volute 0.40.2 → 0.41.1
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/dist/{accept-IVHOHXQS.js → accept-7YVHZKRD.js} +2 -2
- package/dist/{activity-events-DS4QRWBY.js → activity-events-KFKVRZE3.js} +4 -4
- package/dist/{ai-service-EVLKMAJD.js → ai-service-XCLE3MQP.js} +5 -5
- package/dist/{api-client-NFM6GX2N.js → api-client-LC5YRA32.js} +1 -1
- package/dist/{archive-UDHFZN4G.js → archive-4PPYF7LL.js} +4 -4
- package/dist/{auth-X6ZITZ7D.js → auth-EAASQPTN.js} +5 -5
- package/dist/{bridge-MSZC4HUT.js → bridge-WPYSOQKR.js} +2 -2
- package/dist/{chat-F2EEN76G.js → chat-7DOENBY2.js} +9 -9
- package/dist/{chunk-E25SO3QW.js → chunk-5QG36RV7.js} +3 -3
- package/dist/{chunk-NERYUSER.js → chunk-62ICA2FF.js} +1 -1
- package/dist/{chunk-KMHC36CA.js → chunk-763WUVJQ.js} +43 -10
- package/dist/{chunk-ITH5ZLZJ.js → chunk-BLOAJLGI.js} +1 -1
- package/dist/{chunk-4UMXOMZ6.js → chunk-CGPESELY.js} +2 -2
- package/dist/{chunk-MNUXL4XN.js → chunk-E7XWFDZL.js} +1 -1
- package/dist/{chunk-PEKG3GNZ.js → chunk-EKLRS2SX.js} +3 -3
- package/dist/{chunk-ZOI6D2YH.js → chunk-F44AEQAW.js} +292 -73
- package/dist/{chunk-JYQQDI3M.js → chunk-G777ME4L.js} +2 -2
- package/dist/{chunk-YMMYN2V3.js → chunk-GCS64EAD.js} +5 -5
- package/dist/{chunk-AEAZRTEV.js → chunk-GN52E2DP.js} +1 -1
- package/dist/{chunk-ZX7EAV5J.js → chunk-IFNSAOA4.js} +9 -2
- package/dist/{chunk-ZXPWTH4I.js → chunk-IJCZAYGT.js} +1 -1
- package/dist/{chunk-B4WPXYPI.js → chunk-IUZ3EV2D.js} +10 -1
- package/dist/chunk-K3NQKI34.js +10 -0
- package/dist/{chunk-QYI65HCL.js → chunk-K547QOCM.js} +2 -2
- package/dist/{chunk-SVXOBKQY.js → chunk-KUJVCDWT.js} +2 -2
- package/dist/{chunk-YHWGN4FX.js → chunk-M2YMNTHK.js} +1 -1
- package/dist/{chunk-DNU6XLE2.js → chunk-MA7MYEOK.js} +4 -3
- package/dist/{chunk-2HZRJ35V.js → chunk-MHFAWJCC.js} +1 -1
- package/dist/{chunk-UX7FPDDO.js → chunk-MJIJFCAH.js} +44 -15
- package/dist/{chunk-NRJ3ZYFP.js → chunk-MYJSKXGH.js} +15 -14
- package/dist/{chunk-I57LLNAQ.js → chunk-OEJFZHZZ.js} +1 -1
- package/dist/{chunk-TOANT6FD.js → chunk-OSUF75I7.js} +2 -2
- package/dist/{chunk-46DYYHN6.js → chunk-QLWG3C2Z.js} +44 -0
- package/dist/{chunk-KAB6UGOL.js → chunk-QMJCNZ6C.js} +1 -1
- package/dist/{chunk-PKGA23XM.js → chunk-QPTQKGGF.js} +1 -1
- package/dist/{chunk-6SYHHEQ7.js → chunk-TFBQESH7.js} +1 -1
- package/dist/{chunk-WOWRLBL2.js → chunk-ULNQ6OC4.js} +8 -8
- package/dist/{chunk-42UMLIQR.js → chunk-VBKRZCR7.js} +1 -1
- package/dist/{chunk-3Y7UDHO7.js → chunk-YLTIEEVL.js} +3 -3
- package/dist/cli.js +24 -24
- package/dist/{clock-YLDJUKBW.js → clock-HP2TGMG5.js} +4 -4
- package/dist/{cloud-sync-GOSJZIHH.js → cloud-sync-2XVXEOSU.js} +19 -19
- package/dist/{config-PO4EZLIK.js → config-W7MS3PWY.js} +4 -4
- package/dist/connectors/discord-bridge.js +1 -1
- package/dist/connectors/slack-bridge.js +1 -1
- package/dist/connectors/telegram-bridge.js +1 -1
- package/dist/{conversations-AYLXPOGC.js → conversations-FSZCUUYO.js} +5 -5
- package/dist/{create-ZMTGINV3.js → create-CJ2SR4EU.js} +2 -2
- package/dist/{create-Y3RGU2GI.js → create-OTM46ZUM.js} +4 -4
- package/dist/{daemon-client-H6MEKK2W.js → daemon-client-EWDPOOHC.js} +4 -2
- package/dist/{daemon-restart-FSWVXPUE.js → daemon-restart-HDVGTYH7.js} +9 -9
- package/dist/daemon.js +260 -309
- package/dist/{db-FSYOTHSN.js → db-IJL6B26S.js} +1 -1
- package/dist/db-ZJJJYJBU.js +9 -0
- package/dist/{delete-TXVOH2OC.js → delete-4ND5PLE7.js} +3 -3
- package/dist/delivery-manager-CPADWRV2.js +33 -0
- package/dist/{delivery-router-T6CYTS3M.js → delivery-router-FDBZJQOY.js} +4 -4
- package/dist/down-DS6WCT34.js +17 -0
- package/dist/echo-text-GEDEEY7M.js +32 -0
- package/dist/{env-77IOWG4U.js → env-XX2MBZCZ.js} +2 -2
- package/dist/exec-ZDD7NEB4.js +17 -0
- package/dist/{export-TZKOCSCE.js → export-5DOQV2WM.js} +6 -6
- package/dist/{extension-35NB6GHW.js → extension-BCFYXI7A.js} +5 -2
- package/dist/{extensions-MD757RFY.js → extensions-SU3N4COT.js} +19 -19
- package/dist/{files-WNNVJWJB.js → files-K2MEMV3W.js} +5 -5
- package/dist/{import-BNNFCQ7U.js → import-V6QEHMPQ.js} +11 -11
- package/dist/{isolation-4Q4P7HRV.js → isolation-F7ABZMDA.js} +4 -4
- package/dist/{join-E2EJEXZO.js → join-4S3KT7NE.js} +3 -3
- package/dist/{list-BYCEDASJ.js → list-XJB5WII6.js} +2 -2
- package/dist/{login-Y6UAYQVO.js → login-PHMTLNUF.js} +4 -4
- package/dist/{login-JNSIYFVH.js → login-YWD6PUOT.js} +2 -2
- package/dist/{logout-VHGWVH63.js → logout-BP3R3CAA.js} +4 -4
- package/dist/{logout-M6FI62BL.js → logout-Q2WICH4V.js} +2 -2
- package/dist/message-delivery-HPMELC4Q.js +41 -0
- package/dist/{mind-OOB2LEVC.js → mind-APS4URT7.js} +19 -19
- package/dist/{mind-activity-tracker-GJ5RJS32.js → mind-activity-tracker-HWVFE533.js} +5 -5
- package/dist/{mind-history-W4JPTPTV.js → mind-history-TDUQFYAG.js} +2 -2
- package/dist/{mind-list-QROHCLGT.js → mind-list-2T353Q5G.js} +2 -2
- package/dist/mind-manager-74XQZEGX.js +33 -0
- package/dist/{mind-profile-3LNKXNPA.js → mind-profile-2HHR7LZ7.js} +2 -2
- package/dist/mind-service-XGXSMQP6.js +37 -0
- package/dist/{mind-sleep-PVCMLTAH.js → mind-sleep-4NXV4J4U.js} +2 -2
- package/dist/{mind-status-RAJFLRCN.js → mind-status-CG66OXDK.js} +2 -2
- package/dist/{mind-wake-HZUOVE7J.js → mind-wake-TNB54DBR.js} +2 -2
- package/dist/{package-PPA3VWS2.js → package-MVFX22K5.js} +4 -2
- package/dist/{read-OOINVR2H.js → read-JLR4NQXU.js} +2 -2
- package/dist/{read-stdin-P6HCZUAA.js → read-stdin-4B5UYPPM.js} +1 -1
- package/dist/{register-ISOH34RF.js → register-IQ2M4UO6.js} +2 -2
- package/dist/{registry-GV35XFT7.js → registry-MDLNPTTI.js} +7 -3
- package/dist/{reject-ZBWP62X5.js → reject-N2D4CZND.js} +2 -2
- package/dist/{restart-QBJV5455.js → restart-43A5MBGV.js} +2 -2
- package/dist/{sandbox-5R32QKWQ.js → sandbox-ND53WZVU.js} +9 -5
- package/dist/scheduler-MEBQF5MW.js +31 -0
- package/dist/{schema-LYQUDL7G.js → schema-HHYJDG7B.js} +2 -2
- package/dist/{seed-BTAHXCO5.js → seed-L4XFZ3VX.js} +2 -2
- package/dist/{seed-check-3WXXRHTC.js → seed-check-N5ALJBT6.js} +2 -2
- package/dist/{seed-cmd-VEJNJBAQ.js → seed-cmd-NSTPYJFC.js} +4 -4
- package/dist/{seed-create-LOU5RALI.js → seed-create-ZYCZC46W.js} +6 -6
- package/dist/{seed-sprout-BXF5TBXD.js → seed-sprout-YXHU73XA.js} +12 -12
- package/dist/{send-WO3CVG73.js → send-KQECN2EL.js} +5 -5
- package/dist/{service-WMV6R6VJ.js → service-Q5OVY5AK.js} +6 -6
- package/dist/service-install-GTDUHP6R.js +17 -0
- package/dist/{setup-OTEC3ZPM.js → setup-FPFWDMXD.js} +4 -4
- package/dist/{setup-W3545462.js → setup-RMR3TKCR.js} +9 -9
- package/dist/{skill-QHACP7EU.js → skill-E43BI34Y.js} +2 -2
- package/dist/skills/imagegen/scripts/imagegen.ts +1 -1
- package/dist/{skills-3P7VQA4U.js → skills-AOZF6U2B.js} +7 -7
- package/dist/sleep-manager-OHM3TO62.js +35 -0
- package/dist/spirit-ONLRFATY.js +24 -0
- package/dist/{split-7AO4IO42.js → split-5IBUODEE.js} +3 -3
- package/dist/{sprout-AQICF7WZ.js → sprout-2KJOQZCL.js} +2 -2
- package/dist/{src-2IMB3V27.js → src-L2Z7X5UT.js} +6 -9
- package/dist/{src-XNUXP2FP.js → src-O4PRLMKM.js} +1 -1
- package/dist/src-TJ7RBU5H.js +2191 -0
- package/dist/{start-2U57BBK7.js → start-5AYFGNS7.js} +2 -2
- package/dist/{status-BRYYYO7C.js → status-ECZHHSY5.js} +7 -7
- package/dist/{stop-QILBDUAR.js → stop-WJ6IG6OK.js} +2 -2
- package/dist/system-chat-HZUKBIKJ.js +35 -0
- package/dist/{systems-3XTAHA35.js → systems-5MA57Q7G.js} +5 -5
- package/dist/{tailscale-X4HRKRTW.js → tailscale-TIRTGM6E.js} +3 -3
- package/dist/template-hash-446HHH5V.js +9 -0
- package/dist/{turn-tracker-AI6WWEBA.js → turn-tracker-TIX4DY2W.js} +6 -6
- package/dist/up-7KVNER6V.js +19 -0
- package/dist/{update-OY2JYXYK.js → update-OPR4KU4M.js} +7 -7
- package/dist/{update-check-IUB7QHAF.js → update-check-OG27AL4Z.js} +4 -4
- package/dist/{upgrade-25J6AE47.js → upgrade-QB7AHIKX.js} +3 -3
- package/dist/{variant-5LQOPCQA.js → variant-HHDTW74J.js} +1 -1
- package/dist/{version-notify-DK6AHWX7.js → version-notify-UFFDUPCX.js} +21 -21
- package/dist/{volute-config-7FO6QKWU.js → volute-config-TS62GS6A.js} +1 -1
- package/package.json +3 -1
- package/packages/extensions/plan/skills/plan/scripts/plan-hook.sh +2 -2
- package/templates/_base/.init/.config/hooks/pre-prompt/session-activity.ts +3 -3
- package/templates/_base/.init/.local/hooks/pre-prompt/notices.ts +3 -3
- package/templates/_base/.init/.local/hooks/pre-prompt/session-activity.ts +3 -3
- package/templates/_base/src/lib/daemon-client.ts +1 -1
- package/templates/_base/src/lib/volute-server.ts +1 -1
- package/dist/chunk-LMMQX4CK.js +0 -49
- package/dist/db-ZEPKEJJD.js +0 -9
- package/dist/delivery-manager-3NTCDKHR.js +0 -33
- package/dist/down-6DYO2QV7.js +0 -17
- package/dist/echo-text-JUNRP4ER.js +0 -32
- package/dist/exec-5DGKQ5V3.js +0 -17
- package/dist/message-delivery-Q7TU24IA.js +0 -41
- package/dist/mind-manager-4NFK4GEU.js +0 -31
- package/dist/mind-service-X7FH3NA4.js +0 -37
- package/dist/scheduler-PDARH4CE.js +0 -31
- package/dist/service-install-W3FQXJKB.js +0 -17
- package/dist/sleep-manager-TTNOLIX5.js +0 -35
- package/dist/spirit-T6GK5GEP.js +0 -24
- package/dist/src-OS75U2O7.js +0 -241910
- package/dist/system-chat-7CA2PP6A.js +0 -35
- package/dist/template-hash-DMHSLRDX.js +0 -9
- package/dist/up-PKNNDN6M.js +0 -19
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
pollHealthDown,
|
|
9
9
|
readDaemonConfig,
|
|
10
10
|
stopService
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-CGPESELY.js";
|
|
12
12
|
import {
|
|
13
13
|
voluteSystemDir
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
15
15
|
|
|
16
16
|
// src/commands/down.ts
|
|
17
17
|
import { existsSync, readFileSync, unlinkSync } from "fs";
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
aiCompleteUtility
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IJCZAYGT.js";
|
|
5
5
|
import {
|
|
6
6
|
logger_default
|
|
7
7
|
} from "./chunk-T2TP6ZC6.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
11
11
|
import {
|
|
12
12
|
messages,
|
|
13
13
|
mindHistory,
|
|
14
14
|
summaries,
|
|
15
15
|
systemPrompts,
|
|
16
16
|
turns
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MHFAWJCC.js";
|
|
18
18
|
|
|
19
19
|
// packages/daemon/src/lib/daemon/turn-tracker.ts
|
|
20
20
|
import { randomUUID } from "crypto";
|
|
@@ -1013,11 +1013,11 @@ var Summarizer = class {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
};
|
|
1015
1015
|
async function reconcileWedgedTurns(idleMs) {
|
|
1016
|
-
const { sweepWedgedTurns: sweepWedgedTurns2, summarizeOrphanedTurns: summarizeOrphanedTurns2 } = await import("./turn-tracker-
|
|
1016
|
+
const { sweepWedgedTurns: sweepWedgedTurns2, summarizeOrphanedTurns: summarizeOrphanedTurns2 } = await import("./turn-tracker-TIX4DY2W.js");
|
|
1017
1017
|
const wedged = await sweepWedgedTurns2(idleMs);
|
|
1018
1018
|
if (wedged.length === 0) return;
|
|
1019
1019
|
summarizeOrphanedTurns2(wedged);
|
|
1020
|
-
const { tryGetDeliveryManager } = await import("./delivery-manager-
|
|
1020
|
+
const { tryGetDeliveryManager } = await import("./delivery-manager-CPADWRV2.js");
|
|
1021
1021
|
const dm = tryGetDeliveryManager();
|
|
1022
1022
|
if (!dm) return;
|
|
1023
1023
|
for (const t of wedged) {
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
import { existsSync, readFileSync } from "fs";
|
|
5
5
|
import { homedir } from "os";
|
|
6
6
|
import { resolve } from "path";
|
|
7
|
+
import { Agent } from "undici";
|
|
8
|
+
var daemonDispatcher = new Agent({ headersTimeout: 0, bodyTimeout: 0 });
|
|
7
9
|
function voluteUserHome() {
|
|
8
10
|
return process.env.VOLUTE_USER_HOME ?? resolve(homedir(), ".volute");
|
|
9
11
|
}
|
|
@@ -83,7 +85,7 @@ function resolveDaemonUrl() {
|
|
|
83
85
|
async function daemonFetch(path, options) {
|
|
84
86
|
const url = resolveDaemonUrl();
|
|
85
87
|
const headers = new Headers(options?.headers);
|
|
86
|
-
const daemonToken = process.env.
|
|
88
|
+
const daemonToken = process.env.VOLUTE_MIND_TOKEN;
|
|
87
89
|
const cliSession = daemonToken ? null : readCliSession();
|
|
88
90
|
if (daemonToken) {
|
|
89
91
|
headers.set("Authorization", `Bearer ${daemonToken}`);
|
|
@@ -96,7 +98,11 @@ async function daemonFetch(path, options) {
|
|
|
96
98
|
headers.set("X-Volute-Session", voluteSession);
|
|
97
99
|
}
|
|
98
100
|
try {
|
|
99
|
-
const res = await fetch(`${url}${path}`, {
|
|
101
|
+
const res = await fetch(`${url}${path}`, {
|
|
102
|
+
...options,
|
|
103
|
+
headers,
|
|
104
|
+
dispatcher: daemonDispatcher
|
|
105
|
+
});
|
|
100
106
|
if (res.status === 401 && !path.startsWith("/api/auth/")) {
|
|
101
107
|
if (cliSession) {
|
|
102
108
|
console.error("Session expired. Run `volute login` again.");
|
|
@@ -116,6 +122,7 @@ async function daemonFetch(path, options) {
|
|
|
116
122
|
}
|
|
117
123
|
|
|
118
124
|
export {
|
|
125
|
+
daemonDispatcher,
|
|
119
126
|
readSessionFile,
|
|
120
127
|
resolveDaemonUrl,
|
|
121
128
|
daemonFetch
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
minds,
|
|
4
4
|
schema_exports
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MHFAWJCC.js";
|
|
6
6
|
|
|
7
7
|
// packages/daemon/src/lib/db.ts
|
|
8
8
|
import { chmodSync, existsSync } from "fs";
|
|
@@ -147,6 +147,10 @@ async function setMindTemplateHash(name, hash) {
|
|
|
147
147
|
const db2 = await getDb();
|
|
148
148
|
await db2.update(minds).set({ template_hash: hash }).where(eq(minds.name, name));
|
|
149
149
|
}
|
|
150
|
+
async function setMindTemplate(name, template) {
|
|
151
|
+
const db2 = await getDb();
|
|
152
|
+
await db2.update(minds).set({ template }).where(eq(minds.name, name));
|
|
153
|
+
}
|
|
150
154
|
async function findMind(name) {
|
|
151
155
|
const db2 = await getDb();
|
|
152
156
|
const rows = await db2.select().from(minds).where(eq(minds.name, name));
|
|
@@ -175,6 +179,9 @@ async function resolveMindDir(name) {
|
|
|
175
179
|
function stateDir(name) {
|
|
176
180
|
return resolve(voluteSystemDir(), "state", name);
|
|
177
181
|
}
|
|
182
|
+
function mindTmpDir(dir) {
|
|
183
|
+
return resolve(dir, ".mind", "tmp");
|
|
184
|
+
}
|
|
178
185
|
async function nextPort() {
|
|
179
186
|
const db2 = await getDb();
|
|
180
187
|
const rows = await db2.select({ port: minds.port }).from(minds);
|
|
@@ -255,12 +262,14 @@ export {
|
|
|
255
262
|
setMindRunning,
|
|
256
263
|
setMindStage,
|
|
257
264
|
setMindTemplateHash,
|
|
265
|
+
setMindTemplate,
|
|
258
266
|
findMind,
|
|
259
267
|
findVariants,
|
|
260
268
|
getBaseName,
|
|
261
269
|
mindDir,
|
|
262
270
|
resolveMindDir,
|
|
263
271
|
stateDir,
|
|
272
|
+
mindTmpDir,
|
|
264
273
|
nextPort,
|
|
265
274
|
daemonLoopback
|
|
266
275
|
};
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-T2TP6ZC6.js";
|
|
5
5
|
import {
|
|
6
6
|
getDb
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
8
8
|
import {
|
|
9
9
|
activity
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MHFAWJCC.js";
|
|
11
11
|
|
|
12
12
|
// packages/daemon/src/lib/events/activity-events.ts
|
|
13
13
|
var subscribers = /* @__PURE__ */ new Set();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
setBridgeConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QPTQKGGF.js";
|
|
5
5
|
import {
|
|
6
6
|
readEnv,
|
|
7
7
|
sharedEnvPath,
|
|
8
8
|
writeEnv
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BLOAJLGI.js";
|
|
10
10
|
|
|
11
11
|
// packages/daemon/src/lib/template/import-utils.ts
|
|
12
12
|
import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "fs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
voluteSystemDir
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
5
5
|
|
|
6
6
|
// packages/daemon/src/lib/config/setup.ts
|
|
7
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
7
|
+
import { chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
8
8
|
import { resolve } from "path";
|
|
9
9
|
function configPath() {
|
|
10
10
|
return resolve(voluteSystemDir(), "config.json");
|
|
@@ -36,7 +36,8 @@ function writeGlobalConfig(config) {
|
|
|
36
36
|
const path = configPath();
|
|
37
37
|
mkdirSync(voluteSystemDir(), { recursive: true });
|
|
38
38
|
writeFileSync(path, `${JSON.stringify(config, null, 2)}
|
|
39
|
-
|
|
39
|
+
`, { mode: 384 });
|
|
40
|
+
chmodSync(path, 384);
|
|
40
41
|
_cachedConfig = { config, ts: Date.now() };
|
|
41
42
|
}
|
|
42
43
|
function isSetupComplete() {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import {
|
|
3
3
|
exec,
|
|
4
4
|
gitExec
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-GN52E2DP.js";
|
|
6
6
|
import {
|
|
7
7
|
readGlobalConfig,
|
|
8
8
|
writeGlobalConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MA7MYEOK.js";
|
|
10
10
|
import {
|
|
11
11
|
logger_default
|
|
12
12
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -15,10 +15,10 @@ import {
|
|
|
15
15
|
mindDir,
|
|
16
16
|
readRegistry,
|
|
17
17
|
voluteHome
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
19
19
|
import {
|
|
20
20
|
sharedSkills
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-MHFAWJCC.js";
|
|
22
22
|
|
|
23
23
|
// packages/daemon/src/lib/skills.ts
|
|
24
24
|
import { createHash } from "crypto";
|
|
@@ -46,7 +46,7 @@ async function initDefaultSkills() {
|
|
|
46
46
|
const config = readGlobalConfig();
|
|
47
47
|
let extensionSkills = [];
|
|
48
48
|
try {
|
|
49
|
-
const { getExtensionStandardSkills } = await import("./extensions-
|
|
49
|
+
const { getExtensionStandardSkills } = await import("./extensions-SU3N4COT.js");
|
|
50
50
|
extensionSkills = getExtensionStandardSkills();
|
|
51
51
|
} catch (err) {
|
|
52
52
|
logger_default.warn("failed to load extension standard skills during init", logger_default.errorData(err));
|
|
@@ -129,14 +129,24 @@ async function importSkillFromDir(sourceDir, author) {
|
|
|
129
129
|
throw new Error("Invalid skill directory name");
|
|
130
130
|
}
|
|
131
131
|
validateSkillId(id);
|
|
132
|
+
const db = await getDb();
|
|
133
|
+
const existing = await db.select().from(sharedSkills).where(eq(sharedSkills.id, id)).get();
|
|
134
|
+
if (existing && existing.author !== author) {
|
|
135
|
+
const existingProtected = existing.author === "volute" || existing.author.startsWith("ext:");
|
|
136
|
+
const callerProtected = author === "volute" || author.startsWith("ext:");
|
|
137
|
+
const reclaim = callerProtected && !existingProtected;
|
|
138
|
+
if (!reclaim) {
|
|
139
|
+
throw new Error(
|
|
140
|
+
existingProtected ? `Cannot overwrite protected skill "${id}" (authored by "${existing.author}")` : `Cannot overwrite skill "${id}" authored by "${existing.author}"`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
132
144
|
const destDir = join(sharedSkillsDir(), id);
|
|
133
145
|
if (existsSync(destDir)) rmSync(destDir, { recursive: true });
|
|
134
146
|
mkdirSync(destDir, { recursive: true });
|
|
135
147
|
cpSync(sourceDir, destDir, { recursive: true });
|
|
136
148
|
const upstreamPath = join(destDir, ".upstream.json");
|
|
137
149
|
if (existsSync(upstreamPath)) rmSync(upstreamPath);
|
|
138
|
-
const db = await getDb();
|
|
139
|
-
const existing = await db.select().from(sharedSkills).where(eq(sharedSkills.id, id)).get();
|
|
140
150
|
const version = existing ? existing.version + 1 : 1;
|
|
141
151
|
await db.insert(sharedSkills).values({ id, name: name || id, description, author, version }).onConflictDoUpdate({
|
|
142
152
|
target: sharedSkills.id,
|
|
@@ -219,8 +229,14 @@ async function installSkill(_mindName, dir, skillId) {
|
|
|
219
229
|
);
|
|
220
230
|
}
|
|
221
231
|
}
|
|
222
|
-
|
|
223
|
-
|
|
232
|
+
try {
|
|
233
|
+
installHookShims(dir, skillId, hooks);
|
|
234
|
+
if (bin) installBinShim(dir, skillId, bin);
|
|
235
|
+
} catch (e) {
|
|
236
|
+
removeHookShims(dir, skillId);
|
|
237
|
+
rmSync(destDir, { recursive: true });
|
|
238
|
+
throw e;
|
|
239
|
+
}
|
|
224
240
|
}
|
|
225
241
|
let installNotes = null;
|
|
226
242
|
const installMdPath = join(destDir, "references", "INSTALL.md");
|
|
@@ -457,26 +473,31 @@ function removeHookShims(dir, skillId) {
|
|
|
457
473
|
if (existsSync(shimPath)) rmSync(shimPath);
|
|
458
474
|
}
|
|
459
475
|
}
|
|
476
|
+
var BIN_SHIM_MARKER = "# volute-skill:";
|
|
460
477
|
function binShimContent(skillId, scriptPath, skillsSubdir) {
|
|
461
478
|
const skillScriptPath = `${skillsSubdir}/${skillId}/${scriptPath}`;
|
|
462
479
|
const ext = scriptPath.split(".").pop() ?? "sh";
|
|
480
|
+
const header = `#!/bin/bash
|
|
481
|
+
${BIN_SHIM_MARKER} ${skillId}
|
|
482
|
+
`;
|
|
463
483
|
if (ext === "ts") {
|
|
464
|
-
return
|
|
465
|
-
exec node --import tsx ${skillScriptPath} "$@"
|
|
484
|
+
return `${header}exec node --import tsx ${skillScriptPath} "$@"
|
|
466
485
|
`;
|
|
467
486
|
}
|
|
468
487
|
if (ext === "js") {
|
|
469
|
-
return
|
|
470
|
-
exec node ${skillScriptPath} "$@"
|
|
488
|
+
return `${header}exec node ${skillScriptPath} "$@"
|
|
471
489
|
`;
|
|
472
490
|
}
|
|
473
|
-
return
|
|
474
|
-
exec bash ${skillScriptPath} "$@"
|
|
491
|
+
return `${header}exec bash ${skillScriptPath} "$@"
|
|
475
492
|
`;
|
|
476
493
|
}
|
|
477
494
|
function binCommandName(scriptPath) {
|
|
478
495
|
return basename(scriptPath).replace(/\.[^.]+$/, "");
|
|
479
496
|
}
|
|
497
|
+
function binShimOwner(shimPath) {
|
|
498
|
+
const line = readFileSync(shimPath, "utf-8").split("\n").find((l) => l.startsWith(BIN_SHIM_MARKER));
|
|
499
|
+
return line?.slice(BIN_SHIM_MARKER.length).trim() || void 0;
|
|
500
|
+
}
|
|
480
501
|
function installBinShim(dir, skillId, scriptPath) {
|
|
481
502
|
const home = resolve(dir, "home");
|
|
482
503
|
const skillsSubdir = mindSkillsDir(dir).slice(home.length + 1);
|
|
@@ -484,6 +505,14 @@ function installBinShim(dir, skillId, scriptPath) {
|
|
|
484
505
|
mkdirSync(binDir, { recursive: true });
|
|
485
506
|
const cmdName = binCommandName(scriptPath);
|
|
486
507
|
const shimPath = join(binDir, cmdName);
|
|
508
|
+
if (existsSync(shimPath)) {
|
|
509
|
+
const owner = binShimOwner(shimPath);
|
|
510
|
+
if (owner && owner !== skillId) {
|
|
511
|
+
throw new Error(
|
|
512
|
+
`Bin command "${cmdName}" is already provided by skill "${owner}"; skill "${skillId}" cannot overwrite it`
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
487
516
|
writeFileSync(shimPath, binShimContent(skillId, scriptPath, skillsSubdir), { mode: 493 });
|
|
488
517
|
}
|
|
489
518
|
function removeBinShim(dir, scriptPath) {
|
|
@@ -3,27 +3,28 @@ import {
|
|
|
3
3
|
applyInitFiles,
|
|
4
4
|
composeTemplate,
|
|
5
5
|
copyTemplateToDir,
|
|
6
|
-
findTemplatesRoot
|
|
7
|
-
|
|
6
|
+
findTemplatesRoot,
|
|
7
|
+
renderComposedPackageJson
|
|
8
|
+
} from "./chunk-QLWG3C2Z.js";
|
|
8
9
|
import {
|
|
9
10
|
getSharedSkill,
|
|
10
11
|
installSkill,
|
|
11
12
|
mindSkillsDir
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MJIJFCAH.js";
|
|
13
14
|
import {
|
|
14
15
|
readVoluteConfig,
|
|
15
16
|
writeVoluteConfig
|
|
16
17
|
} from "./chunk-CU6OFXMM.js";
|
|
17
18
|
import {
|
|
18
19
|
exec
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-GN52E2DP.js";
|
|
20
21
|
import {
|
|
21
22
|
qualifyModelId,
|
|
22
23
|
resolveTemplate
|
|
23
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-IJCZAYGT.js";
|
|
24
25
|
import {
|
|
25
26
|
readGlobalConfig
|
|
26
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-MA7MYEOK.js";
|
|
27
28
|
import {
|
|
28
29
|
logger_default
|
|
29
30
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -32,7 +33,7 @@ import {
|
|
|
32
33
|
findMind,
|
|
33
34
|
nextPort,
|
|
34
35
|
voluteSystemDir
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
36
37
|
|
|
37
38
|
// packages/daemon/src/lib/mind/spirit.ts
|
|
38
39
|
import { cpSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
@@ -128,7 +129,7 @@ async function ensureSpiritProject() {
|
|
|
128
129
|
} catch (err) {
|
|
129
130
|
slog.warn("failed to add tending schedule to spirit config", logger_default.errorData(err));
|
|
130
131
|
}
|
|
131
|
-
const { createMindUser, chownMindDir, ensureVoluteGroup } = await import("./isolation-
|
|
132
|
+
const { createMindUser, chownMindDir, ensureVoluteGroup } = await import("./isolation-F7ABZMDA.js");
|
|
132
133
|
ensureVoluteGroup();
|
|
133
134
|
createMindUser("volute", resolve(dir, "home"));
|
|
134
135
|
chownMindDir(dir, "volute");
|
|
@@ -157,13 +158,13 @@ async function syncSpiritTemplate() {
|
|
|
157
158
|
if (existsSync(newSrc)) {
|
|
158
159
|
cpSync(newSrc, resolve(dir, "src"), { recursive: true });
|
|
159
160
|
}
|
|
160
|
-
const newPkg =
|
|
161
|
-
if (
|
|
161
|
+
const newPkg = renderComposedPackageJson(newComposed.composedDir, "volute");
|
|
162
|
+
if (newPkg) {
|
|
162
163
|
cpSync(newPkg, resolve(dir, "package.json"));
|
|
163
164
|
await exec("npm", ["install"], { cwd: dir, env: npmEnv() });
|
|
164
165
|
}
|
|
165
|
-
const db = await (await import("./db-
|
|
166
|
-
const { minds } = await import("./schema-
|
|
166
|
+
const db = await (await import("./db-ZJJJYJBU.js")).getDb();
|
|
167
|
+
const { minds } = await import("./schema-HHYJDG7B.js");
|
|
167
168
|
const { eq } = await import("drizzle-orm");
|
|
168
169
|
await db.update(minds).set({ template: expectedTemplate }).where(eq(minds.name, "volute"));
|
|
169
170
|
}
|
|
@@ -198,10 +199,10 @@ async function syncSpiritTemplate() {
|
|
|
198
199
|
`);
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
|
-
const composedPkg =
|
|
202
|
+
const composedPkg = renderComposedPackageJson(composedDir, "volute");
|
|
202
203
|
const currentPkg = resolve(dir, "package.json");
|
|
203
204
|
const nodeModulesMissing = !existsSync(resolve(dir, "node_modules"));
|
|
204
|
-
if (
|
|
205
|
+
if (composedPkg) {
|
|
205
206
|
const composedContent = readFileSync(composedPkg, "utf-8");
|
|
206
207
|
const currentContent = existsSync(currentPkg) ? readFileSync(currentPkg, "utf-8") : "";
|
|
207
208
|
if (composedContent !== currentContent || nodeModulesMissing) {
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
LAUNCHD_PLIST_LABEL,
|
|
4
4
|
LAUNCHD_PLIST_PATH,
|
|
5
5
|
USER_SYSTEMD_UNIT
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CGPESELY.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveVoluteBin
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-GN52E2DP.js";
|
|
10
10
|
|
|
11
11
|
// packages/daemon/src/lib/config/service-install.ts
|
|
12
12
|
import { execFile } from "child_process";
|
|
@@ -78,6 +78,15 @@ function copyTemplateToDir(composedDir, destDir, mindName, manifest) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
+
function renderComposedPackageJson(composedDir, mindName) {
|
|
82
|
+
const dest = resolve(composedDir, "package.json");
|
|
83
|
+
if (existsSync(dest)) return dest;
|
|
84
|
+
const tmpl = resolve(composedDir, "package.json.tmpl");
|
|
85
|
+
if (!existsSync(tmpl)) return null;
|
|
86
|
+
const content = readFileSync(tmpl, "utf-8").replaceAll("{{name}}", mindName);
|
|
87
|
+
writeFileSync(dest, content);
|
|
88
|
+
return dest;
|
|
89
|
+
}
|
|
81
90
|
function applyInitFiles(destDir) {
|
|
82
91
|
const initDir = resolve(destDir, ".init");
|
|
83
92
|
if (!existsSync(initDir)) return;
|
|
@@ -93,6 +102,38 @@ function applyInitFiles(destDir) {
|
|
|
93
102
|
}
|
|
94
103
|
rmSync(initDir, { recursive: true, force: true });
|
|
95
104
|
}
|
|
105
|
+
var MECHANICS_DOCS = {
|
|
106
|
+
claude: "CLAUDE.md",
|
|
107
|
+
pi: "MINDS.md",
|
|
108
|
+
codex: "AGENTS.md"
|
|
109
|
+
};
|
|
110
|
+
function isKnownTemplate(template) {
|
|
111
|
+
return template in MECHANICS_DOCS;
|
|
112
|
+
}
|
|
113
|
+
function applyTemplateHomeFiles(homeDir, template) {
|
|
114
|
+
const root = findTemplatesRoot();
|
|
115
|
+
const newDoc = MECHANICS_DOCS[template];
|
|
116
|
+
const newDocSrc = newDoc ? resolve(root, template, ".init", newDoc) : void 0;
|
|
117
|
+
if (!newDocSrc || !existsSync(newDocSrc)) {
|
|
118
|
+
throw new Error(`No mechanics doc for template "${template}"`);
|
|
119
|
+
}
|
|
120
|
+
for (const doc of Object.values(MECHANICS_DOCS)) {
|
|
121
|
+
rmSync(resolve(homeDir, doc), { force: true });
|
|
122
|
+
}
|
|
123
|
+
cpSync(newDocSrc, resolve(homeDir, newDoc));
|
|
124
|
+
const settingsDest = resolve(homeDir, ".claude", "settings.json");
|
|
125
|
+
if (template === "claude") {
|
|
126
|
+
mkdirSync(dirname(settingsDest), { recursive: true });
|
|
127
|
+
cpSync(resolve(root, "claude", ".init", ".claude", "settings.json"), settingsDest);
|
|
128
|
+
} else {
|
|
129
|
+
rmSync(settingsDest, { force: true });
|
|
130
|
+
}
|
|
131
|
+
const templateConfig = resolve(root, template, "home", ".config", "config.json.tmpl");
|
|
132
|
+
const configTmpl = existsSync(templateConfig) ? templateConfig : resolve(root, "_base", "home", ".config", "config.json.tmpl");
|
|
133
|
+
const configDest = resolve(homeDir, ".config", "config.json");
|
|
134
|
+
mkdirSync(dirname(configDest), { recursive: true });
|
|
135
|
+
writeFileSync(configDest, readFileSync(configTmpl, "utf-8"));
|
|
136
|
+
}
|
|
96
137
|
function listFiles(dir) {
|
|
97
138
|
const results = [];
|
|
98
139
|
function walk(current) {
|
|
@@ -114,6 +155,9 @@ export {
|
|
|
114
155
|
findTemplatesRoot,
|
|
115
156
|
composeTemplate,
|
|
116
157
|
copyTemplateToDir,
|
|
158
|
+
renderComposedPackageJson,
|
|
117
159
|
applyInitFiles,
|
|
160
|
+
isKnownTemplate,
|
|
161
|
+
applyTemplateHomeFiles,
|
|
118
162
|
listFiles
|
|
119
163
|
};
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
findBridgeForChannel,
|
|
4
4
|
getBridgeConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QPTQKGGF.js";
|
|
6
6
|
import {
|
|
7
7
|
recordOutbound
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-F44AEQAW.js";
|
|
9
9
|
import {
|
|
10
10
|
readEnv,
|
|
11
11
|
sharedEnvPath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BLOAJLGI.js";
|
|
13
13
|
import {
|
|
14
14
|
addMessage,
|
|
15
15
|
findDMConversation,
|
|
@@ -17,17 +17,17 @@ import {
|
|
|
17
17
|
getChannelName,
|
|
18
18
|
getConversation,
|
|
19
19
|
getParticipants
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-YLTIEEVL.js";
|
|
21
21
|
import {
|
|
22
22
|
readVoluteConfig
|
|
23
23
|
} from "./chunk-CU6OFXMM.js";
|
|
24
24
|
import {
|
|
25
25
|
publish
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-GCS64EAD.js";
|
|
27
27
|
import {
|
|
28
28
|
getOrCreateMindUser,
|
|
29
29
|
getUserByUsername
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-5QG36RV7.js";
|
|
31
31
|
import {
|
|
32
32
|
logger_default
|
|
33
33
|
} from "./chunk-T2TP6ZC6.js";
|
|
@@ -37,10 +37,10 @@ import {
|
|
|
37
37
|
import {
|
|
38
38
|
mindDir,
|
|
39
39
|
voluteSystemDir
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
41
41
|
import {
|
|
42
42
|
__export
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-K3NQKI34.js";
|
|
44
44
|
|
|
45
45
|
// packages/platforms/src/drivers/discord.ts
|
|
46
46
|
var discord_exports = {};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
subscribe
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-K547QOCM.js";
|
|
5
5
|
import {
|
|
6
6
|
logger_default
|
|
7
7
|
} from "./chunk-T2TP6ZC6.js";
|
|
8
8
|
import {
|
|
9
9
|
getDb
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IUZ3EV2D.js";
|
|
11
11
|
import {
|
|
12
12
|
channels,
|
|
13
13
|
conversationParticipants,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
conversations,
|
|
16
16
|
messages,
|
|
17
17
|
users
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-MHFAWJCC.js";
|
|
19
19
|
|
|
20
20
|
// packages/daemon/src/lib/events/conversations.ts
|
|
21
21
|
import { randomUUID } from "crypto";
|