@sesamespace/hivemind 0.5.4 → 0.5.7

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.
Files changed (86) hide show
  1. package/.github/workflows/memory-release.yml +89 -0
  2. package/config/default.toml +12 -0
  3. package/dist/{chunk-YHRGEWAZ.js → chunk-4U4GKI3X.js} +121 -34
  4. package/dist/chunk-4U4GKI3X.js.map +1 -0
  5. package/{packages/cli/src/commands/start.ts → dist/chunk-62S2NGMN.js} +39 -38
  6. package/dist/chunk-62S2NGMN.js.map +1 -0
  7. package/dist/{chunk-CGSXJVSS.js → chunk-7RTJSPMX.js} +2 -2
  8. package/dist/chunk-IJRAVHQC.js +327 -0
  9. package/dist/chunk-IJRAVHQC.js.map +1 -0
  10. package/dist/{chunk-MHDLSAJ3.js → chunk-JXLLCKMG.js} +102 -5
  11. package/dist/chunk-JXLLCKMG.js.map +1 -0
  12. package/dist/{chunk-SJI2KAIN.js → chunk-LJHJGDKY.js} +8 -2
  13. package/dist/chunk-LJHJGDKY.js.map +1 -0
  14. package/dist/{chunk-LNV373IF.js → chunk-LSOEUOTO.js} +2 -2
  15. package/dist/{chunk-S3RVZBPZ.js → chunk-PFN3BITA.js} +322 -2
  16. package/dist/chunk-PFN3BITA.js.map +1 -0
  17. package/dist/commands/fleet.js +3 -3
  18. package/dist/commands/init.js +1 -1
  19. package/dist/commands/service.js +1 -1
  20. package/dist/commands/start.js +3 -3
  21. package/dist/commands/upgrade.js +1 -1
  22. package/dist/commands/watchdog.js +10 -0
  23. package/dist/commands/watchdog.js.map +1 -0
  24. package/dist/index.js +6 -2
  25. package/dist/main.js +22 -12
  26. package/dist/main.js.map +1 -1
  27. package/dist/start.js +1 -1
  28. package/package.json +4 -3
  29. package/PLANNING.md +0 -383
  30. package/TASKS.md +0 -60
  31. package/dist/chunk-MHDLSAJ3.js.map +0 -1
  32. package/dist/chunk-PPQGQHXJ.js +0 -151
  33. package/dist/chunk-PPQGQHXJ.js.map +0 -1
  34. package/dist/chunk-S3RVZBPZ.js.map +0 -1
  35. package/dist/chunk-SJI2KAIN.js.map +0 -1
  36. package/dist/chunk-YHRGEWAZ.js.map +0 -1
  37. package/install.sh +0 -120
  38. package/npm-package.json +0 -26
  39. package/packages/cli/package.json +0 -23
  40. package/packages/cli/src/commands/fleet.ts +0 -206
  41. package/packages/cli/src/commands/init.ts +0 -252
  42. package/packages/cli/src/commands/service.ts +0 -159
  43. package/packages/cli/src/commands/upgrade.ts +0 -158
  44. package/packages/cli/src/main.ts +0 -64
  45. package/packages/cli/tsconfig.json +0 -8
  46. package/packages/memory/Cargo.lock +0 -6480
  47. package/packages/memory/Cargo.toml +0 -21
  48. package/packages/memory/src/context.rs +0 -179
  49. package/packages/memory/src/embeddings.rs +0 -51
  50. package/packages/memory/src/main.rs +0 -626
  51. package/packages/memory/src/promotion.rs +0 -637
  52. package/packages/memory/src/scoring.rs +0 -131
  53. package/packages/memory/src/store.rs +0 -460
  54. package/packages/memory/src/tasks.rs +0 -321
  55. package/packages/runtime/package.json +0 -24
  56. package/packages/runtime/src/__tests__/fleet-integration.test.ts +0 -235
  57. package/packages/runtime/src/__tests__/fleet.test.ts +0 -207
  58. package/packages/runtime/src/__tests__/integration.test.ts +0 -434
  59. package/packages/runtime/src/agent.ts +0 -255
  60. package/packages/runtime/src/config.ts +0 -130
  61. package/packages/runtime/src/context.ts +0 -192
  62. package/packages/runtime/src/fleet/fleet-manager.ts +0 -399
  63. package/packages/runtime/src/fleet/memory-sync.ts +0 -362
  64. package/packages/runtime/src/fleet/primary-client.ts +0 -285
  65. package/packages/runtime/src/fleet/worker-protocol.ts +0 -158
  66. package/packages/runtime/src/fleet/worker-server.ts +0 -246
  67. package/packages/runtime/src/index.ts +0 -57
  68. package/packages/runtime/src/llm-client.ts +0 -65
  69. package/packages/runtime/src/memory-client.ts +0 -309
  70. package/packages/runtime/src/pipeline.ts +0 -187
  71. package/packages/runtime/src/prompt.ts +0 -173
  72. package/packages/runtime/src/sesame.ts +0 -226
  73. package/packages/runtime/src/start.ts +0 -20
  74. package/packages/runtime/src/task-engine.ts +0 -113
  75. package/packages/runtime/src/worker.ts +0 -339
  76. package/packages/runtime/tsconfig.json +0 -8
  77. package/pnpm-workspace.yaml +0 -2
  78. package/run-aidan.sh +0 -23
  79. package/scripts/bootstrap.sh +0 -196
  80. package/scripts/build-npm.sh +0 -92
  81. package/scripts/com.hivemind.agent.plist +0 -44
  82. package/scripts/com.hivemind.memory.plist +0 -31
  83. package/tsconfig.json +0 -22
  84. package/tsup.config.ts +0 -27
  85. /package/dist/{chunk-CGSXJVSS.js.map → chunk-7RTJSPMX.js.map} +0 -0
  86. /package/dist/{chunk-LNV373IF.js.map → chunk-LSOEUOTO.js.map} +0 -0
