@possumtech/rummy 0.2.3 → 0.2.5
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/.env.example +8 -1
- package/bin/rummy.js +6 -2
- package/package.json +1 -1
- package/service.js +1 -2
package/.env.example
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# DO NOT EDIT OR REMOVE!
|
|
2
|
+
# COPY TO ~/.rummy.env or add appropriate
|
|
3
|
+
# environment variables to ~/.bashrc or wherever
|
|
4
|
+
|
|
5
|
+
# This project uses cascading environment variables
|
|
6
|
+
# (environment) > ~/.rummy/.env > ~/.rummy/.env.example
|
|
7
|
+
|
|
1
8
|
# Service Configuration
|
|
2
9
|
PORT=3044
|
|
3
10
|
|
|
@@ -6,7 +13,7 @@ PORT=3044
|
|
|
6
13
|
|
|
7
14
|
RUMMY_DB_PATH=./rummy.db
|
|
8
15
|
# SQLite mmap size in MB
|
|
9
|
-
|
|
16
|
+
RUMMY_MMAP_MB=0
|
|
10
17
|
|
|
11
18
|
# Agent Loop Limits
|
|
12
19
|
RUMMY_MAX_TURNS=99
|
package/bin/rummy.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { existsSync, mkdirSync } from "node:fs";
|
|
3
|
+
import { existsSync, mkdirSync, copyFileSync } from "node:fs";
|
|
4
4
|
import { join, dirname } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { homedir } from "node:os";
|
|
7
7
|
|
|
8
8
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
9
|
const packageRoot = join(__dirname, "..");
|
|
10
|
+
const envExample = join(packageRoot, ".env.example");
|
|
10
11
|
|
|
11
12
|
// Resolve RUMMY_HOME
|
|
12
13
|
const rummyHome = process.env.RUMMY_HOME || join(homedir(), ".rummy");
|
|
@@ -22,8 +23,11 @@ for (const dir of ["plugins", "skills", "personas"]) {
|
|
|
22
23
|
if (!existsSync(path)) mkdirSync(path, { recursive: true });
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
// Keep .env.example in RUMMY_HOME as reference
|
|
27
|
+
copyFileSync(envExample, join(rummyHome, ".env.example"));
|
|
28
|
+
|
|
25
29
|
// Load defaults from .env.example, then user overrides from ~/.rummy/.env
|
|
26
|
-
process.loadEnvFile(
|
|
30
|
+
process.loadEnvFile(envExample);
|
|
27
31
|
const userEnv = join(rummyHome, ".env");
|
|
28
32
|
if (existsSync(userEnv)) process.loadEnvFile(userEnv);
|
|
29
33
|
|
package/package.json
CHANGED
package/service.js
CHANGED
|
@@ -59,7 +59,6 @@ async function main() {
|
|
|
59
59
|
.filter((f) => f.endsWith(".js") && !f.endsWith(".test.js"))
|
|
60
60
|
.map((f) => join(functionsDir, f));
|
|
61
61
|
|
|
62
|
-
const mmapMb = Number.parseInt(process.env.RUMMY_MMAP_MB || "0", 10);
|
|
63
62
|
const db = await SqlRite.open({
|
|
64
63
|
path: dbPath,
|
|
65
64
|
dir: [
|
|
@@ -68,7 +67,7 @@ async function main() {
|
|
|
68
67
|
],
|
|
69
68
|
functions: sqlFunctions,
|
|
70
69
|
params: {
|
|
71
|
-
mmap_size:
|
|
70
|
+
mmap_size: Number(process.env.RUMMY_MMAP_MB) * 1024 * 1024,
|
|
72
71
|
},
|
|
73
72
|
});
|
|
74
73
|
|