volute 0.42.1 → 0.43.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 (98) hide show
  1. package/dist/{activity-events-KFKVRZE3.js → activity-events-UISXY4Y5.js} +3 -3
  2. package/dist/{ai-service-3GBOJGUA.js → ai-service-FBCCEYF5.js} +8 -4
  3. package/dist/{archive-4PPYF7LL.js → archive-I32WHCJB.js} +3 -3
  4. package/dist/{auth-EAASQPTN.js → auth-3RIG6GKN.js} +4 -4
  5. package/dist/{chat-LYL5CWJV.js → chat-SDSX5TVV.js} +2 -2
  6. package/dist/{chunk-M2YMNTHK.js → chunk-2HIVYZDB.js} +1 -1
  7. package/dist/{chunk-BWZHX46O.js → chunk-3WLWKOGM.js} +21 -6
  8. package/dist/{chunk-QPTQKGGF.js → chunk-57LBQ7JX.js} +1 -1
  9. package/dist/{chunk-43K5UWF7.js → chunk-65OLHBCL.js} +13 -12
  10. package/dist/{chunk-K547QOCM.js → chunk-7G2EEYXX.js} +2 -2
  11. package/dist/{chunk-E7XWFDZL.js → chunk-AD46AYZQ.js} +1 -1
  12. package/dist/{chunk-P6DPB33N.js → chunk-ATEX3ZPG.js} +2 -2
  13. package/dist/{chunk-WR7CSHQ4.js → chunk-C6ESRQZ7.js} +1 -1
  14. package/dist/{chunk-BR6KFHVT.js → chunk-EE7SZJON.js} +2 -2
  15. package/dist/{chunk-5QG36RV7.js → chunk-EFL5UOY4.js} +3 -3
  16. package/dist/{chunk-M3T3Y6FT.js → chunk-FSSUANZJ.js} +5 -5
  17. package/dist/{chunk-JPDN6ZRJ.js → chunk-FZ5TH5PF.js} +8 -8
  18. package/dist/{chunk-OEJFZHZZ.js → chunk-GZJFC76M.js} +1 -1
  19. package/dist/{chunk-KUJVCDWT.js → chunk-JVK6QQIC.js} +2 -2
  20. package/dist/{chunk-YLTIEEVL.js → chunk-K4EHBHPE.js} +3 -3
  21. package/dist/{chunk-MHFAWJCC.js → chunk-L3IV23ZG.js} +12 -1
  22. package/dist/{chunk-VBKRZCR7.js → chunk-M3PGGSBH.js} +1 -1
  23. package/dist/{chunk-NSGIVS5T.js → chunk-O3DXAR44.js} +2 -2
  24. package/dist/{chunk-KZAL7HEQ.js → chunk-ONM2AZFL.js} +1 -1
  25. package/dist/{chunk-6G7R2LPI.js → chunk-PF2AB7VJ.js} +568 -378
  26. package/dist/chunk-PGPLCJPK.js +272 -0
  27. package/dist/{chunk-62ICA2FF.js → chunk-SPLPKBES.js} +17 -1
  28. package/dist/{chunk-BLOAJLGI.js → chunk-XDTKJNW5.js} +1 -1
  29. package/dist/{chunk-IUZ3EV2D.js → chunk-YAMO2U3N.js} +1 -1
  30. package/dist/{chunk-4ZSUUBG5.js → chunk-YSV3VJQK.js} +55 -2
  31. package/dist/{chunk-JU5GWO77.js → chunk-ZO7IQJKO.js} +3 -3
  32. package/dist/cli.js +15 -15
  33. package/dist/{cloud-sync-E3ZL5SZ4.js → cloud-sync-FRYNWKCR.js} +16 -17
  34. package/dist/{conversations-FSZCUUYO.js → conversations-67WWW25C.js} +4 -4
  35. package/dist/{create-ERNQYOCK.js → create-7W3LV3J7.js} +1 -1
  36. package/dist/{daemon-restart-QBZOMILO.js → daemon-restart-5GVZ5V3X.js} +7 -8
  37. package/dist/daemon.js +524 -433
  38. package/dist/{db-ZJJJYJBU.js → db-CZV62BOQ.js} +2 -2
  39. package/dist/delivery-manager-5J2BE22P.js +32 -0
  40. package/dist/{delivery-router-FDBZJQOY.js → delivery-router-HXBHYHJM.js} +7 -5
  41. package/dist/down-RRNYIGCU.js +16 -0
  42. package/dist/echo-text-XKBJM6RV.js +32 -0
  43. package/dist/{exec-ZDD7NEB4.js → exec-SJK7VUTC.js} +3 -4
  44. package/dist/{export-WYI3E3TB.js → export-7LPCIB5J.js} +3 -3
  45. package/dist/{extensions-X6MKBJLB.js → extensions-76EGTMFY.js} +16 -17
  46. package/dist/{files-COTCVBGO.js → files-LV7VAKPC.js} +3 -3
  47. package/dist/{import-EPK6WCYS.js → import-XPECCRQ7.js} +6 -6
  48. package/dist/{isolation-F7ABZMDA.js → isolation-5AYEY55P.js} +5 -3
  49. package/dist/{login-GPBXOU4D.js → login-KJSN4JDA.js} +2 -2
  50. package/dist/{logout-DNNTIYE2.js → logout-TMJGUQV2.js} +2 -2
  51. package/dist/message-delivery-WJBZFALY.js +34 -0
  52. package/dist/{mind-K5PZHPBR.js → mind-QEWCR7FA.js} +5 -5
  53. package/dist/{mind-activity-tracker-HWVFE533.js → mind-activity-tracker-JHAT6456.js} +4 -4
  54. package/dist/mind-service-ZBVUMJ5H.js +36 -0
  55. package/dist/{package-G4AM2IDZ.js → package-ZOI2KAYC.js} +1 -1
  56. package/dist/{registry-MDLNPTTI.js → registry-7LQHTRUX.js} +2 -2
  57. package/dist/{sandbox-E7RWZDVG.js → sandbox-SJH3XOPZ.js} +4 -4
  58. package/dist/scheduler-BR6C6B3E.js +30 -0
  59. package/dist/{schema-HHYJDG7B.js → schema-LRUTFOER.js} +1 -1
  60. package/dist/{seed-SKVSWF7S.js → seed-KOG6KJAO.js} +1 -1
  61. package/dist/{seed-cmd-D2H5VLB4.js → seed-cmd-GJFENEJH.js} +2 -2
  62. package/dist/{seed-create-BUSKQ5II.js → seed-create-YXO6R4KE.js} +3 -3
  63. package/dist/{seed-sprout-R2IZPITD.js → seed-sprout-BBU64QXP.js} +7 -8
  64. package/dist/{send-SLDFRSTL.js → send-ZBZWIH5V.js} +3 -3
  65. package/dist/{service-ZDOSEQCE.js → service-4EVZKGSA.js} +4 -5
  66. package/dist/{service-install-2HZPDHEY.js → service-install-SHRM6NHK.js} +5 -6
  67. package/dist/{setup-IYOUPCIK.js → setup-25MMJ3J4.js} +3 -3
  68. package/dist/{setup-IU3ID7II.js → setup-354PDHUF.js} +8 -10
  69. package/dist/{skills-P6RGGASV.js → skills-DPI3WZPQ.js} +5 -6
  70. package/dist/sleep-manager-BVU5D2AE.js +34 -0
  71. package/dist/{spirit-XLD6QXSS.js → spirit-JQQHUVWR.js} +7 -8
  72. package/dist/{sprout-QV2RJM5W.js → sprout-4WAYBUVV.js} +1 -1
  73. package/dist/{status-QAKAPDYW.js → status-WTU2WHXY.js} +5 -6
  74. package/dist/system-chat-KMQIP7VH.js +34 -0
  75. package/dist/{tailscale-TIRTGM6E.js → tailscale-Q7ZJL7S7.js} +2 -2
  76. package/dist/{turn-tracker-Z5UJC4BY.js → turn-tracker-2GMKJQTN.js} +7 -5
  77. package/dist/up-7RSBEKW6.js +18 -0
  78. package/dist/{update-NY3XBVAJ.js → update-EJ7Q77ZX.js} +5 -6
  79. package/dist/{update-check-OG27AL4Z.js → update-check-ACYYNKTW.js} +3 -3
  80. package/dist/{version-notify-P7UAR7HZ.js → version-notify-DCAIXXZB.js} +17 -18
  81. package/dist/web-assets/assets/{index-CrFAsfiE.js → index-DTDmEfPU.js} +2 -2
  82. package/dist/web-assets/index.html +1 -1
  83. package/drizzle/0010_delivery_queue_redrive.sql +10 -0
  84. package/drizzle/meta/_journal.json +7 -0
  85. package/package.json +1 -1
  86. package/templates/codex/src/server.ts +2 -8
  87. package/dist/chunk-GN52E2DP.js +0 -59
  88. package/dist/chunk-TFBQESH7.js +0 -179
  89. package/dist/delivery-manager-J3BRHXUF.js +0 -33
  90. package/dist/down-DSRWSCXY.js +0 -17
  91. package/dist/echo-text-3HBQUWPX.js +0 -33
  92. package/dist/message-delivery-4ZWFDBAY.js +0 -41
  93. package/dist/mind-manager-6DSY5IJW.js +0 -33
  94. package/dist/mind-service-R2FM53KD.js +0 -37
  95. package/dist/scheduler-2FKQCRCM.js +0 -31
  96. package/dist/sleep-manager-F5KWIFOX.js +0 -35
  97. package/dist/system-chat-EQIH6JVL.js +0 -35
  98. package/dist/up-ZTPGC7HB.js +0 -19
