volute 0.24.0 → 0.26.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 (114) hide show
  1. package/README.md +15 -20
  2. package/dist/{activity-events-4O37J7PD.js → activity-events-ZMBAKLUF.js} +2 -2
  3. package/dist/api.d.ts +590 -10
  4. package/dist/{auth-HM2RSPY7.js → auth-4TV573WE.js} +2 -2
  5. package/dist/{channel-HZOSHGNF.js → channel-ZVZV42UD.js} +3 -3
  6. package/dist/{chunk-NOBRGACV.js → chunk-2VO7453N.js} +56 -19
  7. package/dist/{chunk-OOW675I3.js → chunk-3CFRE2VC.js} +931 -775
  8. package/dist/{chunk-PHHKNGA3.js → chunk-3TV4GLFO.js} +2 -2
  9. package/dist/{chunk-4TJ72QQ3.js → chunk-5Y3PBKW6.js} +3 -3
  10. package/dist/{chunk-BFK6SOEJ.js → chunk-J2CO4WEV.js} +1 -1
  11. package/dist/{chunk-TQDITGES.js → chunk-LX22GRG7.js} +10 -13
  12. package/dist/{chunk-E7GOKNOT.js → chunk-NWI2425I.js} +1 -1
  13. package/dist/{chunk-2767L2RZ.js → chunk-OZFKBXD6.js} +1 -1
  14. package/dist/{chunk-XLC342FO.js → chunk-SIAG3QMM.js} +14 -1
  15. package/dist/{chunk-RVKR2R7F.js → chunk-SSI47XP2.js} +10 -2
  16. package/dist/chunk-TZKJLDQN.js +78 -0
  17. package/dist/{chunk-P3W36ZGD.js → chunk-USNBKHYG.js} +33 -5
  18. package/dist/chunk-UTL75LP6.js +113 -0
  19. package/dist/{chunk-3AIBT4TW.js → chunk-V63B7DX3.js} +24 -1
  20. package/dist/{chunk-33XAVCS4.js → chunk-WBHMQ5OZ.js} +49 -0
  21. package/dist/{chunk-TRQEV3CD.js → chunk-WGOGUMPO.js} +22 -3
  22. package/dist/chunk-XOXLRRR2.js +176 -0
  23. package/dist/{chunk-JTDFJWI2.js → chunk-YJA7P64S.js} +1 -1
  24. package/dist/chunk-ZYGKG6VC.js +22 -0
  25. package/dist/cli.js +44 -20
  26. package/dist/{cloud-sync-DIU3OCPV.js → cloud-sync-NI2K3C7G.js} +11 -9
  27. package/dist/{connector-M6XFI6GM.js → connector-G722WXAU.js} +4 -4
  28. package/dist/{create-VDQJER52.js → create-4YBRTTJS.js} +1 -1
  29. package/dist/{daemon-client-JOVQZ52X.js → daemon-client-Z7FAJ6JW.js} +1 -1
  30. package/dist/{daemon-restart-YMPEATQH.js → daemon-restart-BJZ3O4U4.js} +6 -5
  31. package/dist/daemon.js +982 -340
  32. package/dist/{delete-2MRR4JX5.js → delete-27OYNK25.js} +1 -1
  33. package/dist/{down-674SX2IZ.js → down-7UKFMJJZ.js} +4 -4
  34. package/dist/{env-2FPOZK37.js → env-M336ONDP.js} +4 -4
  35. package/dist/{export-IKFAPRAO.js → export-HP4G5DQC.js} +1 -1
  36. package/dist/{file-KT3UIQM3.js → file-HUDKTRAS.js} +3 -3
  37. package/dist/{history-46WZN5CN.js → history-B64GTFTD.js} +3 -3
  38. package/dist/{import-FRDPQPJ2.js → import-XIB7UV4S.js} +2 -2
  39. package/dist/{log-6SGSSR3D.js → log-PBFNILJ4.js} +3 -3
  40. package/dist/{login-UO6AOVEA.js → login-6U7U6BNG.js} +1 -1
  41. package/dist/login-B5E7N7MY.js +46 -0
  42. package/dist/logout-XSJRYS3U.js +39 -0
  43. package/dist/{logs-HRBONI5I.js → logs-3CART7O7.js} +3 -3
  44. package/dist/{merge-KSFJKX6T.js → merge-VK2HSKMA.js} +3 -3
  45. package/dist/{message-delivery-S7BCNV6Y.js → message-delivery-MS5JYPZX.js} +11 -9
  46. package/dist/{mind-KPLCRKQA.js → mind-HZ3QSDDJ.js} +17 -17
  47. package/dist/{mind-activity-tracker-NMDDEV3K.js → mind-activity-tracker-4G6FURY2.js} +3 -3
  48. package/dist/{mind-manager-ZNRIYEK3.js → mind-manager-VVK67AY3.js} +6 -4
  49. package/dist/{mind-sleep-GHPTSAYN.js → mind-sleep-DTV7L44D.js} +3 -3
  50. package/dist/{mind-wake-BJDJFMDF.js → mind-wake-PFN4FN3T.js} +3 -3
  51. package/dist/notes-37FW2UR2.js +230 -0
  52. package/dist/{package-S5YF25XV.js → package-VZWLXPHV.js} +3 -1
  53. package/dist/{pages-TWR6U7DS.js → pages-DIIT5HMQ.js} +1 -1
  54. package/dist/{publish-BZNHKUUK.js → publish-HQV7YREB.js} +4 -4
  55. package/dist/{pull-D32SPFVU.js → pull-2MB4SK3C.js} +3 -3
  56. package/dist/{register-U2UO6TC4.js → register-EFND67FQ.js} +1 -1
  57. package/dist/{restart-5BMNV7KU.js → restart-CCK7D6TV.js} +3 -3
  58. package/dist/sandbox-EHGFF52K.js +19 -0
  59. package/dist/{schedule-YEFDLVMJ.js → schedule-6F7ELB2M.js} +3 -3
  60. package/dist/{seed-6FEKB3YC.js → seed-E5OQGWX3.js} +1 -1
  61. package/dist/{send-IISDYFCL.js → send-IH6XZKPC.js} +6 -20
  62. package/dist/service-LLBV3R7M.js +122 -0
  63. package/dist/setup-F6TWFYGQ.js +371 -0
  64. package/dist/setup-YGAAIKKZ.js +17 -0
  65. package/dist/{shared-LWMNTTZN.js → shared-UMO4S7CC.js} +4 -4
  66. package/dist/{skill-BQOFACEI.js → skill-42LGFBQC.js} +13 -5
  67. package/dist/skills/dreaming/SKILL.md +68 -0
  68. package/dist/skills/dreaming/references/INSTALL.md +56 -0
  69. package/dist/skills/dreaming/scripts/dream.ts +289 -0
  70. package/dist/skills/dreaming/scripts/wake-context-dreams.sh +30 -0
  71. package/dist/skills/imagegen/SKILL.md +37 -0
  72. package/dist/skills/imagegen/references/INSTALL.md +13 -0
  73. package/dist/skills/imagegen/scripts/imagegen.ts +136 -0
  74. package/dist/skills/notes/SKILL.md +34 -0
  75. package/dist/skills/resonance/SKILL.md +73 -0
  76. package/dist/skills/resonance/assets/default-config.json +21 -0
  77. package/dist/skills/resonance/references/INSTALL.md +23 -0
  78. package/dist/skills/resonance/scripts/resonance.ts +1250 -0
  79. package/dist/skills/volute-mind/SKILL.md +23 -3
  80. package/dist/{sleep-manager-XXSWQQLE.js → sleep-manager-EE4NRN2Q.js} +11 -9
  81. package/dist/{sprout-CGSW4CF5.js → sprout-QL74KR2X.js} +5 -5
  82. package/dist/{start-C7XITZ5O.js → start-O5JQASRC.js} +3 -3
  83. package/dist/{status-SIRPLEZC.js → status-FZBEBM7Q.js} +3 -3
  84. package/dist/{status-LYS4NUOZ.js → status-WXD4HXRL.js} +3 -3
  85. package/dist/{stop-CVKBSLXY.js → stop-2SOG5NYF.js} +3 -3
  86. package/dist/up-SDMCSVI3.js +17 -0
  87. package/dist/{update-7XCZMYBT.js → update-5VUDAI3D.js} +6 -6
  88. package/dist/{upgrade-7RUIXGOO.js → upgrade-QCCO33BK.js} +1 -1
  89. package/dist/{variant-UGREB4G5.js → variant-WWLDY6D5.js} +4 -4
  90. package/dist/{version-notify-SZ75QRGO.js → version-notify-USFZBWMG.js} +11 -9
  91. package/dist/web-assets/assets/index-CUQ31ieL.js +69 -0
  92. package/dist/web-assets/assets/index-CW8NSl1o.css +1 -0
  93. package/dist/web-assets/favicon.png +0 -0
  94. package/dist/web-assets/index.html +5 -4
  95. package/dist/web-assets/logo.png +0 -0
  96. package/drizzle/0015_notes.sql +23 -0
  97. package/drizzle/0016_note_reactions_and_replies.sql +15 -0
  98. package/drizzle/meta/_journal.json +14 -0
  99. package/package.json +3 -1
  100. package/templates/_base/.init/.config/hooks/wake-context.sh +7 -0
  101. package/templates/_base/home/public/.gitkeep +0 -0
  102. package/templates/_base/src/lib/startup.ts +8 -0
  103. package/templates/claude/src/agent.ts +51 -1
  104. package/templates/claude/src/server.ts +1 -0
  105. package/templates/pi/package.json.tmpl +1 -0
  106. package/templates/pi/src/agent.ts +48 -1
  107. package/templates/pi/src/lib/subagents.ts +150 -0
  108. package/templates/pi/src/server.ts +1 -0
  109. package/dist/chunk-NWPT4ASZ.js +0 -89
  110. package/dist/service-FASYWLTC.js +0 -247
  111. package/dist/setup-BMLM2UTK.js +0 -230
  112. package/dist/up-OMHACRJL.js +0 -15
  113. package/dist/web-assets/assets/index-Bx9WDoaQ.js +0 -69
  114. package/dist/web-assets/assets/index-Clz8OhmJ.css +0 -1
