volute 0.32.0 → 0.34.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 (187) hide show
  1. package/README.md +16 -0
  2. package/dist/{accept-74M7I4RZ.js → accept-TW6V4WI4.js} +4 -4
  3. package/dist/{activity-events-HETAODOK.js → activity-events-BN7V6KCC.js} +4 -4
  4. package/dist/{ai-service-ZIPCV3MX.js → ai-service-PSILB5WD.js} +5 -5
  5. package/dist/{api-client-YPKOZP2O.js → api-client-XUXOB7LI.js} +1 -1
  6. package/dist/api.d.ts +1198 -957
  7. package/dist/{archive-INXYFVCW.js → archive-C2VEMQOR.js} +4 -4
  8. package/dist/{auth-6DMGES3I.js → auth-ZFZXJZDQ.js} +5 -5
  9. package/dist/{bridge-BVCBTGPF.js → bridge-O753D5F4.js} +4 -4
  10. package/dist/{chat-XT4OBJBU.js → chat-BHYX7DJ4.js} +9 -9
  11. package/dist/{chunk-M7UL5S3Q.js → chunk-2IOP6PHB.js} +1 -1
  12. package/dist/{chunk-JJ7W6WSB.js → chunk-47XDEWWV.js} +5 -5
  13. package/dist/{chunk-RSX4OPZY.js → chunk-47ZPNLF4.js} +7 -7
  14. package/dist/{chunk-RPZZSXV3.js → chunk-4JSR7YO7.js} +20 -1
  15. package/dist/chunk-6LXAAQ43.js +22 -0
  16. package/dist/{chunk-TSXLLQZW.js → chunk-6OWJXUAR.js} +10 -1
  17. package/dist/{chunk-I5KY25PQ.js → chunk-6WAWMWR5.js} +1 -1
  18. package/dist/{chunk-LSGWR54X.js → chunk-7F2SW2KD.js} +2 -2
  19. package/dist/chunk-7KJOFUNN.js +22 -0
  20. package/dist/{spirit-N4W4UQRH.js → chunk-B2BVAIZ4.js} +21 -12
  21. package/dist/{chunk-LGB6JBHI.js → chunk-BDK73LK6.js} +5 -55
  22. package/dist/{chunk-IYDIE3HG.js → chunk-BFWHBQK4.js} +1 -1
  23. package/dist/{chunk-TDRYEPH4.js → chunk-BM474GX6.js} +4 -4
  24. package/dist/{chunk-R7E6CRVQ.js → chunk-BTWAGDV5.js} +1 -1
  25. package/dist/{chunk-WKF5FEFK.js → chunk-CVL5IGIR.js} +629 -174
  26. package/dist/{chunk-S6NFERDC.js → chunk-E5C7OWZ2.js} +20 -22
  27. package/dist/chunk-FYCALD4Q.js +23 -0
  28. package/dist/{chunk-SKLSMHXO.js → chunk-IS7WJ56Q.js} +1 -1
  29. package/dist/{chunk-2NGTS5UU.js → chunk-M3K5AARV.js} +1 -1
  30. package/dist/{chunk-ALEF47VT.js → chunk-MLOQKQNB.js} +1 -1
  31. package/dist/{chunk-D5G5YOPL.js → chunk-N3DNFPVA.js} +41 -5
  32. package/dist/{chunk-LRCG2JLP.js → chunk-N7BLAHNE.js} +5 -1
  33. package/dist/chunk-OYAKCAVY.js +29 -0
  34. package/dist/{chunk-UKVWJRKN.js → chunk-PLDWHR4D.js} +1 -1
  35. package/dist/{chunk-QBQ424EM.js → chunk-TAHX36HZ.js} +545 -246
  36. package/dist/chunk-U5BTYSAL.js +59 -0
  37. package/dist/{chunk-SX5TKJBZ.js → chunk-V45JXOWY.js} +2 -2
  38. package/dist/{chunk-2FLJ63GU.js → chunk-V6ZCNULL.js} +2 -2
  39. package/dist/{chunk-QZANELPX.js → chunk-XWXBJQBE.js} +3 -2
  40. package/dist/cli.js +32 -24
  41. package/dist/{clock-2UOZ6JPU.js → clock-3X4DSC2N.js} +38 -23
  42. package/dist/{cloud-sync-JN3NWKEM.js → cloud-sync-TG3TIX5H.js} +21 -17
  43. package/dist/{config-H2H4UIF7.js → config-OROA5DUA.js} +4 -4
  44. package/dist/connectors/discord-bridge.js +1 -1
  45. package/dist/connectors/slack-bridge.js +1 -1
  46. package/dist/connectors/telegram-bridge.js +1 -1
  47. package/dist/{conversations-3O5O6AS3.js → conversations-HL2JP5GI.js} +5 -5
  48. package/dist/{create-RNLNCORE.js → create-3SEKKI6P.js} +5 -5
  49. package/dist/{create-WBBYI6V7.js → create-UOSOQ2HN.js} +4 -4
  50. package/dist/daemon-client-WOAQXXBM.js +12 -0
  51. package/dist/{daemon-restart-NGFHFAUF.js → daemon-restart-5ABHNXJZ.js} +9 -8
  52. package/dist/daemon.js +2730 -1520
  53. package/dist/{db-RA45JBFG.js → db-PLEDCBHZ.js} +1 -1
  54. package/dist/db-RYX3SS2W.js +9 -0
  55. package/dist/{delete-QTGWEDBI.js → delete-KYOVWR23.js} +3 -3
  56. package/dist/delivery-manager-2BR5NZKF.js +32 -0
  57. package/dist/{delivery-router-FL45JL7N.js → delivery-router-D5ELDMS2.js} +4 -4
  58. package/dist/down-QVFN4UPK.js +15 -0
  59. package/dist/{env-RLYQBOOP.js → env-R34DT7XL.js} +10 -6
  60. package/dist/exec-DVLXKRIO.js +17 -0
  61. package/dist/{export-SUYRLI5Q.js → export-6ZXAXATG.js} +6 -6
  62. package/dist/extension-PM42QCID.js +97 -0
  63. package/dist/extensions-BBGVL5JC.js +38 -0
  64. package/dist/{files-EAMPO2SJ.js → files-VQV2VZQO.js} +5 -5
  65. package/dist/{import-DDUFE7AY.js → import-MK2I2T6F.js} +5 -5
  66. package/dist/isolation-62MKDZN3.js +22 -0
  67. package/dist/{join-I5QEE3LG.js → join-DGYHTJUH.js} +3 -3
  68. package/dist/lib-DYEZMGW7.js +6588 -0
  69. package/dist/{list-DW2VRTOZ.js → list-C644WTHV.js} +16 -8
  70. package/dist/{login-7CHPW2PN.js → login-IIGEQPHL.js} +4 -4
  71. package/dist/{login-RIJF2F4G.js → login-KZQLMAWE.js} +4 -4
  72. package/dist/{logout-5MLHZALK.js → logout-AGTZVRGP.js} +4 -4
  73. package/dist/{logout-UZJRGY4Z.js → logout-KD6GXIJJ.js} +4 -4
  74. package/dist/message-delivery-V3R6NXJP.js +42 -0
  75. package/dist/{mind-2B6M7Y25.js → mind-BI4EPBVZ.js} +25 -19
  76. package/dist/{mind-activity-tracker-NZZT2NTT.js → mind-activity-tracker-2ACNHA7B.js} +5 -5
  77. package/dist/mind-history-WOYFLQAI.js +264 -0
  78. package/dist/{mind-list-WUPMQDYQ.js → mind-list-6VPM7GUQ.js} +4 -4
  79. package/dist/mind-manager-MWW3BTS4.js +32 -0
  80. package/dist/mind-profile-WPG42U5Y.js +47 -0
  81. package/dist/mind-service-VIKZJK2M.js +38 -0
  82. package/dist/{mind-sleep-B7BHJLH7.js → mind-sleep-XDISJY74.js} +4 -4
  83. package/dist/{mind-status-L3EFFRPR.js → mind-status-7FTZWPZF.js} +4 -4
  84. package/dist/{mind-wake-GY3RFX7Y.js → mind-wake-KIIKEI3A.js} +4 -4
  85. package/dist/{package-PK6JUFL3.js → package-V2WHWVG6.js} +9 -5
  86. package/dist/{read-5AMJRO3D.js → read-H5C26YO7.js} +18 -8
  87. package/dist/read-stdin-PIRM6A2Y.js +8 -0
  88. package/dist/{register-V2JZZKFK.js → register-J27WP33N.js} +4 -4
  89. package/dist/{registry-PJ4S5PHQ.js → registry-UYV5S6QT.js} +3 -3
  90. package/dist/{reject-33HEZMZ4.js → reject-OEANJYIA.js} +4 -4
  91. package/dist/{restart-3UCMRUVC.js → restart-V5EGYBJG.js} +4 -4
  92. package/dist/{sandbox-JANNTX6U.js → sandbox-SI5HMBP3.js} +5 -5
  93. package/dist/scheduler-AGG3L2FO.js +32 -0
  94. package/dist/{schema-PA3M5ZKH.js → schema-ETMABTW4.js} +4 -2
  95. package/dist/seed-WNGI6PNW.js +11 -0
  96. package/dist/seed-check-PXTH7YXS.js +32 -0
  97. package/dist/seed-cmd-VENFTGS3.js +36 -0
  98. package/dist/{seed-ALUQ55FF.js → seed-create-663ALOKH.js} +8 -8
  99. package/dist/{sprout-L2GFOVF7.js → seed-sprout-EH3AGKAI.js} +24 -11
  100. package/dist/{send-3MI36LEF.js → send-7FUUUZZH.js} +66 -51
  101. package/dist/{setup-SZIARWI6.js → setup-GGMKENLN.js} +6 -4
  102. package/dist/{setup-WENLVPVP.js → setup-Z3DEVWV7.js} +13 -11
  103. package/dist/{skill-TUVOTW4Z.js → skill-DKNYJS4P.js} +12 -8
  104. package/dist/skills/imagegen/SKILL.md +11 -7
  105. package/dist/skills/imagegen/scripts/imagegen.ts +146 -25
  106. package/dist/skills/orientation/SKILL.md +9 -2
  107. package/dist/skills/plan-coordinator/SKILL.md +60 -0
  108. package/dist/skills/seed-nurture/SKILL.md +42 -0
  109. package/dist/skills/volute-mind/SKILL.md +11 -221
  110. package/dist/skills/volute-mind/references/extensions.md +37 -0
  111. package/dist/skills/volute-mind/references/integrations.md +48 -0
  112. package/dist/skills/volute-mind/references/routing.md +86 -0
  113. package/dist/skills/volute-mind/references/sleep.md +33 -0
  114. package/dist/skills/volute-mind/references/variants.md +31 -0
  115. package/dist/{skills-XNZK6P4K.js → skills-Q6VZ2UGD.js} +11 -6
  116. package/dist/sleep-manager-BJK2ROPX.js +36 -0
  117. package/dist/spirit-4JP4TY4C.js +23 -0
  118. package/dist/{split-STOROBYJ.js → split-3YPMS2CL.js} +3 -3
  119. package/dist/sprout-E3HJIV2Z.js +11 -0
  120. package/dist/{start-K2NCUUCG.js → start-W3TPKX4D.js} +4 -4
  121. package/dist/{status-TCUMUO6M.js → status-4OVFXFEJ.js} +7 -6
  122. package/dist/{stop-H26JZDXF.js → stop-GTT6YWYO.js} +4 -4
  123. package/dist/system-channel-DXD2JBOU.js +36 -0
  124. package/dist/system-chat-TYLOL7SX.js +36 -0
  125. package/dist/{systems-DHBKVYEY.js → systems-AYLO727G.js} +7 -7
  126. package/dist/{tailscale-XHQBZROW.js → tailscale-ZEUK7GKZ.js} +3 -3
  127. package/dist/{template-hash-A6VVKOXJ.js → template-hash-EJRTKE36.js} +1 -1
  128. package/dist/up-PA7F2CXE.js +18 -0
  129. package/dist/{update-QVPRF6GR.js → update-HG4LCUSG.js} +7 -6
  130. package/dist/{update-check-ZD6OOIYQ.js → update-check-X3YG4WVP.js} +4 -4
  131. package/dist/{upgrade-O4Q7WJM3.js → upgrade-YGNIDICG.js} +3 -3
  132. package/dist/{variant-7TGZHOU3.js → variant-MZUMRTQO.js} +1 -1
  133. package/dist/{version-notify-TCKWBZZG.js → version-notify-YCH4UVQ2.js} +23 -20
  134. package/dist/volute-config-WBKYJGYQ.js +10 -0
  135. package/dist/web-assets/assets/index-DiiwC-CZ.css +1 -0
  136. package/dist/web-assets/assets/index-d6y5b9Ij.js +75 -0
  137. package/dist/web-assets/ext-theme.css +48 -9
  138. package/dist/web-assets/index.html +2 -2
  139. package/drizzle/0005_meta_summaries.sql +15 -0
  140. package/drizzle/meta/0005_snapshot.json +7 -0
  141. package/drizzle/meta/_journal.json +7 -0
  142. package/package.json +8 -4
  143. package/packages/extensions/plan/dist/ui/assets/index-CJj2gZnZ.css +1 -0
  144. package/packages/extensions/plan/dist/ui/assets/index-FMEJmvQz.js +61 -0
  145. package/packages/extensions/plan/dist/ui/index.html +14 -0
  146. package/packages/extensions/plan/skills/plan/SKILL.md +43 -0
  147. package/packages/extensions/plan/skills/plan/scripts/plan-hook.sh +37 -0
  148. package/templates/_base/home/VOLUTE.md +12 -19
  149. package/templates/_base/src/lib/context-breakdown.ts +450 -0
  150. package/templates/_base/src/lib/format-prefix.ts +17 -0
  151. package/templates/_base/src/lib/hook-loader.ts +8 -2
  152. package/templates/_base/src/lib/router.ts +75 -33
  153. package/templates/_base/src/lib/routing.ts +4 -1
  154. package/templates/_base/src/lib/startup.ts +16 -8
  155. package/templates/_base/src/lib/types.ts +2 -1
  156. package/templates/_base/src/lib/volute-server.ts +69 -8
  157. package/templates/claude/.init/CLAUDE.md +4 -10
  158. package/templates/claude/package.json.tmpl +1 -0
  159. package/templates/claude/src/agent.ts +100 -32
  160. package/templates/claude/src/lib/hooks/reply-instructions.ts +27 -7
  161. package/templates/claude/src/lib/stream-consumer.ts +40 -2
  162. package/templates/claude/src/server.ts +1 -0
  163. package/templates/codex/package.json.tmpl +1 -0
  164. package/templates/codex/src/agent.ts +81 -8
  165. package/templates/codex/src/server.ts +1 -4
  166. package/templates/pi/package.json.tmpl +1 -0
  167. package/templates/pi/src/agent.ts +115 -36
  168. package/templates/pi/src/lib/event-handler.ts +22 -7
  169. package/templates/pi/src/lib/reply-instructions-extension.ts +23 -4
  170. package/templates/pi/src/lib/subagents.ts +20 -17
  171. package/templates/pi/src/server.ts +2 -5
  172. package/dist/chunk-K3NQKI34.js +0 -10
  173. package/dist/daemon-client-6QXHZ7US.js +0 -12
  174. package/dist/db-F34YLV7D.js +0 -9
  175. package/dist/delivery-manager-SDVXFD4W.js +0 -28
  176. package/dist/down-TB3ESMNP.js +0 -14
  177. package/dist/extension-FQ5D3NCC.js +0 -174
  178. package/dist/extensions-GDYWQXC4.js +0 -29
  179. package/dist/history-FO5PHBQ5.js +0 -128
  180. package/dist/message-delivery-2FIM7QKO.js +0 -32
  181. package/dist/mind-manager-BNCMGYXW.js +0 -28
  182. package/dist/mind-service-AV273WT4.js +0 -34
  183. package/dist/sleep-manager-53DZOWW7.js +0 -32
  184. package/dist/system-chat-NPYFYZVI.js +0 -32
  185. package/dist/up-6I6BHRTO.js +0 -17
  186. package/dist/web-assets/assets/index-Bui7U9Uu.css +0 -1
  187. package/dist/web-assets/assets/index-e36DIo1b.js +0 -73
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  subscribe
4
- } from "./chunk-QZANELPX.js";
4
+ } from "./chunk-XWXBJQBE.js";
5
5
  import {
6
6
  logger_default
7
7
  } from "./chunk-YUIHSKR6.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-LRCG2JLP.js";