@@ -3,10 +3,10 @@ import {
3
3
  broadcast,
4
4
  publish,
5
5
  subscribe
6
- } from "./chunk-K547QOCM.js";
6
+ } from "./chunk-7G2EEYXX.js";
7
7
  import "./chunk-T2TP6ZC6.js";
8
- import "./chunk-IUZ3EV2D.js";
9
- import "./chunk-MHFAWJCC.js";
8
+ import "./chunk-YAMO2U3N.js";
9
+ import "./chunk-L3IV23ZG.js";
10
10
  import "./chunk-K3NQKI34.js";
11
11
  export {
12
12
  broadcast,
@@ -4,6 +4,7 @@ import {
4
4
  aiComplete,
5
5
  aiCompleteUtility,
6
6
  buildCustomModel,
7
+ findModel,
7
8
  fireProviderRefreshHook,
8
9
  getAiConfig,
9
10
  getAvailableModels,
@@ -12,6 +13,7 @@ import {
12
13
  getEnabledModels,
13
14
  getUtilityModel,
14
15
  isAiConfigured,
16
+ migrateAiModelQualification,
15
17
  qualifyModelId,
16
18
  removeAiConfig,
17
19
  removeCustomModel,
@@ -23,17 +25,18 @@ import {
23
25
  setProviderRefreshHook,
24
26
  setUtilityModel,
25
27
  unqualifyModelId
26
- } from "./chunk-4ZSUUBG5.js";
27
- import "./chunk-KZAL7HEQ.js";
28
+ } from "./chunk-YSV3VJQK.js";
29
+ import "./chunk-ONM2AZFL.js";
28
30
  import "./chunk-T2TP6ZC6.js";
29
- import "./chunk-IUZ3EV2D.js";
30
- import "./chunk-MHFAWJCC.js";
31
+ import "./chunk-YAMO2U3N.js";
32
+ import "./chunk-L3IV23ZG.js";
31
33
  import "./chunk-K3NQKI34.js";
32
34
  export {
33
35
  addCustomModel,
34
36
  aiComplete,
35
37
  aiCompleteUtility,
36
38
  buildCustomModel,
39
+ findModel,
37
40
  fireProviderRefreshHook,
38
41
  getAiConfig,
39
42
  getAvailableModels,
@@ -42,6 +45,7 @@ export {
42
45
  getEnabledModels,
43
46
  getUtilityModel,
44
47
  isAiConfigured,
48
+ migrateAiModelQualification,
45
49
  qualifyModelId,
46
50
  removeAiConfig,
47
51
  removeCustomModel,
@@ -5,9 +5,9 @@ import {
5
5
  extractArchive,
6
6
  isHomeOnlyArchive,
7
7
  readManifest
8
- } from "./chunk-OEJFZHZZ.js";
9
- import "./chunk-IUZ3EV2D.js";
10
- import "./chunk-MHFAWJCC.js";
8
+ } from "./chunk-GZJFC76M.js";
9
+ import "./chunk-YAMO2U3N.js";
10
+ import "./chunk-L3IV23ZG.js";
11
11
  import "./chunk-K3NQKI34.js";
12
12
  export {
13
13
  addHistoryToArchive,
@@ -17,11 +17,11 @@ import {
17
17
  syncMindProfile,
18
18
  updateUserProfile,
19
19
  verifyUser
20
- } from "./chunk-5QG36RV7.js";
21
- import "./chunk-K547QOCM.js";
20
+ } from "./chunk-EFL5UOY4.js";
21
+ import "./chunk-7G2EEYXX.js";
22
22
  import "./chunk-T2TP6ZC6.js";
23
- import "./chunk-IUZ3EV2D.js";
24
- import "./chunk-MHFAWJCC.js";
23
+ import "./chunk-YAMO2U3N.js";
24
+ import "./chunk-L3IV23ZG.js";
25
25
  import "./chunk-K3NQKI34.js";
26
26
  export {
27
27
  approveUser,
@@ -12,7 +12,7 @@ var cmd = subcommands({
12
12
  commands: {
13
13
  send: {
14
14
  description: "Send a message",
15
- run: (args) => import("./send-SLDFRSTL.js").then((m) => m.run(args))
15
+ run: (args) => import("./send-ZBZWIH5V.js").then((m) => m.run(args))
16
16
  },
17
17
  list: {
18
18
  description: "List conversations",
@@ -32,7 +32,7 @@ var cmd = subcommands({
32
32
  },
33
33
  files: {
34
34
  description: "List pending incoming files",
35
- run: (args) => import("./files-COTCVBGO.js").then((m) => m.run(args))
35
+ run: (args) => import("./files-LV7VAKPC.js").then((m) => m.run(args))
36
36
  },
37
37
  accept: {
38
38
  description: "Accept a pending file",
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  stateDir
4
- } from "./chunk-IUZ3EV2D.js";
4
+ } from "./chunk-YAMO2U3N.js";
5
5
 
6
6
  // packages/daemon/src/lib/chat/file-sharing.ts
7
7
  import { randomBytes } from "crypto";
@@ -1,24 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  aiCompleteUtility
4
- } from "./chunk-4ZSUUBG5.js";
4
+ } from "./chunk-YSV3VJQK.js";
5
5
  import {
6
6
  logger_default
7
7
  } from "./chunk-T2TP6ZC6.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-IUZ3EV2D.js";
10
+ } from "./chunk-YAMO2U3N.js";
11
11
  import {
12
12
  messages,
13
13
  mindHistory,
14
14
  summaries,
15
15
  systemPrompts,
16
16
  turns
17
- } from "./chunk-MHFAWJCC.js";
17
+ } from "./chunk-L3IV23ZG.js";
18
18
 
19
19
  // packages/daemon/src/lib/daemon/turn-tracker.ts
20
20
  import { randomUUID } from "crypto";
21
- import { eq as eq3, sql as sql2 } from "drizzle-orm";
21
+ import { and as and2, eq as eq3, sql as sql2 } from "drizzle-orm";
22
22
 
23
23
  // packages/daemon/src/lib/daemon/summarizer.ts
24
24
  import { and, desc, eq as eq2, gte, inArray, like, lt, sql } from "drizzle-orm";
@@ -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-Z5UJC4BY.js");
1016
+ const { sweepWedgedTurns: sweepWedgedTurns2, summarizeOrphanedTurns: summarizeOrphanedTurns2 } = await import("./turn-tracker-2GMKJQTN.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-J3BRHXUF.js");
1020
+ const { tryGetDeliveryManager } = await import("./delivery-manager-5J2BE22P.js");
1021
1021
  const dm = tryGetDeliveryManager();
1022
1022
  if (!dm) return;
1023
1023
  for (const t of wedged) {
@@ -1064,6 +1064,20 @@ async function createTurn(mind) {
1064
1064
  function getActiveTurnId(mind, session) {
1065
1065
  return (activeTurns.get(key(mind, session)) ?? activeTurns.get(key(mind)))?.turnId;
1066
1066
  }
1067
+ async function linkInboundToActiveTurn(mind, session, channel) {
1068
+ if (!channel) return;
1069
+ const turnId = getActiveTurnId(mind, session);
1070
+ if (!turnId) return;
1071
+ const db = await getDb();
1072
+ await db.update(mindHistory).set({ turn_id: turnId }).where(
1073
+ and2(
1074
+ eq3(mindHistory.mind, mind),
1075
+ eq3(mindHistory.type, "inbound"),
1076
+ sql2`${mindHistory.turn_id} IS NULL`,
1077
+ eq3(mindHistory.channel, channel)
1078
+ )
1079
+ );
1080
+ }
1067
1081
  function trackToolUse(mind, session, eventId) {
1068
1082
  const entry = activeTurns.get(key(mind, session)) ?? activeTurns.get(key(mind));
1069
1083
  if (entry) entry.lastToolUseEventId = eventId;
@@ -1201,6 +1215,7 @@ export {
1201
1215
  takeErrored,
1202
1216
  createTurn,
1203
1217
  getActiveTurnId,
1218
+ linkInboundToActiveTurn,
1204
1219
  trackToolUse,
1205
1220
  getLastToolUseEventId,
1206
1221
  assignSession,
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-T2TP6ZC6.js";
5
5
  import {
6
6
  voluteSystemDir
7
- } from "./chunk-IUZ3EV2D.js";
7
+ } from "./chunk-YAMO2U3N.js";
8
8
 
9
9
  // packages/daemon/src/lib/bridges/bridges.ts
10
10
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -10,21 +10,22 @@ import {
10
10
  getSharedSkill,
11
11
  installSkill,
12
12
  mindSkillsDir
13
- } from "./chunk-M3T3Y6FT.js";
13
+ } from "./chunk-FSSUANZJ.js";
14
14
  import {
15
15
  readVoluteConfig,
16
16
  writeVoluteConfig
17
17
  } from "./chunk-CU6OFXMM.js";
18
18
  import {
19
19
  exec
20
- } from "./chunk-GN52E2DP.js";
20
+ } from "./chunk-PGPLCJPK.js";
21
21
  import {
22
22
  qualifyModelId,
23
- resolveTemplate
24
- } from "./chunk-4ZSUUBG5.js";
23
+ resolveTemplate,
24
+ unqualifyModelId
25
+ } from "./chunk-YSV3VJQK.js";
25
26
  import {
26
27
  readGlobalConfig
27
- } from "./chunk-KZAL7HEQ.js";
28
+ } from "./chunk-ONM2AZFL.js";
28
29
  import {
29
30
  logger_default
30
31
  } from "./chunk-T2TP6ZC6.js";
@@ -33,7 +34,7 @@ import {
33
34
  findMind,
34
35
  nextPort,
35
36
  voluteSystemDir
36
- } from "./chunk-IUZ3EV2D.js";
37
+ } from "./chunk-YAMO2U3N.js";
37
38
 
38
39
  // packages/daemon/src/lib/mind/spirit.ts
39
40
  import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
@@ -99,7 +100,7 @@ async function ensureSpiritProject() {
99
100
  writeFileSync(routesPath, `${JSON.stringify(routesContent, null, 2)}
100
101
  `);
101
102
  if (spiritModel) {
102
- const modelForConfig = template === "pi" ? qualifyModelId(spiritModel) : spiritModel;
103
+ const modelForConfig = template === "pi" ? qualifyModelId(spiritModel) : unqualifyModelId(spiritModel);
103
104
  const configPath = resolve(dir, "home/.config/config.json");
104
105
  const mindConfig = existsSync(configPath) ? JSON.parse(readFileSync(configPath, "utf-8")) : {};
105
106
  mindConfig.model = modelForConfig;
@@ -129,10 +130,10 @@ async function ensureSpiritProject() {
129
130
  } catch (err) {
130
131
  slog.warn("failed to add tending schedule to spirit config", logger_default.errorData(err));
131
132
  }
132
- const { createMindUser, chownMindDir, ensureVoluteGroup } = await import("./isolation-F7ABZMDA.js");
133
+ const { createMindUser, chownMindDir, ensureVoluteGroup } = await import("./isolation-5AYEY55P.js");
133
134
  ensureVoluteGroup();
134
135
  createMindUser("volute", resolve(dir, "home"));
135
- chownMindDir(dir, "volute");
136
+ await chownMindDir(dir, "volute");
136
137
  const port = await nextPort();
137
138
  await addSpirit("volute", port, template, dir);
138
139
  slog.info("spirit project created");
@@ -163,8 +164,8 @@ async function syncSpiritTemplate() {
163
164
  cpSync(newPkg, resolve(dir, "package.json"));
164
165
  await exec("npm", ["install"], { cwd: dir, env: npmEnv() });
165
166
  }
166
- const db = await (await import("./db-ZJJJYJBU.js")).getDb();
167
- const { minds } = await import("./schema-HHYJDG7B.js");
167
+ const db = await (await import("./db-CZV62BOQ.js")).getDb();
168
+ const { minds } = await import("./schema-LRUTFOER.js");
168
169
  const { eq } = await import("drizzle-orm");
169
170
  await db.update(minds).set({ template: expectedTemplate }).where(eq(minds.name, "volute"));
170
171
  }
@@ -190,7 +191,7 @@ async function syncSpiritTemplate() {
190
191
  writeFileSync(resolve(dir, "home/SOUL.md"), getSpiritSoul(systemName, config.description));
191
192
  const spiritModel = config.spiritModel;
192
193
  if (spiritModel) {
193
- const modelForConfig = template === "pi" ? qualifyModelId(spiritModel) : spiritModel;
194
+ const modelForConfig = template === "pi" ? qualifyModelId(spiritModel) : unqualifyModelId(spiritModel);
194
195
  const mindConfigPath = resolve(dir, "home/.config/config.json");
195
196
  const mindConfig = existsSync(mindConfigPath) ? JSON.parse(readFileSync(mindConfigPath, "utf-8")) : {};
196
197
  if (mindConfig.model !== modelForConfig) {
@@ -4,10 +4,10 @@ import {
4
4
  } from "./chunk-T2TP6ZC6.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-IUZ3EV2D.js";
7
+ } from "./chunk-YAMO2U3N.js";
8
8
  import {
9
9
  activity
10
- } from "./chunk-MHFAWJCC.js";
10
+ } from "./chunk-L3IV23ZG.js";
11
11
 
12
12
  // packages/daemon/src/lib/events/activity-events.ts
13
13
  var subscribers = /* @__PURE__ */ new Set();
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  voluteSystemDir
4
- } from "./chunk-IUZ3EV2D.js";
4
+ } from "./chunk-YAMO2U3N.js";
5
5
 
6
6
  // packages/daemon/src/lib/update-check.ts
7
7
  import { execFile as execFileCb, execFileSync } from "child_process";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  exec,
4
4
  execInherit
5
- } from "./chunk-GN52E2DP.js";
5
+ } from "./chunk-PGPLCJPK.js";
6
6
  import {
7
7
  voluteSystemDir
8
- } from "./chunk-IUZ3EV2D.js";
8
+ } from "./chunk-YAMO2U3N.js";
9
9
 
