volute 0.35.0 → 0.37.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/dist/{accept-ZBDVVCEU.js → accept-AHAOUFBK.js} +4 -4
- package/dist/activity-events-N6HCHU4P.js +15 -0
- package/dist/{ai-service-LURBEDDB.js → ai-service-C2YNARGH.js} +6 -6
- package/dist/{api-client-3A77HMH7.js → api-client-LC5YRA32.js} +1 -1
- package/dist/{archive-ESU2FUN4.js → archive-AWIJTVQV.js} +4 -4
- package/dist/{auth-WX4TESEI.js → auth-2QOOPMBX.js} +6 -6
- package/dist/{bridge-PXIO6PS2.js → bridge-F3ZJEKDN.js} +4 -4
- package/dist/{chat-QXAJF3FU.js → chat-5Y4FD77E.js} +9 -9
- package/dist/{chunk-BDYXIWA5.js → chunk-2NHRJ3YO.js} +13 -2
- package/dist/{chunk-AN2W47GW.js → chunk-3F7XK5Q7.js} +2 -2
- package/dist/{chunk-AOB6GVRM.js → chunk-46DYYHN6.js} +8 -3
- package/dist/{chunk-WZRZFFCL.js → chunk-5DPRTREW.js} +146 -186
- package/dist/{chunk-QWTR6AWZ.js → chunk-7AZQFSOV.js} +2 -2
- package/dist/{chunk-BMZQYACC.js → chunk-A6FLW5XD.js} +19 -4
- package/dist/{chunk-N5LMGYXX.js → chunk-BIEWHAAM.js} +2 -2
- package/dist/{chunk-5N7Y5WAM.js → chunk-CJ26DXZL.js} +29 -13
- package/dist/{chunk-ZSR72JB3.js → chunk-CU6OFXMM.js} +1 -1
- package/dist/{chunk-N446KRP7.js → chunk-GVVVMZ4J.js} +2 -2
- package/dist/chunk-K3NQKI34.js +10 -0
- package/dist/{chunk-F7ZNLYKZ.js → chunk-KAB6UGOL.js} +2 -2
- package/dist/{chunk-WJPROOU5.js → chunk-KBRGHKVU.js} +681 -3726
- package/dist/{chunk-PWQ2ITYG.js → chunk-KXXJYY62.js} +6 -6
- package/dist/{chunk-NJK5SDGR.js → chunk-LGNUFVMR.js} +1 -1
- package/dist/chunk-LQ6Z4FXN.js +87 -0
- package/dist/{chunk-J6CJQDWI.js → chunk-MQRS4J24.js} +2 -2
- package/dist/{chunk-CORXD635.js → chunk-N42QMDID.js} +3 -3
- package/dist/{chunk-IJHIXLVN.js → chunk-NYP3LBIV.js} +15 -13
- package/dist/{chunk-FT5KETXZ.js → chunk-ORNY3MZR.js} +4 -4
- package/dist/{chunk-A2ZLHBHG.js → chunk-PMMHVSCR.js} +2 -2
- package/dist/chunk-QQQI6ISK.js +853 -0
- package/dist/chunk-RG5TOL4O.js +18 -0
- package/dist/{chunk-VHJRZM2S.js → chunk-SNW2NPP4.js} +2 -2
- package/dist/chunk-SZJWC2GA.js +125 -0
- package/dist/{chunk-BKF4WQCY.js → chunk-T2TP6ZC6.js} +20 -8
- package/dist/{chunk-2TGZJFAT.js → chunk-TNZ5XQA4.js} +3 -3
- package/dist/{chunk-QCH6K235.js → chunk-UI7RPV2B.js} +1 -1
- package/dist/{chunk-XRQSAMX2.js → chunk-UIM5NHPP.js} +3 -3
- package/dist/{chunk-5XJYUFZH.js → chunk-UQFYNZKT.js} +76 -30
- package/dist/{chunk-OTC67N2Z.js → chunk-WC635OPK.js} +1 -1
- package/dist/{chunk-BV65KRHM.js → chunk-XLBQYIHH.js} +2 -2
- package/dist/{chunk-VY3RB2V7.js → chunk-Z6TIXE77.js} +3 -3
- package/dist/cli.js +24 -24
- package/dist/{clock-HSEKS5AR.js → clock-BMLJ2TR6.js} +8 -8
- package/dist/{cloud-sync-6JL4C24T.js → cloud-sync-OIX576NA.js} +20 -21
- package/dist/{config-UTS7QULS.js → config-QB7W3Z7P.js} +4 -4
- package/dist/connectors/discord-bridge.js +4 -4
- package/dist/connectors/slack-bridge.js +4 -4
- package/dist/connectors/telegram-bridge.js +4 -4
- package/dist/{conversations-2PW57WO2.js → conversations-G6YRSABR.js} +16 -10
- package/dist/{create-5BPOOJAN.js → create-C3BBFYV7.js} +4 -4
- package/dist/{create-UVCK2CS6.js → create-PN73742N.js} +4 -4
- package/dist/{daemon-client-RVIKXGFQ.js → daemon-client-2MIPKY3E.js} +1 -1
- package/dist/{daemon-restart-HSZ3BCX5.js → daemon-restart-L2O6L7NR.js} +9 -9
- package/dist/daemon.js +690 -1281
- package/dist/db-CBOCDYVA.js +9 -0
- package/dist/{db-BDMH4SZ2.js → db-IJL6B26S.js} +1 -1
- package/dist/{delete-L5PAVDGQ.js → delete-NLXES2C7.js} +3 -3
- package/dist/delivery-manager-4PVBUZJB.js +30 -0
- package/dist/{delivery-router-HEJSJAHQ.js → delivery-router-QTFEZ26O.js} +5 -5
- package/dist/down-25L2RKCQ.js +17 -0
- package/dist/echo-text-T5ZLGMA7.js +31 -0
- package/dist/{env-E4XHO2BI.js → env-IQ6Q2333.js} +6 -6
- package/dist/exec-ONYZEA5B.js +17 -0
- package/dist/{export-OAS6QVBN.js → export-JPDBQESV.js} +6 -6
- package/dist/{extension-D74CNM7G.js → extension-LZYHBNLV.js} +26 -7
- package/dist/extensions-CLYXNGYB.js +50 -0
- package/dist/{files-CWTK6V3H.js → files-LAQ3NXQK.js} +7 -7
- package/dist/{import-5A3T7QV4.js → import-EROF27RH.js} +12 -11
- package/dist/{isolation-TK5RX2WM.js → isolation-G5J3MTKU.js} +4 -4
- package/dist/{join-DF5XSJAC.js → join-6SZCA5FX.js} +3 -3
- package/dist/{list-PDMQM7ZV.js → list-KHJZJPEJ.js} +11 -5
- package/dist/{login-7TE6CIZF.js → login-F6YMAVLE.js} +6 -6
- package/dist/{login-GOTAYLXP.js → login-GYTH67ES.js} +4 -4
- package/dist/{logout-T4XS6LRU.js → logout-HHPH52KZ.js} +6 -6
- package/dist/{logout-6KIA74EV.js → logout-YHQLOFLR.js} +4 -4
- package/dist/message-delivery-N2V5APCS.js +40 -0
- package/dist/{mind-5IEYKV7I.js → mind-M57ET546.js} +19 -19
- package/dist/mind-activity-tracker-42ENM32S.js +18 -0
- package/dist/{mind-history-IE2QH7U5.js → mind-history-WHCNZ6I5.js} +86 -19
- package/dist/{mind-list-GEWHWAL4.js → mind-list-H3HC2ZRG.js} +4 -4
- package/dist/mind-manager-LS2AIXHQ.js +30 -0
- package/dist/{mind-profile-DCBDVF5B.js → mind-profile-7VYRJGFZ.js} +2 -2
- package/dist/mind-service-UDXF5WC2.js +36 -0
- package/dist/{mind-sleep-ITCF6OQA.js → mind-sleep-ZL5ZXFTM.js} +4 -4
- package/dist/{mind-status-X4SX3YUG.js → mind-status-ZWULKOUO.js} +4 -4
- package/dist/{mind-wake-KXMKMGWX.js → mind-wake-HK5ORGUK.js} +4 -4
- package/dist/{package-D2FSVFAX.js → package-5FGU5QNP.js} +6 -6
- package/dist/{read-67VRP2DO.js → read-CP7MYMJQ.js} +8 -8
- package/dist/{read-stdin-3X5VYKNS.js → read-stdin-4B5UYPPM.js} +1 -1
- package/dist/{register-SB7NXCOE.js → register-XOBFEMI4.js} +4 -4
- package/dist/{registry-GBSNW3HG.js → registry-KMELPC3X.js} +3 -3
- package/dist/{reject-MUR2KWJ4.js → reject-43AGXB6B.js} +4 -4
- package/dist/{restart-5EGG4JXU.js → restart-O5QIYQJT.js} +5 -5
- package/dist/{sandbox-R37VIU36.js → sandbox-PQYEICEF.js} +6 -6
- package/dist/scheduler-NTC74JYH.js +30 -0
- package/dist/{schema-XVZ2CLKW.js → schema-K575EBPE.js} +4 -2
- package/dist/{seed-EQORWX77.js → seed-55VC3A57.js} +2 -2
- package/dist/{seed-check-KJNTL72M.js → seed-check-HZPVFJKZ.js} +2 -2
- package/dist/{seed-cmd-ZM2XGVU2.js → seed-cmd-2KOEQZK6.js} +4 -4
- package/dist/{seed-create-DRWGGHEI.js → seed-create-Y2Z5JWBB.js} +6 -6
- package/dist/{seed-sprout-JYXGXOP3.js → seed-sprout-OLSIWXZN.js} +15 -15
- package/dist/{send-JBJJQ7CA.js → send-7CIP5GLS.js} +8 -8
- package/dist/{service-WNPCNHOX.js → service-YMHWPDXW.js} +6 -6
- package/dist/{setup-BJ4YAY26.js → setup-6Z34JJEB.js} +32 -37
- package/dist/{setup-RHJRFURI.js → setup-PF7JSFMO.js} +6 -4
- package/dist/{skill-TAAKEYBV.js → skill-ICN6Y2ZF.js} +6 -6
- package/dist/skills/tending/SKILL.md +52 -0
- package/dist/{skills-EKMCQ46K.js → skills-FDMLJGZ3.js} +8 -8
- package/dist/sleep-manager-TQP5ZJI5.js +34 -0
- package/dist/spirit-SM6ARJ2N.js +24 -0
- package/dist/{split-AWVOYOPZ.js → split-5YBEQTBF.js} +3 -3
- package/dist/{sprout-HE4TITMK.js → sprout-G6G57IOY.js} +2 -2
- package/dist/src-LT6ZBYYX.js +2133 -0
- package/dist/src-O4PRLMKM.js +425 -0
- package/dist/src-OYWRPLC6.js +617 -0
- package/dist/{start-3UXOPXQG.js → start-LMXXRR3X.js} +5 -5
- package/dist/{status-ZK34WYIM.js → status-MC2P7DBG.js} +7 -7
- package/dist/{stop-3XYIBGFM.js → stop-TWDKVEUX.js} +5 -5
- package/dist/system-chat-NNXYCSVL.js +34 -0
- package/dist/{systems-O43WGQY6.js → systems-Y2WZV2K4.js} +7 -7
- package/dist/{tailscale-ZIZ2HWJ5.js → tailscale-LTYNKIPZ.js} +4 -4
- package/dist/template-hash-SSIBEEYK.js +9 -0
- package/dist/up-5JXV6BZS.js +19 -0
- package/dist/{update-ANE5ZM7F.js → update-UOP2INF2.js} +7 -7
- package/dist/{update-check-UV55CBEP.js → update-check-IKS7SGK5.js} +4 -4
- package/dist/{upgrade-ZMDGC7M2.js → upgrade-RXFZR5FI.js} +3 -3
- package/dist/{variant-QWL2WSRI.js → variant-HHDTW74J.js} +1 -1
- package/dist/{version-notify-FXSEMXWW.js → version-notify-CSE4NBYM.js} +22 -23
- package/dist/{volute-config-D2XVS2YI.js → volute-config-TS62GS6A.js} +2 -2
- package/dist/web-assets/assets/index-B3xLeex8.js +75 -0
- package/dist/web-assets/assets/index-Dr4A90Lo.css +1 -0
- package/dist/web-assets/index.html +2 -2
- package/drizzle/0006_channels.sql +17 -0
- package/drizzle/0007_drop_conversation_name_title.sql +11 -0
- package/drizzle/0008_performance_indexes.sql +6 -0
- package/drizzle/meta/0006_snapshot.json +7 -0
- package/drizzle/meta/0007_snapshot.json +7 -0
- package/drizzle/meta/_journal.json +21 -0
- package/package.json +5 -5
- package/templates/_base/home/.config/routes.json +2 -2
- package/templates/_base/home/VOLUTE.md +1 -2
- package/templates/_base/src/lib/context-breakdown.ts +22 -16
- package/templates/_base/src/lib/format-prefix.ts +1 -7
- package/templates/claude/.init/.config/routes.json +2 -2
- package/templates/codex/.init/.config/routes.json +2 -2
- package/templates/pi/.init/.config/routes.json +2 -2
- package/dist/activity-events-ZW4SDL2C.js +0 -15
- package/dist/chunk-7KJOFUNN.js +0 -22
- package/dist/chunk-MDJGMOSD.js +0 -207
- package/dist/db-BVBJ57TU.js +0 -9
- package/dist/delivery-manager-H5ZVBMCQ.js +0 -31
- package/dist/down-74VXM45A.js +0 -17
- package/dist/exec-PY7THYH4.js +0 -17
- package/dist/extensions-XDDFY72A.js +0 -49
- package/dist/lib-DYEZMGW7.js +0 -6588
- package/dist/message-delivery-GRC4W6P7.js +0 -41
- package/dist/mind-activity-tracker-QBLIV7ZJ.js +0 -18
- package/dist/mind-manager-HFLB5653.js +0 -31
- package/dist/mind-service-X2CAA6W6.js +0 -37
- package/dist/scheduler-Y7O4CJXL.js +0 -31
- package/dist/sleep-manager-7KFK3USC.js +0 -35
- package/dist/spirit-ZFRDXMG7.js +0 -23
- package/dist/system-chat-IDPHYHY4.js +0 -35
- package/dist/template-hash-A7FNHTB7.js +0 -9
- package/dist/up-77ICEDEW.js +0 -19
- package/dist/web-assets/assets/index-BhxWKvbB.css +0 -1
- package/dist/web-assets/assets/index-CHVKJ9II.js +0 -75
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// packages/extensions/sdk/src/index.ts
|
|
4
|
+
var VALID_EXTENSION_ID = /^[a-z0-9][a-z0-9_-]*$/;
|
|
5
|
+
function createExtension(manifest) {
|
|
6
|
+
if (!manifest.id) throw new Error("Extension manifest requires an id");
|
|
7
|
+
if (!VALID_EXTENSION_ID.test(manifest.id))
|
|
8
|
+
throw new Error(
|
|
9
|
+
"Extension id must be lowercase alphanumeric with hyphens/underscores, starting with a letter or digit"
|
|
10
|
+
);
|
|
11
|
+
if (typeof manifest.routes !== "function")
|
|
12
|
+
throw new Error("Extension manifest requires a routes function");
|
|
13
|
+
return manifest;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
createExtension
|
|
18
|
+
};
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
getBaseName,
|
|
4
4
|
validateMindName
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2NHRJ3YO.js";
|
|
6
6
|
|
|
7
|
-
// packages/daemon/src/lib/isolation.ts
|
|
7
|
+
// packages/daemon/src/lib/mind/isolation.ts
|
|
8
8
|
import { execFileSync } from "child_process";
|
|
9
9
|
function isIsolationEnabled() {
|
|
10
10
|
return process.env.VOLUTE_ISOLATION === "user";
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
setBridgeConfig
|
|
4
|
+
} from "./chunk-LQ6Z4FXN.js";
|
|
5
|
+
import {
|
|
6
|
+
readEnv,
|
|
7
|
+
sharedEnvPath,
|
|
8
|
+
writeEnv
|
|
9
|
+
} from "./chunk-PMMHVSCR.js";
|
|
10
|
+
|
|
11
|
+
// packages/daemon/src/lib/template/import-utils.ts
|
|
12
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
13
|
+
import { homedir } from "os";
|
|
14
|
+
import { basename, resolve } from "path";
|
|
15
|
+
function findOpenClawSession(workspaceDir) {
|
|
16
|
+
const ocAgentsDir = resolve(homedir(), ".openclaw/agents");
|
|
17
|
+
if (!existsSync(ocAgentsDir)) return void 0;
|
|
18
|
+
const matches = [];
|
|
19
|
+
try {
|
|
20
|
+
for (const entry of readdirSync(ocAgentsDir)) {
|
|
21
|
+
const sessionsDir = resolve(ocAgentsDir, entry, "sessions");
|
|
22
|
+
if (!existsSync(sessionsDir)) continue;
|
|
23
|
+
for (const file of readdirSync(sessionsDir)) {
|
|
24
|
+
if (!file.endsWith(".jsonl")) continue;
|
|
25
|
+
const fullPath = resolve(sessionsDir, file);
|
|
26
|
+
if (sessionMatchesWorkspace(fullPath, workspaceDir)) {
|
|
27
|
+
matches.push({ path: fullPath, mtime: statSync(fullPath).mtimeMs });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
} catch (err) {
|
|
32
|
+
console.warn("Warning: error scanning OpenClaw sessions:", err);
|
|
33
|
+
return void 0;
|
|
34
|
+
}
|
|
35
|
+
if (matches.length === 0) return void 0;
|
|
36
|
+
matches.sort((a, b) => b.mtime - a.mtime);
|
|
37
|
+
console.log(`Found session: ${matches[0].path}`);
|
|
38
|
+
return matches[0].path;
|
|
39
|
+
}
|
|
40
|
+
function sessionMatchesWorkspace(sessionPath, workspaceDir) {
|
|
41
|
+
try {
|
|
42
|
+
const fd = readFileSync(sessionPath, "utf-8");
|
|
43
|
+
const firstLine = fd.slice(0, fd.indexOf("\n"));
|
|
44
|
+
const header = JSON.parse(firstLine);
|
|
45
|
+
return header.type === "session" && resolve(header.cwd) === resolve(workspaceDir);
|
|
46
|
+
} catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function importPiSession(sessionFile, mindDirPath) {
|
|
51
|
+
const homeDir = resolve(mindDirPath, "home");
|
|
52
|
+
const piSessionDir = resolve(mindDirPath, ".mind/pi-sessions/main");
|
|
53
|
+
mkdirSync(piSessionDir, { recursive: true });
|
|
54
|
+
const content = readFileSync(sessionFile, "utf-8");
|
|
55
|
+
const lines = content.trim().split("\n");
|
|
56
|
+
try {
|
|
57
|
+
const header = JSON.parse(lines[0]);
|
|
58
|
+
if (header.type === "session") {
|
|
59
|
+
header.cwd = homeDir;
|
|
60
|
+
lines[0] = JSON.stringify(header);
|
|
61
|
+
}
|
|
62
|
+
} catch {
|
|
63
|
+
}
|
|
64
|
+
const filename = basename(sessionFile);
|
|
65
|
+
const destPath = resolve(piSessionDir, filename);
|
|
66
|
+
writeFileSync(destPath, `${lines.join("\n")}
|
|
67
|
+
`);
|
|
68
|
+
console.log(`Imported session (${lines.length} entries)`);
|
|
69
|
+
}
|
|
70
|
+
function importOpenClawConnectors(name, _mindDirPath) {
|
|
71
|
+
const configPath = resolve(homedir(), ".openclaw/openclaw.json");
|
|
72
|
+
if (!existsSync(configPath)) return;
|
|
73
|
+
let config;
|
|
74
|
+
try {
|
|
75
|
+
config = JSON.parse(readFileSync(configPath, "utf-8"));
|
|
76
|
+
} catch (err) {
|
|
77
|
+
console.warn("Warning: failed to parse openclaw.json:", err);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const discord = config.channels?.discord;
|
|
81
|
+
if (!discord?.enabled || !discord.token) return;
|
|
82
|
+
const envPath = sharedEnvPath();
|
|
83
|
+
const env = readEnv(envPath);
|
|
84
|
+
if (!env.DISCORD_TOKEN) {
|
|
85
|
+
env.DISCORD_TOKEN = discord.token;
|
|
86
|
+
writeEnv(envPath, env);
|
|
87
|
+
}
|
|
88
|
+
const channelMappings = {};
|
|
89
|
+
if (discord.guilds) {
|
|
90
|
+
for (const guild of Object.values(discord.guilds)) {
|
|
91
|
+
if (!guild.channels) continue;
|
|
92
|
+
for (const [channelName, ch] of Object.entries(guild.channels)) {
|
|
93
|
+
if (ch.allow) {
|
|
94
|
+
channelMappings[channelName] = channelName;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
setBridgeConfig("discord", {
|
|
100
|
+
enabled: true,
|
|
101
|
+
defaultMind: name,
|
|
102
|
+
channelMappings
|
|
103
|
+
});
|
|
104
|
+
console.log(`Imported Discord as system bridge (default mind: ${name})`);
|
|
105
|
+
if (Object.keys(channelMappings).length > 0) {
|
|
106
|
+
console.log(`Mapped channels: ${Object.keys(channelMappings).join(", ")}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function parseNameFromIdentity(identity) {
|
|
110
|
+
const match = identity.match(/\*\*Name:\*\*\s*(.+)/);
|
|
111
|
+
if (match) {
|
|
112
|
+
const raw = match[1].trim();
|
|
113
|
+
if (!raw || raw.startsWith("*") || raw.startsWith("(")) return void 0;
|
|
114
|
+
return raw.toLowerCase().replace(/\s+/g, "-").replace(/[^a-z0-9.-]/g, "");
|
|
115
|
+
}
|
|
116
|
+
return void 0;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export {
|
|
120
|
+
findOpenClawSession,
|
|
121
|
+
sessionMatchesWorkspace,
|
|
122
|
+
importPiSession,
|
|
123
|
+
importOpenClawConnectors,
|
|
124
|
+
parseNameFromIdentity
|
|
125
|
+
};
|
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// packages/daemon/src/lib/log-buffer.ts
|
|
3
|
+
// packages/daemon/src/lib/util/log-buffer.ts
|
|
4
4
|
var LogBuffer = class {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
constructor(maxSize = 1e3) {
|
|
6
|
+
this.maxSize = maxSize;
|
|
7
|
+
this.buffer = new Array(maxSize).fill(null);
|
|
8
|
+
}
|
|
9
|
+
buffer;
|
|
10
|
+
head = 0;
|
|
11
|
+
count = 0;
|
|
7
12
|
subscribers = /* @__PURE__ */ new Set();
|
|
8
13
|
append(entry) {
|
|
9
|
-
this.
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
const idx = (this.head + this.count) % this.maxSize;
|
|
15
|
+
this.buffer[idx] = entry;
|
|
16
|
+
if (this.count === this.maxSize) {
|
|
17
|
+
this.head = (this.head + 1) % this.maxSize;
|
|
18
|
+
} else {
|
|
19
|
+
this.count++;
|
|
12
20
|
}
|
|
13
21
|
for (const sub of this.subscribers) {
|
|
14
22
|
sub(entry);
|
|
15
23
|
}
|
|
16
24
|
}
|
|
17
25
|
getEntries() {
|
|
18
|
-
|
|
26
|
+
const result = [];
|
|
27
|
+
for (let i = 0; i < this.count; i++) {
|
|
28
|
+
result.push(this.buffer[(this.head + i) % this.maxSize]);
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
19
31
|
}
|
|
20
32
|
subscribe(fn) {
|
|
21
33
|
this.subscribers.add(fn);
|
|
@@ -24,7 +36,7 @@ var LogBuffer = class {
|
|
|
24
36
|
};
|
|
25
37
|
var logBuffer = new LogBuffer();
|
|
26
38
|
|
|
27
|
-
// packages/daemon/src/lib/logger.ts
|
|
39
|
+
// packages/daemon/src/lib/util/logger.ts
|
|
28
40
|
var LEVELS = { debug: 0, info: 1, warn: 2, error: 3 };
|
|
29
41
|
var minLevel = LEVELS[process.env.VOLUTE_LOG_LEVEL || "info"] ?? LEVELS.info;
|
|
30
42
|
var output = (line) => process.stderr.write(`${line}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import {
|
|
3
3
|
exec,
|
|
4
4
|
execInherit
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3F7XK5Q7.js";
|
|
6
6
|
import {
|
|
7
7
|
voluteSystemDir
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2NHRJ3YO.js";
|
|
9
9
|
|
|
10
|
-
// packages/daemon/src/lib/service-mode.ts
|
|
10
|
+
// packages/daemon/src/lib/config/service-mode.ts
|
|
11
11
|
import { execFileSync } from "child_process";
|
|
12
12
|
import { existsSync, readFileSync } from "fs";
|
|
13
13
|
import { homedir } from "os";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
broadcast
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-N42QMDID.js";
|
|
5
5
|
import {
|
|
6
6
|
getDb
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2NHRJ3YO.js";
|
|
8
8
|
import {
|
|
9
9
|
users
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CJ26DXZL.js";
|
|
11
11
|
|
|
12
12
|
// packages/daemon/src/lib/auth.ts
|
|
13
13
|
import { compareSync, hashSync } from "bcryptjs";
|
|
@@ -4,41 +4,69 @@ import {
|
|
|
4
4
|
composeTemplate,
|
|
5
5
|
copyTemplateToDir,
|
|
6
6
|
findTemplatesRoot
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-46DYYHN6.js";
|
|
8
8
|
import {
|
|
9
9
|
getSharedSkill,
|
|
10
|
-
installSkill
|
|
11
|
-
|
|
10
|
+
installSkill,
|
|
11
|
+
mindSkillsDir
|
|
12
|
+
} from "./chunk-NYP3LBIV.js";
|
|
12
13
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
logger_default
|
|
18
|
-
} from "./chunk-BKF4WQCY.js";
|
|
14
|
+
readVoluteConfig,
|
|
15
|
+
writeVoluteConfig
|
|
16
|
+
} from "./chunk-CU6OFXMM.js";
|
|
19
17
|
import {
|
|
20
18
|
exec
|
|
21
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-3F7XK5Q7.js";
|
|
20
|
+
import {
|
|
21
|
+
qualifyModelId,
|
|
22
|
+
resolveTemplate
|
|
23
|
+
} from "./chunk-ORNY3MZR.js";
|
|
22
24
|
import {
|
|
23
25
|
readGlobalConfig
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-A6FLW5XD.js";
|
|
27
|
+
import {
|
|
28
|
+
logger_default
|
|
29
|
+
} from "./chunk-T2TP6ZC6.js";
|
|
25
30
|
import {
|
|
26
31
|
addSpirit,
|
|
27
32
|
findMind,
|
|
28
33
|
nextPort,
|
|
29
34
|
voluteSystemDir
|
|
30
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-2NHRJ3YO.js";
|
|
31
36
|
|
|
32
|
-
// packages/daemon/src/lib/spirit.ts
|
|
37
|
+
// packages/daemon/src/lib/mind/spirit.ts
|
|
33
38
|
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
34
|
-
import { homedir } from "os";
|
|
35
39
|
import { resolve } from "path";
|
|
36
40
|
var slog = logger_default.child("spirit");
|
|
41
|
+
var SPIRIT_SKILLS = [
|
|
42
|
+
"volute-admin",
|
|
43
|
+
"orientation",
|
|
44
|
+
"memory",
|
|
45
|
+
"seed-nurture",
|
|
46
|
+
"tending",
|
|
47
|
+
"plan-coordinator"
|
|
48
|
+
];
|
|
49
|
+
var TENDING_SCHEDULE = {
|
|
50
|
+
id: "tending",
|
|
51
|
+
cron: "0 10 * * *",
|
|
52
|
+
message: "Check on the minds in your care \u2014 see if anyone could use a suggestion about features they haven't tried yet.",
|
|
53
|
+
enabled: true,
|
|
54
|
+
whileSleeping: "skip"
|
|
55
|
+
};
|
|
37
56
|
function npmEnv() {
|
|
38
|
-
const cacheDir = resolve(
|
|
57
|
+
const cacheDir = resolve(voluteSystemDir(), ".npm-cache");
|
|
39
58
|
mkdirSync(cacheDir, { recursive: true });
|
|
40
59
|
return { ...process.env, npm_config_cache: cacheDir };
|
|
41
60
|
}
|
|
61
|
+
function ensureTendingSchedule(dir) {
|
|
62
|
+
const config = readVoluteConfig(dir) ?? {};
|
|
63
|
+
const schedules = config.schedules ?? [];
|
|
64
|
+
if (schedules.some((s) => s.id === "tending")) return false;
|
|
65
|
+
schedules.push({ ...TENDING_SCHEDULE });
|
|
66
|
+
config.schedules = schedules;
|
|
67
|
+
writeVoluteConfig(dir, config);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
42
70
|
function spiritDir() {
|
|
43
71
|
return resolve(voluteSystemDir(), "spirit");
|
|
44
72
|
}
|
|
@@ -77,7 +105,7 @@ async function ensureSpiritProject() {
|
|
|
77
105
|
writeFileSync(configPath, `${JSON.stringify(mindConfig, null, 2)}
|
|
78
106
|
`);
|
|
79
107
|
}
|
|
80
|
-
await exec("npm", ["install"
|
|
108
|
+
await exec("npm", ["install"], { cwd: dir, env: npmEnv() });
|
|
81
109
|
try {
|
|
82
110
|
await exec("git", ["init"], { cwd: dir });
|
|
83
111
|
await exec("git", ["add", "-A"], { cwd: dir });
|
|
@@ -85,14 +113,7 @@ async function ensureSpiritProject() {
|
|
|
85
113
|
} catch (err) {
|
|
86
114
|
slog.warn("git init failed for spirit \u2014 not critical", logger_default.errorData(err));
|
|
87
115
|
}
|
|
88
|
-
const
|
|
89
|
-
"volute-admin",
|
|
90
|
-
"orientation",
|
|
91
|
-
"memory",
|
|
92
|
-
"seed-nurture",
|
|
93
|
-
"plan-coordinator"
|
|
94
|
-
];
|
|
95
|
-
for (const skillId of spiritSkills) {
|
|
116
|
+
for (const skillId of SPIRIT_SKILLS) {
|
|
96
117
|
try {
|
|
97
118
|
const shared = await getSharedSkill(skillId);
|
|
98
119
|
if (shared) {
|
|
@@ -102,7 +123,12 @@ async function ensureSpiritProject() {
|
|
|
102
123
|
slog.warn(`failed to install skill ${skillId} for spirit`, logger_default.errorData(err));
|
|
103
124
|
}
|
|
104
125
|
}
|
|
105
|
-
|
|
126
|
+
try {
|
|
127
|
+
ensureTendingSchedule(dir);
|
|
128
|
+
} catch (err) {
|
|
129
|
+
slog.warn("failed to add tending schedule to spirit config", logger_default.errorData(err));
|
|
130
|
+
}
|
|
131
|
+
const { createMindUser, chownMindDir, ensureVoluteGroup } = await import("./isolation-G5J3MTKU.js");
|
|
106
132
|
ensureVoluteGroup();
|
|
107
133
|
createMindUser("volute", resolve(dir, "home"));
|
|
108
134
|
chownMindDir(dir, "volute");
|
|
@@ -134,10 +160,10 @@ async function syncSpiritTemplate() {
|
|
|
134
160
|
const newPkg = resolve(newComposed.composedDir, "package.json");
|
|
135
161
|
if (existsSync(newPkg)) {
|
|
136
162
|
cpSync(newPkg, resolve(dir, "package.json"));
|
|
137
|
-
await exec("npm", ["install"
|
|
163
|
+
await exec("npm", ["install"], { cwd: dir, env: npmEnv() });
|
|
138
164
|
}
|
|
139
|
-
const db = await (await import("./db-
|
|
140
|
-
const { minds } = await import("./schema-
|
|
165
|
+
const db = await (await import("./db-CBOCDYVA.js")).getDb();
|
|
166
|
+
const { minds } = await import("./schema-K575EBPE.js");
|
|
141
167
|
const { eq } = await import("drizzle-orm");
|
|
142
168
|
await db.update(minds).set({ template: expectedTemplate }).where(eq(minds.name, "volute"));
|
|
143
169
|
}
|
|
@@ -182,16 +208,36 @@ async function syncSpiritTemplate() {
|
|
|
182
208
|
if (composedContent !== currentContent) {
|
|
183
209
|
cpSync(composedPkg, currentPkg);
|
|
184
210
|
}
|
|
185
|
-
await exec("npm", ["install"
|
|
211
|
+
await exec("npm", ["install"], { cwd: dir, env: npmEnv() });
|
|
186
212
|
}
|
|
187
213
|
} else if (nodeModulesMissing) {
|
|
188
|
-
await exec("npm", ["install"
|
|
214
|
+
await exec("npm", ["install"], { cwd: dir, env: npmEnv() });
|
|
189
215
|
}
|
|
190
216
|
for (const [p, content] of preserved) {
|
|
191
217
|
const full = resolve(dir, p);
|
|
192
218
|
mkdirSync(resolve(full, ".."), { recursive: true });
|
|
193
219
|
writeFileSync(full, content);
|
|
194
220
|
}
|
|
221
|
+
for (const skillId of SPIRIT_SKILLS) {
|
|
222
|
+
const skillDir = resolve(mindSkillsDir(dir), skillId);
|
|
223
|
+
if (existsSync(skillDir)) continue;
|
|
224
|
+
try {
|
|
225
|
+
const shared = await getSharedSkill(skillId);
|
|
226
|
+
if (shared) {
|
|
227
|
+
await installSkill("volute", dir, skillId);
|
|
228
|
+
slog.info(`installed missing spirit skill: ${skillId}`);
|
|
229
|
+
}
|
|
230
|
+
} catch (err) {
|
|
231
|
+
slog.warn(`failed to install spirit skill ${skillId}`, logger_default.errorData(err));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
if (ensureTendingSchedule(dir)) {
|
|
236
|
+
slog.info("added tending schedule to spirit");
|
|
237
|
+
}
|
|
238
|
+
} catch (err) {
|
|
239
|
+
slog.warn("failed to add tending schedule to spirit config", logger_default.errorData(err));
|
|
240
|
+
}
|
|
195
241
|
slog.info("spirit template synced");
|
|
196
242
|
}
|
|
197
243
|
function getSpiritSoul(systemName, systemDescription) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
stateDir
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2NHRJ3YO.js";
|
|
5
5
|
|
|
6
|
-
// packages/daemon/src/lib/file-sharing.ts
|
|
6
|
+
// packages/daemon/src/lib/chat/file-sharing.ts
|
|
7
7
|
import { randomBytes } from "crypto";
|
|
8
8
|
import { existsSync, mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
9
9
|
import { basename, join, normalize, resolve } from "path";
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
modeLabel,
|
|
5
5
|
pollHealth,
|
|
6
6
|
startService
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TNZ5XQA4.js";
|
|
8
8
|
import {
|
|
9
9
|
command
|
|
10
10
|
} from "./chunk-TXSA4Q3V.js";
|
|
11
11
|
import {
|
|
12
12
|
readGlobalConfig
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-A6FLW5XD.js";
|
|
14
14
|
import {
|
|
15
15
|
voluteHome,
|
|
16
16
|
voluteSystemDir
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-2NHRJ3YO.js";
|
|
18
18
|
|
|
19
19
|
// src/commands/up.ts
|
|
20
20
|
import { spawn } from "child_process";
|
package/dist/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ if (!process.env.VOLUTE_HOME) {
|
|
|
10
10
|
var command = process.argv[2];
|
|
11
11
|
var args = process.argv.slice(3);
|
|
12
12
|
if (command === "--version" || command === "-v") {
|
|
13
|
-
const { default: pkg } = await import("./package-
|
|
13
|
+
const { default: pkg } = await import("./package-5FGU5QNP.js");
|
|
14
14
|
console.log(pkg.version);
|
|
15
15
|
process.exit(0);
|
|
16
16
|
}
|
|
@@ -31,7 +31,7 @@ var ungatedCommands = /* @__PURE__ */ new Set([
|
|
|
31
31
|
void 0
|
|
32
32
|
]);
|
|
33
33
|
if (!ungatedCommands.has(command)) {
|
|
34
|
-
const { isSetupComplete } = await import("./setup-
|
|
34
|
+
const { isSetupComplete } = await import("./setup-PF7JSFMO.js");
|
|
35
35
|
if (!isSetupComplete()) {
|
|
36
36
|
console.error("Volute is not set up. Run `volute setup` first.");
|
|
37
37
|
process.exit(1);
|
|
@@ -39,61 +39,61 @@ if (!ungatedCommands.has(command)) {
|
|
|
39
39
|
}
|
|
40
40
|
switch (command) {
|
|
41
41
|
case "setup":
|
|
42
|
-
await import("./setup-
|
|
42
|
+
await import("./setup-6Z34JJEB.js").then((m) => m.run(args));
|
|
43
43
|
break;
|
|
44
44
|
case "mind":
|
|
45
|
-
await import("./mind-
|
|
45
|
+
await import("./mind-M57ET546.js").then((m) => m.run(args));
|
|
46
46
|
break;
|
|
47
47
|
case "seed":
|
|
48
|
-
await import("./seed-cmd-
|
|
48
|
+
await import("./seed-cmd-2KOEQZK6.js").then((m) => m.run(args));
|
|
49
49
|
break;
|
|
50
50
|
case "chat":
|
|
51
|
-
await import("./chat-
|
|
51
|
+
await import("./chat-5Y4FD77E.js").then((m) => m.run(args));
|
|
52
52
|
break;
|
|
53
53
|
case "variant":
|
|
54
|
-
await import("./variant-
|
|
54
|
+
await import("./variant-HHDTW74J.js").then((m) => m.run(args));
|
|
55
55
|
break;
|
|
56
56
|
case "clock":
|
|
57
|
-
await import("./clock-
|
|
57
|
+
await import("./clock-BMLJ2TR6.js").then((m) => m.run(args));
|
|
58
58
|
break;
|
|
59
59
|
case "skill":
|
|
60
|
-
await import("./skill-
|
|
60
|
+
await import("./skill-ICN6Y2ZF.js").then((m) => m.run(args));
|
|
61
61
|
break;
|
|
62
62
|
case "env":
|
|
63
|
-
await import("./env-
|
|
63
|
+
await import("./env-IQ6Q2333.js").then((m) => m.run(args));
|
|
64
64
|
break;
|
|
65
65
|
case "config":
|
|
66
|
-
await import("./config-
|
|
66
|
+
await import("./config-QB7W3Z7P.js").then((m) => m.run(args));
|
|
67
67
|
break;
|
|
68
68
|
case "up":
|
|
69
|
-
await import("./up-
|
|
69
|
+
await import("./up-5JXV6BZS.js").then((m) => m.run(args));
|
|
70
70
|
break;
|
|
71
71
|
case "down":
|
|
72
|
-
await import("./down-
|
|
72
|
+
await import("./down-25L2RKCQ.js").then((m) => m.run(args));
|
|
73
73
|
break;
|
|
74
74
|
case "restart":
|
|
75
|
-
await import("./daemon-restart-
|
|
75
|
+
await import("./daemon-restart-L2O6L7NR.js").then((m) => m.run(args));
|
|
76
76
|
break;
|
|
77
77
|
case "update":
|
|
78
|
-
await import("./update-
|
|
78
|
+
await import("./update-UOP2INF2.js").then((m) => m.run(args));
|
|
79
79
|
break;
|
|
80
80
|
case "status":
|
|
81
|
-
await import("./status-
|
|
81
|
+
await import("./status-MC2P7DBG.js").then((m) => m.run(args));
|
|
82
82
|
break;
|
|
83
83
|
case "extension":
|
|
84
|
-
await import("./extension-
|
|
84
|
+
await import("./extension-LZYHBNLV.js").then((m) => m.run(args));
|
|
85
85
|
break;
|
|
86
86
|
case "systems":
|
|
87
|
-
await import("./systems-
|
|
87
|
+
await import("./systems-Y2WZV2K4.js").then((m) => m.run(args));
|
|
88
88
|
break;
|
|
89
89
|
case "login":
|
|
90
|
-
await import("./login-
|
|
90
|
+
await import("./login-F6YMAVLE.js").then((m) => m.run(args));
|
|
91
91
|
break;
|
|
92
92
|
case "logout":
|
|
93
|
-
await import("./logout-
|
|
93
|
+
await import("./logout-HHPH52KZ.js").then((m) => m.run(args));
|
|
94
94
|
break;
|
|
95
95
|
case "service":
|
|
96
|
-
await import("./service-
|
|
96
|
+
await import("./service-YMHWPDXW.js").then((m) => m.run(args));
|
|
97
97
|
break;
|
|
98
98
|
case "--help":
|
|
99
99
|
case "-h":
|
|
@@ -150,7 +150,7 @@ use --mind <name> or VOLUTE_MIND env var to identify the mind.`);
|
|
|
150
150
|
default: {
|
|
151
151
|
let isExtensionCommand = false;
|
|
152
152
|
try {
|
|
153
|
-
const { daemonFetch } = await import("./daemon-client-
|
|
153
|
+
const { daemonFetch } = await import("./daemon-client-2MIPKY3E.js");
|
|
154
154
|
const res = await daemonFetch("/api/extensions/commands");
|
|
155
155
|
if (res.ok) {
|
|
156
156
|
const extCommands = await res.json();
|
|
@@ -231,7 +231,7 @@ Use --mind <name> or VOLUTE_MIND to specify the mind.
|
|
|
231
231
|
mind = cmdArgs[mindIdx + 1];
|
|
232
232
|
cmdArgs.splice(mindIdx, 2);
|
|
233
233
|
}
|
|
234
|
-
const { readStdin } = await import("./read-stdin-
|
|
234
|
+
const { readStdin } = await import("./read-stdin-4B5UYPPM.js");
|
|
235
235
|
const stdin = await readStdin();
|
|
236
236
|
const cmdRes = await daemonFetch(`/api/ext/${command}/commands/${subcommand}`, {
|
|
237
237
|
method: "POST",
|
|
@@ -264,7 +264,7 @@ Run 'volute --help' for usage.`);
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
if (command !== "update") {
|
|
267
|
-
import("./update-check-
|
|
267
|
+
import("./update-check-IKS7SGK5.js").then((m) => m.checkForUpdate()).then((result) => {
|
|
268
268
|
if (result.updateAvailable) {
|
|
269
269
|
console.error(`
|
|
270
270
|
Update available: ${result.current} \u2192 ${result.latest}`);
|
|
@@ -6,11 +6,6 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
resolveMindName
|
|
8
8
|
} from "./chunk-BTY4WNFE.js";
|
|
9
|
-
import {
|
|
10
|
-
command,
|
|
11
|
-
subcommands
|
|
12
|
-
} from "./chunk-TXSA4Q3V.js";
|
|
13
|
-
import "./chunk-O7IGP7ZW.js";
|
|
14
9
|
import {
|
|
15
10
|
daemonFetch
|
|
16
11
|
} from "./chunk-ZX7EAV5J.js";
|
|
@@ -18,7 +13,12 @@ import {
|
|
|
18
13
|
getClient,
|
|
19
14
|
urlOf
|
|
20
15
|
} from "./chunk-LOPXTW6H.js";
|
|
21
|
-
import
|
|
16
|
+
import {
|
|
17
|
+
command,
|
|
18
|
+
subcommands
|
|
19
|
+
} from "./chunk-TXSA4Q3V.js";
|
|
20
|
+
import "./chunk-O7IGP7ZW.js";
|
|
21
|
+
import "./chunk-K3NQKI34.js";
|
|
22
22
|
|
|
23
23
|
// packages/cli/src/commands/clock.ts
|
|
24
24
|
import { CronExpressionParser } from "cron-parser";
|
|
@@ -274,11 +274,11 @@ var cmd = subcommands({
|
|
|
274
274
|
},
|
|
275
275
|
sleep: {
|
|
276
276
|
description: "Put a mind to sleep",
|
|
277
|
-
run: (args) => import("./mind-sleep-
|
|
277
|
+
run: (args) => import("./mind-sleep-ZL5ZXFTM.js").then((m) => m.run(args))
|
|
278
278
|
},
|
|
279
279
|
wake: {
|
|
280
280
|
description: "Wake a sleeping mind",
|
|
281
|
-
run: (args) => import("./mind-wake-
|
|
281
|
+
run: (args) => import("./mind-wake-HK5ORGUK.js").then((m) => m.run(args))
|
|
282
282
|
}
|
|
283
283
|
},
|
|
284
284
|
footer: "Use --mind <name> or VOLUTE_MIND to identify the mind."
|