volute 0.42.1 → 0.43.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/{activity-events-KFKVRZE3.js → activity-events-UISXY4Y5.js} +3 -3
- package/dist/{ai-service-3GBOJGUA.js → ai-service-FBCCEYF5.js} +8 -4
- package/dist/{archive-4PPYF7LL.js → archive-I32WHCJB.js} +3 -3
- package/dist/{auth-EAASQPTN.js → auth-3RIG6GKN.js} +4 -4
- package/dist/{chat-LYL5CWJV.js → chat-SDSX5TVV.js} +2 -2
- package/dist/{chunk-M2YMNTHK.js → chunk-2HIVYZDB.js} +1 -1
- package/dist/{chunk-6G7R2LPI.js → chunk-4SVONUTC.js} +569 -379
- package/dist/{chunk-QPTQKGGF.js → chunk-57LBQ7JX.js} +1 -1
- package/dist/{chunk-K547QOCM.js → chunk-7G2EEYXX.js} +2 -2
- package/dist/{chunk-E7XWFDZL.js → chunk-AD46AYZQ.js} +1 -1
- package/dist/{chunk-P6DPB33N.js → chunk-ATEX3ZPG.js} +2 -2
- package/dist/{chunk-WR7CSHQ4.js → chunk-C6ESRQZ7.js} +1 -1
- package/dist/{chunk-JU5GWO77.js → chunk-DE4EKQFH.js} +3 -3
- package/dist/{chunk-JPDN6ZRJ.js → chunk-DMUPZQWP.js} +8 -8
- package/dist/{chunk-BR6KFHVT.js → chunk-EE7SZJON.js} +2 -2
- package/dist/{chunk-5QG36RV7.js → chunk-EFL5UOY4.js} +3 -3
- package/dist/{chunk-OEJFZHZZ.js → chunk-GZJFC76M.js} +1 -1
- package/dist/{chunk-KUJVCDWT.js → chunk-JVK6QQIC.js} +2 -2
- package/dist/{chunk-YLTIEEVL.js → chunk-K4EHBHPE.js} +3 -3
- package/dist/{chunk-M3T3Y6FT.js → chunk-KINGVQSR.js} +5 -5
- package/dist/{chunk-MHFAWJCC.js → chunk-L3IV23ZG.js} +12 -1
- package/dist/{chunk-VBKRZCR7.js → chunk-M3PGGSBH.js} +1 -1
- package/dist/{chunk-NSGIVS5T.js → chunk-O3DXAR44.js} +2 -2
- package/dist/{chunk-KZAL7HEQ.js → chunk-ONM2AZFL.js} +1 -1
- package/dist/chunk-PGPLCJPK.js +272 -0
- package/dist/{chunk-43K5UWF7.js → chunk-QQ2MVQU3.js} +13 -12
- package/dist/{chunk-62ICA2FF.js → chunk-SPLPKBES.js} +17 -1
- package/dist/{chunk-BLOAJLGI.js → chunk-XDTKJNW5.js} +1 -1
- package/dist/{chunk-BWZHX46O.js → chunk-Y6O35D7K.js} +21 -6
- package/dist/{chunk-IUZ3EV2D.js → chunk-YAMO2U3N.js} +1 -1
- package/dist/{chunk-4ZSUUBG5.js → chunk-YSV3VJQK.js} +55 -2
- package/dist/cli.js +15 -15
- package/dist/{cloud-sync-E3ZL5SZ4.js → cloud-sync-KOEBUFW5.js} +16 -17
- package/dist/{conversations-FSZCUUYO.js → conversations-67WWW25C.js} +4 -4
- package/dist/{create-ERNQYOCK.js → create-7W3LV3J7.js} +1 -1
- package/dist/{daemon-restart-QBZOMILO.js → daemon-restart-EZXB73W7.js} +7 -8
- package/dist/daemon.js +524 -433
- package/dist/{db-ZJJJYJBU.js → db-CZV62BOQ.js} +2 -2
- package/dist/delivery-manager-OMCCJEVP.js +32 -0
- package/dist/{delivery-router-FDBZJQOY.js → delivery-router-HXBHYHJM.js} +7 -5
- package/dist/down-RRNYIGCU.js +16 -0
- package/dist/echo-text-KFSUCZXL.js +32 -0
- package/dist/{exec-ZDD7NEB4.js → exec-SJK7VUTC.js} +3 -4
- package/dist/{export-WYI3E3TB.js → export-7LPCIB5J.js} +3 -3
- package/dist/{extensions-X6MKBJLB.js → extensions-PQPZT6LS.js} +16 -17
- package/dist/{files-COTCVBGO.js → files-LV7VAKPC.js} +3 -3
- package/dist/{import-EPK6WCYS.js → import-XPECCRQ7.js} +6 -6
- package/dist/{isolation-F7ABZMDA.js → isolation-5AYEY55P.js} +5 -3
- package/dist/{login-GPBXOU4D.js → login-KJSN4JDA.js} +2 -2
- package/dist/{logout-DNNTIYE2.js → logout-TMJGUQV2.js} +2 -2
- package/dist/message-delivery-HRGFNWO7.js +34 -0
- package/dist/{mind-K5PZHPBR.js → mind-G3WEWDM4.js} +5 -5
- package/dist/{mind-activity-tracker-HWVFE533.js → mind-activity-tracker-JHAT6456.js} +4 -4
- package/dist/mind-service-2C7AINBO.js +36 -0
- package/dist/{package-G4AM2IDZ.js → package-24TL6DTF.js} +1 -1
- package/dist/{registry-MDLNPTTI.js → registry-7LQHTRUX.js} +2 -2
- package/dist/{sandbox-E7RWZDVG.js → sandbox-SJH3XOPZ.js} +4 -4
- package/dist/scheduler-VON2TB52.js +30 -0
- package/dist/{schema-HHYJDG7B.js → schema-LRUTFOER.js} +1 -1
- package/dist/{seed-SKVSWF7S.js → seed-HHSJTM6O.js} +1 -1
- package/dist/{seed-cmd-D2H5VLB4.js → seed-cmd-UPQY35RG.js} +2 -2
- package/dist/{seed-create-BUSKQ5II.js → seed-create-MDRMXMSB.js} +3 -3
- package/dist/{seed-sprout-R2IZPITD.js → seed-sprout-4M7IQWMH.js} +7 -8
- package/dist/{send-SLDFRSTL.js → send-ZBZWIH5V.js} +3 -3
- package/dist/{service-ZDOSEQCE.js → service-4EVZKGSA.js} +4 -5
- package/dist/{service-install-2HZPDHEY.js → service-install-SHRM6NHK.js} +5 -6
- package/dist/{setup-IYOUPCIK.js → setup-25MMJ3J4.js} +3 -3
- package/dist/{setup-IU3ID7II.js → setup-ZD2LMBR3.js} +8 -10
- package/dist/{skills-P6RGGASV.js → skills-4KQ377GN.js} +5 -6
- package/dist/sleep-manager-AG5SQDDI.js +34 -0
- package/dist/{spirit-XLD6QXSS.js → spirit-53DQPRNR.js} +7 -8
- package/dist/{sprout-QV2RJM5W.js → sprout-YKM2M6D6.js} +1 -1
- package/dist/{src-TJ7RBU5H.js → src-3EGHHKZK.js} +8 -8
- package/dist/{status-QAKAPDYW.js → status-WTU2WHXY.js} +5 -6
- package/dist/system-chat-54RN3K67.js +34 -0
- package/dist/{tailscale-TIRTGM6E.js → tailscale-Q7ZJL7S7.js} +2 -2
- package/dist/{turn-tracker-Z5UJC4BY.js → turn-tracker-JZYERJ76.js} +7 -5
- package/dist/up-LFZA4GI5.js +18 -0
- package/dist/{update-NY3XBVAJ.js → update-EJ7Q77ZX.js} +5 -6
- package/dist/{update-check-OG27AL4Z.js → update-check-ACYYNKTW.js} +3 -3
- package/dist/{version-notify-P7UAR7HZ.js → version-notify-SRQJCQEK.js} +17 -18
- package/dist/web-assets/assets/{index-CrFAsfiE.js → index-DTDmEfPU.js} +2 -2
- package/dist/web-assets/index.html +1 -1
- package/drizzle/0010_delivery_queue_redrive.sql +10 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +1 -1
- package/templates/claude/src/agent.ts +8 -1
- package/templates/claude/src/lib/message-channel.ts +28 -6
- package/templates/codex/src/server.ts +2 -8
- package/dist/chunk-GN52E2DP.js +0 -59
- package/dist/chunk-TFBQESH7.js +0 -179
- package/dist/delivery-manager-J3BRHXUF.js +0 -33
- package/dist/down-DSRWSCXY.js +0 -17
- package/dist/echo-text-3HBQUWPX.js +0 -33
- package/dist/message-delivery-4ZWFDBAY.js +0 -41
- package/dist/mind-manager-6DSY5IJW.js +0 -33
- package/dist/mind-service-R2FM53KD.js +0 -37
- package/dist/scheduler-2FKQCRCM.js +0 -31
- package/dist/sleep-manager-F5KWIFOX.js +0 -35
- package/dist/system-chat-EQIH6JVL.js +0 -35
- package/dist/up-ZTPGC7HB.js +0 -19
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
9
9
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
10
10
|
<link href="https://fonts.googleapis.com/css2?family=Averia+Serif+Libre:wght@300;400;700&family=Fira+Code:wght@300;400;500;600&family=Averia+Sans+Libre:ital,wght@0,300;0,400;0,500;0,600;1,400&display=swap" rel="stylesheet" />
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-DTDmEfPU.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-D7udpBCx.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
-- Make delivery_queue an at-least-once queue: track attempts and a backoff
|
|
2
|
+
-- window so a redrive loop can re-deliver stranded rows without hot-looping.
|
|
3
|
+
|
|
4
|
+
ALTER TABLE `delivery_queue` ADD `attempts` integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE `delivery_queue` ADD `next_attempt_at` text;--> statement-breakpoint
|
|
6
|
+
-- Original delivery target (may be a variant name); redrive resolves the port from
|
|
7
|
+
-- this so a variant's stranded row is re-delivered to the variant, not the parent.
|
|
8
|
+
-- Nullable: legacy rows fall back to `mind` (the base name) at read time.
|
|
9
|
+
ALTER TABLE `delivery_queue` ADD `target_mind` text;--> statement-breakpoint
|
|
10
|
+
CREATE INDEX IF NOT EXISTS `idx_delivery_queue_status_next` ON `delivery_queue` (`status`, `next_attempt_at`);
|
package/package.json
CHANGED
|
@@ -292,6 +292,9 @@ export function createMind(options: {
|
|
|
292
292
|
},
|
|
293
293
|
broadcast: (event: VoluteEvent) => broadcastToSession(session, event),
|
|
294
294
|
onTurnEnd: async () => {
|
|
295
|
+
// This turn's message is fully processed — drop it from the channel's
|
|
296
|
+
// in-flight set so a later compaction abort won't re-feed it.
|
|
297
|
+
session.channel.ack();
|
|
295
298
|
await autoCommit.flushFileChanges();
|
|
296
299
|
const wasCompacting = compactionTriggered.get(session.name);
|
|
297
300
|
compactionTriggered.set(session.name, false);
|
|
@@ -422,7 +425,11 @@ export function createMind(options: {
|
|
|
422
425
|
break;
|
|
423
426
|
}
|
|
424
427
|
streamAbort = new AbortController();
|
|
425
|
-
|
|
428
|
+
// Recover input the aborted stream had already pulled but not
|
|
429
|
+
// finished (the compaction wrap-up plus any messages that arrived
|
|
430
|
+
// mid-turn) alongside anything queued during /compact, so nothing
|
|
431
|
+
// is dropped when the killed subprocess takes its buffer with it.
|
|
432
|
+
const pending = session.channel.recover();
|
|
426
433
|
session.channel = createMessageChannel();
|
|
427
434
|
for (const msg of pending) session.channel.push(msg);
|
|
428
435
|
continue; // restart the stream loop
|
|
@@ -2,40 +2,62 @@ import type { SDKUserMessage } from "@anthropic-ai/claude-agent-sdk";
|
|
|
2
2
|
|
|
3
3
|
export type MessageChannel = {
|
|
4
4
|
push: (msg: SDKUserMessage) => void;
|
|
5
|
-
|
|
5
|
+
/** Acknowledge that the oldest in-flight message's turn has completed. */
|
|
6
|
+
ack: () => void;
|
|
7
|
+
/**
|
|
8
|
+
* Return every message that has not been fully processed — those delivered to
|
|
9
|
+
* the consumer but not yet acked (their turn never finished) followed by those
|
|
10
|
+
* still queued — and reset the channel. Used to re-feed the stream after a
|
|
11
|
+
* compaction abort so in-flight input is never lost.
|
|
12
|
+
*/
|
|
13
|
+
recover: () => SDKUserMessage[];
|
|
6
14
|
iterable: AsyncIterable<SDKUserMessage>;
|
|
7
15
|
};
|
|
8
16
|
|
|
9
17
|
export function createMessageChannel(): MessageChannel {
|
|
10
18
|
const queue: SDKUserMessage[] = [];
|
|
19
|
+
// Messages handed to the consumer (the SDK's read-ahead) whose turn has not yet
|
|
20
|
+
// completed. The SDK's streamInput loop pulls messages eagerly and writes them
|
|
21
|
+
// to the CLI subprocess, so once delivered they no longer live in `queue`. We
|
|
22
|
+
// retain them here so a compaction abort — which kills that subprocess — can
|
|
23
|
+
// re-feed the unprocessed ones instead of dropping them.
|
|
24
|
+
const inFlight: SDKUserMessage[] = [];
|
|
11
25
|
let resolve: ((value: IteratorResult<SDKUserMessage>) => void) | null = null;
|
|
12
26
|
|
|
27
|
+
function deliver(msg: SDKUserMessage): IteratorResult<SDKUserMessage> {
|
|
28
|
+
inFlight.push(msg);
|
|
29
|
+
return { value: msg, done: false };
|
|
30
|
+
}
|
|
31
|
+
|
|
13
32
|
return {
|
|
14
33
|
push(msg: SDKUserMessage) {
|
|
15
34
|
if (resolve) {
|
|
16
35
|
const r = resolve;
|
|
17
36
|
resolve = null;
|
|
18
|
-
r(
|
|
37
|
+
r(deliver(msg));
|
|
19
38
|
} else {
|
|
20
39
|
queue.push(msg);
|
|
21
40
|
}
|
|
22
41
|
},
|
|
23
|
-
|
|
42
|
+
ack() {
|
|
43
|
+
inFlight.shift();
|
|
44
|
+
},
|
|
45
|
+
recover() {
|
|
24
46
|
// Resolve any pending iterator wait with done:true so it doesn't
|
|
25
|
-
// leak as an orphaned promise (the old iterator is discarded after
|
|
47
|
+
// leak as an orphaned promise (the old iterator is discarded after recover)
|
|
26
48
|
if (resolve) {
|
|
27
49
|
const r = resolve;
|
|
28
50
|
resolve = null;
|
|
29
51
|
r({ value: undefined as any, done: true });
|
|
30
52
|
}
|
|
31
|
-
return queue.splice(0);
|
|
53
|
+
return [...inFlight.splice(0), ...queue.splice(0)];
|
|
32
54
|
},
|
|
33
55
|
iterable: {
|
|
34
56
|
[Symbol.asyncIterator]() {
|
|
35
57
|
return {
|
|
36
58
|
next(): Promise<IteratorResult<SDKUserMessage>> {
|
|
37
59
|
if (queue.length > 0) {
|
|
38
|
-
return Promise.resolve(
|
|
60
|
+
return Promise.resolve(deliver(queue.shift()!));
|
|
39
61
|
}
|
|
40
62
|
return new Promise((r) => {
|
|
41
63
|
resolve = r;
|
|
@@ -15,13 +15,7 @@ import { createVoluteServer } from "./lib/volute-server.js";
|
|
|
15
15
|
const { port } = parseArgs();
|
|
16
16
|
const config = loadConfig();
|
|
17
17
|
if (config.logLevel) setLevel(config.logLevel);
|
|
18
|
-
|
|
19
|
-
// "provider:model" prefix (e.g. "openai-codex:gpt-5.5") when the spirit's model
|
|
20
|
-
// is provider-qualified. Strip the prefix so the SDK gets just the model.
|
|
21
|
-
const model = config.model?.includes(":")
|
|
22
|
-
? config.model.slice(config.model.indexOf(":") + 1)
|
|
23
|
-
: config.model;
|
|
24
|
-
if (config.model) log("server", `using model: ${model}`);
|
|
18
|
+
if (config.model) log("server", `using model: ${config.model}`);
|
|
25
19
|
if (config.reasoningEffort) log("server", `reasoning effort: ${config.reasoningEffort}`);
|
|
26
20
|
|
|
27
21
|
const systemPrompt = loadSystemPrompt();
|
|
@@ -34,7 +28,7 @@ const mind = createMind({
|
|
|
34
28
|
systemPrompt,
|
|
35
29
|
cwd,
|
|
36
30
|
mindDir,
|
|
37
|
-
model,
|
|
31
|
+
model: config.model,
|
|
38
32
|
reasoningEffort: config.reasoningEffort,
|
|
39
33
|
maxContextTokens: config.compaction?.maxContextTokens,
|
|
40
34
|
});
|
package/dist/chunk-GN52E2DP.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
wrapForIsolation
|
|
4
|
-
} from "./chunk-TFBQESH7.js";
|
|
5
|
-
|
|
6
|
-
// packages/daemon/src/lib/util/exec.ts
|
|
7
|
-
import { execFile as execFileCb, execFileSync, spawn } from "child_process";
|
|
8
|
-
async function exec(cmd, args, options) {
|
|
9
|
-
const [wrappedCmd, wrappedArgs] = options?.mindName ? await wrapForIsolation(cmd, args, options.mindName) : [cmd, args];
|
|
10
|
-
return new Promise((resolve, reject) => {
|
|
11
|
-
execFileCb(
|
|
12
|
-
wrappedCmd,
|
|
13
|
-
wrappedArgs,
|
|
14
|
-
{ cwd: options?.cwd, env: options?.env },
|
|
15
|
-
(err, stdout, stderr) => {
|
|
16
|
-
if (err) {
|
|
17
|
-
err.stderr = stderr;
|
|
18
|
-
err.stdout = stdout;
|
|
19
|
-
reject(err);
|
|
20
|
-
} else {
|
|
21
|
-
resolve(stdout);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
function gitExec(args, options) {
|
|
28
|
-
const fullArgs = process.env.VOLUTE_ISOLATION === "user" ? ["-c", "safe.directory=*", ...args] : args;
|
|
29
|
-
return exec("git", fullArgs, options);
|
|
30
|
-
}
|
|
31
|
-
function resolveVoluteBin() {
|
|
32
|
-
try {
|
|
33
|
-
return execFileSync("which", ["volute"], { encoding: "utf-8" }).trim();
|
|
34
|
-
} catch {
|
|
35
|
-
throw new Error("Could not find volute binary on PATH");
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
async function execInherit(cmd, args, options) {
|
|
39
|
-
const [wrappedCmd, wrappedArgs] = options?.mindName ? await wrapForIsolation(cmd, args, options.mindName) : [cmd, args];
|
|
40
|
-
return new Promise((resolve, reject) => {
|
|
41
|
-
const child = spawn(wrappedCmd, wrappedArgs, {
|
|
42
|
-
cwd: options?.cwd,
|
|
43
|
-
env: options?.env,
|
|
44
|
-
stdio: "inherit"
|
|
45
|
-
});
|
|
46
|
-
child.on("error", reject);
|
|
47
|
-
child.on("close", (code) => {
|
|
48
|
-
if (code === 0) resolve();
|
|
49
|
-
else reject(new Error(`${cmd} ${args.join(" ")} exited with code ${code}`));
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export {
|
|
55
|
-
exec,
|
|
56
|
-
gitExec,
|
|
57
|
-
resolveVoluteBin,
|
|
58
|
-
execInherit
|
|
59
|
-
};
|
package/dist/chunk-TFBQESH7.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
getBaseName,
|
|
4
|
-
validateMindName
|
|
5
|
-
} from "./chunk-IUZ3EV2D.js";
|
|
6
|
-
|
|
7
|
-
// packages/daemon/src/lib/mind/isolation.ts
|
|
8
|
-
import { execFileSync } from "child_process";
|
|
9
|
-
function isIsolationEnabled() {
|
|
10
|
-
return process.env.VOLUTE_ISOLATION === "user";
|
|
11
|
-
}
|
|
12
|
-
function mindUserName(mindName) {
|
|
13
|
-
const err = validateMindName(mindName);
|
|
14
|
-
if (err && mindName !== "volute") {
|
|
15
|
-
throw new Error(`Invalid mind name for isolation: ${err}`);
|
|
16
|
-
}
|
|
17
|
-
const prefix = process.env.VOLUTE_USER_PREFIX ?? "mind-";
|
|
18
|
-
return `${prefix}${mindName}`;
|
|
19
|
-
}
|
|
20
|
-
function findNextMacId(type) {
|
|
21
|
-
const idField = type === "Users" ? "UniqueID" : "PrimaryGroupID";
|
|
22
|
-
let output;
|
|
23
|
-
try {
|
|
24
|
-
output = execFileSync("dscl", [".", "-list", `/${type}`, idField], { encoding: "utf-8" });
|
|
25
|
-
} catch (err) {
|
|
26
|
-
throw new Error(
|
|
27
|
-
`Failed to query ${type} via dscl: ${err instanceof Error ? err.message : err}`
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
const ids = /* @__PURE__ */ new Set();
|
|
31
|
-
for (const line of output.split("\n")) {
|
|
32
|
-
const parts = line.trim().split(/\s+/);
|
|
33
|
-
const id = parseInt(parts[parts.length - 1], 10);
|
|
34
|
-
if (!Number.isNaN(id)) ids.add(id);
|
|
35
|
-
}
|
|
36
|
-
let next = 401;
|
|
37
|
-
while (ids.has(next)) next++;
|
|
38
|
-
return next;
|
|
39
|
-
}
|
|
40
|
-
function getVoluteGroupGid() {
|
|
41
|
-
if (process.platform === "darwin") {
|
|
42
|
-
const output2 = execFileSync("dscl", [".", "-read", "/Groups/volute", "PrimaryGroupID"], {
|
|
43
|
-
encoding: "utf-8"
|
|
44
|
-
});
|
|
45
|
-
const match = output2.match(/PrimaryGroupID:\s*(\d+)/);
|
|
46
|
-
if (!match) throw new Error("Could not read volute group GID");
|
|
47
|
-
return parseInt(match[1], 10);
|
|
48
|
-
}
|
|
49
|
-
const output = execFileSync("getent", ["group", "volute"], { encoding: "utf-8" });
|
|
50
|
-
const gid = parseInt(output.split(":")[2], 10);
|
|
51
|
-
if (Number.isNaN(gid)) throw new Error("Could not read volute group GID");
|
|
52
|
-
return gid;
|
|
53
|
-
}
|
|
54
|
-
function ensureVoluteGroup(opts) {
|
|
55
|
-
if (!opts?.force && !isIsolationEnabled()) return;
|
|
56
|
-
if (process.platform === "darwin") {
|
|
57
|
-
try {
|
|
58
|
-
execFileSync("dscl", [".", "-read", "/Groups/volute"], { stdio: "ignore" });
|
|
59
|
-
return;
|
|
60
|
-
} catch {
|
|
61
|
-
}
|
|
62
|
-
const gid = findNextMacId("Groups");
|
|
63
|
-
try {
|
|
64
|
-
execFileSync("dscl", [".", "-create", "/Groups/volute"]);
|
|
65
|
-
execFileSync("dscl", [".", "-create", "/Groups/volute", "PrimaryGroupID", String(gid)]);
|
|
66
|
-
execFileSync("dscl", [".", "-create", "/Groups/volute", "Password", "*"]);
|
|
67
|
-
} catch (err) {
|
|
68
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
69
|
-
throw new Error(`Failed to create volute group on macOS: ${msg}`);
|
|
70
|
-
}
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
try {
|
|
74
|
-
execFileSync("getent", ["group", "volute"], { stdio: "ignore" });
|
|
75
|
-
} catch {
|
|
76
|
-
try {
|
|
77
|
-
execFileSync("groupadd", ["volute"], { stdio: ["ignore", "ignore", "pipe"] });
|
|
78
|
-
} catch (err) {
|
|
79
|
-
const stderr = err?.stderr?.toString().trim();
|
|
80
|
-
throw new Error(`Failed to create volute group${stderr ? `: ${stderr}` : ""}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function createMindUser(name, homeDir) {
|
|
85
|
-
if (!isIsolationEnabled()) return;
|
|
86
|
-
const user = mindUserName(name);
|
|
87
|
-
try {
|
|
88
|
-
execFileSync("id", [user], { stdio: "ignore" });
|
|
89
|
-
return;
|
|
90
|
-
} catch {
|
|
91
|
-
}
|
|
92
|
-
if (process.platform === "darwin") {
|
|
93
|
-
const uid = findNextMacId("Users");
|
|
94
|
-
const gid = getVoluteGroupGid();
|
|
95
|
-
const home = homeDir ?? "/var/empty";
|
|
96
|
-
try {
|
|
97
|
-
execFileSync("dscl", [".", "-create", `/Users/${user}`]);
|
|
98
|
-
execFileSync("dscl", [".", "-create", `/Users/${user}`, "UniqueID", String(uid)]);
|
|
99
|
-
execFileSync("dscl", [".", "-create", `/Users/${user}`, "PrimaryGroupID", String(gid)]);
|
|
100
|
-
execFileSync("dscl", [".", "-create", `/Users/${user}`, "UserShell", "/usr/bin/false"]);
|
|
101
|
-
execFileSync("dscl", [".", "-create", `/Users/${user}`, "NFSHomeDirectory", home]);
|
|
102
|
-
execFileSync("dscl", [".", "-create", `/Users/${user}`, "RealName", `Volute Mind: ${name}`]);
|
|
103
|
-
execFileSync("dscl", [".", "-create", `/Users/${user}`, "IsHidden", "1"]);
|
|
104
|
-
execFileSync("dscl", [".", "-append", "/Groups/volute", "GroupMembership", user]);
|
|
105
|
-
} catch (err) {
|
|
106
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
107
|
-
throw new Error(`Failed to create user ${user} on macOS: ${msg}`);
|
|
108
|
-
}
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
try {
|
|
112
|
-
const args = ["-r", "-M", "-G", "volute", "-s", "/usr/sbin/nologin"];
|
|
113
|
-
if (homeDir) args.push("-d", homeDir);
|
|
114
|
-
args.push(user);
|
|
115
|
-
execFileSync("useradd", args, {
|
|
116
|
-
stdio: ["ignore", "ignore", "pipe"]
|
|
117
|
-
});
|
|
118
|
-
} catch (err) {
|
|
119
|
-
const stderr = err?.stderr?.toString().trim();
|
|
120
|
-
throw new Error(`Failed to create user ${user}${stderr ? `: ${stderr}` : ""}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
function deleteMindUser(name) {
|
|
124
|
-
if (!isIsolationEnabled()) return;
|
|
125
|
-
const user = mindUserName(name);
|
|
126
|
-
if (process.platform === "darwin") {
|
|
127
|
-
try {
|
|
128
|
-
execFileSync("dscl", [".", "-delete", `/Users/${user}`], { stdio: "ignore" });
|
|
129
|
-
} catch {
|
|
130
|
-
}
|
|
131
|
-
try {
|
|
132
|
-
execFileSync("dscl", [".", "-delete", "/Groups/volute", "GroupMembership", user], {
|
|
133
|
-
stdio: "ignore"
|
|
134
|
-
});
|
|
135
|
-
} catch {
|
|
136
|
-
}
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
try {
|
|
140
|
-
execFileSync("userdel", [user], { stdio: "ignore" });
|
|
141
|
-
} catch {
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
async function wrapForIsolation(cmd, args, mindName) {
|
|
145
|
-
if (!isIsolationEnabled()) return [cmd, args];
|
|
146
|
-
const baseName = await getBaseName(mindName);
|
|
147
|
-
const user = mindUserName(baseName);
|
|
148
|
-
if (process.platform === "darwin") {
|
|
149
|
-
return ["sudo", ["-u", user, "--", cmd, ...args]];
|
|
150
|
-
}
|
|
151
|
-
return ["runuser", ["-u", user, "--", cmd, ...args]];
|
|
152
|
-
}
|
|
153
|
-
function chownMindDir(dir, name) {
|
|
154
|
-
if (!isIsolationEnabled()) return;
|
|
155
|
-
const user = mindUserName(name);
|
|
156
|
-
const group = process.platform === "darwin" ? "volute" : user;
|
|
157
|
-
try {
|
|
158
|
-
execFileSync("chown", ["-R", `${user}:${group}`, dir], { stdio: ["ignore", "ignore", "pipe"] });
|
|
159
|
-
} catch (err) {
|
|
160
|
-
const stderr = err?.stderr?.toString().trim();
|
|
161
|
-
throw new Error(`Failed to chown ${dir} to ${user}:${group}${stderr ? `: ${stderr}` : ""}`);
|
|
162
|
-
}
|
|
163
|
-
try {
|
|
164
|
-
execFileSync("chmod", ["700", dir], { stdio: ["ignore", "ignore", "pipe"] });
|
|
165
|
-
} catch (err) {
|
|
166
|
-
const stderr = err?.stderr?.toString().trim();
|
|
167
|
-
throw new Error(`Failed to chmod ${dir}${stderr ? `: ${stderr}` : ""}`);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export {
|
|
172
|
-
isIsolationEnabled,
|
|
173
|
-
mindUserName,
|
|
174
|
-
ensureVoluteGroup,
|
|
175
|
-
createMindUser,
|
|
176
|
-
deleteMindUser,
|
|
177
|
-
wrapForIsolation,
|
|
178
|
-
chownMindDir
|
|
179
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
DeliveryManager,
|
|
4
|
-
getDeliveryManager,
|
|
5
|
-
initDeliveryManager,
|
|
6
|
-
tryGetDeliveryManager
|
|
7
|
-
} from "./chunk-6G7R2LPI.js";
|
|
8
|
-
import "./chunk-BLOAJLGI.js";
|
|
9
|
-
import "./chunk-43K5UWF7.js";
|
|
10
|
-
import "./chunk-QLWG3C2Z.js";
|
|
11
|
-
import "./chunk-M3T3Y6FT.js";
|
|
12
|
-
import "./chunk-YLTIEEVL.js";
|
|
13
|
-
import "./chunk-CU6OFXMM.js";
|
|
14
|
-
import "./chunk-WR7CSHQ4.js";
|
|
15
|
-
import "./chunk-VBKRZCR7.js";
|
|
16
|
-
import "./chunk-62ICA2FF.js";
|
|
17
|
-
import "./chunk-BWZHX46O.js";
|
|
18
|
-
import "./chunk-GN52E2DP.js";
|
|
19
|
-
import "./chunk-TFBQESH7.js";
|
|
20
|
-
import "./chunk-4ZSUUBG5.js";
|
|
21
|
-
import "./chunk-KZAL7HEQ.js";
|
|
22
|
-
import "./chunk-5QG36RV7.js";
|
|
23
|
-
import "./chunk-K547QOCM.js";
|
|
24
|
-
import "./chunk-T2TP6ZC6.js";
|
|
25
|
-
import "./chunk-IUZ3EV2D.js";
|
|
26
|
-
import "./chunk-MHFAWJCC.js";
|
|
27
|
-
import "./chunk-K3NQKI34.js";
|
|
28
|
-
export {
|
|
29
|
-
DeliveryManager,
|
|
30
|
-
getDeliveryManager,
|
|
31
|
-
initDeliveryManager,
|
|
32
|
-
tryGetDeliveryManager
|
|
33
|
-
};
|
package/dist/down-DSRWSCXY.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
run,
|
|
4
|
-
stopDaemon
|
|
5
|
-
} from "./chunk-NSGIVS5T.js";
|
|
6
|
-
import "./chunk-TXSA4Q3V.js";
|
|
7
|
-
import "./chunk-O7IGP7ZW.js";
|
|
8
|
-
import "./chunk-P6DPB33N.js";
|
|
9
|
-
import "./chunk-GN52E2DP.js";
|
|
10
|
-
import "./chunk-TFBQESH7.js";
|
|
11
|
-
import "./chunk-IUZ3EV2D.js";
|
|
12
|
-
import "./chunk-MHFAWJCC.js";
|
|
13
|
-
import "./chunk-K3NQKI34.js";
|
|
14
|
-
export {
|
|
15
|
-
run,
|
|
16
|
-
stopDaemon
|
|
17
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
clearEchoTextCache,
|
|
4
|
-
echoTextToChannel
|
|
5
|
-
} from "./chunk-JPDN6ZRJ.js";
|
|
6
|
-
import "./chunk-QPTQKGGF.js";
|
|
7
|
-
import "./chunk-6G7R2LPI.js";
|
|
8
|
-
import "./chunk-BLOAJLGI.js";
|
|
9
|
-
import "./chunk-43K5UWF7.js";
|
|
10
|
-
import "./chunk-QLWG3C2Z.js";
|
|
11
|
-
import "./chunk-M3T3Y6FT.js";
|
|
12
|
-
import "./chunk-YLTIEEVL.js";
|
|
13
|
-
import "./chunk-CU6OFXMM.js";
|
|
14
|
-
import "./chunk-WR7CSHQ4.js";
|
|
15
|
-
import "./chunk-VBKRZCR7.js";
|
|
16
|
-
import "./chunk-62ICA2FF.js";
|
|
17
|
-
import "./chunk-BWZHX46O.js";
|
|
18
|
-
import "./chunk-P6DPB33N.js";
|
|
19
|
-
import "./chunk-GN52E2DP.js";
|
|
20
|
-
import "./chunk-TFBQESH7.js";
|
|
21
|
-
import "./chunk-4ZSUUBG5.js";
|
|
22
|
-
import "./chunk-KZAL7HEQ.js";
|
|
23
|
-
import "./chunk-5QG36RV7.js";
|
|
24
|
-
import "./chunk-K547QOCM.js";
|
|
25
|
-
import "./chunk-T2TP6ZC6.js";
|
|
26
|
-
import "./chunk-LGNUFVMR.js";
|
|
27
|
-
import "./chunk-IUZ3EV2D.js";
|
|
28
|
-
import "./chunk-MHFAWJCC.js";
|
|
29
|
-
import "./chunk-K3NQKI34.js";
|
|
30
|
-
export {
|
|
31
|
-
clearEchoTextCache,
|
|
32
|
-
echoTextToChannel
|
|
33
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
deliverMessage,
|
|
4
|
-
linkToolResultToTurn,
|
|
5
|
-
recordInbound,
|
|
6
|
-
recordOutbound,
|
|
7
|
-
resolveSleepAction,
|
|
8
|
-
tagRecentInbound,
|
|
9
|
-
tagUntaggedInbound,
|
|
10
|
-
tagUntaggedOutbound
|
|
11
|
-
} from "./chunk-6G7R2LPI.js";
|
|
12
|
-
import "./chunk-BLOAJLGI.js";
|
|
13
|
-
import "./chunk-43K5UWF7.js";
|
|
14
|
-
import "./chunk-QLWG3C2Z.js";
|
|
15
|
-
import "./chunk-M3T3Y6FT.js";
|
|
16
|
-
import "./chunk-YLTIEEVL.js";
|
|
17
|
-
import "./chunk-CU6OFXMM.js";
|
|
18
|
-
import "./chunk-WR7CSHQ4.js";
|
|
19
|
-
import "./chunk-VBKRZCR7.js";
|
|
20
|
-
import "./chunk-62ICA2FF.js";
|
|
21
|
-
import "./chunk-BWZHX46O.js";
|
|
22
|
-
import "./chunk-GN52E2DP.js";
|
|
23
|
-
import "./chunk-TFBQESH7.js";
|
|
24
|
-
import "./chunk-4ZSUUBG5.js";
|
|
25
|
-
import "./chunk-KZAL7HEQ.js";
|
|
26
|
-
import "./chunk-5QG36RV7.js";
|
|
27
|
-
import "./chunk-K547QOCM.js";
|
|
28
|
-
import "./chunk-T2TP6ZC6.js";
|
|
29
|
-
import "./chunk-IUZ3EV2D.js";
|
|
30
|
-
import "./chunk-MHFAWJCC.js";
|
|
31
|
-
import "./chunk-K3NQKI34.js";
|
|
32
|
-
export {
|
|
33
|
-
deliverMessage,
|
|
34
|
-
linkToolResultToTurn,
|
|
35
|
-
recordInbound,
|
|
36
|
-
recordOutbound,
|
|
37
|
-
resolveSleepAction,
|
|
38
|
-
tagRecentInbound,
|
|
39
|
-
tagUntaggedInbound,
|
|
40
|
-
tagUntaggedOutbound
|
|
41
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
MindManager,
|
|
4
|
-
buildMindBaseEnv,
|
|
5
|
-
getMindManager,
|
|
6
|
-
initMindManager
|
|
7
|
-
} from "./chunk-6G7R2LPI.js";
|
|
8
|
-
import "./chunk-BLOAJLGI.js";
|
|
9
|
-
import "./chunk-43K5UWF7.js";
|
|
10
|
-
import "./chunk-QLWG3C2Z.js";
|
|
11
|
-
import "./chunk-M3T3Y6FT.js";
|
|
12
|
-
import "./chunk-YLTIEEVL.js";
|
|
13
|
-
import "./chunk-CU6OFXMM.js";
|
|
14
|
-
import "./chunk-WR7CSHQ4.js";
|
|
15
|
-
import "./chunk-VBKRZCR7.js";
|
|
16
|
-
import "./chunk-62ICA2FF.js";
|
|
17
|
-
import "./chunk-BWZHX46O.js";
|
|
18
|
-
import "./chunk-GN52E2DP.js";
|
|
19
|
-
import "./chunk-TFBQESH7.js";
|
|
20
|
-
import "./chunk-4ZSUUBG5.js";
|
|
21
|
-
import "./chunk-KZAL7HEQ.js";
|
|
22
|
-
import "./chunk-5QG36RV7.js";
|
|
23
|
-
import "./chunk-K547QOCM.js";
|
|
24
|
-
import "./chunk-T2TP6ZC6.js";
|
|
25
|
-
import "./chunk-IUZ3EV2D.js";
|
|
26
|
-
import "./chunk-MHFAWJCC.js";
|
|
27
|
-
import "./chunk-K3NQKI34.js";
|
|
28
|
-
export {
|
|
29
|
-
MindManager,
|
|
30
|
-
buildMindBaseEnv,
|
|
31
|
-
getMindManager,
|
|
32
|
-
initMindManager
|
|
33
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
sleepMind,
|
|
4
|
-
startMindFull,
|
|
5
|
-
startSpiritFull,
|
|
6
|
-
stopMindFull,
|
|
7
|
-
stopSpiritFull,
|
|
8
|
-
wakeMind
|
|
9
|
-
} from "./chunk-6G7R2LPI.js";
|
|
10
|
-
import "./chunk-BLOAJLGI.js";
|
|
11
|
-
import "./chunk-43K5UWF7.js";
|
|
12
|
-
import "./chunk-QLWG3C2Z.js";
|
|
13
|
-
import "./chunk-M3T3Y6FT.js";
|
|
14
|
-
import "./chunk-YLTIEEVL.js";
|
|
15
|
-
import "./chunk-CU6OFXMM.js";
|
|
16
|
-
import "./chunk-WR7CSHQ4.js";
|
|
17
|
-
import "./chunk-VBKRZCR7.js";
|
|
18
|
-
import "./chunk-62ICA2FF.js";
|
|
19
|
-
import "./chunk-BWZHX46O.js";
|
|
20
|
-
import "./chunk-GN52E2DP.js";
|
|
21
|
-
import "./chunk-TFBQESH7.js";
|
|
22
|
-
import "./chunk-4ZSUUBG5.js";
|
|
23
|
-
import "./chunk-KZAL7HEQ.js";
|
|
24
|
-
import "./chunk-5QG36RV7.js";
|
|
25
|
-
import "./chunk-K547QOCM.js";
|
|
26
|
-
import "./chunk-T2TP6ZC6.js";
|
|
27
|
-
import "./chunk-IUZ3EV2D.js";
|
|
28
|
-
import "./chunk-MHFAWJCC.js";
|
|
29
|
-
import "./chunk-K3NQKI34.js";
|
|
30
|
-
export {
|
|
31
|
-
sleepMind,
|
|
32
|
-
startMindFull,
|
|
33
|
-
startSpiritFull,
|
|
34
|
-
stopMindFull,
|
|
35
|
-
stopSpiritFull,
|
|
36
|
-
wakeMind
|
|
37
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
Scheduler,
|
|
4
|
-
getScheduler,
|
|
5
|
-
initScheduler
|
|
6
|
-
} from "./chunk-6G7R2LPI.js";
|
|
7
|
-
import "./chunk-BLOAJLGI.js";
|
|
8
|
-
import "./chunk-43K5UWF7.js";
|
|
9
|
-
import "./chunk-QLWG3C2Z.js";
|
|
10
|
-
import "./chunk-M3T3Y6FT.js";
|
|
11
|
-
import "./chunk-YLTIEEVL.js";
|
|
12
|
-
import "./chunk-CU6OFXMM.js";
|
|
13
|
-
import "./chunk-WR7CSHQ4.js";
|
|
14
|
-
import "./chunk-VBKRZCR7.js";
|
|
15
|
-
import "./chunk-62ICA2FF.js";
|
|
16
|
-
import "./chunk-BWZHX46O.js";
|
|
17
|
-
import "./chunk-GN52E2DP.js";
|
|
18
|
-
import "./chunk-TFBQESH7.js";
|
|
19
|
-
import "./chunk-4ZSUUBG5.js";
|
|
20
|
-
import "./chunk-KZAL7HEQ.js";
|
|
21
|
-
import "./chunk-5QG36RV7.js";
|
|
22
|
-
import "./chunk-K547QOCM.js";
|
|
23
|
-
import "./chunk-T2TP6ZC6.js";
|
|
24
|
-
import "./chunk-IUZ3EV2D.js";
|
|
25
|
-
import "./chunk-MHFAWJCC.js";
|
|
26
|
-
import "./chunk-K3NQKI34.js";
|
|
27
|
-
export {
|
|
28
|
-
Scheduler,
|
|
29
|
-
getScheduler,
|
|
30
|
-
initScheduler
|
|
31
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
SleepManager,
|
|
4
|
-
getSleepManager,
|
|
5
|
-
getSleepManagerIfReady,
|
|
6
|
-
initSleepManager,
|
|
7
|
-
matchesGlob
|
|
8
|
-
} from "./chunk-6G7R2LPI.js";
|
|
9
|
-
import "./chunk-BLOAJLGI.js";
|
|
10
|
-
import "./chunk-43K5UWF7.js";
|
|
11
|
-
import "./chunk-QLWG3C2Z.js";
|
|
12
|
-
import "./chunk-M3T3Y6FT.js";
|
|
13
|
-
import "./chunk-YLTIEEVL.js";
|
|
14
|
-
import "./chunk-CU6OFXMM.js";
|
|
15
|
-
import "./chunk-WR7CSHQ4.js";
|
|
16
|
-
import "./chunk-VBKRZCR7.js";
|
|
17
|
-
import "./chunk-62ICA2FF.js";
|
|
18
|
-
import "./chunk-BWZHX46O.js";
|
|
19
|
-
import "./chunk-GN52E2DP.js";
|
|
20
|
-
import "./chunk-TFBQESH7.js";
|
|
21
|
-
import "./chunk-4ZSUUBG5.js";
|
|
22
|
-
import "./chunk-KZAL7HEQ.js";
|
|
23
|
-
import "./chunk-5QG36RV7.js";
|
|
24
|
-
import "./chunk-K547QOCM.js";
|
|
25
|
-
import "./chunk-T2TP6ZC6.js";
|
|
26
|
-
import "./chunk-IUZ3EV2D.js";
|
|
27
|
-
import "./chunk-MHFAWJCC.js";
|
|
28
|
-
import "./chunk-K3NQKI34.js";
|
|
29
|
-
export {
|
|
30
|
-
SleepManager,
|
|
31
|
-
getSleepManager,
|
|
32
|
-
getSleepManagerIfReady,
|
|
33
|
-
initSleepManager,
|
|
34
|
-
matchesGlob
|
|
35
|
-
};
|