10
10
  // packages/daemon/src/lib/config/service-mode.ts
11
11
  import { execFileSync } from "child_process";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  readGlobalConfig
4
- } from "./chunk-KZAL7HEQ.js";
4
+ } from "./chunk-ONM2AZFL.js";
5
5
  import {
6
6
  logger_default
7
7
  } from "./chunk-T2TP6ZC6.js";
@@ -3,10 +3,10 @@ import {
3
3
  LAUNCHD_PLIST_LABEL,
4
4
  LAUNCHD_PLIST_PATH,
5
5
  USER_SYSTEMD_UNIT
6
- } from "./chunk-P6DPB33N.js";
6
+ } from "./chunk-ATEX3ZPG.js";
7
7
  import {
8
8
  resolveVoluteBin
9
- } from "./chunk-GN52E2DP.js";
9
+ } from "./chunk-PGPLCJPK.js";
10
10
 
11
11
  // packages/daemon/src/lib/config/service-install.ts
12
12
  import { execFile } from "child_process";
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  broadcast
4
- } from "./chunk-K547QOCM.js";
4
+ } from "./chunk-7G2EEYXX.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-IUZ3EV2D.js";
7
+ } from "./chunk-YAMO2U3N.js";
8
8
  import {
9
9
  users
10
- } from "./chunk-MHFAWJCC.js";
10
+ } from "./chunk-L3IV23ZG.js";
11
11
 
