volute 0.34.0 → 0.35.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 (209) hide show
  1. package/README.md +7 -6
  2. package/dist/accept-ZBDVVCEU.js +42 -0
  3. package/dist/{activity-events-BN7V6KCC.js → activity-events-ZW4SDL2C.js} +4 -4
  4. package/dist/{ai-service-PSILB5WD.js → ai-service-LURBEDDB.js} +5 -5
  5. package/dist/{api-client-XUXOB7LI.js → api-client-3A77HMH7.js} +1 -1
  6. package/dist/api.d.ts +1 -5618
  7. package/dist/{archive-C2VEMQOR.js → archive-ESU2FUN4.js} +3 -3
  8. package/dist/{auth-ZFZXJZDQ.js → auth-WX4TESEI.js} +5 -5
  9. package/dist/bridge-PXIO6PS2.js +206 -0
  10. package/dist/chat-QXAJF3FU.js +51 -0
  11. package/dist/{chunk-7F2SW2KD.js → chunk-2TGZJFAT.js} +3 -3
  12. package/dist/{chunk-6LXAAQ43.js → chunk-33ODGMFZ.js} +1 -1
  13. package/dist/{chunk-4JSR7YO7.js → chunk-5N7Y5WAM.js} +1 -1
  14. package/dist/{chunk-FYCALD4Q.js → chunk-5T5YMX6S.js} +1 -1
  15. package/dist/{chunk-B2BVAIZ4.js → chunk-5XJYUFZH.js} +21 -15
  16. package/dist/{chunk-M3K5AARV.js → chunk-A2ZLHBHG.js} +2 -2
  17. package/dist/{chunk-U5BTYSAL.js → chunk-AN2W47GW.js} +2 -2
  18. package/dist/{chunk-G53F3JA4.js → chunk-AOB6GVRM.js} +1 -1
  19. package/dist/{chunk-N7BLAHNE.js → chunk-BDYXIWA5.js} +5 -5
  20. package/dist/{chunk-YUIHSKR6.js → chunk-BKF4WQCY.js} +2 -2
  21. package/dist/{chunk-6OWJXUAR.js → chunk-BMZQYACC.js} +2 -2
  22. package/dist/{chunk-NAOW2CLO.js → chunk-BTY4WNFE.js} +1 -1
  23. package/dist/{chunk-MLOQKQNB.js → chunk-BV65KRHM.js} +2 -2
  24. package/dist/{chunk-XWXBJQBE.js → chunk-CORXD635.js} +4 -4
  25. package/dist/{chunk-PVY5W6QN.js → chunk-F7ZNLYKZ.js} +2 -2
  26. package/dist/{chunk-BFWHBQK4.js → chunk-FT5KETXZ.js} +3 -3
  27. package/dist/{chunk-N3DNFPVA.js → chunk-IJHIXLVN.js} +8 -8
  28. package/dist/{chunk-V6ZCNULL.js → chunk-J6CJQDWI.js} +37 -28
  29. package/dist/{chunk-4RQBJWQX.js → chunk-LOPXTW6H.js} +1 -1
  30. package/dist/{chunk-47ZPNLF4.js → chunk-MDJGMOSD.js} +8 -137
  31. package/dist/{chunk-BTWAGDV5.js → chunk-N446KRP7.js} +3 -3
  32. package/dist/{chunk-6WAWMWR5.js → chunk-N5LMGYXX.js} +2 -2
  33. package/dist/{chunk-G6BSYHPK.js → chunk-NJK5SDGR.js} +1 -1
  34. package/dist/{chunk-D424ZQGI.js → chunk-O7IGP7ZW.js} +11 -3
  35. package/dist/{chunk-2IOP6PHB.js → chunk-OTC67N2Z.js} +2 -2
  36. package/dist/{chunk-V45JXOWY.js → chunk-PWQ2ITYG.js} +4 -4
  37. package/dist/{chunk-KTLFDYPT.js → chunk-QCH6K235.js} +1 -1
  38. package/dist/chunk-QHG4OMZL.js +145 -0
  39. package/dist/{chunk-IS7WJ56Q.js → chunk-QWTR6AWZ.js} +3 -3
  40. package/dist/chunk-TXSA4Q3V.js +116 -0
  41. package/dist/{chunk-BDK73LK6.js → chunk-VHJRZM2S.js} +2 -2
  42. package/dist/{chunk-SSI47XP2.js → chunk-VHWGEJ4V.js} +1 -1
  43. package/dist/chunk-VY3RB2V7.js +164 -0
  44. package/dist/chunk-WJPROOU5.js +8314 -0
  45. package/dist/{chunk-E5C7OWZ2.js → chunk-WZRZFFCL.js} +8 -8
  46. package/dist/{chunk-BM474GX6.js → chunk-XRQSAMX2.js} +4 -4
  47. package/dist/{chunk-OYAKCAVY.js → chunk-ZSR72JB3.js} +1 -1
  48. package/dist/{chunk-PLDWHR4D.js → chunk-ZX7EAV5J.js} +17 -7
  49. package/dist/cli.js +90 -29
  50. package/dist/clock-HSEKS5AR.js +289 -0
  51. package/dist/{cloud-sync-TG3TIX5H.js → cloud-sync-6JL4C24T.js} +21 -22
  52. package/dist/config-UTS7QULS.js +76 -0
  53. package/dist/connectors/discord-bridge.js +3 -3
  54. package/dist/connectors/slack-bridge.js +3 -3
  55. package/dist/connectors/telegram-bridge.js +3 -3
  56. package/dist/{conversations-HL2JP5GI.js → conversations-2PW57WO2.js} +5 -5
  57. package/dist/create-5BPOOJAN.js +75 -0
  58. package/dist/create-UVCK2CS6.js +50 -0
  59. package/dist/daemon-client-RVIKXGFQ.js +12 -0
  60. package/dist/daemon-restart-HSZ3BCX5.js +65 -0
  61. package/dist/daemon.js +845 -1766
  62. package/dist/{db-PLEDCBHZ.js → db-BDMH4SZ2.js} +7 -3
  63. package/dist/{db-RYX3SS2W.js → db-BVBJ57TU.js} +2 -2
  64. package/dist/delete-L5PAVDGQ.js +42 -0
  65. package/dist/delivery-manager-H5ZVBMCQ.js +31 -0
  66. package/dist/{delivery-router-D5ELDMS2.js → delivery-router-HEJSJAHQ.js} +4 -4
  67. package/dist/down-74VXM45A.js +17 -0
  68. package/dist/env-E4XHO2BI.js +223 -0
  69. package/dist/{exec-DVLXKRIO.js → exec-PY7THYH4.js} +4 -4
  70. package/dist/export-OAS6QVBN.js +113 -0
  71. package/dist/{extension-PM42QCID.js → extension-D74CNM7G.js} +25 -33
  72. package/dist/{extensions-BBGVL5JC.js → extensions-XDDFY72A.js} +22 -11
  73. package/dist/files-CWTK6V3H.js +53 -0
  74. package/dist/import-5A3T7QV4.js +143 -0
  75. package/dist/{isolation-62MKDZN3.js → isolation-TK5RX2WM.js} +3 -3
  76. package/dist/join-DF5XSJAC.js +67 -0
  77. package/dist/list-PDMQM7ZV.js +53 -0
  78. package/dist/login-7TE6CIZF.js +60 -0
  79. package/dist/login-GOTAYLXP.js +51 -0
  80. package/dist/logout-6KIA74EV.js +29 -0
  81. package/dist/logout-T4XS6LRU.js +50 -0
  82. package/dist/message-delivery-GRC4W6P7.js +41 -0
  83. package/dist/mind-5IEYKV7I.js +97 -0
  84. package/dist/{mind-activity-tracker-2ACNHA7B.js → mind-activity-tracker-QBLIV7ZJ.js} +5 -5
  85. package/dist/{mind-history-WOYFLQAI.js → mind-history-IE2QH7U5.js} +82 -71
  86. package/dist/mind-list-GEWHWAL4.js +38 -0
  87. package/dist/mind-manager-HFLB5653.js +31 -0
  88. package/dist/mind-profile-DCBDVF5B.js +53 -0
  89. package/dist/mind-service-X2CAA6W6.js +37 -0
  90. package/dist/mind-sleep-ITCF6OQA.js +47 -0
  91. package/dist/mind-status-X4SX3YUG.js +65 -0
  92. package/dist/mind-wake-KXMKMGWX.js +42 -0
  93. package/dist/{package-V2WHWVG6.js → package-D2FSVFAX.js} +5 -5
  94. package/dist/read-67VRP2DO.js +91 -0
  95. package/dist/{read-stdin-PIRM6A2Y.js → read-stdin-3X5VYKNS.js} +1 -1
  96. package/dist/register-SB7NXCOE.js +51 -0
  97. package/dist/{registry-UYV5S6QT.js → registry-GBSNW3HG.js} +2 -2
  98. package/dist/reject-MUR2KWJ4.js +40 -0
  99. package/dist/restart-5EGG4JXU.js +42 -0
  100. package/dist/{sandbox-SI5HMBP3.js → sandbox-R37VIU36.js} +5 -5
  101. package/dist/scheduler-Y7O4CJXL.js +31 -0
  102. package/dist/{schema-ETMABTW4.js → schema-XVZ2CLKW.js} +1 -1
  103. package/dist/{seed-WNGI6PNW.js → seed-EQORWX77.js} +2 -2
  104. package/dist/seed-check-KJNTL72M.js +35 -0
  105. package/dist/seed-cmd-ZM2XGVU2.js +30 -0
  106. package/dist/seed-create-DRWGGHEI.js +113 -0
  107. package/dist/seed-sprout-JYXGXOP3.js +148 -0
  108. package/dist/send-JBJJQ7CA.js +409 -0
  109. package/dist/service-WNPCNHOX.js +121 -0
  110. package/dist/{setup-Z3DEVWV7.js → setup-BJ4YAY26.js} +153 -127
  111. package/dist/{setup-GGMKENLN.js → setup-RHJRFURI.js} +3 -3
  112. package/dist/skill-TAAKEYBV.js +389 -0
  113. package/dist/skills/volute-mind/SKILL.md +3 -7
  114. package/dist/skills/volute-mind/references/extensions.md +8 -11
  115. package/dist/{skills-Q6VZ2UGD.js → skills-EKMCQ46K.js} +7 -7
  116. package/dist/sleep-manager-7KFK3USC.js +35 -0
  117. package/dist/spirit-ZFRDXMG7.js +23 -0
  118. package/dist/split-AWVOYOPZ.js +64 -0
  119. package/dist/{sprout-E3HJIV2Z.js → sprout-HE4TITMK.js} +2 -2
  120. package/dist/start-3UXOPXQG.js +39 -0
  121. package/dist/status-ZK34WYIM.js +125 -0
  122. package/dist/stop-3XYIBGFM.js +41 -0
  123. package/dist/system-chat-IDPHYHY4.js +35 -0
  124. package/dist/systems-O43WGQY6.js +52 -0
  125. package/dist/{tailscale-ZEUK7GKZ.js → tailscale-ZIZ2HWJ5.js} +4 -4
  126. package/dist/{template-hash-EJRTKE36.js → template-hash-A7FNHTB7.js} +2 -2
  127. package/dist/up-77ICEDEW.js +19 -0
  128. package/dist/update-ANE5ZM7F.js +225 -0
  129. package/dist/{update-check-X3YG4WVP.js → update-check-UV55CBEP.js} +3 -3
  130. package/dist/upgrade-ZMDGC7M2.js +74 -0
  131. package/dist/variant-QWL2WSRI.js +62 -0
  132. package/dist/{version-notify-YCH4UVQ2.js → version-notify-FXSEMXWW.js} +28 -27
  133. package/dist/{volute-config-WBKYJGYQ.js → volute-config-D2XVS2YI.js} +1 -1
  134. package/dist/web-assets/assets/index-BhxWKvbB.css +1 -0
  135. package/dist/web-assets/assets/index-CHVKJ9II.js +75 -0
  136. package/dist/web-assets/index.html +2 -2
  137. package/dist/web-assets/sw.js +117 -0
  138. package/package.json +5 -5
  139. package/packages/extensions/pages/dist/ui/assets/index-DKZLNMED.js +2 -0
  140. package/packages/extensions/pages/dist/ui/index.html +1 -1
  141. package/packages/extensions/pages/skills/pages/SKILL.md +84 -9
  142. package/templates/_base/src/lib/auto-commit.ts +8 -8
  143. package/templates/_base/src/lib/volute-server.ts +6 -0
  144. package/templates/claude/src/agent.ts +8 -1
  145. package/dist/accept-TW6V4WI4.js +0 -42
  146. package/dist/bridge-O753D5F4.js +0 -207
  147. package/dist/chat-BHYX7DJ4.js +0 -68
  148. package/dist/chunk-47XDEWWV.js +0 -156
  149. package/dist/chunk-CVL5IGIR.js +0 -2084
  150. package/dist/chunk-PB65JZK2.js +0 -85
  151. package/dist/chunk-TAHX36HZ.js +0 -3679
  152. package/dist/clock-3X4DSC2N.js +0 -281
  153. package/dist/config-OROA5DUA.js +0 -72
  154. package/dist/create-3SEKKI6P.js +0 -71
  155. package/dist/create-UOSOQ2HN.js +0 -44
  156. package/dist/daemon-client-WOAQXXBM.js +0 -12
  157. package/dist/daemon-restart-5ABHNXJZ.js +0 -52
  158. package/dist/delete-KYOVWR23.js +0 -35
  159. package/dist/delivery-manager-2BR5NZKF.js +0 -32
  160. package/dist/down-QVFN4UPK.js +0 -15
  161. package/dist/env-R34DT7XL.js +0 -195
  162. package/dist/export-6ZXAXATG.js +0 -112
  163. package/dist/files-VQV2VZQO.js +0 -47
  164. package/dist/import-MK2I2T6F.js +0 -23
  165. package/dist/join-DGYHTJUH.js +0 -66
  166. package/dist/list-C644WTHV.js +0 -49
  167. package/dist/login-IIGEQPHL.js +0 -47
  168. package/dist/login-KZQLMAWE.js +0 -47
  169. package/dist/logout-AGTZVRGP.js +0 -40
  170. package/dist/logout-KD6GXIJJ.js +0 -21
  171. package/dist/message-delivery-V3R6NXJP.js +0 -42
  172. package/dist/mind-BI4EPBVZ.js +0 -108
  173. package/dist/mind-list-6VPM7GUQ.js +0 -30
  174. package/dist/mind-manager-MWW3BTS4.js +0 -32
  175. package/dist/mind-profile-WPG42U5Y.js +0 -47
  176. package/dist/mind-service-VIKZJK2M.js +0 -38
  177. package/dist/mind-sleep-XDISJY74.js +0 -42
  178. package/dist/mind-status-7FTZWPZF.js +0 -56
  179. package/dist/mind-wake-KIIKEI3A.js +0 -37
  180. package/dist/read-H5C26YO7.js +0 -85
  181. package/dist/register-J27WP33N.js +0 -47
  182. package/dist/reject-OEANJYIA.js +0 -40
  183. package/dist/restart-V5EGYBJG.js +0 -33
  184. package/dist/scheduler-AGG3L2FO.js +0 -32
  185. package/dist/seed-check-PXTH7YXS.js +0 -32
  186. package/dist/seed-cmd-VENFTGS3.js +0 -36
  187. package/dist/seed-create-663ALOKH.js +0 -112
  188. package/dist/seed-sprout-EH3AGKAI.js +0 -132
  189. package/dist/send-7FUUUZZH.js +0 -386
  190. package/dist/skill-DKNYJS4P.js +0 -362
  191. package/dist/skills/shared-files/SKILL.md +0 -44
  192. package/dist/skills/shared-files/scripts/merge.ts +0 -72
  193. package/dist/skills/shared-files/scripts/pull.ts +0 -52
  194. package/dist/sleep-manager-BJK2ROPX.js +0 -36
  195. package/dist/spirit-4JP4TY4C.js +0 -23
  196. package/dist/split-3YPMS2CL.js +0 -63
  197. package/dist/start-W3TPKX4D.js +0 -33
  198. package/dist/status-4OVFXFEJ.js +0 -115
  199. package/dist/stop-GTT6YWYO.js +0 -32
  200. package/dist/system-channel-DXD2JBOU.js +0 -36
  201. package/dist/system-chat-TYLOL7SX.js +0 -36
  202. package/dist/systems-AYLO727G.js +0 -61
  203. package/dist/up-PA7F2CXE.js +0 -18
  204. package/dist/update-HG4LCUSG.js +0 -215
  205. package/dist/upgrade-YGNIDICG.js +0 -67
  206. package/dist/variant-MZUMRTQO.js +0 -41
  207. package/dist/web-assets/assets/index-DiiwC-CZ.css +0 -1
  208. package/dist/web-assets/assets/index-d6y5b9Ij.js +0 -75
  209. package/packages/extensions/pages/dist/ui/assets/index-tLTROSk5.js +0 -2
