volute 0.35.0 → 0.36.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 (123) hide show
  1. package/dist/{activity-events-ZW4SDL2C.js → activity-events-PWOGSMRL.js} +4 -4
  2. package/dist/{ai-service-LURBEDDB.js → ai-service-GSZWIETO.js} +5 -5
  3. package/dist/{archive-ESU2FUN4.js → archive-Y2YEOCGB.js} +3 -3
  4. package/dist/{auth-WX4TESEI.js → auth-YTQME4EV.js} +5 -5
  5. package/dist/{chat-QXAJF3FU.js → chat-ED7YOGKO.js} +4 -4
  6. package/dist/{chunk-AOB6GVRM.js → chunk-46DYYHN6.js} +8 -3
  7. package/dist/{chunk-5XJYUFZH.js → chunk-6F3YNULE.js} +68 -22
  8. package/dist/{chunk-BDYXIWA5.js → chunk-75AJ54GM.js} +13 -2
  9. package/dist/{chunk-5N7Y5WAM.js → chunk-7PTQGPJY.js} +28 -12
  10. package/dist/{chunk-CORXD635.js → chunk-B35VNNSS.js} +3 -3
  11. package/dist/{chunk-PWQ2ITYG.js → chunk-BOLJUV77.js} +4 -4
  12. package/dist/{chunk-ZSR72JB3.js → chunk-CU6OFXMM.js} +1 -1
  13. package/dist/{chunk-2TGZJFAT.js → chunk-DJT5Y4UF.js} +3 -3
  14. package/dist/{chunk-XRQSAMX2.js → chunk-DMV5P2LU.js} +3 -3
  15. package/dist/{chunk-WJPROOU5.js → chunk-DQ7VBXAP.js} +635 -3692
  16. package/dist/{chunk-IJHIXLVN.js → chunk-GBDVNPN2.js} +13 -11
  17. package/dist/{chunk-WZRZFFCL.js → chunk-IIWF2IPD.js} +146 -186
  18. package/dist/{chunk-F7ZNLYKZ.js → chunk-KAB6UGOL.js} +2 -2
  19. package/dist/{chunk-VHJRZM2S.js → chunk-L72WYMF7.js} +2 -2
  20. package/dist/{chunk-NJK5SDGR.js → chunk-LGNUFVMR.js} +1 -1
  21. package/dist/{chunk-FT5KETXZ.js → chunk-M5RYAA5I.js} +2 -2
  22. package/dist/{chunk-J6CJQDWI.js → chunk-N2AUHW4C.js} +2 -2
  23. package/dist/{chunk-BMZQYACC.js → chunk-NUX47Y2V.js} +19 -4
  24. package/dist/{chunk-AN2W47GW.js → chunk-PJ4IPTIN.js} +2 -2
  25. package/dist/{chunk-N446KRP7.js → chunk-PY557GDR.js} +2 -2
  26. package/dist/{chunk-MDJGMOSD.js → chunk-PZYJBOQP.js} +6 -6
  27. package/dist/chunk-RG5TOL4O.js +18 -0
  28. package/dist/{chunk-N5LMGYXX.js → chunk-SWW6AUVW.js} +2 -2
  29. package/dist/{chunk-BKF4WQCY.js → chunk-T2TP6ZC6.js} +20 -8
  30. package/dist/{chunk-VY3RB2V7.js → chunk-TWAN7ZNO.js} +3 -3
  31. package/dist/{chunk-QCH6K235.js → chunk-UI7RPV2B.js} +1 -1
  32. package/dist/{chunk-QWTR6AWZ.js → chunk-X2J7QUFH.js} +2 -2
  33. package/dist/{chunk-A2ZLHBHG.js → chunk-YDBAY3NA.js} +2 -2
  34. package/dist/{chunk-BV65KRHM.js → chunk-YTWZORJN.js} +2 -2
  35. package/dist/{chunk-OTC67N2Z.js → chunk-ZTVKQOU7.js} +1 -1
  36. package/dist/cli.js +16 -16
  37. package/dist/{cloud-sync-6JL4C24T.js → cloud-sync-BOCZSDIA.js} +19 -20
  38. package/dist/connectors/discord-bridge.js +3 -3
  39. package/dist/connectors/slack-bridge.js +3 -3
  40. package/dist/connectors/telegram-bridge.js +3 -3
  41. package/dist/{conversations-2PW57WO2.js → conversations-HH3CJD4E.js} +15 -9
  42. package/dist/{create-UVCK2CS6.js → create-QBEPSD2Z.js} +1 -1
  43. package/dist/{daemon-restart-HSZ3BCX5.js → daemon-restart-SIR3UR4B.js} +10 -10
  44. package/dist/daemon.js +446 -328
  45. package/dist/{db-BVBJ57TU.js → db-URORGSXQ.js} +2 -2
  46. package/dist/delivery-manager-WTGIPBGY.js +30 -0
  47. package/dist/{delivery-router-HEJSJAHQ.js → delivery-router-VSULHXNH.js} +4 -4
  48. package/dist/down-DGGLZ5TA.js +17 -0
  49. package/dist/{exec-PY7THYH4.js → exec-X3C6ZZTQ.js} +4 -4
  50. package/dist/{export-OAS6QVBN.js → export-HTFOHOKL.js} +3 -3
  51. package/dist/{extension-D74CNM7G.js → extension-AKZ46YSL.js} +22 -3
  52. package/dist/{extensions-XDDFY72A.js → extensions-OOSFVH7U.js} +21 -20
  53. package/dist/{files-CWTK6V3H.js → files-H2YLRD37.js} +3 -3
  54. package/dist/{import-5A3T7QV4.js → import-OL5BZX7S.js} +6 -6
  55. package/dist/{isolation-TK5RX2WM.js → isolation-N74RWOUX.js} +3 -3
  56. package/dist/{list-PDMQM7ZV.js → list-GJ4RUQQT.js} +7 -1
  57. package/dist/{login-7TE6CIZF.js → login-JXRVMBRB.js} +2 -2
  58. package/dist/{logout-T4XS6LRU.js → logout-FW243JBU.js} +2 -2
  59. package/dist/message-delivery-YORUXKDQ.js +40 -0
  60. package/dist/{mind-5IEYKV7I.js → mind-6VJJHF65.js} +6 -6
  61. package/dist/{mind-activity-tracker-QBLIV7ZJ.js → mind-activity-tracker-66UVYIFW.js} +5 -5
  62. package/dist/{mind-history-IE2QH7U5.js → mind-history-MII2SK7F.js} +81 -14
  63. package/dist/mind-manager-TJ2SUPRX.js +30 -0
  64. package/dist/mind-service-E7FM2WZF.js +36 -0
  65. package/dist/{package-D2FSVFAX.js → package-3W2MEXHB.js} +5 -5
  66. package/dist/{read-67VRP2DO.js → read-ZUDG4JWU.js} +4 -4
  67. package/dist/{registry-GBSNW3HG.js → registry-YPHK534W.js} +2 -2
  68. package/dist/{sandbox-R37VIU36.js → sandbox-LP6YRAXS.js} +5 -5
  69. package/dist/scheduler-FRJ5DK24.js +30 -0
  70. package/dist/{schema-XVZ2CLKW.js → schema-MISD3JFG.js} +3 -1
  71. package/dist/{seed-EQORWX77.js → seed-CEC4RC23.js} +1 -1
  72. package/dist/{seed-cmd-ZM2XGVU2.js → seed-cmd-WTTG7SRQ.js} +2 -2
  73. package/dist/{seed-create-DRWGGHEI.js → seed-create-M6RCC6RP.js} +3 -3
  74. package/dist/{seed-sprout-JYXGXOP3.js → seed-sprout-ZKCHFJKH.js} +10 -10
  75. package/dist/{send-JBJJQ7CA.js → send-LXUT2GGR.js} +3 -3
  76. package/dist/{service-WNPCNHOX.js → service-M6N3RUYU.js} +5 -5
  77. package/dist/{setup-BJ4YAY26.js → setup-PJOF5UV5.js} +7 -7
  78. package/dist/{setup-RHJRFURI.js → setup-PMJHCZQX.js} +5 -3
  79. package/dist/skills/tending/SKILL.md +52 -0
  80. package/dist/{skills-EKMCQ46K.js → skills-2PTRTBQP.js} +7 -7
  81. package/dist/sleep-manager-WAZWMFJT.js +34 -0
  82. package/dist/spirit-6KVDIROQ.js +24 -0
  83. package/dist/{sprout-HE4TITMK.js → sprout-WX2FFYLP.js} +1 -1
  84. package/dist/src-FQE4BHRG.js +617 -0
  85. package/dist/src-GW6FP6VL.js +425 -0
  86. package/dist/src-QEOLMAYC.js +2133 -0
  87. package/dist/{status-ZK34WYIM.js → status-3IVSLJDN.js} +6 -6
  88. package/dist/system-chat-2IFS5HCX.js +34 -0
  89. package/dist/{tailscale-ZIZ2HWJ5.js → tailscale-DZU4WM3E.js} +3 -3
  90. package/dist/{template-hash-A7FNHTB7.js → template-hash-6ITI3WC4.js} +2 -2
  91. package/dist/up-4SCIUIMG.js +19 -0
  92. package/dist/{update-ANE5ZM7F.js → update-RIQYUPVN.js} +6 -6
  93. package/dist/{update-check-UV55CBEP.js → update-check-4TIJKVGD.js} +3 -3
  94. package/dist/{version-notify-FXSEMXWW.js → version-notify-UXSHBZ35.js} +21 -22
  95. package/dist/{volute-config-D2XVS2YI.js → volute-config-V7UFFBG3.js} +1 -1
  96. package/dist/web-assets/assets/index-C-eYso8Y.js +75 -0
  97. package/dist/web-assets/assets/index-CCv_fSte.css +1 -0
  98. package/dist/web-assets/index.html +2 -2
  99. package/drizzle/0006_channels.sql +17 -0
  100. package/drizzle/0007_drop_conversation_name_title.sql +11 -0
  101. package/drizzle/0008_performance_indexes.sql +6 -0
  102. package/drizzle/meta/0006_snapshot.json +7 -0
  103. package/drizzle/meta/0007_snapshot.json +7 -0
  104. package/drizzle/meta/_journal.json +21 -0
  105. package/package.json +5 -5
  106. package/templates/_base/home/.config/routes.json +2 -2
  107. package/templates/_base/home/VOLUTE.md +1 -2
  108. package/templates/_base/src/lib/format-prefix.ts +1 -7
  109. package/templates/claude/.init/.config/routes.json +2 -2
  110. package/templates/codex/.init/.config/routes.json +2 -2
  111. package/templates/pi/.init/.config/routes.json +2 -2
  112. package/dist/delivery-manager-H5ZVBMCQ.js +0 -31
  113. package/dist/down-74VXM45A.js +0 -17
  114. package/dist/message-delivery-GRC4W6P7.js +0 -41
  115. package/dist/mind-manager-HFLB5653.js +0 -31
  116. package/dist/mind-service-X2CAA6W6.js +0 -37
  117. package/dist/scheduler-Y7O4CJXL.js +0 -31
  118. package/dist/sleep-manager-7KFK3USC.js +0 -35
  119. package/dist/spirit-ZFRDXMG7.js +0 -23
  120. package/dist/system-chat-IDPHYHY4.js +0 -35
  121. package/dist/up-77ICEDEW.js +0 -19
  122. package/dist/web-assets/assets/index-BhxWKvbB.css +0 -1
  123. package/dist/web-assets/assets/index-CHVKJ9II.js +0 -75