@@ -13,7 +13,7 @@ async function run(args) {
13
13
  force: { type: "boolean" }
14
14
  });
15
15
  const name = resolveMindName({ mind: positional[0] });
16
- const { daemonFetch } = await import("./daemon-client-JOVQZ52X.js");
16
+ const { daemonFetch } = await import("./daemon-client-Z7FAJ6JW.js");
17
17
  const { getClient, urlOf } = await import("./api-client-YPKOZP2O.js");
18
18
  const client = getClient();
19
19
  const url = urlOf(client.api.minds[":name"].$url({ param: { name } })) + (flags.force ? "?force=true" : "");
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  run,
4
4
  stopDaemon
5
- } from "./chunk-2767L2RZ.js";
6
- import "./chunk-3AIBT4TW.js";
7
- import "./chunk-JTDFJWI2.js";
8
- import "./chunk-NWPT4ASZ.js";
5
+ } from "./chunk-OZFKBXD6.js";
6
+ import "./chunk-V63B7DX3.js";
7
+ import "./chunk-YJA7P64S.js";
8
+ import "./chunk-XOXLRRR2.js";
9
9
  import "./chunk-B2CPS4QU.js";
10
10
  import "./chunk-K3NQKI34.js";
11
11
  export {
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  promptLine
4
- } from "./chunk-RVKR2R7F.js";
4
+ } from "./chunk-SSI47XP2.js";
5
+ import {
6
+ daemonFetch
7
+ } from "./chunk-WGOGUMPO.js";
5
8
  import {
6
9
  getClient,
7
10
  urlOf
@@ -9,9 +12,6 @@ import {
9
12
  import {
10
13
  parseArgs
11
14
  } from "./chunk-D424ZQGI.js";
12
- import {
13
- daemonFetch
14
- } from "./chunk-TRQEV3CD.js";
15
15
  import "./chunk-B2CPS4QU.js";
16
16
  import "./chunk-K3NQKI34.js";
17
17
 
@@ -63,7 +63,7 @@ async function run(args) {
63
63
  });
64
64
  if (includeHistory) {
65
65
  try {
66
- const { daemonFetch } = await import("./daemon-client-JOVQZ52X.js");
66
+ const { daemonFetch } = await import("./daemon-client-Z7FAJ6JW.js");
67
67
  const { getClient, urlOf } = await import("./api-client-YPKOZP2O.js");
68
68
  const client = getClient();
69
69
  const res = await daemonFetch(
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-WGOGUMPO.js";
2
5
  import {
3
6
  resolveMindName
4
7
  } from "./chunk-NAOW2CLO.js";
5
8
  import {
6
9
  parseArgs
7
10
  } from "./chunk-D424ZQGI.js";
8
- import {
9
- daemonFetch
10
- } from "./chunk-TRQEV3CD.js";
11
11
  import "./chunk-B2CPS4QU.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-WGOGUMPO.js";
2
5
  import {
3
6
  getClient,
4
7
  urlOf
@@ -9,9 +12,6 @@ import {
9
12
  import {
10
13
  parseArgs
11
14
  } from "./chunk-D424ZQGI.js";
12
- import {
13
- daemonFetch
14
- } from "./chunk-TRQEV3CD.js";
15
15
  import "./chunk-B2CPS4QU.js";
16
16
  import "./chunk-K3NQKI34.js";
17
17
 
@@ -6,8 +6,8 @@ import {
6
6
  parseNameFromIdentity,
7
7
  run,
8
8
  sessionMatchesWorkspace
9
- } from "./chunk-4TJ72QQ3.js";
10
- import "./chunk-XLC342FO.js";
9
+ } from "./chunk-5Y3PBKW6.js";
10
+ import "./chunk-SIAG3QMM.js";
11
11
  import "./chunk-PHU4DEAJ.js";
12
12
  import "./chunk-D424ZQGI.js";
13
13
  import "./chunk-B2CPS4QU.js";
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-WGOGUMPO.js";
2
5
  import {
3
6
  resolveMindName
4
7
  } from "./chunk-NAOW2CLO.js";
5
8
  import {
6
9
  parseArgs
7
10
  } from "./chunk-D424ZQGI.js";
8
- import {
9
- daemonFetch
10
- } from "./chunk-TRQEV3CD.js";
11
11
  import "./chunk-B2CPS4QU.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-RWKVSSLY.js";
5
5
  import {
6
6
  promptLine
7
- } from "./chunk-RVKR2R7F.js";
7
+ } from "./chunk-SSI47XP2.js";
8
8
  import {
9
9
  readSystemsConfig,
10
10
  writeSystemsConfig
@@ -0,0 +1,46 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ promptLine,
4
+ promptPassword
5
+ } from "./chunk-SSI47XP2.js";
6
+ import {
7
+ daemonFetch
8
+ } from "./chunk-WGOGUMPO.js";
9
+ import {
10
+ voluteHome
11
+ } from "./chunk-B2CPS4QU.js";
12
+ import "./chunk-K3NQKI34.js";
13
+
14
+ // src/commands/login.ts
15
+ import { writeFileSync } from "fs";
16
+ import { resolve } from "path";
17
+ async function run(_args) {
18
+ const username = await promptLine("Username: ");
19
+ const password = await promptPassword("Password: ");
20
+ const res = await daemonFetch("/api/auth/login", {
21
+ method: "POST",
22
+ headers: { "Content-Type": "application/json" },
23
+ body: JSON.stringify({ username, password })
24
+ });
25
+ if (!res.ok) {
26
+ const data = await res.json().catch(() => ({}));
27
+ console.error(data.error || "Login failed");
28
+ process.exit(1);
29
+ }
30
+ const {
31
+ username: name,
32
+ role,
33
+ sessionId
34
+ } = await res.json();
35
+ const sessionPath = resolve(voluteHome(), "cli-session.json");
36
+ try {
37
+ writeFileSync(sessionPath, JSON.stringify({ sessionId, username: name }), { mode: 384 });
38
+ } catch (err) {
39
+ console.error(`Login succeeded but failed to save session: ${err.message}`);
40
+ process.exit(1);
41
+ }
42
+ console.log(`Logged in as ${name} (role: ${role})`);
43
+ }
44
+ export {
45
+ run
46
+ };
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-WGOGUMPO.js";
5
+ import {
6
+ voluteHome
7
+ } from "./chunk-B2CPS4QU.js";
8
+ import "./chunk-K3NQKI34.js";
9
+
10
+ // src/commands/logout.ts
11
+ import { existsSync, readFileSync, unlinkSync } from "fs";
12
+ import { resolve } from "path";
13
+ async function run(_args) {
14
+ const sessionPath = resolve(voluteHome(), "cli-session.json");
15
+ if (!existsSync(sessionPath)) {
16
+ console.log("Not logged in");
17
+ return;
18
+ }
19
+ let sessionId;
20
+ try {
21
+ const data = JSON.parse(readFileSync(sessionPath, "utf-8"));
22
+ sessionId = data.sessionId;
23
+ } catch {
24
+ }
25
+ if (sessionId) {
26
+ try {
27
+ await daemonFetch("/api/auth/logout", {
28
+ method: "POST",
29
+ headers: { Authorization: `Bearer ${sessionId}` }
30
+ });
31
+ } catch {
32
+ }
33
+ }
34
+ unlinkSync(sessionPath);
35
+ console.log("Logged out");
36
+ }
37
+ export {
38
+ run
39
+ };
@@ -1,4 +1,7 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-WGOGUMPO.js";
2
5
  import {
3
6
  getClient,
4
7
  urlOf
@@ -9,9 +12,6 @@ import {
9
12
  import {
10
13
  parseArgs
11
14
  } from "./chunk-D424ZQGI.js";
12
- import {
13
- daemonFetch
14
- } from "./chunk-TRQEV3CD.js";
15
15
  import "./chunk-B2CPS4QU.js";
16
16
  import "./chunk-K3NQKI34.js";
17
17
 
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-WGOGUMPO.js";
2
5
  import {
3
6
  resolveMindName
4
7
  } from "./chunk-NAOW2CLO.js";
5
8
  import {
6
9
  parseArgs
7
10
  } from "./chunk-D424ZQGI.js";
8
- import {
9
- daemonFetch
10
- } from "./chunk-TRQEV3CD.js";
11
11
  import "./chunk-B2CPS4QU.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
@@ -3,17 +3,19 @@ import {
3
3
  deliverMessage,
4
4
  extractTextContent,
5
5
  recordInbound
6
- } from "./chunk-OOW675I3.js";
6
+ } from "./chunk-3CFRE2VC.js";
7
7
  import "./chunk-HFCBO2GL.js";
8
- import "./chunk-E7GOKNOT.js";
9
- import "./chunk-BFK6SOEJ.js";
10
- import "./chunk-NOBRGACV.js";
11
- import "./chunk-XLC342FO.js";
12
- import "./chunk-PHU4DEAJ.js";
13
- import "./chunk-33XAVCS4.js";
8
+ import "./chunk-NWI2425I.js";
9
+ import "./chunk-J2CO4WEV.js";
10
+ import "./chunk-2VO7453N.js";
11
+ import "./chunk-UTL75LP6.js";
12
+ import "./chunk-WBHMQ5OZ.js";
14
13
  import "./chunk-YUIHSKR6.js";
15
- import "./chunk-JTDFJWI2.js";
16
- import "./chunk-NWPT4ASZ.js";
14
+ import "./chunk-SIAG3QMM.js";
15
+ import "./chunk-PHU4DEAJ.js";
16
+ import "./chunk-YJA7P64S.js";
17
+ import "./chunk-XOXLRRR2.js";
18
+ import "./chunk-TZKJLDQN.js";
17
19
  import "./chunk-B2CPS4QU.js";
18
20
  import "./chunk-K3NQKI34.js";
19
21
  export {
@@ -6,63 +6,63 @@ async function run(args) {
6
6
  const subcommand = args[0];
7
7
  switch (subcommand) {
8
8
  case "create":
9
- await import("./create-VDQJER52.js").then((m) => m.run(args.slice(1)));
9
+ await import("./create-4YBRTTJS.js").then((m) => m.run(args.slice(1)));
10
10
  break;
11
11
  case "start":
12
- await import("./start-C7XITZ5O.js").then((m) => m.run(args.slice(1)));
12
+ await import("./start-O5JQASRC.js").then((m) => m.run(args.slice(1)));
13
13
  break;
14
14
  case "stop":
15
- await import("./stop-CVKBSLXY.js").then((m) => m.run(args.slice(1)));
15
+ await import("./stop-2SOG5NYF.js").then((m) => m.run(args.slice(1)));
16
16
  break;
17
17
  case "restart":
18
- await import("./restart-5BMNV7KU.js").then((m) => m.run(args.slice(1)));
18
+ await import("./restart-CCK7D6TV.js").then((m) => m.run(args.slice(1)));
19
19
  break;
20
20
  case "delete":
21
- await import("./delete-2MRR4JX5.js").then((m) => m.run(args.slice(1)));
21
+ await import("./delete-27OYNK25.js").then((m) => m.run(args.slice(1)));
22
22
  break;
23
23
  case "list":
24
- await import("./status-SIRPLEZC.js").then((m) => m.run(args.slice(1)));
24
+ await import("./status-FZBEBM7Q.js").then((m) => m.run(args.slice(1)));
25
25
  break;
26
26
  case "status": {
27
27
  const rest = args.slice(1);
28
28
  if (!rest[0] && process.env.VOLUTE_MIND) {
29
29
  rest.unshift(process.env.VOLUTE_MIND);
30
30
  }
31
- await import("./status-SIRPLEZC.js").then((m) => m.run(rest));
31
+ await import("./status-FZBEBM7Q.js").then((m) => m.run(rest));
32
32
  break;
33
33
  }
34
34
  case "logs": {
35
35
  const rest = args.slice(1);
36
36
  const logsArgs = transformMindFlag(rest);
37
- await import("./logs-HRBONI5I.js").then((m) => m.run(logsArgs));
37
+ await import("./logs-3CART7O7.js").then((m) => m.run(logsArgs));
38
38
  break;
39
39
  }
40
40
  case "upgrade":
41
- await import("./upgrade-7RUIXGOO.js").then((m) => m.run(args.slice(1)));
41
+ await import("./upgrade-QCCO33BK.js").then((m) => m.run(args.slice(1)));
42
42
  break;
43
43
  case "import":
44
- await import("./import-FRDPQPJ2.js").then((m) => m.run(args.slice(1)));
44
+ await import("./import-XIB7UV4S.js").then((m) => m.run(args.slice(1)));
45
45
  break;
46
46
  case "export":
47
- await import("./export-IKFAPRAO.js").then((m) => m.run(args.slice(1)));
47
+ await import("./export-HP4G5DQC.js").then((m) => m.run(args.slice(1)));
48
48
  break;
49
49
  case "connect":
50
- await import("./connector-M6XFI6GM.js").then((m) => m.run(["connect", ...args.slice(1)]));
50
+ await import("./connector-G722WXAU.js").then((m) => m.run(["connect", ...args.slice(1)]));
51
51
  break;
52
52
  case "disconnect":
53
- await import("./connector-M6XFI6GM.js").then((m) => m.run(["disconnect", ...args.slice(1)]));
53
+ await import("./connector-G722WXAU.js").then((m) => m.run(["disconnect", ...args.slice(1)]));
54
54
  break;
55
55
  case "seed":
56
- await import("./seed-6FEKB3YC.js").then((m) => m.run(args.slice(1)));
56
+ await import("./seed-E5OQGWX3.js").then((m) => m.run(args.slice(1)));
57
57
  break;
58
58
  case "sprout":
59
- await import("./sprout-CGSW4CF5.js").then((m) => m.run(args.slice(1)));
59
+ await import("./sprout-QL74KR2X.js").then((m) => m.run(args.slice(1)));
60
60
  break;
61
61
  case "sleep":
62
- await import("./mind-sleep-GHPTSAYN.js").then((m) => m.run(args.slice(1)));
62
+ await import("./mind-sleep-DTV7L44D.js").then((m) => m.run(args.slice(1)));
63
63
  break;
64
64
  case "wake":
65
- await import("./mind-wake-BJDJFMDF.js").then((m) => m.run(args.slice(1)));
65
+ await import("./mind-wake-PFN4FN3T.js").then((m) => m.run(args.slice(1)));
66
66
  break;
67
67
  case "--help":
68
68
  case "-h":
@@ -4,9 +4,9 @@ import {
4
4
  markIdle,
5
5
  onMindEvent,
6
6
  stopAll
7
- } from "./chunk-E7GOKNOT.js";
8
- import "./chunk-BFK6SOEJ.js";
9
- import "./chunk-33XAVCS4.js";
7
+ } from "./chunk-NWI2425I.js";
8
+ import "./chunk-J2CO4WEV.js";
9
+ import "./chunk-WBHMQ5OZ.js";
10
10
  import "./chunk-YUIHSKR6.js";
11
11
  import "./chunk-B2CPS4QU.js";
12
12
  import "./chunk-K3NQKI34.js";
@@ -3,11 +3,13 @@ import {
3
3
  MindManager,
4
4
  getMindManager,
5
5
  initMindManager
6
- } from "./chunk-NOBRGACV.js";
7
- import "./chunk-PHU4DEAJ.js";
8
- import "./chunk-33XAVCS4.js";
6
+ } from "./chunk-2VO7453N.js";
7
+ import "./chunk-UTL75LP6.js";
8
+ import "./chunk-WBHMQ5OZ.js";
9
9
  import "./chunk-YUIHSKR6.js";
10
- import "./chunk-NWPT4ASZ.js";
10
+ import "./chunk-PHU4DEAJ.js";
11
+ import "./chunk-XOXLRRR2.js";
12
+ import "./chunk-TZKJLDQN.js";
11
13
  import "./chunk-B2CPS4QU.js";
12
14
  import "./chunk-K3NQKI34.js";
13
15
  export {
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-WGOGUMPO.js";
2
5
  import {
3
6
  resolveMindName
4
7
  } from "./chunk-NAOW2CLO.js";
5
8
  import {
6
9
  parseArgs
7
10
  } from "./chunk-D424ZQGI.js";
8
- import {
9
- daemonFetch
10
- } from "./chunk-TRQEV3CD.js";
11
11
  import "./chunk-B2CPS4QU.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-WGOGUMPO.js";
2
5
  import {
3
6
  resolveMindName
4
7
  } from "./chunk-NAOW2CLO.js";
5
8
  import {
6
9
  parseArgs
7
10
  } from "./chunk-D424ZQGI.js";
8
- import {
9
- daemonFetch
10
- } from "./chunk-TRQEV3CD.js";
11
11
  import "./chunk-B2CPS4QU.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
@@ -0,0 +1,230 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ readStdin
4
+ } from "./chunk-ZYGKG6VC.js";
5
+ import {
6
+ daemonFetch
7
+ } from "./chunk-WGOGUMPO.js";
8
+ import {
9
+ parseArgs
10
+ } from "./chunk-D424ZQGI.js";
11
+ import "./chunk-B2CPS4QU.js";
12
+ import "./chunk-K3NQKI34.js";
13
+
14
+ // src/commands/notes.ts
15
+ function apiUrl(path) {
16
+ return `/api/notes${path}`;
17
+ }
18
+ async function list(args) {
19
+ const { flags } = parseArgs(args, {
20
+ author: { type: "string" },
21
+ limit: { type: "number" },
22
+ mind: { type: "string" }
23
+ });
24
+ const params = new URLSearchParams();
25
+ if (flags.author) params.set("author", flags.author);
26
+ if (flags.limit) params.set("limit", String(flags.limit));
27
+ const res = await daemonFetch(`${apiUrl("")}?${params}`);
28
+ if (!res.ok) {
29
+ const data = await res.json().catch(() => ({ error: "Unknown error" }));
30
+ console.error(data.error);
31
+ process.exit(1);
32
+ }
33
+ const notes = await res.json();
34
+ if (notes.length === 0) {
35
+ console.log("No notes yet.");
36
+ return;
37
+ }
38
+ for (const note of notes) {
39
+ const date = new Date(note.created_at).toLocaleDateString();
40
+ const comments = note.comment_count > 0 ? ` (${note.comment_count} comments)` : "";
41
+ const replyIndicator = note.reply_to ? ` \u21A9 ${note.reply_to.author_username}/${note.reply_to.slug}` : "";
42
+ const reactions = note.reactions && note.reactions.length > 0 ? ` ${note.reactions.map((r) => `${r.emoji} ${r.count}`).join(" ")}` : "";
43
+ console.log(
44
+ ` ${note.author_username}/${note.slug} ${note.title} ${date}${comments}${replyIndicator}${reactions}`
45
+ );
46
+ }
47
+ }
48
+ async function write(args) {
49
+ const { flags } = parseArgs(args, {
50
+ title: { type: "string" },
51
+ content: { type: "string" },
52
+ mind: { type: "string" },
53
+ "reply-to": { type: "string" }
54
+ });
55
+ if (!flags.title) {
56
+ console.error(
57
+ 'Usage: volute notes write --title "..." [--content "..." | stdin] [--reply-to <author>/<slug>]'
58
+ );
59
+ process.exit(1);
60
+ }
61
+ const content = flags.content ?? await readStdin();
62
+ if (!content) {
63
+ console.error("Content required via --content or stdin");
64
+ process.exit(1);
65
+ }
66
+ const asUser = process.env.VOLUTE_MIND ?? flags.mind;
67
+ const params = asUser ? `?as=${encodeURIComponent(asUser)}` : "";
68
+ const body = { title: flags.title, content };
69
+ if (flags["reply-to"]) body.reply_to = flags["reply-to"];
70
+ const res = await daemonFetch(`${apiUrl("")}${params}`, {
71
+ method: "POST",
72
+ headers: { "Content-Type": "application/json" },
73
+ body: JSON.stringify(body)
74
+ });
75
+ if (!res.ok) {
76
+ const data = await res.json().catch(() => ({ error: "Unknown error" }));
77
+ console.error(data.error);
78
+ process.exit(1);
79
+ }
80
+ const note = await res.json();
81
+ console.log(`Published: ${note.author_username}/${note.slug}`);
82
+ }
83
+ async function read(args) {
84
+ const { positional } = parseArgs(args, { mind: { type: "string" } });
85
+ const ref = positional[0];
86
+ if (!ref || !ref.includes("/")) {
87
+ console.error("Usage: volute notes read <author>/<slug>");
88
+ process.exit(1);
89
+ }
90
+ const [author, slug] = ref.split("/", 2);
91
+ const res = await daemonFetch(apiUrl(`/${author}/${slug}`));
92
+ if (!res.ok) {
93
+ const data = await res.json().catch(() => ({ error: "Unknown error" }));
94
+ console.error(data.error);
95
+ process.exit(1);
96
+ }
97
+ const note = await res.json();
98
+ console.log(`
99
+ ${note.title}`);
100
+ console.log(` by ${note.author_username} \xB7 ${new Date(note.created_at).toLocaleDateString()}`);
101
+ if (note.reply_to) {
102
+ console.log(
103
+ ` In reply to: ${note.reply_to.author_username}/${note.reply_to.slug} \u2014 ${note.reply_to.title}`
104
+ );
105
+ }
106
+ console.log("");
107
+ console.log(note.content);
108
+ if (note.reactions && note.reactions.length > 0) {
109
+ console.log(`
110
+ ${note.reactions.map((r) => `${r.emoji} ${r.count}`).join(" ")}`);
111
+ }
112
+ if (note.comments && note.comments.length > 0) {
113
+ console.log(`
114
+ --- Comments (${note.comments.length}) ---
115
+ `);
116
+ for (const c of note.comments) {
117
+ const date = new Date(c.created_at).toLocaleDateString();
118
+ console.log(` ${c.author_username} (${date}):`);
119
+ console.log(` ${c.content}
120
+ `);
121
+ }
122
+ }
123
+ if (note.replies && note.replies.length > 0) {
124
+ console.log(`
125
+ --- Replies (${note.replies.length}) ---
126
+ `);
127
+ for (const r of note.replies) {
128
+ const date = new Date(r.created_at).toLocaleDateString();
129
+ console.log(` ${r.author_username}/${r.slug} ${r.title} ${date}`);
130
+ }
131
+ }
132
+ }
133
+ async function react(args) {
134
+ const { positional, flags } = parseArgs(args, { mind: { type: "string" } });
135
+ const ref = positional[0];
136
+ const emoji = positional[1];
137
+ if (!ref || !ref.includes("/") || !emoji) {
138
+ console.error("Usage: volute notes react <author>/<slug> <emoji>");
139
+ process.exit(1);
140
+ }
141
+ const [author, slug] = ref.split("/", 2);
142
+ const asUser = process.env.VOLUTE_MIND ?? flags.mind;
143
+ const params = asUser ? `?as=${encodeURIComponent(asUser)}` : "";
144
+ const res = await daemonFetch(`${apiUrl(`/${author}/${slug}/reactions`)}${params}`, {
145
+ method: "POST",
146
+ headers: { "Content-Type": "application/json" },
147
+ body: JSON.stringify({ emoji })
148
+ });
149
+ if (!res.ok) {
150
+ const data = await res.json().catch(() => ({ error: "Unknown error" }));
151
+ console.error(data.error);
152
+ process.exit(1);
153
+ }
154
+ const result = await res.json();
155
+ console.log(result.added ? `Reacted with ${emoji}` : `Removed ${emoji} reaction`);
156
+ }
157
+ async function comment(args) {
158
+ const { positional, flags } = parseArgs(args, { mind: { type: "string" } });
159
+ const ref = positional[0];
160
+ const text = positional[1] ?? await readStdin();
161
+ if (!ref || !ref.includes("/") || !text) {
162
+ console.error('Usage: volute notes comment <author>/<slug> "comment text"');
163
+ process.exit(1);
164
+ }
165
+ const [author, slug] = ref.split("/", 2);
166
+ const asUser = process.env.VOLUTE_MIND ?? flags.mind;
167
+ const params = asUser ? `?as=${encodeURIComponent(asUser)}` : "";
168
+ const res = await daemonFetch(`${apiUrl(`/${author}/${slug}/comments`)}${params}`, {
169
+ method: "POST",
170
+ headers: { "Content-Type": "application/json" },
171
+ body: JSON.stringify({ content: text })
172
+ });
173
+ if (!res.ok) {
174
+ const data = await res.json().catch(() => ({ error: "Unknown error" }));
175
+ console.error(data.error);
176
+ process.exit(1);
177
+ }
178
+ console.log("Comment added.");
179
+ }
180
+ async function del(args) {
181
+ const { positional, flags } = parseArgs(args, { mind: { type: "string" } });
182
+ const ref = positional[0];
183
+ if (!ref || !ref.includes("/")) {
184
+ console.error("Usage: volute notes delete <author>/<slug>");
185
+ process.exit(1);
186
+ }
187
+ const [author, slug] = ref.split("/", 2);
188
+ const asUser = process.env.VOLUTE_MIND ?? flags.mind;
189
+ const params = asUser ? `?as=${encodeURIComponent(asUser)}` : "";
190
+ const res = await daemonFetch(`${apiUrl(`/${author}/${slug}`)}${params}`, {
191
+ method: "DELETE"
192
+ });
193
+ if (!res.ok) {
194
+ const data = await res.json().catch(() => ({ error: "Unknown error" }));
195
+ console.error(data.error);
196
+ process.exit(1);
197
+ }
198
+ console.log("Note deleted.");
199
+ }
200
+ async function run(args) {
201
+ const subcommand = args[0];
202
+ const rest = args.slice(1);
203
+ switch (subcommand) {
204
+ case "list":
205
+ return list(rest);
206
+ case "write":
207
+ return write(rest);
208
+ case "read":
209
+ return read(rest);
210
+ case "react":
211
+ return react(rest);
212
+ case "comment":
213
+ return comment(rest);
214
+ case "delete":
215
+ return del(rest);
216
+ default:
217
+ console.log(`volute notes \u2014 read and write notes
218
+
219
+ list [--author <name>] [--limit N] List notes
220
+ write --title "..." [--content "..."] [--reply-to ref] Write a note (content from --content or stdin)
221
+ read <author>/<slug> Read a note
222
+ react <author>/<slug> <emoji> Toggle a reaction on a note
223
+ comment <author>/<slug> "text" Comment on a note
224
+ delete <author>/<slug> Delete a note`);
225
+ if (subcommand && subcommand !== "--help" && subcommand !== "-h") process.exit(1);
226
+ }
227
+ }
228
+ export {
229
+ run
230
+ };