12
12
  // packages/daemon/src/lib/auth.ts
13
13
  import { compareSync, hashSync } from "bcryptjs";
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  exec,
4
4
  gitExec
5
- } from "./chunk-GN52E2DP.js";
5
+ } from "./chunk-PGPLCJPK.js";
6
6
  import {
7
7
  readGlobalConfig,
8
8
  writeGlobalConfig
9
- } from "./chunk-KZAL7HEQ.js";
9
+ } from "./chunk-ONM2AZFL.js";
10
10
  import {
11
11
  logger_default
12
12
  } from "./chunk-T2TP6ZC6.js";
@@ -15,10 +15,10 @@ import {
15
15
  mindDir,
16
16
  readRegistry,
17
17
  voluteHome
18
- } from "./chunk-IUZ3EV2D.js";
18
+ } from "./chunk-YAMO2U3N.js";
19
19
  import {
20
20
  sharedSkills
21
- } from "./chunk-MHFAWJCC.js";
21
+ } from "./chunk-L3IV23ZG.js";
22
22
 
23
23
  // packages/daemon/src/lib/skills.ts
24
24
  import { createHash } from "crypto";
@@ -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-X6MKBJLB.js");
49
+ const { getExtensionStandardSkills } = await import("./extensions-76EGTMFY.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));
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  findBridgeForChannel,
4
4
  getBridgeConfig
5
- } from "./chunk-QPTQKGGF.js";
5
+ } from "./chunk-57LBQ7JX.js";
6
6
  import {
7
7
  recordOutbound
8
- } from "./chunk-6G7R2LPI.js";
8
+ } from "./chunk-PF2AB7VJ.js";
9
9
  import {
10
10
  readEnv,
11
11
  sharedEnvPath
12
- } from "./chunk-BLOAJLGI.js";
12
+ } from "./chunk-XDTKJNW5.js";
13
13
  import {
14
14
  addMessage,
15
15
  findDMConversation,
@@ -17,21 +17,21 @@ import {
17
17
  getChannelName,
18
18
  getConversation,
19
19
  getParticipants
20
- } from "./chunk-YLTIEEVL.js";
20
+ } from "./chunk-K4EHBHPE.js";
21
21
  import {
22
22
  readVoluteConfig
23
23
  } from "./chunk-CU6OFXMM.js";
