volute 0.25.0 → 0.27.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 (145) hide show
  1. package/README.md +28 -33
  2. package/dist/{activity-events-4O37J7PD.js → activity-events-BBIEA2F4.js} +2 -3
  3. package/dist/api.d.ts +886 -220
  4. package/dist/{archive-4ZQYK5MN.js → archive-UA4BDFXQ.js} +2 -2
  5. package/dist/{auth-HM2RSPY7.js → auth-D3OT2ARB.js} +3 -3
  6. package/dist/bridge-FQHZL3MC.js +206 -0
  7. package/dist/chat-MHJ3L6JQ.js +58 -0
  8. package/dist/{chunk-PHU4DEAJ.js → chunk-2WPW7OT6.js} +3 -3
  9. package/dist/{chunk-BOTQ25QT.js → chunk-2YP2TVDT.js} +138 -56
  10. package/dist/{chunk-DG7TO7EE.js → chunk-4WXYUOAK.js} +5 -7
  11. package/dist/{chunk-JTDFJWI2.js → chunk-AW7PFDVN.js} +5 -5
  12. package/dist/{chunk-2767L2RZ.js → chunk-EHYDTZTF.js} +6 -6
  13. package/dist/{chunk-ZSH4G2P5.js → chunk-GIE6CSN5.js} +17 -17
  14. package/dist/chunk-H7OZRFJB.js +432 -0
  15. package/dist/{chunk-ON3FF5JA.js → chunk-HDN7MNGD.js} +3 -3
  16. package/dist/chunk-IAYBDWVG.js +477 -0
  17. package/dist/chunk-IKRVFPWU.js +83 -0
  18. package/dist/{chunk-TRQEV3CD.js → chunk-JGFVMROS.js} +32 -6
  19. package/dist/{chunk-PHHKNGA3.js → chunk-JKOWNZ4P.js} +3 -3
  20. package/dist/{chunk-E7GOKNOT.js → chunk-K5NAC55T.js} +1 -1
  21. package/dist/{chunk-HFCBO2GL.js → chunk-KDGS53OS.js} +4 -4
  22. package/dist/chunk-KTLFDYPT.js +61 -0
  23. package/dist/{chunk-3AIBT4TW.js → chunk-LAC664WU.js} +30 -4
  24. package/dist/{chunk-PMX4EIJK.js → chunk-OQZH4PBB.js} +467 -1054
  25. package/dist/{chunk-SHSWYG2J.js → chunk-PHSAT7YL.js} +71 -58
  26. package/dist/chunk-RKQEHRBB.js +177 -0
  27. package/dist/{chunk-RVKR2R7F.js → chunk-SSI47XP2.js} +10 -2
  28. package/dist/chunk-T6HKBWXZ.js +23 -0
  29. package/dist/chunk-USUXRNVD.js +113 -0
  30. package/dist/{chunk-BFK6SOEJ.js → chunk-VIVMW2H2.js} +4 -4
  31. package/dist/{chunk-KTJGZ7M7.js → chunk-XBLSAVJF.js} +1 -1
  32. package/dist/chunk-ZYGKG6VC.js +22 -0
  33. package/dist/cli.js +51 -32
  34. package/dist/{cloud-sync-PPBBJDY6.js → cloud-sync-T7M3ESC3.js} +15 -12
  35. package/dist/connectors/discord-bridge.js +158 -0
  36. package/dist/connectors/slack-bridge.js +119 -0
  37. package/dist/connectors/telegram-bridge.js +133 -0
  38. package/dist/conversations-M2K4253F.js +55 -0
  39. package/dist/create-D7J73A6H.js +45 -0
  40. package/dist/{create-VDQJER52.js → create-QWV73WXD.js} +1 -1
  41. package/dist/{daemon-client-JOVQZ52X.js → daemon-client-I42FK2BF.js} +2 -2
  42. package/dist/{daemon-restart-FDNOZEAD.js → daemon-restart-M2QTYMEG.js} +7 -6
  43. package/dist/daemon.js +2247 -1085
  44. package/dist/db-IC4J52XQ.js +8 -0
  45. package/dist/{delete-2MRR4JX5.js → delete-4JYGD4VN.js} +1 -1
  46. package/dist/down-LVBXEULC.js +14 -0
  47. package/dist/{env-2FPOZK37.js → env-YJMUMFIY.js} +5 -5
  48. package/dist/{export-IKFAPRAO.js → export-BOJQWBMA.js} +4 -4
  49. package/dist/{file-KT3UIQM3.js → file-CR36YUPD.js} +4 -4
  50. package/dist/{history-46WZN5CN.js → history-XKRTAFS2.js} +7 -7
  51. package/dist/{import-TH26J76F.js → import-SRTQXBGH.js} +4 -4
  52. package/dist/join-J4QU42DL.js +66 -0
  53. package/dist/list-R73GENNL.js +40 -0
  54. package/dist/{log-6SGSSR3D.js → log-ABYNVYJ3.js} +4 -4
  55. package/dist/login-3QZNR2DF.js +46 -0
  56. package/dist/{login-UO6AOVEA.js → login-XX37I52P.js} +3 -3
  57. package/dist/logout-T53VKCPU.js +39 -0
  58. package/dist/{logout-UKD5LA37.js → logout-W4KOOBIT.js} +2 -2
  59. package/dist/{logs-HRBONI5I.js → logs-U35JR2KE.js} +7 -7
  60. package/dist/{merge-KSFJKX6T.js → merge-LNSMSAOF.js} +4 -4
  61. package/dist/message-delivery-LDXLGERA.js +25 -0
  62. package/dist/migrate-registry-to-db-XC7T5B7P.js +110 -0
  63. package/dist/{mind-YVWAHL2A.js → mind-DI33C74K.js} +25 -25
  64. package/dist/{mind-activity-tracker-NMDDEV3K.js → mind-activity-tracker-EN6XNXPF.js} +3 -4
  65. package/dist/{mind-manager-4NDNAYAB.js → mind-manager-M6EMUW5I.js} +6 -5
  66. package/dist/{mind-sleep-GHPTSAYN.js → mind-sleep-BTSWQNAC.js} +4 -4
  67. package/dist/{mind-wake-BJDJFMDF.js → mind-wake-SBAKIDVP.js} +4 -4
  68. package/dist/notes-XCER3I7M.js +220 -0
  69. package/dist/{package-3HF5MXU2.js → package-7WY6VKU3.js} +2 -1
  70. package/dist/{pages-Y6DRWUOJ.js → pages-6EBS6CBR.js} +2 -2
  71. package/dist/{publish-EEKTZBHW.js → publish-66UB2ZFY.js} +5 -5
  72. package/dist/{pull-D32SPFVU.js → pull-XCHJTM5M.js} +4 -4
  73. package/dist/read-36UFXN3G.js +46 -0
  74. package/dist/{register-U2UO6TC4.js → register-6B2CXTYM.js} +3 -3
  75. package/dist/{registry-D2BSQ2X5.js → registry-NDNOOYG4.js} +15 -9
  76. package/dist/{restart-5BMNV7KU.js → restart-6ESL3NBO.js} +6 -6
  77. package/dist/sandbox-TGBX22DS.js +19 -0
  78. package/dist/{schedule-YEFDLVMJ.js → schedule-QTJMFATP.js} +7 -7
  79. package/dist/{seed-6FEKB3YC.js → seed-SSUCYYDF.js} +2 -2
  80. package/dist/{send-IISDYFCL.js → send-ZNCJDSRP.js} +28 -36
  81. package/dist/service-6LIN3F3K.js +122 -0
  82. package/dist/setup-JG4QAEBV.js +371 -0
  83. package/dist/setup-JHL5ZEST.js +17 -0
  84. package/dist/{shared-LWMNTTZN.js → shared-ML5I4Q2A.js} +4 -4
  85. package/dist/{skill-T3EMR6IR.js → skill-AUAQTSP5.js} +7 -7
  86. package/dist/skills/dreaming/SKILL.md +68 -0
  87. package/dist/skills/dreaming/references/INSTALL.md +56 -0
  88. package/dist/skills/dreaming/scripts/dream.ts +289 -0
  89. package/dist/skills/dreaming/scripts/wake-context-dreams.sh +30 -0
  90. package/dist/skills/notes/SKILL.md +34 -0
  91. package/dist/skills/orientation/SKILL.md +3 -3
  92. package/dist/skills/volute-mind/SKILL.md +32 -30
  93. package/dist/sleep-manager-MWYHM5HV.js +29 -0
  94. package/dist/split-TKJ5OT3P.js +63 -0
  95. package/dist/{sprout-QJVGJDSH.js → sprout-IJVVKSJ2.js} +6 -7
  96. package/dist/{start-C7XITZ5O.js → start-EUJSS5R4.js} +4 -4
  97. package/dist/{status-SIRPLEZC.js → status-77YEPHMW.js} +5 -5
  98. package/dist/{status-LYS4NUOZ.js → status-7GA4SM4Y.js} +4 -4
  99. package/dist/{status-LV34BG6G.js → status-THLOBLWG.js} +2 -2
  100. package/dist/{stop-CVKBSLXY.js → stop-3XAITBBF.js} +6 -6
  101. package/dist/{tailscale-AJ4VL5XK.js → tailscale-NY5MUMY3.js} +1 -1
  102. package/dist/up-NKSMXBWR.js +17 -0
  103. package/dist/{update-7XCZMYBT.js → update-PTSH22AZ.js} +11 -11
  104. package/dist/{update-check-F5Z3ALXX.js → update-check-64FWC4Y2.js} +2 -2
  105. package/dist/{upgrade-7RUIXGOO.js → upgrade-HA47CS4C.js} +12 -5
  106. package/dist/variant-7TGZHOU3.js +41 -0
  107. package/dist/{version-notify-AZQMC32A.js → version-notify-5Z4MNR6M.js} +26 -28
  108. package/dist/web-assets/assets/index-CI5wgghI.css +1 -0
  109. package/dist/web-assets/assets/index-is5CvJWH.js +75 -0
  110. package/dist/web-assets/favicon.png +0 -0
  111. package/dist/web-assets/index.html +2 -2
  112. package/drizzle/0015_notes.sql +23 -0
  113. package/drizzle/0016_note_reactions_and_replies.sql +15 -0
  114. package/drizzle/0017_minds.sql +16 -0
  115. package/drizzle/meta/_journal.json +21 -0
  116. package/package.json +2 -1
  117. package/templates/_base/.init/.config/hooks/wake-context.sh +7 -0
  118. package/templates/_base/.init/.config/prompts.json +2 -2
  119. package/templates/_base/home/VOLUTE.md +5 -5
  120. package/templates/_base/src/lib/startup.ts +10 -2
  121. package/templates/claude/src/agent.ts +51 -1
  122. package/templates/claude/src/server.ts +1 -0
  123. package/templates/pi/package.json.tmpl +1 -0
  124. package/templates/pi/src/agent.ts +48 -1
  125. package/templates/pi/src/lib/subagents.ts +150 -0
  126. package/templates/pi/src/server.ts +1 -0
  127. package/dist/channel-HZOSHGNF.js +0 -260
  128. package/dist/chunk-33XAVCS4.js +0 -203
  129. package/dist/chunk-B2CPS4QU.js +0 -283
  130. package/dist/chunk-NWPT4ASZ.js +0 -89
  131. package/dist/chunk-SIAG3QMM.js +0 -42
  132. package/dist/chunk-WSLPZF72.js +0 -173
  133. package/dist/connector-M6XFI6GM.js +0 -147
  134. package/dist/connectors/discord.js +0 -177
  135. package/dist/connectors/slack.js +0 -181
  136. package/dist/connectors/telegram.js +0 -187
  137. package/dist/down-674SX2IZ.js +0 -14
  138. package/dist/message-delivery-XMGV3FUM.js +0 -23
  139. package/dist/service-FASYWLTC.js +0 -247
  140. package/dist/setup-BMLM2UTK.js +0 -230
  141. package/dist/sleep-manager-RKTFZPD3.js +0 -27
  142. package/dist/up-CJ26KQLN.js +0 -15
  143. package/dist/variant-UGREB4G5.js +0 -207
  144. package/dist/web-assets/assets/index-CGPSVu19.js +0 -69
  145. package/dist/web-assets/assets/index-V_rNDsM8.css +0 -1
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ getDb
4
+ } from "./chunk-H7OZRFJB.js";
5
+ import "./chunk-K3NQKI34.js";
6
+ export {
7
+ getDb
8
+ };
@@ -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-I42FK2BF.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" : "");
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ run,
4
+ stopDaemon
5
+ } from "./chunk-EHYDTZTF.js";
6
+ import "./chunk-LAC664WU.js";
7
+ import "./chunk-AW7PFDVN.js";
8
+ import "./chunk-RKQEHRBB.js";
9
+ import "./chunk-H7OZRFJB.js";
10
+ import "./chunk-K3NQKI34.js";
11
+ export {
12
+ run,
13
+ stopDaemon
14
+ };
@@ -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-JGFVMROS.js";
5
8
  import {
6
9
  getClient,
7
10
  urlOf
@@ -9,10 +12,7 @@ import {
9
12
  import {
10
13
  parseArgs
11
14
  } from "./chunk-D424ZQGI.js";
12
- import {
13
- daemonFetch
14
- } from "./chunk-TRQEV3CD.js";
15
- import "./chunk-B2CPS4QU.js";
15
+ import "./chunk-H7OZRFJB.js";
16
16
  import "./chunk-K3NQKI34.js";
17
17
 
18
18
  // src/commands/env.ts
@@ -2,14 +2,14 @@
2
2
  import {
3
3
  addHistoryToArchive,
4
4
  createExportArchive
5
- } from "./chunk-KTJGZ7M7.js";
5
+ } from "./chunk-XBLSAVJF.js";
6
6
  import {
7
7
  parseArgs
8
8
  } from "./chunk-D424ZQGI.js";
9
9
  import {
10
10
  findMind,
11
11
  mindDir
12
- } from "./chunk-B2CPS4QU.js";
12
+ } from "./chunk-H7OZRFJB.js";
13
13
  import "./chunk-K3NQKI34.js";
