volute 0.37.0 → 0.38.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/{chunk-UQFYNZKT.js → chunk-2TR2OPVA.js} +1 -1
- package/dist/chunk-JOJT34M2.js +109 -0
- package/dist/{chunk-Z6TIXE77.js → chunk-NGXQ2ESO.js} +9 -8
- package/dist/{chunk-QQQI6ISK.js → chunk-PLL2FM7A.js} +35 -20
- package/dist/{chunk-KBRGHKVU.js → chunk-TEZRVSSB.js} +58 -29
- package/dist/{chunk-NYP3LBIV.js → chunk-VUM2K6EN.js} +1 -1
- package/dist/cli.js +12 -12
- package/dist/{cloud-sync-OIX576NA.js → cloud-sync-PEM3IVI4.js} +8 -8
- package/dist/{daemon-restart-L2O6L7NR.js → daemon-restart-6QONRBTK.js} +6 -6
- package/dist/daemon.js +146 -76
- package/dist/{delivery-manager-4PVBUZJB.js → delivery-manager-IMCRV6A3.js} +5 -5
- package/dist/{down-25L2RKCQ.js → down-5XZWH4ZP.js} +2 -2
- package/dist/{echo-text-T5ZLGMA7.js → echo-text-ADKLNTIA.js} +6 -6
- package/dist/{extensions-CLYXNGYB.js → extensions-P477XR46.js} +5 -5
- package/dist/{message-delivery-N2V5APCS.js → message-delivery-54IXVE5H.js} +5 -5
- package/dist/{mind-M57ET546.js → mind-G5HDKBKL.js} +2 -2
- package/dist/{mind-manager-LS2AIXHQ.js → mind-manager-5G6P2EAT.js} +5 -5
- package/dist/{mind-service-UDXF5WC2.js → mind-service-FDATHL6X.js} +5 -5
- package/dist/{package-5FGU5QNP.js → package-LYQHSDPG.js} +27 -27
- package/dist/{scheduler-NTC74JYH.js → scheduler-ZRUZNQI5.js} +5 -5
- package/dist/{seed-55VC3A57.js → seed-3KH4ZRJL.js} +1 -1
- package/dist/{seed-cmd-2KOEQZK6.js → seed-cmd-6A76SSAA.js} +2 -2
- package/dist/{seed-create-Y2Z5JWBB.js → seed-create-XXRRGZCO.js} +1 -1
- package/dist/{seed-sprout-OLSIWXZN.js → seed-sprout-HLMUH2AI.js} +2 -2
- package/dist/service-install-AIQBLE6P.js +17 -0
- package/dist/setup-NPAZXBIJ.js +454 -0
- package/dist/{skills-FDMLJGZ3.js → skills-NVOWS5NY.js} +1 -1
- package/dist/{sleep-manager-TQP5ZJI5.js → sleep-manager-VPPQXBPH.js} +5 -5
- package/dist/{spirit-SM6ARJ2N.js → spirit-ZFYG4JOH.js} +2 -2
- package/dist/{sprout-G6G57IOY.js → sprout-FLBCETYG.js} +1 -1
- package/dist/{src-LT6ZBYYX.js → src-6Z4XYDH5.js} +200 -169
- package/dist/{system-chat-NNXYCSVL.js → system-chat-YUIT7RA6.js} +5 -5
- package/dist/{up-5JXV6BZS.js → up-YRZAEZ3Z.js} +2 -2
- package/dist/{version-notify-CSE4NBYM.js → version-notify-764EXVQQ.js} +5 -5
- package/dist/web-assets/assets/index-BI7hUTBr.js +73 -0
- package/dist/web-assets/assets/index-BJifO9h_.css +1 -0
- package/dist/web-assets/index.html +2 -2
- package/package.json +27 -27
- package/packages/extensions/notes/dist/ui/assets/index-D3cdui42.css +1 -0
- package/packages/extensions/notes/dist/ui/assets/index-Dsua7alJ.js +61 -0
- package/packages/extensions/notes/dist/ui/index.html +2 -2
- package/packages/extensions/pages/dist/ui/assets/index-BM7gRdg7.js +2 -0
- package/packages/extensions/pages/dist/ui/assets/index-BcY6lnq4.css +1 -0
- package/packages/extensions/pages/dist/ui/index.html +2 -2
- package/packages/extensions/plan/dist/ui/assets/index-DWiqtzBv.js +61 -0
- package/packages/extensions/plan/dist/ui/assets/index-jIkrt-vI.css +1 -0
- package/packages/extensions/plan/dist/ui/index.html +2 -2
- package/templates/_base/src/lib/startup.ts +2 -0
- package/templates/_base/tsconfig.json +3 -1
- package/templates/claude/package.json.tmpl +5 -5
- package/templates/claude/src/agent.ts +1 -0
- package/templates/codex/package.json.tmpl +4 -4
- package/templates/pi/package.json.tmpl +5 -5
- package/templates/pi/src/agent.ts +2 -1
- package/dist/setup-6Z34JJEB.js +0 -425
- package/dist/web-assets/assets/index-B3xLeex8.js +0 -75
- package/dist/web-assets/assets/index-Dr4A90Lo.css +0 -1
- package/packages/extensions/notes/dist/ui/assets/index-8jWEv9SA.js +0 -61
- package/packages/extensions/notes/dist/ui/assets/index-DkaB7Ytd.css +0 -1
- package/packages/extensions/pages/dist/ui/assets/index-D0HyS-xQ.css +0 -1
- package/packages/extensions/pages/dist/ui/assets/index-DKZLNMED.js +0 -2
- package/packages/extensions/plan/dist/ui/assets/index-CJj2gZnZ.css +0 -1
- package/packages/extensions/plan/dist/ui/assets/index-FMEJmvQz.js +0 -61
- package/dist/{chat-5Y4FD77E.js → chat-XL7CVWVJ.js} +0 -0
- package/dist/{chunk-MQRS4J24.js → chunk-LN67VPZJ.js} +3 -3
- package/dist/{service-YMHWPDXW.js → service-RH6Q2XWR.js} +4 -4
- package/dist/{status-MC2P7DBG.js → status-TGOKAFW3.js} +4 -4
- package/dist/{update-UOP2INF2.js → update-ZCTQ6UGY.js} +4 -4
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
LAUNCHD_PLIST_LABEL,
|
|
4
|
+
LAUNCHD_PLIST_PATH,
|
|
5
|
+
USER_SYSTEMD_UNIT
|
|
6
|
+
} from "./chunk-TNZ5XQA4.js";
|
|
7
|
+
import {
|
|
8
|
+
resolveVoluteBin
|
|
9
|
+
} from "./chunk-3F7XK5Q7.js";
|
|
10
|
+
|
|
11
|
+
// packages/daemon/src/lib/config/service-install.ts
|
|
12
|
+
import { execFile } from "child_process";
|
|
13
|
+
import { mkdirSync, writeFileSync } from "fs";
|
|
14
|
+
import { homedir } from "os";
|
|
15
|
+
import { dirname, resolve } from "path";
|
|
16
|
+
import { promisify } from "util";
|
|
17
|
+
var execFileAsync = promisify(execFile);
|
|
18
|
+
function escapeXml(s) {
|
|
19
|
+
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
20
|
+
}
|
|
21
|
+
function buildServicePath(voluteBin) {
|
|
22
|
+
const binDir = dirname(voluteBin);
|
|
23
|
+
const standardPaths = [
|
|
24
|
+
"/usr/local/sbin",
|
|
25
|
+
"/usr/local/bin",
|
|
26
|
+
"/usr/sbin",
|
|
27
|
+
"/usr/bin",
|
|
28
|
+
"/sbin",
|
|
29
|
+
"/bin"
|
|
30
|
+
];
|
|
31
|
+
const parts = standardPaths.includes(binDir) ? standardPaths : [binDir, ...standardPaths];
|
|
32
|
+
return parts.join(":");
|
|
33
|
+
}
|
|
34
|
+
function generateUserPlist(voluteBin, opts) {
|
|
35
|
+
const args = ["up", "--foreground"];
|
|
36
|
+
if (opts?.port != null) args.push("--port", String(opts.port));
|
|
37
|
+
if (opts?.host) args.push("--host", opts.host);
|
|
38
|
+
const logPath = resolve(homedir(), ".volute", "system", "daemon.log");
|
|
39
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
40
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
41
|
+
<plist version="1.0">
|
|
42
|
+
<dict>
|
|
43
|
+
<key>Label</key>
|
|
44
|
+
<string>${LAUNCHD_PLIST_LABEL}</string>
|
|
45
|
+
<key>ProgramArguments</key>
|
|
46
|
+
<array>
|
|
47
|
+
${[voluteBin, ...args].map((a) => `<string>${escapeXml(a)}</string>`).join("\n ")}
|
|
48
|
+
</array>
|
|
49
|
+
<key>EnvironmentVariables</key>
|
|
50
|
+
<dict>
|
|
51
|
+
<key>PATH</key>
|
|
52
|
+
<string>${escapeXml(buildServicePath(voluteBin))}</string>
|
|
53
|
+
</dict>
|
|
54
|
+
<key>RunAtLoad</key>
|
|
55
|
+
<true/>
|
|
56
|
+
<key>KeepAlive</key>
|
|
57
|
+
<true/>
|
|
58
|
+
<key>StandardOutPath</key>
|
|
59
|
+
<string>${logPath}</string>
|
|
60
|
+
<key>StandardErrorPath</key>
|
|
61
|
+
<string>${logPath}</string>
|
|
62
|
+
</dict>
|
|
63
|
+
</plist>`;
|
|
64
|
+
}
|
|
65
|
+
function generateUserUnit(voluteBin, port, host) {
|
|
66
|
+
const args = ["up", "--foreground"];
|
|
67
|
+
if (port != null) args.push("--port", String(port));
|
|
68
|
+
if (host) args.push("--host", host);
|
|
69
|
+
return `[Unit]
|
|
70
|
+
Description=Volute Daemon
|
|
71
|
+
After=network.target
|
|
72
|
+
|
|
73
|
+
[Service]
|
|
74
|
+
Type=exec
|
|
75
|
+
ExecStart=${voluteBin} ${args.join(" ")}
|
|
76
|
+
Restart=on-failure
|
|
77
|
+
RestartSec=5
|
|
78
|
+
|
|
79
|
+
[Install]
|
|
80
|
+
WantedBy=default.target
|
|
81
|
+
`;
|
|
82
|
+
}
|
|
83
|
+
async function installUserService(port, host) {
|
|
84
|
+
const voluteBin = resolveVoluteBin();
|
|
85
|
+
const platform = process.platform;
|
|
86
|
+
if (platform === "darwin") {
|
|
87
|
+
mkdirSync(resolve(homedir(), "Library", "LaunchAgents"), { recursive: true });
|
|
88
|
+
writeFileSync(LAUNCHD_PLIST_PATH, generateUserPlist(voluteBin, { port, host }));
|
|
89
|
+
const uid = `gui/${process.getuid()}`;
|
|
90
|
+
try {
|
|
91
|
+
await execFileAsync("launchctl", ["bootout", `${uid}/${LAUNCHD_PLIST_LABEL}`]);
|
|
92
|
+
} catch {
|
|
93
|
+
}
|
|
94
|
+
await execFileAsync("launchctl", ["bootstrap", uid, LAUNCHD_PLIST_PATH]);
|
|
95
|
+
return true;
|
|
96
|
+
} else if (platform === "linux") {
|
|
97
|
+
mkdirSync(resolve(homedir(), ".config", "systemd", "user"), { recursive: true });
|
|
98
|
+
writeFileSync(USER_SYSTEMD_UNIT, generateUserUnit(voluteBin, port, host));
|
|
99
|
+
await execFileAsync("systemctl", ["--user", "enable", "--now", "volute"]);
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
generateUserPlist,
|
|
107
|
+
generateUserUnit,
|
|
108
|
+
installUserService
|
|
109
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
command
|
|
4
|
+
} from "./chunk-TXSA4Q3V.js";
|
|
2
5
|
import {
|
|
3
6
|
getServiceMode,
|
|
4
7
|
modeLabel,
|
|
5
8
|
pollHealth,
|
|
6
9
|
startService
|
|
7
10
|
} from "./chunk-TNZ5XQA4.js";
|
|
8
|
-
import {
|
|
9
|
-
command
|
|
10
|
-
} from "./chunk-TXSA4Q3V.js";
|
|
11
11
|
import {
|
|
12
12
|
readGlobalConfig
|
|
13
13
|
} from "./chunk-A6FLW5XD.js";
|
|
@@ -70,8 +70,9 @@ var cmd = command({
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
const pollHost = hostname === "0.0.0.0" || hostname === "::" ? "localhost" : hostname;
|
|
73
|
+
const useTailscale = flags.tailscale || config.tailscale;
|
|
73
74
|
let tailscaleHostname;
|
|
74
|
-
if (
|
|
75
|
+
if (useTailscale) {
|
|
75
76
|
try {
|
|
76
77
|
const { execFile } = await import("child_process");
|
|
77
78
|
const { promisify } = await import("util");
|
|
@@ -102,7 +103,7 @@ var cmd = command({
|
|
|
102
103
|
}
|
|
103
104
|
if (flags.foreground) {
|
|
104
105
|
const { startDaemon } = await import("./daemon.js");
|
|
105
|
-
await startDaemon({ port, hostname, foreground: true, tailscale:
|
|
106
|
+
await startDaemon({ port, hostname, foreground: true, tailscale: useTailscale });
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
109
|
const daemonModule = resolve(dirname(new URL(import.meta.url).pathname), "daemon.js");
|
|
@@ -115,14 +116,14 @@ var cmd = command({
|
|
|
115
116
|
const logFile = resolve(systemDir, "daemon.log");
|
|
116
117
|
const logFd = openSync(logFile, "a");
|
|
117
118
|
const daemonArgs = [daemonModule, "--port", String(port), "--host", hostname];
|
|
118
|
-
if (
|
|
119
|
+
if (useTailscale) daemonArgs.push("--tailscale");
|
|
119
120
|
if (flags["no-sandbox"]) daemonArgs.push("--no-sandbox");
|
|
120
121
|
const child = spawn(process.execPath, daemonArgs, {
|
|
121
122
|
stdio: ["ignore", "ignore", logFd],
|
|
122
123
|
detached: true
|
|
123
124
|
});
|
|
124
125
|
child.unref();
|
|
125
|
-
const pollPort =
|
|
126
|
+
const pollPort = useTailscale ? port + 1 : port;
|
|
126
127
|
const url = `http://localhost:${pollPort}/api/health`;
|
|
127
128
|
const maxWait = 3e4;
|
|
128
129
|
const start = Date.now();
|
|
@@ -131,7 +132,7 @@ var cmd = command({
|
|
|
131
132
|
const res = await fetch(url);
|
|
132
133
|
if (res.ok) {
|
|
133
134
|
const displayHost = tailscaleHostname ?? hostname;
|
|
134
|
-
const displayProto =
|
|
135
|
+
const displayProto = useTailscale ? "https" : "http";
|
|
135
136
|
console.log(
|
|
136
137
|
`Volute daemon running on ${displayProto}://${displayHost}:${port} (pid ${child.pid})`
|
|
137
138
|
);
|
|
@@ -6,18 +6,11 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
publish,
|
|
8
8
|
recordOutbound
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TEZRVSSB.js";
|
|
10
10
|
import {
|
|
11
11
|
readEnv,
|
|
12
12
|
sharedEnvPath
|
|
13
13
|
} from "./chunk-PMMHVSCR.js";
|
|
14
|
-
import {
|
|
15
|
-
readVoluteConfig
|
|
16
|
-
} from "./chunk-CU6OFXMM.js";
|
|
17
|
-
import {
|
|
18
|
-
getOrCreateMindUser,
|
|
19
|
-
getUserByUsername
|
|
20
|
-
} from "./chunk-UIM5NHPP.js";
|
|
21
14
|
import {
|
|
22
15
|
addMessage,
|
|
23
16
|
findDMConversation,
|
|
@@ -26,6 +19,13 @@ import {
|
|
|
26
19
|
getConversation,
|
|
27
20
|
getParticipants
|
|
28
21
|
} from "./chunk-5DPRTREW.js";
|
|
22
|
+
import {
|
|
23
|
+
readVoluteConfig
|
|
24
|
+
} from "./chunk-CU6OFXMM.js";
|
|
25
|
+
import {
|
|
26
|
+
getOrCreateMindUser,
|
|
27
|
+
getUserByUsername
|
|
28
|
+
} from "./chunk-UIM5NHPP.js";
|
|
29
29
|
import {
|
|
30
30
|
logger_default
|
|
31
31
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -766,29 +766,41 @@ async function routeDMOutbound(conversationId, senderName, contentBlocks) {
|
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
768
|
|
|
769
|
+
// packages/daemon/src/lib/util/fix-model-escapes.ts
|
|
770
|
+
function fixModelEscapes(text, unescapeNewlines) {
|
|
771
|
+
let result = text.replaceAll("\\!", "!");
|
|
772
|
+
if (unescapeNewlines) {
|
|
773
|
+
result = result.replaceAll("\\n", "\n").replaceAll("\\t", " ");
|
|
774
|
+
}
|
|
775
|
+
return result;
|
|
776
|
+
}
|
|
777
|
+
|
|
769
778
|
// packages/daemon/src/lib/delivery/echo-text.ts
|
|
770
779
|
var dlog = logger_default.child("echo-text");
|
|
771
|
-
var
|
|
780
|
+
var echoConfigCache = /* @__PURE__ */ new Map();
|
|
772
781
|
var channelConvCache = /* @__PURE__ */ new Map();
|
|
782
|
+
function getEchoConfig(mind) {
|
|
783
|
+
const cached = echoConfigCache.get(mind);
|
|
784
|
+
if (cached) return cached;
|
|
785
|
+
const config = readVoluteConfig(mindDir(mind));
|
|
786
|
+
const result = {
|
|
787
|
+
echoText: config?.echoText === true,
|
|
788
|
+
unescapeNewlines: config?.unescapeNewlines === true
|
|
789
|
+
};
|
|
790
|
+
echoConfigCache.set(mind, result);
|
|
791
|
+
return result;
|
|
792
|
+
}
|
|
773
793
|
function clearEchoTextCache(mind) {
|
|
774
794
|
if (mind) {
|
|
775
|
-
|
|
795
|
+
echoConfigCache.delete(mind);
|
|
776
796
|
for (const key of channelConvCache.keys()) {
|
|
777
797
|
if (key.startsWith(`${mind}:`)) channelConvCache.delete(key);
|
|
778
798
|
}
|
|
779
799
|
} else {
|
|
780
|
-
|
|
800
|
+
echoConfigCache.clear();
|
|
781
801
|
channelConvCache.clear();
|
|
782
802
|
}
|
|
783
803
|
}
|
|
784
|
-
function isEchoEnabled(mind) {
|
|
785
|
-
const cached = echoTextCache.get(mind);
|
|
786
|
-
if (cached !== void 0) return cached;
|
|
787
|
-
const config = readVoluteConfig(mindDir(mind));
|
|
788
|
-
const enabled = config?.echoText === true;
|
|
789
|
-
echoTextCache.set(mind, enabled);
|
|
790
|
-
return enabled;
|
|
791
|
-
}
|
|
792
804
|
async function resolveConversationId(mind, channel) {
|
|
793
805
|
const cacheKey = `${mind}:${channel}`;
|
|
794
806
|
const cached = channelConvCache.get(cacheKey);
|
|
@@ -813,13 +825,15 @@ async function resolveConversationId(mind, channel) {
|
|
|
813
825
|
return conversationId;
|
|
814
826
|
}
|
|
815
827
|
async function echoTextToChannel(mind, channel, text, turnId, textEventId) {
|
|
816
|
-
|
|
828
|
+
const cfg = getEchoConfig(mind);
|
|
829
|
+
if (!cfg.echoText) return void 0;
|
|
817
830
|
if (!text.trim()) return void 0;
|
|
818
831
|
const conversationId = await resolveConversationId(mind, channel);
|
|
819
832
|
if (!conversationId) {
|
|
820
833
|
dlog.debug(`echo-text: could not resolve channel "${channel}" to conversation`);
|
|
821
834
|
return void 0;
|
|
822
835
|
}
|
|
836
|
+
text = fixModelEscapes(text, cfg.unescapeNewlines);
|
|
823
837
|
const contentBlocks = [{ type: "text", text }];
|
|
824
838
|
const message = await addMessage(conversationId, "user", mind, contentBlocks, {
|
|
825
839
|
turnId,
|
|
@@ -848,6 +862,7 @@ export {
|
|
|
848
862
|
PLATFORMS,
|
|
849
863
|
getPlatformDriver,
|
|
850
864
|
routeOutboundBridge,
|
|
865
|
+
fixModelEscapes,
|
|
851
866
|
clearEchoTextCache,
|
|
852
867
|
echoTextToChannel
|
|
853
868
|
};
|
|
@@ -4,13 +4,23 @@ import {
|
|
|
4
4
|
} from "./chunk-PMMHVSCR.js";
|
|
5
5
|
import {
|
|
6
6
|
spiritDir
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2TR2OPVA.js";
|
|
8
8
|
import {
|
|
9
9
|
hashSkillDir,
|
|
10
10
|
importSkillFromDir,
|
|
11
11
|
removeSharedSkill,
|
|
12
12
|
sharedSkillsDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VUM2K6EN.js";
|
|
14
|
+
import {
|
|
15
|
+
addMessage,
|
|
16
|
+
createChannel,
|
|
17
|
+
createConversation,
|
|
18
|
+
findDMConversation,
|
|
19
|
+
getChannelByName,
|
|
20
|
+
getParticipants,
|
|
21
|
+
joinChannel,
|
|
22
|
+
publish as publish2
|
|
23
|
+
} from "./chunk-5DPRTREW.js";
|
|
14
24
|
import {
|
|
15
25
|
readVoluteConfig,
|
|
16
26
|
writeVoluteConfig
|
|
@@ -44,6 +54,10 @@ import {
|
|
|
44
54
|
getUserByUsername,
|
|
45
55
|
syncMindProfile
|
|
46
56
|
} from "./chunk-UIM5NHPP.js";
|
|
57
|
+
import {
|
|
58
|
+
publish,
|
|
59
|
+
subscribe
|
|
60
|
+
} from "./chunk-N42QMDID.js";
|
|
47
61
|
import {
|
|
48
62
|
aiCompleteUtility,
|
|
49
63
|
getAiConfig,
|
|
@@ -53,20 +67,6 @@ import {
|
|
|
53
67
|
readGlobalConfig,
|
|
54
68
|
writeGlobalConfig
|
|
55
69
|
} from "./chunk-A6FLW5XD.js";
|
|
56
|
-
import {
|
|
57
|
-
addMessage,
|
|
58
|
-
createChannel,
|
|
59
|
-
createConversation,
|
|
60
|
-
findDMConversation,
|
|
61
|
-
getChannelByName,
|
|
62
|
-
getParticipants,
|
|
63
|
-
joinChannel,
|
|
64
|
-
publish as publish2
|
|
65
|
-
} from "./chunk-5DPRTREW.js";
|
|
66
|
-
import {
|
|
67
|
-
publish,
|
|
68
|
-
subscribe
|
|
69
|
-
} from "./chunk-N42QMDID.js";
|
|
70
70
|
import {
|
|
71
71
|
logger_default
|
|
72
72
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -1535,11 +1535,40 @@ var MindManager = class {
|
|
|
1535
1535
|
}
|
|
1536
1536
|
if (target.template === "codex") {
|
|
1537
1537
|
try {
|
|
1538
|
-
const
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1538
|
+
const ai = getAiConfig();
|
|
1539
|
+
const codexConfig = ai?.providers["openai-codex"];
|
|
1540
|
+
if (codexConfig?.oauth) {
|
|
1541
|
+
const codexDir = resolve(dir, ".mind", "codex");
|
|
1542
|
+
mkdirSync(codexDir, { recursive: true });
|
|
1543
|
+
env.CODEX_HOME = codexDir;
|
|
1544
|
+
const authPath = resolve(codexDir, "auth.json");
|
|
1545
|
+
writeFileSync2(
|
|
1546
|
+
authPath,
|
|
1547
|
+
JSON.stringify({
|
|
1548
|
+
auth_mode: "chatgpt",
|
|
1549
|
+
tokens: {
|
|
1550
|
+
access_token: codexConfig.oauth.access,
|
|
1551
|
+
refresh_token: codexConfig.oauth.refresh,
|
|
1552
|
+
id_token: codexConfig.oauth.access
|
|
1553
|
+
},
|
|
1554
|
+
last_refresh: (/* @__PURE__ */ new Date()).toISOString()
|
|
1555
|
+
}),
|
|
1556
|
+
{ mode: 384 }
|
|
1557
|
+
);
|
|
1558
|
+
const configTomlPath = resolve(codexDir, "config.toml");
|
|
1559
|
+
if (!existsSync3(configTomlPath)) {
|
|
1560
|
+
writeFileSync2(configTomlPath, 'cli_auth_credentials_store = "file"\n');
|
|
1561
|
+
}
|
|
1562
|
+
if (isIsolationEnabled()) {
|
|
1563
|
+
chownMindDir(codexDir, baseName);
|
|
1564
|
+
}
|
|
1565
|
+
} else {
|
|
1566
|
+
const apiKey = await resolveApiKey("openai-codex");
|
|
1567
|
+
if (apiKey) {
|
|
1568
|
+
env.OPENAI_API_KEY = apiKey;
|
|
1569
|
+
} else if (process.env.OPENAI_API_KEY) {
|
|
1570
|
+
env.OPENAI_API_KEY = process.env.OPENAI_API_KEY;
|
|
1571
|
+
}
|
|
1543
1572
|
}
|
|
1544
1573
|
} catch (err) {
|
|
1545
1574
|
mlog.error(`failed to resolve OpenAI API key for ${name}`, logger_default.errorData(err));
|
|
@@ -1740,7 +1769,7 @@ var MindManager = class {
|
|
|
1740
1769
|
if (this.shuttingDown || this.stopping.has(name)) return;
|
|
1741
1770
|
mlog.error(`mind ${name} exited with code ${code}`);
|
|
1742
1771
|
try {
|
|
1743
|
-
const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-
|
|
1772
|
+
const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-VPPQXBPH.js");
|
|
1744
1773
|
const sleepState = getSleepManagerIfReady2()?.getState(name);
|
|
1745
1774
|
if (sleepState?.sleeping) {
|
|
1746
1775
|
mlog.info(`${name} is sleeping \u2014 skipping crash recovery`);
|
|
@@ -1753,7 +1782,7 @@ var MindManager = class {
|
|
|
1753
1782
|
(err) => mlog.warn(`failed to clear turn state for ${name} after crash`, logger_default.errorData(err))
|
|
1754
1783
|
);
|
|
1755
1784
|
try {
|
|
1756
|
-
const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-
|
|
1785
|
+
const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-IMCRV6A3.js");
|
|
1757
1786
|
getDeliveryManager2().clearMindSessions(name);
|
|
1758
1787
|
} catch (err) {
|
|
1759
1788
|
if (!(err instanceof Error && err.message.includes("not initialized"))) {
|
|
@@ -1812,7 +1841,7 @@ var MindManager = class {
|
|
|
1812
1841
|
mlog.warn(`failed to clear turn state for ${name} on stop`, logger_default.errorData(err));
|
|
1813
1842
|
}
|
|
1814
1843
|
try {
|
|
1815
|
-
const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-
|
|
1844
|
+
const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-IMCRV6A3.js");
|
|
1816
1845
|
getDeliveryManager2().clearMindSessions(name);
|
|
1817
1846
|
} catch (err) {
|
|
1818
1847
|
if (!(err instanceof Error && err.message.includes("not initialized"))) {
|
|
@@ -1820,7 +1849,7 @@ var MindManager = class {
|
|
|
1820
1849
|
}
|
|
1821
1850
|
}
|
|
1822
1851
|
try {
|
|
1823
|
-
const { clearEchoTextCache } = await import("./echo-text-
|
|
1852
|
+
const { clearEchoTextCache } = await import("./echo-text-ADKLNTIA.js");
|
|
1824
1853
|
clearEchoTextCache(name);
|
|
1825
1854
|
} catch (err) {
|
|
1826
1855
|
mlog.debug(`failed to clear echo-text cache for ${name}`, logger_default.errorData(err));
|
|
@@ -2304,7 +2333,7 @@ function resolveSkillsDir(manifest) {
|
|
|
2304
2333
|
async function discoverBuiltinExtensions(disabledIds) {
|
|
2305
2334
|
const builtins = [
|
|
2306
2335
|
{ id: "notes", load: async () => (await import("./src-OYWRPLC6.js")).default },
|
|
2307
|
-
{ id: "pages", load: async () => (await import("./src-
|
|
2336
|
+
{ id: "pages", load: async () => (await import("./src-6Z4XYDH5.js")).default },
|
|
2308
2337
|
{ id: "plan", load: async () => (await import("./src-O4PRLMKM.js")).default }
|
|
2309
2338
|
];
|
|
2310
2339
|
const results = [];
|
|
@@ -3708,7 +3737,7 @@ var SleepManager = class {
|
|
|
3708
3737
|
const db = await getDb();
|
|
3709
3738
|
const rows = await db.select().from(deliveryQueue).where(and2(eq4(deliveryQueue.mind, name), eq4(deliveryQueue.status, "sleep-queued"))).all();
|
|
3710
3739
|
if (rows.length === 0) return 0;
|
|
3711
|
-
const { deliverMessage: deliverMessage2 } = await import("./message-delivery-
|
|
3740
|
+
const { deliverMessage: deliverMessage2 } = await import("./message-delivery-54IXVE5H.js");
|
|
3712
3741
|
const delivered = [];
|
|
3713
3742
|
for (const row of rows) {
|
|
3714
3743
|
try {
|
|
@@ -4618,7 +4647,7 @@ var DeliveryManager = class {
|
|
|
4618
4647
|
`To accept this channel, add a routing rule for "${channel}" to your routes.json.`,
|
|
4619
4648
|
`Messages are being held until a route is configured.`
|
|
4620
4649
|
].filter((line) => line !== null).join("\n");
|
|
4621
|
-
const { sendSystemMessage: sendSystemMessage2 } = await import("./system-chat-
|
|
4650
|
+
const { sendSystemMessage: sendSystemMessage2 } = await import("./system-chat-YUIT7RA6.js");
|
|
4622
4651
|
await sendSystemMessage2(mindName, notification);
|
|
4623
4652
|
}
|
|
4624
4653
|
async persistToQueue(mindName, session, payload, status = "pending") {
|
|
@@ -5141,7 +5170,7 @@ async function generateSystemReply(conversationId, mindName, message) {
|
|
|
5141
5170
|
if (config.sleep.schedule?.wake) contextParts.push(`Wake cron: ${config.sleep.schedule.wake}`);
|
|
5142
5171
|
}
|
|
5143
5172
|
try {
|
|
5144
|
-
const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-
|
|
5173
|
+
const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-VPPQXBPH.js");
|
|
5145
5174
|
const sm = getSleepManagerIfReady2();
|
|
5146
5175
|
if (sm) {
|
|
5147
5176
|
const state = sm.getState(mindName);
|
|
@@ -46,7 +46,7 @@ async function initDefaultSkills() {
|
|
|
46
46
|
const config = readGlobalConfig();
|
|
47
47
|
let extensionSkills = [];
|
|
48
48
|
try {
|
|
49
|
-
const { getExtensionStandardSkills } = await import("./extensions-
|
|
49
|
+
const { getExtensionStandardSkills } = await import("./extensions-P477XR46.js");
|
|
50
50
|
extensionSkills = getExtensionStandardSkills();
|
|
51
51
|
} catch (err) {
|
|
52
52
|
logger_default.warn("failed to load extension standard skills during init", logger_default.errorData(err));
|
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-LYQHSDPG.js");
|
|
14
14
|
console.log(pkg.version);
|
|
15
15
|
process.exit(0);
|
|
16
16
|
}
|
|
@@ -39,16 +39,16 @@ if (!ungatedCommands.has(command)) {
|
|
|
39
39
|
}
|
|
40
40
|
switch (command) {
|
|
41
41
|
case "setup":
|
|
42
|
-
await import("./setup-
|
|
42
|
+
await import("./setup-NPAZXBIJ.js").then((m) => m.run(args));
|
|
43
43
|
break;
|
|
44
44
|
case "mind":
|
|
45
|
-
await import("./mind-
|
|
45
|
+
await import("./mind-G5HDKBKL.js").then((m) => m.run(args));
|
|
46
46
|
break;
|
|
47
47
|
case "seed":
|
|
48
|
-
await import("./seed-cmd-
|
|
48
|
+
await import("./seed-cmd-6A76SSAA.js").then((m) => m.run(args));
|
|
49
49
|
break;
|
|
50
50
|
case "chat":
|
|
51
|
-
await import("./chat-
|
|
51
|
+
await import("./chat-XL7CVWVJ.js").then((m) => m.run(args));
|
|
52
52
|
break;
|
|
53
53
|
case "variant":
|
|
54
54
|
await import("./variant-HHDTW74J.js").then((m) => m.run(args));
|
|
@@ -66,19 +66,19 @@ switch (command) {
|
|
|
66
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-YRZAEZ3Z.js").then((m) => m.run(args));
|
|
70
70
|
break;
|
|
71
71
|
case "down":
|
|
72
|
-
await import("./down-
|
|
72
|
+
await import("./down-5XZWH4ZP.js").then((m) => m.run(args));
|
|
73
73
|
break;
|
|
74
74
|
case "restart":
|
|
75
|
-
await import("./daemon-restart-
|
|
75
|
+
await import("./daemon-restart-6QONRBTK.js").then((m) => m.run(args));
|
|
76
76
|
break;
|
|
77
77
|
case "update":
|
|
78
|
-
await import("./update-
|
|
78
|
+
await import("./update-ZCTQ6UGY.js").then((m) => m.run(args));
|
|
79
79
|
break;
|
|
80
80
|
case "status":
|
|
81
|
-
await import("./status-
|
|
81
|
+
await import("./status-TGOKAFW3.js").then((m) => m.run(args));
|
|
82
82
|
break;
|
|
83
83
|
case "extension":
|
|
84
84
|
await import("./extension-LZYHBNLV.js").then((m) => m.run(args));
|
|
@@ -93,7 +93,7 @@ switch (command) {
|
|
|
93
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-RH6Q2XWR.js").then((m) => m.run(args));
|
|
97
97
|
break;
|
|
98
98
|
case "--help":
|
|
99
99
|
case "-h":
|
|
@@ -126,7 +126,7 @@ Configuration:
|
|
|
126
126
|
env Manage environment variables
|
|
127
127
|
|
|
128
128
|
System:
|
|
129
|
-
setup
|
|
129
|
+
setup [--system] [--cli] First-time setup
|
|
130
130
|
up / down / restart Daemon control
|
|
131
131
|
status Show daemon & service status
|
|
132
132
|
extension list/install/uninstall Manage extensions
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
deliverMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TEZRVSSB.js";
|
|
5
5
|
import "./chunk-PMMHVSCR.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-2TR2OPVA.js";
|
|
7
7
|
import "./chunk-46DYYHN6.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-VUM2K6EN.js";
|
|
9
|
+
import {
|
|
10
|
+
getAuthHeaders,
|
|
11
|
+
getWebhookUrl
|
|
12
|
+
} from "./chunk-5DPRTREW.js";
|
|
9
13
|
import "./chunk-CU6OFXMM.js";
|
|
10
14
|
import "./chunk-KXXJYY62.js";
|
|
11
15
|
import "./chunk-7AZQFSOV.js";
|
|
@@ -13,13 +17,9 @@ import "./chunk-GVVVMZ4J.js";
|
|
|
13
17
|
import "./chunk-3F7XK5Q7.js";
|
|
14
18
|
import "./chunk-SNW2NPP4.js";
|
|
15
19
|
import "./chunk-UIM5NHPP.js";
|
|
20
|
+
import "./chunk-N42QMDID.js";
|
|
16
21
|
import "./chunk-ORNY3MZR.js";
|
|
17
22
|
import "./chunk-A6FLW5XD.js";
|
|
18
|
-
import {
|
|
19
|
-
getAuthHeaders,
|
|
20
|
-
getWebhookUrl
|
|
21
|
-
} from "./chunk-5DPRTREW.js";
|
|
22
|
-
import "./chunk-N42QMDID.js";
|
|
23
23
|
import {
|
|
24
24
|
logger_default
|
|
25
25
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
stopDaemon
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LN67VPZJ.js";
|
|
5
5
|
import {
|
|
6
6
|
run
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-NGXQ2ESO.js";
|
|
8
|
+
import {
|
|
9
|
+
command
|
|
10
|
+
} from "./chunk-TXSA4Q3V.js";
|
|
11
|
+
import "./chunk-O7IGP7ZW.js";
|
|
8
12
|
import {
|
|
9
13
|
getServiceMode,
|
|
10
14
|
modeLabel,
|
|
@@ -12,10 +16,6 @@ import {
|
|
|
12
16
|
readDaemonConfig,
|
|
13
17
|
restartService
|
|
14
18
|
} from "./chunk-TNZ5XQA4.js";
|
|
15
|
-
import {
|
|
16
|
-
command
|
|
17
|
-
} from "./chunk-TXSA4Q3V.js";
|
|
18
|
-
import "./chunk-O7IGP7ZW.js";
|
|
19
19
|
import "./chunk-3F7XK5Q7.js";
|
|
20
20
|
import "./chunk-SNW2NPP4.js";
|
|
21
21
|
import "./chunk-A6FLW5XD.js";
|