Skip to content

Commit ff8b251

Browse files
committed
feat(mcp): Update extractBuiltinFunctions to support forceUpdate
1 parent 7eed099 commit ff8b251

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

mcp/docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function ensureDocs(
3737
if (shouldUpdate) {
3838
try {
3939
if (!isMcpMode) console.log(`Updating documentation for Zig version: ${zigVersion}`);
40-
const builtinFunctions = await extractBuiltinFunctions(zigVersion, isMcpMode);
40+
const builtinFunctions = await extractBuiltinFunctions(zigVersion, isMcpMode, true);
4141

4242
await downloadSourcesTar(zigVersion, isMcpMode, true);
4343

mcp/extract-builtin-functions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ export interface BuiltinFunction {
1212
async function extractBuiltinFunctions(
1313
zigVersion: string,
1414
isMcpMode = true,
15+
forceUpdate = false,
1516
): Promise<BuiltinFunction[]> {
1617
const paths = envPaths("zig-mcp", { suffix: "" });
1718
const versionCacheDir = path.join(paths.cache, zigVersion);
1819
const outputPath = path.join(versionCacheDir, "builtin-functions.json");
1920

20-
if (fs.existsSync(outputPath)) {
21+
if (fs.existsSync(outputPath) && !forceUpdate) {
2122
if (!isMcpMode) console.log(`Using cached builtin functions from ${outputPath}`);
2223
try {
2324
const content = fs.readFileSync(outputPath, "utf8");

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zig-mcp",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"type": "module",
55
"bin": {
66
"zig-mcp": "dist/mcp.js"

0 commit comments

Comments
 (0)