volute 0.37.1 → 0.39.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 (116) hide show
  1. package/dist/{activity-events-N6HCHU4P.js → activity-events-CR4RIHJT.js} +2 -2
  2. package/dist/{ai-service-C2YNARGH.js → ai-service-PL7GKFQC.js} +3 -3
  3. package/dist/{archive-AWIJTVQV.js → archive-UEWIFRAR.js} +2 -2
  4. package/dist/{auth-2QOOPMBX.js → auth-OJ2YW3NR.js} +3 -3
  5. package/dist/{chat-5Y4FD77E.js → chat-RQ5NV5EA.js} +2 -2
  6. package/dist/{chunk-LIIX2MOM.js → chunk-4BO4I7UF.js} +39 -24
  7. package/dist/{chunk-SNW2NPP4.js → chunk-6FSSMAXU.js} +1 -1
  8. package/dist/{chunk-TNZ5XQA4.js → chunk-6V2U3GFQ.js} +2 -2
  9. package/dist/{chunk-N42QMDID.js → chunk-7GZB3ZJP.js} +1 -1
  10. package/dist/{chunk-CF4SO5L3.js → chunk-7OS7QFDF.js} +12 -11
  11. package/dist/{chunk-UIM5NHPP.js → chunk-7W3UWCQD.js} +2 -2
  12. package/dist/{chunk-ORNY3MZR.js → chunk-B7MWXFAH.js} +1 -1
  13. package/dist/{chunk-RUIVWCYY.js → chunk-CHCISTH7.js} +46 -44
  14. package/dist/{chunk-GVVVMZ4J.js → chunk-DZ4LYU6J.js} +1 -1
  15. package/dist/{chunk-KXXJYY62.js → chunk-EVKGKQ2P.js} +55 -37
  16. package/dist/{chunk-BIEWHAAM.js → chunk-IA2SZSLB.js} +1 -1
  17. package/dist/{chunk-QJGLTPAP.js → chunk-IBOU6Q3Y.js} +4 -4
  18. package/dist/{chunk-3F7XK5Q7.js → chunk-OEXOFBW5.js} +1 -1
  19. package/dist/{chunk-7AZQFSOV.js → chunk-OS5MRIEP.js} +1 -1
  20. package/dist/{chunk-2NHRJ3YO.js → chunk-QDWP435B.js} +2 -2
  21. package/dist/{chunk-5DPRTREW.js → chunk-QDWPM73D.js} +2 -2
  22. package/dist/{chunk-MQRS4J24.js → chunk-QJ4GU5XT.js} +5 -5
  23. package/dist/{chunk-WC635OPK.js → chunk-RAVQXKAG.js} +1 -1
  24. package/dist/{chunk-A6FLW5XD.js → chunk-TCNCRDB5.js} +1 -1
  25. package/dist/{chunk-XLBQYIHH.js → chunk-TT4WT6Y7.js} +1 -1
  26. package/dist/{chunk-PMMHVSCR.js → chunk-WUH54G5S.js} +1 -1
  27. package/dist/{chunk-SZJWC2GA.js → chunk-X7GM2OPM.js} +2 -2
  28. package/dist/{chunk-LQ6Z4FXN.js → chunk-XOSAY7PY.js} +1 -1
  29. package/dist/{chunk-4L2Q7IP5.js → chunk-Y4W3OS7Q.js} +7 -7
  30. package/dist/chunk-Y5UC6G3O.js +109 -0
  31. package/dist/cli.js +16 -16
  32. package/dist/{cloud-sync-EZKCEIBX.js → cloud-sync-NQCWJLYI.js} +16 -16
  33. package/dist/{conversations-G6YRSABR.js → conversations-EUXHBWJD.js} +3 -3
  34. package/dist/{create-PN73742N.js → create-3QH7DVLC.js} +1 -1
  35. package/dist/{daemon-restart-S6SOD3C5.js → daemon-restart-UEB3PLKB.js} +11 -11
  36. package/dist/daemon.js +184 -114
  37. package/dist/{db-CBOCDYVA.js → db-32YFKMFL.js} +1 -1
  38. package/dist/delivery-manager-N34XKUGL.js +30 -0
  39. package/dist/{delivery-router-QTFEZ26O.js → delivery-router-EUW4RIWG.js} +2 -2
  40. package/dist/{down-25L2RKCQ.js → down-TCEBGTMY.js} +5 -5
  41. package/dist/echo-text-N3BC3WNX.js +31 -0
  42. package/dist/{exec-ONYZEA5B.js → exec-2MFHTGOS.js} +3 -3
  43. package/dist/{export-JPDBQESV.js → export-JDAK3THX.js} +2 -2
  44. package/dist/{extensions-PCOXTHNM.js → extensions-V7TXKAKM.js} +15 -15
  45. package/dist/{files-LAQ3NXQK.js → files-K5XV23H6.js} +2 -2
  46. package/dist/{import-EROF27RH.js → import-GZ5IYVV7.js} +5 -5
  47. package/dist/{isolation-G5J3MTKU.js → isolation-FPF4UTH2.js} +2 -2
  48. package/dist/{login-F6YMAVLE.js → login-BGF5JY3I.js} +1 -1
  49. package/dist/{logout-HHPH52KZ.js → logout-GQHI6KH6.js} +1 -1
  50. package/dist/{message-delivery-NWL7XEIX.js → message-delivery-X7MKA3TA.js} +15 -15
  51. package/dist/{mind-MM2IYMJ3.js → mind-QMJIWWWW.js} +5 -5
  52. package/dist/{mind-activity-tracker-42ENM32S.js → mind-activity-tracker-Z3KBQTVU.js} +3 -3
  53. package/dist/mind-manager-7GWTTKWD.js +30 -0
  54. package/dist/mind-service-MO2XJKJN.js +36 -0
  55. package/dist/{package-TA6IHIED.js → package-IR4ZEQA2.js} +27 -27
  56. package/dist/{registry-KMELPC3X.js → registry-LWEOAO53.js} +1 -1
  57. package/dist/{sandbox-PQYEICEF.js → sandbox-KUAVC37A.js} +5 -5
  58. package/dist/scheduler-CGUPAEBA.js +30 -0
  59. package/dist/{seed-6S4Z6TAM.js → seed-GPBERPXJ.js} +1 -1
  60. package/dist/{seed-cmd-CBWLJWYD.js → seed-cmd-PWF4FYFG.js} +2 -2
  61. package/dist/{seed-create-NT6DG4SE.js → seed-create-NTIICZVB.js} +3 -3
  62. package/dist/{seed-sprout-GQLSK4EF.js → seed-sprout-PRPFKGJF.js} +7 -7
  63. package/dist/{send-7CIP5GLS.js → send-IMHDYJHW.js} +2 -2
  64. package/dist/{service-YMHWPDXW.js → service-DWBRRFXS.js} +8 -8
  65. package/dist/service-install-KEBDNZVE.js +17 -0
  66. package/dist/setup-4CWQ53VV.js +454 -0
  67. package/dist/{setup-PF7JSFMO.js → setup-IFYS3TLS.js} +2 -2
  68. package/dist/{skills-ZFVNN4TU.js → skills-FJ5W73AV.js} +5 -5
  69. package/dist/sleep-manager-6QRMUNHK.js +34 -0
  70. package/dist/{spirit-4QOYM33G.js → spirit-U6MDQLYT.js} +7 -7
  71. package/dist/{sprout-UDLZPMEO.js → sprout-ABX2G76C.js} +1 -1
  72. package/dist/{src-LT6ZBYYX.js → src-6Z4XYDH5.js} +200 -169
  73. package/dist/{status-MC2P7DBG.js → status-C6BBWNU3.js} +9 -9
  74. package/dist/system-chat-D343HYGR.js +34 -0
  75. package/dist/{tailscale-LTYNKIPZ.js → tailscale-2KKXDMNK.js} +1 -1
  76. package/dist/{up-4T32B7OB.js → up-ZU6ILVMA.js} +6 -6
  77. package/dist/{update-UOP2INF2.js → update-V26PT4VN.js} +9 -9
  78. package/dist/{update-check-IKS7SGK5.js → update-check-XRERV36Y.js} +2 -2
  79. package/dist/{version-notify-NCRIN5QK.js → version-notify-ZBMY2TEX.js} +16 -16
  80. package/dist/web-assets/assets/index-B1zwqwt8.css +1 -0
  81. package/dist/web-assets/assets/index-D1guJF1i.js +73 -0
  82. package/dist/web-assets/index.html +2 -2
  83. package/package.json +27 -27
  84. package/packages/extensions/notes/dist/ui/assets/index-D3cdui42.css +1 -0
  85. package/packages/extensions/notes/dist/ui/assets/index-Dsua7alJ.js +61 -0
  86. package/packages/extensions/notes/dist/ui/index.html +2 -2
  87. package/packages/extensions/pages/dist/ui/assets/index-BM7gRdg7.js +2 -0
  88. package/packages/extensions/pages/dist/ui/assets/index-BcY6lnq4.css +1 -0
  89. package/packages/extensions/pages/dist/ui/index.html +2 -2
  90. package/packages/extensions/plan/dist/ui/assets/index-DWiqtzBv.js +61 -0
  91. package/packages/extensions/plan/dist/ui/assets/index-jIkrt-vI.css +1 -0
  92. package/packages/extensions/plan/dist/ui/index.html +2 -2
  93. package/templates/_base/src/lib/startup.ts +2 -0
  94. package/templates/_base/tsconfig.json +3 -1
  95. package/templates/claude/package.json.tmpl +5 -5
  96. package/templates/claude/src/agent.ts +1 -0
  97. package/templates/codex/package.json.tmpl +4 -4
  98. package/templates/codex/src/agent.ts +6 -0
  99. package/templates/pi/package.json.tmpl +5 -5
  100. package/templates/pi/src/agent.ts +2 -1
  101. package/dist/delivery-manager-3I7CA734.js +0 -30
  102. package/dist/echo-text-IWAQKNTC.js +0 -31
  103. package/dist/mind-manager-VOEQ2IZL.js +0 -30
  104. package/dist/mind-service-WRTOQSAL.js +0 -36
  105. package/dist/scheduler-355E746X.js +0 -30
  106. package/dist/setup-APNN7KJB.js +0 -425
  107. package/dist/sleep-manager-PBOIEBJZ.js +0 -34
  108. package/dist/system-chat-7AIN3U5M.js +0 -34
  109. package/dist/web-assets/assets/index-B3xLeex8.js +0 -75
  110. package/dist/web-assets/assets/index-Dr4A90Lo.css +0 -1
  111. package/packages/extensions/notes/dist/ui/assets/index-8jWEv9SA.js +0 -61
  112. package/packages/extensions/notes/dist/ui/assets/index-DkaB7Ytd.css +0 -1
  113. package/packages/extensions/pages/dist/ui/assets/index-D0HyS-xQ.css +0 -1
  114. package/packages/extensions/pages/dist/ui/assets/index-DKZLNMED.js +0 -2
  115. package/packages/extensions/plan/dist/ui/assets/index-CJj2gZnZ.css +0 -1
  116. package/packages/extensions/plan/dist/ui/assets/index-FMEJmvQz.js +0 -61
