volute 0.18.0 → 0.20.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.
Files changed (117) hide show
  1. package/README.md +67 -67
  2. package/dist/activity-events-OMXKXD5N.js +16 -0
  3. package/dist/archive-ZCFOSTKB.js +15 -0
  4. package/dist/{channel-SLURLIRV.js → channel-PUQKGSQM.js} +60 -7
  5. package/dist/{chunk-6BDNWYKG.js → chunk-32VR2EOH.js} +2 -2
  6. package/dist/chunk-5XNT2472.js +36 -0
  7. package/dist/{chunk-QJIIHU32.js → chunk-7NO7EV5Z.js} +2 -2
  8. package/dist/{chunk-6DVBMLVN.js → chunk-7UFKREVW.js} +2 -2
  9. package/dist/chunk-AW7P4EVV.js +159 -0
  10. package/dist/{chunk-2Y77MCFG.js → chunk-DYZGP3EW.js} +2 -2
  11. package/dist/{chunk-M77QBTEH.js → chunk-EBGCNDMM.js} +24 -14
  12. package/dist/{chunk-37X7ECMF.js → chunk-FCDU5BFX.js} +1 -1
  13. package/dist/chunk-FGSYHIS3.js +891 -0
  14. package/dist/chunk-GZ7DW4YL.js +97 -0
  15. package/dist/chunk-IKMY5X76.js +375 -0
  16. package/dist/chunk-NSE7VJQA.js +159 -0
  17. package/dist/{chunk-GSPWIM5E.js → chunk-O6ASDHFO.js} +79 -7
  18. package/dist/{chunk-ZCEYUUID.js → chunk-OGXOMR65.js} +2 -1
  19. package/dist/{chunk-AYB7XAWO.js → chunk-PUVXOZ6T.js} +120 -279
  20. package/dist/{chunk-GK4E7LM7.js → chunk-RHEGSQFJ.js} +1 -1
  21. package/dist/{chunk-MVSXRMJJ.js → chunk-SCUDS4US.js} +1 -1
  22. package/dist/chunk-TIWH32HP.js +227 -0
  23. package/dist/{chunk-FW5API7X.js → chunk-UJ6GHNR7.js} +2 -2
  24. package/dist/chunk-UU7A7KLB.js +58 -0
  25. package/dist/{chunk-OYSZNX5I.js → chunk-VDWCHYTS.js} +1 -1
  26. package/dist/{chunk-OJQ47SCA.js → chunk-WC6ZHVRL.js} +1 -1
  27. package/dist/chunk-YUIHSKR6.js +72 -0
  28. package/dist/cli.js +43 -25
  29. package/dist/{connector-3ELFMI2R.js → connector-JBVNZ7VK.js} +6 -6
  30. package/dist/connectors/discord.js +2 -2
  31. package/dist/connectors/slack.js +2 -2
  32. package/dist/connectors/telegram.js +2 -2
  33. package/dist/{create-ZWHCRT5F.js → create-HP4OVVHF.js} +6 -4
  34. package/dist/{daemon-client-ODKDUYDE.js → daemon-client-ITWUCNFO.js} +2 -2
  35. package/dist/{daemon-restart-2HVTHZAT.js → daemon-restart-KPSWNYTH.js} +6 -6
  36. package/dist/daemon.js +2463 -1707
  37. package/dist/db-C2CJ46ZU.js +10 -0
  38. package/dist/{delete-6G6WEX4F.js → delete-BSU7K3RY.js} +1 -1
  39. package/dist/delivery-manager-CSG7LXA4.js +16 -0
  40. package/dist/down-ZY35KMHR.js +14 -0
  41. package/dist/{env-6IDWGBUH.js → env-A3LMO777.js} +6 -6
  42. package/dist/export-6QBUOQGC.js +100 -0
  43. package/dist/file-C57SK5DK.js +204 -0
  44. package/dist/{history-YUEKTJ2N.js → history-WNK3DFUM.js} +6 -6
  45. package/dist/{import-EDGRLIGO.js → import-XEC34Y4Z.js} +3 -3
  46. package/dist/log-PPPZDVEF.js +39 -0
  47. package/dist/{login-ORQDXLBM.js → login-HNH3EUQV.js} +2 -2
  48. package/dist/{logout-XC5AUO5I.js → logout-I5CB5UZS.js} +2 -2
  49. package/dist/{logs-GYOR3L2L.js → logs-SF2IMJN4.js} +6 -6
  50. package/dist/merge-33C237A4.js +46 -0
  51. package/dist/{mind-OJN6RBZW.js → mind-Z7CKD6DG.js} +14 -10
  52. package/dist/mind-activity-tracker-624QLQLC.js +19 -0
  53. package/dist/mind-manager-3DMYKZPB.js +18 -0
  54. package/dist/{package-OKLFO7UY.js → package-4NHAVUUI.js} +5 -3
  55. package/dist/{pages-6IV4VQTU.js → pages-4DGQT7ZA.js} +2 -2
  56. package/dist/{publish-Q4RPSJLL.js → publish-TAJUET4I.js} +22 -5
  57. package/dist/pull-XAEWQJ47.js +39 -0
  58. package/dist/{register-LDE6LRXY.js → register-VSPCMHKX.js} +2 -2
  59. package/dist/{restart-YFAWFS5T.js → restart-IQKMCK5M.js} +6 -6
  60. package/dist/{schedule-AGYLDMNS.js → schedule-FFZG23IW.js} +31 -11
  61. package/dist/schema-GFH6RV3W.js +26 -0
  62. package/dist/{seed-AP4Q7RZ7.js → seed-J43YDKXG.js} +7 -4
  63. package/dist/{send-BNDTLUPM.js → send-KVIZIGCE.js} +8 -8
  64. package/dist/{service-U7MZ2H7F.js → service-LUR7WDO7.js} +6 -6
  65. package/dist/{setup-DJKIZKGW.js → setup-52YRV7VP.js} +23 -7
  66. package/dist/shared-KO35ZM44.js +39 -0
  67. package/dist/{skill-2Y42P4JY.js → skill-BCVNI6TV.js} +6 -6
  68. package/{templates/_base/_skills → dist/skills}/orientation/SKILL.md +1 -1
  69. package/{templates/_base/_skills → dist/skills}/sessions/SKILL.md +2 -2
  70. package/{templates/_base/_skills → dist/skills}/volute-mind/SKILL.md +51 -3
  71. package/dist/{sprout-TJ3BHVOG.js → sprout-QN7Y4VVO.js} +38 -20
  72. package/dist/{start-3YYRXBKP.js → start-I5JYB65M.js} +6 -6
  73. package/dist/{status-VSFZYX7S.js → status-4ESFLGH4.js} +5 -5
  74. package/dist/status-D7E5HHBV.js +35 -0
  75. package/dist/{status-OKNA6AR3.js → status-FU2PFVVF.js} +5 -4
  76. package/dist/{stop-AA5K5LYG.js → stop-NBVKEFQQ.js} +6 -6
  77. package/dist/{up-7B3BWF2U.js → up-FS7CKM6V.js} +5 -5
  78. package/dist/{update-YAGN5ODG.js → update-FJIHDJKM.js} +5 -5
  79. package/dist/{update-check-APLTH4IN.js → update-check-MWE5AH4U.js} +2 -2
  80. package/dist/{upgrade-KXZCQSZN.js → upgrade-AIT24B5I.js} +1 -1
  81. package/dist/{variant-X5QFG6KK.js → variant-63ZWO2W7.js} +4 -4
  82. package/dist/variants-JAGWGBXG.js +26 -0
  83. package/dist/web-assets/assets/index-CUZTZzaW.js +64 -0
  84. package/dist/web-assets/assets/index-adVuCkqy.css +1 -0
  85. package/dist/web-assets/index.html +2 -2
  86. package/drizzle/0010_delivery_queue.sql +12 -0
  87. package/drizzle/0011_rename_human_to_brain.sql +1 -0
  88. package/drizzle/0012_activity.sql +11 -0
  89. package/drizzle/meta/0010_snapshot.json +7 -0
  90. package/drizzle/meta/0011_snapshot.json +7 -0
  91. package/drizzle/meta/0012_snapshot.json +7 -0
  92. package/drizzle/meta/_journal.json +21 -0
  93. package/package.json +5 -3
  94. package/templates/_base/.init/.config/hooks/startup-context.sh +1 -1
  95. package/templates/_base/.init/.config/scripts/session-reader.ts +3 -3
  96. package/templates/_base/home/.config/routes.json +2 -2
  97. package/templates/_base/home/VOLUTE.md +16 -1
  98. package/templates/_base/src/lib/auto-commit.ts +51 -14
  99. package/templates/_base/src/lib/daemon-client.ts +22 -0
  100. package/templates/_base/src/lib/router.ts +123 -1
  101. package/templates/_base/src/lib/transparency.ts +1 -1
  102. package/templates/_base/src/lib/types.ts +4 -0
  103. package/templates/_base/src/lib/volute-server.ts +91 -2
  104. package/templates/claude/.init/.config/routes.json +7 -1
  105. package/templates/claude/src/server.ts +2 -2
  106. package/templates/claude/volute-template.json +1 -2
  107. package/templates/pi/.init/.config/routes.json +7 -1
  108. package/templates/pi/src/agent.ts +12 -6
  109. package/templates/pi/src/lib/session-context-extension.ts +6 -4
  110. package/templates/pi/src/server.ts +2 -0
  111. package/templates/pi/volute-template.json +1 -2
  112. package/dist/chunk-PO5Q2AYN.js +0 -121
  113. package/dist/down-A56B5JLK.js +0 -14
  114. package/dist/mind-manager-Z7O7PN2O.js +0 -15
  115. package/dist/web-assets/assets/index-CtiimdWK.css +0 -1
  116. package/dist/web-assets/assets/index-kt1_EcuO.js +0 -63
  117. /package/{templates/_base/_skills → dist/skills}/memory/SKILL.md +0 -0
