volute 0.34.0 → 0.36.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 +7 -6
- package/dist/accept-ZBDVVCEU.js +42 -0
- package/dist/{activity-events-BN7V6KCC.js → activity-events-PWOGSMRL.js} +4 -4
- package/dist/{ai-service-PSILB5WD.js → ai-service-GSZWIETO.js} +5 -5
- package/dist/{api-client-XUXOB7LI.js → api-client-3A77HMH7.js} +1 -1
- package/dist/api.d.ts +1 -5618
- package/dist/{archive-C2VEMQOR.js → archive-Y2YEOCGB.js} +3 -3
- package/dist/{auth-ZFZXJZDQ.js → auth-YTQME4EV.js} +5 -5
- package/dist/bridge-PXIO6PS2.js +206 -0
- package/dist/chat-ED7YOGKO.js +51 -0
- package/dist/{chunk-6LXAAQ43.js → chunk-33ODGMFZ.js} +1 -1
- package/dist/{chunk-G53F3JA4.js → chunk-46DYYHN6.js} +8 -3
- package/dist/{chunk-FYCALD4Q.js → chunk-5T5YMX6S.js} +1 -1
- package/dist/{chunk-B2BVAIZ4.js → chunk-6F3YNULE.js} +76 -24
- package/dist/{chunk-N7BLAHNE.js → chunk-75AJ54GM.js} +16 -5
- package/dist/{chunk-4JSR7YO7.js → chunk-7PTQGPJY.js} +29 -13
- package/dist/{chunk-XWXBJQBE.js → chunk-B35VNNSS.js} +4 -4
- package/dist/{chunk-V45JXOWY.js → chunk-BOLJUV77.js} +4 -4
- package/dist/{chunk-NAOW2CLO.js → chunk-BTY4WNFE.js} +1 -1
- package/dist/{chunk-OYAKCAVY.js → chunk-CU6OFXMM.js} +1 -1
- package/dist/{chunk-7F2SW2KD.js → chunk-DJT5Y4UF.js} +3 -3
- package/dist/{chunk-BM474GX6.js → chunk-DMV5P2LU.js} +4 -4
- package/dist/{chunk-TAHX36HZ.js → chunk-DQ7VBXAP.js} +2014 -436
- package/dist/{chunk-N3DNFPVA.js → chunk-GBDVNPN2.js} +15 -13
- package/dist/{chunk-E5C7OWZ2.js → chunk-IIWF2IPD.js} +150 -190
- package/dist/{chunk-PVY5W6QN.js → chunk-KAB6UGOL.js} +2 -2
- package/dist/{chunk-BDK73LK6.js → chunk-L72WYMF7.js} +2 -2
- package/dist/{chunk-G6BSYHPK.js → chunk-LGNUFVMR.js} +1 -1
- package/dist/{chunk-4RQBJWQX.js → chunk-LOPXTW6H.js} +1 -1
- package/dist/{chunk-BFWHBQK4.js → chunk-M5RYAA5I.js} +3 -3
- package/dist/{chunk-V6ZCNULL.js → chunk-N2AUHW4C.js} +37 -28
- package/dist/{chunk-6OWJXUAR.js → chunk-NUX47Y2V.js} +19 -4
- package/dist/{chunk-D424ZQGI.js → chunk-O7IGP7ZW.js} +11 -3
- package/dist/{chunk-U5BTYSAL.js → chunk-PJ4IPTIN.js} +2 -2
- package/dist/{chunk-BTWAGDV5.js → chunk-PY557GDR.js} +3 -3
- package/dist/{chunk-47ZPNLF4.js → chunk-PZYJBOQP.js} +8 -137
- package/dist/chunk-QHG4OMZL.js +145 -0
- package/dist/chunk-RG5TOL4O.js +18 -0
- package/dist/{chunk-6WAWMWR5.js → chunk-SWW6AUVW.js} +2 -2
- package/dist/{chunk-YUIHSKR6.js → chunk-T2TP6ZC6.js} +20 -8
- package/dist/chunk-TWAN7ZNO.js +164 -0
- package/dist/chunk-TXSA4Q3V.js +116 -0
- package/dist/{chunk-KTLFDYPT.js → chunk-UI7RPV2B.js} +1 -1
- package/dist/{chunk-SSI47XP2.js → chunk-VHWGEJ4V.js} +1 -1
- package/dist/{chunk-IS7WJ56Q.js → chunk-X2J7QUFH.js} +3 -3
- package/dist/{chunk-M3K5AARV.js → chunk-YDBAY3NA.js} +2 -2
- package/dist/{chunk-MLOQKQNB.js → chunk-YTWZORJN.js} +2 -2
- package/dist/{chunk-2IOP6PHB.js → chunk-ZTVKQOU7.js} +2 -2
- package/dist/{chunk-PLDWHR4D.js → chunk-ZX7EAV5J.js} +17 -7
- package/dist/cli.js +90 -29
- package/dist/clock-HSEKS5AR.js +289 -0
- package/dist/{cloud-sync-TG3TIX5H.js → cloud-sync-BOCZSDIA.js} +20 -22
- package/dist/config-UTS7QULS.js +76 -0
- package/dist/connectors/discord-bridge.js +3 -3
- package/dist/connectors/slack-bridge.js +3 -3
- package/dist/connectors/telegram-bridge.js +3 -3
- package/dist/{conversations-HL2JP5GI.js → conversations-HH3CJD4E.js} +15 -9
- package/dist/create-5BPOOJAN.js +75 -0
- package/dist/create-QBEPSD2Z.js +50 -0
- package/dist/daemon-client-RVIKXGFQ.js +12 -0
- package/dist/daemon-restart-SIR3UR4B.js +65 -0
- package/dist/daemon.js +1186 -1989
- package/dist/{db-PLEDCBHZ.js → db-BDMH4SZ2.js} +7 -3
- package/dist/{db-RYX3SS2W.js → db-URORGSXQ.js} +2 -2
- package/dist/delete-L5PAVDGQ.js +42 -0
- package/dist/delivery-manager-WTGIPBGY.js +30 -0
- package/dist/{delivery-router-D5ELDMS2.js → delivery-router-VSULHXNH.js} +4 -4
- package/dist/down-DGGLZ5TA.js +17 -0
- package/dist/env-E4XHO2BI.js +223 -0
- package/dist/{exec-DVLXKRIO.js → exec-X3C6ZZTQ.js} +4 -4
- package/dist/export-HTFOHOKL.js +113 -0
- package/dist/{extension-PM42QCID.js → extension-AKZ46YSL.js} +46 -35
- package/dist/extensions-OOSFVH7U.js +50 -0
- package/dist/files-H2YLRD37.js +53 -0
- package/dist/import-OL5BZX7S.js +143 -0
- package/dist/{isolation-62MKDZN3.js → isolation-N74RWOUX.js} +3 -3
- package/dist/join-DF5XSJAC.js +67 -0
- package/dist/list-GJ4RUQQT.js +59 -0
- package/dist/login-GOTAYLXP.js +51 -0
- package/dist/login-JXRVMBRB.js +60 -0
- package/dist/logout-6KIA74EV.js +29 -0
- package/dist/logout-FW243JBU.js +50 -0
- package/dist/message-delivery-YORUXKDQ.js +40 -0
- package/dist/mind-6VJJHF65.js +97 -0
- package/dist/{mind-activity-tracker-2ACNHA7B.js → mind-activity-tracker-66UVYIFW.js} +5 -5
- package/dist/mind-history-MII2SK7F.js +342 -0
- package/dist/mind-list-GEWHWAL4.js +38 -0
- package/dist/mind-manager-TJ2SUPRX.js +30 -0
- package/dist/mind-profile-DCBDVF5B.js +53 -0
- package/dist/mind-service-E7FM2WZF.js +36 -0
- package/dist/mind-sleep-ITCF6OQA.js +47 -0
- package/dist/mind-status-X4SX3YUG.js +65 -0
- package/dist/mind-wake-KXMKMGWX.js +42 -0
- package/dist/{package-V2WHWVG6.js → package-3W2MEXHB.js} +5 -5
- package/dist/read-ZUDG4JWU.js +91 -0
- package/dist/{read-stdin-PIRM6A2Y.js → read-stdin-3X5VYKNS.js} +1 -1
- package/dist/register-SB7NXCOE.js +51 -0
- package/dist/{registry-UYV5S6QT.js → registry-YPHK534W.js} +2 -2
- package/dist/reject-MUR2KWJ4.js +40 -0
- package/dist/restart-5EGG4JXU.js +42 -0
- package/dist/{sandbox-SI5HMBP3.js → sandbox-LP6YRAXS.js} +5 -5
- package/dist/scheduler-FRJ5DK24.js +30 -0
- package/dist/{schema-ETMABTW4.js → schema-MISD3JFG.js} +3 -1
- package/dist/{seed-WNGI6PNW.js → seed-CEC4RC23.js} +2 -2
- package/dist/seed-check-KJNTL72M.js +35 -0
- package/dist/seed-cmd-WTTG7SRQ.js +30 -0
- package/dist/seed-create-M6RCC6RP.js +113 -0
- package/dist/seed-sprout-ZKCHFJKH.js +148 -0
- package/dist/send-LXUT2GGR.js +409 -0
- package/dist/service-M6N3RUYU.js +121 -0
- package/dist/{setup-Z3DEVWV7.js → setup-PJOF5UV5.js} +153 -127
- package/dist/{setup-GGMKENLN.js → setup-PMJHCZQX.js} +5 -3
- package/dist/skill-TAAKEYBV.js +389 -0
- package/dist/skills/tending/SKILL.md +52 -0
- package/dist/skills/volute-mind/SKILL.md +3 -7
- package/dist/skills/volute-mind/references/extensions.md +8 -11
- package/dist/{skills-Q6VZ2UGD.js → skills-2PTRTBQP.js} +7 -7
- package/dist/sleep-manager-WAZWMFJT.js +34 -0
- package/dist/spirit-6KVDIROQ.js +24 -0
- package/dist/split-AWVOYOPZ.js +64 -0
- package/dist/{sprout-E3HJIV2Z.js → sprout-WX2FFYLP.js} +2 -2
- package/dist/src-FQE4BHRG.js +617 -0
- package/dist/src-GW6FP6VL.js +425 -0
- package/dist/src-QEOLMAYC.js +2133 -0
- package/dist/start-3UXOPXQG.js +39 -0
- package/dist/status-3IVSLJDN.js +125 -0
- package/dist/stop-3XYIBGFM.js +41 -0
- package/dist/system-chat-2IFS5HCX.js +34 -0
- package/dist/systems-O43WGQY6.js +52 -0
- package/dist/{tailscale-ZEUK7GKZ.js → tailscale-DZU4WM3E.js} +4 -4
- package/dist/{template-hash-EJRTKE36.js → template-hash-6ITI3WC4.js} +2 -2
- package/dist/up-4SCIUIMG.js +19 -0
- package/dist/update-RIQYUPVN.js +225 -0
- package/dist/{update-check-X3YG4WVP.js → update-check-4TIJKVGD.js} +3 -3
- package/dist/upgrade-ZMDGC7M2.js +74 -0
- package/dist/variant-QWL2WSRI.js +62 -0
- package/dist/{version-notify-YCH4UVQ2.js → version-notify-UXSHBZ35.js} +27 -27
- package/dist/{volute-config-WBKYJGYQ.js → volute-config-V7UFFBG3.js} +1 -1
- package/dist/web-assets/assets/index-C-eYso8Y.js +75 -0
- package/dist/web-assets/assets/index-CCv_fSte.css +1 -0
- package/dist/web-assets/index.html +2 -2
- package/dist/web-assets/sw.js +117 -0
- package/drizzle/0006_channels.sql +17 -0
- package/drizzle/0007_drop_conversation_name_title.sql +11 -0
- package/drizzle/0008_performance_indexes.sql +6 -0
- package/drizzle/meta/0006_snapshot.json +7 -0
- package/drizzle/meta/0007_snapshot.json +7 -0
- package/drizzle/meta/_journal.json +21 -0
- package/package.json +5 -5
- package/packages/extensions/pages/dist/ui/assets/index-DKZLNMED.js +2 -0
- package/packages/extensions/pages/dist/ui/index.html +1 -1
- package/packages/extensions/pages/skills/pages/SKILL.md +84 -9
- package/templates/_base/home/.config/routes.json +2 -2
- package/templates/_base/home/VOLUTE.md +1 -2
- package/templates/_base/src/lib/auto-commit.ts +8 -8
- package/templates/_base/src/lib/format-prefix.ts +1 -7
- package/templates/_base/src/lib/volute-server.ts +6 -0
- package/templates/claude/.init/.config/routes.json +2 -2
- package/templates/claude/src/agent.ts +8 -1
- package/templates/codex/.init/.config/routes.json +2 -2
- package/templates/pi/.init/.config/routes.json +2 -2
- package/dist/accept-TW6V4WI4.js +0 -42
- package/dist/bridge-O753D5F4.js +0 -207
- package/dist/chat-BHYX7DJ4.js +0 -68
- package/dist/chunk-47XDEWWV.js +0 -156
- package/dist/chunk-CVL5IGIR.js +0 -2084
- package/dist/chunk-PB65JZK2.js +0 -85
- package/dist/clock-3X4DSC2N.js +0 -281
- package/dist/config-OROA5DUA.js +0 -72
- package/dist/create-3SEKKI6P.js +0 -71
- package/dist/create-UOSOQ2HN.js +0 -44
- package/dist/daemon-client-WOAQXXBM.js +0 -12
- package/dist/daemon-restart-5ABHNXJZ.js +0 -52
- package/dist/delete-KYOVWR23.js +0 -35
- package/dist/delivery-manager-2BR5NZKF.js +0 -32
- package/dist/down-QVFN4UPK.js +0 -15
- package/dist/env-R34DT7XL.js +0 -195
- package/dist/export-6ZXAXATG.js +0 -112
- package/dist/extensions-BBGVL5JC.js +0 -38
- package/dist/files-VQV2VZQO.js +0 -47
- package/dist/import-MK2I2T6F.js +0 -23
- package/dist/join-DGYHTJUH.js +0 -66
- package/dist/list-C644WTHV.js +0 -49
- package/dist/login-IIGEQPHL.js +0 -47
- package/dist/login-KZQLMAWE.js +0 -47
- package/dist/logout-AGTZVRGP.js +0 -40
- package/dist/logout-KD6GXIJJ.js +0 -21
- package/dist/message-delivery-V3R6NXJP.js +0 -42
- package/dist/mind-BI4EPBVZ.js +0 -108
- package/dist/mind-history-WOYFLQAI.js +0 -264
- package/dist/mind-list-6VPM7GUQ.js +0 -30
- package/dist/mind-manager-MWW3BTS4.js +0 -32
- package/dist/mind-profile-WPG42U5Y.js +0 -47
- package/dist/mind-service-VIKZJK2M.js +0 -38
- package/dist/mind-sleep-XDISJY74.js +0 -42
- package/dist/mind-status-7FTZWPZF.js +0 -56
- package/dist/mind-wake-KIIKEI3A.js +0 -37
- package/dist/read-H5C26YO7.js +0 -85
- package/dist/register-J27WP33N.js +0 -47
- package/dist/reject-OEANJYIA.js +0 -40
- package/dist/restart-V5EGYBJG.js +0 -33
- package/dist/scheduler-AGG3L2FO.js +0 -32
- package/dist/seed-check-PXTH7YXS.js +0 -32
- package/dist/seed-cmd-VENFTGS3.js +0 -36
- package/dist/seed-create-663ALOKH.js +0 -112
- package/dist/seed-sprout-EH3AGKAI.js +0 -132
- package/dist/send-7FUUUZZH.js +0 -386
- package/dist/skill-DKNYJS4P.js +0 -362
- package/dist/skills/shared-files/SKILL.md +0 -44
- package/dist/skills/shared-files/scripts/merge.ts +0 -72
- package/dist/skills/shared-files/scripts/pull.ts +0 -52
- package/dist/sleep-manager-BJK2ROPX.js +0 -36
- package/dist/spirit-4JP4TY4C.js +0 -23
- package/dist/split-3YPMS2CL.js +0 -63
- package/dist/start-W3TPKX4D.js +0 -33
- package/dist/status-4OVFXFEJ.js +0 -115
- package/dist/stop-GTT6YWYO.js +0 -32
- package/dist/system-channel-DXD2JBOU.js +0 -36
- package/dist/system-chat-TYLOL7SX.js +0 -36
- package/dist/systems-AYLO727G.js +0 -61
- package/dist/up-PA7F2CXE.js +0 -18
- package/dist/update-HG4LCUSG.js +0 -215
- package/dist/upgrade-YGNIDICG.js +0 -67
- package/dist/variant-MZUMRTQO.js +0 -41
- package/dist/web-assets/assets/index-DiiwC-CZ.css +0 -1
- package/dist/web-assets/assets/index-d6y5b9Ij.js +0 -75
- package/packages/extensions/pages/dist/ui/assets/index-tLTROSk5.js +0 -2
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
extractArchive,
|
|
6
6
|
isHomeOnlyArchive,
|
|
7
7
|
readManifest
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-SWW6AUVW.js";
|
|
9
|
+
import "./chunk-75AJ54GM.js";
|
|
10
|
+
import "./chunk-7PTQGPJY.js";
|
|
11
11
|
import "./chunk-7KJOFUNN.js";
|
|
12
12
|
export {
|
|
13
13
|
addHistoryToArchive,
|
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
syncMindProfile,
|
|
18
18
|
updateUserProfile,
|
|
19
19
|
verifyUser
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-DMV5P2LU.js";
|
|
21
|
+
import "./chunk-B35VNNSS.js";
|
|
22
|
+
import "./chunk-T2TP6ZC6.js";
|
|
23
|
+
import "./chunk-75AJ54GM.js";
|
|
24
|
+
import "./chunk-7PTQGPJY.js";
|
|
25
25
|
import "./chunk-7KJOFUNN.js";
|
|
26
26
|
export {
|
|
27
27
|
approveUser,
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
command,
|
|
4
|
+
subcommands
|
|
5
|
+
} from "./chunk-TXSA4Q3V.js";
|
|
6
|
+
import "./chunk-O7IGP7ZW.js";
|
|
7
|
+
import {
|
|
8
|
+
daemonFetch
|
|
9
|
+
} from "./chunk-ZX7EAV5J.js";
|
|
10
|
+
import "./chunk-7KJOFUNN.js";
|
|
11
|
+
|
|
12
|
+
// packages/cli/src/commands/chat/bridge.ts
|
|
13
|
+
var bridgeAddCmd = command({
|
|
14
|
+
name: "volute chat bridge add",
|
|
15
|
+
description: "Enable a bridge with a default mind",
|
|
16
|
+
args: [
|
|
17
|
+
{
|
|
18
|
+
name: "platform",
|
|
19
|
+
required: true,
|
|
20
|
+
description: "Bridge platform (e.g. discord, slack, telegram)"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
flags: {
|
|
24
|
+
"default-mind": { type: "string", description: "Mind to route DMs to (required)" }
|
|
25
|
+
},
|
|
26
|
+
run: async ({ args, flags }) => {
|
|
27
|
+
const platform = args.platform;
|
|
28
|
+
const defaultMind = flags["default-mind"];
|
|
29
|
+
if (!defaultMind) {
|
|
30
|
+
console.error("--default-mind is required (mind to route DMs to)");
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
const res = await daemonFetch(`/api/bridges/${encodeURIComponent(platform)}`, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: { "Content-Type": "application/json" },
|
|
36
|
+
body: JSON.stringify({ defaultMind })
|
|
37
|
+
});
|
|
38
|
+
if (!res.ok) {
|
|
39
|
+
const data = await res.json().catch(() => ({}));
|
|
40
|
+
if (data.error === "missing_env" && data.missing) {
|
|
41
|
+
console.error(`Missing required environment variables:`);
|
|
42
|
+
for (const v of data.missing) {
|
|
43
|
+
console.error(` ${v.name} \u2014 ${v.description}`);
|
|
44
|
+
}
|
|
45
|
+
console.error(`
|
|
46
|
+
Set them with: volute env set <VAR> <value>`);
|
|
47
|
+
} else {
|
|
48
|
+
console.error(data.error ?? `Failed to add bridge: ${res.status}`);
|
|
49
|
+
}
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
console.log(`Bridge ${platform} enabled.`);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
var bridgeRemoveCmd = command({
|
|
56
|
+
name: "volute chat bridge remove",
|
|
57
|
+
description: "Disable a bridge",
|
|
58
|
+
args: [{ name: "platform", required: true, description: "Bridge platform to remove" }],
|
|
59
|
+
flags: {},
|
|
60
|
+
run: async ({ args }) => {
|
|
61
|
+
const platform = args.platform;
|
|
62
|
+
const res = await daemonFetch(`/api/bridges/${encodeURIComponent(platform)}`, {
|
|
63
|
+
method: "DELETE"
|
|
64
|
+
});
|
|
65
|
+
if (!res.ok) {
|
|
66
|
+
console.error(`Failed to remove bridge: ${res.status}`);
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
console.log(`Bridge ${platform} removed.`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var bridgeListCmd = command({
|
|
73
|
+
name: "volute chat bridge list",
|
|
74
|
+
description: "Show all bridges and their status",
|
|
75
|
+
args: [],
|
|
76
|
+
flags: {},
|
|
77
|
+
run: async () => {
|
|
78
|
+
const res = await daemonFetch("/api/bridges");
|
|
79
|
+
if (!res.ok) {
|
|
80
|
+
console.error(`Failed to list bridges: ${res.status}`);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
const bridges = await res.json();
|
|
84
|
+
if (bridges.length === 0) {
|
|
85
|
+
console.log("No bridges configured. Use 'volute chat bridge add <platform>' to set one up.");
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
for (const b of bridges) {
|
|
89
|
+
const status = b.running ? "running" : b.enabled ? "stopped" : "disabled";
|
|
90
|
+
console.log(` ${b.displayName} (${b.platform}) ${status} default: ${b.defaultMind}`);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
var bridgeMapCmd = command({
|
|
95
|
+
name: "volute chat bridge map",
|
|
96
|
+
description: "Map an external channel to a Volute channel",
|
|
97
|
+
args: [
|
|
98
|
+
{ name: "target", required: true, description: "External channel (platform:channel)" },
|
|
99
|
+
{ name: "volute-channel", required: true, description: "Volute channel name" }
|
|
100
|
+
],
|
|
101
|
+
flags: {},
|
|
102
|
+
run: async ({ args }) => {
|
|
103
|
+
const target = args.target;
|
|
104
|
+
const voluteChannel = args["volute-channel"];
|
|
105
|
+
const colonIdx = target.indexOf(":");
|
|
106
|
+
if (colonIdx < 1) {
|
|
107
|
+
console.error("Target must be in format platform:channel (e.g. discord:my-server/general)");
|
|
108
|
+
process.exit(1);
|
|
109
|
+
}
|
|
110
|
+
const platform = target.slice(0, colonIdx);
|
|
111
|
+
const externalChannel = target.slice(colonIdx + 1);
|
|
112
|
+
const res = await daemonFetch(`/api/bridges/${encodeURIComponent(platform)}/mappings`, {
|
|
113
|
+
method: "PUT",
|
|
114
|
+
headers: { "Content-Type": "application/json" },
|
|
115
|
+
body: JSON.stringify({ externalChannel, voluteChannel })
|
|
116
|
+
});
|
|
117
|
+
if (!res.ok) {
|
|
118
|
+
const data = await res.json().catch(() => ({}));
|
|
119
|
+
console.error(data.error ?? `Failed to set mapping: ${res.status}`);
|
|
120
|
+
process.exit(1);
|
|
121
|
+
}
|
|
122
|
+
console.log(`Mapped ${platform}:${externalChannel} \u2192 ${voluteChannel}`);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
var bridgeUnmapCmd = command({
|
|
126
|
+
name: "volute chat bridge unmap",
|
|
127
|
+
description: "Remove a channel mapping",
|
|
128
|
+
args: [{ name: "target", required: true, description: "External channel (platform:channel)" }],
|
|
129
|
+
flags: {},
|
|
130
|
+
run: async ({ args }) => {
|
|
131
|
+
const target = args.target;
|
|
132
|
+
const colonIdx = target.indexOf(":");
|
|
133
|
+
if (colonIdx < 1) {
|
|
134
|
+
console.error("Target must be in format platform:channel");
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
const platform = target.slice(0, colonIdx);
|
|
138
|
+
const externalChannel = target.slice(colonIdx + 1);
|
|
139
|
+
const res = await daemonFetch(
|
|
140
|
+
`/api/bridges/${encodeURIComponent(platform)}/mappings/${encodeURIComponent(externalChannel)}`,
|
|
141
|
+
{ method: "DELETE" }
|
|
142
|
+
);
|
|
143
|
+
if (!res.ok) {
|
|
144
|
+
console.error(`Failed to remove mapping: ${res.status}`);
|
|
145
|
+
process.exit(1);
|
|
146
|
+
}
|
|
147
|
+
console.log(`Removed mapping for ${platform}:${externalChannel}`);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
var bridgeMappingsCmd = command({
|
|
151
|
+
name: "volute chat bridge mappings",
|
|
152
|
+
description: "List channel mappings",
|
|
153
|
+
args: [{ name: "platform", description: "Filter by platform" }],
|
|
154
|
+
flags: {},
|
|
155
|
+
run: async ({ args }) => {
|
|
156
|
+
const platform = args.platform;
|
|
157
|
+
if (platform) {
|
|
158
|
+
const res = await daemonFetch(`/api/bridges/${encodeURIComponent(platform)}/mappings`);
|
|
159
|
+
if (!res.ok) {
|
|
160
|
+
console.error(`Failed to get mappings: ${res.status}`);
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
const mappings = await res.json();
|
|
164
|
+
if (Object.keys(mappings).length === 0) {
|
|
165
|
+
console.log(`No mappings for ${platform}.`);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
for (const [external, volute] of Object.entries(mappings)) {
|
|
169
|
+
console.log(` ${platform}:${external} \u2192 ${volute}`);
|
|
170
|
+
}
|
|
171
|
+
} else {
|
|
172
|
+
const res = await daemonFetch("/api/bridges");
|
|
173
|
+
if (!res.ok) {
|
|
174
|
+
console.error(`Failed to list bridges: ${res.status}`);
|
|
175
|
+
process.exit(1);
|
|
176
|
+
}
|
|
177
|
+
const bridges = await res.json();
|
|
178
|
+
let found = false;
|
|
179
|
+
for (const b of bridges) {
|
|
180
|
+
for (const [external, volute] of Object.entries(b.channelMappings)) {
|
|
181
|
+
console.log(` ${b.platform}:${external} \u2192 ${volute}`);
|
|
182
|
+
found = true;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (!found) {
|
|
186
|
+
console.log("No mappings configured.");
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
var cmd = subcommands({
|
|
192
|
+
name: "volute chat bridge",
|
|
193
|
+
description: "Manage platform bridges",
|
|
194
|
+
commands: {
|
|
195
|
+
add: { description: "Enable a bridge with a default mind", run: bridgeAddCmd.execute },
|
|
196
|
+
remove: { description: "Disable a bridge", run: bridgeRemoveCmd.execute },
|
|
197
|
+
list: { description: "Show all bridges and their status", run: bridgeListCmd.execute },
|
|
198
|
+
map: { description: "Map an external channel to a Volute channel", run: bridgeMapCmd.execute },
|
|
199
|
+
unmap: { description: "Remove a channel mapping", run: bridgeUnmapCmd.execute },
|
|
200
|
+
mappings: { description: "List channel mappings", run: bridgeMappingsCmd.execute }
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
var run = cmd.execute;
|
|
204
|
+
export {
|
|
205
|
+
run
|
|
206
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
subcommands
|
|
4
|
+
} from "./chunk-TXSA4Q3V.js";
|
|
5
|
+
import "./chunk-O7IGP7ZW.js";
|
|
6
|
+
import "./chunk-7KJOFUNN.js";
|
|
7
|
+
|
|
8
|
+
// packages/cli/src/commands/chat.ts
|
|
9
|
+
var cmd = subcommands({
|
|
10
|
+
name: "volute chat",
|
|
11
|
+
description: "Manage conversations and messages",
|
|
12
|
+
commands: {
|
|
13
|
+
send: {
|
|
14
|
+
description: "Send a message",
|
|
15
|
+
run: (args) => import("./send-LXUT2GGR.js").then((m) => m.run(args))
|
|
16
|
+
},
|
|
17
|
+
list: {
|
|
18
|
+
description: "List conversations",
|
|
19
|
+
run: (args) => import("./list-GJ4RUQQT.js").then((m) => m.run(args))
|
|
20
|
+
},
|
|
21
|
+
read: {
|
|
22
|
+
description: "Read conversation messages",
|
|
23
|
+
run: (args) => import("./read-ZUDG4JWU.js").then((m) => m.run(args))
|
|
24
|
+
},
|
|
25
|
+
create: {
|
|
26
|
+
description: "Create a conversation",
|
|
27
|
+
run: (args) => import("./create-5BPOOJAN.js").then((m) => m.run(args))
|
|
28
|
+
},
|
|
29
|
+
bridge: {
|
|
30
|
+
description: "Manage platform bridges",
|
|
31
|
+
run: (args) => import("./bridge-PXIO6PS2.js").then((m) => m.run(args))
|
|
32
|
+
},
|
|
33
|
+
files: {
|
|
34
|
+
description: "List pending incoming files",
|
|
35
|
+
run: (args) => import("./files-H2YLRD37.js").then((m) => m.run(args))
|
|
36
|
+
},
|
|
37
|
+
accept: {
|
|
38
|
+
description: "Accept a pending file",
|
|
39
|
+
run: (args) => import("./accept-ZBDVVCEU.js").then((m) => m.run(args))
|
|
40
|
+
},
|
|
41
|
+
reject: {
|
|
42
|
+
description: "Reject a pending file",
|
|
43
|
+
run: (args) => import("./reject-MUR2KWJ4.js").then((m) => m.run(args))
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
footer: "Use --mind <name> or VOLUTE_MIND to identify the mind."
|
|
47
|
+
});
|
|
48
|
+
var run = cmd.execute;
|
|
49
|
+
export {
|
|
50
|
+
run
|
|
51
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// src/lib/template.ts
|
|
3
|
+
// packages/daemon/src/lib/template/template.ts
|
|
4
4
|
import {
|
|
5
5
|
cpSync,
|
|
6
6
|
existsSync,
|
|
@@ -14,11 +14,16 @@ import {
|
|
|
14
14
|
} from "fs";
|
|
15
15
|
import { tmpdir } from "os";
|
|
16
16
|
import { dirname, join, relative, resolve } from "path";
|
|
17
|
+
var _templatesRoot = null;
|
|
17
18
|
function findTemplatesRoot() {
|
|
19
|
+
if (_templatesRoot) return _templatesRoot;
|
|
18
20
|
let dir = dirname(new URL(import.meta.url).pathname);
|
|
19
|
-
for (let i = 0; i <
|
|
21
|
+
for (let i = 0; i < 7; i++) {
|
|
20
22
|
const candidate = resolve(dir, "templates");
|
|
21
|
-
if (existsSync(resolve(candidate, "_base")))
|
|
23
|
+
if (existsSync(resolve(candidate, "_base"))) {
|
|
24
|
+
_templatesRoot = candidate;
|
|
25
|
+
return _templatesRoot;
|
|
26
|
+
}
|
|
22
27
|
dir = dirname(dir);
|
|
23
28
|
}
|
|
24
29
|
console.error(
|
|
@@ -4,35 +4,69 @@ import {
|
|
|
4
4
|
composeTemplate,
|
|
5
5
|
copyTemplateToDir,
|
|
6
6
|
findTemplatesRoot
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-46DYYHN6.js";
|
|
8
8
|
import {
|
|
9
9
|
getSharedSkill,
|
|
10
|
-
installSkill
|
|
11
|
-
|
|
10
|
+
installSkill,
|
|
11
|
+
mindSkillsDir
|
|
12
|
+
} from "./chunk-GBDVNPN2.js";
|
|
13
|
+
import {
|
|
14
|
+
readVoluteConfig,
|
|
15
|
+
writeVoluteConfig
|
|
16
|
+
} from "./chunk-CU6OFXMM.js";
|
|
12
17
|
import {
|
|
13
18
|
qualifyModelId,
|
|
14
19
|
resolveTemplate
|
|
15
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-M5RYAA5I.js";
|
|
16
21
|
import {
|
|
17
22
|
logger_default
|
|
18
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-T2TP6ZC6.js";
|
|
19
24
|
import {
|
|
20
25
|
exec
|
|
21
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-PJ4IPTIN.js";
|
|
22
27
|
import {
|
|
23
28
|
readGlobalConfig
|
|
24
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-NUX47Y2V.js";
|
|
25
30
|
import {
|
|
26
31
|
addSpirit,
|
|
27
32
|
findMind,
|
|
28
33
|
nextPort,
|
|
29
34
|
voluteSystemDir
|
|
30
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-75AJ54GM.js";
|
|
31
36
|
|
|
32
|
-
// src/lib/spirit.ts
|
|
37
|
+
// packages/daemon/src/lib/mind/spirit.ts
|
|
33
38
|
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
34
39
|
import { resolve } from "path";
|
|
35
40
|
var slog = logger_default.child("spirit");
|
|
41
|
+
var SPIRIT_SKILLS = [
|
|
42
|
+
"volute-admin",
|
|
43
|
+
"orientation",
|
|
44
|
+
"memory",
|
|
45
|
+
"seed-nurture",
|
|
46
|
+
"tending",
|
|
47
|
+
"plan-coordinator"
|
|
48
|
+
];
|
|
49
|
+
var TENDING_SCHEDULE = {
|
|
50
|
+
id: "tending",
|
|
51
|
+
cron: "0 10 * * *",
|
|
52
|
+
message: "Check on the minds in your care \u2014 see if anyone could use a suggestion about features they haven't tried yet.",
|
|
53
|
+
enabled: true,
|
|
54
|
+
whileSleeping: "skip"
|
|
55
|
+
};
|
|
56
|
+
function npmEnv() {
|
|
57
|
+
const cacheDir = resolve(voluteSystemDir(), ".npm-cache");
|
|
58
|
+
mkdirSync(cacheDir, { recursive: true });
|
|
59
|
+
return { ...process.env, npm_config_cache: cacheDir };
|
|
60
|
+
}
|
|
61
|
+
function ensureTendingSchedule(dir) {
|
|
62
|
+
const config = readVoluteConfig(dir) ?? {};
|
|
63
|
+
const schedules = config.schedules ?? [];
|
|
64
|
+
if (schedules.some((s) => s.id === "tending")) return false;
|
|
65
|
+
schedules.push({ ...TENDING_SCHEDULE });
|
|
66
|
+
config.schedules = schedules;
|
|
67
|
+
writeVoluteConfig(dir, config);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
36
70
|
function spiritDir() {
|
|
37
71
|
return resolve(voluteSystemDir(), "spirit");
|
|
38
72
|
}
|
|
@@ -71,7 +105,7 @@ async function ensureSpiritProject() {
|
|
|
71
105
|
writeFileSync(configPath, `${JSON.stringify(mindConfig, null, 2)}
|
|
72
106
|
`);
|
|
73
107
|
}
|
|
74
|
-
await exec("npm", ["install", "--ignore-scripts"], { cwd: dir });
|
|
108
|
+
await exec("npm", ["install", "--ignore-scripts"], { cwd: dir, env: npmEnv() });
|
|
75
109
|
try {
|
|
76
110
|
await exec("git", ["init"], { cwd: dir });
|
|
77
111
|
await exec("git", ["add", "-A"], { cwd: dir });
|
|
@@ -79,14 +113,7 @@ async function ensureSpiritProject() {
|
|
|
79
113
|
} catch (err) {
|
|
80
114
|
slog.warn("git init failed for spirit \u2014 not critical", logger_default.errorData(err));
|
|
81
115
|
}
|
|
82
|
-
const
|
|
83
|
-
"volute-admin",
|
|
84
|
-
"orientation",
|
|
85
|
-
"memory",
|
|
86
|
-
"seed-nurture",
|
|
87
|
-
"plan-coordinator"
|
|
88
|
-
];
|
|
89
|
-
for (const skillId of spiritSkills) {
|
|
116
|
+
for (const skillId of SPIRIT_SKILLS) {
|
|
90
117
|
try {
|
|
91
118
|
const shared = await getSharedSkill(skillId);
|
|
92
119
|
if (shared) {
|
|
@@ -96,7 +123,12 @@ async function ensureSpiritProject() {
|
|
|
96
123
|
slog.warn(`failed to install skill ${skillId} for spirit`, logger_default.errorData(err));
|
|
97
124
|
}
|
|
98
125
|
}
|
|
99
|
-
|
|
126
|
+
try {
|
|
127
|
+
ensureTendingSchedule(dir);
|
|
128
|
+
} catch (err) {
|
|
129
|
+
slog.warn("failed to add tending schedule to spirit config", logger_default.errorData(err));
|
|
130
|
+
}
|
|
131
|
+
const { createMindUser, chownMindDir, ensureVoluteGroup } = await import("./isolation-N74RWOUX.js");
|
|
100
132
|
ensureVoluteGroup();
|
|
101
133
|
createMindUser("volute", resolve(dir, "home"));
|
|
102
134
|
chownMindDir(dir, "volute");
|
|
@@ -128,10 +160,10 @@ async function syncSpiritTemplate() {
|
|
|
128
160
|
const newPkg = resolve(newComposed.composedDir, "package.json");
|
|
129
161
|
if (existsSync(newPkg)) {
|
|
130
162
|
cpSync(newPkg, resolve(dir, "package.json"));
|
|
131
|
-
await exec("npm", ["install", "--ignore-scripts"], { cwd: dir });
|
|
163
|
+
await exec("npm", ["install", "--ignore-scripts"], { cwd: dir, env: npmEnv() });
|
|
132
164
|
}
|
|
133
|
-
const db = await (await import("./db-
|
|
134
|
-
const { minds } = await import("./schema-
|
|
165
|
+
const db = await (await import("./db-URORGSXQ.js")).getDb();
|
|
166
|
+
const { minds } = await import("./schema-MISD3JFG.js");
|
|
135
167
|
const { eq } = await import("drizzle-orm");
|
|
136
168
|
await db.update(minds).set({ template: expectedTemplate }).where(eq(minds.name, "volute"));
|
|
137
169
|
}
|
|
@@ -176,16 +208,36 @@ async function syncSpiritTemplate() {
|
|
|
176
208
|
if (composedContent !== currentContent) {
|
|
177
209
|
cpSync(composedPkg, currentPkg);
|
|
178
210
|
}
|
|
179
|
-
await exec("npm", ["install", "--ignore-scripts"], { cwd: dir });
|
|
211
|
+
await exec("npm", ["install", "--ignore-scripts"], { cwd: dir, env: npmEnv() });
|
|
180
212
|
}
|
|
181
213
|
} else if (nodeModulesMissing) {
|
|
182
|
-
await exec("npm", ["install", "--ignore-scripts"], { cwd: dir });
|
|
214
|
+
await exec("npm", ["install", "--ignore-scripts"], { cwd: dir, env: npmEnv() });
|
|
183
215
|
}
|
|
184
216
|
for (const [p, content] of preserved) {
|
|
185
217
|
const full = resolve(dir, p);
|
|
186
218
|
mkdirSync(resolve(full, ".."), { recursive: true });
|
|
187
219
|
writeFileSync(full, content);
|
|
188
220
|
}
|
|
221
|
+
for (const skillId of SPIRIT_SKILLS) {
|
|
222
|
+
const skillDir = resolve(mindSkillsDir(dir), skillId);
|
|
223
|
+
if (existsSync(skillDir)) continue;
|
|
224
|
+
try {
|
|
225
|
+
const shared = await getSharedSkill(skillId);
|
|
226
|
+
if (shared) {
|
|
227
|
+
await installSkill("volute", dir, skillId);
|
|
228
|
+
slog.info(`installed missing spirit skill: ${skillId}`);
|
|
229
|
+
}
|
|
230
|
+
} catch (err) {
|
|
231
|
+
slog.warn(`failed to install spirit skill ${skillId}`, logger_default.errorData(err));
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
try {
|
|
235
|
+
if (ensureTendingSchedule(dir)) {
|
|
236
|
+
slog.info("added tending schedule to spirit");
|
|
237
|
+
}
|
|
238
|
+
} catch (err) {
|
|
239
|
+
slog.warn("failed to add tending schedule to spirit config", logger_default.errorData(err));
|
|
240
|
+
}
|
|
189
241
|
slog.info("spirit template synced");
|
|
190
242
|
}
|
|
191
243
|
function getSpiritSoul(systemName, systemDescription) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
minds,
|
|
4
4
|
schema_exports
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7PTQGPJY.js";
|
|
6
6
|
|
|
7
|
-
// src/lib/db.ts
|
|
7
|
+
// packages/daemon/src/lib/db.ts
|
|
8
8
|
import { chmodSync, existsSync } from "fs";
|
|
9
9
|
import { dirname as dirname2, resolve as resolve2 } from "path";
|
|
10
10
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
@@ -12,7 +12,7 @@ import { sql } from "drizzle-orm";
|
|
|
12
12
|
import { drizzle } from "drizzle-orm/libsql";
|
|
13
13
|
import { migrate } from "drizzle-orm/libsql/migrator";
|
|
14
14
|
|
|
15
|
-
// src/lib/registry.ts
|
|
15
|
+
// packages/daemon/src/lib/mind/registry.ts
|
|
16
16
|
import { mkdirSync } from "fs";
|
|
17
17
|
import { homedir } from "os";
|
|
18
18
|
import { dirname, resolve } from "path";
|
|
@@ -192,11 +192,21 @@ function daemonLoopback() {
|
|
|
192
192
|
return host;
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
// src/lib/db.ts
|
|
195
|
+
// packages/daemon/src/lib/db.ts
|
|
196
196
|
var __dirname = dirname2(fileURLToPath2(import.meta.url));
|
|
197
|
-
var migrationsFolder = existsSync(resolve2(__dirname, "../drizzle")) ? resolve2(__dirname, "../drizzle") : resolve2(__dirname, "../../drizzle");
|
|
197
|
+
var migrationsFolder = existsSync(resolve2(__dirname, "../drizzle")) ? resolve2(__dirname, "../drizzle") : existsSync(resolve2(__dirname, "../../drizzle")) ? resolve2(__dirname, "../../drizzle") : resolve2(__dirname, "../../../../drizzle");
|
|
198
198
|
var db = null;
|
|
199
199
|
var dbPromise = null;
|
|
200
|
+
async function cleanupConversationColumns(db2) {
|
|
201
|
+
const cols = await db2.all(sql.raw("PRAGMA table_info(conversations)"));
|
|
202
|
+
const colNames = new Set(cols.map((c) => c.name));
|
|
203
|
+
const toDrop = ["name", "title", "mind_name", "channel"].filter((c) => colNames.has(c));
|
|
204
|
+
if (toDrop.length === 0) return;
|
|
205
|
+
for (const col of toDrop) {
|
|
206
|
+
await db2.run(sql.raw(`DROP INDEX IF EXISTS idx_conversations_${col}`));
|
|
207
|
+
await db2.run(sql.raw(`ALTER TABLE conversations DROP COLUMN ${col}`));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
200
210
|
async function getDb() {
|
|
201
211
|
if (db) return db;
|
|
202
212
|
if (dbPromise) return dbPromise;
|
|
@@ -208,6 +218,7 @@ async function getDb() {
|
|
|
208
218
|
await instance.run(sql.raw("PRAGMA busy_timeout=5000"));
|
|
209
219
|
await instance.run(sql.raw("PRAGMA foreign_keys=ON"));
|
|
210
220
|
await migrate(instance, { migrationsFolder });
|
|
221
|
+
await cleanupConversationColumns(instance);
|
|
211
222
|
try {
|
|
212
223
|
chmodSync(dbPath, 384);
|
|
213
224
|
} catch (err) {
|
|
@@ -3,10 +3,11 @@ import {
|
|
|
3
3
|
__export
|
|
4
4
|
} from "./chunk-7KJOFUNN.js";
|
|
5
5
|
|
|
6
|
-
// src/lib/schema.ts
|
|
6
|
+
// packages/daemon/src/lib/schema.ts
|
|
7
7
|
var schema_exports = {};
|
|
8
8
|
__export(schema_exports, {
|
|
9
9
|
activity: () => activity,
|
|
10
|
+
channels: () => channels,
|
|
10
11
|
conversationParticipants: () => conversationParticipants,
|
|
11
12
|
conversationReads: () => conversationReads,
|
|
12
13
|
conversations: () => conversations,
|
|
@@ -59,21 +60,15 @@ var conversations = sqliteTable(
|
|
|
59
60
|
"conversations",
|
|
60
61
|
{
|
|
61
62
|
id: text("id").primaryKey(),
|
|
62
|
-
mind_name: text("mind_name"),
|
|
63
|
-
channel: text("channel").notNull(),
|
|
64
63
|
type: text("type").notNull().default("dm"),
|
|
65
|
-
name: text("name"),
|
|
66
64
|
user_id: integer("user_id").references(() => users.id),
|
|
67
|
-
title: text("title"),
|
|
68
65
|
private: integer("private").notNull().default(0),
|
|
69
66
|
created_at: text("created_at").notNull().default(sql`(datetime('now'))`),
|
|
70
67
|
updated_at: text("updated_at").notNull().default(sql`(datetime('now'))`)
|
|
71
68
|
},
|
|
72
69
|
(table) => [
|
|
73
|
-
index("idx_conversations_mind_name").on(table.mind_name),
|
|
74
70
|
index("idx_conversations_user_id").on(table.user_id),
|
|
75
|
-
index("idx_conversations_updated_at").on(table.updated_at)
|
|
76
|
-
uniqueIndex("idx_conversations_name").on(table.name)
|
|
71
|
+
index("idx_conversations_updated_at").on(table.updated_at)
|
|
77
72
|
]
|
|
78
73
|
);
|
|
79
74
|
var turns = sqliteTable(
|
|
@@ -90,7 +85,8 @@ var turns = sqliteTable(
|
|
|
90
85
|
},
|
|
91
86
|
(table) => [
|
|
92
87
|
index("idx_turns_mind").on(table.mind),
|
|
93
|
-
index("idx_turns_mind_status").on(table.mind, table.status)
|
|
88
|
+
index("idx_turns_mind_status").on(table.mind, table.status),
|
|
89
|
+
index("idx_turns_mind_created_at").on(table.mind, table.created_at)
|
|
94
90
|
]
|
|
95
91
|
);
|
|
96
92
|
var mindHistory = sqliteTable(
|
|
@@ -112,7 +108,9 @@ var mindHistory = sqliteTable(
|
|
|
112
108
|
index("idx_mind_history_mind").on(table.mind),
|
|
113
109
|
index("idx_mind_history_mind_channel").on(table.mind, table.channel),
|
|
114
110
|
index("idx_mind_history_mind_type").on(table.mind, table.type),
|
|
115
|
-
index("idx_mind_history_turn_id").on(table.turn_id)
|
|
111
|
+
index("idx_mind_history_turn_id").on(table.turn_id),
|
|
112
|
+
index("idx_mind_history_session").on(table.session),
|
|
113
|
+
index("idx_mind_history_mind_created_at").on(table.mind, table.created_at)
|
|
116
114
|
]
|
|
117
115
|
);
|
|
118
116
|
var conversationParticipants = sqliteTable(
|
|
@@ -161,7 +159,8 @@ var deliveryQueue = sqliteTable(
|
|
|
161
159
|
},
|
|
162
160
|
(table) => [
|
|
163
161
|
index("idx_delivery_queue_mind_session").on(table.mind, table.session),
|
|
164
|
-
index("idx_delivery_queue_mind_status").on(table.mind, table.status)
|
|
162
|
+
index("idx_delivery_queue_mind_status").on(table.mind, table.status),
|
|
163
|
+
index("idx_delivery_queue_status").on(table.status)
|
|
165
164
|
]
|
|
166
165
|
);
|
|
167
166
|
var activity = sqliteTable(
|
|
@@ -179,7 +178,8 @@ var activity = sqliteTable(
|
|
|
179
178
|
(table) => [
|
|
180
179
|
index("idx_activity_created_at").on(table.created_at),
|
|
181
180
|
index("idx_activity_mind").on(table.mind),
|
|
182
|
-
index("idx_activity_turn_id").on(table.turn_id)
|
|
181
|
+
index("idx_activity_turn_id").on(table.turn_id),
|
|
182
|
+
index("idx_activity_type").on(table.type)
|
|
183
183
|
]
|
|
184
184
|
);
|
|
185
185
|
var summaries = sqliteTable(
|
|
@@ -195,7 +195,8 @@ var summaries = sqliteTable(
|
|
|
195
195
|
},
|
|
196
196
|
(table) => [
|
|
197
197
|
uniqueIndex("idx_summaries_unique").on(table.mind, table.period, table.period_key),
|
|
198
|
-
index("idx_summaries_mind_period").on(table.mind, table.period)
|
|
198
|
+
index("idx_summaries_mind_period").on(table.mind, table.period),
|
|
199
|
+
index("idx_summaries_mind_period_key").on(table.mind, table.period_key)
|
|
199
200
|
]
|
|
200
201
|
);
|
|
201
202
|
var conversationReads = sqliteTable(
|
|
@@ -209,6 +210,20 @@ var conversationReads = sqliteTable(
|
|
|
209
210
|
uniqueIndex("idx_conversation_reads_unique").on(table.user_id, table.conversation_id)
|
|
210
211
|
]
|
|
211
212
|
);
|
|
213
|
+
var channels = sqliteTable(
|
|
214
|
+
"channels",
|
|
215
|
+
{
|
|
216
|
+
conversation_id: text("conversation_id").primaryKey().references(() => conversations.id, { onDelete: "cascade" }),
|
|
217
|
+
name: text("name").notNull(),
|
|
218
|
+
description: text("description"),
|
|
219
|
+
rules: text("rules"),
|
|
220
|
+
char_limit: integer("char_limit"),
|
|
221
|
+
private: integer("private").notNull().default(0),
|
|
222
|
+
created_at: text("created_at").notNull().default(sql`(datetime('now'))`),
|
|
223
|
+
updated_at: text("updated_at").notNull().default(sql`(datetime('now'))`)
|
|
224
|
+
},
|
|
225
|
+
(table) => [uniqueIndex("idx_channels_name").on(table.name)]
|
|
226
|
+
);
|
|
212
227
|
var messages = sqliteTable(
|
|
213
228
|
"messages",
|
|
214
229
|
{
|
|
@@ -241,6 +256,7 @@ export {
|
|
|
241
256
|
activity,
|
|
242
257
|
summaries,
|
|
243
258
|
conversationReads,
|
|
259
|
+
channels,
|
|
244
260
|
messages,
|
|
245
261
|
schema_exports
|
|
246
262
|
};
|