@jagilber-org/index-server 1.28.2 → 1.28.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.
Files changed (33) hide show
  1. package/CONTRIBUTING.md +3 -2
  2. package/README.md +29 -10
  3. package/dist/config/runtimeConfig.d.ts +1 -0
  4. package/dist/config/runtimeConfig.js +1 -0
  5. package/dist/dashboard/client/admin.html +27 -27
  6. package/dist/server/certInit.js +4 -2
  7. package/dist/server/index-server.js +102 -1
  8. package/dist/server/sdkServer.js +2 -2
  9. package/dist/server/transport.js +2 -2
  10. package/dist/services/handlers.dashboardConfig.js +1 -0
  11. package/dist/services/handlers.search.js +4 -0
  12. package/dist/services/handlers.usage.js +11 -0
  13. package/dist/services/mcpConfig/backup.d.ts +17 -0
  14. package/dist/services/mcpConfig/backup.js +114 -0
  15. package/dist/services/mcpConfig/flagCatalog.d.ts +44 -0
  16. package/dist/services/mcpConfig/flagCatalog.js +315 -0
  17. package/dist/services/mcpConfig/formats.d.ts +30 -0
  18. package/dist/services/mcpConfig/formats.js +116 -0
  19. package/dist/services/mcpConfig/index.d.ts +44 -0
  20. package/dist/services/mcpConfig/index.js +130 -0
  21. package/dist/services/mcpConfig/jsoncEdit.d.ts +2 -0
  22. package/dist/services/mcpConfig/jsoncEdit.js +29 -0
  23. package/dist/services/mcpConfig/paths.d.ts +18 -0
  24. package/dist/services/mcpConfig/paths.js +50 -0
  25. package/dist/services/mcpConfig/validate.d.ts +7 -0
  26. package/dist/services/mcpConfig/validate.js +62 -0
  27. package/package.json +3 -2
  28. package/schemas/mcp.claude.schema.json +27 -0
  29. package/schemas/mcp.copilot-cli.schema.json +28 -0
  30. package/schemas/mcp.indexServerEnv.schema.json +9 -0
  31. package/schemas/mcp.vscode.schema.json +28 -0
  32. package/scripts/build/setup-wizard.mjs +50 -344
  33. package/server.json +2 -2