@@ -1,158 +0,0 @@
1
- import { execSync } from "child_process";
2
- import { resolve } from "path";
3
- import { existsSync, readFileSync } from "fs";
4
-
5
- const PACKAGE_NAME = "@sesamespace/hivemind";
6
-
7
- interface VersionInfo {
8
- current: string;
9
- latest: string;
10
- updateAvailable: boolean;
11
- }
12
-
13
- function getCurrentVersion(): string {
14
- try {
15
- // Check the installed package version
16
- const output = execSync(`npm ls -g ${PACKAGE_NAME} --json 2>/dev/null`, { encoding: "utf-8" });
17
- const parsed = JSON.parse(output);
18
- const deps = parsed.dependencies?.[PACKAGE_NAME];
19
- if (deps?.version) return deps.version;
20
- } catch {
21
- // Fallback: read from the package.json in the hivemind dir
22
- }
23
-
24
- const hivemindHome = process.env.HIVEMIND_HOME || resolve(process.env.HOME || "~", "hivemind");
25
- const pkgPath = resolve(hivemindHome, "node_modules", PACKAGE_NAME, "package.json");
26
- if (existsSync(pkgPath)) {
27
- try {
28
- return JSON.parse(readFileSync(pkgPath, "utf-8")).version;
29
- } catch {
30
- // fall through
31
- }
32
- }
33
-
34
- return "unknown";
35
- }
36
-
37
- function getLatestVersion(target?: string): string {
38
- try {
39
- const tag = target || "latest";
40
- const output = execSync(`npm view ${PACKAGE_NAME}@${tag} version 2>/dev/null`, { encoding: "utf-8" });
41
- return output.trim();
42
- } catch {
43
- throw new Error("Failed to check npm registry for latest version");
44
- }
45
- }
46
-
47
- async function checkVersion(target?: string): Promise<VersionInfo> {
48
- const current = getCurrentVersion();
49
- const latest = target || getLatestVersion();
50
- return {
51
- current,
52
- latest,
53
- updateAvailable: current !== latest && current !== "unknown",
54
- };
55
- }
56
-
57
- export async function runUpgradeCommand(args: string[]): Promise<void> {
58
- const checkOnly = args.includes("--check") || args.includes("-c");
59
- const force = args.includes("--force") || args.includes("-f");
60
- const dryRun = args.includes("--dry-run") || args.includes("-n");
61
-
62
- // Target version (optional positional arg)
63
- const targetVersion = args.find((a) => !a.startsWith("-"));
64
-
65
- if (args.includes("--help") || args.includes("-h")) {
66
- printHelp();
67
- return;
68
- }
69
-
70
- console.log(`
71
- ╦ ╦╦╦ ╦╔═╗╔╦╗╦╔╗╔╔╦╗
72
- ╠═╣║╚╗╔╝║╣ ║║║║║║║ ║║
73
- ╩ ╩╩ ╚╝ ╚═╝╩ ╩╩╝╚╝═╩╝
74
- Agent Upgrade
75
- `);
76
-
77
- // --- Check versions ---
78
- console.log("→ Checking versions...");
79
- const info = await checkVersion(targetVersion);
80
- console.log(` Current: ${info.current}`);
81
- console.log(` Latest: ${info.latest}`);
82
-
83
- if (!info.updateAvailable && !force) {
84
- console.log("\n ✓ Already up to date!");
85
- return;
86
- }
87
-
88
- if (info.updateAvailable) {
89
- console.log(`\n ⬆ Update available: ${info.current} → ${info.latest}`);
90
- }
91
-
92
- if (checkOnly) {
93
- return;
94
- }
95
-
96
- // --- Perform upgrade ---
97
- const target = targetVersion ? `${PACKAGE_NAME}@${targetVersion}` : `${PACKAGE_NAME}@latest`;
98
-
99
- if (dryRun) {
100
- console.log(`\n→ [dry-run] Would run: npm install -g ${target}`);
101
- console.log("→ [dry-run] Would restart the agent service");
102
- return;
103
- }
104
-
105
- console.log(`\n→ Installing ${target}...`);
106
- try {
107
- execSync(`npm install -g ${target}`, { stdio: "inherit" });
108
- console.log(" ✓ Package updated");
109
- } catch (err) {
110
- console.error(` ✗ npm install failed: ${(err as Error).message}`);
111
- process.exit(1);
112
- }
113
-
114
- // --- Restart agent ---
115
- console.log("\n→ Restarting agent...");
116
- try {
117
- // Try launchctl first (macOS service)
118
- const plistName = "com.hivemind.agent";
119
- execSync(`launchctl list ${plistName} 2>/dev/null`, { encoding: "utf-8" });
120
- // Service exists — restart it
121
- execSync(`launchctl kickstart -k gui/$(id -u)/${plistName}`, { stdio: "inherit" });
122
- console.log(" ✓ Agent restarted via launchd");
123
- } catch {
124
- // No launchd service — try finding and restarting the process
125
- try {
126
- execSync("pkill -f 'hivemind start'", { stdio: "inherit" });
127
- console.log(" ✓ Old process killed");
128
- console.log(" ! Start the agent manually: hivemind start");
129
- } catch {
130
- console.log(" ! No running agent found — start manually: hivemind start");
131
- }
132
- }
133
-
134
- // --- Verify ---
135
- const newVersion = getCurrentVersion();
136
- console.log(`\n ✓ Upgrade complete: ${info.current} → ${newVersion}`);
137
- }
138
-
139
- function printHelp(): void {
140
- console.log(`hivemind upgrade — Upgrade the Hivemind agent runtime
141
-
142
- Usage: hivemind upgrade [version] [options]
143
-
144
- Arguments:
145
- version Target version (default: latest)
146
-
147
- Options:
148
- -c, --check Check for updates only (don't install)
149
- -f, --force Force reinstall even if up to date
150
- -n, --dry-run Show what would happen without doing it
151
- -h, --help Show this help
152
-
153
- Examples:
154
- hivemind upgrade # Upgrade to latest
155
- hivemind upgrade 0.3.0 # Upgrade to specific version
156
- hivemind upgrade --check # Just check if update available
157
- `);
158
- }
@@ -1,64 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import { runFleetCommand } from "./commands/fleet.js";
4
- import { runStartCommand } from "./commands/start.js";
5
- import { runInitCommand } from "./commands/init.js";
6
- import { runServiceCommand } from "./commands/service.js";
7
- import { runUpgradeCommand } from "./commands/upgrade.js";
8
-
9
- const [command, ...args] = process.argv.slice(2);
10
-
11
- switch (command) {
12
- case "init":
13
- runInitCommand(args).catch((err) => {
14
- console.error(err instanceof Error ? err.message : String(err));
15
- process.exit(1);
16
- });
17
- break;
18
-
19
- case "start":
20
- runStartCommand(args).catch((err) => {
21
- console.error(err instanceof Error ? err.message : String(err));
22
- process.exit(1);
23
- });
24
- break;
25
-
26
- case "service":
27
- runServiceCommand(args).catch((err) => {
28
- console.error(err instanceof Error ? err.message : String(err));
29
- process.exit(1);
30
- });
31
- break;
32
-
33
- case "fleet":
34
- runFleetCommand(args).catch((err) => {
35
- console.error(err instanceof Error ? err.message : String(err));
36
- process.exit(1);
37
- });
38
- break;
39
-
40
- case "upgrade":
41
- runUpgradeCommand(args).catch((err) => {
42
- console.error(err instanceof Error ? err.message : String(err));
43
- process.exit(1);
44
- });
45
- break;
46
-
47
- default:
48
- console.log(`hivemind cli v0.3.0
49
-
50
- Usage: hivemind <command> [args]
51
-
52
- Commands:
53
- init Initialize agent from Sesame API key
54
- start Start the Hivemind agent
55
- upgrade Upgrade the Hivemind runtime
56
- service Manage launchd services (install/uninstall/status/logs)
57
- fleet Manage the worker fleet
58
- `);
59
- if (command) {
60
- console.error(`Unknown command: ${command}`);
61
- process.exit(1);
62
- }
63
- break;
64
- }
@@ -1,8 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "dist",
5
- "rootDir": "src"
6
- },
7
- "include": ["src"]
8
- }