24
24
  import {
25
25
  publish
26
- } from "./chunk-BWZHX46O.js";
26
+ } from "./chunk-3WLWKOGM.js";
27
27
  import {
28
28
  daemonConfigPath,
29
29
  readDaemonToken
30
- } from "./chunk-P6DPB33N.js";
30
+ } from "./chunk-ATEX3ZPG.js";
31
31
  import {
32
32
  getOrCreateMindUser,
33
33
  getUserByUsername
34
- } from "./chunk-5QG36RV7.js";
34
+ } from "./chunk-EFL5UOY4.js";
35
35
  import {
36
36
  logger_default
37
37
  } from "./chunk-T2TP6ZC6.js";
@@ -40,7 +40,7 @@ import {
40
40
  } from "./chunk-LGNUFVMR.js";
41
41
  import {
42
42
  mindDir
43
- } from "./chunk-IUZ3EV2D.js";
43
+ } from "./chunk-YAMO2U3N.js";
44
44
  import {
45
45
  __export
46
46
  } from "./chunk-K3NQKI34.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  mindDir,
4
4
  stateDir
5
- } from "./chunk-IUZ3EV2D.js";
5
+ } from "./chunk-YAMO2U3N.js";
6
6
 
7
7
  // packages/daemon/src/lib/mind/archive.ts