14
14
 
15
15
  // src/commands/export.ts
@@ -33,7 +33,7 @@ async function run(args) {
33
33
  );
34
34
  process.exit(1);
35
35
  }
36
- const entry = findMind(name);
36
+ const entry = await findMind(name);
37
37
  if (!entry) {
38
38
  console.error(`Unknown mind: ${name}`);
39
39
  process.exit(1);
@@ -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-I42FK2BF.js");
67
67
  const { getClient, urlOf } = await import("./api-client-YPKOZP2O.js");
68
68
  const client = getClient();
69
69
  const res = await daemonFetch(
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  resolveMindName
4
4
  } from "./chunk-NAOW2CLO.js";
5
+ import {
6
+ daemonFetch
7
+ } from "./chunk-JGFVMROS.js";
5
8
  import {
6
9
  parseArgs
7
10
  } from "./chunk-D424ZQGI.js";
8
- import {
9
- daemonFetch
10
- } from "./chunk-TRQEV3CD.js";
11
- import "./chunk-B2CPS4QU.js";
11
+ import "./chunk-H7OZRFJB.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
14
14
  // src/commands/file.ts
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ resolveMindName
4
+ } from "./chunk-NAOW2CLO.js";
5
+ import {
6
+ daemonFetch
7
+ } from "./chunk-JGFVMROS.js";
2
8
  import {
3
9
  getClient,
4
10
  urlOf
5
11
  } from "./chunk-4RQBJWQX.js";