@@ -3,9 +3,9 @@ import {
3
3
  broadcast,
4
4
  publish,
5
5
  subscribe
6
- } from "./chunk-N42QMDID.js";
6
+ } from "./chunk-7GZB3ZJP.js";
7
7
  import "./chunk-T2TP6ZC6.js";
8
- import "./chunk-2NHRJ3YO.js";
8
+ import "./chunk-QDWP435B.js";
9
9
  import "./chunk-CJ26DXZL.js";
10
10
  import "./chunk-K3NQKI34.js";
11
11
  export {
@@ -17,10 +17,10 @@ import {
17
17
  setEnabledModels,
18
18
  setUtilityModel,
19
19
  unqualifyModelId
20
- } from "./chunk-ORNY3MZR.js";
21
- import "./chunk-A6FLW5XD.js";
20
+ } from "./chunk-B7MWXFAH.js";
21
+ import "./chunk-TCNCRDB5.js";
22
22
  import "./chunk-T2TP6ZC6.js";
23
- import "./chunk-2NHRJ3YO.js";
23
+ import "./chunk-QDWP435B.js";
24
24
  import "./chunk-CJ26DXZL.js";
25
25
  import "./chunk-K3NQKI34.js";
26
26
  export {
@@ -5,8 +5,8 @@ import {
5
5
  extractArchive,
6
6
  isHomeOnlyArchive,
7
7
  readManifest
8
- } from "./chunk-BIEWHAAM.js";
9
- import "./chunk-2NHRJ3YO.js";
8
+ } from "./chunk-IA2SZSLB.js";
9
+ import "./chunk-QDWP435B.js";
10
10
  import "./chunk-CJ26DXZL.js";
