volute 0.45.2 → 0.47.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 (146) hide show
  1. package/README.md +4 -4
  2. package/dist/{activity-events-BUR2RYTJ.js → activity-events-MIOK3IOU.js} +3 -3
  3. package/dist/{ai-service-UODCCE4O.js → ai-service-CVZEYKTK.js} +4 -4
  4. package/dist/{archive-WS2L2VIQ.js → archive-6Z4GFQPH.js} +3 -3
  5. package/dist/{auth-FLAEXXZK.js → auth-A4VGHADI.js} +4 -4
  6. package/dist/avatar-image-7S3WA77A.js +22 -0
  7. package/dist/{backup-TST5C2YN.js → backup-IIAFOW2L.js} +13 -13
  8. package/dist/channels-ITE4YC57.js +89 -0
  9. package/dist/{chat-76MRWWQX.js → chat-AJLJCQ3M.js} +12 -8
  10. package/dist/{chunk-ZV7MFISX.js → chunk-2MJ7EOMT.js} +20 -2
  11. package/dist/{chunk-R77O2WMK.js → chunk-2OIYNHWO.js} +1 -1
  12. package/dist/{chunk-QCN24XEN.js → chunk-3YUBFTDN.js} +1 -1
  13. package/dist/{chunk-NYC5U6K7.js → chunk-4I72V3E5.js} +10 -10
  14. package/dist/{chunk-QNQMSWZE.js → chunk-5IERLDUS.js} +3 -3
  15. package/dist/{chunk-FXORA5JG.js → chunk-5NN2VHJV.js} +3 -3
  16. package/dist/chunk-7KRIHYLR.js +124 -0
  17. package/dist/{chunk-RRNXJOKB.js → chunk-BGYHLR54.js} +2 -2
  18. package/dist/{chunk-QMJCNZ6C.js → chunk-C3KLHJDB.js} +1 -1
  19. package/dist/{chunk-TQJ6ZYVY.js → chunk-CBOIHNMR.js} +2 -2
  20. package/dist/{chunk-H2X54EHC.js → chunk-DGGZVZTM.js} +1 -1
  21. package/dist/{chunk-4JOQZPCE.js → chunk-EIQDZC43.js} +1 -1
  22. package/dist/{chunk-YT7PEESJ.js → chunk-F55GRIEK.js} +464 -221
  23. package/dist/{chunk-OP4JG2BS.js → chunk-HPGN6XRT.js} +8 -4
  24. package/dist/{chunk-7ZUB63PS.js → chunk-IWJSNMSY.js} +5 -5
  25. package/dist/{chunk-ZDZISKCL.js → chunk-IYG4FBMP.js} +1 -1
  26. package/dist/chunk-JCMGDCGX.js +237 -0
  27. package/dist/{clock-K43IMROX.js → chunk-JSVHH32K.js} +26 -21
  28. package/dist/{chunk-UYLGEDVD.js → chunk-K23P5Q5N.js} +340 -339
  29. package/dist/{chunk-7C44R625.js → chunk-LTLFOSA4.js} +49 -3
  30. package/dist/{chunk-IHKGWTGT.js → chunk-LWDTP6DH.js} +1 -1
  31. package/dist/{chunk-JZ62SYWR.js → chunk-M3XDVS5Q.js} +1 -1
  32. package/dist/{chunk-FR6S2KNN.js → chunk-M6TTZRGH.js} +9 -9
  33. package/dist/{chunk-EJVPTVTI.js → chunk-MTRMQFCQ.js} +1 -1
  34. package/dist/{chunk-T6HYVHPG.js → chunk-ODDGGLM6.js} +3 -3
  35. package/dist/{chunk-QLWG3C2Z.js → chunk-RRZ4RQQU.js} +2 -2
  36. package/dist/{chunk-CDPBTTZO.js → chunk-RUFLGTOT.js} +2 -2
  37. package/dist/{chunk-F7H6ATM4.js → chunk-SKNXMUIU.js} +1 -1
  38. package/dist/{chunk-RXEEYDIB.js → chunk-SZJCJVXV.js} +1 -1
  39. package/dist/{chunk-DRJ24GXK.js → chunk-VMCZBXF2.js} +52 -8
  40. package/dist/{chunk-ALKYQULU.js → chunk-WW6C3PLV.js} +1 -1
  41. package/dist/{chunk-A7WQZKOU.js → chunk-XHN6XBWV.js} +2 -2
  42. package/dist/{chunk-6EMWJZBK.js → chunk-YKA7DCVW.js} +1 -1
  43. package/dist/cli.js +24 -24
  44. package/dist/clock-E6N5Y3YW.js +16 -0
  45. package/dist/{cloud-sync-3OJOPZRT.js → cloud-sync-LQTVDTQ3.js} +19 -17
  46. package/dist/{conversations-JZTD6KLR.js → conversations-C7IKYSHD.js} +4 -4
  47. package/dist/{create-IOV4GCRX.js → create-PQQXKTJK.js} +1 -1
  48. package/dist/{daemon-restart-TIHKVVVA.js → daemon-restart-5F3YTLZK.js} +7 -7
  49. package/dist/daemon.js +418 -273
  50. package/dist/{db-MF2JNRUW.js → db-FO6LXYCW.js} +2 -2
  51. package/dist/{delete-BFMIGAIB.js → delete-HPLC7ETU.js} +1 -1
  52. package/dist/delivery-manager-TN5KK2AP.js +34 -0
  53. package/dist/{delivery-router-N4A7ZC5T.js → delivery-router-3QFG2ZEX.js} +3 -3
  54. package/dist/{down-U2CZ23M4.js → down-ZI4S6265.js} +5 -5
  55. package/dist/echo-text-SEQCLGAT.js +34 -0
  56. package/dist/{exec-G3ZRST4Z.js → exec-QIFYZG4C.js} +3 -3
  57. package/dist/{export-GGIVO76O.js → export-4GVGNW54.js} +6 -6
  58. package/dist/{extensions-JONTW2HF.js → extensions-PIMIQ7J3.js} +21 -17
  59. package/dist/{files-4LN3EN7Q.js → files-FEFZKMNM.js} +6 -6
  60. package/dist/{import-42YNQBF4.js → import-7MO3YTRE.js} +6 -6
  61. package/dist/{isolation-YMGZZ4E5.js → isolation-MCT4ZYLT.js} +3 -3
  62. package/dist/{login-M6OJUPQ2.js → login-OF4WXDAN.js} +5 -5
  63. package/dist/{logout-WQBWO77G.js → logout-ERE2BGA3.js} +5 -5
  64. package/dist/message-delivery-ZE3YGJDD.js +38 -0
  65. package/dist/{mind-DWB6XYCH.js → mind-POOHFZHP.js} +18 -18
  66. package/dist/{mind-activity-tracker-POBLU3LC.js → mind-activity-tracker-YVZPC4A5.js} +4 -4
  67. package/dist/{mind-list-4D7J4CHD.js → mind-list-KEGRGQEQ.js} +5 -4
  68. package/dist/mind-service-JFY7UG5E.js +40 -0
  69. package/dist/mind-sleep-IN3WPA76.js +83 -0
  70. package/dist/{mind-status-UO34ASXZ.js → mind-status-SMUWJKGV.js} +20 -3
  71. package/dist/{package-A7KXT67Q.js → package-WPEE2HVJ.js} +3 -2
  72. package/dist/{registry-OUZBZ3Q4.js → registry-UMMDRPRM.js} +2 -2
  73. package/dist/{sandbox-ZJ7QA6Z6.js → sandbox-G4X4K3UN.js} +4 -4
  74. package/dist/scheduler-HQSDYJFY.js +32 -0
  75. package/dist/{schema-PVNG3PQM.js → schema-VEVO7HG6.js} +3 -1
  76. package/dist/{seed-HCP5NYKH.js → seed-VANPU43L.js} +1 -1
  77. package/dist/{seed-cmd-ILOGNIFB.js → seed-cmd-SYVDZKM4.js} +2 -2
  78. package/dist/{seed-create-OURS2LS4.js → seed-create-3FGZPS6C.js} +5 -5
  79. package/dist/{seed-sprout-ELDFDAN6.js → seed-sprout-H7QLFPFM.js} +13 -11
  80. package/dist/{send-AAIOPJAV.js → send-HYDFGC6G.js} +13 -7
  81. package/dist/{service-UOCLXDWR.js → service-SYJ5G6LP.js} +4 -4
  82. package/dist/{service-install-4HHFDDWY.js → service-install-FQ43Z4DF.js} +5 -5
  83. package/dist/{setup-Y2EJI3GG.js → setup-KFYVWTXG.js} +3 -3
  84. package/dist/{setup-DQM5VPY4.js → setup-QJHGMGSN.js} +7 -7
  85. package/dist/skills/orientation/SKILL.md +1 -1
  86. package/dist/skills/volute-mind/SKILL.md +8 -8
  87. package/dist/skills/volute-mind/references/sleep.md +8 -1
  88. package/dist/{skills-BKINFL7W.js → skills-L2CMTW7A.js} +5 -5
  89. package/dist/sleep-manager-3NA7ZJP3.js +36 -0
  90. package/dist/{spirit-DBTIW7P4.js → spirit-WXN4IDBF.js} +8 -8
  91. package/dist/{sprout-W3KC7UGK.js → sprout-LTL5P36T.js} +1 -1
  92. package/dist/{status-SWRVGXBI.js → status-V4RJMHJ4.js} +19 -9
  93. package/dist/system-chat-N2F7HVY3.js +38 -0
  94. package/dist/{systems-VNB5WKSS.js → systems-B5YJKMW4.js} +6 -6
  95. package/dist/{tailscale-3XOKOW7T.js → tailscale-MCLY5GYE.js} +2 -2
  96. package/dist/{template-hash-446HHH5V.js → template-hash-GSOUARW4.js} +2 -2
  97. package/dist/template-staleness-EMQORSGG.js +15 -0
  98. package/dist/{turn-tracker-2W6Q2NSR.js → turn-tracker-JZRZDFWV.js} +6 -5
  99. package/dist/{up-FTK7CTO3.js → up-J2PBPOZL.js} +6 -6
  100. package/dist/{update-SWAYZRWJ.js → update-ACV4SAY3.js} +5 -5
  101. package/dist/{update-check-PQ2MZ47K.js → update-check-266R4ZSY.js} +3 -3
  102. package/dist/{version-notify-3XMAIQTE.js → version-notify-XRGTEEDK.js} +42 -23
  103. package/dist/web-assets/assets/index-DtctoDXY.css +1 -0
  104. package/dist/web-assets/assets/index-Wpyb2CML.js +86 -0
  105. package/dist/web-assets/index.html +2 -2
  106. package/drizzle/0011_drop_turn_summary_event_id.sql +3 -0
  107. package/drizzle/0012_channel_gates.sql +17 -0
  108. package/drizzle/meta/_journal.json +14 -0
  109. package/package.json +3 -2
  110. package/templates/_base/home/VOLUTE.md +6 -2
  111. package/templates/_base/src/lib/context-breakdown.ts +57 -67
  112. package/templates/_base/src/lib/startup.ts +43 -2
  113. package/templates/_base/src/lib/volute-server.ts +2 -2
  114. package/templates/claude/src/agent.ts +105 -43
  115. package/templates/claude/src/lib/session-reaper.ts +63 -0
  116. package/templates/claude/src/server.ts +10 -1
  117. package/templates/codex/src/agent.ts +62 -40
  118. package/templates/pi/src/agent.ts +55 -38
  119. package/dist/avatar-image-6KY6UU4D.js +0 -16
  120. package/dist/delivery-manager-VDVKVA46.js +0 -32
  121. package/dist/echo-text-6JJOPUD4.js +0 -32
  122. package/dist/message-delivery-3C65ZI6L.js +0 -34
  123. package/dist/mind-service-3F4I46CI.js +0 -36
  124. package/dist/mind-sleep-YMBR3I35.js +0 -47
  125. package/dist/scheduler-P6DXLLXI.js +0 -30
  126. package/dist/sleep-manager-HCUH4PM4.js +0 -34
  127. package/dist/system-chat-XOALE2RD.js +0 -36
  128. package/dist/web-assets/assets/index-B1JBQv2m.css +0 -1
  129. package/dist/web-assets/assets/index-Bc2m8gRC.js +0 -86
  130. package/dist/{accept-N5XULCXK.js → accept-YAFP5JFJ.js} +3 -3
  131. package/dist/{bridge-2PO3AI5D.js → bridge-TIZGSXOD.js} +3 -3
  132. package/dist/{create-DF3KISTW.js → create-A7PDHIIL.js} +3 -3
  133. package/dist/{env-VZ4MLFQW.js → env-HRL2PWAT.js} +5 -5
  134. package/dist/{extension-SEID47SR.js → extension-QBY4C44L.js} +3 -3
  135. package/dist/{list-OXIAY3W7.js → list-LQO2DCIK.js} +3 -3
  136. package/dist/{login-MY6ETFYB.js → login-6TLMI2TQ.js} +3 -3
  137. package/dist/{logout-NCG3TMDL.js → logout-BK53HXNY.js} +3 -3
  138. package/dist/{mind-history-VRO5A76U.js → mind-history-47DN6ILW.js} +4 -4
  139. package/dist/{mind-wake-LCLGTXA2.js → mind-wake-R54BPESY.js} +3 -3
  140. package/dist/{read-QVAXMTPV.js → read-PWAJOQIQ.js} +3 -3
  141. package/dist/{register-Y2H4PY5R.js → register-7SZJFHU6.js} +3 -3
  142. package/dist/{reject-EV35X64Y.js → reject-6VH7N2A4.js} +3 -3
  143. package/dist/{restart-FJQ662XJ.js → restart-H5WJDMA7.js} +4 -4
  144. package/dist/{skill-FKFHIJRR.js → skill-GUKG2YVH.js} +5 -5
  145. package/dist/{start-5JE3TV66.js → start-X46I3GXB.js} +4 -4
  146. package/dist/{stop-AAMTG3TU.js → stop-HJQV4YSM.js} +4 -4
