@nirvana-labs/nirvana-mcp 1.63.1 → 1.64.0
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 +1 -0
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +1 -0
- package/code-tool-worker.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 +10 -11
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +10 -11
- package/docs-search-tool.mjs.map +1 -1
- package/http.d.mts.map +1 -1
- package/http.d.ts.map +1 -1
- package/http.js +15 -0
- package/http.js.map +1 -1
- package/http.mjs +15 -0
- package/http.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 +88 -16
- package/local-docs-search.js.map +1 -1
- package/local-docs-search.mjs +88 -16
- 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 +6 -0
- package/methods.js.map +1 -1
- package/methods.mjs +6 -0
- package/methods.mjs.map +1 -1
- package/package.json +2 -2
- package/server.d.mts +5 -0
- package/server.d.mts.map +1 -1
- package/server.d.ts +5 -0
- package/server.d.ts.map +1 -1
- package/server.js +3 -1
- package/server.js.map +1 -1
- package/server.mjs +3 -1
- package/server.mjs.map +1 -1
- package/src/code-tool-worker.ts +1 -0
- package/src/docs-search-tool.ts +10 -18
- package/src/http.ts +16 -0
- package/src/local-docs-search.ts +93 -16
- package/src/methods.ts +6 -0
- package/src/server.ts +5 -1
- package/src/types.ts +2 -0
- package/types.d.mts +5 -0
- package/types.d.mts.map +1 -1
- package/types.d.ts +5 -0
- package/types.d.ts.map +1 -1
- package/types.js.map +1 -1
- package/types.mjs.map +1 -1
package/src/local-docs-search.ts
CHANGED
|
@@ -5,6 +5,11 @@ import * as fs from 'node:fs/promises';
|
|
|
5
5
|
import * as path from 'node:path';
|
|
6
6
|
import { getLogger } from './logger';
|
|
7
7
|
|
|
8
|
+
type PerLanguageData = {
|
|
9
|
+
method?: string;
|
|
10
|
+
example?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
8
13
|
type MethodEntry = {
|
|
9
14
|
name: string;
|
|
10
15
|
endpoint: string;
|
|
@@ -16,6 +21,7 @@ type MethodEntry = {
|
|
|
16
21
|
params?: string[];
|
|
17
22
|
response?: string;
|
|
18
23
|
markdown?: string;
|
|
24
|
+
perLanguage?: Record<string, PerLanguageData>;
|
|
19
25
|
};
|
|
20
26
|
|
|
21
27
|
type ProseChunk = {
|
|
@@ -1344,11 +1350,17 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1344
1350
|
description: 'Update an NKS node pool',
|
|
1345
1351
|
stainlessPath: '(resource) nks.clusters.pools > (method) update',
|
|
1346
1352
|
qualified: 'client.nks.clusters.pools.update',
|
|
1347
|
-
params: [
|
|
1353
|
+
params: [
|
|
1354
|
+
'cluster_id: string;',
|
|
1355
|
+
'pool_id: string;',
|
|
1356
|
+
'name?: string;',
|
|
1357
|
+
'node_count?: number;',
|
|
1358
|
+
'tags?: string[];',
|
|
1359
|
+
],
|
|
1348
1360
|
response:
|
|
1349
|
-
"{ id: string;
|
|
1361
|
+
"{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
1350
1362
|
markdown:
|
|
1351
|
-
"## update\n\n`client.nks.clusters.pools.update(cluster_id: string, pool_id: string, name?: string, tags?: string[]): { id: string;
|
|
1363
|
+
"## update\n\n`client.nks.clusters.pools.update(cluster_id: string, pool_id: string, name?: string, node_count?: number, tags?: string[]): { id: string; created_at: string; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**patch** `/v1/nks/clusters/{cluster_id}/pools/{pool_id}`\n\nUpdate an NKS node pool\n\n### Parameters\n\n- `cluster_id: string`\n\n- `pool_id: string`\n\n- `name?: string`\n Name of the node pool.\n\n- `node_count?: number`\n Number of nodes.\n\n- `tags?: string[]`\n Tags to attach to the node pool.\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.nks.clusters.pools.update('pool_id', { cluster_id: 'cluster_id' });\n\nconsole.log(operation);\n```",
|
|
1352
1364
|
},
|
|
1353
1365
|
{
|
|
1354
1366
|
name: 'list',
|
|
@@ -1418,9 +1430,15 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1418
1430
|
description: 'Check if an NKS node pool can be updated',
|
|
1419
1431
|
stainlessPath: '(resource) nks.clusters.pools.availability > (method) update',
|
|
1420
1432
|
qualified: 'client.nks.clusters.pools.availability.update',
|
|
1421
|
-
params: [
|
|
1433
|
+
params: [
|
|
1434
|
+
'cluster_id: string;',
|
|
1435
|
+
'pool_id: string;',
|
|
1436
|
+
'name?: string;',
|
|
1437
|
+
'node_count?: number;',
|
|
1438
|
+
'tags?: string[];',
|
|
1439
|
+
],
|
|
1422
1440
|
markdown:
|
|
1423
|
-
"## update\n\n`client.nks.clusters.pools.availability.update(cluster_id: string, pool_id: string, name?: string, tags?: string[]): void`\n\n**patch** `/v1/nks/clusters/{cluster_id}/pools/{pool_id}/availability`\n\nCheck if an NKS node pool can be updated\n\n### Parameters\n\n- `cluster_id: string`\n\n- `pool_id: string`\n\n- `name?: string`\n Name of the node pool.\n\n- `tags?: string[]`\n Tags to attach to the node pool.\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nawait client.nks.clusters.pools.availability.update('pool_id', { cluster_id: 'cluster_id' })\n```",
|
|
1441
|
+
"## update\n\n`client.nks.clusters.pools.availability.update(cluster_id: string, pool_id: string, name?: string, node_count?: number, tags?: string[]): void`\n\n**patch** `/v1/nks/clusters/{cluster_id}/pools/{pool_id}/availability`\n\nCheck if an NKS node pool can be updated\n\n### Parameters\n\n- `cluster_id: string`\n\n- `pool_id: string`\n\n- `name?: string`\n Name of the node pool.\n\n- `node_count?: number`\n Number of nodes.\n\n- `tags?: string[]`\n Tags to attach to the node pool.\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nawait client.nks.clusters.pools.availability.update('pool_id', { cluster_id: 'cluster_id' })\n```",
|
|
1424
1442
|
},
|
|
1425
1443
|
{
|
|
1426
1444
|
name: 'list',
|
|
@@ -1436,6 +1454,20 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1436
1454
|
markdown:
|
|
1437
1455
|
"## list\n\n`client.nks.clusters.pools.nodes.list(cluster_id: string, pool_id: string, cursor?: string, limit?: number): { id: string; created_at: string; name: string; private_ip: string; status: resource_status; updated_at: string; }`\n\n**get** `/v1/nks/clusters/{cluster_id}/pools/{pool_id}/nodes`\n\nList all nodes in an NKS node pool\n\n### Parameters\n\n- `cluster_id: string`\n\n- `pool_id: string`\n\n- `cursor?: string`\n Pagination cursor returned by a previous request\n\n- `limit?: number`\n Maximum number of items to return\n\n### Returns\n\n- `{ id: string; created_at: string; name: string; private_ip: string; status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'; updated_at: string; }`\n NKS node details.\n\n - `id: string`\n - `created_at: string`\n - `name: string`\n - `private_ip: string`\n - `status: 'pending' | 'creating' | 'updating' | 'ready' | 'deleting' | 'deleted' | 'error'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\n// Automatically fetches more pages as needed.\nfor await (const nksNode of client.nks.clusters.pools.nodes.list('pool_id', { cluster_id: 'cluster_id' })) {\n console.log(nksNode);\n}\n```",
|
|
1438
1456
|
},
|
|
1457
|
+
{
|
|
1458
|
+
name: 'delete',
|
|
1459
|
+
endpoint: '/v1/nks/clusters/{cluster_id}/pools/{pool_id}/nodes/{node_id}',
|
|
1460
|
+
httpMethod: 'delete',
|
|
1461
|
+
summary: 'Delete NKS Node',
|
|
1462
|
+
description: 'Delete a single node from an NKS node pool',
|
|
1463
|
+
stainlessPath: '(resource) nks.clusters.pools.nodes > (method) delete',
|
|
1464
|
+
qualified: 'client.nks.clusters.pools.nodes.delete',
|
|
1465
|
+
params: ['cluster_id: string;', 'pool_id: string;', 'node_id: string;'],
|
|
1466
|
+
response:
|
|
1467
|
+
"{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }",
|
|
1468
|
+
markdown:
|
|
1469
|
+
"## delete\n\n`client.nks.clusters.pools.nodes.delete(cluster_id: string, pool_id: string, node_id: string): { id: string; created_at: string; kind: operation_kind; project_id: string; resource_id: string; status: operation_status; type: operation_type; updated_at: string; }`\n\n**delete** `/v1/nks/clusters/{cluster_id}/pools/{pool_id}/nodes/{node_id}`\n\nDelete a single node from an NKS node pool\n\n### Parameters\n\n- `cluster_id: string`\n\n- `pool_id: string`\n\n- `node_id: string`\n\n### Returns\n\n- `{ id: string; created_at: string; kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'; project_id: string; resource_id: string; status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'; type: 'create' | 'update' | 'delete' | 'restart'; updated_at: string; }`\n Operation details.\n\n - `id: string`\n - `created_at: string`\n - `kind: 'vm' | 'volume' | 'vpc' | 'firewall_rule' | 'nks_cluster' | 'nks_node_pool'`\n - `project_id: string`\n - `resource_id: string`\n - `status: 'pending' | 'running' | 'done' | 'failed' | 'unknown'`\n - `type: 'create' | 'update' | 'delete' | 'restart'`\n - `updated_at: string`\n\n### Example\n\n```typescript\nimport NirvanaLabs from '@nirvana-labs/nirvana';\n\nconst client = new NirvanaLabs();\n\nconst operation = await client.nks.clusters.pools.nodes.delete('node_id', { cluster_id: 'cluster_id', pool_id: 'pool_id' });\n\nconsole.log(operation);\n```",
|
|
1470
|
+
},
|
|
1439
1471
|
{
|
|
1440
1472
|
name: 'get',
|
|
1441
1473
|
endpoint: '/v1/nks/clusters/{cluster_id}/pools/{pool_id}/nodes/{node_id}',
|
|
@@ -1486,6 +1518,8 @@ const EMBEDDED_METHODS: MethodEntry[] = [
|
|
|
1486
1518
|
},
|
|
1487
1519
|
];
|
|
1488
1520
|
|
|
1521
|
+
const EMBEDDED_READMES: { language: string; content: string }[] = [];
|
|
1522
|
+
|
|
1489
1523
|
const INDEX_OPTIONS = {
|
|
1490
1524
|
fields: [
|
|
1491
1525
|
'name',
|
|
@@ -1500,13 +1534,15 @@ const INDEX_OPTIONS = {
|
|
|
1500
1534
|
storeFields: ['kind', '_original'],
|
|
1501
1535
|
searchOptions: {
|
|
1502
1536
|
prefix: true,
|
|
1503
|
-
fuzzy: 0.
|
|
1537
|
+
fuzzy: 0.1,
|
|
1504
1538
|
boost: {
|
|
1505
|
-
name:
|
|
1506
|
-
|
|
1539
|
+
name: 5,
|
|
1540
|
+
stainlessPath: 3,
|
|
1541
|
+
endpoint: 3,
|
|
1542
|
+
qualified: 3,
|
|
1507
1543
|
summary: 2,
|
|
1508
|
-
qualified: 2,
|
|
1509
1544
|
content: 1,
|
|
1545
|
+
description: 1,
|
|
1510
1546
|
} as Record<string, number>,
|
|
1511
1547
|
},
|
|
1512
1548
|
};
|
|
@@ -1528,14 +1564,15 @@ export class LocalDocsSearch {
|
|
|
1528
1564
|
static async create(opts?: { docsDir?: string }): Promise<LocalDocsSearch> {
|
|
1529
1565
|
const instance = new LocalDocsSearch();
|
|
1530
1566
|
instance.indexMethods(EMBEDDED_METHODS);
|
|
1567
|
+
for (const readme of EMBEDDED_READMES) {
|
|
1568
|
+
instance.indexProse(readme.content, `readme:${readme.language}`);
|
|
1569
|
+
}
|
|
1531
1570
|
if (opts?.docsDir) {
|
|
1532
1571
|
await instance.loadDocsDirectory(opts.docsDir);
|
|
1533
1572
|
}
|
|
1534
1573
|
return instance;
|
|
1535
1574
|
}
|
|
1536
1575
|
|
|
1537
|
-
// Note: Language is accepted for interface consistency with remote search, but currently has no
|
|
1538
|
-
// effect since this local search only supports TypeScript docs.
|
|
1539
1576
|
search(props: {
|
|
1540
1577
|
query: string;
|
|
1541
1578
|
language?: string;
|
|
@@ -1543,15 +1580,29 @@ export class LocalDocsSearch {
|
|
|
1543
1580
|
maxResults?: number;
|
|
1544
1581
|
maxLength?: number;
|
|
1545
1582
|
}): SearchResult {
|
|
1546
|
-
const { query, detail = 'default', maxResults = 5, maxLength = 100_000 } = props;
|
|
1583
|
+
const { query, language = 'typescript', detail = 'default', maxResults = 5, maxLength = 100_000 } = props;
|
|
1547
1584
|
|
|
1548
1585
|
const useMarkdown = detail === 'verbose' || detail === 'high';
|
|
1549
1586
|
|
|
1550
|
-
// Search both indices and merge results by score
|
|
1587
|
+
// Search both indices and merge results by score.
|
|
1588
|
+
// Filter prose hits so language-tagged content (READMEs and docs with
|
|
1589
|
+
// frontmatter) only matches the requested language.
|
|
1551
1590
|
const methodHits = this.methodIndex
|
|
1552
1591
|
.search(query)
|
|
1553
1592
|
.map((hit) => ({ ...hit, _kind: 'http_method' as const }));
|
|
1554
|
-
const proseHits = this.proseIndex
|
|
1593
|
+
const proseHits = this.proseIndex
|
|
1594
|
+
.search(query)
|
|
1595
|
+
.filter((hit) => {
|
|
1596
|
+
const source = ((hit as Record<string, unknown>)['_original'] as ProseChunk | undefined)?.source;
|
|
1597
|
+
if (!source) return true;
|
|
1598
|
+
// Check for language-tagged sources: "readme:<lang>" or "lang:<lang>:<filename>"
|
|
1599
|
+
let taggedLang: string | undefined;
|
|
1600
|
+
if (source.startsWith('readme:')) taggedLang = source.slice('readme:'.length);
|
|
1601
|
+
else if (source.startsWith('lang:')) taggedLang = source.split(':')[1];
|
|
1602
|
+
if (!taggedLang) return true;
|
|
1603
|
+
return taggedLang === language || (language === 'javascript' && taggedLang === 'typescript');
|
|
1604
|
+
})
|
|
1605
|
+
.map((hit) => ({ ...hit, _kind: 'prose' as const }));
|
|
1555
1606
|
const merged = [...methodHits, ...proseHits].sort((a, b) => b.score - a.score);
|
|
1556
1607
|
const top = merged.slice(0, maxResults);
|
|
1557
1608
|
|
|
@@ -1564,11 +1615,16 @@ export class LocalDocsSearch {
|
|
|
1564
1615
|
if (useMarkdown && m.markdown) {
|
|
1565
1616
|
fullResults.push(m.markdown);
|
|
1566
1617
|
} else {
|
|
1618
|
+
// Use per-language data when available, falling back to the
|
|
1619
|
+
// top-level fields (which are TypeScript-specific in the
|
|
1620
|
+
// legacy codepath).
|
|
1621
|
+
const langData = m.perLanguage?.[language];
|
|
1567
1622
|
fullResults.push({
|
|
1568
|
-
method: m.qualified,
|
|
1623
|
+
method: langData?.method ?? m.qualified,
|
|
1569
1624
|
summary: m.summary,
|
|
1570
1625
|
description: m.description,
|
|
1571
1626
|
endpoint: `${m.httpMethod.toUpperCase()} ${m.endpoint}`,
|
|
1627
|
+
...(langData?.example ? { example: langData.example } : {}),
|
|
1572
1628
|
...(m.params ? { params: m.params } : {}),
|
|
1573
1629
|
...(m.response ? { response: m.response } : {}),
|
|
1574
1630
|
});
|
|
@@ -1639,7 +1695,19 @@ export class LocalDocsSearch {
|
|
|
1639
1695
|
this.indexProse(texts.join('\n\n'), file.name);
|
|
1640
1696
|
}
|
|
1641
1697
|
} else {
|
|
1642
|
-
|
|
1698
|
+
// Parse optional YAML frontmatter for language tagging.
|
|
1699
|
+
// Files with a "language" field in frontmatter will only
|
|
1700
|
+
// surface in searches for that language.
|
|
1701
|
+
//
|
|
1702
|
+
// Example:
|
|
1703
|
+
// ---
|
|
1704
|
+
// language: python
|
|
1705
|
+
// ---
|
|
1706
|
+
// # Error handling in Python
|
|
1707
|
+
// ...
|
|
1708
|
+
const frontmatter = parseFrontmatter(content);
|
|
1709
|
+
const source = frontmatter.language ? `lang:${frontmatter.language}:${file.name}` : file.name;
|
|
1710
|
+
this.indexProse(content, source);
|
|
1643
1711
|
}
|
|
1644
1712
|
} catch (err) {
|
|
1645
1713
|
getLogger().warn({ err, file: file.name }, 'Failed to index docs file');
|
|
@@ -1717,3 +1785,12 @@ function extractTexts(data: unknown, depth = 0): string[] {
|
|
|
1717
1785
|
}
|
|
1718
1786
|
return [];
|
|
1719
1787
|
}
|
|
1788
|
+
|
|
1789
|
+
/** Parses YAML frontmatter from a markdown string, extracting the language field if present. */
|
|
1790
|
+
function parseFrontmatter(markdown: string): { language?: string } {
|
|
1791
|
+
const match = markdown.match(/^---\n([\s\S]*?)\n---/);
|
|
1792
|
+
if (!match) return {};
|
|
1793
|
+
const body = match[1] ?? '';
|
|
1794
|
+
const langMatch = body.match(/^language:\s*(.+)$/m);
|
|
1795
|
+
return langMatch ? { language: langMatch[1]!.trim() } : {};
|
|
1796
|
+
}
|
package/src/methods.ts
CHANGED
|
@@ -562,6 +562,12 @@ export const sdkMethods: SdkMethod[] = [
|
|
|
562
562
|
httpMethod: 'get',
|
|
563
563
|
httpPath: '/v1/nks/clusters/{cluster_id}/pools/{pool_id}/nodes',
|
|
564
564
|
},
|
|
565
|
+
{
|
|
566
|
+
clientCallName: 'client.nks.clusters.pools.nodes.delete',
|
|
567
|
+
fullyQualifiedName: 'nks.clusters.pools.nodes.delete',
|
|
568
|
+
httpMethod: 'delete',
|
|
569
|
+
httpPath: '/v1/nks/clusters/{cluster_id}/pools/{pool_id}/nodes/{node_id}',
|
|
570
|
+
},
|
|
565
571
|
{
|
|
566
572
|
clientCallName: 'client.nks.clusters.pools.nodes.get',
|
|
567
573
|
fullyQualifiedName: 'nks.clusters.pools.nodes.get',
|
package/src/server.ts
CHANGED
|
@@ -28,7 +28,7 @@ export const newMcpServer = async ({
|
|
|
28
28
|
new McpServer(
|
|
29
29
|
{
|
|
30
30
|
name: 'nirvana_labs_nirvana_api',
|
|
31
|
-
version: '1.
|
|
31
|
+
version: '1.64.0',
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
34
|
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
|
|
@@ -46,6 +46,8 @@ export async function initMcpServer(params: {
|
|
|
46
46
|
mcpOptions?: McpOptions;
|
|
47
47
|
stainlessApiKey?: string | undefined;
|
|
48
48
|
upstreamClientEnvs?: Record<string, string> | undefined;
|
|
49
|
+
mcpSessionId?: string | undefined;
|
|
50
|
+
mcpClientInfo?: { name: string; version: string } | undefined;
|
|
49
51
|
}) {
|
|
50
52
|
const server = params.server instanceof McpServer ? params.server.server : params.server;
|
|
51
53
|
|
|
@@ -134,6 +136,8 @@ export async function initMcpServer(params: {
|
|
|
134
136
|
client,
|
|
135
137
|
stainlessApiKey: params.stainlessApiKey ?? params.mcpOptions?.stainlessApiKey,
|
|
136
138
|
upstreamClientEnvs: params.upstreamClientEnvs,
|
|
139
|
+
mcpSessionId: params.mcpSessionId,
|
|
140
|
+
mcpClientInfo: params.mcpClientInfo,
|
|
137
141
|
},
|
|
138
142
|
args,
|
|
139
143
|
});
|
package/src/types.ts
CHANGED
|
@@ -46,6 +46,8 @@ export type McpRequestContext = {
|
|
|
46
46
|
client: NirvanaLabs;
|
|
47
47
|
stainlessApiKey?: string | undefined;
|
|
48
48
|
upstreamClientEnvs?: Record<string, string> | undefined;
|
|
49
|
+
mcpSessionId?: string | undefined;
|
|
50
|
+
mcpClientInfo?: { name: string; version: string } | undefined;
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
export type HandlerFunction = ({
|
package/types.d.mts
CHANGED
|
@@ -35,6 +35,11 @@ export type McpRequestContext = {
|
|
|
35
35
|
client: NirvanaLabs;
|
|
36
36
|
stainlessApiKey?: string | undefined;
|
|
37
37
|
upstreamClientEnvs?: Record<string, string> | undefined;
|
|
38
|
+
mcpSessionId?: string | undefined;
|
|
39
|
+
mcpClientInfo?: {
|
|
40
|
+
name: string;
|
|
41
|
+
version: string;
|
|
42
|
+
} | undefined;
|
|
38
43
|
};
|
|
39
44
|
export type HandlerFunction = ({ reqContext, args, }: {
|
|
40
45
|
reqContext: McpRequestContext;
|
package/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"OAEO,WAAW,MAAM,uBAAuB;OACxC,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,QAA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,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC"}
|
package/types.d.ts
CHANGED
|
@@ -35,6 +35,11 @@ export type McpRequestContext = {
|
|
|
35
35
|
client: NirvanaLabs;
|
|
36
36
|
stainlessApiKey?: string | undefined;
|
|
37
37
|
upstreamClientEnvs?: Record<string, string> | undefined;
|
|
38
|
+
mcpSessionId?: string | undefined;
|
|
39
|
+
mcpClientInfo?: {
|
|
40
|
+
name: string;
|
|
41
|
+
version: string;
|
|
42
|
+
} | undefined;
|
|
38
43
|
};
|
|
39
44
|
export type HandlerFunction = ({ reqContext, args, }: {
|
|
40
45
|
reqContext: McpRequestContext;
|
package/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"OAEO,WAAW,MAAM,uBAAuB;OACxC,EAAE,IAAI,EAAE,MAAM,oCAAoC;AAEzD,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK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,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC"}
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":";AAAA,sFAAsF;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":";AAAA,sFAAsF;;AA4DtF,kDASC;AAED,sDA2BC;AAED,sCAUC;AAlDD,SAAgB,mBAAmB,CAAC,MAAe;IACjD,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aACtC;SACF;KACF,CAAC;AACJ,CAAC;AAEM,KAAK,UAAU,qBAAqB,CAAC,QAAkB;IAC5D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;IAC3B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACtE,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAClC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7C,CAAC;IACJ,CAAC;SAAM,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,UAAU;oBAChB,QAAQ,EAAE;wBACR,uEAAuE;wBACvE,GAAG,EAAE,0BAA0B;wBAC/B,QAAQ;wBACR,IAAI,EAAE,IAAI;qBACX;iBACF;aACF;SACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAgB,aAAa,CAAC,OAAe;IAC3C,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,OAAO;aACd;SACF;QACD,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
package/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA,sFAAsF;
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAAA,sFAAsF;AA4DtF,MAAM,UAAU,mBAAmB,CAAC,MAAe;IACjD,OAAO;QACL,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;gBACZ,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;aACtC;SACF;KACF,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,QAAkB;IAC5D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;I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