11
11
  import "./chunk-K3NQKI34.js";
12
12
  export {
@@ -17,10 +17,10 @@ import {
17
17
  syncMindProfile,
18
18
  updateUserProfile,
19
19
  verifyUser
20
- } from "./chunk-UIM5NHPP.js";
21
- import "./chunk-N42QMDID.js";
20
+ } from "./chunk-7W3UWCQD.js";
21
+ import "./chunk-7GZB3ZJP.js";
22
22
  import "./chunk-T2TP6ZC6.js";
23
- import "./chunk-2NHRJ3YO.js";
23
+ import "./chunk-QDWP435B.js";
24
24
  import "./chunk-CJ26DXZL.js";
25
25
  import "./chunk-K3NQKI34.js";
26
26
  export {
@@ -12,7 +12,7 @@ var cmd = subcommands({
12
12
  commands: {
13
13
  send: {
14
14
  description: "Send a message",
15
- run: (args) => import("./send-7CIP5GLS.js").then((m) => m.run(args))
15
+ run: (args) => import("./send-IMHDYJHW.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-LAQ3NXQK.js").then((m) => m.run(args))
35
+ run: (args) => import("./files-K5XV23H6.js").then((m) => m.run(args))
36
36
  },
37
37
  accept: {
38
38
  description: "Accept a pending file",
@@ -2,22 +2,15 @@
2
2
  import {
3
3
  findBridgeForChannel,
4
4
  getBridgeConfig
5
- } from "./chunk-LQ6Z4FXN.js";
5
+ } from "./chunk-XOSAY7PY.js";
6
6
  import {
7
7
  publish,
8
8
  recordOutbound
9
- } from "./chunk-RUIVWCYY.js";
9
+ } from "./chunk-CHCISTH7.js";
10
10
  import {
11
11
  readEnv,
12
12
  sharedEnvPath
13
- } from "./chunk-PMMHVSCR.js";
14
- import {
15
- readVoluteConfig
16
- } from "./chunk-CU6OFXMM.js";
17
- import {
18
- getOrCreateMindUser,
19
- getUserByUsername
20
- } from "./chunk-UIM5NHPP.js";
13
+ } from "./chunk-WUH54G5S.js";
21
14
  import {
22
15
  addMessage,
23
16
  findDMConversation,
@@ -25,7 +18,14 @@ import {
25
18
  getChannelName,
26
19
  getConversation,
27
20
  getParticipants
28
- } from "./chunk-5DPRTREW.js";
21
+ } from "./chunk-QDWPM73D.js";
22
+ import {
23
+ readVoluteConfig
24
+ } from "./chunk-CU6OFXMM.js";
25
+ import {
26
+ getOrCreateMindUser,
27
+ getUserByUsername
28
+ } from "./chunk-7W3UWCQD.js";
29
29
  import {
30
30
  logger_default
31
31
  } from "./chunk-T2TP6ZC6.js";
@@ -35,7 +35,7 @@ import {
35
35
  import {
36
36
  mindDir,
37
37
  voluteSystemDir
38
- } from "./chunk-2NHRJ3YO.js";
38
+ } from "./chunk-QDWP435B.js";
39
39
  import {
40
40
  __export
41
41
  } from "./chunk-K3NQKI34.js";
@@ -766,29 +766,41 @@ async function routeDMOutbound(conversationId, senderName, contentBlocks) {
766
766
  }
767
767
  }
768
768
 
769
+ // packages/daemon/src/lib/util/fix-model-escapes.ts
770
+ function fixModelEscapes(text, unescapeNewlines) {
771
+ let result = text.replaceAll("\\!", "!");
772
+ if (unescapeNewlines) {
773
+ result = result.replaceAll("\\n", "\n").replaceAll("\\t", " ");
774
+ }
775
+ return result;
776
+ }
777
+
769
778
  // packages/daemon/src/lib/delivery/echo-text.ts
770
779
  var dlog = logger_default.child("echo-text");
771
- var echoTextCache = /* @__PURE__ */ new Map();
780
+ var echoConfigCache = /* @__PURE__ */ new Map();
772
781
  var channelConvCache = /* @__PURE__ */ new Map();
782
+ function getEchoConfig(mind) {
783
+ const cached = echoConfigCache.get(mind);
784
+ if (cached) return cached;
785
+ const config = readVoluteConfig(mindDir(mind));
786
+ const result = {
787
+ echoText: config?.echoText === true,
788
+ unescapeNewlines: config?.unescapeNewlines === true
789
+ };
790
+ echoConfigCache.set(mind, result);
791
+ return result;
792
+ }
773
793
  function clearEchoTextCache(mind) {
774
794
  if (mind) {
775
- echoTextCache.delete(mind);
795
+ echoConfigCache.delete(mind);
776
796
  for (const key of channelConvCache.keys()) {
777
797
  if (key.startsWith(`${mind}:`)) channelConvCache.delete(key);
778
798
  }
779
799
  } else {
780
- echoTextCache.clear();
800
+ echoConfigCache.clear();
781
801
  channelConvCache.clear();
782
802
  }
783
803
  }
784
- function isEchoEnabled(mind) {
785
- const cached = echoTextCache.get(mind);
786
- if (cached !== void 0) return cached;
787
- const config = readVoluteConfig(mindDir(mind));
788
- const enabled = config?.echoText === true;
789
- echoTextCache.set(mind, enabled);
790
- return enabled;
791
- }
792
804
  async function resolveConversationId(mind, channel) {
793
805
  const cacheKey = `${mind}:${channel}`;
794
806
  const cached = channelConvCache.get(cacheKey);
@@ -813,13 +825,15 @@ async function resolveConversationId(mind, channel) {
813
825
  return conversationId;
814
826
  }
815
827
  async function echoTextToChannel(mind, channel, text, turnId, textEventId) {
816
- if (!isEchoEnabled(mind)) return void 0;
828
+ const cfg = getEchoConfig(mind);
829
+ if (!cfg.echoText) return void 0;
817
830
  if (!text.trim()) return void 0;
818
831
  const conversationId = await resolveConversationId(mind, channel);
819
832
  if (!conversationId) {
820
833
  dlog.debug(`echo-text: could not resolve channel "${channel}" to conversation`);
821
834
  return void 0;
822
835
  }
836
+ text = fixModelEscapes(text, cfg.unescapeNewlines);
823
837
  const contentBlocks = [{ type: "text", text }];
824
838
  const message = await addMessage(conversationId, "user", mind, contentBlocks, {
825
839
  turnId,
@@ -848,6 +862,7 @@ export {
848
862
  PLATFORMS,
849
863
  getPlatformDriver,
850
864
  routeOutboundBridge,
865
+ fixModelEscapes,
851
866
  clearEchoTextCache,
852
867
  echoTextToChannel
853
868
  };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getBaseName,
4
4
  validateMindName
5
- } from "./chunk-2NHRJ3YO.js";
5
+ } from "./chunk-QDWP435B.js";
6
6
 
7
7
  // packages/daemon/src/lib/mind/isolation.ts
8
8
  import { execFileSync } from "child_process";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  exec,
4
4
  execInherit
5
- } from "./chunk-3F7XK5Q7.js";
5
+ } from "./chunk-OEXOFBW5.js";
6
6
  import {
7
7
  voluteSystemDir
8
- } from "./chunk-2NHRJ3YO.js";
8
+ } from "./chunk-QDWP435B.js";
9
9
 
