suemo 0.1.2 → 0.1.4
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 +9 -6
- package/package.json +1 -1
- package/skills/suemo/SKILL.md +3 -1
- package/skills/suemo/references/agents-snippet.md +1 -1
- package/skills/suemo/references/cli-reference.md +1 -1
- package/skills/suemo/references/core-workflow.md +1 -1
- package/skills/suemo/references/manual-test-plan.md +1 -1
- package/skills/suemo/references/mcp-reference.md +1 -1
- package/skills/suemo/references/schema-retention-longevity.md +1 -1
- package/skills/suemo/references/sync-local-vps.md +1 -1
- package/src/cli/commands/init.ts +17 -17
- package/src/skill/catalog.ts +5 -9
package/README.md
CHANGED
|
@@ -42,6 +42,8 @@ SURREAL_DATASTORE_VERSIONED=true SURREAL_DATASTORE_RETENTION=90d surreal start \
|
|
|
42
42
|
-- surrealkv:///path/to/data
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
+
Note: It is advised to create database-level admin specifically for suemo.
|
|
46
|
+
|
|
45
47
|
For suemo, the critical capability is allowing custom functions:
|
|
46
48
|
|
|
47
49
|
- `fn::*`
|
|
@@ -50,6 +52,7 @@ For suemo, the critical capability is allowing custom functions:
|
|
|
50
52
|
- `search::*` (for `search::score`)
|
|
51
53
|
- `math::*` (for `math::mean`, `math::min`)
|
|
52
54
|
- `rand::*` (used in `wander` query)
|
|
55
|
+
- `array::*` (used in `recall` query)
|
|
53
56
|
|
|
54
57
|
If you run with strict capability mode, use an allowlist like:
|
|
55
58
|
|
|
@@ -110,7 +113,7 @@ If `suemo` is not on root PATH, use `sudo bunx suemo ...`.
|
|
|
110
113
|
|
|
111
114
|
Drop `--dry-run` to apply changes.
|
|
112
115
|
|
|
113
|
-
`suemo init surreal` also creates `/opt/suemo/
|
|
116
|
+
`suemo init surreal` also creates `/opt/suemo/surreal/local.env` with commented overrides and does not overwrite it if it already exists. If defined in `local.env`, these values override `common.env`:
|
|
114
117
|
|
|
115
118
|
- `SURREAL_USER`
|
|
116
119
|
- `SURREAL_PASS`
|
|
@@ -123,10 +126,10 @@ What these commands do:
|
|
|
123
126
|
|
|
124
127
|
- `suemo init surreal <2gb|6gb>`
|
|
125
128
|
- checks `surrealdb` package via `pacman -Q`
|
|
126
|
-
- creates `/opt/suemo/
|
|
127
|
-
- creates `/opt/suemo/
|
|
128
|
-
- writes `/etc/systemd/system/suemo-
|
|
129
|
-
- enables + starts `suemo-
|
|
129
|
+
- creates `/opt/suemo/surreal/common.env` + profile env (`2gb.env` or `6gb.env`)
|
|
130
|
+
- creates `/opt/suemo/surreal/local.env` once (user override file; not overwritten)
|
|
131
|
+
- writes `/etc/systemd/system/suemo-surreal@.service`
|
|
132
|
+
- enables + starts `suemo-surreal@<profile>.service`
|
|
130
133
|
- includes `VERSIONED` + retention config and strict capability allowlist:
|
|
131
134
|
- `SURREAL_DATASTORE_VERSIONED=true`
|
|
132
135
|
- `SURREAL_DATASTORE_RETENTION=90d`
|
|
@@ -136,7 +139,7 @@ What these commands do:
|
|
|
136
139
|
- `suemo init fastembed`
|
|
137
140
|
- checks `python-fastembed`, `python-fastapi`, `python-uvicorn` via `pacman -Q`
|
|
138
141
|
- installs `data/fastembed-server.py` to `/opt/suemo/fastembed-server.py`
|
|
139
|
-
- creates `/opt/fastembed/local.env` once (user override file; not overwritten)
|
|
142
|
+
- creates `/opt/suemo/fastembed/local.env` once (user override file; not overwritten)
|
|
140
143
|
- writes `/etc/systemd/system/suemo-fastembed.service`
|
|
141
144
|
- enables + starts `suemo-fastembed.service`
|
|
142
145
|
|
package/package.json
CHANGED
package/skills/suemo/SKILL.md
CHANGED
package/src/cli/commands/init.ts
CHANGED
|
@@ -29,12 +29,12 @@ const log = getLogger(['suemo', 'cli', 'init'])
|
|
|
29
29
|
const init = app.sub('init')
|
|
30
30
|
.meta({ description: 'Initialize suemo config and/or database schema' })
|
|
31
31
|
|
|
32
|
-
const SURREAL_PROFILES_DIR = '/opt/suemo/
|
|
33
|
-
const SURREAL_LOCAL_ENV_PATH = '/opt/suemo/
|
|
34
|
-
const SURREAL_SYSTEMD_UNIT_PATH = '/etc/systemd/system/suemo-
|
|
32
|
+
const SURREAL_PROFILES_DIR = '/opt/suemo/surreal'
|
|
33
|
+
const SURREAL_LOCAL_ENV_PATH = '/opt/suemo/surreal/local.env'
|
|
34
|
+
const SURREAL_SYSTEMD_UNIT_PATH = '/etc/systemd/system/suemo-surreal@.service'
|
|
35
35
|
const SURREAL_DATA_DIR = '/var/lib/surrealdb'
|
|
36
36
|
const FASTEMBED_INSTALL_DIR = '/opt/suemo'
|
|
37
|
-
const FASTEMBED_LOCAL_ENV_DIR = '/opt/fastembed'
|
|
37
|
+
const FASTEMBED_LOCAL_ENV_DIR = '/opt/suemo/fastembed'
|
|
38
38
|
const FASTEMBED_SCRIPT_TARGET = '/opt/suemo/fastembed-server.py'
|
|
39
39
|
const FASTEMBED_CACHE_DIR = '/var/cache/fastembed'
|
|
40
40
|
const FASTEMBED_SERVICE_PATH = '/etc/systemd/system/suemo-fastembed.service'
|
|
@@ -52,9 +52,9 @@ Type=simple
|
|
|
52
52
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
53
53
|
User=surrealdb
|
|
54
54
|
Group=surrealdb
|
|
55
|
-
EnvironmentFile=/opt/suemo/
|
|
56
|
-
EnvironmentFile=/opt/suemo/
|
|
57
|
-
EnvironmentFile=-/opt/suemo/
|
|
55
|
+
EnvironmentFile=/opt/suemo/surreal/common.env
|
|
56
|
+
EnvironmentFile=/opt/suemo/surreal/%i.env
|
|
57
|
+
EnvironmentFile=-/opt/suemo/surreal/local.env
|
|
58
58
|
ExecStart=/usr/bin/surreal start
|
|
59
59
|
ExecStop=/bin/kill -s SIGTERM $MAINPID
|
|
60
60
|
Restart=on-failure
|
|
@@ -77,7 +77,7 @@ StateDirectoryMode=0750
|
|
|
77
77
|
WorkingDirectory=/var/lib/surrealdb
|
|
78
78
|
StandardOutput=journal
|
|
79
79
|
StandardError=journal
|
|
80
|
-
SyslogIdentifier=suemo-
|
|
80
|
+
SyslogIdentifier=suemo-surreal-%i
|
|
81
81
|
|
|
82
82
|
[Install]
|
|
83
83
|
WantedBy=multi-user.target
|
|
@@ -118,7 +118,7 @@ SURREAL_TRANSACTION_TIMEOUT=15s
|
|
|
118
118
|
|
|
119
119
|
# Capability allowlist (required for suemo workflows)
|
|
120
120
|
SURREAL_CAPS_DENY_ALL=true
|
|
121
|
-
SURREAL_CAPS_ALLOW_FUNC=fn,time,vector,search,math,rand,ml
|
|
121
|
+
SURREAL_CAPS_ALLOW_FUNC=fn,time,vector,search,math,rand,ml,array
|
|
122
122
|
|
|
123
123
|
# Logging
|
|
124
124
|
SURREAL_LOG=warn
|
|
@@ -165,7 +165,7 @@ SURREAL_EXTERNAL_SORTING_BUFFER_LIMIT=25000
|
|
|
165
165
|
SURREAL_MEMORY_THRESHOLD=512m
|
|
166
166
|
`
|
|
167
167
|
|
|
168
|
-
const FASTEMBED_LOCAL_ENV_PATH = '/opt/fastembed/local.env'
|
|
168
|
+
const FASTEMBED_LOCAL_ENV_PATH = '/opt/suemo/fastembed/local.env'
|
|
169
169
|
|
|
170
170
|
const FASTEMBED_LOCAL_ENV_TEMPLATE = `# User overrides - edit this file to customize settings
|
|
171
171
|
# This file is NOT overwritten by suemo init fastembed
|
|
@@ -192,7 +192,7 @@ Environment=FASTEMBED_HOST=127.0.0.1
|
|
|
192
192
|
Environment=FASTEMBED_PORT=8080
|
|
193
193
|
Environment=FASTEMBED_MODEL=sentence-transformers/all-MiniLM-L6-v2
|
|
194
194
|
Environment=FASTEMBED_CACHE_DIR=/var/cache/fastembed
|
|
195
|
-
EnvironmentFile=-/opt/fastembed/local.env
|
|
195
|
+
EnvironmentFile=-/opt/suemo/fastembed/local.env
|
|
196
196
|
ExecStart=/usr/bin/python /opt/suemo/fastembed-server.py
|
|
197
197
|
Restart=on-failure
|
|
198
198
|
RestartSec=5s
|
|
@@ -200,7 +200,7 @@ NoNewPrivileges=true
|
|
|
200
200
|
PrivateTmp=true
|
|
201
201
|
ProtectSystem=strict
|
|
202
202
|
ProtectHome=true
|
|
203
|
-
ReadWritePaths=/var/cache/fastembed
|
|
203
|
+
ReadWritePaths=/var/cache/fastembed /var/lib/fastembed
|
|
204
204
|
StandardOutput=journal
|
|
205
205
|
StandardError=journal
|
|
206
206
|
SyslogIdentifier=suemo-fastembed
|
|
@@ -484,7 +484,7 @@ function buildSurrealActions(
|
|
|
484
484
|
{
|
|
485
485
|
kind: 'run',
|
|
486
486
|
command: 'systemctl',
|
|
487
|
-
args: ['enable', '--now', `suemo-
|
|
487
|
+
args: ['enable', '--now', `suemo-surreal@${profile}.service`],
|
|
488
488
|
requireRoot: true,
|
|
489
489
|
},
|
|
490
490
|
)
|
|
@@ -542,9 +542,9 @@ function printInitSystemSummary(kind: 'surreal' | 'fastembed', dryRun: boolean,
|
|
|
542
542
|
console.log('✓ SurrealDB setup complete.')
|
|
543
543
|
}
|
|
544
544
|
if (profile) {
|
|
545
|
-
console.log(`Service: suemo-
|
|
546
|
-
console.log(`Status: systemctl status suemo-
|
|
547
|
-
console.log(`Logs: journalctl -u suemo-
|
|
545
|
+
console.log(`Service: suemo-surreal@${profile}.service`)
|
|
546
|
+
console.log(`Status: systemctl status suemo-surreal@${profile}.service`)
|
|
547
|
+
console.log(`Logs: journalctl -u suemo-surreal@${profile}.service -f`)
|
|
548
548
|
}
|
|
549
549
|
return
|
|
550
550
|
}
|
|
@@ -849,7 +849,7 @@ const initSurrealCmd = init.sub('surreal')
|
|
|
849
849
|
ok: true,
|
|
850
850
|
dryRun: false,
|
|
851
851
|
profile,
|
|
852
|
-
service: `suemo-
|
|
852
|
+
service: `suemo-surreal@${profile}.service`,
|
|
853
853
|
credentialStatus: result.credentialStatus,
|
|
854
854
|
}, flags)
|
|
855
855
|
return
|
package/src/skill/catalog.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import { readdirSync, readFileSync } from 'node:fs'
|
|
2
|
-
import { basename,
|
|
3
|
-
import { fileURLToPath } from 'node:url'
|
|
2
|
+
import { basename, join } from 'node:path'
|
|
4
3
|
|
|
5
|
-
const PROJECT_ROOT =
|
|
6
|
-
|
|
7
|
-
)
|
|
8
|
-
|
|
9
|
-
const SKILL_FILE_PATH = `${PROJECT_ROOT}/skills/suemo/SKILL.md`
|
|
10
|
-
const SKILL_REFERENCES_DIR = `${PROJECT_ROOT}/skills/suemo/references/`
|
|
4
|
+
const PROJECT_ROOT = new URL('.', import.meta.resolve('@/package.json')).pathname
|
|
5
|
+
const SKILL_FILE_PATH = join(PROJECT_ROOT, 'skills/suemo/SKILL.md')
|
|
6
|
+
const SKILL_REFERENCES_DIR = join(PROJECT_ROOT, 'skills/suemo/references/')
|
|
11
7
|
|
|
12
8
|
export function skillFilePath(): string {
|
|
13
9
|
return SKILL_FILE_PATH
|
|
@@ -29,7 +25,7 @@ export function skillReferencePath(reference: string): string | null {
|
|
|
29
25
|
if (!cleaned) return null
|
|
30
26
|
const available = new Set(listSkillReferences())
|
|
31
27
|
if (!available.has(cleaned)) return null
|
|
32
|
-
return
|
|
28
|
+
return join(PROJECT_ROOT, `/skills/suemo/references/${cleaned}.md`)
|
|
33
29
|
}
|
|
34
30
|
|
|
35
31
|
export function readSkillReference(reference: string): { name: string; path: string; content: string } | null {
|