volute 0.41.1 → 0.42.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/{ai-service-XCLE3MQP.js → ai-service-3GBOJGUA.js} +10 -2
- package/dist/{chunk-ULNQ6OC4.js → chunk-2YRTSK5K.js} +2 -2
- package/dist/{chunk-IJCZAYGT.js → chunk-4ZSUUBG5.js} +97 -2
- package/dist/{chunk-F44AEQAW.js → chunk-52NMCDBS.js} +13 -13
- package/dist/{chunk-MJIJFCAH.js → chunk-JLX3GC7T.js} +2 -2
- package/dist/chunk-KZAL7HEQ.js +141 -0
- package/dist/{chunk-EKLRS2SX.js → chunk-RKBYFLOR.js} +1 -1
- package/dist/{chunk-GCS64EAD.js → chunk-TKOWXAHG.js} +3 -3
- package/dist/{chunk-MYJSKXGH.js → chunk-VSUZE2PD.js} +3 -3
- package/dist/{chunk-763WUVJQ.js → chunk-WR7CSHQ4.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/{cloud-sync-2XVXEOSU.js → cloud-sync-3OPHFOYQ.js} +7 -7
- package/dist/{create-OTM46ZUM.js → create-YNBZWD34.js} +1 -1
- package/dist/{daemon-restart-HDVGTYH7.js → daemon-restart-RAKGR56L.js} +2 -2
- package/dist/daemon.js +80 -42
- package/dist/{delivery-manager-CPADWRV2.js → delivery-manager-5Y35DOX3.js} +7 -7
- package/dist/{echo-text-GEDEEY7M.js → echo-text-YP3JVLNA.js} +8 -8
- package/dist/{extensions-SU3N4COT.js → extensions-BTNIUS5J.js} +7 -7
- package/dist/{message-delivery-HPMELC4Q.js → message-delivery-FPIL26WV.js} +7 -7
- package/dist/{mind-APS4URT7.js → mind-VXV6ZYZY.js} +3 -3
- package/dist/{mind-manager-74XQZEGX.js → mind-manager-OYOIBGK6.js} +7 -7
- package/dist/{mind-service-XGXSMQP6.js → mind-service-PR4PR4XI.js} +7 -7
- package/dist/{package-MVFX22K5.js → package-UWH5IM76.js} +1 -1
- package/dist/{sandbox-ND53WZVU.js → sandbox-E7RWZDVG.js} +2 -2
- package/dist/{scheduler-MEBQF5MW.js → scheduler-KXUY2I7W.js} +7 -7
- package/dist/{seed-L4XFZ3VX.js → seed-YQAOIXIY.js} +1 -1
- package/dist/{seed-cmd-NSTPYJFC.js → seed-cmd-7KJS4LCA.js} +2 -2
- package/dist/{seed-create-ZYCZC46W.js → seed-create-Z7NDRRGP.js} +3 -3
- package/dist/{seed-sprout-YXHU73XA.js → seed-sprout-PYDMVVUL.js} +4 -4
- package/dist/{setup-FPFWDMXD.js → setup-IYOUPCIK.js} +5 -1
- package/dist/{setup-RMR3TKCR.js → setup-VARJ7N6Z.js} +2 -2
- package/dist/{skills-AOZF6U2B.js → skills-YBCYVOPQ.js} +2 -2
- package/dist/{sleep-manager-OHM3TO62.js → sleep-manager-FJLASHHW.js} +7 -7
- package/dist/{spirit-ONLRFATY.js → spirit-NJFAY5CZ.js} +4 -4
- package/dist/{sprout-2KJOQZCL.js → sprout-B27C2WGE.js} +1 -1
- package/dist/{system-chat-HZUKBIKJ.js → system-chat-P6KVGW4T.js} +7 -7
- package/dist/{turn-tracker-TIX4DY2W.js → turn-tracker-W4TASMR7.js} +3 -3
- package/dist/{up-7KVNER6V.js → up-POJX6S5Y.js} +2 -2
- package/dist/{version-notify-UFFDUPCX.js → version-notify-TCKAX7ZA.js} +7 -7
- package/dist/web-assets/assets/{index-DaUp9iE2.js → index-CrFAsfiE.js} +10 -10
- package/dist/web-assets/assets/{index-DqHSW9Fr.css → index-D7udpBCx.css} +1 -1
- package/dist/web-assets/index.html +2 -2
- package/package.json +1 -1
- package/templates/codex/src/server.ts +8 -2
- package/templates/pi/src/lib/resolve-model.ts +50 -12
- package/dist/chunk-MA7MYEOK.js +0 -71
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
addCustomModel,
|
|
3
4
|
aiComplete,
|
|
4
5
|
aiCompleteUtility,
|
|
6
|
+
buildCustomModel,
|
|
5
7
|
fireProviderRefreshHook,
|
|
6
8
|
getAiConfig,
|
|
7
9
|
getAvailableModels,
|
|
8
10
|
getConfiguredProviders,
|
|
11
|
+
getCustomModels,
|
|
9
12
|
getEnabledModels,
|
|
10
13
|
getUtilityModel,
|
|
11
14
|
isAiConfigured,
|
|
12
15
|
qualifyModelId,
|
|
13
16
|
removeAiConfig,
|
|
17
|
+
removeCustomModel,
|
|
14
18
|
removeProviderConfig,
|
|
15
19
|
resolveApiKey,
|
|
16
20
|
resolveTemplate,
|
|
@@ -19,24 +23,28 @@ import {
|
|
|
19
23
|
setProviderRefreshHook,
|
|
20
24
|
setUtilityModel,
|
|
21
25
|
unqualifyModelId
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-4ZSUUBG5.js";
|
|
27
|
+
import "./chunk-KZAL7HEQ.js";
|
|
24
28
|
import "./chunk-T2TP6ZC6.js";
|
|
25
29
|
import "./chunk-IUZ3EV2D.js";
|
|
26
30
|
import "./chunk-MHFAWJCC.js";
|
|
27
31
|
import "./chunk-K3NQKI34.js";
|
|
28
32
|
export {
|
|
33
|
+
addCustomModel,
|
|
29
34
|
aiComplete,
|
|
30
35
|
aiCompleteUtility,
|
|
36
|
+
buildCustomModel,
|
|
31
37
|
fireProviderRefreshHook,
|
|
32
38
|
getAiConfig,
|
|
33
39
|
getAvailableModels,
|
|
34
40
|
getConfiguredProviders,
|
|
41
|
+
getCustomModels,
|
|
35
42
|
getEnabledModels,
|
|
36
43
|
getUtilityModel,
|
|
37
44
|
isAiConfigured,
|
|
38
45
|
qualifyModelId,
|
|
39
46
|
removeAiConfig,
|
|
47
|
+
removeCustomModel,
|
|
40
48
|
removeProviderConfig,
|
|
41
49
|
resolveApiKey,
|
|
42
50
|
resolveTemplate,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-QPTQKGGF.js";
|
|
6
6
|
import {
|
|
7
7
|
recordOutbound
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-52NMCDBS.js";
|
|
9
9
|
import {
|
|
10
10
|
readEnv,
|
|
11
11
|
sharedEnvPath
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
} from "./chunk-CU6OFXMM.js";
|
|
24
24
|
import {
|
|
25
25
|
publish
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-TKOWXAHG.js";
|
|
27
27
|
import {
|
|
28
28
|
getOrCreateMindUser,
|
|
29
29
|
getUserByUsername
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
readGlobalConfig,
|
|
4
4
|
writeGlobalConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KZAL7HEQ.js";
|
|
6
6
|
import {
|
|
7
7
|
logger_default
|
|
8
8
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -141,11 +141,96 @@ function setEnabledModels(modelIds) {
|
|
|
141
141
|
const config = readGlobalConfig();
|
|
142
142
|
writeGlobalConfig({ ...config, ai });
|
|
143
143
|
}
|
|
144
|
+
function getCustomModels() {
|
|
145
|
+
return getAiConfig()?.customModels ?? [];
|
|
146
|
+
}
|
|
147
|
+
function addCustomModel(provider, id, name) {
|
|
148
|
+
const ai = getAiConfig() ?? { providers: {} };
|
|
149
|
+
const customModels = ai.customModels ?? [];
|
|
150
|
+
if (!customModels.some((m) => m.provider === provider && m.id === id)) {
|
|
151
|
+
customModels.push({ provider, id, ...name ? { name } : {} });
|
|
152
|
+
}
|
|
153
|
+
ai.customModels = customModels;
|
|
154
|
+
const config = readGlobalConfig();
|
|
155
|
+
writeGlobalConfig({ ...config, ai });
|
|
156
|
+
}
|
|
157
|
+
function removeCustomModel(provider, id) {
|
|
158
|
+
const ai = getAiConfig();
|
|
159
|
+
if (!ai) return;
|
|
160
|
+
const customModels = (ai.customModels ?? []).filter(
|
|
161
|
+
(m) => !(m.provider === provider && m.id === id)
|
|
162
|
+
);
|
|
163
|
+
ai.customModels = customModels.length > 0 ? customModels : void 0;
|
|
164
|
+
if (!ai.customModels) delete ai.customModels;
|
|
165
|
+
if (ai.models) {
|
|
166
|
+
ai.models = ai.models.filter((mid) => mid !== id);
|
|
167
|
+
if (ai.models.length === 0) delete ai.models;
|
|
168
|
+
}
|
|
169
|
+
const config = readGlobalConfig();
|
|
170
|
+
writeGlobalConfig({ ...config, ai });
|
|
171
|
+
}
|
|
172
|
+
function sharedPrefixLength(a, b) {
|
|
173
|
+
let i = 0;
|
|
174
|
+
while (i < a.length && i < b.length && a[i] === b[i]) i++;
|
|
175
|
+
return i;
|
|
176
|
+
}
|
|
177
|
+
function pickSibling(provider, id) {
|
|
178
|
+
const siblings = getBuiltinModels(provider);
|
|
179
|
+
if (siblings.length === 0) return void 0;
|
|
180
|
+
let best = siblings[0];
|
|
181
|
+
let bestPrefix = -1;
|
|
182
|
+
for (const s of siblings) {
|
|
183
|
+
const prefix = sharedPrefixLength(s.id, id);
|
|
184
|
+
if (prefix > bestPrefix || prefix === bestPrefix && s.contextWindow > best.contextWindow) {
|
|
185
|
+
bestPrefix = prefix;
|
|
186
|
+
best = s;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
return best;
|
|
190
|
+
}
|
|
191
|
+
function buildCustomModel(provider, id, name) {
|
|
192
|
+
const sibling = pickSibling(provider, id);
|
|
193
|
+
if (!sibling) return void 0;
|
|
194
|
+
return {
|
|
195
|
+
...sibling,
|
|
196
|
+
id,
|
|
197
|
+
name: name ?? id,
|
|
198
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 }
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
function pruneAbsorbedCustomModels() {
|
|
202
|
+
const ai = getAiConfig();
|
|
203
|
+
const custom = ai?.customModels ?? [];
|
|
204
|
+
if (custom.length === 0 || !ai) return custom;
|
|
205
|
+
const kept = custom.filter((cm) => !getBuiltinModel(cm.provider, cm.id));
|
|
206
|
+
if (kept.length !== custom.length) {
|
|
207
|
+
ai.customModels = kept.length > 0 ? kept : void 0;
|
|
208
|
+
if (!ai.customModels) delete ai.customModels;
|
|
209
|
+
const config = readGlobalConfig();
|
|
210
|
+
writeGlobalConfig({ ...config, ai });
|
|
211
|
+
}
|
|
212
|
+
return kept;
|
|
213
|
+
}
|
|
144
214
|
async function getAvailableModels() {
|
|
145
215
|
const providers = await getConfiguredProviders();
|
|
216
|
+
const configured = new Set(providers);
|
|
146
217
|
const result = [];
|
|
218
|
+
const seen = /* @__PURE__ */ new Set();
|
|
147
219
|
for (const provider of providers) {
|
|
148
|
-
|
|
220
|
+
for (const m of getBuiltinModels(provider)) {
|
|
221
|
+
result.push(m);
|
|
222
|
+
seen.add(m.id);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
for (const cm of pruneAbsorbedCustomModels()) {
|
|
226
|
+
if (!configured.has(cm.provider) || seen.has(cm.id)) continue;
|
|
227
|
+
const built = buildCustomModel(cm.provider, cm.id, cm.name);
|
|
228
|
+
if (built) {
|
|
229
|
+
result.push(built);
|
|
230
|
+
seen.add(cm.id);
|
|
231
|
+
} else {
|
|
232
|
+
aiLog.warn(`custom model ${cm.provider}:${cm.id} has no sibling to clone from; skipping`);
|
|
233
|
+
}
|
|
149
234
|
}
|
|
150
235
|
return result;
|
|
151
236
|
}
|
|
@@ -185,6 +270,12 @@ function findModel(modelId) {
|
|
|
185
270
|
const model = getBuiltinModel(provider, modelId);
|
|
186
271
|
if (model) return model;
|
|
187
272
|
}
|
|
273
|
+
for (const cm of getCustomModels()) {
|
|
274
|
+
if (cm.id === modelId) {
|
|
275
|
+
const built = buildCustomModel(cm.provider, cm.id, cm.name);
|
|
276
|
+
if (built) return built;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
188
279
|
for (const provider of getBuiltinProviders()) {
|
|
189
280
|
const found = getBuiltinModels(provider).find((m) => m.id.startsWith(modelId));
|
|
190
281
|
if (found) return found;
|
|
@@ -240,6 +331,10 @@ export {
|
|
|
240
331
|
resolveTemplate,
|
|
241
332
|
getEnabledModels,
|
|
242
333
|
setEnabledModels,
|
|
334
|
+
getCustomModels,
|
|
335
|
+
addCustomModel,
|
|
336
|
+
removeCustomModel,
|
|
337
|
+
buildCustomModel,
|
|
243
338
|
getAvailableModels,
|
|
244
339
|
resolveApiKey,
|
|
245
340
|
qualifyModelId,
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
} from "./chunk-BLOAJLGI.js";
|
|
5
5
|
import {
|
|
6
6
|
spiritDir
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VSUZE2PD.js";
|
|
8
8
|
import {
|
|
9
9
|
hashSkillDir,
|
|
10
10
|
importSkillFromDir,
|
|
11
11
|
removeSharedSkill,
|
|
12
12
|
sharedSkillsDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JLX3GC7T.js";
|
|
14
14
|
import {
|
|
15
15
|
addMessage,
|
|
16
16
|
createChannel,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
isSandboxEnabled,
|
|
30
30
|
wrapForSandbox
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-WR7CSHQ4.js";
|
|
32
32
|
import {
|
|
33
33
|
markIdle,
|
|
34
34
|
onMindEvent
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
getPrompt,
|
|
46
46
|
publish as publish3,
|
|
47
47
|
summarizeOrphanedTurns
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-TKOWXAHG.js";
|
|
49
49
|
import {
|
|
50
50
|
exec
|
|
51
51
|
} from "./chunk-GN52E2DP.js";
|
|
@@ -59,11 +59,11 @@ import {
|
|
|
59
59
|
aiCompleteUtility,
|
|
60
60
|
getAiConfig,
|
|
61
61
|
resolveApiKey
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-4ZSUUBG5.js";
|
|
63
63
|
import {
|
|
64
64
|
readGlobalConfig,
|
|
65
65
|
writeGlobalConfig
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-KZAL7HEQ.js";
|
|
67
67
|
import {
|
|
68
68
|
getOrCreateMindUser,
|
|
69
69
|
getOrCreateSystemUser,
|
|
@@ -838,7 +838,7 @@ var MindManager = class {
|
|
|
838
838
|
if (this.shuttingDown || this.stopping.has(name)) return;
|
|
839
839
|
mlog.error(`mind ${name} exited with code ${code}`);
|
|
840
840
|
try {
|
|
841
|
-
const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-
|
|
841
|
+
const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-FJLASHHW.js");
|
|
842
842
|
const sleepState = getSleepManagerIfReady2()?.getState(name);
|
|
843
843
|
if (sleepState?.sleeping) {
|
|
844
844
|
mlog.info(`${name} is sleeping \u2014 skipping crash recovery`);
|
|
@@ -862,7 +862,7 @@ var MindManager = class {
|
|
|
862
862
|
(err) => mlog.warn(`failed to clear turn state for ${name} after crash`, logger_default.errorData(err))
|
|
863
863
|
);
|
|
864
864
|
try {
|
|
865
|
-
const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-
|
|
865
|
+
const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-5Y35DOX3.js");
|
|
866
866
|
getDeliveryManager2().clearMindSessions(name);
|
|
867
867
|
} catch (err) {
|
|
868
868
|
if (!(err instanceof Error && err.message.includes("not initialized"))) {
|
|
@@ -921,7 +921,7 @@ var MindManager = class {
|
|
|
921
921
|
mlog.warn(`failed to clear turn state for ${name} on stop`, logger_default.errorData(err));
|
|
922
922
|
}
|
|
923
923
|
try {
|
|
924
|
-
const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-
|
|
924
|
+
const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-5Y35DOX3.js");
|
|
925
925
|
getDeliveryManager2().clearMindSessions(name);
|
|
926
926
|
} catch (err) {
|
|
927
927
|
if (!(err instanceof Error && err.message.includes("not initialized"))) {
|
|
@@ -929,7 +929,7 @@ var MindManager = class {
|
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
931
|
try {
|
|
932
|
-
const { clearEchoTextCache } = await import("./echo-text-
|
|
932
|
+
const { clearEchoTextCache } = await import("./echo-text-YP3JVLNA.js");
|
|
933
933
|
clearEchoTextCache(name);
|
|
934
934
|
} catch (err) {
|
|
935
935
|
mlog.debug(`failed to clear echo-text cache for ${name}`, logger_default.errorData(err));
|
|
@@ -2992,7 +2992,7 @@ var SleepManager = class {
|
|
|
2992
2992
|
const db = await getDb();
|
|
2993
2993
|
const rows = await db.select().from(deliveryQueue).where(and2(eq3(deliveryQueue.mind, name), eq3(deliveryQueue.status, "sleep-queued"))).all();
|
|
2994
2994
|
if (rows.length === 0) return 0;
|
|
2995
|
-
const { deliverMessage: deliverMessage2 } = await import("./message-delivery-
|
|
2995
|
+
const { deliverMessage: deliverMessage2 } = await import("./message-delivery-FPIL26WV.js");
|
|
2996
2996
|
const delivered = [];
|
|
2997
2997
|
for (const row of rows) {
|
|
2998
2998
|
try {
|
|
@@ -3924,7 +3924,7 @@ var DeliveryManager = class {
|
|
|
3924
3924
|
`To accept this channel, add a routing rule for "${channel}" to your routes.json.`,
|
|
3925
3925
|
`Messages are being held until a route is configured.`
|
|
3926
3926
|
].filter((line) => line !== null).join("\n");
|
|
3927
|
-
const { sendSystemMessage: sendSystemMessage2 } = await import("./system-chat-
|
|
3927
|
+
const { sendSystemMessage: sendSystemMessage2 } = await import("./system-chat-P6KVGW4T.js");
|
|
3928
3928
|
await sendSystemMessage2(mindName, notification);
|
|
3929
3929
|
}
|
|
3930
3930
|
async persistToQueue(mindName, session, payload, status = "pending") {
|
|
@@ -4450,7 +4450,7 @@ async function generateSystemReply(conversationId, mindName, message) {
|
|
|
4450
4450
|
if (config.sleep.schedule?.wake) contextParts.push(`Wake cron: ${config.sleep.schedule.wake}`);
|
|
4451
4451
|
}
|
|
4452
4452
|
try {
|
|
4453
|
-
const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-
|
|
4453
|
+
const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-FJLASHHW.js");
|
|
4454
4454
|
const sm = getSleepManagerIfReady2();
|
|
4455
4455
|
if (sm) {
|
|
4456
4456
|
const state = sm.getState(mindName);
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
readGlobalConfig,
|
|
8
8
|
writeGlobalConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KZAL7HEQ.js";
|
|
10
10
|
import {
|
|
11
11
|
logger_default
|
|
12
12
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -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-BTNIUS5J.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));
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
voluteSystemDir
|
|
4
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
5
|
+
|
|
6
|
+
// packages/daemon/src/lib/config/setup.ts
|
|
7
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
8
|
+
import { resolve } from "path";
|
|
9
|
+
function configPath() {
|
|
10
|
+
return resolve(voluteSystemDir(), "config.json");
|
|
11
|
+
}
|
|
12
|
+
function secretsPath() {
|
|
13
|
+
return resolve(voluteSystemDir(), "secrets.json");
|
|
14
|
+
}
|
|
15
|
+
function hasEntries(obj) {
|
|
16
|
+
return !!obj && Object.keys(obj).length > 0;
|
|
17
|
+
}
|
|
18
|
+
function splitConfig(config) {
|
|
19
|
+
const publicConfig = { ...config };
|
|
20
|
+
const secrets = {};
|
|
21
|
+
if (config.ai) {
|
|
22
|
+
const { providers, ...rest } = config.ai;
|
|
23
|
+
publicConfig.ai = { ...rest, providers: {} };
|
|
24
|
+
if (hasEntries(providers)) secrets.ai = { providers };
|
|
25
|
+
}
|
|
26
|
+
if (config.imagegen) {
|
|
27
|
+
const { providers, ...rest } = config.imagegen;
|
|
28
|
+
publicConfig.imagegen = { ...rest };
|
|
29
|
+
if (providers && Object.keys(providers).length > 0) secrets.imagegen = { providers };
|
|
30
|
+
}
|
|
31
|
+
return { publicConfig, secrets };
|
|
32
|
+
}
|
|
33
|
+
function mergeSecrets(publicConfig, secrets) {
|
|
34
|
+
const merged = { ...publicConfig };
|
|
35
|
+
if (secrets.ai?.providers) {
|
|
36
|
+
merged.ai = { ...merged.ai ?? { providers: {} }, providers: secrets.ai.providers };
|
|
37
|
+
}
|
|
38
|
+
if (secrets.imagegen?.providers) {
|
|
39
|
+
merged.imagegen = { ...merged.imagegen ?? {}, providers: secrets.imagegen.providers };
|
|
40
|
+
}
|
|
41
|
+
return merged;
|
|
42
|
+
}
|
|
43
|
+
function readSecrets() {
|
|
44
|
+
const path = secretsPath();
|
|
45
|
+
if (!existsSync(path)) return {};
|
|
46
|
+
try {
|
|
47
|
+
return JSON.parse(readFileSync(path, "utf-8"));
|
|
48
|
+
} catch {
|
|
49
|
+
return {};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
var _cachedConfig = null;
|
|
53
|
+
var CONFIG_CACHE_TTL = 2e3;
|
|
54
|
+
function _resetConfigCache() {
|
|
55
|
+
_cachedConfig = null;
|
|
56
|
+
}
|
|
57
|
+
function readGlobalConfig() {
|
|
58
|
+
if (_cachedConfig && Date.now() - _cachedConfig.ts < CONFIG_CACHE_TTL) {
|
|
59
|
+
return { ..._cachedConfig.config };
|
|
60
|
+
}
|
|
61
|
+
const path = configPath();
|
|
62
|
+
if (!existsSync(path)) {
|
|
63
|
+
_cachedConfig = null;
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
let publicConfig;
|
|
67
|
+
try {
|
|
68
|
+
publicConfig = JSON.parse(readFileSync(path, "utf-8"));
|
|
69
|
+
} catch (err) {
|
|
70
|
+
console.error(`Failed to parse ${path}: ${err instanceof Error ? err.message : err}`);
|
|
71
|
+
return {};
|
|
72
|
+
}
|
|
73
|
+
const config = mergeSecrets(publicConfig, readSecrets());
|
|
74
|
+
_cachedConfig = { config, ts: Date.now() };
|
|
75
|
+
return config;
|
|
76
|
+
}
|
|
77
|
+
function writeGlobalConfig(config) {
|
|
78
|
+
mkdirSync(voluteSystemDir(), { recursive: true });
|
|
79
|
+
const { publicConfig, secrets } = splitConfig(config);
|
|
80
|
+
const cfgPath = configPath();
|
|
81
|
+
writeFileSync(cfgPath, `${JSON.stringify(publicConfig, null, 2)}
|
|
82
|
+
`, { mode: 420 });
|
|
83
|
+
chmodSync(cfgPath, 420);
|
|
84
|
+
const secPath = secretsPath();
|
|
85
|
+
writeFileSync(secPath, `${JSON.stringify(secrets, null, 2)}
|
|
86
|
+
`, { mode: 384 });
|
|
87
|
+
chmodSync(secPath, 384);
|
|
88
|
+
_cachedConfig = { config, ts: Date.now() };
|
|
89
|
+
}
|
|
90
|
+
function migrateConfigSecrets() {
|
|
91
|
+
const path = configPath();
|
|
92
|
+
if (!existsSync(path)) return;
|
|
93
|
+
let raw;
|
|
94
|
+
try {
|
|
95
|
+
raw = readFileSync(path, "utf-8");
|
|
96
|
+
} catch {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
let parsed;
|
|
100
|
+
try {
|
|
101
|
+
parsed = JSON.parse(raw);
|
|
102
|
+
} catch {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const embedsSecrets = hasEntries(parsed.ai?.providers) || hasEntries(parsed.imagegen?.providers);
|
|
106
|
+
const mode = statSync(path).mode & 511;
|
|
107
|
+
if (!embedsSecrets && mode === 420) return;
|
|
108
|
+
_resetConfigCache();
|
|
109
|
+
writeGlobalConfig(readGlobalConfig());
|
|
110
|
+
}
|
|
111
|
+
function isSetupComplete() {
|
|
112
|
+
const config = readGlobalConfig();
|
|
113
|
+
return config.setupCompleted === true;
|
|
114
|
+
}
|
|
115
|
+
function isImagegenEnabled() {
|
|
116
|
+
const config = readGlobalConfig();
|
|
117
|
+
const ig = config.imagegen;
|
|
118
|
+
if (!ig) return false;
|
|
119
|
+
if (ig.enabled === true) return true;
|
|
120
|
+
if (ig.providers && Object.keys(ig.providers).length > 0) return true;
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
function migrateSetupCompleted() {
|
|
124
|
+
const config = readGlobalConfig();
|
|
125
|
+
if (config.setup != null && config.setupCompleted == null) {
|
|
126
|
+
config.setupCompleted = true;
|
|
127
|
+
writeGlobalConfig(config);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export {
|
|
132
|
+
configPath,
|
|
133
|
+
secretsPath,
|
|
134
|
+
_resetConfigCache,
|
|
135
|
+
readGlobalConfig,
|
|
136
|
+
writeGlobalConfig,
|
|
137
|
+
migrateConfigSecrets,
|
|
138
|
+
isSetupComplete,
|
|
139
|
+
isImagegenEnabled,
|
|
140
|
+
migrateSetupCompleted
|
|
141
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
aiCompleteUtility
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4ZSUUBG5.js";
|
|
5
5
|
import {
|
|
6
6
|
logger_default
|
|
7
7
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -1013,11 +1013,11 @@ var Summarizer = class {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
};
|
|
1015
1015
|
async function reconcileWedgedTurns(idleMs) {
|
|
1016
|
-
const { sweepWedgedTurns: sweepWedgedTurns2, summarizeOrphanedTurns: summarizeOrphanedTurns2 } = await import("./turn-tracker-
|
|
1016
|
+
const { sweepWedgedTurns: sweepWedgedTurns2, summarizeOrphanedTurns: summarizeOrphanedTurns2 } = await import("./turn-tracker-W4TASMR7.js");
|
|
1017
1017
|
const wedged = await sweepWedgedTurns2(idleMs);
|
|
1018
1018
|
if (wedged.length === 0) return;
|
|
1019
1019
|
summarizeOrphanedTurns2(wedged);
|
|
1020
|
-
const { tryGetDeliveryManager } = await import("./delivery-manager-
|
|
1020
|
+
const { tryGetDeliveryManager } = await import("./delivery-manager-5Y35DOX3.js");
|
|
1021
1021
|
const dm = tryGetDeliveryManager();
|
|
1022
1022
|
if (!dm) return;
|
|
1023
1023
|
for (const t of wedged) {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getSharedSkill,
|
|
11
11
|
installSkill,
|
|
12
12
|
mindSkillsDir
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JLX3GC7T.js";
|
|
14
14
|
import {
|
|
15
15
|
readVoluteConfig,
|
|
16
16
|
writeVoluteConfig
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
qualifyModelId,
|
|
23
23
|
resolveTemplate
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-4ZSUUBG5.js";
|
|
25
25
|
import {
|
|
26
26
|
readGlobalConfig
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-KZAL7HEQ.js";
|
|
28
28
|
import {
|
|
29
29
|
logger_default
|
|
30
30
|
} from "./chunk-T2TP6ZC6.js";
|
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-UWH5IM76.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-IYOUPCIK.js");
|
|
35
35
|
if (!isSetupComplete()) {
|
|
36
36
|
console.error("Volute is not set up. Run `volute setup` first.");
|
|
37
37
|
process.exit(1);
|
|
@@ -39,13 +39,13 @@ if (!ungatedCommands.has(command)) {
|
|
|
39
39
|
}
|
|
40
40
|
switch (command) {
|
|
41
41
|
case "setup":
|
|
42
|
-
await import("./setup-
|
|
42
|
+
await import("./setup-VARJ7N6Z.js").then((m) => m.run(args));
|
|
43
43
|
break;
|
|
44
44
|
case "mind":
|
|
45
|
-
await import("./mind-
|
|
45
|
+
await import("./mind-VXV6ZYZY.js").then((m) => m.run(args));
|
|
46
46
|
break;
|
|
47
47
|
case "seed":
|
|
48
|
-
await import("./seed-cmd-
|
|
48
|
+
await import("./seed-cmd-7KJS4LCA.js").then((m) => m.run(args));
|
|
49
49
|
break;
|
|
50
50
|
case "chat":
|
|
51
51
|
await import("./chat-7DOENBY2.js").then((m) => m.run(args));
|
|
@@ -66,13 +66,13 @@ switch (command) {
|
|
|
66
66
|
await import("./config-W7MS3PWY.js").then((m) => m.run(args));
|
|
67
67
|
break;
|
|
68
68
|
case "up":
|
|
69
|
-
await import("./up-
|
|
69
|
+
await import("./up-POJX6S5Y.js").then((m) => m.run(args));
|
|
70
70
|
break;
|
|
71
71
|
case "down":
|
|
72
72
|
await import("./down-DS6WCT34.js").then((m) => m.run(args));
|
|
73
73
|
break;
|
|
74
74
|
case "restart":
|
|
75
|
-
await import("./daemon-restart-
|
|
75
|
+
await import("./daemon-restart-RAKGR56L.js").then((m) => m.run(args));
|
|
76
76
|
break;
|
|
77
77
|
case "update":
|
|
78
78
|
await import("./update-OPR4KU4M.js").then((m) => m.run(args));
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
deliverMessage
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-52NMCDBS.js";
|
|
5
5
|
import "./chunk-BLOAJLGI.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-VSUZE2PD.js";
|
|
7
7
|
import "./chunk-QLWG3C2Z.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-JLX3GC7T.js";
|
|
9
9
|
import {
|
|
10
10
|
getAuthHeaders,
|
|
11
11
|
getWebhookUrl
|
|
12
12
|
} from "./chunk-YLTIEEVL.js";
|
|
13
13
|
import "./chunk-CU6OFXMM.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-WR7CSHQ4.js";
|
|
15
15
|
import "./chunk-VBKRZCR7.js";
|
|
16
16
|
import "./chunk-62ICA2FF.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-TKOWXAHG.js";
|
|
18
18
|
import "./chunk-GN52E2DP.js";
|
|
19
19
|
import "./chunk-TFBQESH7.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-4ZSUUBG5.js";
|
|
21
|
+
import "./chunk-KZAL7HEQ.js";
|
|
22
22
|
import "./chunk-5QG36RV7.js";
|
|
23
23
|
import "./chunk-K547QOCM.js";
|
|
24
24
|
import {
|
|
@@ -21,7 +21,7 @@ var cmd = command({
|
|
|
21
21
|
const name = args.name;
|
|
22
22
|
let template = flags.template;
|
|
23
23
|
if (!template) {
|
|
24
|
-
const { resolveTemplate } = await import("./ai-service-
|
|
24
|
+
const { resolveTemplate } = await import("./ai-service-3GBOJGUA.js");
|
|
25
25
|
template = await resolveTemplate();
|
|
26
26
|
}
|
|
27
27
|
const skills = flags.skills === "none" ? [] : flags.skills ? flags.skills.split(",") : void 0;
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-G777ME4L.js";
|
|
5
5
|
import {
|
|
6
6
|
run
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-RKBYFLOR.js";
|
|
8
8
|
import {
|
|
9
9
|
command
|
|
10
10
|
} from "./chunk-TXSA4Q3V.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-CGPESELY.js";
|
|
19
19
|
import "./chunk-GN52E2DP.js";
|
|
20
20
|
import "./chunk-TFBQESH7.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-KZAL7HEQ.js";
|
|
22
22
|
import "./chunk-IUZ3EV2D.js";
|
|
23
23
|
import "./chunk-MHFAWJCC.js";
|
|
24
24
|
import "./chunk-K3NQKI34.js";
|