6
- import {
7
- resolveMindName
8
- } from "./chunk-NAOW2CLO.js";
9
12
  import {
10
13
  parseArgs
11
14
  } from "./chunk-D424ZQGI.js";
12
- import {
13
- daemonFetch
14
- } from "./chunk-TRQEV3CD.js";
15
- import "./chunk-B2CPS4QU.js";
15
+ import "./chunk-H7OZRFJB.js";
16
16
  import "./chunk-K3NQKI34.js";
17
17
 
18
18
  // src/commands/history.ts
@@ -6,11 +6,11 @@ import {
6
6
  parseNameFromIdentity,
7
7
  run,
8
8
  sessionMatchesWorkspace
9
- } from "./chunk-BOTQ25QT.js";
10
- import "./chunk-SIAG3QMM.js";
11
- import "./chunk-PHU4DEAJ.js";
9
+ } from "./chunk-2YP2TVDT.js";
10
+ import "./chunk-2WPW7OT6.js";
11
+ import "./chunk-YUIHSKR6.js";
12
12
  import "./chunk-D424ZQGI.js";
13
- import "./chunk-B2CPS4QU.js";
13
+ import "./chunk-H7OZRFJB.js";
14
14
  import "./chunk-K3NQKI34.js";
15
15
  export {
16
16
  findOpenClawSession,
@@ -0,0 +1,66 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ parseArgs
4
+ } from "./chunk-D424ZQGI.js";
5
+ import "./chunk-K3NQKI34.js";
6
+
7
+ // src/commands/join.ts
8
+ async function run(args) {
9
+ const { positional, flags } = parseArgs(args, {
10
+ summary: { type: "string" },
11
+ justification: { type: "string" },
12
+ memory: { type: "string" },
13
+ "skip-verify": { type: "boolean" }
14
+ });
15
+ const variantName = positional[0];
16
+ if (!variantName) {
17
+ console.error(
18
+ "Usage: volute mind join <variant-name> [--summary '...'] [--justification '...'] [--memory '...'] [--skip-verify]"
19
+ );
20
+ process.exit(1);
21
+ }
22
+ console.log(`Joining variant ${variantName}...`);
23
+ const { daemonFetch } = await import("./daemon-client-I42FK2BF.js");
24
+ const { getClient, urlOf } = await import("./api-client-YPKOZP2O.js");
25
+ const client = getClient();
26
+ const statusRes = await daemonFetch(
27
+ urlOf(client.api.minds[":name"].$url({ param: { name: variantName } }))
28
+ );
29
+ if (!statusRes.ok) {
30
+ const data2 = await statusRes.json().catch(() => ({}));
31
+ console.error(data2.error ?? `Variant '${variantName}' not found (HTTP ${statusRes.status})`);
32
+ process.exit(1);
33
+ }
34
+ const statusData = await statusRes.json();
35
+ const parentName = statusData.parent;
36
+ if (!parentName) {
37
+ console.error(`'${variantName}' is not a variant \u2014 it has no parent mind`);
38
+ process.exit(1);
39
+ }
40
+ const res = await daemonFetch(
41
+ urlOf(
42
+ client.api.minds[":name"].variants[":variant"].merge.$url({
43
+ param: { name: parentName, variant: variantName }
44
+ })
45
+ ),
46
+ {
47
+ method: "POST",
48
+ headers: { "Content-Type": "application/json" },
49
+ body: JSON.stringify({
50
+ ...flags.summary && { summary: flags.summary },
51
+ ...flags.justification && { justification: flags.justification },
52
+ ...flags.memory && { memory: flags.memory },
53
+ ...flags["skip-verify"] && { skipVerify: true }
54
+ })
55
+ }
56
+ );
57
+ const data = await res.json();
58
+ if (!res.ok) {
59
+ console.error(data.error ?? "Failed to join variant");
60
+ process.exit(1);
61
+ }
62
+ console.log(`Variant ${variantName} joined and cleaned up.`);
63
+ }
64
+ export {
65
+ run
66
+ };
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ resolveMindName
4
+ } from "./chunk-NAOW2CLO.js";
5
+ import {
6
+ daemonFetch
7
+ } from "./chunk-JGFVMROS.js";
8
+ import {
9
+ parseArgs
10
+ } from "./chunk-D424ZQGI.js";
11
+ import "./chunk-H7OZRFJB.js";
12
+ import "./chunk-K3NQKI34.js";
13
+
14
+ // src/commands/chat/list.ts
15
+ async function run(args) {
16
+ const { flags } = parseArgs(args, {
17
+ mind: { type: "string" }
18
+ });
19
+ const mindName = resolveMindName(flags);
20
+ const res = await daemonFetch(`/api/minds/${encodeURIComponent(mindName)}/conversations`);
21
+ if (!res.ok) {
22
+ console.error(`Failed to list conversations: ${res.status}`);
23
+ process.exit(1);
24
+ }
25
+ const convs = await res.json();
26
+ if (convs.length === 0) {
27
+ console.log("No conversations.");
28
+ return;
29
+ }
30
+ for (const conv of convs) {
31
+ const label = conv.type === "channel" ? `#${conv.name}` : conv.title ?? conv.id.slice(0, 8);
32
+ const time = new Date(
33
+ conv.updated_at.endsWith("Z") ? conv.updated_at : `${conv.updated_at}Z`
34
+ ).toLocaleString();
35
+ console.log(` ${label} (${conv.type}) ${time}`);
36
+ }
37
+ }
38
+ export {
39
+ run
40
+ };
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  resolveMindName
4
4
  } from "./chunk-NAOW2CLO.js";
