vault-cortex 0.10.4 → 0.10.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/README.md +3 -3
- package/dist/env.js +18 -0
- package/dist/optional-settings.js +22 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,9 +49,9 @@ What it does:
|
|
|
49
49
|
- **Remote** — a VPS with [Obsidian Sync](https://obsidian.md/sync),
|
|
50
50
|
reachable from any device
|
|
51
51
|
2. Offers the most common optional settings — memory layer and folder,
|
|
52
|
-
daily notes folder and format, file tools,
|
|
53
|
-
timezone (plus sync direction for remote) — press enter
|
|
54
|
-
defaults, or pick the ones you want to change
|
|
52
|
+
daily notes folder and format, file tools, read-only mode, semantic
|
|
53
|
+
search, port, timezone (plus sync direction for remote) — press enter
|
|
54
|
+
to keep the defaults, or pick the ones you want to change
|
|
55
55
|
3. Generates a `.env` file with a securely generated `MCP_AUTH_TOKEN`
|
|
56
56
|
4. Optionally starts the container and waits for the health check
|
|
57
57
|
5. Prints your connection details — the MCP URL, your auth token, and how to
|
package/dist/env.js
CHANGED
|
@@ -58,6 +58,15 @@ MEMORY_ENABLED=true
|
|
|
58
58
|
# Enable or disable file tools — vault_read_file and vault_list_files (default: true).
|
|
59
59
|
# Set to false when Obsidian Sync has attachment syncing disabled.
|
|
60
60
|
FILE_TOOLS_ENABLED=true
|
|
61
|
+
# Run the server in read-only mode (default: false).
|
|
62
|
+
# Set to true to hide every tool that changes the vault — clients can only
|
|
63
|
+
# read and search. The memory folder is not auto-created in this mode.
|
|
64
|
+
READONLY_MODE=false
|
|
65
|
+
# Hide individual tools by name, comma-separated (default: none hidden).
|
|
66
|
+
# Names match the README tools table: https://github.com/aliasunder/vault-cortex#tools
|
|
67
|
+
# Subtractive only — it cannot re-enable a tool another setting hides; an
|
|
68
|
+
# unknown tool name stops the server at startup so typos surface immediately.
|
|
69
|
+
# DISABLED_TOOLS=vault_delete_note,vault_move_note
|
|
61
70
|
# Memory folder name in your vault (default: About Me).
|
|
62
71
|
MEMORY_DIR=About Me
|
|
63
72
|
|
|
@@ -160,6 +169,15 @@ MEMORY_ENABLED=true
|
|
|
160
169
|
# Enable or disable file tools — vault_read_file and vault_list_files (default: true).
|
|
161
170
|
# Set to false when Obsidian Sync has attachment syncing disabled.
|
|
162
171
|
FILE_TOOLS_ENABLED=true
|
|
172
|
+
# Run the server in read-only mode (default: false).
|
|
173
|
+
# Set to true to hide every tool that changes the vault — clients can only
|
|
174
|
+
# read and search. The memory folder is not auto-created in this mode.
|
|
175
|
+
READONLY_MODE=false
|
|
176
|
+
# Hide individual tools by name, comma-separated (default: none hidden).
|
|
177
|
+
# Names match the README tools table: https://github.com/aliasunder/vault-cortex#tools
|
|
178
|
+
# Subtractive only — it cannot re-enable a tool another setting hides; an
|
|
179
|
+
# unknown tool name stops the server at startup so typos surface immediately.
|
|
180
|
+
# DISABLED_TOOLS=vault_delete_note,vault_move_note
|
|
163
181
|
# Memory folder name in your vault (default: About Me).
|
|
164
182
|
MEMORY_DIR=About Me
|
|
165
183
|
|
|
@@ -37,6 +37,13 @@ const OPTIONAL_SETTINGS = [
|
|
|
37
37
|
label: "File tools",
|
|
38
38
|
question: "Enable file tools (read images, PDFs, and other non-Markdown files)?",
|
|
39
39
|
},
|
|
40
|
+
{
|
|
41
|
+
kind: "toggle",
|
|
42
|
+
name: "READONLY_MODE",
|
|
43
|
+
label: "Read-only mode",
|
|
44
|
+
question: "Run the server in read-only mode (hide all tools that change the vault)?",
|
|
45
|
+
defaultEnabled: false,
|
|
46
|
+
},
|
|
40
47
|
{
|
|
41
48
|
kind: "toggle",
|
|
42
49
|
name: "EMBEDDING_ENABLED",
|
|
@@ -127,11 +134,12 @@ export const derivePublicUrlOverride = (envContent, overrides) => {
|
|
|
127
134
|
return { ...overrides, PUBLIC_URL: `http://localhost:${newPort}` };
|
|
128
135
|
};
|
|
129
136
|
/**
|
|
130
|
-
*
|
|
131
|
-
* 0/1 alongside true/false. An absent or unrecognized value falls to
|
|
132
|
-
* server default,
|
|
137
|
+
* True unless the .env value is an explicit "off" spelling — env-var's asBool
|
|
138
|
+
* accepts 0/1 alongside true/false. An absent or unrecognized value falls to
|
|
139
|
+
* the server default, declared per-toggle via defaultEnabled (enabled unless
|
|
140
|
+
* stated otherwise).
|
|
133
141
|
*/
|
|
134
|
-
const
|
|
142
|
+
const isEnabledToggleValue = (value) => !["false", "0"].includes((value ?? "").toLowerCase());
|
|
135
143
|
/**
|
|
136
144
|
* Plain digits in the TCP port range. Number() coercion is not enough:
|
|
137
145
|
* it accepts "1e4"/"0x1F40"/"+9000", which readEnvPort's /^PORT=(\d+)/
|
|
@@ -222,7 +230,15 @@ const askSettingValue = async (params, prompts) => {
|
|
|
222
230
|
const { setting, currentValue } = params;
|
|
223
231
|
switch (setting.kind) {
|
|
224
232
|
case "toggle": {
|
|
225
|
-
|
|
233
|
+
// An unset or empty var means the server default applies — seed the
|
|
234
|
+
// confirm from defaultEnabled, not from the enabled-unless-"false"
|
|
235
|
+
// heuristic (wrong for default-off toggles like READONLY_MODE).
|
|
236
|
+
// Empty string matters: `READONLY_MODE=` in .env is read as unset
|
|
237
|
+
// by Compose's `${VAR:-default}` and env-var's `.default()`.
|
|
238
|
+
const currentlyEnabled = !currentValue
|
|
239
|
+
? (setting.defaultEnabled ?? true)
|
|
240
|
+
: isEnabledToggleValue(currentValue);
|
|
241
|
+
const enabled = await prompts.confirm(setting.question, currentlyEnabled);
|
|
226
242
|
return String(enabled);
|
|
227
243
|
}
|
|
228
244
|
case "port":
|
|
@@ -258,7 +274,7 @@ export const askOptionalSettings = async (params, prompts) => {
|
|
|
258
274
|
const currentValue = readOptionalValue(envContent, setting.name);
|
|
259
275
|
const requiredToggle = OPTIONAL_SETTINGS.find((candidate) => candidate.name === setting.requiresToggle);
|
|
260
276
|
const dependencyNote = requiredToggle &&
|
|
261
|
-
|
|
277
|
+
!isEnabledToggleValue(readOptionalValue(envContent, requiredToggle.name))
|
|
262
278
|
? ` · not used while ${requiredToggle.label} is off`
|
|
263
279
|
: "";
|
|
264
280
|
return {
|