8
8
  import { execFileSync } from "child_process";
@@ -1,12 +1,12 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  setBridgeConfig
4
- } from "./chunk-QPTQKGGF.js";
4
+ } from "./chunk-57LBQ7JX.js";
5
5
  import {
6
6
  readEnv,
7
7
  sharedEnvPath,
8
8
  writeEnv
9
- } from "./chunk-BLOAJLGI.js";
9
+ } from "./chunk-XDTKJNW5.js";
10
10
 
11
11
  // packages/daemon/src/lib/template/import-utils.ts
12
12
  import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "fs";
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  subscribe
4
- } from "./chunk-K547QOCM.js";
4
+ } from "./chunk-7G2EEYXX.js";
5
5
  import {
6
6
  logger_default
7
7
  } from "./chunk-T2TP6ZC6.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-IUZ3EV2D.js";
10
+ } from "./chunk-YAMO2U3N.js";
11
11
  import {
12
12
  channels,
13
13
  conversationParticipants,
@@ -15,7 +15,7 @@ import {
15
15
  conversations,
16
16
  messages,
17
17
  users
18
- } from "./chunk-MHFAWJCC.js";
18
+ } from "./chunk-L3IV23ZG.js";
19
19
 
20
20
  // packages/daemon/src/lib/events/conversations.ts