5
+ import {
6
+ daemonFetch
7
+ } from "./chunk-JGFVMROS.js";
5
8
  import {
6
9
  parseArgs
7
10
  } from "./chunk-D424ZQGI.js";
8
- import {
9
- daemonFetch
10
- } from "./chunk-TRQEV3CD.js";
11
- import "./chunk-B2CPS4QU.js";
11
+ import "./chunk-H7OZRFJB.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
14
14
  // src/commands/shared/log.ts
@@ -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-JGFVMROS.js";
9
+ import {
10
+ voluteUserHome
11
+ } from "./chunk-H7OZRFJB.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(voluteUserHome(), "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
+ };
@@ -4,15 +4,15 @@ 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
11
- } from "./chunk-HFCBO2GL.js";
11
+ } from "./chunk-KDGS53OS.js";
12
12
  import {
13
13
  parseArgs
14
14
  } from "./chunk-D424ZQGI.js";
15
- import "./chunk-B2CPS4QU.js";
15
+ import "./chunk-H7OZRFJB.js";
16
16
  import "./chunk-K3NQKI34.js";
17
17
 
18
18
  // src/commands/pages/login.ts
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ daemonFetch
4
+ } from "./chunk-JGFVMROS.js";
5
+ import {
6
+ voluteUserHome
7
+ } from "./chunk-H7OZRFJB.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(voluteUserHome(), "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,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  deleteSystemsConfig
4
- } from "./chunk-HFCBO2GL.js";
5
- import "./chunk-B2CPS4QU.js";
4
+ } from "./chunk-KDGS53OS.js";
5
+ import "./chunk-H7OZRFJB.js";
6
6
  import "./chunk-K3NQKI34.js";
