@fractary/codex-mcp 0.3.4 → 0.3.6
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/dist/cli.cjs +24 -2
- package/dist/cli.cjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -14253,12 +14253,31 @@ var McpServer = class {
|
|
|
14253
14253
|
};
|
|
14254
14254
|
|
|
14255
14255
|
// src/cli.ts
|
|
14256
|
+
function expandEnvVars(obj) {
|
|
14257
|
+
if (typeof obj === "string") {
|
|
14258
|
+
return obj.replace(/\$\{([^}]+)\}/g, (_, varName) => {
|
|
14259
|
+
return process.env[varName] || `\${${varName}}`;
|
|
14260
|
+
});
|
|
14261
|
+
}
|
|
14262
|
+
if (Array.isArray(obj)) {
|
|
14263
|
+
return obj.map((item) => expandEnvVars(item));
|
|
14264
|
+
}
|
|
14265
|
+
if (obj !== null && typeof obj === "object") {
|
|
14266
|
+
const result = {};
|
|
14267
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
14268
|
+
result[key] = expandEnvVars(value);
|
|
14269
|
+
}
|
|
14270
|
+
return result;
|
|
14271
|
+
}
|
|
14272
|
+
return obj;
|
|
14273
|
+
}
|
|
14256
14274
|
var program2 = new Command();
|
|
14257
|
-
program2.name("fractary-codex-mcp").description("MCP server for Fractary Codex knowledge management").version("0.3.
|
|
14275
|
+
program2.name("fractary-codex-mcp").description("MCP server for Fractary Codex knowledge management").version("0.3.6").option("--config <path>", "Path to config file", ".fractary/codex/config.yaml").action(async (options) => {
|
|
14258
14276
|
let config = {};
|
|
14259
14277
|
try {
|
|
14260
14278
|
const configFile = (0, import_fs.readFileSync)(options.config, "utf-8");
|
|
14261
14279
|
config = load(configFile);
|
|
14280
|
+
config = expandEnvVars(config);
|
|
14262
14281
|
} catch (error) {
|
|
14263
14282
|
if (options.config !== ".fractary/codex/config.yaml") {
|
|
14264
14283
|
console.error(`Warning: Could not load config file: ${options.config}`);
|
|
@@ -14269,9 +14288,12 @@ program2.name("fractary-codex-mcp").description("MCP server for Fractary Codex k
|
|
|
14269
14288
|
cacheDir: config.cache?.cacheDir || ".fractary/codex/cache",
|
|
14270
14289
|
...config.cache
|
|
14271
14290
|
});
|
|
14291
|
+
if (storage) {
|
|
14292
|
+
cache.setStorageManager(storage);
|
|
14293
|
+
}
|
|
14272
14294
|
const server = new McpServer({
|
|
14273
14295
|
name: "fractary-codex",
|
|
14274
|
-
version: "0.3.
|
|
14296
|
+
version: "0.3.6",
|
|
14275
14297
|
cache,
|
|
14276
14298
|
storage
|
|
14277
14299
|
});
|