@@ -63,4 +63,13 @@ server.listen(port, () => {
63
63
  log("server", `listening on :${actualPort}`);
64
64
  });
65
65
 
66
- setupShutdown();
66
+ // Reap live SDK subprocesses on SIGTERM/SIGINT so `mind stop`/restart don't
67
+ // orphan `<defunct>` claude children to PID 1 (the daemon, which isn't a
68
+ // reaping init). Bounded so a wedged child can't block shutdown forever.
69
+ // Stop accepting new messages first so a late request can't spawn a fresh
70
+ // subprocess after reapAllSessions has snapshotted the live set (which would
71
+ // re-orphan the very child we're reaping).
72
+ setupShutdown(async () => {
73
+ server.close();
74
+ await mind.reapAllSessions();
75
+ });
@@ -8,6 +8,7 @@ import {
8
8
  countSkillDescriptionTokens,
9
9
  countSystemPromptTokens,
10
10
  findCodexSessionFile,
11
+ getCachedContextInfo,
11
12
  processCodexSession,
12
13
  readSdkInstructions,
13
14
  readSkillDescriptions,
@@ -26,7 +27,7 @@ import type {
26
27
  VoluteContentPart,
27
28
  VoluteEvent,
28
29
  } from "./lib/types.js";
29
- import type { ContextInfo, ContextMessages } from "./lib/volute-server.js";
30
+ import type { ContextInfo, ContextMessages, SessionContextInfo } from "./lib/volute-server.js";
30
31
 
31
32
  /** Minimal interface for a Codex SDK thread — typed to the methods we actually use */
32
33
  type CodexThread = {
@@ -77,8 +78,8 @@ export function createMind(options: {
77
78
  maxContextTokens?: number;
78
79
  }): {
79
80
  resolve: HandlerResolver;
80
- getContextInfo: () => ContextInfo;
81
- getContextMessages: () => ContextMessages;
81
+ getContextInfo: () => Promise<ContextInfo>;
82
+ getContextMessages: () => Promise<ContextMessages>;
82
83
  } {
83
84
  const sessions = new Map<string, CodexSession>();
84
85
  const prompts = loadPrompts();
@@ -623,55 +624,76 @@ export function createMind(options: {
623
624
  const claudeMdTokens = countSdkInstructionTokens(options.cwd);
624
625
  const skillDescTokens = countSkillDescriptionTokens([resolvePath(options.cwd, ".agents/skills")]);
625
626
 
626
- function processSession(sessionName: string) {
627
+ function jsonlPathFor(sessionName: string): string | null {
627
628
  const threadId = sessionStore.load(sessionName);
628
- const jsonlPath = threadId ? findCodexSessionFile(threadId, options.mindDir) : null;
629
- return jsonlPath
630
- ? processCodexSession(jsonlPath, systemPromptTokens, claudeMdTokens, skillDescTokens)
631
- : null;
629
+ return threadId ? findCodexSessionFile(threadId, options.mindDir) : null;
632
630
  }
633
631
 
634
- function getContextInfo(): ContextInfo {
635
- return {
636
- sessions: Array.from(sessions.values()).map((s) => {
637
- try {
638
- const result = processSession(s.name);
639
- return {
640
- name: s.name,
641
- contextTokens: result?.parsed?.contextTokens ?? s.cumulativeInputTokens,
642
- contextWindow: maxContextTokens,
643
- breakdown: result?.parsed?.breakdown,
644
- };
645
- } catch (err) {
646
- log("mind", `failed to get context breakdown for session "${s.name}":`, err);
647
- return {
648
- name: s.name,
649
- contextTokens: s.cumulativeInputTokens,
650
- contextWindow: maxContextTokens,
651
- };
652
- }
653
- }),
654
- systemPrompt: systemPromptTokens,
655
- };
632
+ async function getContextInfo(): Promise<ContextInfo> {
633
+ const infos: SessionContextInfo[] = [];
634
+ for (const s of sessions.values()) {
635
+ try {
636
+ const jsonlPath = jsonlPathFor(s.name);
637
+ // Cache the computed breakdown by file identity: polls between turns are free.
638
+ const parsed = jsonlPath
639
+ ? await getCachedContextInfo(
640
+ jsonlPath,
641
+ async () =>
642
+ (
643
+ await processCodexSession(
644
+ jsonlPath,
645
+ systemPromptTokens,
646
+ claudeMdTokens,
647
+ skillDescTokens,
648
+ )
649
+ ).parsed,
650
+ )
651
+ : null;
652
+ infos.push({
653
+ name: s.name,
654
+ contextTokens: parsed?.contextTokens ?? s.cumulativeInputTokens,
655
+ contextWindow: maxContextTokens,
656
+ breakdown: parsed?.breakdown,
657
+ });
658
+ } catch (err) {
659
+ log("mind", `failed to get context breakdown for session "${s.name}":`, err);
660
+ infos.push({
661
+ name: s.name,
662
+ contextTokens: s.cumulativeInputTokens,
663
+ contextWindow: maxContextTokens,
664
+ });
665
+ }
666
+ }
667
+ return { sessions: infos, systemPrompt: systemPromptTokens };
656
668
  }
657
669
 
658
- function getContextMessages(): ContextMessages {
670
+ async function getContextMessages(): Promise<ContextMessages> {
659
671
  const skillsDir = resolvePath(options.cwd, ".agents/skills");
672
+ const sessionMessages: ContextMessages["sessions"] = [];
673
+ for (const s of sessions.values()) {
674
+ try {
675
+ const jsonlPath = jsonlPathFor(s.name);
676
+ const result = jsonlPath
677
+ ? await processCodexSession(
678
+ jsonlPath,
679
+ systemPromptTokens,
680
+ claudeMdTokens,
681
+ skillDescTokens,
682
+ )
683
+ : null;
684
+ sessionMessages.push({ name: s.name, messages: result?.messages ?? [] });
685
+ } catch (err) {
686
+ log("mind", `failed to extract messages for session "${s.name}":`, err);
687
+ sessionMessages.push({ name: s.name, messages: [] });
688
+ }
689
+ }
660
690
  return {
661
691
  preamble: {
662
692
  systemPrompt: options.systemPrompt,
663
693
  sdkInstructions: readSdkInstructions(options.cwd),
664
694
  skillDescriptions: readSkillDescriptions([skillsDir]),
665
695
  },
666
- sessions: Array.from(sessions.values()).map((s) => {
667
- try {
668
- const result = processSession(s.name);
669
- return { name: s.name, messages: result?.messages ?? [] };
670
- } catch (err) {
671
- log("mind", `failed to extract messages for session "${s.name}":`, err);
672
- return { name: s.name, messages: [] };
673
- }
674
- }),
696
+ sessions: sessionMessages,
675
697
  };
676
698
  }
677
699
 
@@ -16,6 +16,7 @@ import {
16
16
  countSkillDescriptionTokens,
17
17
  countSystemPromptTokens,
18
18
  findPiSessionFile,
19
+ getCachedContextInfo,
19
20
  processPiSession,
20
21
  readSdkInstructions,
21
22
  readSkillDescriptions,
@@ -36,7 +37,7 @@ import type {
36
37
  VoluteContentPart,
37
38
  VoluteEvent,
38
39
  } from "./lib/types.js";
39
- import type { ContextInfo, ContextMessages } from "./lib/volute-server.js";
40
+ import type { ContextInfo, ContextMessages, SessionContextInfo } from "./lib/volute-server.js";
40
41
 
41
42
  type PiAgentSession = Awaited<ReturnType<typeof createAgentSession>>["session"];
42
43
 
@@ -63,8 +64,8 @@ export function createMind(options: {
63
64
  subagents?: Record<string, SubagentConfig>;
64
65
  }): {
65
66
  resolve: HandlerResolver;
66
- getContextInfo: () => ContextInfo;
67
- getContextMessages: () => ContextMessages;
67
+ getContextInfo: () => Promise<ContextInfo>;
68
+ getContextMessages: () => Promise<ContextMessages>;
68
69
  } {
69
70
  const sessions = new Map<string, PiSession>();
70
71
  const prompts = loadPrompts();
@@ -538,50 +539,66 @@ export function createMind(options: {
538
539
  const claudeMdTokens = countSdkInstructionTokens(options.cwd);
539
540
  const skillDescTokens = countSkillDescriptionTokens([resolvePath(options.cwd, ".pi/skills")]);
540
541
 
541
- function processSession(sessionName: string) {
542
- const jsonlPath = findPiSessionFile(piSessionsDir, sessionName);
543
- return jsonlPath
544
- ? processPiSession(jsonlPath, systemPromptTokens, claudeMdTokens, skillDescTokens)
545
- : null;
546
- }
547
-
548
- function getContextInfo(): ContextInfo {
549
- return {
550
- sessions: Array.from(sessions.values()).map((s) => {
551
- try {
552
- const result = processSession(s.name);
553
- return {
554
- name: s.name,
555
- contextTokens: result?.parsed?.contextTokens ?? s.contextTokens,
556
- contextWindow: maxContextTokens,
557
- breakdown: result?.parsed?.breakdown,
558
- };
559
- } catch (err) {
560
- log("mind", `failed to get context breakdown for session "${s.name}":`, err);
561
- return { name: s.name, contextTokens: s.contextTokens, contextWindow: maxContextTokens };
562
- }
563
- }),
564
- systemPrompt: systemPromptTokens,
565
- };
542
+ async function getContextInfo(): Promise<ContextInfo> {
543
+ const infos: SessionContextInfo[] = [];
544
+ for (const s of sessions.values()) {
545
+ try {
546
+ const jsonlPath = findPiSessionFile(piSessionsDir, s.name);
547
+ // Cache the computed breakdown by file identity: polls between turns are free.
548
+ const parsed = jsonlPath
549
+ ? await getCachedContextInfo(
550
+ jsonlPath,
551
+ async () =>
552
+ (
553
+ await processPiSession(
554
+ jsonlPath,
555
+ systemPromptTokens,
556
+ claudeMdTokens,
557
+ skillDescTokens,
558
+ )
559
+ ).parsed,
560
+ )
561
+ : null;
562
+ infos.push({
563
+ name: s.name,
564
+ contextTokens: parsed?.contextTokens ?? s.contextTokens,
565
+ contextWindow: maxContextTokens,
566
+ breakdown: parsed?.breakdown,
567
+ });
568
+ } catch (err) {
569
+ log("mind", `failed to get context breakdown for session "${s.name}":`, err);
570
+ infos.push({
571
+ name: s.name,
572
+ contextTokens: s.contextTokens,
573
+ contextWindow: maxContextTokens,
574
+ });
575
+ }
576
+ }
577
+ return { sessions: infos, systemPrompt: systemPromptTokens };
566
578
  }
567
579
 
568
- function getContextMessages(): ContextMessages {
580
+ async function getContextMessages(): Promise<ContextMessages> {
569
581
  const skillsDir = resolvePath(options.cwd, ".pi/skills");
582
+ const sessionMessages: ContextMessages["sessions"] = [];
583
+ for (const s of sessions.values()) {
584
+ try {
585
+ const jsonlPath = findPiSessionFile(piSessionsDir, s.name);
586
+ const result = jsonlPath
587
+ ? await processPiSession(jsonlPath, systemPromptTokens, claudeMdTokens, skillDescTokens)
588
+ : null;
589
+ sessionMessages.push({ name: s.name, messages: result?.messages ?? [] });
590
+ } catch (err) {
591
+ log("mind", `failed to extract messages for session "${s.name}":`, err);
592
+ sessionMessages.push({ name: s.name, messages: [] });
593
+ }
594
+ }
570
595
  return {
571
596
  preamble: {
572
597
  systemPrompt: options.systemPrompt,
573
598
  sdkInstructions: readSdkInstructions(options.cwd),
574
599
  skillDescriptions: readSkillDescriptions([skillsDir]),
575
600
  },
576
- sessions: Array.from(sessions.values()).map((s) => {
577
- try {
578
- const result = processSession(s.name);
579
- return { name: s.name, messages: result?.messages ?? [] };
580
- } catch (err) {
581
- log("mind", `failed to extract messages for session "${s.name}":`, err);
582
- return { name: s.name, messages: [] };
583
- }
584
- }),
601
+ sessions: sessionMessages,
585
602
  };
586
603
  }
587
604
 
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- AVATAR_DIM,
4
- migrateAvatarSizes,
5
- normalizeAvatar
6
- } from "./chunk-DRJ24GXK.js";
7
- import "./chunk-PFZBNKUH.js";
8
- import "./chunk-T2TP6ZC6.js";
9
- import "./chunk-ALKYQULU.js";
10
- import "./chunk-ZV7MFISX.js";
11
- import "./chunk-K3NQKI34.js";
12
- export {
13
- AVATAR_DIM,
14
- migrateAvatarSizes,
15
- normalizeAvatar
16
- };
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- DeliveryManager,
4
- getDeliveryManager,
5
- initDeliveryManager,
6
- tryGetDeliveryManager
7
- } from "./chunk-YT7PEESJ.js";
8
- import "./chunk-ZDZISKCL.js";
9
- import "./chunk-FR6S2KNN.js";
10
- import "./chunk-QLWG3C2Z.js";
11
- import "./chunk-7ZUB63PS.js";
12
- import "./chunk-OP4JG2BS.js";
13
- import "./chunk-PFZBNKUH.js";
14
- import "./chunk-JZ62SYWR.js";
15
- import "./chunk-EJVPTVTI.js";
16
- import "./chunk-4JOQZPCE.js";
17
- import "./chunk-UYLGEDVD.js";
18
- import "./chunk-H2X54EHC.js";
19
- import "./chunk-IHKGWTGT.js";
20
- import "./chunk-F7H6ATM4.js";
21
- import "./chunk-T6HYVHPG.js";
22
- import "./chunk-7C44R625.js";
23
- import "./chunk-T2TP6ZC6.js";
24
- import "./chunk-ALKYQULU.js";
25
- import "./chunk-ZV7MFISX.js";
26
- import "./chunk-K3NQKI34.js";
27
- export {
28
- DeliveryManager,
29
- getDeliveryManager,
30
- initDeliveryManager,
31
- tryGetDeliveryManager
32
- };
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- clearEchoTextCache,
4
- echoTextToChannel
5
- } from "./chunk-NYC5U6K7.js";
6
- import "./chunk-RXEEYDIB.js";
7
- import "./chunk-YT7PEESJ.js";
8
- import "./chunk-ZDZISKCL.js";
9
- import "./chunk-FR6S2KNN.js";
10
- import "./chunk-QLWG3C2Z.js";
11
- import "./chunk-7ZUB63PS.js";
12
- import "./chunk-OP4JG2BS.js";
13
- import "./chunk-PFZBNKUH.js";
14
- import "./chunk-JZ62SYWR.js";
15
- import "./chunk-EJVPTVTI.js";
16
- import "./chunk-4JOQZPCE.js";
17
- import "./chunk-UYLGEDVD.js";
18
- import "./chunk-TQJ6ZYVY.js";
19
- import "./chunk-H2X54EHC.js";
20
- import "./chunk-IHKGWTGT.js";
21
- import "./chunk-F7H6ATM4.js";
22
- import "./chunk-T6HYVHPG.js";
23
- import "./chunk-7C44R625.js";
24
- import "./chunk-T2TP6ZC6.js";
25
- import "./chunk-LGNUFVMR.js";
26
- import "./chunk-ALKYQULU.js";
27
- import "./chunk-ZV7MFISX.js";
28
- import "./chunk-K3NQKI34.js";
29
- export {
30
- clearEchoTextCache,
31
- echoTextToChannel
32
- };
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- deliverMessage,
4
- linkToolResultToTurn,
5
- recordInbound,
6
- recordOutbound,
7
- resolveSleepAction
8
- } from "./chunk-YT7PEESJ.js";
9
- import "./chunk-ZDZISKCL.js";
10
- import "./chunk-FR6S2KNN.js";
11
- import "./chunk-QLWG3C2Z.js";
12
- import "./chunk-7ZUB63PS.js";
13
- import "./chunk-OP4JG2BS.js";
14
- import "./chunk-PFZBNKUH.js";
15
- import "./chunk-JZ62SYWR.js";
16
- import "./chunk-EJVPTVTI.js";
17
- import "./chunk-4JOQZPCE.js";
18
- import "./chunk-UYLGEDVD.js";
19
- import "./chunk-H2X54EHC.js";
20
- import "./chunk-IHKGWTGT.js";
21
- import "./chunk-F7H6ATM4.js";
22
- import "./chunk-T6HYVHPG.js";
23
- import "./chunk-7C44R625.js";
24
- import "./chunk-T2TP6ZC6.js";
25
- import "./chunk-ALKYQULU.js";
26
- import "./chunk-ZV7MFISX.js";
27
- import "./chunk-K3NQKI34.js";
28
- export {
29
- deliverMessage,
30
- linkToolResultToTurn,
31
- recordInbound,
32
- recordOutbound,
33
- resolveSleepAction
34
- };
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- sleepMind,
4
- startMindFull,
5
- startSpiritFull,
6
- stopMindFull,
7
- stopSpiritFull,
8
- wakeMind
9
- } from "./chunk-YT7PEESJ.js";
10
- import "./chunk-ZDZISKCL.js";
11
- import "./chunk-FR6S2KNN.js";
12
- import "./chunk-QLWG3C2Z.js";
13
- import "./chunk-7ZUB63PS.js";
14
- import "./chunk-OP4JG2BS.js";
15
- import "./chunk-PFZBNKUH.js";
16
- import "./chunk-JZ62SYWR.js";
17
- import "./chunk-EJVPTVTI.js";
18
- import "./chunk-4JOQZPCE.js";
19
- import "./chunk-UYLGEDVD.js";
20
- import "./chunk-H2X54EHC.js";
21
- import "./chunk-IHKGWTGT.js";
22
- import "./chunk-F7H6ATM4.js";
23
- import "./chunk-T6HYVHPG.js";
24
- import "./chunk-7C44R625.js";
25
- import "./chunk-T2TP6ZC6.js";
26
- import "./chunk-ALKYQULU.js";
27
- import "./chunk-ZV7MFISX.js";
28
- import "./chunk-K3NQKI34.js";
29
- export {
30
- sleepMind,
31
- startMindFull,
32
- startSpiritFull,
33
- stopMindFull,
34
- stopSpiritFull,
35
- wakeMind
36
- };
@@ -1,47 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- resolveMindName
4
- } from "./chunk-BTY4WNFE.js";
5
- import {
6
- daemonFetch
7
- } from "./chunk-RBNMDAKB.js";
8
- import {
9
- command
10
- } from "./chunk-TXSA4Q3V.js";
11
- import "./chunk-O7IGP7ZW.js";
12
- import "./chunk-K3NQKI34.js";
13
-
14
- // packages/cli/src/commands/mind-sleep.ts
15
- var cmd = command({
16
- name: "volute clock sleep",
17
- description: "Put a mind to sleep",
18
- args: [{ name: "name", description: "Mind to sleep (or use --mind / VOLUTE_MIND)" }],
19
- flags: {
20
- mind: { type: "string", description: "Mind name" },
21
- "wake-at": { type: "string", description: "Schedule wake time" }
22
- },
23
- run: async ({ args, flags }) => {
24
- const name = args.name || resolveMindName(flags);
25
- if (!name) {
26
- console.error("Provide a mind name as argument, --mind flag, or VOLUTE_MIND env var");
27
- process.exit(1);
28
- }
29
- const body = {};
30
- if (flags["wake-at"]) body.wakeAt = flags["wake-at"];
31
- const res = await daemonFetch(`/api/minds/${encodeURIComponent(name)}/sleep`, {
32
- method: "POST",
33
- headers: { "Content-Type": "application/json" },
34
- body: JSON.stringify(body)
35
- });
36
- const data = await res.json();
37
- if (!res.ok) {
38
- console.error(data.error || "Failed to put mind to sleep");
39
- process.exit(1);
40
- }
41
- console.log(`${name} is going to sleep`);
42
- }
43
- });
44
- var run = cmd.execute;
45
- export {
46
- run
47
- };
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- Scheduler,
4
- getScheduler,
5
- initScheduler
6
- } from "./chunk-YT7PEESJ.js";
7
- import "./chunk-ZDZISKCL.js";
8
- import "./chunk-FR6S2KNN.js";
9
- import "./chunk-QLWG3C2Z.js";
10
- import "./chunk-7ZUB63PS.js";
11
- import "./chunk-OP4JG2BS.js";
12
- import "./chunk-PFZBNKUH.js";
13
- import "./chunk-JZ62SYWR.js";
14
- import "./chunk-EJVPTVTI.js";
15
- import "./chunk-4JOQZPCE.js";
16
- import "./chunk-UYLGEDVD.js";
17
- import "./chunk-H2X54EHC.js";
18
- import "./chunk-IHKGWTGT.js";
19
- import "./chunk-F7H6ATM4.js";
20
- import "./chunk-T6HYVHPG.js";
21
- import "./chunk-7C44R625.js";
22
- import "./chunk-T2TP6ZC6.js";
23
- import "./chunk-ALKYQULU.js";
24
- import "./chunk-ZV7MFISX.js";
25
- import "./chunk-K3NQKI34.js";
26
- export {
27
- Scheduler,
28
- getScheduler,
29
- initScheduler
30
- };
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- SleepManager,
4
- getSleepManager,
5
- getSleepManagerIfReady,
6
- initSleepManager,
7
- matchesGlob
8
- } from "./chunk-YT7PEESJ.js";
9
- import "./chunk-ZDZISKCL.js";
10
- import "./chunk-FR6S2KNN.js";
11
- import "./chunk-QLWG3C2Z.js";
12
- import "./chunk-7ZUB63PS.js";
13
- import "./chunk-OP4JG2BS.js";
14
- import "./chunk-PFZBNKUH.js";
15
- import "./chunk-JZ62SYWR.js";
16
- import "./chunk-EJVPTVTI.js";
17
- import "./chunk-4JOQZPCE.js";
18
- import "./chunk-UYLGEDVD.js";
19
- import "./chunk-H2X54EHC.js";
20
- import "./chunk-IHKGWTGT.js";
21
- import "./chunk-F7H6ATM4.js";
22
- import "./chunk-T6HYVHPG.js";
23
- import "./chunk-7C44R625.js";
24
- import "./chunk-T2TP6ZC6.js";
25
- import "./chunk-ALKYQULU.js";
26
- import "./chunk-ZV7MFISX.js";
27
- import "./chunk-K3NQKI34.js";
28
- export {
29
- SleepManager,
30
- getSleepManager,
31
- getSleepManagerIfReady,
32
- initSleepManager,
33
- matchesGlob
34
- };
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- ensureSystemDM,
4
- generateSystemFallbackReply,
5
- resetSystemDMCache,
6
- sendSystemMessage,
7
- sendSystemMessageDirect,
8
- shouldGenerateSystemFallback
9
- } from "./chunk-YT7PEESJ.js";
10
- import "./chunk-ZDZISKCL.js";
11
- import "./chunk-FR6S2KNN.js";
12
- import "./chunk-QLWG3C2Z.js";
13
- import "./chunk-7ZUB63PS.js";
14
- import "./chunk-OP4JG2BS.js";
15
- import "./chunk-PFZBNKUH.js";
16
- import "./chunk-JZ62SYWR.js";
17
- import "./chunk-EJVPTVTI.js";
18
- import "./chunk-4JOQZPCE.js";
19
- import "./chunk-UYLGEDVD.js";
20
- import "./chunk-H2X54EHC.js";
21
- import "./chunk-IHKGWTGT.js";
22
- import "./chunk-F7H6ATM4.js";
23
- import "./chunk-T6HYVHPG.js";
24
- import "./chunk-7C44R625.js";
25
- import "./chunk-T2TP6ZC6.js";
26
- import "./chunk-ALKYQULU.js";
27
- import "./chunk-ZV7MFISX.js";
28
- import "./chunk-K3NQKI34.js";
29
- export {
30
- ensureSystemDM,
31
- generateSystemFallbackReply,
32
- resetSystemDMCache,
33
- sendSystemMessage,
34
- sendSystemMessageDirect,
35
- shouldGenerateSystemFallback
36
- };