7
7
 
8
8
  // src/commands/pages/logout.ts
@@ -1,18 +1,18 @@
1
1
  #!/usr/bin/env node
2
+ import {
3
+ resolveMindName
4
+ } from "./chunk-NAOW2CLO.js";
5
+ import {
6
+ daemonFetch
7
+ } from "./chunk-JGFVMROS.js";
2
8
  import {
3
9
  getClient,
4
10
  urlOf
5
11
  } from "./chunk-4RQBJWQX.js";
6
- import {
7
- resolveMindName
8
- } from "./chunk-NAOW2CLO.js";
9
12
  import {
10
13
  parseArgs
11
14
  } from "./chunk-D424ZQGI.js";
12
- import {
13
- daemonFetch
14
- } from "./chunk-TRQEV3CD.js";
15
- import "./chunk-B2CPS4QU.js";
15
+ import "./chunk-H7OZRFJB.js";
16
16
  import "./chunk-K3NQKI34.js";
17
17
 
18
18
  // src/commands/logs.ts
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  resolveMindName
4
4
  } from "./chunk-NAOW2CLO.js";
5
+ import {
6
+ daemonFetch
7
+ } from "./chunk-JGFVMROS.js";
5
8
  import {
6
9
  parseArgs
7
10
  } from "./chunk-D424ZQGI.js";