@@ -0,0 +1,159 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ mindDir,
4
+ stateDir
5
+ } from "./chunk-EBGCNDMM.js";
6
+
7
+ // src/lib/archive.ts
8
+ import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "fs";
9
+ import { join, relative, resolve } from "path";
10
+ import AdmZip from "adm-zip";
11
+ var EXCLUDED_DIRS = /* @__PURE__ */ new Set(["node_modules", ".variants", ".git"]);
12
+ function walkDir(dir, base, skipSessions) {
13
+ const results = [];
14
+ const baseDir = base ?? dir;
15
+ for (const entry of readdirSync(dir)) {
16
+ const fullPath = resolve(dir, entry);
17
+ const relPath = relative(baseDir, fullPath);
18
+ const stat = statSync(fullPath);
19
+ if (stat.isDirectory()) {
20
+ if (EXCLUDED_DIRS.has(entry)) continue;
21
+ if (skipSessions && relPath === join(".mind", "sessions")) continue;
22
+ results.push(...walkDir(fullPath, baseDir, skipSessions));
23
+ } else {
24
+ results.push(relPath);
25
+ }
26
+ }
27
+ return results;
28
+ }
29
+ function createExportArchive(options) {
30
+ const {
31
+ name,
32
+ template,
33
+ includeEnv = false,
34
+ includeIdentity = false,
35
+ includeConnectors = false,
36
+ includeHistory = false,
37
+ includeSessions = false
38
+ } = options;
39
+ const dir = mindDir(name);
40
+ const state = stateDir(name);
41
+ const zip = new AdmZip();
42
+ const files = walkDir(dir, void 0, includeSessions);
43
+ for (const relPath of files) {
44
+ if (!includeIdentity && relPath.startsWith(join(".mind", "identity"))) continue;
45
+ if (!includeConnectors && relPath.startsWith(join(".mind", "connectors"))) continue;
46
+ const fullPath = resolve(dir, relPath);
47
+ zip.addFile(`mind/${relPath}`, readFileSync(fullPath));
48
+ }
49
+ if (existsSync(state)) {
50
+ const channelsPath = resolve(state, "channels.json");
51
+ if (existsSync(channelsPath)) {
52
+ zip.addFile("state/channels.json", readFileSync(channelsPath));
53
+ }
54
+ }
55
+ if (includeEnv && existsSync(state)) {
56
+ const envPath = resolve(state, "env.json");
57
+ if (existsSync(envPath)) {
58
+ zip.addFile("state/env.json", readFileSync(envPath));
59
+ }
60
+ }
61
+ if (includeSessions) {
62
+ const sessionsDir = resolve(dir, ".mind/sessions");
63
+ if (existsSync(sessionsDir)) {
64
+ for (const file of readdirSync(sessionsDir)) {
65
+ if (!file.endsWith(".json") && !file.endsWith(".jsonl")) continue;
66
+ const fullPath = resolve(sessionsDir, file);
67
+ zip.addFile(`sessions/${file}`, readFileSync(fullPath));
68
+ }
69
+ }
70
+ }
71
+ let voluteVersion = "unknown";
72
+ try {
73
+ const pkgPath = resolve(import.meta.dirname, "../../package.json");
74
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
75
+ voluteVersion = pkg.version;
76
+ } catch {
77
+ }
78
+ const manifest = {
79
+ version: 1,
80
+ name,
81
+ template,
82
+ voluteVersion,
83
+ exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
84
+ includes: {
85
+ env: includeEnv,
86
+ identity: includeIdentity,
87
+ connectors: includeConnectors,
88
+ history: includeHistory,
89
+ sessions: includeSessions
90
+ }
91
+ };
92
+ zip.addFile("manifest.json", Buffer.from(`${JSON.stringify(manifest, null, 2)}
93
+ `));
94
+ return zip;
95
+ }
96
+ function addHistoryToArchive(zip, rows) {
97
+ if (rows.length === 0) return;
98
+ const lines = `${rows.map((r) => JSON.stringify(r)).join("\n")}
99
+ `;
100
+ zip.addFile("history.jsonl", Buffer.from(lines));
101
+ }
102
+ function readManifest(archivePath) {
103
+ const zip = new AdmZip(archivePath);
104
+ const entry = zip.getEntry("manifest.json");
105
+ if (!entry) {
106
+ throw new Error("Invalid archive: missing manifest.json");
107
+ }
108
+ const manifest = JSON.parse(entry.getData().toString("utf-8"));
109
+ if (manifest.version !== 1) {
110
+ throw new Error(`Unsupported archive version: ${manifest.version}`);
111
+ }
112
+ return manifest;
113
+ }
114
+ function extractArchive(archivePath, destDir) {
115
+ const zip = new AdmZip(archivePath);
116
+ const manifestEntry = zip.getEntry("manifest.json");
117
+ if (!manifestEntry) {
118
+ throw new Error("Invalid archive: missing manifest.json");
119
+ }
120
+ const manifest = JSON.parse(manifestEntry.getData().toString("utf-8"));
121
+ if (manifest.version !== 1) {
122
+ throw new Error(`Unsupported archive version: ${manifest.version}`);
123
+ }
124
+ const normalizedDestDir = resolve(destDir);
125
+ const extractedMindDir = resolve(normalizedDestDir, "mind");
126
+ const extractedStateDir = resolve(normalizedDestDir, "state");
127
+ mkdirSync(extractedMindDir, { recursive: true });
128
+ mkdirSync(extractedStateDir, { recursive: true });
129
+ for (const entry of zip.getEntries()) {
130
+ if (entry.isDirectory) continue;
131
+ const name = entry.entryName;
132
+ if (name === "manifest.json") continue;
133
+ const destPath = resolve(normalizedDestDir, name);
134
+ if (!destPath.startsWith(`${normalizedDestDir}/`)) {
135
+ throw new Error(`Archive contains path traversal entry: ${name}`);
136
+ }
137
+ mkdirSync(resolve(destPath, ".."), { recursive: true });
138
+ writeFileSync(destPath, entry.getData());
139
+ }
140
+ const channelsJson = resolve(extractedStateDir, "channels.json");
141
+ const envJson = resolve(extractedStateDir, "env.json");
142
+ const historyJsonl = resolve(normalizedDestDir, "history.jsonl");
143
+ const sessionsDir = resolve(normalizedDestDir, "sessions");
144
+ return {
145
+ manifest,
146
+ mindDir: extractedMindDir,
147
+ channelsJson: existsSync(channelsJson) ? channelsJson : null,
148
+ envJson: existsSync(envJson) ? envJson : null,
149
+ historyJsonl: existsSync(historyJsonl) ? historyJsonl : null,
150
+ sessionsDir: existsSync(sessionsDir) ? sessionsDir : null
151
+ };
152
+ }
153
+
154
+ export {
155
+ createExportArchive,
156
+ addHistoryToArchive,
157
+ readManifest,
158
+ extractArchive
159
+ };
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  wrapForIsolation
4
- } from "./chunk-ZCEYUUID.js";
4
+ } from "./chunk-OGXOMR65.js";
5
5
 