10
10
  // packages/daemon/src/lib/config/service-mode.ts
11
11
  import { execFileSync } from "child_process";
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-T2TP6ZC6.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-2NHRJ3YO.js";
7
+ } from "./chunk-QDWP435B.js";
8
8
  import {
9
9
  activity
10
10
  } from "./chunk-CJ26DXZL.js";
@@ -1,20 +1,20 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ command
4
+ } from "./chunk-TXSA4Q3V.js";
2
5
  import {
3
6
  getServiceMode,
4
7
  modeLabel,
5
8
  pollHealth,
6
9
  startService
7
- } from "./chunk-TNZ5XQA4.js";
8
- import {
9
- command
10
- } from "./chunk-TXSA4Q3V.js";
10
+ } from "./chunk-6V2U3GFQ.js";
11
11
  import {
12
12
  readGlobalConfig
13
- } from "./chunk-A6FLW5XD.js";
13
+ } from "./chunk-TCNCRDB5.js";
14
14
  import {
15
15
  voluteHome,
16
16
  voluteSystemDir
17
- } from "./chunk-2NHRJ3YO.js";
17
+ } from "./chunk-QDWP435B.js";
18
18
 
19
19
  // src/commands/up.ts
20
20
  import { spawn } from "child_process";
@@ -70,8 +70,9 @@ var cmd = command({
70
70
  }
71
71
  }