10
+ } from "./chunk-N7BLAHNE.js";
11
11
  import {
12
12
  conversationParticipants,
13
13
  conversationReads,
14
14
  conversations,
15
15
  messages,
16
16
  users
17
- } from "./chunk-RPZZSXV3.js";
17
+ } from "./chunk-4JSR7YO7.js";
18
18
 
19
19
  // src/lib/events/conversations.ts
20
20
  import { randomUUID } from "crypto";
@@ -116,26 +116,24 @@ async function createConversation(mindName, channel, opts) {
116
116
  const id = randomUUID();
117
117
  const type = opts?.type ?? "dm";
118
118
  const name = opts?.name ?? null;
119
- await db.transaction(async (tx) => {
120
- await tx.insert(conversations).values({
121
- id,
122
- mind_name: mindName,
123
- channel,
124
- type,
125
- name,
126
- user_id: opts?.userId ?? null,
127
- title: opts?.title ?? null
128
- });
129
- if (opts?.participantIds && opts.participantIds.length > 0) {
130
- await tx.insert(conversationParticipants).values(
131
- opts.participantIds.map((uid, i) => ({
132
- conversation_id: id,
133
- user_id: uid,
134
- role: i === 0 ? "owner" : "member"
135
- }))
136
- );
137
- }
119
+ await db.insert(conversations).values({
120
+ id,
121
+ mind_name: mindName,
122
+ channel,
123
+ type,
124
+ name,
125
+ user_id: opts?.userId ?? null,
126
+ title: opts?.title ?? null
138
127
  });
128
+ if (opts?.participantIds && opts.participantIds.length > 0) {
129
+ await db.insert(conversationParticipants).values(
130
+ opts.participantIds.map((uid, i) => ({
131
+ conversation_id: id,
132
+ user_id: uid,
133
+ role: i === 0 ? "owner" : "member"
134
+ }))
135
+ );
136
+ }
139
137
  fireWebhook({
140
138
  event: "conversation_created",
141
139
  mind: mindName ?? "",
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/lib/format-cli.ts
4
+ var isCompact = () => !!process.env.VOLUTE_MIND;
5
+ function compactTime(dateStr) {
6
+ const d = new Date(dateStr.endsWith("Z") ? dateStr : `${dateStr}Z`);
7
+ return `${String(d.getHours()).padStart(2, "0")}:${String(d.getMinutes()).padStart(2, "0")}`;
8
+ }
9
+ function compactDateTime(dateStr) {
10
+ const d = new Date(dateStr.endsWith("Z") ? dateStr : `${dateStr}Z`);
11
+ const y = d.getFullYear();
12
+ const m = String(d.getMonth() + 1).padStart(2, "0");
13
+ const day = String(d.getDate()).padStart(2, "0");
14
+ const h = String(d.getHours()).padStart(2, "0");
15
+ const min = String(d.getMinutes()).padStart(2, "0");
16
+ return `${y}-${m}-${day} ${h}:${min}`;
17
+ }
18
+
19
+ export {
20
+ isCompact,
21
+ compactTime,
22
+ compactDateTime
23
+ };
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-YUIHSKR6.js";
5
5
  import {
6
6
  mindDir
7
- } from "./chunk-LRCG2JLP.js";
7
+ } from "./chunk-N7BLAHNE.js";
8
8
 
9
9
  // src/lib/delivery/delivery-router.ts
10
10
  import { readFileSync, statSync } from "fs";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  stateDir,
4
4
  voluteSystemDir
5
- } from "./chunk-LRCG2JLP.js";
5
+ } from "./chunk-N7BLAHNE.js";
6
6
 
7
7
  // src/lib/env.ts
8
8
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  stateDir
4
- } from "./chunk-LRCG2JLP.js";
4
+ } from "./chunk-N7BLAHNE.js";
5
5
 
