volute 0.28.0 → 0.30.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.
Files changed (134) hide show
  1. package/README.md +127 -18
  2. package/dist/{accept-666DIZX2.js → accept-E3PAH3QJ.js} +2 -2
  3. package/dist/{activity-events-BBIEA2F4.js → activity-events-BKBPPUBP.js} +2 -2
  4. package/dist/ai-service-VAJT5UBS.js +29 -0
  5. package/dist/api.d.ts +586 -529
  6. package/dist/{archive-UA4BDFXQ.js → archive-WWDBWYN2.js} +2 -2
  7. package/dist/{bridge-FQHZL3MC.js → bridge-RO37CUFM.js} +2 -2
  8. package/dist/{chat-M4SX42JD.js → chat-TCUNPFGO.js} +8 -8
  9. package/dist/{chunk-IAYBDWVG.js → chunk-2C2VXEBB.js} +147 -2
  10. package/dist/chunk-2NDZC3S7.js +1330 -0
  11. package/dist/{chunk-IKRVFPWU.js → chunk-7D47T4RB.js} +3 -2
  12. package/dist/chunk-A6TUJJ3L.js +19 -0
  13. package/dist/{chunk-AW7PFDVN.js → chunk-CVH6Y2YG.js} +1 -1
  14. package/dist/{chunk-XBLSAVJF.js → chunk-DTC6EH5I.js} +1 -1
  15. package/dist/chunk-EFP3PE6C.js +232 -0
  16. package/dist/{chunk-JGFVMROS.js → chunk-EFVHR7KH.js} +1 -1
  17. package/dist/{chunk-K5NAC55T.js → chunk-FSM45XD5.js} +2 -2
  18. package/dist/{chunk-LAC664WU.js → chunk-FXHXHI2A.js} +42 -24
  19. package/dist/{chunk-RKQEHRBB.js → chunk-G3GBKZGG.js} +1 -1
  20. package/dist/{chunk-H7OZRFJB.js → chunk-HHTXM4JT.js} +0 -49
  21. package/dist/{chunk-J4IBNXGJ.js → chunk-IKHDUZRH.js} +4 -3
  22. package/dist/{chunk-MD4C26II.js → chunk-JGFRDMR6.js} +1 -1
  23. package/dist/{chunk-POSXWWTA.js → chunk-LIRWLNAK.js} +26 -12
  24. package/dist/{chunk-NI5FFCCS.js → chunk-MDPCSXZ4.js} +35 -11
  25. package/dist/chunk-NSBFETWP.js +188 -0
  26. package/dist/{chunk-VIVMW2H2.js → chunk-P27RV5WM.js} +1 -1
  27. package/dist/{chunk-EHYDTZTF.js → chunk-P7VFDSSG.js} +2 -2
  28. package/dist/{chunk-AAPXKR5V.js → chunk-QVAQ5454.js} +181 -544
  29. package/dist/{chunk-HDN7MNGD.js → chunk-S5LR3XYJ.js} +1 -1
  30. package/dist/{chunk-2YP2TVDT.js → chunk-UPA6COHU.js} +5 -5
  31. package/dist/{chunk-AKPFNL7L.js → chunk-VGWJSNHS.js} +1 -1
  32. package/dist/{chunk-SGVNFZHW.js → chunk-W5OOPLNP.js} +3 -3
  33. package/dist/{chunk-2WPW7OT6.js → chunk-ZWKTUQEL.js} +1 -1
  34. package/dist/cli.js +25 -26
  35. package/dist/clock-G3ALCMLJ.js +263 -0
  36. package/dist/{cloud-sync-HDL6PHZI.js → cloud-sync-JV4LJOK3.js} +14 -12
  37. package/dist/connectors/discord-bridge.js +1 -1
  38. package/dist/connectors/slack-bridge.js +1 -1
  39. package/dist/connectors/telegram-bridge.js +1 -1
  40. package/dist/{conversations-M2K4253F.js → conversations-7KVQV7EZ.js} +9 -3
  41. package/dist/create-JTLS7GX3.js +70 -0
  42. package/dist/{create-QWV73WXD.js → create-VQSQHJQW.js} +1 -1
  43. package/dist/{daemon-client-I42FK2BF.js → daemon-client-BCTFGVCZ.js} +2 -2
  44. package/dist/{daemon-restart-G4B2OYAB.js → daemon-restart-4JGBHEJ4.js} +7 -7
  45. package/dist/daemon.js +1474 -1124
  46. package/dist/{db-IC4J52XQ.js → db-HMFPIRO2.js} +1 -1
  47. package/dist/{delete-4JYGD4VN.js → delete-JESHKE7F.js} +1 -1
  48. package/dist/down-NGBMGORS.js +14 -0
  49. package/dist/{env-YJMUMFIY.js → env-CLXXT7M2.js} +2 -2
  50. package/dist/{export-BOJQWBMA.js → export-EGA5M5PB.js} +3 -3
  51. package/dist/extension-WZ4SUPJB.js +174 -0
  52. package/dist/extensions-ECO4RPFQ.js +27 -0
  53. package/dist/{files-M546TKVN.js → files-4VEJDASH.js} +3 -3
  54. package/dist/{history-ALPTNB3I.js → history-EJMMLXDO.js} +17 -2
  55. package/dist/{import-SRTQXBGH.js → import-YCGPMBSI.js} +3 -3
  56. package/dist/{join-J4QU42DL.js → join-2GBJKZEN.js} +1 -1
  57. package/dist/{list-R73GENNL.js → list-Q6O7FGAN.js} +2 -2
  58. package/dist/{login-3QZNR2DF.js → login-RET5WESK.js} +2 -2
  59. package/dist/{login-BKP3AFWN.js → login-RL6AU2SM.js} +3 -3
  60. package/dist/{logout-T53VKCPU.js → logout-CGAGJN3L.js} +2 -2
  61. package/dist/{logout-IQK7FNEK.js → logout-JRPBEMMR.js} +3 -3
  62. package/dist/message-delivery-6YMVNOEC.js +28 -0
  63. package/dist/{migrate-registry-to-db-XC7T5B7P.js → migrate-registry-to-db-FK35IPEH.js} +1 -1
  64. package/dist/{mind-S5V6CK5W.js → mind-LUWRQUQ5.js} +17 -17
  65. package/dist/{mind-activity-tracker-EN6XNXPF.js → mind-activity-tracker-VYN2ZZ2M.js} +3 -3
  66. package/dist/{mind-list-UPJ75GPI.js → mind-list-V5WW5DUA.js} +2 -2
  67. package/dist/{mind-manager-S6ILZVX3.js → mind-manager-YFCOIAAX.js} +6 -6
  68. package/dist/{mind-sleep-BTSWQNAC.js → mind-sleep-R6PTNNW4.js} +2 -2
  69. package/dist/{mind-status-TK5AETEM.js → mind-status-I4ISFJ6I.js} +2 -2
  70. package/dist/{mind-wake-SBAKIDVP.js → mind-wake-67ZQEWAV.js} +2 -2
  71. package/dist/{package-CG4RWUGP.js → package-S2OAA5ZA.js} +11 -5
  72. package/dist/pages-watcher-Z3PKNROC.js +21 -0
  73. package/dist/{read-36UFXN3G.js → read-WQMPTSN2.js} +2 -2
  74. package/dist/{register-CHREOMJ3.js → register-NZDSTLP3.js} +3 -3
  75. package/dist/{registry-NDNOOYG4.js → registry-ODSALQQL.js} +1 -1
  76. package/dist/{reject-LXIZFJ4Q.js → reject-2HZOJEIJ.js} +2 -2
  77. package/dist/{restart-6ESL3NBO.js → restart-QHS3NT64.js} +2 -2
  78. package/dist/{sandbox-5BW5HPXM.js → sandbox-O5FUSF43.js} +3 -3
  79. package/dist/{seed-SSUCYYDF.js → seed-WUQMPLDM.js} +1 -1
  80. package/dist/{send-TAOEZ4NH.js → send-OAN3RYYY.js} +20 -6
  81. package/dist/{setup-JHL5ZEST.js → setup-QMDK5RZX.js} +2 -2
  82. package/dist/{setup-RXYVGGT7.js → setup-XJH3E7YM.js} +45 -14
  83. package/dist/{skill-AUAQTSP5.js → skill-FZIN4W4Q.js} +65 -3
  84. package/dist/skills/dreaming/references/INSTALL.md +3 -17
  85. package/dist/skills/volute-mind/SKILL.md +45 -27
  86. package/dist/sleep-manager-O7YQFCV5.js +30 -0
  87. package/dist/{split-TKJ5OT3P.js → split-EXYGGGQN.js} +1 -1
  88. package/dist/{sprout-UNT7LKKE.js → sprout-AXQ6H5DB.js} +8 -7
  89. package/dist/{start-EUJSS5R4.js → start-MTOVL6SY.js} +2 -2
  90. package/dist/{status-NQJYR4BG.js → status-ZRO37MWR.js} +5 -5
  91. package/dist/{stop-3XAITBBF.js → stop-OK5WEPVC.js} +2 -2
  92. package/dist/{systems-SMEFSHTA.js → systems-W3BBMSOZ.js} +5 -5
  93. package/dist/{tailscale-NY5MUMY3.js → tailscale-BM72RXCJ.js} +1 -1
  94. package/dist/{template-hash-BIMA4ILT.js → template-hash-3HOR4UAJ.js} +1 -1
  95. package/dist/up-BXUAIDXB.js +17 -0
  96. package/dist/{update-PTSH22AZ.js → update-PLPHMMZ2.js} +5 -5
  97. package/dist/{update-check-64FWC4Y2.js → update-check-CVCN7MF6.js} +2 -2
  98. package/dist/{upgrade-HA47CS4C.js → upgrade-I6NPCYUU.js} +1 -1
  99. package/dist/{version-notify-JDUF4HQJ.js → version-notify-2NTWVEHL.js} +18 -16
  100. package/dist/web-assets/assets/index--kREqKl9.js +72 -0
  101. package/dist/web-assets/assets/index-BXYTG0nJ.css +1 -0
  102. package/dist/web-assets/ext-theme.css +111 -0
  103. package/dist/web-assets/index.html +2 -2
  104. package/package.json +11 -5
  105. package/packages/extensions/notes/dist/ui/assets/index-DgawVO5g.css +1 -0
  106. package/packages/extensions/notes/dist/ui/assets/index-qUWoeC4c.js +2 -0
  107. package/packages/extensions/notes/dist/ui/index.html +14 -0
  108. package/packages/extensions/notes/skills/notes/SKILL.md +62 -0
  109. package/packages/extensions/notes/skills/notes/scripts/notes.mjs +185 -0
  110. package/packages/extensions/pages/dist/ui/assets/index-D0HyS-xQ.css +1 -0
  111. package/packages/extensions/pages/dist/ui/assets/index-tLTROSk5.js +2 -0
  112. package/packages/extensions/pages/dist/ui/index.html +14 -0
  113. package/packages/extensions/pages/skills/pages/SKILL.md +58 -0
  114. package/templates/_base/home/VOLUTE.md +1 -1
  115. package/templates/_base/src/lib/logger.ts +10 -49
  116. package/templates/_base/src/lib/router.ts +1 -9
  117. package/templates/claude/src/lib/stream-consumer.ts +1 -4
  118. package/templates/pi/src/lib/event-handler.ts +1 -14
  119. package/dist/chunk-P72MVS4R.js +0 -188
  120. package/dist/chunk-T6HKBWXZ.js +0 -23
  121. package/dist/chunk-ZYGKG6VC.js +0 -22
  122. package/dist/create-D7J73A6H.js +0 -45
  123. package/dist/down-LVBXEULC.js +0 -14
  124. package/dist/message-delivery-HV3S6HZV.js +0 -24
  125. package/dist/notes-XCER3I7M.js +0 -220
  126. package/dist/pages-KJDJX4TA.js +0 -36
  127. package/dist/publish-ZZB33WP4.js +0 -86
  128. package/dist/schedule-QTJMFATP.js +0 -154
  129. package/dist/skills/notes/SKILL.md +0 -34
  130. package/dist/sleep-manager-WMVG2VCL.js +0 -28
  131. package/dist/status-S7UUPNRW.js +0 -38
  132. package/dist/up-GM2JOH2Y.js +0 -17
  133. package/dist/web-assets/assets/index-BZGvToHi.css +0 -1
  134. package/dist/web-assets/assets/index-Cz4TrpzB.js +0 -75