72
72
  const pollHost = hostname === "0.0.0.0" || hostname === "::" ? "localhost" : hostname;
73
+ const useTailscale = flags.tailscale || config.tailscale;
73
74
  let tailscaleHostname;
74
- if (flags.tailscale) {
75
+ if (useTailscale) {
75
76
  try {
76
77
  const { execFile } = await import("child_process");
77
78
  const { promisify } = await import("util");
@@ -102,7 +103,7 @@ var cmd = command({
102
103
  }
103
104
  if (flags.foreground) {
104
105
  const { startDaemon } = await import("./daemon.js");
105
- await startDaemon({ port, hostname, foreground: true, tailscale: flags.tailscale });
106
+ await startDaemon({ port, hostname, foreground: true, tailscale: useTailscale });
106
107
  return;
107
108
  }
108
109
  const daemonModule = resolve(dirname(new URL(import.meta.url).pathname), "daemon.js");
@@ -115,14 +116,14 @@ var cmd = command({
115
116
  const logFile = resolve(systemDir, "daemon.log");
116
117
  const logFd = openSync(logFile, "a");
117
118
  const daemonArgs = [daemonModule, "--port", String(port), "--host", hostname];
118
- if (flags.tailscale) daemonArgs.push("--tailscale");
119
+ if (useTailscale) daemonArgs.push("--tailscale");
119
120
  if (flags["no-sandbox"]) daemonArgs.push("--no-sandbox");
120
121
  const child = spawn(process.execPath, daemonArgs, {
121
122
  stdio: ["ignore", "ignore", logFd],
122
123
  detached: true
123
124
  });
124
125
  child.unref();
125
- const pollPort = flags.tailscale ? port + 1 : port;
126
+ const pollPort = useTailscale ? port + 1 : port;
126
127
  const url = `http://localhost:${pollPort}/api/health`;
127
128
  const maxWait = 3e4;
128
129
  const start = Date.now();
@@ -131,7 +132,7 @@ var cmd = command({
131
132
  const res = await fetch(url);
132
133
  if (res.ok) {
133
134
  const displayHost = tailscaleHostname ?? hostname;
134
- const displayProto = flags.tailscale ? "https" : "http";
135
+ const displayProto = useTailscale ? "https" : "http";
135
136
  console.log(
136
137
  `Volute daemon running on ${displayProto}://${displayHost}:${port} (pid ${child.pid})`
137
138
  );
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  broadcast
4
- } from "./chunk-N42QMDID.js";
4
+ } from "./chunk-7GZB3ZJP.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-2NHRJ3YO.js";
7
+ } from "./chunk-QDWP435B.js";
8
8
  import {
9
9
  users
10
10
  } from "./chunk-CJ26DXZL.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  readGlobalConfig,
4
4
  writeGlobalConfig
5
- } from "./chunk-A6FLW5XD.js";
5
+ } from "./chunk-TCNCRDB5.js";
6
6
  import {
7
7
  logger_default
8
8
  } from "./chunk-T2TP6ZC6.js";
@@ -1,16 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  loadMergedEnv
4
- } from "./chunk-PMMHVSCR.js";
4
+ } from "./chunk-WUH54G5S.js";
5
5
  import {
6
6
  spiritDir
7
- } from "./chunk-4L2Q7IP5.js";
7
+ } from "./chunk-Y4W3OS7Q.js";
8
8
  import {
9
9
  hashSkillDir,
10
10
  importSkillFromDir,
11
11
  removeSharedSkill,
12
12
  sharedSkillsDir
13
- } from "./chunk-QJGLTPAP.js";
13
+ } from "./chunk-IBOU6Q3Y.js";
14
+ import {
15
+ addMessage,
16
+ createChannel,
17
+ createConversation,
18
+ findDMConversation,
19
+ getChannelByName,
20
+ getParticipants,
21
+ joinChannel,
22
+ publish as publish2
23
+ } from "./chunk-QDWPM73D.js";
14
24
  import {
15
25
  readVoluteConfig,
16
26
  writeVoluteConfig
@@ -18,55 +28,46 @@ import {
18
28
  import {
19
29
  isSandboxEnabled,
20
30
  wrapForSandbox
21
- } from "./chunk-KXXJYY62.js";
31
+ } from "./chunk-EVKGKQ2P.js";
32
+ import {
33
+ markIdle,
34
+ onMindEvent
35
+ } from "./chunk-DZ4LYU6J.js";
22
36
  import {
23
37
  extractTextContent,
24
38
  getRoutingConfig,
25
39
  resolveDeliveryMode,
26
40
  resolveRoute
27
- } from "./chunk-7AZQFSOV.js";
28
- import {
29
- markIdle
30
- } from "./chunk-GVVVMZ4J.js";
41
+ } from "./chunk-OS5MRIEP.js";
31
42
  import {
32
43
  exec
33
- } from "./chunk-3F7XK5Q7.js";
44
+ } from "./chunk-OEXOFBW5.js";
34
45
  import {
35
46
  chownMindDir,
36
47
  isIsolationEnabled,
37
48
  mindUserName,
38
49
  wrapForIsolation
39
- } from "./chunk-SNW2NPP4.js";
50
+ } from "./chunk-6FSSMAXU.js";
40
51
  import {
41
52
  getOrCreateMindUser,
42
53
  getOrCreateSystemUser,
43
54
  getUser,
44
55
  getUserByUsername,
45
56
  syncMindProfile
46
- } from "./chunk-UIM5NHPP.js";
57
+ } from "./chunk-7W3UWCQD.js";
58
+ import {
59
+ publish,
60
+ subscribe
61
+ } from "./chunk-7GZB3ZJP.js";
47
62
  import {
48
63
  aiCompleteUtility,
49
64
  getAiConfig,
50
65
  resolveApiKey
51
- } from "./chunk-ORNY3MZR.js";
66
+ } from "./chunk-B7MWXFAH.js";
52
67
  import {
53
68
  readGlobalConfig,
54
69
  writeGlobalConfig
55
- } from "./chunk-A6FLW5XD.js";
56
- import {
57
- addMessage,
58
- createChannel,
59
- createConversation,
60
- findDMConversation,
61
- getChannelByName,
62
- getParticipants,
63
- joinChannel,
64
- publish as publish2
65
- } from "./chunk-5DPRTREW.js";
66
- import {
67
- publish,
68
- subscribe
69
- } from "./chunk-N42QMDID.js";
70
+ } from "./chunk-TCNCRDB5.js";
70
71
  import {
71
72
  logger_default
72
73
  } from "./chunk-T2TP6ZC6.js";