@@ -3,10 +3,10 @@ import {
3
3
  broadcast,
4
4
  publish,
5
5
  subscribe
6
- } from "./chunk-CORXD635.js";
7
- import "./chunk-BKF4WQCY.js";
8
- import "./chunk-BDYXIWA5.js";
9
- import "./chunk-5N7Y5WAM.js";
6
+ } from "./chunk-B35VNNSS.js";
7
+ import "./chunk-T2TP6ZC6.js";
8
+ import "./chunk-75AJ54GM.js";
9
+ import "./chunk-7PTQGPJY.js";
10
10
  import "./chunk-7KJOFUNN.js";
11
11
  export {
12
12
  broadcast,
@@ -17,11 +17,11 @@ import {
17
17
  setEnabledModels,
18
18
  setUtilityModel,
19
19
  unqualifyModelId
20
- } from "./chunk-FT5KETXZ.js";
21
- import "./chunk-BKF4WQCY.js";
22
- import "./chunk-BMZQYACC.js";
23
- import "./chunk-BDYXIWA5.js";
24
- import "./chunk-5N7Y5WAM.js";
20
+ } from "./chunk-M5RYAA5I.js";
21
+ import "./chunk-T2TP6ZC6.js";
22
+ import "./chunk-NUX47Y2V.js";
23
+ import "./chunk-75AJ54GM.js";
24
+ import "./chunk-7PTQGPJY.js";
25
25
  import "./chunk-7KJOFUNN.js";