@@ -1,26 +1,26 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  subscribe
4
- } from "./chunk-XWXBJQBE.js";
4
+ } from "./chunk-CORXD635.js";
5
5
  import {
6
6
  logger_default
7
- } from "./chunk-YUIHSKR6.js";
7
+ } from "./chunk-BKF4WQCY.js";
8
8
  import {
9
9
  getDb
10
- } from "./chunk-N7BLAHNE.js";
10
+ } from "./chunk-BDYXIWA5.js";
11
11
  import {
12
12
  conversationParticipants,
13
13
  conversationReads,
14
14
  conversations,
15
15
  messages,
16
16
  users
17
- } from "./chunk-4JSR7YO7.js";
17
+ } from "./chunk-5N7Y5WAM.js";
18
18
 
19
- // src/lib/events/conversations.ts
19
+ // packages/daemon/src/lib/events/conversations.ts
20
20
  import { randomUUID } from "crypto";
21
21
  import { and, desc, eq, inArray, isNull, lt, sql } from "drizzle-orm";
22
22
 
23
- // src/lib/webhook.ts
23
+ // packages/daemon/src/lib/webhook.ts
24
24
  var slog = logger_default.child("webhook");
25
25
  function getWebhookUrl() {
26
26
  return process.env.VOLUTE_WEBHOOK_URL;
@@ -82,7 +82,7 @@ function initWebhook() {
82
82
  });