@@ -79,7 +80,7 @@ import {
79
80
  stateDir,
80
81
  voluteHome,
81
82
  voluteSystemDir
82
- } from "./chunk-2NHRJ3YO.js";
83
+ } from "./chunk-QDWP435B.js";
83
84
  import {
84
85
  activity,
85
86
  conversationParticipants,
@@ -1639,7 +1640,7 @@ var MindManager = class {
1639
1640
  let spawnArgs;
1640
1641
  if (isIsolationEnabled()) {
1641
1642
  [spawnCmd, spawnArgs] = await wrapForIsolation(baseBin, baseArgs, name);
1642
- } else if (isSandboxEnabled()) {
1643
+ } else if (isSandboxEnabled() && target.template !== "codex") {
1643
1644
  [spawnCmd, spawnArgs] = await wrapForSandbox(baseBin, baseArgs, dir, name, [
1644
1645
  dir,
1645
1646
  mindStateDir,
@@ -1769,7 +1770,7 @@ var MindManager = class {
1769
1770
  if (this.shuttingDown || this.stopping.has(name)) return;
1770
1771
  mlog.error(`mind ${name} exited with code ${code}`);
1771
1772
  try {
1772
- const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-PBOIEBJZ.js");
1773
+ const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-6QRMUNHK.js");
1773
1774
  const sleepState = getSleepManagerIfReady2()?.getState(name);
1774
1775
  if (sleepState?.sleeping) {
1775
1776
  mlog.info(`${name} is sleeping \u2014 skipping crash recovery`);
@@ -1782,15 +1783,15 @@ var MindManager = class {
1782
1783
  (err) => mlog.warn(`failed to clear turn state for ${name} after crash`, logger_default.errorData(err))
1783
1784
  );
1784
1785
  try {
1785
- const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-3I7CA734.js");
1786
+ const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-N34XKUGL.js");
1786
1787
  getDeliveryManager2().clearMindSessions(name);
1787
1788
  } catch (err) {
1788
1789
  if (!(err instanceof Error && err.message.includes("not initialized"))) {
1789
1790
  mlog.warn(`failed to clear delivery state for ${name} after crash`, logger_default.errorData(err));
1790
1791
  }
1791
1792
  }
1792
- import("./mind-activity-tracker-42ENM32S.js").then(({ markIdle: markIdle2 }) => markIdle2(name)).catch((err) => mlog.warn(`failed to mark ${name} idle after crash`, logger_default.errorData(err)));
1793
- import("./activity-events-N6HCHU4P.js").then(
1793
+ import("./mind-activity-tracker-Z3KBQTVU.js").then(({ markIdle: markIdle2 }) => markIdle2(name)).catch((err) => mlog.warn(`failed to mark ${name} idle after crash`, logger_default.errorData(err)));
1794
+ import("./activity-events-CR4RIHJT.js").then(
1794
1795
  ({ publish: publish4 }) => publish4({ type: "mind_stopped", mind: name, summary: `${name} crashed (exit ${code})` })
1795
1796
  ).catch((err) => mlog.warn(`failed to publish crash event for ${name}`, logger_default.errorData(err)));
1796
1797
  const { shouldRestart, delay, attempt } = this.restartTracker.recordCrash(name);
@@ -1841,7 +1842,7 @@ var MindManager = class {
1841
1842
  mlog.warn(`failed to clear turn state for ${name} on stop`, logger_default.errorData(err));
1842
1843
  }
1843
1844
  try {
1844
- const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-3I7CA734.js");
1845
+ const { getDeliveryManager: getDeliveryManager2 } = await import("./delivery-manager-N34XKUGL.js");
1845
1846
  getDeliveryManager2().clearMindSessions(name);
1846
1847
  } catch (err) {
1847
1848
  if (!(err instanceof Error && err.message.includes("not initialized"))) {
@@ -1849,7 +1850,7 @@ var MindManager = class {
1849
1850
  }
1850
1851
  }
1851
1852
  try {
1852
- const { clearEchoTextCache } = await import("./echo-text-IWAQKNTC.js");
1853
+ const { clearEchoTextCache } = await import("./echo-text-N3BC3WNX.js");
1853
1854
  clearEchoTextCache(name);
1854
1855
  } catch (err) {
1855
1856
  mlog.debug(`failed to clear echo-text cache for ${name}`, logger_default.errorData(err));
@@ -2333,7 +2334,7 @@ function resolveSkillsDir(manifest) {
2333
2334
  async function discoverBuiltinExtensions(disabledIds) {
2334
2335
  const builtins = [
2335
2336
  { id: "notes", load: async () => (await import("./src-OYWRPLC6.js")).default },
2336
- { id: "pages", load: async () => (await import("./src-LT6ZBYYX.js")).default },
2337
+ { id: "pages", load: async () => (await import("./src-6Z4XYDH5.js")).default },
2337
2338
  { id: "plan", load: async () => (await import("./src-O4PRLMKM.js")).default }
2338
2339
  ];
2339
2340
  const results = [];
@@ -2574,7 +2575,7 @@ async function installNpmExtension(pkg) {
2574
2575
  throw new Error(`Extension "${pkg}" is already installed`);
2575
2576
  }
2576
2577
  const dir = ensureExtensionsNpmDir();
2577
- const { exec: exec2 } = await import("./exec-ONYZEA5B.js");
2578
+ const { exec: exec2 } = await import("./exec-2MFHTGOS.js");
2578
2579
  try {
2579
2580
  await exec2("npm", ["install", pkg], { cwd: dir });
2580
2581
  } catch (err) {
@@ -2595,7 +2596,7 @@ async function uninstallNpmExtension(pkg) {
2595
2596
  packages.splice(idx, 1);
2596
2597
  writeExtensionsConfig(packages);
2597
2598
  try {
2598
- const { exec: exec2 } = await import("./exec-ONYZEA5B.js");
2599
+ const { exec: exec2 } = await import("./exec-2MFHTGOS.js");
2599
2600
  await exec2("npm", ["uninstall", pkg], { cwd: extensionsNpmDir() });
2600
2601
  } catch (err) {
2601
2602
  logger_default.warn(
@@ -3370,7 +3371,7 @@ async function wakeMind(name) {
3370
3371
  async function startSpiritFull(name) {
3371
3372
  const entry = await findMind(name);
3372
3373
  if (entry?.dir) {
3373
- const { registerMindDir } = await import("./delivery-router-QTFEZ26O.js");
3374
+ const { registerMindDir } = await import("./delivery-router-EUW4RIWG.js");
3374
3375
  registerMindDir(name, entry.dir);
3375
3376
  }
3376
3377
  await getMindManager().startMind(name);
@@ -3392,8 +3393,8 @@ async function stopSpiritFull(name) {
3392
3393
  }).catch((err) => logger_default.error("failed to publish spirit_stopped activity", logger_default.errorData(err)));
3393
3394
  }
3394
3395
  async function ensureCreatorDM(mindName, creatorUsername) {
3395
- const { getOrCreateMindUser: getOrCreateMindUser2, getUserByUsername: getUserByUsername2 } = await import("./auth-2QOOPMBX.js");
3396
- const { findDMConversation: findDMConversation2, createConversation: createConversation2 } = await import("./conversations-G6YRSABR.js");
3396
+ const { getOrCreateMindUser: getOrCreateMindUser2, getUserByUsername: getUserByUsername2 } = await import("./auth-OJ2YW3NR.js");
3397
+ const { findDMConversation: findDMConversation2, createConversation: createConversation2 } = await import("./conversations-EUXHBWJD.js");
3397
3398
  const mindUser = await getOrCreateMindUser2(mindName);
3398
3399
  const creatorUser = await getUserByUsername2(creatorUsername);
3399
3400
  if (!creatorUser) {
@@ -3737,7 +3738,7 @@ var SleepManager = class {
3737
3738
  const db = await getDb();
3738
3739
  const rows = await db.select().from(deliveryQueue).where(and2(eq4(deliveryQueue.mind, name), eq4(deliveryQueue.status, "sleep-queued"))).all();
3739
3740
  if (rows.length === 0) return 0;
3740
- const { deliverMessage: deliverMessage2 } = await import("./message-delivery-NWL7XEIX.js");
3741
+ const { deliverMessage: deliverMessage2 } = await import("./message-delivery-X7MKA3TA.js");
3741
3742
  const delivered = [];
3742
3743
  for (const row of rows) {
3743
3744
  try {
@@ -4410,6 +4411,7 @@ var DeliveryManager = class {
4410
4411
  if (payload.conversationId) {
4411
4412
  typingMap.set(payload.conversationId, baseName, { persistent: true });
4412
4413
  }
4414
+ onMindEvent(baseName, "delivery", payload.channel);
4413
4415
  const enrichedPayload = await this.enrichWithProfiles(baseName, session, payload);
4414
4416
  const body = JSON.stringify({
4415
4417
  ...enrichedPayload,
@@ -4647,7 +4649,7 @@ var DeliveryManager = class {
4647
4649
  `To accept this channel, add a routing rule for "${channel}" to your routes.json.`,
4648
4650
  `Messages are being held until a route is configured.`
4649
4651
  ].filter((line) => line !== null).join("\n");
4650
- const { sendSystemMessage: sendSystemMessage2 } = await import("./system-chat-7AIN3U5M.js");
4652
+ const { sendSystemMessage: sendSystemMessage2 } = await import("./system-chat-D343HYGR.js");
4651
4653
  await sendSystemMessage2(mindName, notification);
4652
4654
  }
4653
4655
  async persistToQueue(mindName, session, payload, status = "pending") {
@@ -5170,7 +5172,7 @@ async function generateSystemReply(conversationId, mindName, message) {
5170
5172
  if (config.sleep.schedule?.wake) contextParts.push(`Wake cron: ${config.sleep.schedule.wake}`);
5171
5173
  }
5172
5174
  try {
5173
- const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-PBOIEBJZ.js");
5175
+ const { getSleepManagerIfReady: getSleepManagerIfReady2 } = await import("./sleep-manager-6QRMUNHK.js");
5174
5176
  const sm = getSleepManagerIfReady2();
5175
5177
  if (sm) {
5176
5178
  const state = sm.getState(mindName);
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  publish
4
- } from "./chunk-N42QMDID.js";
4
+ } from "./chunk-7GZB3ZJP.js";
5
5
  import {
6
6
  logger_default
7
7
  } from "./chunk-T2TP6ZC6.js";