26
26
  export {
27
27
  aiComplete,
@@ -5,9 +5,9 @@ import {
5
5
  extractArchive,
6
6
  isHomeOnlyArchive,
7
7
  readManifest
8
- } from "./chunk-N5LMGYXX.js";
9
- import "./chunk-BDYXIWA5.js";
10
- import "./chunk-5N7Y5WAM.js";
8
+ } from "./chunk-SWW6AUVW.js";
9
+ import "./chunk-75AJ54GM.js";
10
+ import "./chunk-7PTQGPJY.js";
11
11
  import "./chunk-7KJOFUNN.js";
12
12
  export {
13
13
  addHistoryToArchive,
@@ -17,11 +17,11 @@ import {
17
17
  syncMindProfile,
18
18
  updateUserProfile,
19
19
  verifyUser
20
- } from "./chunk-XRQSAMX2.js";
21
- import "./chunk-CORXD635.js";
22
- import "./chunk-BKF4WQCY.js";
23
- import "./chunk-BDYXIWA5.js";
24
- import "./chunk-5N7Y5WAM.js";
20
+ } from "./chunk-DMV5P2LU.js";
21
+ import "./chunk-B35VNNSS.js";
22
+ import "./chunk-T2TP6ZC6.js";
23
+ import "./chunk-75AJ54GM.js";
24
+ import "./chunk-7PTQGPJY.js";
25
25
  import "./chunk-7KJOFUNN.js";