83
83
  }
84
84
 
85
- // src/lib/events/conversation-events.ts
85
+ // packages/daemon/src/lib/events/conversation-events.ts
86
86
  var subscribers = /* @__PURE__ */ new Map();
87
87
  function subscribe2(conversationId, callback) {
88
88
  let set = subscribers.get(conversationId);
@@ -110,7 +110,7 @@ function publish(conversationId, event) {
110
110
  }
111
111
  }
112
112
 
113
- // src/lib/events/conversations.ts
113
+ // packages/daemon/src/lib/events/conversations.ts
114
114
  async function createConversation(mindName, channel, opts) {
115
115
  const db = await getDb();
116
116
  const id = randomUUID();
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  broadcast
4
- } from "./chunk-XWXBJQBE.js";
4
+ } from "./chunk-CORXD635.js";
5
5
  import {
6
6
  getDb
7
- } from "./chunk-N7BLAHNE.js";
7
+ } from "./chunk-BDYXIWA5.js";
8
8
  import {
9
9
  users
10
- } from "./chunk-4JSR7YO7.js";
10
+ } from "./chunk-5N7Y5WAM.js";
11
11
 
12
- // src/lib/auth.ts
12
+ // packages/daemon/src/lib/auth.ts
13
13
  import { compareSync, hashSync } from "bcryptjs";