@@ -5,12 +5,16 @@ import {
5
5
  import {
6
6
  exec,
7
7
  gitExec
8
- } from "./chunk-AW7PFDVN.js";
8
+ } from "./chunk-CVH6Y2YG.js";
9
+ import {
10
+ readGlobalConfig,
11
+ writeGlobalConfig
12
+ } from "./chunk-7D47T4RB.js";
9
13
  import {
10
14
  getDb,
11
15
  sharedSkills,
12
16
  voluteHome
13
- } from "./chunk-H7OZRFJB.js";
17
+ } from "./chunk-HHTXM4JT.js";
14
18
 
15
19
  // src/lib/skills.ts
16
20
  import { createHash } from "crypto";
@@ -28,14 +32,30 @@ import { basename, dirname, join, resolve } from "path";
28
32
  import { eq, sql } from "drizzle-orm";
29
33
  var VALID_SKILL_ID = /^[a-zA-Z0-9_-]+$/;
30
34
  var SEED_SKILLS = ["orientation", "memory"];
31
- var STANDARD_SKILLS = [
32
- "volute-mind",
33
- "memory",
34
- "sessions",
35
- "notes",
36
- "dreaming",
37
- "shared-files"
38
- ];
35
+ var STANDARD_SKILLS = ["volute-mind", "memory", "sessions", "dreaming", "shared-files"];
36
+ function getStandardSkillsWithExtensions() {
37
+ const config = readGlobalConfig();
38
+ if (config.defaultSkills) return [...config.defaultSkills];
39
+ return [...STANDARD_SKILLS];
40
+ }
41
+ async function initDefaultSkills() {
42
+ const config = readGlobalConfig();
43
+ let extensionSkills = [];
44
+ try {
45
+ const { getExtensionStandardSkills } = await import("./extensions-ECO4RPFQ.js");
46
+ extensionSkills = getExtensionStandardSkills();
47
+ } catch (err) {
48
+ logger_default.warn("failed to load extension standard skills during init", logger_default.errorData(err));
49
+ }
50
+ const desired = /* @__PURE__ */ new Set([...STANDARD_SKILLS, ...extensionSkills]);
51
+ const current = config.defaultSkills ?? [];
52
+ const removed = new Set(config.removedDefaultSkills ?? []);
53
+ const toAdd = [...desired].filter((s) => !current.includes(s) && !removed.has(s));
54
+ if (toAdd.length === 0 && current.length > 0) return;
55
+ const merged = [.../* @__PURE__ */ new Set([...current, ...toAdd])];
56
+ writeGlobalConfig({ ...config, defaultSkills: merged });
57
+ logger_default.info(`updated default skills: ${merged.join(", ")}`);
58
+ }
39
59
  function validateSkillId(id) {
40
60
  if (!id || !VALID_SKILL_ID.test(id)) {
41
61
  throw new Error(`Invalid skill ID: ${id}`);
@@ -120,7 +140,8 @@ function readUpstream(skillDir) {
120
140
  return null;
121
141
  }
122
142
  return data;
123
- } catch {
143
+ } catch (err) {
144
+ logger_default.warn(`corrupt .upstream.json in ${skillDir}`, logger_default.errorData(err));
124
145
  return null;
125
146
  }
126
147
  }