8
- import {
9
- daemonFetch
10
- } from "./chunk-TRQEV3CD.js";
11
- import "./chunk-B2CPS4QU.js";
11
+ import "./chunk-H7OZRFJB.js";
12
12
  import "./chunk-K3NQKI34.js";
13
13
 
14
14
  // src/commands/shared/merge.ts
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ deliverMessage,
4
+ extractTextContent,
5
+ recordInbound
6
+ } from "./chunk-OQZH4PBB.js";
7
+ import "./chunk-KDGS53OS.js";
8
+ import "./chunk-K5NAC55T.js";
9
+ import "./chunk-PHSAT7YL.js";
10
+ import "./chunk-USUXRNVD.js";
11
+ import "./chunk-IAYBDWVG.js";
12
+ import "./chunk-VIVMW2H2.js";
13
+ import "./chunk-2WPW7OT6.js";
14
+ import "./chunk-YUIHSKR6.js";
15
+ import "./chunk-AW7PFDVN.js";
16
+ import "./chunk-RKQEHRBB.js";
17
+ import "./chunk-IKRVFPWU.js";
18
+ import "./chunk-T6HKBWXZ.js";
19
+ import "./chunk-H7OZRFJB.js";
20
+ import "./chunk-K3NQKI34.js";
21
+ export {
22
+ deliverMessage,
23
+ extractTextContent,
24
+ recordInbound
25
+ };
@@ -0,0 +1,110 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ logger_default
4
+ } from "./chunk-YUIHSKR6.js";
5
+ import {
6
+ getDb,
7
+ minds,
8
+ voluteSystemDir
9
+ } from "./chunk-H7OZRFJB.js";
10
+ import "./chunk-K3NQKI34.js";
11
+
12
+ // src/lib/migrate-registry-to-db.ts
13
+ import { existsSync, readFileSync, renameSync } from "fs";
14
+ import { resolve } from "path";
15
+ async function migrateRegistryToDb() {
16
+ const systemDir = voluteSystemDir();
17
+ const mindsJsonPath = resolve(systemDir, "minds.json");
18
+ const variantsJsonPath = resolve(systemDir, "variants.json");
19
+ if (!existsSync(mindsJsonPath) && !existsSync(variantsJsonPath)) return;
20
+ const db = await getDb();
21
+ let mindEntries = [];
22
+ let mindsParseOk = true;
23
+ if (existsSync(mindsJsonPath)) {
24
+ try {
25
+ mindEntries = JSON.parse(readFileSync(mindsJsonPath, "utf-8"));
26
+ } catch (err) {
27
+ mindsParseOk = false;
28
+ logger_default.error("failed to parse minds.json during migration", { error: err });
29
+ }
30
+ }
31
+ let allVariants = {};
32
+ let variantsParseOk = true;
33
+ if (existsSync(variantsJsonPath)) {
34
+ try {
35
+ allVariants = JSON.parse(readFileSync(variantsJsonPath, "utf-8"));
36
+ } catch (err) {
37
+ variantsParseOk = false;
38
+ logger_default.error("failed to parse variants.json during migration", { error: err });
39
+ }
40
+ }
41
+ let mindFailCount = 0;
42
+ for (const entry of mindEntries) {
43
+ try {
44
+ await db.insert(minds).values({
45
+ name: entry.name,
46
+ port: entry.port,
47
+ stage: entry.stage ?? "sprouted",
48
+ template: entry.template ?? null,
49
+ template_hash: entry.templateHash ?? null,
50
+ running: entry.running ? 1 : 0,
51
+ created_at: entry.created
52
+ }).onConflictDoNothing();
53
+ } catch (err) {
54
+ mindFailCount++;
55
+ logger_default.warn(`failed to migrate mind ${entry.name} to DB`, { error: err });
56
+ }
57
+ }
58
+ let variantFailCount = 0;
59
+ for (const [mindName, variants] of Object.entries(allVariants)) {
60
+ for (const v of variants) {
61
+ try {
62
+ await db.insert(minds).values({
63
+ name: `${mindName}@${v.name}`,
64
+ port: v.port,
65
+ parent: mindName,
66
+ dir: v.path,
67
+ branch: v.branch,
68
+ running: v.running ? 1 : 0,
69
+ created_at: v.created
70
+ }).onConflictDoNothing();
71
+ } catch (err) {
72
+ variantFailCount++;
73
+ logger_default.warn(`failed to migrate variant ${mindName}@${v.name} to DB`, { error: err });
74
+ }
75
+ }
76
+ }
77
+ if (mindFailCount > 0) {
78
+ logger_default.error(`${mindFailCount} mind(s) failed to migrate \u2014 minds.json will not be renamed`);
79
+ }
80
+ if (variantFailCount > 0) {
81
+ logger_default.error(
82
+ `${variantFailCount} variant(s) failed to migrate \u2014 variants.json will not be renamed`
83
+ );
84
+ }
85
+ if (mindsParseOk && mindFailCount === 0) {
86
+ try {
87
+ if (existsSync(mindsJsonPath)) {
88
+ renameSync(mindsJsonPath, `${mindsJsonPath}.bak`);
89
+ }
90
+ } catch (err) {
91
+ logger_default.warn("failed to rename minds.json to .bak", { error: err });
92
+ }
93
+ }
94
+ if (variantsParseOk && variantFailCount === 0) {
95
+ try {
96
+ if (existsSync(variantsJsonPath)) {
97
+ renameSync(variantsJsonPath, `${variantsJsonPath}.bak`);
98
+ }
99
+ } catch (err) {
100
+ logger_default.warn("failed to rename variants.json to .bak", { error: err });
101
+ }
102
+ }
103
+ const count = mindEntries.length + Object.values(allVariants).flat().length;
104
+ if (count > 0) {
105
+ logger_default.info(`migrated ${count} entries from JSON to DB`);
106
+ }
107
+ }
108
+ export {
109
+ migrateRegistryToDb
110
+ };