14
14
  import { and, count, eq, or } from "drizzle-orm";
15
15
  var userSelectFields = {
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // src/lib/volute-config.ts
3
+ // packages/daemon/src/lib/volute-config.ts
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
5
5
  import { dirname, resolve } from "path";
6
6
  function readJson(path) {
@@ -1,12 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- voluteSystemDir,
4
- voluteUserHome
5
- } from "./chunk-N7BLAHNE.js";
6
2
 
7
- // src/lib/daemon-client.ts
3
+ // packages/cli/src/lib/daemon-client.ts
8
4
  import { existsSync, readFileSync } from "fs";
5
+ import { homedir } from "os";
9
6
  import { resolve } from "path";
7
+ function voluteUserHome() {
8
+ return process.env.VOLUTE_USER_HOME ?? resolve(homedir(), ".volute");
9
+ }
10
+ function voluteSystemDir() {
11
+ const home = process.env.VOLUTE_HOME ?? resolve(homedir(), ".volute");
12
+ return resolve(home, "system");
13
+ }
10
14
  function readSessionFile(mindDir) {
11
15
  try {
12
16
  const p = resolve(mindDir, ".mind", "current-session");
@@ -70,9 +74,14 @@ function buildUrl(config) {
70
74
  }
71
75
  return url.origin;
72
76
  }
77
+ function resolveDaemonUrl() {
78
+ if (process.env.VOLUTE_DAEMON_URL) return process.env.VOLUTE_DAEMON_URL;
79
+ const session = readCliSession();
80
+ if (session?.daemonUrl) return session.daemonUrl;
81
+ return buildUrl(readDaemonConfig());
82
+ }
73
83
  async function daemonFetch(path, options) {
74
- const config = readDaemonConfig();
75
- const url = buildUrl(config);
84
+ const url = resolveDaemonUrl();
76
85
  const headers = new Headers(options?.headers);
77
86
  const daemonToken = process.env.VOLUTE_DAEMON_TOKEN;
78
87
  const cliSession = daemonToken ? null : readCliSession();
@@ -108,5 +117,6 @@ async function daemonFetch(path, options) {
108
117
 
109
118
  export {
110
119
  readSessionFile,
120
+ resolveDaemonUrl,
111
121
  daemonFetch
112
122
  };
package/dist/cli.js CHANGED
@@ -10,7 +10,7 @@ if (!process.env.VOLUTE_HOME) {
10
10
  var command = process.argv[2];
11
11
  var args = process.argv.slice(3);
12
12
  if (command === "--version" || command === "-v") {
13
- const { default: pkg } = await import("./package-V2WHWVG6.js");
13
+ const { default: pkg } = await import("./package-D2FSVFAX.js");
14
14
  console.log(pkg.version);
15
15
  process.exit(0);
16
16
  }
@@ -31,7 +31,7 @@ var ungatedCommands = /* @__PURE__ */ new Set([
31
31
  void 0
32
32
  ]);
33
33
  if (!ungatedCommands.has(command)) {
34
- const { isSetupComplete } = await import("./setup-GGMKENLN.js");
34
+ const { isSetupComplete } = await import("./setup-RHJRFURI.js");
35
35
  if (!isSetupComplete()) {
36
36
  console.error("Volute is not set up. Run `volute setup` first.");
37
37
  process.exit(1);
@@ -39,58 +39,61 @@ if (!ungatedCommands.has(command)) {
39
39
  }
40
40
  switch (command) {
41
41
  case "setup":
42
- await import("./setup-Z3DEVWV7.js").then((m) => m.run(args));
42
+ await import("./setup-BJ4YAY26.js").then((m) => m.run(args));
43
43
  break;
44
44
  case "mind":
45
- await import("./mind-BI4EPBVZ.js").then((m) => m.run(args));
45
+ await import("./mind-5IEYKV7I.js").then((m) => m.run(args));
46
46
  break;
47
47
  case "seed":
48
- await import("./seed-cmd-VENFTGS3.js").then((m) => m.run(args));
48
+ await import("./seed-cmd-ZM2XGVU2.js").then((m) => m.run(args));
49
49
  break;
50
50
  case "chat":
51
- await import("./chat-BHYX7DJ4.js").then((m) => m.run(args));
51
+ await import("./chat-QXAJF3FU.js").then((m) => m.run(args));
52
52
  break;
53
53
  case "variant":
54
- await import("./variant-MZUMRTQO.js").then((m) => m.run(args));
54
+ await import("./variant-QWL2WSRI.js").then((m) => m.run(args));
55
55
  break;
56
56
  case "clock":
57
- await import("./clock-3X4DSC2N.js").then((m) => m.run(args));
57
+ await import("./clock-HSEKS5AR.js").then((m) => m.run(args));
58
58
  break;
59
59
  case "skill":
60
- await import("./skill-DKNYJS4P.js").then((m) => m.run(args));
60
+ await import("./skill-TAAKEYBV.js").then((m) => m.run(args));
61
61
  break;
62
62
  case "env":
63
- await import("./env-R34DT7XL.js").then((m) => m.run(args));
63
+ await import("./env-E4XHO2BI.js").then((m) => m.run(args));
64
64
  break;
65
65
  case "config":
66
- await import("./config-OROA5DUA.js").then((m) => m.run(args));
66
+ await import("./config-UTS7QULS.js").then((m) => m.run(args));
67
67
  break;
68
68
  case "up":
69
- await import("./up-PA7F2CXE.js").then((m) => m.run(args));
69
+ await import("./up-77ICEDEW.js").then((m) => m.run(args));
70
70
  break;
71
71
  case "down":
72
- await import("./down-QVFN4UPK.js").then((m) => m.run(args));
72
+ await import("./down-74VXM45A.js").then((m) => m.run(args));
73
73
  break;
74
74
  case "restart":
75
- await import("./daemon-restart-5ABHNXJZ.js").then((m) => m.run(args));
75
+ await import("./daemon-restart-HSZ3BCX5.js").then((m) => m.run(args));
76
76
  break;
77
77
  case "update":
78
- await import("./update-HG4LCUSG.js").then((m) => m.run(args));
78
+ await import("./update-ANE5ZM7F.js").then((m) => m.run(args));
79
79
  break;
80
80
  case "status":
81
- await import("./status-4OVFXFEJ.js").then((m) => m.run(args));
81
+ await import("./status-ZK34WYIM.js").then((m) => m.run(args));
82
82
  break;
83
83
  case "extension":
84
- await import("./extension-PM42QCID.js").then((m) => m.run(args));
84
+ await import("./extension-D74CNM7G.js").then((m) => m.run(args));
85
85
  break;
86
86
  case "systems":
87
- await import("./systems-AYLO727G.js").then((m) => m.run(args));
87
+ await import("./systems-O43WGQY6.js").then((m) => m.run(args));
88
88
  break;
89
89
  case "login":
90
- await import("./login-KZQLMAWE.js").then((m) => m.run(args));
90
+ await import("./login-7TE6CIZF.js").then((m) => m.run(args));
91
91
  break;
92
92
  case "logout":
93
- await import("./logout-AGTZVRGP.js").then((m) => m.run(args));
93
+ await import("./logout-T4XS6LRU.js").then((m) => m.run(args));
94
+ break;
95
+ case "service":
96
+ await import("./service-WNPCNHOX.js").then((m) => m.run(args));
94
97
  break;
95
98
  case "--help":
96
99
  case "-h":
@@ -133,7 +136,7 @@ System:
133
136
 
134
137
  Extensions:
135
138
  notes write/list/read/... Manage notes
136
- pages notify Notify page updates
139
+ pages publish/list/pull/log Manage pages
137
140
 
138
141
  Options:
139
142
  --version, -v Show version number
@@ -147,22 +150,80 @@ use --mind <name> or VOLUTE_MIND env var to identify the mind.`);
147
150
  default: {
148
151
  let isExtensionCommand = false;
149
152
  try {
150
- const { daemonFetch } = await import("./daemon-client-WOAQXXBM.js");
153
+ const { daemonFetch } = await import("./daemon-client-RVIKXGFQ.js");
151
154
  const res = await daemonFetch("/api/extensions/commands");
152
155
  if (res.ok) {
153
156
  const extCommands = await res.json();
154
157
  if (command && command in extCommands) {
155
158
  isExtensionCommand = true;
156
- const subcommand = args[0];
157
159
  const ext = extCommands[command];
158
- if (!subcommand || !(subcommand in ext.commands)) {
159
- console.log(`volute ${command} \u2014 ${Object.keys(ext.commands).join(", ")}
160
+ const subcommand = args[0];
161
+ const wantsHelp = args.includes("--help") || args.includes("-h");
162
+ if (!subcommand || wantsHelp && !(subcommand in ext.commands)) {
163
+ console.log(`Manage ${command}
164
+ `);
165
+ console.log(`Usage: volute ${command} <command> [options]
160
166
  `);
161
- for (const [name, meta] of Object.entries(ext.commands)) {
162
- console.log(` ${name.padEnd(12)} ${meta.description}`);
167
+ console.log("Commands:");
168
+ const entries = Object.entries(ext.commands);
169
+ const nameWidth = Math.max(...entries.map(([k]) => k.length));
170
+ for (const [name, meta] of entries) {
171
+ console.log(` ${name.padEnd(nameWidth + 2)} ${meta.description}`);
172
+ }
173
+ console.log(`
174
+ Use --mind <name> or VOLUTE_MIND to specify the mind.
175
+ `);
176
+ process.exit(subcommand ? 0 : 1);
177
+ }
178
+ if (wantsHelp && subcommand in ext.commands) {
179
+ const meta = ext.commands[subcommand];
180
+ const argParts = (meta.args ?? []).map(
181
+ (a) => a.required ? `<${a.name}>` : `[${a.name}]`
182
+ );
183
+ const flagEntries = Object.entries(meta.flags ?? {});
184
+ const flagPart = flagEntries.length > 0 ? " [options]" : "";
185
+ const argStr = argParts.length > 0 ? ` ${argParts.join(" ")}` : "";
186
+ console.log(`${meta.description}
187
+ `);
188
+ console.log(`Usage: volute ${command} ${subcommand}${argStr}${flagPart}
189
+ `);
190
+ if (meta.args && meta.args.length > 0) {
191
+ console.log("Arguments:");
192
+ const w = Math.max(...meta.args.map((a) => a.name.length + 2));
193
+ for (const a of meta.args) {
194
+ const label = a.required ? `<${a.name}>` : `[${a.name}]`;
195
+ console.log(` ${label.padEnd(w + 2)} ${a.description}`);
196
+ }
197
+ console.log("");
198
+ }
199
+ if (flagEntries.length > 0) {
200
+ console.log("Options:");
201
+ const w = Math.max(
202
+ ...flagEntries.map(([k, v]) => {
203
+ const hint = v.type === "boolean" ? "" : ` <${v.type === "string" ? "value" : "n"}>`;
204
+ return `--${k}${hint}`.length;
205
+ })
206
+ );
207
+ for (const [key, val] of flagEntries) {
208
+ const hint = val.type === "boolean" ? "" : ` <${val.type === "string" ? "value" : "n"}>`;
209
+ const flag = `--${key}${hint}`;
210
+ console.log(` ${flag.padEnd(w + 2)} ${val.description}`);
211
+ }
212
+ console.log("");
213
+ }
214
+ if (meta.examples && meta.examples.length > 0) {
215
+ console.log("Examples:");
216
+ for (const ex of meta.examples) {
217
+ console.log(` ${ex}`);
218
+ }
219
+ console.log("");
163
220
  }
164
221
  process.exit(0);
165
222
  }
223
+ if (!(subcommand in ext.commands)) {
224
+ console.error(`Unknown command: volute ${command} ${subcommand}`);
225
+ process.exit(1);
226
+ }
166
227
  const cmdArgs = args.slice(1);
167
228
  let mind = process.env.VOLUTE_MIND;
168
229
  const mindIdx = cmdArgs.indexOf("--mind");
@@ -170,7 +231,7 @@ use --mind <name> or VOLUTE_MIND env var to identify the mind.`);
170
231
  mind = cmdArgs[mindIdx + 1];
171
232
  cmdArgs.splice(mindIdx, 2);
172
233
  }
173
- const { readStdin } = await import("./read-stdin-PIRM6A2Y.js");
234
+ const { readStdin } = await import("./read-stdin-3X5VYKNS.js");
174
235
  const stdin = await readStdin();
175
236
  const cmdRes = await daemonFetch(`/api/ext/${command}/commands/${subcommand}`, {
176
237
  method: "POST",
@@ -203,7 +264,7 @@ Run 'volute --help' for usage.`);
203
264
  }
204
265
  }
205
266
  if (command !== "update") {
206
- import("./update-check-X3YG4WVP.js").then((m) => m.checkForUpdate()).then((result) => {
267
+ import("./update-check-UV55CBEP.js").then((m) => m.checkForUpdate()).then((result) => {
207
268
  if (result.updateAvailable) {
208
269
  console.error(`
209
270
  Update available: ${result.current} \u2192 ${result.latest}`);
@@ -0,0 +1,289 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ compactDateTime,
4
+ isCompact
5
+ } from "./chunk-5T5YMX6S.js";
6
+ import {
7
+ resolveMindName
8
+ } from "./chunk-BTY4WNFE.js";
9
+ import {
10
+ command,
11
+ subcommands
12
+ } from "./chunk-TXSA4Q3V.js";
13
+ import "./chunk-O7IGP7ZW.js";
14
+ import {
15
+ daemonFetch
16
+ } from "./chunk-ZX7EAV5J.js";
17
+ import {
18
+ getClient,
19
+ urlOf
20
+ } from "./chunk-LOPXTW6H.js";
21
+ import "./chunk-7KJOFUNN.js";
22
+
23
+ // packages/cli/src/commands/clock.ts
24
+ import { CronExpressionParser } from "cron-parser";
25
+ function parseDuration(input) {
26
+ const parts = input.match(/^(?:(\d+)h)?(?:(\d+)m)?(?:(\d+)s)?$/);
27
+ if (!parts || parts[0] !== input) return null;
28
+ const hours = parseInt(parts[1] || "0", 10);
29
+ const minutes = parseInt(parts[2] || "0", 10);
30
+ const seconds = parseInt(parts[3] || "0", 10);
31
+ const total = hours * 36e5 + minutes * 6e4 + seconds * 1e3;
32
+ return total > 0 ? total : null;
33
+ }
34
+ var clockStatusCmd = command({
35
+ name: "volute clock status",
36
+ description: "Show sleep state and upcoming events",
37
+ flags: {
38
+ mind: { type: "string", description: "Mind name" }
39
+ },
40
+ run: async ({ flags }) => {
41
+ const mind = resolveMindName(flags);
42
+ const client = getClient();
43
+ const res = await daemonFetch(
44
+ urlOf(client.api.minds[":name"].clock.status.$url({ param: { name: mind } }))
45
+ );
46
+ if (!res.ok) {
47
+ const data = await res.json();
48
+ console.error(data.error ?? `Failed to get clock status: ${res.status}`);
49
+ process.exit(1);
50
+ }
51
+ const status = await res.json();
52
+ const compact = isCompact();
53
+ const fmtTime = (s) => compact ? compactDateTime(s) : new Date(s).toLocaleString();
54
+ if (status.sleep?.sleeping) {
55
+ const since = status.sleep.sleepingSince ? fmtTime(status.sleep.sleepingSince) : "unknown";
56
+ console.log(`Sleep: sleeping since ${since}`);
57
+ if (status.sleep.scheduledWakeAt) {
58
+ console.log(` Wake at: ${fmtTime(status.sleep.scheduledWakeAt)}`);
59
+ }
60
+ if (status.sleep.voluntaryWakeAt) {
61
+ console.log(` Voluntary wake at: ${fmtTime(status.sleep.voluntaryWakeAt)}`);
62
+ }
63
+ if (status.sleep.queuedMessageCount > 0) {
64
+ console.log(` Queued messages: ${status.sleep.queuedMessageCount}`);
65
+ }
66
+ } else {
67
+ console.log("Sleep: awake");
68
+ }
69
+ if (status.sleepConfig?.enabled && status.sleepConfig.schedule) {
70
+ console.log(
71
+ ` Schedule: sleep ${status.sleepConfig.schedule.sleep}, wake ${status.sleepConfig.schedule.wake}`
72
+ );
73
+ }
74
+ if (status.upcoming.length > 0) {
75
+ if (!compact) console.log("");
76
+ console.log("Upcoming (next 24h):");
77
+ for (const u of status.upcoming) {
78
+ const time = fmtTime(u.at);
79
+ const label = u.type === "timer" ? "[timer]" : "[cron]";
80
+ console.log(` ${u.id.padEnd(20)} ${label} ${time}`);
81
+ }
82
+ } else {
83
+ if (!compact) console.log("");
84
+ console.log("No upcoming events in next 24h.");
85
+ }
86
+ if (!compact) {
87
+ console.log(`
88
+ ${status.schedules.length} schedule(s) configured.`);
89
+ }
90
+ }
91
+ });
92
+ var listSchedulesCmd = command({
93
+ name: "volute clock list",
94
+ description: "List schedules and timers",
95
+ flags: {
96
+ mind: { type: "string", description: "Mind name" }
97
+ },
98
+ run: async ({ flags }) => {
99
+ const mind = resolveMindName(flags);
100
+ const client = getClient();
101
+ const res = await daemonFetch(
102
+ urlOf(client.api.minds[":name"].schedules.$url({ param: { name: mind } }))
103
+ );
104
+ if (!res.ok) {
105
+ const data = await res.json();
106
+ console.error(data.error ?? `Failed to list schedules: ${res.status}`);
107
+ process.exit(1);
108
+ }
109
+ const schedules = await res.json();
110
+ if (schedules.length === 0) {
111
+ console.log("No schedules configured.");
112
+ return;
113
+ }
114
+ const actionLabel = (s) => s.script ? `[script] ${s.script}` : s.message ?? "";
115
+ if (isCompact()) {
116
+ for (const s of schedules) {
117
+ const sched = s.cron ?? (s.fireAt ? `at ${s.fireAt}` : "");
118
+ console.log(`${s.id} ${sched} ${actionLabel(s)}`);
119
+ }
120
+ } else {
121
+ const idW = Math.max(2, ...schedules.map((s) => s.id.length));
122
+ const schedW = Math.max(8, ...schedules.map((s) => (s.cron ?? s.fireAt ?? "").length));
123
+ console.log(`${"ID".padEnd(idW)} ${"SCHEDULE".padEnd(schedW)} ENABLED ACTION`);
124
+ for (const s of schedules) {
125
+ const sched = s.cron ?? (s.fireAt ? `at ${s.fireAt}` : "");
126
+ console.log(
127
+ `${s.id.padEnd(idW)} ${sched.padEnd(schedW)} ${String(s.enabled).padEnd(7)} ${actionLabel(s)}`
128
+ );
129
+ }
130
+ }
131
+ }
132
+ });
133
+ var addScheduleCmd = command({
134
+ name: "volute clock add",
135
+ description: "Add a schedule or timer",
136
+ flags: {
137
+ mind: { type: "string", description: "Mind name" },
138
+ cron: { type: "string", description: "Cron expression" },
139
+ in: { type: "string", description: "Duration (e.g. 30s, 10m, 1h)" },
140
+ message: { type: "string", description: "Message to send" },
141
+ script: { type: "string", description: "Script to run" },
142
+ id: { type: "string", description: "Schedule ID (required)" },
143
+ session: { type: "string", description: "Session name" },
144
+ "while-sleeping": {
145
+ type: "string",
146
+ description: "Behavior during sleep (skip, queue, trigger-wake)"
147
+ }
148
+ },
149
+ run: async ({ flags }) => {
150
+ const mind = resolveMindName(flags);
151
+ if (!flags.id) {
152
+ console.error("--id is required (a descriptive name for this schedule)");
153
+ process.exit(1);
154
+ }
155
+ if (!flags.cron && !flags.in) {
156
+ console.error("--cron or --in is required");
157
+ process.exit(1);
158
+ }
159
+ if (flags.cron && flags.in) {
160
+ console.error("--cron and --in are mutually exclusive");
161
+ process.exit(1);
162
+ }
163
+ if (!flags.message && !flags.script) {
164
+ console.error("--message or --script is required");
165
+ process.exit(1);
166
+ }
167
+ if (flags.message && flags.script) {
168
+ console.error("--message and --script are mutually exclusive");
169
+ process.exit(1);
170
+ }
171
+ const body = {};
172
+ if (flags.cron) {
173
+ try {
174
+ CronExpressionParser.parse(flags.cron);
175
+ } catch {
176
+ console.error(`Invalid cron expression: ${flags.cron}`);
177
+ process.exit(1);
178
+ }
179
+ body.cron = flags.cron;
180
+ }
181
+ if (flags.in) {
182
+ const durationMs = parseDuration(flags.in);
183
+ if (!durationMs) {
184
+ console.error(`Invalid duration: ${flags.in} (expected format: 30s, 10m, 1h, 2h30m)`);
185
+ process.exit(1);
186
+ }
187
+ body.fireAt = new Date(Date.now() + durationMs).toISOString();
188
+ }
189
+ if (flags.message) body.message = flags.message;
190
+ if (flags.script) body.script = flags.script;
191
+ if (flags.id) body.id = flags.id;
192
+ if (flags.session) body.session = flags.session;
193
+ if (flags["while-sleeping"]) {
194
+ const ws = flags["while-sleeping"];
195
+ if (!["skip", "queue", "trigger-wake"].includes(ws)) {
196
+ console.error(
197
+ `Invalid --while-sleeping value: ${ws} (must be skip, queue, or trigger-wake)`
198
+ );
199
+ process.exit(1);
200
+ }
201
+ body.whileSleeping = ws;
202
+ }
203
+ const client = getClient();
204
+ const res = await daemonFetch(
205
+ urlOf(client.api.minds[":name"].schedules.$url({ param: { name: mind } })),
206
+ {
207
+ method: "POST",
208
+ headers: { "Content-Type": "application/json" },
209
+ body: JSON.stringify(body)
210
+ }
211
+ );
212
+ if (!res.ok) {
213
+ const data2 = await res.json();
214
+ console.error(data2.error ?? `Failed to add schedule: ${res.status}`);
215
+ process.exit(1);
216
+ }
217
+ const data = await res.json();
218
+ if (flags.in) {
219
+ console.log(`Timer set: ${data.id} (fires in ${flags.in})`);
220
+ } else {
221
+ console.log(`Schedule added: ${data.id}`);
222
+ }
223
+ }
224
+ });
225
+ var removeScheduleCmd = command({
226
+ name: "volute clock remove",
227
+ description: "Remove a schedule or timer",
228
+ flags: {
229
+ mind: { type: "string", description: "Mind name" },
230
+ id: { type: "string", description: "Schedule ID (required)" }
231
+ },
232
+ run: async ({ flags }) => {
233
+ const mind = resolveMindName(flags);
234
+ if (!flags.id) {
235
+ console.error("--id is required");
236
+ process.exit(1);
237
+ }
238
+ const client = getClient();
239
+ const res = await daemonFetch(
240
+ urlOf(
241
+ client.api.minds[":name"].schedules[":id"].$url({
242
+ param: { name: mind, id: flags.id }
243
+ })
244
+ ),
245
+ { method: "DELETE" }
246
+ );
247
+ if (!res.ok) {
248
+ const data = await res.json();
249
+ console.error(data.error ?? `Failed to remove schedule: ${res.status}`);
250
+ process.exit(1);
251
+ }
252
+ console.log(`Schedule removed: ${flags.id}`);
253
+ }
254
+ });
255
+ var cmd = subcommands({
256
+ name: "volute clock",
257
+ description: "Manage schedules, timers, and sleep/wake cycles",
258
+ commands: {
259
+ status: {
260
+ description: "Show sleep state and upcoming schedule fires",
261
+ run: clockStatusCmd.execute
262
+ },
263
+ list: {
264
+ description: "List schedules and timers",
265
+ run: listSchedulesCmd.execute
266
+ },
267
+ add: {
268
+ description: "Add a schedule or timer",
269
+ run: addScheduleCmd.execute
270
+ },
271
+ remove: {
272
+ description: "Remove a schedule or timer",
273
+ run: removeScheduleCmd.execute
274
+ },
275
+ sleep: {
276
+ description: "Put a mind to sleep",
277
+ run: (args) => import("./mind-sleep-ITCF6OQA.js").then((m) => m.run(args))
278
+ },
279
+ wake: {
280
+ description: "Wake a sleeping mind",
281
+ run: (args) => import("./mind-wake-KXMKMGWX.js").then((m) => m.run(args))
282
+ }
283
+ },
284
+ footer: "Use --mind <name> or VOLUTE_MIND to identify the mind."
285
+ });
286
+ var run = cmd.execute;
287
+ export {
288
+ run
289
+ };
@@ -1,35 +1,34 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  deliverMessage
4
- } from "./chunk-TAHX36HZ.js";
5
- import "./chunk-CVL5IGIR.js";
6
- import "./chunk-B2BVAIZ4.js";
7
- import "./chunk-G53F3JA4.js";
8
- import "./chunk-N3DNFPVA.js";
9
- import "./chunk-OYAKCAVY.js";
10
- import "./chunk-V45JXOWY.js";
11
- import "./chunk-IS7WJ56Q.js";
12
- import "./chunk-BTWAGDV5.js";
13
- import "./chunk-M3K5AARV.js";
14
- import "./chunk-PB65JZK2.js";
15
- import "./chunk-BM474GX6.js";
4
+ } from "./chunk-WJPROOU5.js";
5
+ import "./chunk-5XJYUFZH.js";
6
+ import "./chunk-AOB6GVRM.js";
7
+ import "./chunk-IJHIXLVN.js";
8
+ import "./chunk-QWTR6AWZ.js";
9
+ import "./chunk-N446KRP7.js";
10
+ import "./chunk-QHG4OMZL.js";
11
+ import "./chunk-XRQSAMX2.js";
16
12
  import {
17
13
  getAuthHeaders,
18
14
  getWebhookUrl
19
- } from "./chunk-E5C7OWZ2.js";
20
- import "./chunk-XWXBJQBE.js";
21
- import "./chunk-BFWHBQK4.js";
15
+ } from "./chunk-WZRZFFCL.js";
16
+ import "./chunk-CORXD635.js";
17
+ import "./chunk-ZSR72JB3.js";
18
+ import "./chunk-PWQ2ITYG.js";
19
+ import "./chunk-A2ZLHBHG.js";
20
+ import "./chunk-FT5KETXZ.js";
22
21
  import {
23
22
  logger_default
24
- } from "./chunk-YUIHSKR6.js";
25
- import "./chunk-U5BTYSAL.js";
26
- import "./chunk-BDK73LK6.js";
27
- import "./chunk-6OWJXUAR.js";
28
- import "./chunk-N7BLAHNE.js";
29
- import "./chunk-4JSR7YO7.js";
23
+ } from "./chunk-BKF4WQCY.js";
24
+ import "./chunk-AN2W47GW.js";
25
+ import "./chunk-VHJRZM2S.js";
26
+ import "./chunk-BMZQYACC.js";
27
+ import "./chunk-BDYXIWA5.js";
28
+ import "./chunk-5N7Y5WAM.js";
30
29
  import "./chunk-7KJOFUNN.js";
31
30
 
32
- // src/lib/cloud-sync.ts
31
+ // packages/daemon/src/lib/cloud-sync.ts
33
32
  var slog = logger_default.child("cloud-sync");
34
33
  function getQueueUrl() {
35
34
  const base = getWebhookUrl();