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.
- package/README.md +15 -20
- package/dist/{activity-events-4O37J7PD.js → activity-events-ZMBAKLUF.js} +2 -2
- package/dist/api.d.ts +590 -10
- package/dist/{auth-HM2RSPY7.js → auth-4TV573WE.js} +2 -2
- package/dist/{channel-HZOSHGNF.js → channel-ZVZV42UD.js} +3 -3
- package/dist/{chunk-NOBRGACV.js → chunk-2VO7453N.js} +56 -19
- package/dist/{chunk-OOW675I3.js → chunk-3CFRE2VC.js} +931 -775
- package/dist/{chunk-PHHKNGA3.js → chunk-3TV4GLFO.js} +2 -2
- package/dist/{chunk-4TJ72QQ3.js → chunk-5Y3PBKW6.js} +3 -3
- package/dist/{chunk-BFK6SOEJ.js → chunk-J2CO4WEV.js} +1 -1
- package/dist/{chunk-TQDITGES.js → chunk-LX22GRG7.js} +10 -13
- package/dist/{chunk-E7GOKNOT.js → chunk-NWI2425I.js} +1 -1
- package/dist/{chunk-2767L2RZ.js → chunk-OZFKBXD6.js} +1 -1
- package/dist/{chunk-XLC342FO.js → chunk-SIAG3QMM.js} +14 -1
- package/dist/{chunk-RVKR2R7F.js → chunk-SSI47XP2.js} +10 -2
- package/dist/chunk-TZKJLDQN.js +78 -0
- package/dist/{chunk-P3W36ZGD.js → chunk-USNBKHYG.js} +33 -5
- package/dist/chunk-UTL75LP6.js +113 -0
- package/dist/{chunk-3AIBT4TW.js → chunk-V63B7DX3.js} +24 -1
- package/dist/{chunk-33XAVCS4.js → chunk-WBHMQ5OZ.js} +49 -0
- package/dist/{chunk-TRQEV3CD.js → chunk-WGOGUMPO.js} +22 -3
- package/dist/chunk-XOXLRRR2.js +176 -0
- package/dist/{chunk-JTDFJWI2.js → chunk-YJA7P64S.js} +1 -1
- package/dist/chunk-ZYGKG6VC.js +22 -0
- package/dist/cli.js +44 -20
- package/dist/{cloud-sync-DIU3OCPV.js → cloud-sync-NI2K3C7G.js} +11 -9
- package/dist/{connector-M6XFI6GM.js → connector-G722WXAU.js} +4 -4
- package/dist/{create-VDQJER52.js → create-4YBRTTJS.js} +1 -1
- package/dist/{daemon-client-JOVQZ52X.js → daemon-client-Z7FAJ6JW.js} +1 -1
- package/dist/{daemon-restart-YMPEATQH.js → daemon-restart-BJZ3O4U4.js} +6 -5
- package/dist/daemon.js +982 -340
- package/dist/{delete-2MRR4JX5.js → delete-27OYNK25.js} +1 -1
- package/dist/{down-674SX2IZ.js → down-7UKFMJJZ.js} +4 -4
- package/dist/{env-2FPOZK37.js → env-M336ONDP.js} +4 -4
- package/dist/{export-IKFAPRAO.js → export-HP4G5DQC.js} +1 -1
- package/dist/{file-KT3UIQM3.js → file-HUDKTRAS.js} +3 -3
- package/dist/{history-46WZN5CN.js → history-B64GTFTD.js} +3 -3
- package/dist/{import-FRDPQPJ2.js → import-XIB7UV4S.js} +2 -2
- package/dist/{log-6SGSSR3D.js → log-PBFNILJ4.js} +3 -3
- package/dist/{login-UO6AOVEA.js → login-6U7U6BNG.js} +1 -1
- package/dist/login-B5E7N7MY.js +46 -0
- package/dist/logout-XSJRYS3U.js +39 -0
- package/dist/{logs-HRBONI5I.js → logs-3CART7O7.js} +3 -3
- package/dist/{merge-KSFJKX6T.js → merge-VK2HSKMA.js} +3 -3
- package/dist/{message-delivery-S7BCNV6Y.js → message-delivery-MS5JYPZX.js} +11 -9
- package/dist/{mind-KPLCRKQA.js → mind-HZ3QSDDJ.js} +17 -17
- package/dist/{mind-activity-tracker-NMDDEV3K.js → mind-activity-tracker-4G6FURY2.js} +3 -3
- package/dist/{mind-manager-ZNRIYEK3.js → mind-manager-VVK67AY3.js} +6 -4
- package/dist/{mind-sleep-GHPTSAYN.js → mind-sleep-DTV7L44D.js} +3 -3
- package/dist/{mind-wake-BJDJFMDF.js → mind-wake-PFN4FN3T.js} +3 -3
- package/dist/notes-37FW2UR2.js +230 -0
- package/dist/{package-S5YF25XV.js → package-VZWLXPHV.js} +3 -1
- package/dist/{pages-TWR6U7DS.js → pages-DIIT5HMQ.js} +1 -1
- package/dist/{publish-BZNHKUUK.js → publish-HQV7YREB.js} +4 -4
- package/dist/{pull-D32SPFVU.js → pull-2MB4SK3C.js} +3 -3
- package/dist/{register-U2UO6TC4.js → register-EFND67FQ.js} +1 -1
- package/dist/{restart-5BMNV7KU.js → restart-CCK7D6TV.js} +3 -3
- package/dist/sandbox-EHGFF52K.js +19 -0
- package/dist/{schedule-YEFDLVMJ.js → schedule-6F7ELB2M.js} +3 -3
- package/dist/{seed-6FEKB3YC.js → seed-E5OQGWX3.js} +1 -1
- package/dist/{send-IISDYFCL.js → send-IH6XZKPC.js} +6 -20
- package/dist/service-LLBV3R7M.js +122 -0
- package/dist/setup-F6TWFYGQ.js +371 -0
- package/dist/setup-YGAAIKKZ.js +17 -0
- package/dist/{shared-LWMNTTZN.js → shared-UMO4S7CC.js} +4 -4
- package/dist/{skill-BQOFACEI.js → skill-42LGFBQC.js} +13 -5
- package/dist/skills/dreaming/SKILL.md +68 -0
- package/dist/skills/dreaming/references/INSTALL.md +56 -0
- package/dist/skills/dreaming/scripts/dream.ts +289 -0
- package/dist/skills/dreaming/scripts/wake-context-dreams.sh +30 -0
- package/dist/skills/imagegen/SKILL.md +37 -0
- package/dist/skills/imagegen/references/INSTALL.md +13 -0
- package/dist/skills/imagegen/scripts/imagegen.ts +136 -0
- package/dist/skills/notes/SKILL.md +34 -0
- package/dist/skills/resonance/SKILL.md +73 -0
- package/dist/skills/resonance/assets/default-config.json +21 -0
- package/dist/skills/resonance/references/INSTALL.md +23 -0
- package/dist/skills/resonance/scripts/resonance.ts +1250 -0
- package/dist/skills/volute-mind/SKILL.md +23 -3
- package/dist/{sleep-manager-XXSWQQLE.js → sleep-manager-EE4NRN2Q.js} +11 -9
- package/dist/{sprout-CGSW4CF5.js → sprout-QL74KR2X.js} +5 -5
- package/dist/{start-C7XITZ5O.js → start-O5JQASRC.js} +3 -3
- package/dist/{status-SIRPLEZC.js → status-FZBEBM7Q.js} +3 -3
- package/dist/{status-LYS4NUOZ.js → status-WXD4HXRL.js} +3 -3
- package/dist/{stop-CVKBSLXY.js → stop-2SOG5NYF.js} +3 -3
- package/dist/up-SDMCSVI3.js +17 -0
- package/dist/{update-7XCZMYBT.js → update-5VUDAI3D.js} +6 -6
- package/dist/{upgrade-7RUIXGOO.js → upgrade-QCCO33BK.js} +1 -1
- package/dist/{variant-UGREB4G5.js → variant-WWLDY6D5.js} +4 -4
- package/dist/{version-notify-SZ75QRGO.js → version-notify-USFZBWMG.js} +11 -9
- package/dist/web-assets/assets/index-CUQ31ieL.js +69 -0
- package/dist/web-assets/assets/index-CW8NSl1o.css +1 -0
- package/dist/web-assets/favicon.png +0 -0
- package/dist/web-assets/index.html +5 -4
- package/dist/web-assets/logo.png +0 -0
- package/drizzle/0015_notes.sql +23 -0
- package/drizzle/0016_note_reactions_and_replies.sql +15 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +3 -1
- package/templates/_base/.init/.config/hooks/wake-context.sh +7 -0
- package/templates/_base/home/public/.gitkeep +0 -0
- package/templates/_base/src/lib/startup.ts +8 -0
- package/templates/claude/src/agent.ts +51 -1
- package/templates/claude/src/server.ts +1 -0
- package/templates/pi/package.json.tmpl +1 -0
- package/templates/pi/src/agent.ts +48 -1
- package/templates/pi/src/lib/subagents.ts +150 -0
- package/templates/pi/src/server.ts +1 -0
- package/dist/chunk-NWPT4ASZ.js +0 -89
- package/dist/service-FASYWLTC.js +0 -247
- package/dist/setup-BMLM2UTK.js +0 -230
- package/dist/up-OMHACRJL.js +0 -15
- package/dist/web-assets/assets/index-Bx9WDoaQ.js +0 -69
- 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-
|
|
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-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
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-
|
|
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-
|
|
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-
|
|
10
|
-
import "./chunk-
|
|
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
|
|
|
@@ -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-
|
|
6
|
+
} from "./chunk-3CFRE2VC.js";
|
|
7
7
|
import "./chunk-HFCBO2GL.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
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-
|
|
16
|
-
import "./chunk-
|
|
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-
|
|
9
|
+
await import("./create-4YBRTTJS.js").then((m) => m.run(args.slice(1)));
|
|
10
10
|
break;
|
|
11
11
|
case "start":
|
|
12
|
-
await import("./start-
|
|
12
|
+
await import("./start-O5JQASRC.js").then((m) => m.run(args.slice(1)));
|
|
13
13
|
break;
|
|
14
14
|
case "stop":
|
|
15
|
-
await import("./stop-
|
|
15
|
+
await import("./stop-2SOG5NYF.js").then((m) => m.run(args.slice(1)));
|
|
16
16
|
break;
|
|
17
17
|
case "restart":
|
|
18
|
-
await import("./restart-
|
|
18
|
+
await import("./restart-CCK7D6TV.js").then((m) => m.run(args.slice(1)));
|
|
19
19
|
break;
|
|
20
20
|
case "delete":
|
|
21
|
-
await import("./delete-
|
|
21
|
+
await import("./delete-27OYNK25.js").then((m) => m.run(args.slice(1)));
|
|
22
22
|
break;
|
|
23
23
|
case "list":
|
|
24
|
-
await import("./status-
|
|
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-
|
|
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-
|
|
37
|
+
await import("./logs-3CART7O7.js").then((m) => m.run(logsArgs));
|
|
38
38
|
break;
|
|
39
39
|
}
|
|
40
40
|
case "upgrade":
|
|
41
|
-
await import("./upgrade-
|
|
41
|
+
await import("./upgrade-QCCO33BK.js").then((m) => m.run(args.slice(1)));
|
|
42
42
|
break;
|
|
43
43
|
case "import":
|
|
44
|
-
await import("./import-
|
|
44
|
+
await import("./import-XIB7UV4S.js").then((m) => m.run(args.slice(1)));
|
|
45
45
|
break;
|
|
46
46
|
case "export":
|
|
47
|
-
await import("./export-
|
|
47
|
+
await import("./export-HP4G5DQC.js").then((m) => m.run(args.slice(1)));
|
|
48
48
|
break;
|
|
49
49
|
case "connect":
|
|
50
|
-
await import("./connector-
|
|
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-
|
|
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-
|
|
56
|
+
await import("./seed-E5OQGWX3.js").then((m) => m.run(args.slice(1)));
|
|
57
57
|
break;
|
|
58
58
|
case "sprout":
|
|
59
|
-
await import("./sprout-
|
|
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-
|
|
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-
|
|
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-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-2VO7453N.js";
|
|
7
|
+
import "./chunk-UTL75LP6.js";
|
|
8
|
+
import "./chunk-WBHMQ5OZ.js";
|
|
9
9
|
import "./chunk-YUIHSKR6.js";
|
|
10
|
-
import "./chunk-
|
|
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
|
+
};
|