6
6
  // src/lib/exec.ts
7
7
  import { execFile as execFileCb, execFileSync, spawn } from "child_process";
@@ -24,7 +24,7 @@ function exec(cmd, args, options) {
24
24
  });
25
25
  }
26
26
  function gitExec(args, options) {
27
- const fullArgs = process.env.VOLUTE_ISOLATION === "user" ? ["-c", `safe.directory=${options.cwd}`, ...args] : args;
27
+ const fullArgs = process.env.VOLUTE_ISOLATION === "user" ? ["-c", "safe.directory=*", ...args] : args;
28
28
  return exec("git", fullArgs, options);
29
29
  }
30
30
  function resolveVoluteBin() {
@@ -9,6 +9,24 @@ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "
9
9
  import { homedir } from "os";
10
10
  import { dirname, resolve } from "path";
11
11
  import { fileURLToPath } from "url";
12
+ var registryCache = null;
13
+ function initRegistryCache() {
14
+ registryCache = readRegistryFromDisk();
15
+ }
16
+ function readRegistryFromDisk() {
17
+ const registryPath = resolve(voluteHome(), "minds.json");
18
+ if (!existsSync(registryPath)) return [];
19
+ try {
20
+ const entries = JSON.parse(readFileSync(registryPath, "utf-8"));
21
+ return entries.map((e) => ({
22
+ ...e,
23
+ running: e.running ?? false,
24
+ stage: e.stage ?? "sprouted"
25
+ }));
26
+ } catch {
27
+ return [];
28
+ }
29
+ }
12
30
  function voluteHome() {
13
31
  if (process.env.VOLUTE_HOME) return process.env.VOLUTE_HOME;
14
32
  const dir = dirname(fileURLToPath(import.meta.url));
@@ -24,20 +42,11 @@ function ensureVoluteHome() {
24
42
  mkdirSync(mindsBase, { recursive: true });
25
43
  }
26
44
  function readRegistry() {
27
- const registryPath = resolve(voluteHome(), "minds.json");
28
- if (!existsSync(registryPath)) return [];
29
- try {
30
- const entries = JSON.parse(readFileSync(registryPath, "utf-8"));
31
- return entries.map((e) => ({
32
- ...e,
33
- running: e.running ?? false,
34
- stage: e.stage ?? "sprouted"
35
- }));
36
- } catch {
37
- return [];
38
- }
45
+ if (registryCache) return registryCache;
46
+ return readRegistryFromDisk();
39
47
  }
40
48
  function writeRegistry(entries) {
49
+ if (registryCache) registryCache = entries;
41
50
  ensureVoluteHome();
42
51
  const registryPath = resolve(voluteHome(), "minds.json");
43
52
  const tmpPath = `${registryPath}.tmp`;
@@ -55,12 +64,12 @@ function validateMindName(name) {
55
64
  }
56
65
  return null;
57
66
  }
58
- function addMind(name, port, stage) {
67
+ function addMind(name, port, stage, template) {
59
68
  const err = validateMindName(name);
60
69
  if (err) throw new Error(err);
61
70
  const entries = readRegistry();
62
71
  const filtered = entries.filter((e) => e.name !== name);
63
- filtered.push({ name, port, created: (/* @__PURE__ */ new Date()).toISOString(), running: false, stage });
72
+ filtered.push({ name, port, created: (/* @__PURE__ */ new Date()).toISOString(), running: false, stage, template });
64
73
  writeRegistry(filtered);
65
74
  }
66
75
  function removeMind(name) {
@@ -242,6 +251,7 @@ export {
242
251
  removeAllVariants,
243
252
  checkHealth,
244
253
  validateBranchName,
254
+ initRegistryCache,
245
255
  voluteHome,
246
256
  ensureVoluteHome,
247
257
  readRegistry,
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  voluteHome
4
- } from "./chunk-M77QBTEH.js";
4
+ } from "./chunk-EBGCNDMM.js";
5
5
 
6
6
  // src/lib/systems-config.ts
7
7
  import { existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "fs";