21
21
  import { randomUUID } from "crypto";
@@ -150,18 +150,29 @@ var deliveryQueue = sqliteTable(
150
150
  "delivery_queue",
151
151
  {
152
152
  id: integer("id").primaryKey({ autoIncrement: true }),
153
+ // Keying/cleanup/dedup key: always the base (parent) name, so an insert under a
154
+ // variant name and the id-scoped cleanup share a key.
153
155
  mind: text("mind").notNull(),
156
+ // Original delivery target — may be a variant name. Used to resolve the port on
157
+ // redrive so a variant's stranded message is re-delivered to the variant, not the
158
+ // parent. Null on legacy rows → callers fall back to `mind`.
159
+ target_mind: text("target_mind"),
154
160
  session: text("session").notNull(),
155
161
  channel: text("channel"),
156
162
  sender: text("sender"),
157
163
  status: text("status").notNull().default("pending"),
158
164
  payload: text("payload").notNull(),
165
+ // Redrive bookkeeping: how many delivery attempts have been made, and the
166
+ // earliest time the row is eligible for a retry (null = deliver ASAP).
167
+ attempts: integer("attempts").notNull().default(0),
168
+ next_attempt_at: text("next_attempt_at"),
159
169
  created_at: text("created_at").notNull().default(sql`(datetime('now'))`)
160
170
  },
161
171
  (table) => [
162
172
  index("idx_delivery_queue_mind_session").on(table.mind, table.session),
163
173
  index("idx_delivery_queue_mind_status").on(table.mind, table.status),
164
- index("idx_delivery_queue_status").on(table.status)
174
+ index("idx_delivery_queue_status").on(table.status),
175
+ index("idx_delivery_queue_status_next").on(table.status, table.next_attempt_at)
165
176
  ]
166
177
  );
167
178
  var activity = sqliteTable(
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  publish
4
- } from "./chunk-K547QOCM.js";
4
+ } from "./chunk-7G2EEYXX.js";
5
5
  import {
6
6
  logger_default
7
7
  } from "./chunk-T2TP6ZC6.js";
@@ -8,10 +8,10 @@ import {
8
8
  pollHealthDown,
9
9
  readDaemonConfig,
10
10
  stopService
11
- } from "./chunk-P6DPB33N.js";
11
+ } from "./chunk-ATEX3ZPG.js";
12
12
  import {
13
13
  voluteSystemDir
14
- } from "./chunk-IUZ3EV2D.js";
14
+ } from "./chunk-YAMO2U3N.js";
15
15
 
16
16
  // src/commands/down.ts
17
17
  import { existsSync, readFileSync, unlinkSync } from "fs";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  voluteSystemDir
4
- } from "./chunk-IUZ3EV2D.js";
4
+ } from "./chunk-YAMO2U3N.js";
5
5
 
6
6
  // packages/daemon/src/lib/config/setup.ts
7
7
  import { chmodSync, existsSync, mkdirSync, readFileSync, statSync, writeFileSync } from "fs";