-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathconfig.js
More file actions
446 lines (429 loc) · 20.2 KB
/
Copy pathconfig.js
File metadata and controls
446 lines (429 loc) · 20.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
require('dotenv').config();
const path = require('path');
const pkg = require('./package.json');
const normalizedOpenRouterKeys = [];
if (process.env.OPENROUTER_API_KEY) {
const key = process.env.OPENROUTER_API_KEY.trim();
if (key) normalizedOpenRouterKeys.push(key);
}
if (process.env.OPENROUTER_API_KEYS) {
const extraKeys = String(process.env.OPENROUTER_API_KEYS)
.split(',')
.map(k => k.trim())
.filter(Boolean);
for (const key of extraKeys) {
if (!normalizedOpenRouterKeys.includes(key)) {
normalizedOpenRouterKeys.push(key);
}
}
}
const config = {
server: {
// Support both SERVER_PORT and PORT, prefer SERVER_PORT if present
port: process.env.SERVER_PORT || process.env.PORT || 3002,
name: "openrouter_agents",
version: pkg.version,
// Add a key for basic server authentication (optional)
apiKey: process.env.SERVER_API_KEY || null,
requireHttps: process.env.REQUIRE_HTTPS === 'true',
publicUrl: process.env.PUBLIC_URL || `${process.env.REQUIRE_HTTPS === 'true' ? 'https' : 'http'}://localhost:${process.env.SERVER_PORT || process.env.PORT || 3002}`,
// Server startup behavior
allowStartWithoutDb: process.env.ALLOW_START_WITHOUT_DB === 'true',
startupTimeoutMs: parseInt(process.env.STARTUP_TIMEOUT_MS, 10) || 60000
},
openrouter: {
apiKey: normalizedOpenRouterKeys[0],
apiKeys: normalizedOpenRouterKeys,
baseUrl: "https://openrouter.ai/api/v1",
timeout: parseInt(process.env.OPENROUTER_TIMEOUT_MS, 10) || 180000,
retries: parseInt(process.env.OPENROUTER_RETRIES, 10) || 3,
retryDelayMs: parseInt(process.env.OPENROUTER_RETRY_DELAY_MS, 10) || 1000
},
models: {
// Allow overriding planning model; provide a generally-available safe default
planning: process.env.PLANNING_MODEL || "google/gemini-3-flash-preview", // Default planning/synthesis model
planningCandidates: (process.env.PLANNING_CANDIDATES || "openai/gpt-5.2-chat,google/gemini-3-pro-preview,anthropic/claude-sonnet-4.5,google/gemini-3-flash-preview")
.split(',').map(s=>s.trim()).filter(Boolean),
useDynamicCatalog: process.env.USE_DYNAMIC_CATALOG === 'true',
// Define models with domain strengths
// Accept either JSON array of objects or CSV of model ids in env vars
highCost: process.env.HIGH_COST_MODELS ?
(function parseHighCost(val){
try {
const parsed = JSON.parse(val);
if (Array.isArray(parsed)) return parsed;
} catch(_) {}
// CSV fallback -> wrap ids as objects without explicit domains
return String(val).split(',').map(s=>s.trim()).filter(Boolean).map(name=>({ name, domains: ["general"] }));
})(process.env.HIGH_COST_MODELS) : [
{ name: "anthropic/claude-sonnet-4.5", domains: ["reasoning", "technical", "general", "creative"] },
{ name: "openai/gpt-5.2-chat", domains: ["reasoning", "technical", "general"] },
{ name: "google/gemini-3-pro-preview", domains: ["reasoning", "technical", "general", "creative"] },
{ name: "perplexity/sonar-pro-search", domains: ["reasoning", "technical", "general", "creative"] },
{ name: "google/gemini-3-flash-preview", domains: ["reasoning", "technical", "general", "creative"] }
],
lowCost: process.env.LOW_COST_MODELS ?
(function parseLowCost(val){
try {
const parsed = JSON.parse(val);
if (Array.isArray(parsed)) return parsed;
} catch(_) {}
return String(val).split(',').map(s=>s.trim()).filter(Boolean).map(name=>({ name, domains: ["general"] }));
})(process.env.LOW_COST_MODELS) : [
{ name: "google/gemini-3-flash-preview", domains: ["general", "reasoning", "technical", "coding"] },
{ name: "anthropic/claude-haiku-4.5", domains: ["general", "technical", "reasoning"] },
{ name: "z-ai/glm-4.7", domains: ["general", "multimodal", "vision", "reasoning"] },
{ name: "openai/gpt-oss-120b", domains: ["general", "reasoning", "search"] },
{ name: "moonshotai/kimi-k2-thinking", domains: ["general", "creative", "technical"] },
{ name: "baidu/ernie-4.5-vl-424b-a47b", domains: ["general", "creative"] }
],
// Define a tier for potentially simpler tasks (adjust models as needed)
veryLowCost: process.env.VERY_LOW_COST_MODELS ?
(function parseVeryLow(val){
try {
const parsed = JSON.parse(val);
if (Array.isArray(parsed)) return parsed;
} catch(_) {}
return String(val).split(',').map(s=>s.trim()).filter(Boolean).map(name=>({ name, domains: ["general"] }));
})(process.env.VERY_LOW_COST_MODELS) : [
{ name: "openai/gpt-5-nano", domains: ["general", "reasoning", "creative"] }
],
// Add a model specifically for classification tasks if needed, or reuse planning model
classification: process.env.CLASSIFICATION_MODEL || "openai/gpt-5-nano",
// Default ensemble size for research agent model ensembles
ensembleSize: parseInt(process.env.ENSEMBLE_SIZE, 10) || 2,
// Max research iterations (initial + refinements)
maxResearchIterations: parseInt(process.env.MAX_RESEARCH_ITERATIONS, 10) || 2, // Default to 1 initial + 1 refinement
// Parallelism for concurrent sub-queries
parallelism: parseInt(process.env.PARALLELISM, 10) || 4,
// Enforce a minimum max_tokens to avoid truncation across all calls
minMaxTokens: parseInt(process.env.MIN_MAX_TOKENS, 10) || 2048,
// Model-aware adaptive token limits (dynamically adjusted based on model capabilities)
tokens: {
synthesis: {
min: parseInt(process.env.SYNTHESIS_MIN_TOKENS, 10) || 4000,
fallbackMax: parseInt(process.env.SYNTHESIS_MAX_TOKENS, 10) || 16000,
perSubQuery: parseInt(process.env.TOKENS_PER_SUBQUERY, 10) || 800,
perDocument: parseInt(process.env.TOKENS_PER_DOC, 10) || 500
},
research: {
min: parseInt(process.env.RESEARCH_MIN_TOKENS, 10) || 2000,
fallbackMax: parseInt(process.env.RESEARCH_MAX_TOKENS, 10) || 8000
},
planning: {
min: parseInt(process.env.PLANNING_MIN_TOKENS, 10) || 1000,
fallbackMax: parseInt(process.env.PLANNING_MAX_TOKENS, 10) || 4000
}
}
},
// Database configuration for knowledge base using PGLite
database: {
// Smart default paths: XDG_DATA_HOME > TMPDIR (AppImage) > ~/.local/share > ./
dataDirectory: process.env.PGLITE_DATA_DIR || (() => {
// XDG Base Directory compliance (Linux/macOS)
if (process.env.XDG_DATA_HOME) {
return path.join(process.env.XDG_DATA_HOME, 'openrouter-agents', 'db');
}
// AppImage environments set TMPDIR to writable location within sandbox
if (process.env.APPIMAGE && process.env.TMPDIR) {
return path.join(process.env.TMPDIR, 'openrouter-agents-db');
}
// Standard user data location
if (process.env.HOME) {
return path.join(process.env.HOME, '.local', 'share', 'openrouter-agents', 'db');
}
// Fallback to current directory (legacy behavior)
return './researchAgentDB';
})(),
vectorDimension: 384, // Dimension for the embeddings from all-MiniLM-L6-v2
cacheTTL: parseInt(process.env.CACHE_TTL_SECONDS, 10) || 3600, // 1 hour in seconds
// Enhanced PGLite configuration
databaseUrl: process.env.PGLITE_DATABASE_URL || null, // Override auto-detected URL
relaxedDurability: process.env.PGLITE_RELAXED_DURABILITY === 'false' ? false : true,
maxRetryAttempts: parseInt(process.env.PGLITE_MAX_RETRY_ATTEMPTS, 10) || 3,
retryDelayBaseMs: parseInt(process.env.PGLITE_RETRY_DELAY_BASE_MS, 10) || 200,
// Initialization behavior
initTimeoutMs: parseInt(process.env.PGLITE_INIT_TIMEOUT_MS, 10) || 60000,
retryOnFailure: process.env.PGLITE_RETRY_ON_FAILURE === 'true',
allowInMemoryFallback: process.env.PGLITE_ALLOW_IN_MEMORY_FALLBACK !== 'false', // Default true for backwards compat
// Database extensions configuration
extensions: {
bloom: {
enabled: process.env.DB_BLOOM_ENABLED !== 'false',
indexFalsePositiveRate: parseFloat(process.env.BLOOM_FALSE_POSITIVE_RATE) || 0.01
},
cube: {
enabled: process.env.DB_CUBE_ENABLED !== 'false',
maxDimensions: parseInt(process.env.CUBE_MAX_DIMENSIONS, 10) || 10
},
seg: {
enabled: process.env.DB_SEG_ENABLED !== 'false'
},
tcn: {
enabled: process.env.DB_TCN_ENABLED !== 'false',
channels: ['research_reports_changed', 'jobs_changed']
},
tsm_system_time: {
enabled: process.env.DB_TEMPORAL_ENABLED !== 'false'
},
pgtap: {
enabled: process.env.NODE_ENV === 'test'
}
}
},
// Local indexing/search configuration (opt-in by default)
indexer: {
enabled: process.env.INDEXER_ENABLED === 'false' ? false : true,
autoIndexReports: process.env.INDEXER_AUTO_INDEX_REPORTS === 'true',
autoIndexFetchedContent: process.env.INDEXER_AUTO_INDEX_FETCHED === 'true',
embedDocs: process.env.INDEXER_EMBED_DOCS !== 'false',
maxDocLength: parseInt(process.env.INDEXER_MAX_DOC_LENGTH, 10) || 8000,
bm25: {
k1: Number(process.env.INDEXER_BM25_K1) || 1.2,
b: Number(process.env.INDEXER_BM25_B) || 0.75
},
weights: {
bm25: Number(process.env.INDEXER_WEIGHT_BM25) || 0.7,
vector: Number(process.env.INDEXER_WEIGHT_VECTOR) || 0.3
},
stopwords: (process.env.INDEXER_STOPWORDS || '').split(',').map(s => s.trim()).filter(Boolean),
rerankEnabled: process.env.INDEXER_RERANK_ENABLED === 'true',
rerankModel: process.env.INDEXER_RERANK_MODEL || null
},
// Configuration for where to save full research reports
reportOutputPath: process.env.REPORT_OUTPUT_PATH || './research_outputs/'
};
// MCP feature toggles (opt-in by default; can be disabled via env)
config.mcp = {
features: {
prompts: process.env.MCP_ENABLE_PROMPTS === 'false' ? false : true,
resources: process.env.MCP_ENABLE_RESOURCES === 'false' ? false : true
}
};
config.mcp.mode = (process.env.MODE || 'ALL').toUpperCase();
// Experimental modes
config.modes = {
hyper: process.env.HYPER_MODE === 'true'
};
// MCP transport preferences
config.mcp.transport = {
streamableHttpEnabled: true, // Always enabled — primary transport in v2.0.0
legacySseEnabled: process.env.MCP_LEGACY_SSE_ENABLED === 'false' ? false : true
};
// Prompt strategy configuration
config.prompts = {
compact: process.env.PROMPTS_COMPACT === 'false' ? false : true, // default compact prompts on
requireUrls: process.env.PROMPTS_REQUIRE_URLS === 'false' ? false : true,
confidenceScoring: process.env.PROMPTS_CONFIDENCE === 'false' ? false : true
};
// Simple tool aliasing (short params) for minimal token overhead
config.simpleTools = {
enabled: process.env.SIMPLE_TOOLS === 'false' ? false : true
};
// Tool recursion/chaining configuration
// Allows agent to execute multiple tools in a single call with depth limiting
config.toolRecursion = {
enabled: process.env.MAX_TOOL_DEPTH !== '0',
maxDepth: parseInt(process.env.MAX_TOOL_DEPTH, 10) || 3 // Default: 3 levels, set to 0 to disable
};
// Async job processing - optimized for parallel batch research
config.jobs = {
concurrency: parseInt(process.env.JOBS_CONCURRENCY, 10) || 4, // ↑ from 2 for better parallelism
heartbeatMs: parseInt(process.env.JOB_HEARTBEAT_MS, 10) || 2000, // ↓ from 5000 for faster stale detection
leaseTimeoutMs: parseInt(process.env.JOB_LEASE_TIMEOUT_MS, 10) || 30000, // ↓ from 60000 for faster recovery
batchEventLimit: parseInt(process.env.JOB_BATCH_EVENT_LIMIT, 10) || 500, // SSE event limit per batch poll
ssePollingMs: parseInt(process.env.JOB_SSE_POLLING_MS, 10) || 500 // ↓ from 1000 for lower latency
};
// Structured logging configuration (MCP-compliant)
config.logging = {
// Log level filtering: 'debug' | 'info' | 'warn' | 'error' (default: info)
level: (process.env.LOG_LEVEL || 'info').toLowerCase(),
// Output mode: 'stderr' | 'mcp' | 'both' (default: stderr)
// - stderr: Traditional stderr logging (compatible with all clients)
// - mcp: Use MCP SDK sendLoggingMessage notifications (client can filter)
// - both: Output to both channels
output: process.env.LOG_OUTPUT || 'stderr',
// JSON format for machine parsing (default: false for human-readable)
json: process.env.LOG_JSON === 'true'
};
// Advanced caching and cost optimization
config.caching = {
// Semantic result caching
results: {
enabled: process.env.RESULT_CACHING_ENABLED !== 'false',
ttlSeconds: parseInt(process.env.RESULT_CACHE_TTL, 10) || 7200, // 2 hours
maxEntries: parseInt(process.env.RESULT_CACHE_MAX_ENTRIES, 10) || 1000,
similarityThreshold: parseFloat(process.env.CACHE_SIMILARITY_THRESHOLD) || 0.85
},
// Model response caching
models: {
enabled: process.env.MODEL_CACHING_ENABLED !== 'false',
ttlSeconds: parseInt(process.env.MODEL_CACHE_TTL, 10) || 3600, // 1 hour
maxEntries: parseInt(process.env.MODEL_CACHE_MAX_ENTRIES, 10) || 500
},
// Cost optimization strategies
optimization: {
preferredLowCostModels: ['google/gemini-3-flash-preview', 'anthropic/claude-haiku-4.5', 'openai/gpt-5-nano', 'deepcogito/cogito-v2.1-671b'],
visionModels: ['anthropic/claude-opus-4.5', 'google/gemini-3-flash-preview', 'google/gemini-3-pro-preview', 'anthropic/claude-sonnet-4.5', 'openai/gpt-5.2'],
codingModels: ['google/gemini-3-flash-preview', 'google/gemini-3-pro-preview', 'openai/gpt-5.2-chat', 'anthropic/claude-sonnet-4.5', 'anthropic/claude-haiku-4.5', 'deepcogito/cogito-v2.1-671b'],
complexReasoningModels: ['perplexity/sonar-pro-search', 'google/gemini-3-pro-preview', 'anthropic/claude-sonnet-4.5', 'anthropic/claude-opus-4.5', 'openai/gpt-5.2-chat'],
costThresholds: {
simple: 0.0000005, // Max cost per token for simple queries
moderate: 0.000002, // Max cost per token for moderate queries
complex: 0.000015 // Max cost per token for complex queries
}
}
};
// Payload optimization
config.payload = {
compressionEnabled: process.env.PAYLOAD_COMPRESSION !== 'false',
compressionFormat: process.env.PAYLOAD_COMPRESSION_FORMAT || 'gzip', // gzip | brotli | none
compressionThreshold: parseInt(process.env.PAYLOAD_COMPRESSION_THRESHOLD, 10) || 50000, // bytes
referenceThreshold: parseInt(process.env.PAYLOAD_REFERENCE_THRESHOLD, 10) || 100000 // bytes
};
// Core abstractions (Convergence Plan v2.0)
config.core = {
// Enable new consolidated handlers (enabled by default since v1.9.0)
handlers: {
enabled: process.env.CORE_HANDLERS_ENABLED !== 'false',
// Which domains use new handlers (others fall back to tools.js)
domains: (process.env.CORE_HANDLER_DOMAINS || '').split(',').filter(Boolean)
},
// Signal protocol configuration (enabled by default since v1.9.0)
signal: {
enabled: process.env.SIGNAL_PROTOCOL_ENABLED !== 'false',
maxHistorySize: parseInt(process.env.SIGNAL_MAX_HISTORY, 10) || 1000
},
// RoleShift bidirectional protocol (enabled by default since v1.9.0)
roleShift: {
enabled: process.env.ROLESHIFT_ENABLED !== 'false',
timeout: parseInt(process.env.ROLESHIFT_TIMEOUT_MS, 10) || 60000
},
// MCP features (resources, prompts, streamable HTTP)
mcp: {
features: {
resources: process.env.MCP_RESOURCES_ENABLED !== 'false',
prompts: process.env.MCP_PROMPTS_ENABLED !== 'false'
}
},
// Schema registry options
schemas: {
strictValidation: process.env.STRICT_SCHEMA_VALIDATION === 'true'
},
// Rail Protocol configuration (v1.9.2)
rail: {
enabled: process.env.RAIL_ENABLED !== 'false',
version: '0.1.0',
// Token tracking
tokens: {
countEnabled: process.env.RAIL_TOKEN_COUNT !== 'false',
budgetEnabled: process.env.RAIL_TOKEN_BUDGET === 'true',
budgetLimit: parseInt(process.env.RAIL_TOKEN_BUDGET_LIMIT, 10) || 100000
},
// Caching
cache: {
enabled: process.env.RAIL_CACHE !== 'false',
ttlSeconds: parseInt(process.env.RAIL_CACHE_TTL, 10) || 3600,
semanticThreshold: parseFloat(process.env.RAIL_CACHE_THRESHOLD) || 0.85
},
// Rate limiting
rateLimit: {
enabled: process.env.RAIL_RATE_LIMIT !== 'false',
requestsPerMinute: parseInt(process.env.RAIL_RATE_LIMIT_RPM, 10) || 60
},
// Circuit breaker
circuitBreaker: {
enabled: process.env.RAIL_CIRCUIT_BREAKER !== 'false',
failureThreshold: parseInt(process.env.RAIL_CIRCUIT_THRESHOLD, 10) || 5,
resetTimeoutMs: parseInt(process.env.RAIL_CIRCUIT_RESET_MS, 10) || 120000 // 2 minutes for recovery
},
// Routing strategy
routing: {
strategy: process.env.RAIL_ROUTING_STRATEGY || 'auto',
costPreference: process.env.RAIL_COST_PREFERENCE || 'balanced'
},
// Tunnels (agent-to-agent)
tunnels: {
enabled: process.env.RAIL_TUNNELS !== 'false',
defaultTtlMs: parseInt(process.env.RAIL_TUNNEL_TTL_MS, 10) || 600000, // 10 minutes - research can be slow
requireAck: process.env.RAIL_TUNNEL_REQUIRE_ACK === 'true'
},
// Streaming consensus
consensus: {
enabled: process.env.RAIL_CONSENSUS !== 'false',
minAgreement: parseFloat(process.env.RAIL_CONSENSUS_MIN) || 0.6,
timeoutMs: parseInt(process.env.RAIL_CONSENSUS_TIMEOUT_MS, 10) || 300000, // 5 minutes - models can be slow
updateIntervalMs: parseInt(process.env.RAIL_CONSENSUS_UPDATE_MS, 10) || 500
},
// Observability
debug: process.env.RAIL_DEBUG === 'true',
debugRails: (process.env.RAIL_DEBUG_RAILS || '').split(',').filter(Boolean)
},
// HVM Integration (v1.15.0 - Superintelligence Stream A)
hvm: {
enabled: process.env.HVM_ENABLED !== 'false',
interpreter: process.env.HVM_INTERPRETER || 'js', // 'js' | 'wasm' (wasm not yet available)
maxReductions: parseInt(process.env.HVM_MAX_REDUCTIONS, 10) || 100000,
// Parallel reduction settings
parallelization: {
enabled: process.env.HVM_PARALLEL !== 'false',
maxWorkers: parseInt(process.env.HVM_MAX_WORKERS, 10) || 4,
strategy: process.env.HVM_PARALLEL_STRATEGY || 'label-analysis' // label-analysis | greedy | conservative
},
// Crystallization-aware termination
crystallization: {
earlyExitThreshold: parseFloat(process.env.HVM_CRYSTALLIZATION_THRESHOLD) || 0.7,
checkIntervalMs: parseInt(process.env.HVM_CHECK_INTERVAL_MS, 10) || 100
},
// Observability
debug: process.env.HVM_DEBUG === 'true',
visualize: process.env.HVM_VISUALIZE === 'true'
},
// Mathematical Foundations (v1.15.0 - Superintelligence Stream C)
math: {
// P-adic Numbers (provider lineage distance)
padic: {
enabled: process.env.PADIC_ENABLED !== 'false',
prime: parseInt(process.env.PADIC_PRIME, 10) || 2,
cacheEnabled: process.env.PADIC_CACHE !== 'false',
cacheTTL: parseInt(process.env.PADIC_CACHE_TTL, 10) || 3600
},
// IQ Quadrature (phase-based consensus)
quadrature: {
enabled: process.env.QUADRATURE_ENABLED !== 'false',
phaseLockThreshold: parseFloat(process.env.QUADRATURE_PHASE_LOCK_THRESHOLD) || 0.1,
referenceModel: process.env.QUADRATURE_REFERENCE_MODEL || 'anthropic/claude-sonnet-4.5'
},
// Semantic Manifolds (curvature-aware embedding)
manifold: {
enabled: process.env.MANIFOLD_ENABLED !== 'false',
curvatureThreshold: parseFloat(process.env.MANIFOLD_CURVATURE_THRESHOLD) || 0.5,
neighborhoodSize: parseInt(process.env.MANIFOLD_NEIGHBORHOOD_SIZE, 10) || 10,
precomputeOnIndex: process.env.MANIFOLD_PRECOMPUTE === 'true'
},
// Procedural Rewards (Stream D)
rewards: {
enabled: process.env.REWARDS_ENABLED !== 'false',
crystallizationWeight: parseFloat(process.env.REWARDS_CRYSTALLIZATION_WEIGHT) || 0.5,
uncertaintyPenalty: parseFloat(process.env.REWARDS_UNCERTAINTY_PENALTY) || 0.3,
traceBonus: parseFloat(process.env.REWARDS_TRACE_BONUS) || 0.2,
tracePersistence: process.env.REWARDS_PERSIST_TRACE !== 'false'
}
}
};
// Version information
config.version = pkg.version;
config.mcpSpec = {
stable: '2025-11-25',
// All SEPs from MCP 2025-11-25 stable (AAIF/Linux Foundation governance)
features: [
'SEP-1686', // Task Protocol
'SEP-1577', // Sampling with Tools
'SEP-1036', // URL Mode Elicitation
'SEP-1865', // MCP Apps (UI Resources)
'SEP-990', // Enterprise Auth (ID-JAG, Token Exchange)
'SEP-991', // Client Metadata (CIMD)
'SEP-1649' // Server Discovery (.well-known/mcp-server)
]
};
module.exports = config;