@nirvana-labs/nirvana-mcp 1.91.0 → 1.91.2
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/code-tool-worker.d.mts.map +1 -1
- package/code-tool-worker.d.ts.map +1 -1
- package/code-tool-worker.js +3 -0
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +3 -0
- package/code-tool-worker.mjs.map +1 -1
- package/code-tool.d.mts.map +1 -1
- package/code-tool.d.ts.map +1 -1
- package/code-tool.js +2 -53
- package/code-tool.js.map +1 -1
- package/code-tool.mjs +3 -54
- package/code-tool.mjs.map +1 -1
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +1 -41
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +1 -41
- package/docs-search-tool.mjs.map +1 -1
- package/instructions.d.mts.map +1 -1
- package/instructions.d.ts.map +1 -1
- package/instructions.js +2 -18
- package/instructions.js.map +1 -1
- package/instructions.mjs +2 -18
- package/instructions.mjs.map +1 -1
- package/local-docs-search.d.mts.map +1 -1
- package/local-docs-search.d.ts.map +1 -1
- package/local-docs-search.js +437 -330
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +437 -330
- package/local-docs-search.mjs.map +1 -1
- package/methods.d.mts.map +1 -1
- package/methods.d.ts.map +1 -1
- package/methods.js +187 -169
- package/methods.js.map +1 -1
- package/methods.mjs +187 -169
- package/methods.mjs.map +1 -1
- package/options.d.mts +2 -2
- package/options.d.mts.map +1 -1
- package/options.d.ts +2 -2
- package/options.d.ts.map +1 -1
- package/options.js +6 -6
- package/options.js.map +1 -1
- package/options.mjs +6 -6
- package/options.mjs.map +1 -1
- package/package.json +2 -2
- package/server.js +2 -2
- package/server.js.map +1 -1
- package/server.mjs +2 -2
- package/server.mjs.map +1 -1
- package/src/code-tool-worker.ts +3 -0
- package/src/code-tool.ts +4 -83
- package/src/docs-search-tool.ts +2 -61
- package/src/instructions.ts +2 -28
- package/src/local-docs-search.ts +560 -435
- package/src/methods.ts +187 -169
- package/src/options.ts +9 -9
- package/src/server.ts +2 -2
package/instructions.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import fs from 'fs/promises';
|
|
3
3
|
import { getLogger } from "./logger.mjs";
|
|
4
|
-
import { readEnv } from "./util.mjs";
|
|
5
4
|
const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes
|
|
6
5
|
const instructionsCache = new Map();
|
|
7
6
|
export async function getInstructions({ stainlessApiKey, customInstructionsPath, }) {
|
|
@@ -22,7 +21,8 @@ export async function getInstructions({ stainlessApiKey, customInstructionsPath,
|
|
|
22
21
|
fetchedInstructions = await fetchLatestInstructionsFromFile(customInstructionsPath);
|
|
23
22
|
}
|
|
24
23
|
else {
|
|
25
|
-
fetchedInstructions =
|
|
24
|
+
fetchedInstructions =
|
|
25
|
+
'\n This is the nirvana labs MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
|
|
26
26
|
}
|
|
27
27
|
instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: now });
|
|
28
28
|
return fetchedInstructions;
|
|
@@ -36,20 +36,4 @@ async function fetchLatestInstructionsFromFile(path) {
|
|
|
36
36
|
throw error;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
async function fetchLatestInstructionsFromApi(stainlessApiKey) {
|
|
40
|
-
// Setting the stainless API key is optional, but may be required
|
|
41
|
-
// to authenticate requests to the Stainless API.
|
|
42
|
-
const response = await fetch(readEnv('CODE_MODE_INSTRUCTIONS_URL') ?? 'https://api.stainless.com/api/ai/instructions/nirvana', {
|
|
43
|
-
method: 'GET',
|
|
44
|
-
headers: { ...(stainlessApiKey && { Authorization: stainlessApiKey }) },
|
|
45
|
-
});
|
|
46
|
-
let instructions;
|
|
47
|
-
if (!response.ok) {
|
|
48
|
-
getLogger().warn('Warning: failed to retrieve MCP server instructions. Proceeding with default instructions...');
|
|
49
|
-
instructions =
|
|
50
|
-
'\n This is the nirvana MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
|
|
51
|
-
}
|
|
52
|
-
instructions ??= (await response.json()).instructions;
|
|
53
|
-
return instructions;
|
|
54
|
-
}
|
|
55
39
|
//# sourceMappingURL=instructions.mjs.map
|
package/instructions.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.mjs","sourceRoot":"","sources":["src/instructions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,qBAAiB;
|
|
1
|
+
{"version":3,"file":"instructions.mjs","sourceRoot":"","sources":["src/instructions.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,MAAM,aAAa,CA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I,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,SAAS,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,uCAAuC,CAAC,CAAC;QAC5E,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.mts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AA27HF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;
|
|
1
|
+
{"version":3,"file":"local-docs-search.d.ts","sourceRoot":"","sources":["src/local-docs-search.ts"],"names":[],"mappings":"AA+CA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CAC/C,CAAC;AA27HF;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,WAAW,CAAiC;IACpD,OAAO,CAAC,UAAU,CAAiC;IAEnD,OAAO;WAKM,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAY1E,MAAM,CAAC,KAAK,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,YAAY;IA2EhB,OAAO,CAAC,YAAY;YAiBN,iBAAiB;IA4C/B,OAAO,CAAC,UAAU;CAgBnB"}
|