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.
- package/README.md +67 -67
- package/dist/activity-events-OMXKXD5N.js +16 -0
- package/dist/archive-ZCFOSTKB.js +15 -0
- package/dist/{channel-SLURLIRV.js → channel-PUQKGSQM.js} +60 -7
- package/dist/{chunk-6BDNWYKG.js → chunk-32VR2EOH.js} +2 -2
- package/dist/chunk-5XNT2472.js +36 -0
- package/dist/{chunk-QJIIHU32.js → chunk-7NO7EV5Z.js} +2 -2
- package/dist/{chunk-6DVBMLVN.js → chunk-7UFKREVW.js} +2 -2
- package/dist/chunk-AW7P4EVV.js +159 -0
- package/dist/{chunk-2Y77MCFG.js → chunk-DYZGP3EW.js} +2 -2
- package/dist/{chunk-M77QBTEH.js → chunk-EBGCNDMM.js} +24 -14
- package/dist/{chunk-37X7ECMF.js → chunk-FCDU5BFX.js} +1 -1
- package/dist/chunk-FGSYHIS3.js +891 -0
- package/dist/chunk-GZ7DW4YL.js +97 -0
- package/dist/chunk-IKMY5X76.js +375 -0
- package/dist/chunk-NSE7VJQA.js +159 -0
- package/dist/{chunk-GSPWIM5E.js → chunk-O6ASDHFO.js} +79 -7
- package/dist/{chunk-ZCEYUUID.js → chunk-OGXOMR65.js} +2 -1
- package/dist/{chunk-AYB7XAWO.js → chunk-PUVXOZ6T.js} +120 -279
- package/dist/{chunk-GK4E7LM7.js → chunk-RHEGSQFJ.js} +1 -1
- package/dist/{chunk-MVSXRMJJ.js → chunk-SCUDS4US.js} +1 -1
- package/dist/chunk-TIWH32HP.js +227 -0
- package/dist/{chunk-FW5API7X.js → chunk-UJ6GHNR7.js} +2 -2
- package/dist/chunk-UU7A7KLB.js +58 -0
- package/dist/{chunk-OYSZNX5I.js → chunk-VDWCHYTS.js} +1 -1
- package/dist/{chunk-OJQ47SCA.js → chunk-WC6ZHVRL.js} +1 -1
- package/dist/chunk-YUIHSKR6.js +72 -0
- package/dist/cli.js +43 -25
- package/dist/{connector-3ELFMI2R.js → connector-JBVNZ7VK.js} +6 -6
- package/dist/connectors/discord.js +2 -2
- package/dist/connectors/slack.js +2 -2
- package/dist/connectors/telegram.js +2 -2
- package/dist/{create-ZWHCRT5F.js → create-HP4OVVHF.js} +6 -4
- package/dist/{daemon-client-ODKDUYDE.js → daemon-client-ITWUCNFO.js} +2 -2
- package/dist/{daemon-restart-2HVTHZAT.js → daemon-restart-KPSWNYTH.js} +6 -6
- package/dist/daemon.js +2463 -1707
- package/dist/db-C2CJ46ZU.js +10 -0
- package/dist/{delete-6G6WEX4F.js → delete-BSU7K3RY.js} +1 -1
- package/dist/delivery-manager-CSG7LXA4.js +16 -0
- package/dist/down-ZY35KMHR.js +14 -0
- package/dist/{env-6IDWGBUH.js → env-A3LMO777.js} +6 -6
- package/dist/export-6QBUOQGC.js +100 -0
- package/dist/file-C57SK5DK.js +204 -0
- package/dist/{history-YUEKTJ2N.js → history-WNK3DFUM.js} +6 -6
- package/dist/{import-EDGRLIGO.js → import-XEC34Y4Z.js} +3 -3
- package/dist/log-PPPZDVEF.js +39 -0
- package/dist/{login-ORQDXLBM.js → login-HNH3EUQV.js} +2 -2
- package/dist/{logout-XC5AUO5I.js → logout-I5CB5UZS.js} +2 -2
- package/dist/{logs-GYOR3L2L.js → logs-SF2IMJN4.js} +6 -6
- package/dist/merge-33C237A4.js +46 -0
- package/dist/{mind-OJN6RBZW.js → mind-Z7CKD6DG.js} +14 -10
- package/dist/mind-activity-tracker-624QLQLC.js +19 -0
- package/dist/mind-manager-3DMYKZPB.js +18 -0
- package/dist/{package-OKLFO7UY.js → package-4NHAVUUI.js} +5 -3
- package/dist/{pages-6IV4VQTU.js → pages-4DGQT7ZA.js} +2 -2
- package/dist/{publish-Q4RPSJLL.js → publish-TAJUET4I.js} +22 -5
- package/dist/pull-XAEWQJ47.js +39 -0
- package/dist/{register-LDE6LRXY.js → register-VSPCMHKX.js} +2 -2
- package/dist/{restart-YFAWFS5T.js → restart-IQKMCK5M.js} +6 -6
- package/dist/{schedule-AGYLDMNS.js → schedule-FFZG23IW.js} +31 -11
- package/dist/schema-GFH6RV3W.js +26 -0
- package/dist/{seed-AP4Q7RZ7.js → seed-J43YDKXG.js} +7 -4
- package/dist/{send-BNDTLUPM.js → send-KVIZIGCE.js} +8 -8
- package/dist/{service-U7MZ2H7F.js → service-LUR7WDO7.js} +6 -6
- package/dist/{setup-DJKIZKGW.js → setup-52YRV7VP.js} +23 -7
- package/dist/shared-KO35ZM44.js +39 -0
- package/dist/{skill-2Y42P4JY.js → skill-BCVNI6TV.js} +6 -6
- package/{templates/_base/_skills → dist/skills}/orientation/SKILL.md +1 -1
- package/{templates/_base/_skills → dist/skills}/sessions/SKILL.md +2 -2
- package/{templates/_base/_skills → dist/skills}/volute-mind/SKILL.md +51 -3
- package/dist/{sprout-TJ3BHVOG.js → sprout-QN7Y4VVO.js} +38 -20
- package/dist/{start-3YYRXBKP.js → start-I5JYB65M.js} +6 -6
- package/dist/{status-VSFZYX7S.js → status-4ESFLGH4.js} +5 -5
- package/dist/status-D7E5HHBV.js +35 -0
- package/dist/{status-OKNA6AR3.js → status-FU2PFVVF.js} +5 -4
- package/dist/{stop-AA5K5LYG.js → stop-NBVKEFQQ.js} +6 -6
- package/dist/{up-7B3BWF2U.js → up-FS7CKM6V.js} +5 -5
- package/dist/{update-YAGN5ODG.js → update-FJIHDJKM.js} +5 -5
- package/dist/{update-check-APLTH4IN.js → update-check-MWE5AH4U.js} +2 -2
- package/dist/{upgrade-KXZCQSZN.js → upgrade-AIT24B5I.js} +1 -1
- package/dist/{variant-X5QFG6KK.js → variant-63ZWO2W7.js} +4 -4
- package/dist/variants-JAGWGBXG.js +26 -0
- package/dist/web-assets/assets/index-CUZTZzaW.js +64 -0
- package/dist/web-assets/assets/index-adVuCkqy.css +1 -0
- package/dist/web-assets/index.html +2 -2
- package/drizzle/0010_delivery_queue.sql +12 -0
- package/drizzle/0011_rename_human_to_brain.sql +1 -0
- package/drizzle/0012_activity.sql +11 -0
- package/drizzle/meta/0010_snapshot.json +7 -0
- package/drizzle/meta/0011_snapshot.json +7 -0
- package/drizzle/meta/0012_snapshot.json +7 -0
- package/drizzle/meta/_journal.json +21 -0
- package/package.json +5 -3
- package/templates/_base/.init/.config/hooks/startup-context.sh +1 -1
- package/templates/_base/.init/.config/scripts/session-reader.ts +3 -3
- package/templates/_base/home/.config/routes.json +2 -2
- package/templates/_base/home/VOLUTE.md +16 -1
- package/templates/_base/src/lib/auto-commit.ts +51 -14
- package/templates/_base/src/lib/daemon-client.ts +22 -0
- package/templates/_base/src/lib/router.ts +123 -1
- package/templates/_base/src/lib/transparency.ts +1 -1
- package/templates/_base/src/lib/types.ts +4 -0
- package/templates/_base/src/lib/volute-server.ts +91 -2
- package/templates/claude/.init/.config/routes.json +7 -1
- package/templates/claude/src/server.ts +2 -2
- package/templates/claude/volute-template.json +1 -2
- package/templates/pi/.init/.config/routes.json +7 -1
- package/templates/pi/src/agent.ts +12 -6
- package/templates/pi/src/lib/session-context-extension.ts +6 -4
- package/templates/pi/src/server.ts +2 -0
- package/templates/pi/volute-template.json +1 -2
- package/dist/chunk-PO5Q2AYN.js +0 -121
- package/dist/down-A56B5JLK.js +0 -14
- package/dist/mind-manager-Z7O7PN2O.js +0 -15
- package/dist/web-assets/assets/index-CtiimdWK.css +0 -1
- package/dist/web-assets/assets/index-kt1_EcuO.js +0 -63
- /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-
|
|
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",
|
|
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
|
-
|
|
28
|
-
|
|
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,
|