volute 0.29.0 → 0.30.1
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 +112 -13
- package/dist/{accept-666DIZX2.js → accept-E3PAH3QJ.js} +2 -2
- package/dist/{activity-events-BBIEA2F4.js → activity-events-BKBPPUBP.js} +2 -2
- package/dist/ai-service-VAJT5UBS.js +29 -0
- package/dist/api.d.ts +351 -477
- package/dist/{archive-UA4BDFXQ.js → archive-WWDBWYN2.js} +2 -2
- package/dist/{bridge-FQHZL3MC.js → bridge-RO37CUFM.js} +2 -2
- package/dist/{chat-KTPOR2JT.js → chat-TCUNPFGO.js} +8 -8
- package/dist/{chunk-FLZGS4QH.js → chunk-2C2VXEBB.js} +2 -2
- package/dist/chunk-2NDZC3S7.js +1330 -0
- package/dist/{chunk-IKRVFPWU.js → chunk-7D47T4RB.js} +3 -2
- package/dist/{chunk-AW7PFDVN.js → chunk-CVH6Y2YG.js} +1 -1
- package/dist/{chunk-XBLSAVJF.js → chunk-DTC6EH5I.js} +1 -1
- package/dist/{chunk-THUUIU3E.js → chunk-EFP3PE6C.js} +5 -5
- package/dist/{chunk-JGFVMROS.js → chunk-EFVHR7KH.js} +1 -1
- package/dist/{chunk-CQ7SNKNI.js → chunk-FSM45XD5.js} +1 -1
- package/dist/{chunk-LAC664WU.js → chunk-FXHXHI2A.js} +42 -24
- package/dist/{chunk-RKQEHRBB.js → chunk-G3GBKZGG.js} +1 -1
- package/dist/{chunk-H7OZRFJB.js → chunk-HHTXM4JT.js} +0 -49
- package/dist/{chunk-J4IBNXGJ.js → chunk-IKHDUZRH.js} +4 -3
- package/dist/{chunk-MD4C26II.js → chunk-JGFRDMR6.js} +1 -1
- package/dist/{chunk-EHZKEMMV.js → chunk-LIRWLNAK.js} +24 -10
- package/dist/{chunk-NI5FFCCS.js → chunk-MDPCSXZ4.js} +35 -11
- package/dist/chunk-NSBFETWP.js +188 -0
- package/dist/{chunk-VIVMW2H2.js → chunk-P27RV5WM.js} +1 -1
- package/dist/{chunk-EHYDTZTF.js → chunk-P7VFDSSG.js} +2 -2
- package/dist/{chunk-CMILSHZD.js → chunk-QVAQ5454.js} +84 -300
- package/dist/{chunk-HDN7MNGD.js → chunk-S5LR3XYJ.js} +1 -1
- package/dist/{chunk-2YP2TVDT.js → chunk-UPA6COHU.js} +5 -5
- package/dist/{chunk-AKPFNL7L.js → chunk-VGWJSNHS.js} +1 -1
- package/dist/{chunk-DUAUMCEE.js → chunk-W5OOPLNP.js} +3 -3
- package/dist/{chunk-2WPW7OT6.js → chunk-ZWKTUQEL.js} +1 -1
- package/dist/cli.js +22 -26
- package/dist/{clock-DGCBVGYA.js → clock-G3ALCMLJ.js} +10 -6
- package/dist/{cloud-sync-KILFGV5Q.js → cloud-sync-JV4LJOK3.js} +13 -12
- package/dist/{conversations-P5BL7RMX.js → conversations-7KVQV7EZ.js} +3 -3
- package/dist/{create-DFCAGEE5.js → create-JTLS7GX3.js} +2 -2
- package/dist/{create-QWV73WXD.js → create-VQSQHJQW.js} +1 -1
- package/dist/{daemon-client-I42FK2BF.js → daemon-client-BCTFGVCZ.js} +2 -2
- package/dist/{daemon-restart-UHOMICXT.js → daemon-restart-4JGBHEJ4.js} +7 -7
- package/dist/daemon.js +1257 -1022
- package/dist/{db-IC4J52XQ.js → db-HMFPIRO2.js} +1 -1
- package/dist/{delete-4JYGD4VN.js → delete-JESHKE7F.js} +1 -1
- package/dist/down-NGBMGORS.js +14 -0
- package/dist/{env-YJMUMFIY.js → env-CLXXT7M2.js} +2 -2
- package/dist/{export-BOJQWBMA.js → export-EGA5M5PB.js} +3 -3
- package/dist/extension-WZ4SUPJB.js +174 -0
- package/dist/extensions-ECO4RPFQ.js +27 -0
- package/dist/{files-M546TKVN.js → files-4VEJDASH.js} +3 -3
- package/dist/{history-ALPTNB3I.js → history-EJMMLXDO.js} +17 -2
- package/dist/{import-SRTQXBGH.js → import-YCGPMBSI.js} +3 -3
- package/dist/{join-J4QU42DL.js → join-2GBJKZEN.js} +1 -1
- package/dist/{list-R73GENNL.js → list-Q6O7FGAN.js} +2 -2
- package/dist/{login-3QZNR2DF.js → login-RET5WESK.js} +2 -2
- package/dist/{login-BKP3AFWN.js → login-RL6AU2SM.js} +3 -3
- package/dist/{logout-T53VKCPU.js → logout-CGAGJN3L.js} +2 -2
- package/dist/{logout-IQK7FNEK.js → logout-JRPBEMMR.js} +3 -3
- package/dist/message-delivery-6YMVNOEC.js +28 -0
- package/dist/{migrate-registry-to-db-XC7T5B7P.js → migrate-registry-to-db-FK35IPEH.js} +1 -1
- package/dist/{mind-S5V6CK5W.js → mind-LUWRQUQ5.js} +17 -17
- package/dist/{mind-activity-tracker-WRHFI3YW.js → mind-activity-tracker-VYN2ZZ2M.js} +3 -3
- package/dist/{mind-list-UPJ75GPI.js → mind-list-V5WW5DUA.js} +2 -2
- package/dist/{mind-manager-P66HQDNE.js → mind-manager-YFCOIAAX.js} +6 -6
- package/dist/{mind-sleep-BTSWQNAC.js → mind-sleep-R6PTNNW4.js} +2 -2
- package/dist/{mind-status-TK5AETEM.js → mind-status-I4ISFJ6I.js} +2 -2
- package/dist/{mind-wake-SBAKIDVP.js → mind-wake-67ZQEWAV.js} +2 -2
- package/dist/{package-OFKXNKJF.js → package-OYUD4ZJ4.js} +12 -6
- package/dist/{pages-watcher-P7QECRE2.js → pages-watcher-Z3PKNROC.js} +3 -3
- package/dist/{read-36UFXN3G.js → read-WQMPTSN2.js} +2 -2
- package/dist/{register-CHREOMJ3.js → register-NZDSTLP3.js} +3 -3
- package/dist/{registry-NDNOOYG4.js → registry-ODSALQQL.js} +1 -1
- package/dist/{reject-LXIZFJ4Q.js → reject-2HZOJEIJ.js} +2 -2
- package/dist/{restart-6ESL3NBO.js → restart-QHS3NT64.js} +2 -2
- package/dist/{sandbox-5BW5HPXM.js → sandbox-O5FUSF43.js} +3 -3
- package/dist/{seed-SSUCYYDF.js → seed-WUQMPLDM.js} +1 -1
- package/dist/{send-TAOEZ4NH.js → send-OAN3RYYY.js} +20 -6
- package/dist/{setup-JHL5ZEST.js → setup-QMDK5RZX.js} +2 -2
- package/dist/{setup-RXYVGGT7.js → setup-XJH3E7YM.js} +45 -14
- package/dist/{skill-AUAQTSP5.js → skill-FZIN4W4Q.js} +65 -3
- package/dist/skills/volute-mind/SKILL.md +10 -19
- package/dist/sleep-manager-O7YQFCV5.js +30 -0
- package/dist/{split-TKJ5OT3P.js → split-EXYGGGQN.js} +1 -1
- package/dist/{sprout-UNT7LKKE.js → sprout-AXQ6H5DB.js} +8 -7
- package/dist/{start-EUJSS5R4.js → start-MTOVL6SY.js} +2 -2
- package/dist/{status-NQJYR4BG.js → status-ZRO37MWR.js} +5 -5
- package/dist/{stop-3XAITBBF.js → stop-OK5WEPVC.js} +2 -2
- package/dist/{systems-SMEFSHTA.js → systems-W3BBMSOZ.js} +5 -5
- package/dist/{tailscale-NY5MUMY3.js → tailscale-BM72RXCJ.js} +1 -1
- package/dist/{template-hash-BIMA4ILT.js → template-hash-3HOR4UAJ.js} +1 -1
- package/dist/up-BXUAIDXB.js +17 -0
- package/dist/{update-PTSH22AZ.js → update-PLPHMMZ2.js} +5 -5
- package/dist/{update-check-64FWC4Y2.js → update-check-CVCN7MF6.js} +2 -2
- package/dist/{upgrade-HA47CS4C.js → upgrade-I6NPCYUU.js} +1 -1
- package/dist/{version-notify-WDHRO3XD.js → version-notify-2NTWVEHL.js} +15 -14
- package/dist/web-assets/assets/index--kREqKl9.js +72 -0
- package/dist/web-assets/assets/index-BXYTG0nJ.css +1 -0
- package/dist/web-assets/ext-theme.css +111 -0
- package/dist/web-assets/index.html +2 -2
- package/package.json +12 -6
- package/packages/extensions/notes/dist/ui/assets/index-DgawVO5g.css +1 -0
- package/packages/extensions/notes/dist/ui/assets/index-qUWoeC4c.js +2 -0
- package/packages/extensions/notes/dist/ui/index.html +14 -0
- package/packages/extensions/notes/skills/notes/SKILL.md +62 -0
- package/packages/extensions/notes/skills/notes/scripts/notes.mjs +185 -0
- package/packages/extensions/pages/dist/ui/assets/index-D0HyS-xQ.css +1 -0
- package/packages/extensions/pages/dist/ui/assets/index-tLTROSk5.js +2 -0
- package/packages/extensions/pages/dist/ui/index.html +14 -0
- package/packages/extensions/pages/skills/pages/SKILL.md +58 -0
- package/templates/_base/home/VOLUTE.md +1 -1
- package/dist/chunk-P72MVS4R.js +0 -188
- package/dist/chunk-ZYGKG6VC.js +0 -22
- package/dist/down-LVBXEULC.js +0 -14
- package/dist/message-delivery-Q7VUMIEI.js +0 -27
- package/dist/notes-XCER3I7M.js +0 -220
- package/dist/pages-EUJR52AH.js +0 -36
- package/dist/publish-ZZB33WP4.js +0 -86
- package/dist/skills/notes/SKILL.md +0 -34
- package/dist/sleep-manager-G4B5GW5P.js +0 -29
- package/dist/status-S7UUPNRW.js +0 -38
- package/dist/up-W6VAK2XE.js +0 -17
- package/dist/web-assets/assets/index-BmKDnWDB.css +0 -1
- package/dist/web-assets/assets/index-CLJMx-GA.js +0 -71
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
logger_default
|
|
4
|
+
} from "./chunk-YUIHSKR6.js";
|
|
5
|
+
import {
|
|
6
|
+
readGlobalConfig,
|
|
7
|
+
writeGlobalConfig
|
|
8
|
+
} from "./chunk-7D47T4RB.js";
|
|
9
|
+
|
|
10
|
+
// src/lib/ai-service.ts
|
|
11
|
+
import {
|
|
12
|
+
complete,
|
|
13
|
+
getEnvApiKey,
|
|
14
|
+
getModel,
|
|
15
|
+
getModels,
|
|
16
|
+
getOAuthApiKey,
|
|
17
|
+
getProviders
|
|
18
|
+
} from "@mariozechner/pi-ai";
|
|
19
|
+
var aiLog = logger_default.child("ai-service");
|
|
20
|
+
function getAiConfig() {
|
|
21
|
+
const config = readGlobalConfig();
|
|
22
|
+
if (!config.ai) return null;
|
|
23
|
+
const ai = config.ai;
|
|
24
|
+
if ("provider" in ai && !("providers" in ai)) {
|
|
25
|
+
const old = ai;
|
|
26
|
+
const migrated = {
|
|
27
|
+
providers: {
|
|
28
|
+
[old.provider]: {
|
|
29
|
+
...old.apiKey ? { apiKey: old.apiKey } : {},
|
|
30
|
+
...old.oauth ? { oauth: old.oauth } : {}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
writeGlobalConfig({ ...config, ai: migrated });
|
|
35
|
+
return migrated;
|
|
36
|
+
}
|
|
37
|
+
return config.ai;
|
|
38
|
+
}
|
|
39
|
+
function saveProviderConfig(providerId, providerConfig) {
|
|
40
|
+
const ai = getAiConfig() ?? { providers: {} };
|
|
41
|
+
ai.providers[providerId] = providerConfig;
|
|
42
|
+
const config = readGlobalConfig();
|
|
43
|
+
writeGlobalConfig({ ...config, ai });
|
|
44
|
+
}
|
|
45
|
+
function removeProviderConfig(providerId) {
|
|
46
|
+
const ai = getAiConfig();
|
|
47
|
+
if (!ai) return;
|
|
48
|
+
delete ai.providers[providerId];
|
|
49
|
+
const config = readGlobalConfig();
|
|
50
|
+
if (Object.keys(ai.providers).length === 0) {
|
|
51
|
+
delete config.ai;
|
|
52
|
+
} else {
|
|
53
|
+
config.ai = ai;
|
|
54
|
+
}
|
|
55
|
+
writeGlobalConfig(config);
|
|
56
|
+
}
|
|
57
|
+
function removeAiConfig() {
|
|
58
|
+
const config = readGlobalConfig();
|
|
59
|
+
delete config.ai;
|
|
60
|
+
writeGlobalConfig(config);
|
|
61
|
+
}
|
|
62
|
+
function getConfiguredProviders() {
|
|
63
|
+
const ai = getAiConfig();
|
|
64
|
+
const configured = /* @__PURE__ */ new Set();
|
|
65
|
+
if (ai) {
|
|
66
|
+
for (const id of Object.keys(ai.providers)) {
|
|
67
|
+
const p = ai.providers[id];
|
|
68
|
+
if (p.apiKey || p.oauth) configured.add(id);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
for (const id of getProviders()) {
|
|
72
|
+
if (!configured.has(id) && getEnvApiKey(id)) {
|
|
73
|
+
configured.add(id);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return [...configured];
|
|
77
|
+
}
|
|
78
|
+
function isAiConfigured() {
|
|
79
|
+
return getEnabledModels().length > 0;
|
|
80
|
+
}
|
|
81
|
+
function getEnabledModels() {
|
|
82
|
+
const ai = getAiConfig();
|
|
83
|
+
return ai?.models ?? [];
|
|
84
|
+
}
|
|
85
|
+
function setEnabledModels(modelIds) {
|
|
86
|
+
const ai = getAiConfig() ?? { providers: {} };
|
|
87
|
+
ai.models = modelIds.length > 0 ? modelIds : void 0;
|
|
88
|
+
const config = readGlobalConfig();
|
|
89
|
+
writeGlobalConfig({ ...config, ai });
|
|
90
|
+
}
|
|
91
|
+
function getAvailableModels() {
|
|
92
|
+
const providers = getConfiguredProviders();
|
|
93
|
+
const models = [];
|
|
94
|
+
for (const provider of providers) {
|
|
95
|
+
try {
|
|
96
|
+
models.push(...getModels(provider));
|
|
97
|
+
} catch (err) {
|
|
98
|
+
aiLog.debug(`no models for provider ${provider}`, logger_default.errorData(err));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return models;
|
|
102
|
+
}
|
|
103
|
+
async function resolveApiKey(providerId) {
|
|
104
|
+
const ai = getAiConfig();
|
|
105
|
+
const providerConfig = ai?.providers[providerId];
|
|
106
|
+
if (providerConfig?.oauth) {
|
|
107
|
+
try {
|
|
108
|
+
const result = await getOAuthApiKey(providerId, {
|
|
109
|
+
[providerId]: providerConfig.oauth
|
|
110
|
+
});
|
|
111
|
+
if (result) {
|
|
112
|
+
if (result.newCredentials.access !== providerConfig.oauth.access) {
|
|
113
|
+
saveProviderConfig(providerId, { ...providerConfig, oauth: result.newCredentials });
|
|
114
|
+
}
|
|
115
|
+
return result.apiKey;
|
|
116
|
+
}
|
|
117
|
+
} catch (err) {
|
|
118
|
+
aiLog.warn(`OAuth key resolution failed for ${providerId}`, logger_default.errorData(err));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
if (providerConfig?.apiKey) return providerConfig.apiKey;
|
|
122
|
+
return getEnvApiKey(providerId) ?? void 0;
|
|
123
|
+
}
|
|
124
|
+
function findModel(modelId) {
|
|
125
|
+
const providers = getConfiguredProviders();
|
|
126
|
+
for (const provider of providers) {
|
|
127
|
+
try {
|
|
128
|
+
const model = getModel(provider, modelId);
|
|
129
|
+
if (model) return model;
|
|
130
|
+
} catch (err) {
|
|
131
|
+
aiLog.debug(`model lookup failed for ${modelId} in ${provider}`, logger_default.errorData(err));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
for (const provider of providers) {
|
|
135
|
+
try {
|
|
136
|
+
const found = getModels(provider).find((m) => m.id.startsWith(modelId));
|
|
137
|
+
if (found) return found;
|
|
138
|
+
} catch (err) {
|
|
139
|
+
aiLog.debug(`prefix search failed for ${modelId} in ${provider}`, logger_default.errorData(err));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return void 0;
|
|
143
|
+
}
|
|
144
|
+
function autoSelectModel() {
|
|
145
|
+
const enabled = getEnabledModels();
|
|
146
|
+
if (enabled.length === 0) return void 0;
|
|
147
|
+
for (const id of enabled) {
|
|
148
|
+
const model = findModel(id);
|
|
149
|
+
if (model) return model;
|
|
150
|
+
}
|
|
151
|
+
return void 0;
|
|
152
|
+
}
|
|
153
|
+
async function aiComplete(systemPrompt, userMessage, modelId) {
|
|
154
|
+
const model = modelId ? findModel(modelId) : autoSelectModel();
|
|
155
|
+
if (!model) {
|
|
156
|
+
if (modelId) aiLog.warn(`model not found: ${modelId}`);
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
try {
|
|
160
|
+
const apiKey = await resolveApiKey(model.provider);
|
|
161
|
+
const response = await complete(
|
|
162
|
+
model,
|
|
163
|
+
{
|
|
164
|
+
systemPrompt,
|
|
165
|
+
messages: [{ role: "user", content: userMessage, timestamp: Date.now() }]
|
|
166
|
+
},
|
|
167
|
+
apiKey ? { apiKey } : void 0
|
|
168
|
+
);
|
|
169
|
+
const text = response.content.filter((c) => c.type === "text").map((c) => c.text).join("");
|
|
170
|
+
return text || null;
|
|
171
|
+
} catch (err) {
|
|
172
|
+
aiLog.error("completion failed", logger_default.errorData(err));
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export {
|
|
178
|
+
getAiConfig,
|
|
179
|
+
saveProviderConfig,
|
|
180
|
+
removeProviderConfig,
|
|
181
|
+
removeAiConfig,
|
|
182
|
+
getConfiguredProviders,
|
|
183
|
+
isAiConfigured,
|
|
184
|
+
getEnabledModels,
|
|
185
|
+
setEnabledModels,
|
|
186
|
+
getAvailableModels,
|
|
187
|
+
aiComplete
|
|
188
|
+
};
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
pollHealthDown,
|
|
6
6
|
readDaemonConfig,
|
|
7
7
|
stopService
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FXHXHI2A.js";
|
|
9
9
|
import {
|
|
10
10
|
voluteSystemDir
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-HHTXM4JT.js";
|
|
12
12
|
|
|
13
13
|
// src/commands/down.ts
|
|
14
14
|
import { existsSync, readFileSync, unlinkSync } from "fs";
|