26
26
  export {
27
27
  approveUser,
@@ -12,15 +12,15 @@ var cmd = subcommands({
12
12
  commands: {
13
13
  send: {
14
14
  description: "Send a message",
15
- run: (args) => import("./send-JBJJQ7CA.js").then((m) => m.run(args))
15
+ run: (args) => import("./send-LXUT2GGR.js").then((m) => m.run(args))
16
16
  },
17
17
  list: {
18
18
  description: "List conversations",
19
- run: (args) => import("./list-PDMQM7ZV.js").then((m) => m.run(args))
19
+ run: (args) => import("./list-GJ4RUQQT.js").then((m) => m.run(args))
20
20
  },
21
21
  read: {
22
22
  description: "Read conversation messages",
23
- run: (args) => import("./read-67VRP2DO.js").then((m) => m.run(args))
23
+ run: (args) => import("./read-ZUDG4JWU.js").then((m) => m.run(args))
24
24
  },
25
25
  create: {
26
26
  description: "Create a conversation",
@@ -32,7 +32,7 @@ var cmd = subcommands({
32
32
  },
33
33
  files: {
34
34
  description: "List pending incoming files",
35
- run: (args) => import("./files-CWTK6V3H.js").then((m) => m.run(args))
35
+ run: (args) => import("./files-H2YLRD37.js").then((m) => m.run(args))
36
36
  },
37
37
  accept: {
38
38
  description: "Accept a pending file",
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // packages/daemon/src/lib/template.ts
3
+ // packages/daemon/src/lib/template/template.ts
4
4
  import {
5
5
  cpSync,
6
6
  existsSync,
@@ -14,11 +14,16 @@ import {
14
14
  } from "fs";
15
15
  import { tmpdir } from "os";
16
16
  import { dirname, join, relative, resolve } from "path";
17
+ var _templatesRoot = null;
17
18
  function findTemplatesRoot() {
19
+ if (_templatesRoot) return _templatesRoot;
18
20
  let dir = dirname(new URL(import.meta.url).pathname);
19
- for (let i = 0; i < 5; i++) {
21
+ for (let i = 0; i < 7; i++) {
20
22
  const candidate = resolve(dir, "templates");
21
- if (existsSync(resolve(candidate, "_base"))) return candidate;
23
+ if (existsSync(resolve(candidate, "_base"))) {
24
+ _templatesRoot = candidate;
25
+ return _templatesRoot;
26
+ }
22
27
  dir = dirname(dir);
23
28
  }
24
29
  console.error(
@@ -4,41 +4,69 @@ import {
4
4
  composeTemplate,
5
5
  copyTemplateToDir,
6
6
  findTemplatesRoot
7
- } from "./chunk-AOB6GVRM.js";
7
+ } from "./chunk-46DYYHN6.js";
8
8
  import {
9
9
  getSharedSkill,
10
- installSkill
11
- } from "./chunk-IJHIXLVN.js";
10
+ installSkill,
11
+ mindSkillsDir
12
+ } from "./chunk-GBDVNPN2.js";
13
+ import {
14
+ readVoluteConfig,
15
+ writeVoluteConfig
16
+ } from "./chunk-CU6OFXMM.js";
12
17
  import {
13
18
  qualifyModelId,
14
19
  resolveTemplate
15
- } from "./chunk-FT5KETXZ.js";
20
+ } from "./chunk-M5RYAA5I.js";
16
21
  import {
17
22
  logger_default
18
- } from "./chunk-BKF4WQCY.js";
23
+ } from "./chunk-T2TP6ZC6.js";
19
24
  import {
20
25
  exec
21
- } from "./chunk-AN2W47GW.js";
26
+ } from "./chunk-PJ4IPTIN.js";
22
27
  import {
23
28
  readGlobalConfig
24
- } from "./chunk-BMZQYACC.js";
29
+ } from "./chunk-NUX47Y2V.js";
25
30
  import {
26
31
  addSpirit,
27
32
  findMind,
28
33
  nextPort,
29
34
  voluteSystemDir
30
- } from "./chunk-BDYXIWA5.js";
35
+ } from "./chunk-75AJ54GM.js";
31
36
 
32
- // packages/daemon/src/lib/spirit.ts
37
+ // packages/daemon/src/lib/mind/spirit.ts
33
38
  import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
34
- import { homedir } from "os";
35
39
  import { resolve } from "path";
36
40
  var slog = logger_default.child("spirit");
41
+ var SPIRIT_SKILLS = [
42
+ "volute-admin",
43
+ "orientation",
44
+ "memory",
45
+ "seed-nurture",
46
+ "tending",
47
+ "plan-coordinator"
48
+ ];
49
+ var TENDING_SCHEDULE = {
50
+ id: "tending",
51
+ cron: "0 10 * * *",
52
+ message: "Check on the minds in your care \u2014 see if anyone could use a suggestion about features they haven't tried yet.",
53
+ enabled: true,
54
+ whileSleeping: "skip"
55
+ };
37
56
  function npmEnv() {
38
- const cacheDir = resolve(homedir(), ".npm");
57
+ const cacheDir = resolve(voluteSystemDir(), ".npm-cache");
39
58
  mkdirSync(cacheDir, { recursive: true });
40
59
  return { ...process.env, npm_config_cache: cacheDir };
41
60
  }
61
+ function ensureTendingSchedule(dir) {
62
+ const config = readVoluteConfig(dir) ?? {};
63
+ const schedules = config.schedules ?? [];
64
+ if (schedules.some((s) => s.id === "tending")) return false;
65
+ schedules.push({ ...TENDING_SCHEDULE });
66
+ config.schedules = schedules;
67
+ writeVoluteConfig(dir, config);
68
+ return true;
69
+ }
42
70
  function spiritDir() {
43
71
  return resolve(voluteSystemDir(), "spirit");
44
72
  }
@@ -85,14 +113,7 @@ async function ensureSpiritProject() {
85
113
  } catch (err) {
86
114
  slog.warn("git init failed for spirit \u2014 not critical", logger_default.errorData(err));
87
115
  }
88
- const spiritSkills = [
89
- "volute-admin",
90
- "orientation",
91
- "memory",
92
- "seed-nurture",
93
- "plan-coordinator"
94
- ];
95
- for (const skillId of spiritSkills) {
116
+ for (const skillId of SPIRIT_SKILLS) {
96
117
  try {
97
118
  const shared = await getSharedSkill(skillId);
98
119
  if (shared) {
@@ -102,7 +123,12 @@ async function ensureSpiritProject() {
102
123
  slog.warn(`failed to install skill ${skillId} for spirit`, logger_default.errorData(err));
103
124
  }
104
125
  }
105
- const { createMindUser, chownMindDir, ensureVoluteGroup } = await import("./isolation-TK5RX2WM.js");
126
+ try {
127
+ ensureTendingSchedule(dir);
128
+ } catch (err) {
129
+ slog.warn("failed to add tending schedule to spirit config", logger_default.errorData(err));
130
+ }
131
+ const { createMindUser, chownMindDir, ensureVoluteGroup } = await import("./isolation-N74RWOUX.js");
106
132
  ensureVoluteGroup();
107
133
  createMindUser("volute", resolve(dir, "home"));
108
134
  chownMindDir(dir, "volute");
@@ -136,8 +162,8 @@ async function syncSpiritTemplate() {
136
162
  cpSync(newPkg, resolve(dir, "package.json"));
137
163
  await exec("npm", ["install", "--ignore-scripts"], { cwd: dir, env: npmEnv() });
138
164
  }
139
- const db = await (await import("./db-BVBJ57TU.js")).getDb();
140
- const { minds } = await import("./schema-XVZ2CLKW.js");
165
+ const db = await (await import("./db-URORGSXQ.js")).getDb();
166
+ const { minds } = await import("./schema-MISD3JFG.js");
141
167
  const { eq } = await import("drizzle-orm");
142
168
  await db.update(minds).set({ template: expectedTemplate }).where(eq(minds.name, "volute"));
143
169
  }
@@ -192,6 +218,26 @@ async function syncSpiritTemplate() {
192
218
  mkdirSync(resolve(full, ".."), { recursive: true });
193
219
  writeFileSync(full, content);
194
220
  }
221
+ for (const skillId of SPIRIT_SKILLS) {
222
+ const skillDir = resolve(mindSkillsDir(dir), skillId);
223
+ if (existsSync(skillDir)) continue;
224
+ try {
225
+ const shared = await getSharedSkill(skillId);
226
+ if (shared) {
227
+ await installSkill("volute", dir, skillId);
228
+ slog.info(`installed missing spirit skill: ${skillId}`);
229
+ }
230
+ } catch (err) {
231
+ slog.warn(`failed to install spirit skill ${skillId}`, logger_default.errorData(err));
232
+ }
233
+ }
234
+ try {
235
+ if (ensureTendingSchedule(dir)) {
236
+ slog.info("added tending schedule to spirit");
237
+ }
238
+ } catch (err) {
239
+ slog.warn("failed to add tending schedule to spirit config", logger_default.errorData(err));
240
+ }
195
241
  slog.info("spirit template synced");
196
242
  }
197
243
  function getSpiritSoul(systemName, systemDescription) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  minds,
4
4
  schema_exports
5
- } from "./chunk-5N7Y5WAM.js";
5
+ } from "./chunk-7PTQGPJY.js";
6
6
 
7
7
  // packages/daemon/src/lib/db.ts
8
8
  import { chmodSync, existsSync } from "fs";
@@ -12,7 +12,7 @@ import { sql } from "drizzle-orm";
12
12
  import { drizzle } from "drizzle-orm/libsql";
13
13
  import { migrate } from "drizzle-orm/libsql/migrator";
14
14
 
15
- // packages/daemon/src/lib/registry.ts
15
+ // packages/daemon/src/lib/mind/registry.ts
16
16
  import { mkdirSync } from "fs";
17
17
  import { homedir } from "os";
18
18
  import { dirname, resolve } from "path";
@@ -197,6 +197,16 @@ var __dirname = dirname2(fileURLToPath2(import.meta.url));
197
197
  var migrationsFolder = existsSync(resolve2(__dirname, "../drizzle")) ? resolve2(__dirname, "../drizzle") : existsSync(resolve2(__dirname, "../../drizzle")) ? resolve2(__dirname, "../../drizzle") : resolve2(__dirname, "../../../../drizzle");
198
198
  var db = null;
199
199
  var dbPromise = null;
200
+ async function cleanupConversationColumns(db2) {
201
+ const cols = await db2.all(sql.raw("PRAGMA table_info(conversations)"));
202
+ const colNames = new Set(cols.map((c) => c.name));
203
+ const toDrop = ["name", "title", "mind_name", "channel"].filter((c) => colNames.has(c));
204
+ if (toDrop.length === 0) return;
205
+ for (const col of toDrop) {
206
+ await db2.run(sql.raw(`DROP INDEX IF EXISTS idx_conversations_${col}`));
207
+ await db2.run(sql.raw(`ALTER TABLE conversations DROP COLUMN ${col}`));
208
+ }
209
+ }
200
210
  async function getDb() {
201
211
  if (db) return db;
202
212
  if (dbPromise) return dbPromise;
@@ -208,6 +218,7 @@ async function getDb() {
208
218
  await instance.run(sql.raw("PRAGMA busy_timeout=5000"));
209
219
  await instance.run(sql.raw("PRAGMA foreign_keys=ON"));
210
220
  await migrate(instance, { migrationsFolder });
221
+ await cleanupConversationColumns(instance);
211
222
  try {
212
223
  chmodSync(dbPath, 384);
213
224
  } catch (err) {
@@ -7,6 +7,7 @@ import {
7
7
  var schema_exports = {};
8
8
  __export(schema_exports, {
9
9
  activity: () => activity,
10
+ channels: () => channels,
10
11
  conversationParticipants: () => conversationParticipants,
11
12
  conversationReads: () => conversationReads,
12
13
  conversations: () => conversations,
@@ -59,21 +60,15 @@ var conversations = sqliteTable(
59
60
  "conversations",
60
61
  {
61
62
  id: text("id").primaryKey(),
62
- mind_name: text("mind_name"),
63
- channel: text("channel").notNull(),
64
63
  type: text("type").notNull().default("dm"),
65
- name: text("name"),
66
64
  user_id: integer("user_id").references(() => users.id),
67
- title: text("title"),
68
65
  private: integer("private").notNull().default(0),
69
66
  created_at: text("created_at").notNull().default(sql`(datetime('now'))`),
70
67
  updated_at: text("updated_at").notNull().default(sql`(datetime('now'))`)
71
68
  },
72
69
  (table) => [
73
- index("idx_conversations_mind_name").on(table.mind_name),
74
70
  index("idx_conversations_user_id").on(table.user_id),
75
- index("idx_conversations_updated_at").on(table.updated_at),
76
- uniqueIndex("idx_conversations_name").on(table.name)
71
+ index("idx_conversations_updated_at").on(table.updated_at)
77
72
  ]
78
73
  );
79
74
  var turns = sqliteTable(
@@ -90,7 +85,8 @@ var turns = sqliteTable(
90
85
  },
91
86
  (table) => [
92
87
  index("idx_turns_mind").on(table.mind),
93
- index("idx_turns_mind_status").on(table.mind, table.status)
88
+ index("idx_turns_mind_status").on(table.mind, table.status),
89
+ index("idx_turns_mind_created_at").on(table.mind, table.created_at)
94
90
  ]
95
91
  );
96
92
  var mindHistory = sqliteTable(
@@ -112,7 +108,9 @@ var mindHistory = sqliteTable(
112
108
  index("idx_mind_history_mind").on(table.mind),
113
109
  index("idx_mind_history_mind_channel").on(table.mind, table.channel),
114
110
  index("idx_mind_history_mind_type").on(table.mind, table.type),
115
- index("idx_mind_history_turn_id").on(table.turn_id)
111
+ index("idx_mind_history_turn_id").on(table.turn_id),
112
+ index("idx_mind_history_session").on(table.session),
113
+ index("idx_mind_history_mind_created_at").on(table.mind, table.created_at)
116
114
  ]
117
115
  );
118
116
  var conversationParticipants = sqliteTable(
@@ -161,7 +159,8 @@ var deliveryQueue = sqliteTable(
161
159
  },
162
160
  (table) => [
163
161
  index("idx_delivery_queue_mind_session").on(table.mind, table.session),
164
- index("idx_delivery_queue_mind_status").on(table.mind, table.status)
162
+ index("idx_delivery_queue_mind_status").on(table.mind, table.status),
163
+ index("idx_delivery_queue_status").on(table.status)
165
164
  ]
166
165
  );
167
166
  var activity = sqliteTable(
@@ -179,7 +178,8 @@ var activity = sqliteTable(
179
178
  (table) => [
180
179
  index("idx_activity_created_at").on(table.created_at),
181
180
  index("idx_activity_mind").on(table.mind),
182
- index("idx_activity_turn_id").on(table.turn_id)
181
+ index("idx_activity_turn_id").on(table.turn_id),
182
+ index("idx_activity_type").on(table.type)
183
183
  ]
184
184
  );
185
185
  var summaries = sqliteTable(
@@ -195,7 +195,8 @@ var summaries = sqliteTable(
195
195
  },
196
196
  (table) => [
197
197
  uniqueIndex("idx_summaries_unique").on(table.mind, table.period, table.period_key),
198
- index("idx_summaries_mind_period").on(table.mind, table.period)
198
+ index("idx_summaries_mind_period").on(table.mind, table.period),
199
+ index("idx_summaries_mind_period_key").on(table.mind, table.period_key)
199
200
  ]
200
201
  );
201
202
  var conversationReads = sqliteTable(
@@ -209,6 +210,20 @@ var conversationReads = sqliteTable(
209
210
  uniqueIndex("idx_conversation_reads_unique").on(table.user_id, table.conversation_id)
210
211
  ]
211
212
  );
213
+ var channels = sqliteTable(
214
+ "channels",
215
+ {
216
+ conversation_id: text("conversation_id").primaryKey().references(() => conversations.id, { onDelete: "cascade" }),
217
+ name: text("name").notNull(),
218
+ description: text("description"),
219
+ rules: text("rules"),
220
+ char_limit: integer("char_limit"),
221
+ private: integer("private").notNull().default(0),
222
+ created_at: text("created_at").notNull().default(sql`(datetime('now'))`),
223
+ updated_at: text("updated_at").notNull().default(sql`(datetime('now'))`)
224
+ },
225
+ (table) => [uniqueIndex("idx_channels_name").on(table.name)]
226
+ );
212
227
  var messages = sqliteTable(
213
228
  "messages",
214
229
  {
@@ -241,6 +256,7 @@ export {
241
256
  activity,
242
257
  summaries,
243
258
  conversationReads,
259
+ channels,
244
260
  messages,
245
261
  schema_exports
246
262
  };
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  logger_default
4
- } from "./chunk-BKF4WQCY.js";
4
+ } from "./chunk-T2TP6ZC6.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-BDYXIWA5.js";
7
+ } from "./chunk-75AJ54GM.js";
8
8
  import {
9
9
  activity
10
- } from "./chunk-5N7Y5WAM.js";
10
+ } from "./chunk-7PTQGPJY.js";
11
11
 
12
12
  // packages/daemon/src/lib/events/activity-events.ts
13
13
  var subscribers = /* @__PURE__ */ new Set();
@@ -1,19 +1,19 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  logger_default
4
- } from "./chunk-BKF4WQCY.js";
4
+ } from "./chunk-T2TP6ZC6.js";
5
5
  import {
6
6
  readGlobalConfig
7
- } from "./chunk-BMZQYACC.js";
7
+ } from "./chunk-NUX47Y2V.js";
8
8
  import {
9
9
  getBaseName,
10
10
  readRegistry,
11
11
  voluteHome,
12
12
  voluteSystemDir,
13
13
  voluteUserHome
14
- } from "./chunk-BDYXIWA5.js";
14
+ } from "./chunk-75AJ54GM.js";
15
15
 
16
- // packages/daemon/src/lib/sandbox.ts
16
+ // packages/daemon/src/lib/mind/sandbox.ts
17
17
  import { resolve } from "path";
18
18
  var slog = logger_default.child("sandbox");
19
19
  var sandboxManager = null;
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // packages/daemon/src/lib/volute-config.ts
3
+ // packages/daemon/src/lib/mind/volute-config.ts
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
5
5
  import { dirname, resolve } from "path";
6
6
  function readJson(path) {
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  exec,
4
4
  execInherit
5
- } from "./chunk-AN2W47GW.js";
5
+ } from "./chunk-PJ4IPTIN.js";
6
6
  import {
7
7
  voluteSystemDir
8
- } from "./chunk-BDYXIWA5.js";
8
+ } from "./chunk-75AJ54GM.js";
9
9
 
10
- // packages/daemon/src/lib/service-mode.ts
10
+ // packages/daemon/src/lib/config/service-mode.ts
11
11
  import { execFileSync } from "child_process";
12
12
  import { existsSync, readFileSync } from "fs";
13
13
  import { homedir } from "os";
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  broadcast
4
- } from "./chunk-CORXD635.js";
4
+ } from "./chunk-B35VNNSS.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-BDYXIWA5.js";
7
+ } from "./chunk-75AJ54GM.js";
8
8
  import {
9
9
  users
10
- } from "./chunk-5N7Y5WAM.js";
10
+ } from "./chunk-7PTQGPJY.js";
11
11
 
12
12
  // packages/daemon/src/lib/auth.ts
13
13
  import { compareSync, hashSync } from "bcryptjs";