6
6
  // src/lib/file-sharing.ts
7
7
  import { randomBytes } from "crypto";
@@ -5,18 +5,20 @@ import {
5
5
  import {
6
6
  exec,
7
7
  gitExec
8
- } from "./chunk-LGB6JBHI.js";
8
+ } from "./chunk-U5BTYSAL.js";
9
9
  import {
10
10
  readGlobalConfig,
11
11
  writeGlobalConfig
12
- } from "./chunk-TSXLLQZW.js";
12
+ } from "./chunk-6OWJXUAR.js";
13
13
  import {
14
14
  getDb,
15
+ mindDir,
16
+ readRegistry,
15
17
  voluteHome
16
- } from "./chunk-LRCG2JLP.js";
18
+ } from "./chunk-N7BLAHNE.js";
17
19
  import {
18
20
  sharedSkills
19
- } from "./chunk-RPZZSXV3.js";
21
+ } from "./chunk-4JSR7YO7.js";
20
22
 
21
23
  // src/lib/skills.ts
22
24
  import { createHash } from "crypto";
@@ -44,7 +46,7 @@ async function initDefaultSkills() {
44
46
  const config = readGlobalConfig();
45
47
  let extensionSkills = [];
46
48
  try {
47
- const { getExtensionStandardSkills } = await import("./extensions-GDYWQXC4.js");
49
+ const { getExtensionStandardSkills } = await import("./extensions-BBGVL5JC.js");
48
50
  extensionSkills = getExtensionStandardSkills();
49
51
  } catch (err) {
50
52
  logger_default.warn("failed to load extension standard skills during init", logger_default.errorData(err));
@@ -527,6 +529,38 @@ function hashSkillDir(dir) {
527
529
  }
528
530
  return hash.digest("hex");
529
531
  }
532
+ function isAutoUpdateSkillsEnabled() {
533
+ return readGlobalConfig().autoUpdateSkills !== false;
534
+ }
535
+ async function autoUpdateMindSkills() {
536
+ const baseMinds = await readRegistry();
537
+ const shared = await listSharedSkills();
538
+ const sharedMap = new Map(shared.map((s) => [s.id, s]));
539
+ for (const mind of baseMinds) {
540
+ const dir = mind.dir ?? mindDir(mind.name);
541
+ const skillsDir = mindSkillsDir(dir);
542
+ if (!existsSync(skillsDir)) continue;
543
+ const entries = readdirSync(skillsDir, { withFileTypes: true }).filter((e) => e.isDirectory());
544
+ for (const entry of entries) {
545
+ const upstream = readUpstream(join(skillsDir, entry.name));
546
+ if (!upstream) continue;
547
+ const sharedSkill = sharedMap.get(upstream.source);
548
+ if (!sharedSkill || sharedSkill.version <= upstream.version) continue;
549
+ try {
550
+ const result = await updateSkill(mind.name, dir, entry.name);
551
+ if (result.status === "updated") {
552
+ logger_default.info(`auto-updated skill ${entry.name} for ${mind.name} (v${sharedSkill.version})`);
553
+ } else if (result.status === "conflict") {
554
+ logger_default.warn(
555
+ `auto-update conflict for skill ${entry.name} in ${mind.name}: ${result.conflictFiles.join(", ")}`
556
+ );
557
+ }
558
+ } catch (err) {
559
+ logger_default.error(`failed to auto-update skill ${entry.name} for ${mind.name}`, logger_default.errorData(err));
560
+ }
561
+ }
562
+ }
563
+ }
530
564
  async function syncBuiltinSkills() {
531
565
  let skillsRoot;
532
566
  try {
@@ -579,5 +613,7 @@ export {
579
613
  listFilesRecursive,
580
614
  findSkillsRoot,
581
615
  hashSkillDir,
616
+ isAutoUpdateSkillsEnabled,
617
+ autoUpdateMindSkills,
582
618
  syncBuiltinSkills
583
619
  };
@@ -2,12 +2,13 @@
2
2
  import {
3
3
  minds,
4
4
  schema_exports
5
- } from "./chunk-RPZZSXV3.js";
5
+ } from "./chunk-4JSR7YO7.js";
6
6
 
7
7
  // src/lib/db.ts
8
8
  import { chmodSync, existsSync } from "fs";
9
9
  import { dirname as dirname2, resolve as resolve2 } from "path";
10
10
  import { fileURLToPath as fileURLToPath2 } from "url";
11
+ import { sql } from "drizzle-orm";
11
12
  import { drizzle } from "drizzle-orm/libsql";
12
13
  import { migrate } from "drizzle-orm/libsql/migrator";
13
14
 
@@ -203,6 +204,9 @@ async function getDb() {
203
204
  try {
204
205
  const dbPath = process.env.VOLUTE_DB_PATH || resolve2(voluteSystemDir(), "volute.db");
205
206
  const instance = drizzle({ connection: { url: `file:${dbPath}` }, schema: schema_exports });
207
+ await instance.run(sql.raw("PRAGMA journal_mode=WAL"));
208
+ await instance.run(sql.raw("PRAGMA busy_timeout=5000"));
209
+ await instance.run(sql.raw("PRAGMA foreign_keys=ON"));
206
210
  await migrate(instance, { migrationsFolder });
207
211
  try {
208
212
  chmodSync(dbPath, 384);
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/lib/volute-config.ts
4
+ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
5
+ import { dirname, resolve } from "path";
6
+ function readJson(path) {
7
+ if (!existsSync(path)) return null;
8
+ try {
9
+ return JSON.parse(readFileSync(path, "utf-8"));
10
+ } catch (err) {
11
+ console.error(`[volute-config] failed to parse ${path}: ${err}`);
12
+ return null;
13
+ }
14
+ }
15
+ function readVoluteConfig(mindDir) {
16
+ const path = resolve(mindDir, "home/.config/volute.json");
17
+ return readJson(path);
18
+ }
19
+ function writeVoluteConfig(mindDir, config) {
20
+ const path = resolve(mindDir, "home/.config/volute.json");
21
+ mkdirSync(dirname(path), { recursive: true });
22
+ writeFileSync(path, `${JSON.stringify(config, null, 2)}
23
+ `);
24
+ }
25
+
26
+ export {
27
+ readVoluteConfig,
28
+ writeVoluteConfig
29
+ };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  voluteSystemDir,
4
4
  voluteUserHome
5
- } from "./chunk-LRCG2JLP.js";
5
+ } from "./chunk-N7BLAHNE.js";
6
6
 
7
7
  // src/lib/daemon-client.ts
8
8
  import { existsSync, readFileSync } from "fs";