@@ -0,0 +1,44 @@
1
+ export type McpProfile = 'default' | 'enhanced' | 'experimental';
2
+ export interface McpDataPaths {
3
+ instructions: string;
4
+ feedback: string;
5
+ backups: string;
6
+ state: string;
7
+ auditLog: string;
8
+ logFile: string;
9
+ metrics: string;
10
+ messaging: string;
11
+ embeddings: string;
12
+ modelCache: string;
13
+ sqliteDb: string;
14
+ certs: string;
15
+ flags: string;
16
+ }
17
+ export interface McpEnvCatalogSection {
18
+ section: string;
19
+ }
20
+ export interface McpEnvCatalogVariable {
21
+ key: string;
22
+ desc: string;
23
+ active: boolean;
24
+ value: string;
25
+ defaultByProfile: Record<McpProfile, string>;
26
+ mcpEnvVisibility: 'always' | 'when-set' | 'never';
27
+ validate: string;
28
+ [key: string]: unknown;
29
+ }
30
+ export type McpEnvCatalogEntry = McpEnvCatalogSection | McpEnvCatalogVariable;
31
+ export interface McpProfileConfig {
32
+ profile: McpProfile;
33
+ root: string;
34
+ port: number;
35
+ host: string;
36
+ tls: boolean;
37
+ mutation: boolean;
38
+ logLevel: string;
39
+ }
40
+ export declare const DOCUMENTED_INDEX_SERVER_FLAGS: readonly ["INDEX_SERVER_ADD_TIMING", "INDEX_SERVER_ADMIN_API_KEY", "INDEX_SERVER_ADMIN_MAX_SESSION_HISTORY", "INDEX_SERVER_AGENT_ID", "INDEX_SERVER_ALWAYS_RELOAD", "INDEX_SERVER_ATOMIC_WRITE_BACKOFF_MS", "INDEX_SERVER_ATOMIC_WRITE_RETRIES", "INDEX_SERVER_AUDIT_LOG", "INDEX_SERVER_AUTH_KEY", "INDEX_SERVER_AUTO_BACKUP", "INDEX_SERVER_AUTO_BACKUP_INTERVAL_MS", "INDEX_SERVER_AUTO_BACKUP_MAX_COUNT", "INDEX_SERVER_AUTO_EMBED_ON_IMPORT", "INDEX_SERVER_AUTO_SEED", "INDEX_SERVER_AUTO_SPLIT_OVERSIZED", "INDEX_SERVER_AUTO_USAGE_TRACK", "INDEX_SERVER_BACKUP_BEFORE_BULK_DELETE", "INDEX_SERVER_BACKUPS_DIR", "INDEX_SERVER_BODY_MAX_LENGTH", "INDEX_SERVER_BODY_WARN_LENGTH", "INDEX_SERVER_BOOTSTRAP_AUTOCONFIRM", "INDEX_SERVER_BOOTSTRAP_TOKEN_TTL_SEC", "INDEX_SERVER_BUFFER_RING_APPEND", "INDEX_SERVER_BUFFER_RING_PRELOAD", "INDEX_SERVER_CACHE_MODE", "INDEX_SERVER_CANONICAL_DISABLE", "INDEX_SERVER_DASHBOARD", "INDEX_SERVER_DASHBOARD_GRAPH", "INDEX_SERVER_DASHBOARD_HOST", "INDEX_SERVER_DASHBOARD_PORT", "INDEX_SERVER_DASHBOARD_TLS", "INDEX_SERVER_DASHBOARD_TLS_CA", "INDEX_SERVER_DASHBOARD_TLS_CERT", "INDEX_SERVER_DASHBOARD_TLS_KEY", "INDEX_SERVER_DASHBOARD_TRIES", "INDEX_SERVER_DEBUG", "INDEX_SERVER_DIR", "INDEX_SERVER_DISABLE_EARLY_STDIN_BUFFER", "INDEX_SERVER_DISABLE_STDERR_BRIDGE", "INDEX_SERVER_DISABLE_USAGE_CLAMP", "INDEX_SERVER_EMBEDDING_PATH", "INDEX_SERVER_ENABLE_INDEX_SERVER_POLLER", "INDEX_SERVER_ENABLE_STDERR_BRIDGE", "INDEX_SERVER_EVENT_BUFFER_SIZE", "INDEX_SERVER_EVENT_SILENT", "INDEX_SERVER_FATAL_EXIT_DELAY_MS", "INDEX_SERVER_FEATURES", "INDEX_SERVER_FEEDBACK_DIR", "INDEX_SERVER_FEEDBACK_MAX_ENTRIES", "INDEX_SERVER_FILE_TRACE", "INDEX_SERVER_FLAG_TOOLS_ADMIN", "INDEX_SERVER_FLAG_TOOLS_EXTENDED", "INDEX_SERVER_FLAGS", "INDEX_SERVER_FLAGS_FILE", "INDEX_SERVER_FORCE_REBUILD", "INDEX_SERVER_GOV_HASH_CANON_VARIANTS", "INDEX_SERVER_GOV_HASH_HARDENING", "INDEX_SERVER_GOV_HASH_IMPORT_SET_SIZE", "INDEX_SERVER_GRAPH_INCLUDE_PRIMARY_EDGES", "INDEX_SERVER_GRAPH_LARGE_CATEGORY_CAP", "INDEX_SERVER_HEALTH_ERROR_THRESHOLD", "INDEX_SERVER_HEALTH_MEMORY_THRESHOLD", "INDEX_SERVER_HEALTH_MIN_UPTIME", "INDEX_SERVER_HEARTBEAT_MS", "INDEX_SERVER_HTTP_METRICS", "INDEX_SERVER_IDLE_KEEPALIVE_MS", "INDEX_SERVER_IDLE_READY_SENTINEL", "INDEX_SERVER_INIT_FEATURES", "INDEX_SERVER_ISSUE_317_COUNTER", "INDEX_SERVER_LEADER_PORT", "INDEX_SERVER_LEADER_URL", "INDEX_SERVER_LOAD_WARN_MS", "INDEX_SERVER_LOG_DIAG", "INDEX_SERVER_LOG_FILE", "INDEX_SERVER_LOG_JSON", "INDEX_SERVER_LOG_LEVEL", "INDEX_SERVER_LOG_MUTATION", "INDEX_SERVER_LOG_PROTOCOL", "INDEX_SERVER_LOG_SEARCH", "INDEX_SERVER_LOG_SYNC", "INDEX_SERVER_LOG_TOOLS", "INDEX_SERVER_MANIFEST_FASTLOAD", "INDEX_SERVER_MANIFEST_PATH", "INDEX_SERVER_MANIFEST_WRITE", "INDEX_SERVER_MAX_BULK_DELETE", "INDEX_SERVER_MAX_CONNECTIONS", "INDEX_SERVER_MAX_FILES", "INDEX_SERVER_MCP_BACKUP_RETAIN", "INDEX_SERVER_MCP_CONFIG_ROOT", "INDEX_SERVER_MEMOIZE", "INDEX_SERVER_MEMOIZE_HASH", "INDEX_SERVER_MEMORY_MONITOR", "INDEX_SERVER_MESSAGING_DIR", "INDEX_SERVER_MESSAGING_MAX", "INDEX_SERVER_MESSAGING_SWEEP_MS", "INDEX_SERVER_METRICS_DIR", "INDEX_SERVER_METRICS_FILE_STORAGE", "INDEX_SERVER_METRICS_MAX_FILES", "INDEX_SERVER_MINIMAL_DEBUG", "INDEX_SERVER_MODE", "INDEX_SERVER_MUTATION", "INDEX_SERVER_NORMALIZATION_LOG", "INDEX_SERVER_POLL_MS", "INDEX_SERVER_POLL_PROACTIVE", "INDEX_SERVER_PREFLIGHT_MODULES", "INDEX_SERVER_PREFLIGHT_STRICT", "INDEX_SERVER_PROFILE", "INDEX_SERVER_PWS_EXIT_MS", "INDEX_SERVER_RATE_LIMIT", "INDEX_SERVER_READ_BACKOFF_MS", "INDEX_SERVER_READ_RETRIES", "INDEX_SERVER_REFERENCE_MODE", "INDEX_SERVER_REQUEST_TIMEOUT", "INDEX_SERVER_REQUIRE_AUTH_ALL", "INDEX_SERVER_REQUIRE_CATEGORY", "INDEX_SERVER_RESOURCE_CAPACITY", "INDEX_SERVER_RESOURCE_SAMPLE_INTERVAL_MS", "INDEX_SERVER_SEED_VERBOSE", "INDEX_SERVER_SEMANTIC_CACHE_DIR", "INDEX_SERVER_SEMANTIC_DEVICE", "INDEX_SERVER_SEMANTIC_ENABLED", "INDEX_SERVER_SEMANTIC_LOCAL_ONLY", "INDEX_SERVER_SEMANTIC_MODEL", "INDEX_SERVER_SEARCH_OMIT_ZERO_QUERY", "INDEX_SERVER_SESSION_BACKUP_INTEGRATION", "INDEX_SERVER_SESSION_DEDUPLICATION_ENABLED", "INDEX_SERVER_SESSION_MAX_CONNECTION_HISTORY_DAYS", "INDEX_SERVER_SESSION_MAX_HISTORY_DAYS", "INDEX_SERVER_SESSION_MAX_HISTORY_ENTRIES", "INDEX_SERVER_SESSION_PERSISTENCE_DIR", "INDEX_SERVER_SESSION_PERSISTENCE_ENABLED", "INDEX_SERVER_SESSION_PERSISTENCE_INTERVAL_MS", "INDEX_SERVER_SHARED_SERVER_SENTINEL", "INDEX_SERVER_SQLITE_MIGRATE_ON_START", "INDEX_SERVER_SQLITE_PATH", "INDEX_SERVER_SQLITE_VEC_ENABLED", "INDEX_SERVER_SQLITE_VEC_PATH", "INDEX_SERVER_SQLITE_WAL", "INDEX_SERVER_STALE_THRESHOLD_MS", "INDEX_SERVER_STATE_DIR", "INDEX_SERVER_STORAGE_BACKEND", "INDEX_SERVER_STRESS_DIAG", "INDEX_SERVER_STRESS_MODE", "INDEX_SERVER_STRICT_", "INDEX_SERVER_STRICT_CREATE", "INDEX_SERVER_STRICT_REMOVE", "INDEX_SERVER_TEST_MODE", "INDEX_SERVER_TEST_STRICT_VISIBILITY", "INDEX_SERVER_TIMING_JSON", "INDEX_SERVER_TOOLCALL_APPEND_LOG", "INDEX_SERVER_TOOLCALL_CHUNK_SIZE", "INDEX_SERVER_TOOLCALL_COMPACT_MS", "INDEX_SERVER_TOOLCALL_FLUSH_MS", "INDEX_SERVER_TRACE", "INDEX_SERVER_TRACE_", "INDEX_SERVER_TRACE_ALL", "INDEX_SERVER_TRACE_BUFFER_", "INDEX_SERVER_TRACE_BUFFER_DUMP_ON_EXIT", "INDEX_SERVER_TRACE_BUFFER_FILE", "INDEX_SERVER_TRACE_BUFFER_SIZE", "INDEX_SERVER_TRACE_CALLSITE", "INDEX_SERVER_TRACE_CATEGORIES", "INDEX_SERVER_TRACE_DIR", "INDEX_SERVER_TRACE_DISPATCH_DIAG", "INDEX_SERVER_TRACE_FILE", "INDEX_SERVER_TRACE_FSYNC", "INDEX_SERVER_TRACE_LEVEL", "INDEX_SERVER_TRACE_MAX_FILE_SIZE", "INDEX_SERVER_TRACE_PERSIST", "INDEX_SERVER_TRACE_QUERY_DIAG", "INDEX_SERVER_TRACE_SESSION", "INDEX_SERVER_USAGE_FLUSH_MS", "INDEX_SERVER_USAGE_SNAPSHOT_PATH", "INDEX_SERVER_VALIDATION_MODE", "INDEX_SERVER_VERBOSE_LOGGING", "INDEX_SERVER_VISIBILITY_DIAG", "INDEX_SERVER_WARN_BUDGET", "INDEX_SERVER_WORKSPACE"];
41
+ export declare function toForwardSlashes(value: string): string;
42
+ export declare function resolveDataPaths(root: string): McpDataPaths;
43
+ export declare function buildEnvCatalog(config: McpProfileConfig, paths: McpDataPaths): McpEnvCatalogEntry[];
44
+ export declare function activeEnvFromCatalog(catalog: McpEnvCatalogEntry[]): Record<string, string>;
@@ -0,0 +1,315 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DOCUMENTED_INDEX_SERVER_FLAGS = void 0;
7
+ exports.toForwardSlashes = toForwardSlashes;
8
+ exports.resolveDataPaths = resolveDataPaths;
9
+ exports.buildEnvCatalog = buildEnvCatalog;
10
+ exports.activeEnvFromCatalog = activeEnvFromCatalog;
11
+ const path_1 = __importDefault(require("path"));
12
+ exports.DOCUMENTED_INDEX_SERVER_FLAGS = [
13
+ 'INDEX_SERVER_ADD_TIMING',
14
+ 'INDEX_SERVER_ADMIN_API_KEY',
15
+ 'INDEX_SERVER_ADMIN_MAX_SESSION_HISTORY',
16
+ 'INDEX_SERVER_AGENT_ID',
17
+ 'INDEX_SERVER_ALWAYS_RELOAD',
18
+ 'INDEX_SERVER_ATOMIC_WRITE_BACKOFF_MS',
19
+ 'INDEX_SERVER_ATOMIC_WRITE_RETRIES',
20
+ 'INDEX_SERVER_AUDIT_LOG',
21
+ 'INDEX_SERVER_AUTH_KEY',
22
+ 'INDEX_SERVER_AUTO_BACKUP',
23
+ 'INDEX_SERVER_AUTO_BACKUP_INTERVAL_MS',
24
+ 'INDEX_SERVER_AUTO_BACKUP_MAX_COUNT',
25
+ 'INDEX_SERVER_AUTO_EMBED_ON_IMPORT',
26
+ 'INDEX_SERVER_AUTO_SEED',
27
+ 'INDEX_SERVER_AUTO_SPLIT_OVERSIZED',
28
+ 'INDEX_SERVER_AUTO_USAGE_TRACK',
29
+ 'INDEX_SERVER_BACKUP_BEFORE_BULK_DELETE',
30
+ 'INDEX_SERVER_BACKUPS_DIR',
31
+ 'INDEX_SERVER_BODY_MAX_LENGTH',
32
+ 'INDEX_SERVER_BODY_WARN_LENGTH',
33
+ 'INDEX_SERVER_BOOTSTRAP_AUTOCONFIRM',
34
+ 'INDEX_SERVER_BOOTSTRAP_TOKEN_TTL_SEC',
35
+ 'INDEX_SERVER_BUFFER_RING_APPEND',
36
+ 'INDEX_SERVER_BUFFER_RING_PRELOAD',
37
+ 'INDEX_SERVER_CACHE_MODE',
38
+ 'INDEX_SERVER_CANONICAL_DISABLE',
39
+ 'INDEX_SERVER_DASHBOARD',
40
+ 'INDEX_SERVER_DASHBOARD_GRAPH',
41
+ 'INDEX_SERVER_DASHBOARD_HOST',
42
+ 'INDEX_SERVER_DASHBOARD_PORT',
43
+ 'INDEX_SERVER_DASHBOARD_TLS',
44
+ 'INDEX_SERVER_DASHBOARD_TLS_CA',
45
+ 'INDEX_SERVER_DASHBOARD_TLS_CERT',
46
+ 'INDEX_SERVER_DASHBOARD_TLS_KEY',
47
+ 'INDEX_SERVER_DASHBOARD_TRIES',
48
+ 'INDEX_SERVER_DEBUG',
49
+ 'INDEX_SERVER_DIR',
50
+ 'INDEX_SERVER_DISABLE_EARLY_STDIN_BUFFER',
51
+ 'INDEX_SERVER_DISABLE_STDERR_BRIDGE',
52
+ 'INDEX_SERVER_DISABLE_USAGE_CLAMP',
53
+ 'INDEX_SERVER_EMBEDDING_PATH',
54
+ 'INDEX_SERVER_ENABLE_INDEX_SERVER_POLLER',
55
+ 'INDEX_SERVER_ENABLE_STDERR_BRIDGE',
56
+ 'INDEX_SERVER_EVENT_BUFFER_SIZE',
57
+ 'INDEX_SERVER_EVENT_SILENT',
58
+ 'INDEX_SERVER_FATAL_EXIT_DELAY_MS',
59
+ 'INDEX_SERVER_FEATURES',
60
+ 'INDEX_SERVER_FEEDBACK_DIR',
61
+ 'INDEX_SERVER_FEEDBACK_MAX_ENTRIES',
62
+ 'INDEX_SERVER_FILE_TRACE',
63
+ 'INDEX_SERVER_FLAG_TOOLS_ADMIN',
64
+ 'INDEX_SERVER_FLAG_TOOLS_EXTENDED',
65
+ 'INDEX_SERVER_FLAGS',
66
+ 'INDEX_SERVER_FLAGS_FILE',
67
+ 'INDEX_SERVER_FORCE_REBUILD',
68
+ 'INDEX_SERVER_GOV_HASH_CANON_VARIANTS',
69
+ 'INDEX_SERVER_GOV_HASH_HARDENING',
70
+ 'INDEX_SERVER_GOV_HASH_IMPORT_SET_SIZE',
71
+ 'INDEX_SERVER_GRAPH_INCLUDE_PRIMARY_EDGES',
72
+ 'INDEX_SERVER_GRAPH_LARGE_CATEGORY_CAP',
73
+ 'INDEX_SERVER_HEALTH_ERROR_THRESHOLD',
74
+ 'INDEX_SERVER_HEALTH_MEMORY_THRESHOLD',
75
+ 'INDEX_SERVER_HEALTH_MIN_UPTIME',
76
+ 'INDEX_SERVER_HEARTBEAT_MS',
77
+ 'INDEX_SERVER_HTTP_METRICS',
78
+ 'INDEX_SERVER_IDLE_KEEPALIVE_MS',
79
+ 'INDEX_SERVER_IDLE_READY_SENTINEL',
80
+ 'INDEX_SERVER_INIT_FEATURES',
81
+ 'INDEX_SERVER_ISSUE_317_COUNTER',
82
+ 'INDEX_SERVER_LEADER_PORT',
83
+ 'INDEX_SERVER_LEADER_URL',
84
+ 'INDEX_SERVER_LOAD_WARN_MS',
85
+ 'INDEX_SERVER_LOG_DIAG',
86
+ 'INDEX_SERVER_LOG_FILE',
87
+ 'INDEX_SERVER_LOG_JSON',
88
+ 'INDEX_SERVER_LOG_LEVEL',
89
+ 'INDEX_SERVER_LOG_MUTATION',
90
+ 'INDEX_SERVER_LOG_PROTOCOL',
91
+ 'INDEX_SERVER_LOG_SEARCH',
92
+ 'INDEX_SERVER_LOG_SYNC',
93
+ 'INDEX_SERVER_LOG_TOOLS',
94
+ 'INDEX_SERVER_MANIFEST_FASTLOAD',
95
+ 'INDEX_SERVER_MANIFEST_PATH',
96
+ 'INDEX_SERVER_MANIFEST_WRITE',
97
+ 'INDEX_SERVER_MAX_BULK_DELETE',
98
+ 'INDEX_SERVER_MAX_CONNECTIONS',
99
+ 'INDEX_SERVER_MAX_FILES',
100
+ 'INDEX_SERVER_MCP_BACKUP_RETAIN',
101
+ 'INDEX_SERVER_MCP_CONFIG_ROOT',
102
+ 'INDEX_SERVER_MEMOIZE',
103
+ 'INDEX_SERVER_MEMOIZE_HASH',
104
+ 'INDEX_SERVER_MEMORY_MONITOR',
105
+ 'INDEX_SERVER_MESSAGING_DIR',
106
+ 'INDEX_SERVER_MESSAGING_MAX',
107
+ 'INDEX_SERVER_MESSAGING_SWEEP_MS',
108
+ 'INDEX_SERVER_METRICS_DIR',
109
+ 'INDEX_SERVER_METRICS_FILE_STORAGE',
110
+ 'INDEX_SERVER_METRICS_MAX_FILES',
111
+ 'INDEX_SERVER_MINIMAL_DEBUG',
112
+ 'INDEX_SERVER_MODE',
113
+ 'INDEX_SERVER_MUTATION',
114
+ 'INDEX_SERVER_NORMALIZATION_LOG',
115
+ 'INDEX_SERVER_POLL_MS',
116
+ 'INDEX_SERVER_POLL_PROACTIVE',
117
+ 'INDEX_SERVER_PREFLIGHT_MODULES',
118
+ 'INDEX_SERVER_PREFLIGHT_STRICT',
119
+ 'INDEX_SERVER_PROFILE',
120
+ 'INDEX_SERVER_PWS_EXIT_MS',
121
+ 'INDEX_SERVER_RATE_LIMIT',
122
+ 'INDEX_SERVER_READ_BACKOFF_MS',
123
+ 'INDEX_SERVER_READ_RETRIES',
124
+ 'INDEX_SERVER_REFERENCE_MODE',
125
+ 'INDEX_SERVER_REQUEST_TIMEOUT',
126
+ 'INDEX_SERVER_REQUIRE_AUTH_ALL',
127
+ 'INDEX_SERVER_REQUIRE_CATEGORY',
128
+ 'INDEX_SERVER_RESOURCE_CAPACITY',
129
+ 'INDEX_SERVER_RESOURCE_SAMPLE_INTERVAL_MS',
130
+ 'INDEX_SERVER_SEED_VERBOSE',
131
+ 'INDEX_SERVER_SEMANTIC_CACHE_DIR',
132
+ 'INDEX_SERVER_SEMANTIC_DEVICE',
133
+ 'INDEX_SERVER_SEMANTIC_ENABLED',
134
+ 'INDEX_SERVER_SEMANTIC_LOCAL_ONLY',
135
+ 'INDEX_SERVER_SEMANTIC_MODEL',
136
+ 'INDEX_SERVER_SEARCH_OMIT_ZERO_QUERY',
137
+ 'INDEX_SERVER_SESSION_BACKUP_INTEGRATION',
138
+ 'INDEX_SERVER_SESSION_DEDUPLICATION_ENABLED',
139
+ 'INDEX_SERVER_SESSION_MAX_CONNECTION_HISTORY_DAYS',
140
+ 'INDEX_SERVER_SESSION_MAX_HISTORY_DAYS',
141
+ 'INDEX_SERVER_SESSION_MAX_HISTORY_ENTRIES',
142
+ 'INDEX_SERVER_SESSION_PERSISTENCE_DIR',
143
+ 'INDEX_SERVER_SESSION_PERSISTENCE_ENABLED',
144
+ 'INDEX_SERVER_SESSION_PERSISTENCE_INTERVAL_MS',
145
+ 'INDEX_SERVER_SHARED_SERVER_SENTINEL',
146
+ 'INDEX_SERVER_SQLITE_MIGRATE_ON_START',
147
+ 'INDEX_SERVER_SQLITE_PATH',
148
+ 'INDEX_SERVER_SQLITE_VEC_ENABLED',
149
+ 'INDEX_SERVER_SQLITE_VEC_PATH',
150
+ 'INDEX_SERVER_SQLITE_WAL',
151
+ 'INDEX_SERVER_STALE_THRESHOLD_MS',
152
+ 'INDEX_SERVER_STATE_DIR',
153
+ 'INDEX_SERVER_STORAGE_BACKEND',
154
+ 'INDEX_SERVER_STRESS_DIAG',
155
+ 'INDEX_SERVER_STRESS_MODE',
156
+ 'INDEX_SERVER_STRICT_',
157
+ 'INDEX_SERVER_STRICT_CREATE',
158
+ 'INDEX_SERVER_STRICT_REMOVE',
159
+ 'INDEX_SERVER_TEST_MODE',
160
+ 'INDEX_SERVER_TEST_STRICT_VISIBILITY',
161
+ 'INDEX_SERVER_TIMING_JSON',
162
+ 'INDEX_SERVER_TOOLCALL_APPEND_LOG',
163
+ 'INDEX_SERVER_TOOLCALL_CHUNK_SIZE',
164
+ 'INDEX_SERVER_TOOLCALL_COMPACT_MS',
165
+ 'INDEX_SERVER_TOOLCALL_FLUSH_MS',
166
+ 'INDEX_SERVER_TRACE',
167
+ 'INDEX_SERVER_TRACE_',
168
+ 'INDEX_SERVER_TRACE_ALL',
169
+ 'INDEX_SERVER_TRACE_BUFFER_',
170
+ 'INDEX_SERVER_TRACE_BUFFER_DUMP_ON_EXIT',
171
+ 'INDEX_SERVER_TRACE_BUFFER_FILE',
172
+ 'INDEX_SERVER_TRACE_BUFFER_SIZE',
173
+ 'INDEX_SERVER_TRACE_CALLSITE',
174
+ 'INDEX_SERVER_TRACE_CATEGORIES',
175
+ 'INDEX_SERVER_TRACE_DIR',
176
+ 'INDEX_SERVER_TRACE_DISPATCH_DIAG',
177
+ 'INDEX_SERVER_TRACE_FILE',
178
+ 'INDEX_SERVER_TRACE_FSYNC',
179
+ 'INDEX_SERVER_TRACE_LEVEL',
180
+ 'INDEX_SERVER_TRACE_MAX_FILE_SIZE',
181
+ 'INDEX_SERVER_TRACE_PERSIST',
182
+ 'INDEX_SERVER_TRACE_QUERY_DIAG',
183
+ 'INDEX_SERVER_TRACE_SESSION',
184
+ 'INDEX_SERVER_USAGE_FLUSH_MS',
185
+ 'INDEX_SERVER_USAGE_SNAPSHOT_PATH',
186
+ 'INDEX_SERVER_VALIDATION_MODE',
187
+ 'INDEX_SERVER_VERBOSE_LOGGING',
188
+ 'INDEX_SERVER_VISIBILITY_DIAG',
189
+ 'INDEX_SERVER_WARN_BUDGET',
190
+ 'INDEX_SERVER_WORKSPACE',
191
+ ];
192
+ function toForwardSlashes(value) {
193
+ return value.split(path_1.default.sep).join('/');
194
+ }
195
+ function resolveDataPaths(root) {
196
+ const resolveUnder = (...segments) => toForwardSlashes(path_1.default.resolve(root, ...segments));
197
+ return {
198
+ instructions: resolveUnder('instructions'),
199
+ feedback: resolveUnder('feedback'),
200
+ backups: resolveUnder('backups'),
201
+ state: resolveUnder('data', 'state'),
202
+ auditLog: resolveUnder('logs', 'instruction-transactions.log.jsonl'),
203
+ logFile: resolveUnder('logs', 'mcp-server.log'),
204
+ metrics: resolveUnder('metrics'),
205
+ messaging: resolveUnder('data', 'messaging'),
206
+ embeddings: resolveUnder('data', 'embeddings.json'),
207
+ modelCache: resolveUnder('data', 'models'),
208
+ sqliteDb: resolveUnder('data', 'index.db'),
209
+ certs: resolveUnder('certs'),
210
+ flags: resolveUnder('flags.json'),
211
+ };
212
+ }
213
+ function buildEnvCatalog(config, paths) {
214
+ const isEnhanced = config.profile === 'enhanced' || config.profile === 'experimental';
215
+ const isSqlite = config.profile === 'experimental';
216
+ const entries = [
217
+ { section: 'Core Paths - where your data lives' },
218
+ { key: 'INDEX_SERVER_PROFILE', desc: 'Configuration profile: default | enhanced | experimental', active: true, value: config.profile },
219
+ { key: 'INDEX_SERVER_ALWAYS_RELOAD', desc: 'Reload index on each read for generated config verification', active: true, value: '1' },
220
+ { key: 'INDEX_SERVER_DIR', desc: 'Instruction catalog directory', active: false, value: paths.instructions },
221
+ { key: 'INDEX_SERVER_FEEDBACK_DIR', desc: 'Feedback entries storage directory', active: false, value: paths.feedback },
222
+ { key: 'INDEX_SERVER_BACKUPS_DIR', desc: 'Backup snapshots directory', active: false, value: paths.backups },
223
+ { key: 'INDEX_SERVER_STATE_DIR', desc: 'Runtime state files directory', active: false, value: paths.state },
224
+ { key: 'INDEX_SERVER_MESSAGING_DIR', desc: 'Message queue storage directory', active: false, value: paths.messaging },
225
+ { section: 'Dashboard - HTTP/HTTPS admin interface' },
226
+ { key: 'INDEX_SERVER_DASHBOARD', desc: 'Enable the web dashboard', active: true, value: '1' },
227
+ { key: 'INDEX_SERVER_DASHBOARD_PORT', desc: 'Dashboard listen port', active: true, value: String(config.port) },
228
+ { key: 'INDEX_SERVER_DASHBOARD_HOST', desc: 'Dashboard bind address', active: true, value: config.host },
229
+ { key: 'INDEX_SERVER_DASHBOARD_GRAPH', desc: 'Enable graph visualization', active: false, value: '0' },
230
+ { section: 'Security - mutation control and TLS' },
231
+ { key: 'INDEX_SERVER_MUTATION', desc: 'Enable write operations', active: true, value: config.mutation ? '1' : '0' },
232
+ { key: 'INDEX_SERVER_ADMIN_API_KEY', desc: 'Dashboard admin API key', active: false, value: '' },
233
+ { key: 'INDEX_SERVER_DASHBOARD_TLS', desc: 'Enable HTTPS dashboard', active: config.tls, value: config.tls ? '1' : '0' },
234
+ { key: 'INDEX_SERVER_DASHBOARD_TLS_CERT', desc: 'Path to TLS certificate file', active: false, value: `${paths.certs}/server.crt` },
235
+ { key: 'INDEX_SERVER_DASHBOARD_TLS_KEY', desc: 'Path to TLS private key file', active: false, value: `${paths.certs}/server.key` },
236
+ { key: 'INDEX_SERVER_DASHBOARD_TLS_CA', desc: 'Path to CA certificate', active: false, value: '' },
237
+ { section: 'Semantic Search - embeddings' },
238
+ { key: 'INDEX_SERVER_SEMANTIC_ENABLED', desc: 'Enable semantic search', active: isEnhanced, value: isEnhanced ? '1' : '0' },
239
+ { key: 'INDEX_SERVER_SEMANTIC_MODEL', desc: 'HuggingFace model name', active: false, value: 'Xenova/all-MiniLM-L6-v2' },
240
+ { key: 'INDEX_SERVER_SEMANTIC_DEVICE', desc: 'Compute device', active: false, value: 'cpu' },
241
+ { key: 'INDEX_SERVER_SEMANTIC_CACHE_DIR', desc: 'Downloaded model cache directory', active: false, value: paths.modelCache },
242
+ { key: 'INDEX_SERVER_EMBEDDING_PATH', desc: 'Cached embeddings file', active: false, value: paths.embeddings },
243
+ { key: 'INDEX_SERVER_SEMANTIC_LOCAL_ONLY', desc: 'Block remote model downloads', active: false, value: isEnhanced ? '0' : '1' },
244
+ { section: 'Storage Backend - JSON or SQLite' },
245
+ { key: 'INDEX_SERVER_STORAGE_BACKEND', desc: 'Storage engine', active: isSqlite, value: isSqlite ? 'sqlite' : 'json' },
246
+ { key: 'INDEX_SERVER_SQLITE_PATH', desc: 'SQLite database file path', active: false, value: paths.sqliteDb },
247
+ { key: 'INDEX_SERVER_SQLITE_WAL', desc: 'Enable SQLite WAL mode', active: false, value: '1' },
248
+ { key: 'INDEX_SERVER_SQLITE_MIGRATE_ON_START', desc: 'Auto-migrate JSON to SQLite', active: false, value: '1' },
249
+ { section: 'Logging and diagnostics' },
250
+ { key: 'INDEX_SERVER_LOG_LEVEL', desc: 'Log level', active: true, value: config.logLevel },
251
+ { key: 'INDEX_SERVER_LOG_FILE', desc: 'Enable file logging', active: isEnhanced, value: isEnhanced ? '1' : '0' },
252
+ { key: 'INDEX_SERVER_VERBOSE_LOGGING', desc: 'Verbose stderr output', active: false, value: '0' },
253
+ { key: 'INDEX_SERVER_LOG_JSON', desc: 'JSON-formatted logs', active: false, value: '0' },
254
+ { key: 'INDEX_SERVER_LOG_DIAG', desc: 'Diagnostic startup logging', active: false, value: '0' },
255
+ { key: 'INDEX_SERVER_AUDIT_LOG', desc: 'Audit log path', active: false, value: paths.auditLog },
256
+ { section: 'Backup and recovery' },
257
+ { key: 'INDEX_SERVER_AUTO_BACKUP', desc: 'Enable instruction backups', active: false, value: config.mutation ? '1' : '0' },
258
+ { key: 'INDEX_SERVER_AUTO_BACKUP_INTERVAL_MS', desc: 'Backup interval in ms', active: false, value: '3600000' },
259
+ { key: 'INDEX_SERVER_AUTO_BACKUP_MAX_COUNT', desc: 'Max instruction backups retained', active: false, value: '10' },
260
+ { key: 'INDEX_SERVER_BACKUP_BEFORE_BULK_DELETE', desc: 'Backup before bulk delete', active: false, value: '1' },
261
+ { section: 'Features and flags' },
262
+ { key: 'INDEX_SERVER_FEATURES', desc: 'Comma-separated feature flags', active: isEnhanced, value: isEnhanced ? 'usage' : '' },
263
+ { key: 'INDEX_SERVER_FLAG_TOOLS_EXTENDED', desc: 'Expose extended index mutation tools', active: true, value: '1' },
264
+ { key: 'INDEX_SERVER_SEARCH_OMIT_ZERO_QUERY', desc: 'Omit echoed query metadata on zero-result search responses', active: true, value: '1' },
265
+ { key: 'INDEX_SERVER_METRICS_FILE_STORAGE', desc: 'Persist metrics to disk', active: isEnhanced, value: isEnhanced ? '1' : '0' },
266
+ { key: 'INDEX_SERVER_METRICS_DIR', desc: 'Metrics storage directory', active: false, value: paths.metrics },
267
+ { key: 'INDEX_SERVER_FLAGS_FILE', desc: 'Feature flags JSON file path', active: false, value: paths.flags },
268
+ { section: 'Server and transport' },
269
+ { key: 'INDEX_SERVER_MODE', desc: 'Instance mode', active: false, value: 'standalone' },
270
+ { key: 'INDEX_SERVER_DISABLE_EARLY_STDIN_BUFFER', desc: 'Disable stdin handshake hardening', active: false, value: '0' },
271
+ { key: 'INDEX_SERVER_IDLE_KEEPALIVE_MS', desc: 'Keepalive interval in ms', active: false, value: '30000' },
272
+ { key: 'INDEX_SERVER_POLL_MS', desc: 'Index filesystem poll interval', active: false, value: '10000' },
273
+ { section: 'Advanced tuning' },
274
+ { key: 'INDEX_SERVER_BODY_WARN_LENGTH', desc: 'Instruction body warning length', active: false, value: '50000' },
275
+ { key: 'INDEX_SERVER_AUTO_SPLIT_OVERSIZED', desc: 'Auto-split oversized entries', active: false, value: '0' },
276
+ { key: 'INDEX_SERVER_READ_RETRIES', desc: 'File read retry attempts', active: false, value: '3' },
277
+ { key: 'INDEX_SERVER_MAX_BULK_DELETE', desc: 'Max bulk delete entries', active: false, value: '5' },
278
+ { key: 'INDEX_SERVER_FEEDBACK_MAX_ENTRIES', desc: 'Max feedback entries', active: false, value: '1000' },
279
+ { key: 'INDEX_SERVER_MESSAGING_MAX', desc: 'Max messages in queue', active: false, value: '10000' },
280
+ { key: 'INDEX_SERVER_MAX_CONNECTIONS', desc: 'Max dashboard connections', active: false, value: '100' },
281
+ { key: 'INDEX_SERVER_CACHE_MODE', desc: 'Index cache mode', active: false, value: 'normal' },
282
+ { key: 'INDEX_SERVER_WORKSPACE', desc: 'Workspace identifier', active: false, value: '' },
283
+ { key: 'INDEX_SERVER_AGENT_ID', desc: 'Agent identifier', active: false, value: '' },
284
+ ];
285
+ const seen = new Set(entries.flatMap(entry => 'key' in entry ? [entry.key] : []));
286
+ for (const flag of exports.DOCUMENTED_INDEX_SERVER_FLAGS) {
287
+ if (!seen.has(flag))
288
+ entries.push({ key: flag, desc: 'Documented runtime configuration flag', active: false, value: '' });
289
+ }
290
+ return entries.map((entry) => {
291
+ if ('section' in entry)
292
+ return entry;
293
+ const value = String(entry.value);
294
+ const variable = {
295
+ ...entry,
296
+ value,
297
+ defaultByProfile: {
298
+ default: value,
299
+ enhanced: value,
300
+ experimental: value,
301
+ },
302
+ mcpEnvVisibility: entry.active ? 'always' : 'when-set',
303
+ validate: 'string',
304
+ };
305
+ return variable;
306
+ });
307
+ }
308
+ function activeEnvFromCatalog(catalog) {
309
+ const env = {};
310
+ for (const entry of catalog) {
311
+ if ('key' in entry && entry.active)
312
+ env[entry.key] = entry.value;
313
+ }
314
+ return env;
315
+ }
@@ -0,0 +1,30 @@
1
+ import { McpDataPaths, McpProfileConfig } from './flagCatalog';
2
+ import type { McpConfigFormat } from './paths';
3
+ export interface McpServerEntry {
4
+ type?: string;
5
+ command: string;
6
+ args: string[];
7
+ cwd?: string;
8
+ env?: Record<string, string>;
9
+ tools?: string[];
10
+ }
11
+ export interface ServerBuildConfig extends McpProfileConfig {
12
+ serverName: string;
13
+ }
14
+ export declare function rootKeyForFormat(format: McpConfigFormat): 'servers' | 'mcpServers';
15
+ export declare function emptyConfigForFormat(format: McpConfigFormat): Record<string, unknown>;
16
+ export declare function parseConfigText(format: McpConfigFormat, text: string): Record<string, unknown>;
17
+ export declare function readConfigFile(format: McpConfigFormat, filePath: string): Record<string, unknown>;
18
+ export declare function getServerMap(config: Record<string, unknown>, format: McpConfigFormat): Record<string, McpServerEntry>;
19
+ export declare function resolveServerLaunch(config: {
20
+ root: string;
21
+ }): {
22
+ command: string;
23
+ args: string[];
24
+ cwd?: string;
25
+ source: 'local' | 'packaged' | 'npx';
26
+ };
27
+ export declare function buildServerEntry(format: McpConfigFormat, config: ServerBuildConfig, paths: McpDataPaths, envOverrides?: Record<string, string>): McpServerEntry;
28
+ export declare function renderConfig(format: McpConfigFormat, serverName: string, entry: McpServerEntry): string;
29
+ export declare function upsertConfigText(format: McpConfigFormat, existingText: string, serverName: string, entry: McpServerEntry): string;
30
+ export declare function removeConfigText(format: McpConfigFormat, existingText: string, serverName: string): string;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.rootKeyForFormat = rootKeyForFormat;
7
+ exports.emptyConfigForFormat = emptyConfigForFormat;
8
+ exports.parseConfigText = parseConfigText;
9
+ exports.readConfigFile = readConfigFile;
10
+ exports.getServerMap = getServerMap;
11
+ exports.resolveServerLaunch = resolveServerLaunch;
12
+ exports.buildServerEntry = buildServerEntry;
13
+ exports.renderConfig = renderConfig;
14
+ exports.upsertConfigText = upsertConfigText;
15
+ exports.removeConfigText = removeConfigText;
16
+ const fs_1 = __importDefault(require("fs"));
17
+ const path_1 = __importDefault(require("path"));
18
+ const jsoncEdit_1 = require("./jsoncEdit");
19
+ const flagCatalog_1 = require("./flagCatalog");
20
+ function rootKeyForFormat(format) {
21
+ return format === 'vscode' || format === 'vscode-global' ? 'servers' : 'mcpServers';
22
+ }
23
+ function emptyConfigForFormat(format) {
24
+ const rootKey = rootKeyForFormat(format);
25
+ const value = { [rootKey]: {} };
26
+ if (rootKey === 'servers')
27
+ value.inputs = [];
28
+ return value;
29
+ }
30
+ function parseConfigText(format, text) {
31
+ if (text.trim().length === 0)
32
+ return emptyConfigForFormat(format);
33
+ return format === 'vscode' || format === 'vscode-global'
34
+ ? (0, jsoncEdit_1.parseJsonc)(text)
35
+ : JSON.parse(text);
36
+ }
37
+ function readConfigFile(format, filePath) {
38
+ if (!fs_1.default.existsSync(filePath))
39
+ return emptyConfigForFormat(format);
40
+ return parseConfigText(format, fs_1.default.readFileSync(filePath, 'utf8'));
41
+ }
42
+ function getServerMap(config, format) {
43
+ const rootKey = rootKeyForFormat(format);
44
+ const servers = config[rootKey];
45
+ if (servers === undefined)
46
+ return {};
47
+ if (!servers || typeof servers !== 'object' || Array.isArray(servers)) {
48
+ throw new Error(`Invalid MCP config: ${rootKey} must be an object`);
49
+ }
50
+ return servers;
51
+ }
52
+ function resolveServerLaunch(config) {
53
+ const packageRoot = path_1.default.resolve(__dirname, '..', '..', '..');
54
+ const entryRelative = path_1.default.join('dist', 'server', 'index-server.js');
55
+ const localEntry = path_1.default.join(config.root, entryRelative);
56
+ const packagedEntry = path_1.default.join(packageRoot, entryRelative);
57
+ if (fs_1.default.existsSync(localEntry)) {
58
+ return { command: 'node', args: [(0, flagCatalog_1.toForwardSlashes)(entryRelative)], cwd: config.root, source: 'local' };
59
+ }
60
+ if (fs_1.default.existsSync(packagedEntry)) {
61
+ return { command: 'node', args: [(0, flagCatalog_1.toForwardSlashes)(packagedEntry)], source: 'packaged' };
62
+ }
63
+ return { command: 'npx', args: ['-y', '@jagilber-org/index-server'], source: 'npx' };
64
+ }
65
+ function buildServerEntry(format, config, paths, envOverrides = {}) {
66
+ const launch = resolveServerLaunch(config);
67
+ const catalog = (0, flagCatalog_1.buildEnvCatalog)(config, paths);
68
+ const env = { ...(0, flagCatalog_1.activeEnvFromCatalog)(catalog), ...envOverrides };
69
+ const entry = {
70
+ command: launch.command,
71
+ args: launch.args,
72
+ env,
73
+ };
74
+ if (format === 'vscode' || format === 'vscode-global')
75
+ entry.type = 'stdio';
76
+ if (format === 'vscode' && launch.cwd)
77
+ entry.cwd = (0, flagCatalog_1.toForwardSlashes)(launch.cwd);
78
+ if (format === 'vscode-global' && launch.command === 'node') {
79
+ const firstArg = launch.args[0] ?? '';
80
+ entry.args = [path_1.default.isAbsolute(firstArg) ? (0, flagCatalog_1.toForwardSlashes)(firstArg) : (0, flagCatalog_1.toForwardSlashes)(path_1.default.resolve(launch.cwd ?? config.root, firstArg))];
81
+ entry.cwd = (0, flagCatalog_1.toForwardSlashes)(path_1.default.resolve(__dirname, '..', '..', '..'));
82
+ }
83
+ return entry;
84
+ }
85
+ function renderConfig(format, serverName, entry) {
86
+ const config = emptyConfigForFormat(format);
87
+ const rootKey = rootKeyForFormat(format);
88
+ config[rootKey][serverName] = entry;
89
+ return format === 'vscode' || format === 'vscode-global'
90
+ ? JSON.stringify(config, null, 2)
91
+ : `${JSON.stringify(config, null, 2)}\n`;
92
+ }
93
+ function upsertConfigText(format, existingText, serverName, entry) {
94
+ if (format === 'vscode' || format === 'vscode-global') {
95
+ const base = existingText.trim().length > 0 ? existingText : JSON.stringify(emptyConfigForFormat(format), null, 2);
96
+ return (0, jsoncEdit_1.applyJsoncEdit)(base, [rootKeyForFormat(format), serverName], entry);
97
+ }
98
+ const config = parseConfigText(format, existingText);
99
+ const rootKey = rootKeyForFormat(format);
100
+ const servers = getServerMap(config, format);
101
+ servers[serverName] = entry;
102
+ config[rootKey] = servers;
103
+ return `${JSON.stringify(config, null, 2)}\n`;
104
+ }
105
+ function removeConfigText(format, existingText, serverName) {
106
+ if (format === 'vscode' || format === 'vscode-global') {
107
+ const base = existingText.trim().length > 0 ? existingText : JSON.stringify(emptyConfigForFormat(format), null, 2);
108
+ return (0, jsoncEdit_1.applyJsoncEdit)(base, [rootKeyForFormat(format), serverName], undefined);
109
+ }
110
+ const config = parseConfigText(format, existingText);
111
+ const rootKey = rootKeyForFormat(format);
112
+ const servers = getServerMap(config, format);
113
+ delete servers[serverName];
114
+ config[rootKey] = servers;
115
+ return `${JSON.stringify(config, null, 2)}\n`;
116
+ }
@@ -0,0 +1,44 @@
1
+ import { resolveServerLaunch, type McpServerEntry, type ServerBuildConfig } from './formats';
2
+ import { buildEnvCatalog, resolveDataPaths } from './flagCatalog';
3
+ import { resolveConfigTargets, type McpClientTarget, type McpConfigFormat, type McpScope, type McpTargetInfo } from './paths';
4
+ import { type ValidationResult } from './validate';
5
+ export type { McpClientTarget, McpConfigFormat, McpScope, McpTargetInfo, McpServerEntry, ServerBuildConfig, ValidationResult };
6
+ export { buildEnvCatalog, resolveConfigTargets, resolveDataPaths, resolveServerLaunch };
7
+ export interface McpOperationOptions {
8
+ target?: McpClientTarget;
9
+ targets?: McpClientTarget[];
10
+ scope?: McpScope;
11
+ root?: string;
12
+ name?: string;
13
+ profile?: 'default' | 'enhanced' | 'experimental';
14
+ port?: number;
15
+ host?: string;
16
+ tls?: boolean;
17
+ mutation?: boolean;
18
+ logLevel?: string;
19
+ env?: Record<string, string>;
20
+ dryRun?: boolean;
21
+ backup?: string;
22
+ }
23
+ export interface McpOperationResult {
24
+ ok: boolean;
25
+ action: string;
26
+ target: McpClientTarget;
27
+ format: McpConfigFormat;
28
+ path: string;
29
+ name?: string;
30
+ server?: McpServerEntry | null;
31
+ servers?: string[];
32
+ validation?: ValidationResult;
33
+ backupPath?: string;
34
+ dryRun?: boolean;
35
+ }
36
+ export declare function listServers(options?: McpOperationOptions): McpOperationResult;
37
+ export declare function getServer(options?: McpOperationOptions): McpOperationResult;
38
+ export declare function upsertServer(options?: McpOperationOptions): McpOperationResult;
39
+ export declare function removeServer(options?: McpOperationOptions): McpOperationResult;
40
+ export declare function restoreLatestBackup(options?: McpOperationOptions): McpOperationResult;
41
+ export declare function restoreServer(options?: McpOperationOptions): McpOperationResult;
42
+ export declare function validateFile(options?: McpOperationOptions): McpOperationResult;
43
+ export declare function renderServerConfigForTarget(target: McpTargetInfo, options?: McpOperationOptions): string;
44
+ export declare function writeGeneratedConfig(filePath: string, content: string): void;