@@ -396,6 +417,8 @@ async function syncBuiltinSkills() {
396
417
  export {
397
418
  SEED_SKILLS,
398
419
  STANDARD_SKILLS,
420
+ getStandardSkillsWithExtensions,
421
+ initDefaultSkills,
399
422
  sharedSkillsDir,
400
423
  listSharedSkills,
401
424
  getSharedSkill,
@@ -407,5 +430,6 @@ export {
407
430
  listMindSkills,
408
431
  publishSkill,
409
432
  listFilesRecursive,
433
+ hashSkillDir,
410
434
  syncBuiltinSkills
411
435
  };
@@ -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,7 +5,7 @@ import {
5
5
  import {
6
6
  activity,
7
7
  getDb
8
- } from "./chunk-H7OZRFJB.js";
8
+ } from "./chunk-HHTXM4JT.js";
9
9
 
10
10
  // src/lib/events/activity-events.ts
11
11
  var subscribers = /* @__PURE__ */ new Set();
@@ -5,10 +5,10 @@ import {
5
5
  pollHealthDown,
6
6
  readDaemonConfig,
7
7
  stopService
8
- } from "./chunk-LAC664WU.js";
8
+ } from "./chunk-FXHXHI2A.js";
9
9
  import {
10
10
  voluteSystemDir
11
- } from "./chunk-H7OZRFJB.js";
11
+ } from "./chunk-HHTXM4JT.js";
12
12
 
13
13
  // src/commands/down.ts
14
14
  import { existsSync, readFileSync, unlinkSync } from "fs";