context.dev-mcp 1.0.1 → 1.2.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 +43 -2
- package/code-tool-worker.js.map +1 -1
- package/code-tool-worker.mjs +10 -2
- package/code-tool-worker.mjs.map +1 -1
- package/docs-search-tool.d.mts +2 -0
- package/docs-search-tool.d.mts.map +1 -1
- package/docs-search-tool.d.ts +2 -0
- package/docs-search-tool.d.ts.map +1 -1
- package/docs-search-tool.js +32 -2
- package/docs-search-tool.js.map +1 -1
- package/docs-search-tool.mjs +31 -2
- 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 +24 -1
- package/http.js.map +1 -1
- package/http.mjs +24 -1
- package/http.mjs.map +1 -1
- package/instructions.d.mts +4 -1
- package/instructions.d.mts.map +1 -1
- package/instructions.d.ts +4 -1
- package/instructions.d.ts.map +1 -1
- package/instructions.js +23 -4
- package/instructions.js.map +1 -1
- package/instructions.mjs +20 -4
- package/instructions.mjs.map +1 -1
- package/local-docs-search.d.mts +28 -0
- package/local-docs-search.d.mts.map +1 -0
- package/local-docs-search.d.ts +28 -0
- package/local-docs-search.d.ts.map +1 -0
- package/local-docs-search.js +940 -0
- package/local-docs-search.js.map +1 -0
- package/local-docs-search.mjs +900 -0
- package/local-docs-search.mjs.map +1 -0
- package/options.d.mts +3 -0
- package/options.d.mts.map +1 -1
- package/options.d.ts +3 -0
- package/options.d.ts.map +1 -1
- package/options.js +19 -0
- package/options.js.map +1 -1
- package/options.mjs +19 -0
- package/options.mjs.map +1 -1
- package/package.json +13 -2
- package/server.d.mts +9 -1
- package/server.d.mts.map +1 -1
- package/server.d.ts +9 -1
- package/server.d.ts.map +1 -1
- package/server.js +12 -3
- package/server.js.map +1 -1
- package/server.mjs +12 -3
- package/server.mjs.map +1 -1
- package/src/code-tool-worker.ts +10 -2
- package/src/docs-search-tool.ts +46 -8
- package/src/http.ts +27 -1
- package/src/instructions.ts +27 -4
- package/src/local-docs-search.ts +1096 -0
- package/src/options.ts +24 -0
- package/src/server.ts +21 -3
- package/src/stdio.ts +4 -1
- package/src/types.ts +2 -0
- package/stdio.d.mts.map +1 -1
- package/stdio.d.ts.map +1 -1
- package/stdio.js +4 -1
- package/stdio.js.map +1 -1
- package/stdio.mjs +4 -1
- package/stdio.mjs.map +1 -1
- 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/options.ts
CHANGED
|
@@ -18,10 +18,13 @@ export type McpOptions = {
|
|
|
18
18
|
includeCodeTool?: boolean | undefined;
|
|
19
19
|
includeDocsTools?: boolean | undefined;
|
|
20
20
|
stainlessApiKey?: string | undefined;
|
|
21
|
+
docsSearchMode?: 'stainless-api' | 'local' | undefined;
|
|
22
|
+
docsDir?: string | undefined;
|
|
21
23
|
codeAllowHttpGets?: boolean | undefined;
|
|
22
24
|
codeAllowedMethods?: string[] | undefined;
|
|
23
25
|
codeBlockedMethods?: string[] | undefined;
|
|
24
26
|
codeExecutionMode: McpCodeExecutionMode;
|
|
27
|
+
customInstructionsPath?: string | undefined;
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
export type McpCodeExecutionMode = 'stainless-sandbox' | 'local';
|
|
@@ -52,7 +55,23 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
52
55
|
description:
|
|
53
56
|
"Where to run code execution in code tool; 'stainless-sandbox' will execute code in Stainless-hosted sandboxes whereas 'local' will execute code locally on the MCP server machine.",
|
|
54
57
|
})
|
|
58
|
+
.option('custom-instructions-path', {
|
|
59
|
+
type: 'string',
|
|
60
|
+
description: 'Path to custom instructions for the MCP server',
|
|
61
|
+
})
|
|
55
62
|
.option('debug', { type: 'boolean', description: 'Enable debug logging' })
|
|
63
|
+
.option('docs-dir', {
|
|
64
|
+
type: 'string',
|
|
65
|
+
description:
|
|
66
|
+
'Path to a directory of local documentation files (markdown/JSON) to include in local docs search.',
|
|
67
|
+
})
|
|
68
|
+
.option('docs-search-mode', {
|
|
69
|
+
type: 'string',
|
|
70
|
+
choices: ['stainless-api', 'local'],
|
|
71
|
+
default: 'stainless-api',
|
|
72
|
+
description:
|
|
73
|
+
"Where to search documentation; 'stainless-api' uses the Stainless-hosted search API whereas 'local' uses an in-memory search index built from embedded SDK method data and optional local docs files.",
|
|
74
|
+
})
|
|
56
75
|
.option('log-format', {
|
|
57
76
|
type: 'string',
|
|
58
77
|
choices: ['json', 'pretty'],
|
|
@@ -113,10 +132,13 @@ export function parseCLIOptions(): CLIOptions {
|
|
|
113
132
|
...(includeDocsTools !== undefined && { includeDocsTools }),
|
|
114
133
|
debug: !!argv.debug,
|
|
115
134
|
stainlessApiKey: argv.stainlessApiKey,
|
|
135
|
+
docsSearchMode: argv.docsSearchMode as 'stainless-api' | 'local' | undefined,
|
|
136
|
+
docsDir: argv.docsDir,
|
|
116
137
|
codeAllowHttpGets: argv.codeAllowHttpGets,
|
|
117
138
|
codeAllowedMethods: argv.codeAllowedMethods,
|
|
118
139
|
codeBlockedMethods: argv.codeBlockedMethods,
|
|
119
140
|
codeExecutionMode: argv.codeExecutionMode as McpCodeExecutionMode,
|
|
141
|
+
customInstructionsPath: argv.customInstructionsPath,
|
|
120
142
|
transport,
|
|
121
143
|
logFormat,
|
|
122
144
|
port: argv.port,
|
|
@@ -157,5 +179,7 @@ export function parseQueryOptions(defaultOptions: McpOptions, query: unknown): M
|
|
|
157
179
|
...(codeTool !== undefined && { includeCodeTool: codeTool }),
|
|
158
180
|
...(docsTools !== undefined && { includeDocsTools: docsTools }),
|
|
159
181
|
codeExecutionMode: defaultOptions.codeExecutionMode,
|
|
182
|
+
docsSearchMode: defaultOptions.docsSearchMode,
|
|
183
|
+
docsDir: defaultOptions.docsDir,
|
|
160
184
|
};
|
|
161
185
|
}
|
package/src/server.ts
CHANGED
|
@@ -11,19 +11,27 @@ import { ClientOptions } from 'context.dev';
|
|
|
11
11
|
import ContextDev from 'context.dev';
|
|
12
12
|
import { codeTool } from './code-tool';
|
|
13
13
|
import docsSearchTool from './docs-search-tool';
|
|
14
|
+
import { setLocalSearch } from './docs-search-tool';
|
|
15
|
+
import { LocalDocsSearch } from './local-docs-search';
|
|
14
16
|
import { getInstructions } from './instructions';
|
|
15
17
|
import { McpOptions } from './options';
|
|
16
18
|
import { blockedMethodsForCodeTool } from './methods';
|
|
17
19
|
import { HandlerFunction, McpRequestContext, ToolCallResult, McpTool } from './types';
|
|
18
20
|
|
|
19
|
-
export const newMcpServer = async (
|
|
21
|
+
export const newMcpServer = async ({
|
|
22
|
+
stainlessApiKey,
|
|
23
|
+
customInstructionsPath,
|
|
24
|
+
}: {
|
|
25
|
+
stainlessApiKey?: string | undefined;
|
|
26
|
+
customInstructionsPath?: string | undefined;
|
|
27
|
+
}) =>
|
|
20
28
|
new McpServer(
|
|
21
29
|
{
|
|
22
30
|
name: 'context_dev_api',
|
|
23
|
-
version: '1.0
|
|
31
|
+
version: '1.2.0',
|
|
24
32
|
},
|
|
25
33
|
{
|
|
26
|
-
instructions: await getInstructions(stainlessApiKey),
|
|
34
|
+
instructions: await getInstructions({ stainlessApiKey, customInstructionsPath }),
|
|
27
35
|
capabilities: { tools: {}, logging: {} },
|
|
28
36
|
},
|
|
29
37
|
);
|
|
@@ -38,6 +46,8 @@ export async function initMcpServer(params: {
|
|
|
38
46
|
mcpOptions?: McpOptions;
|
|
39
47
|
stainlessApiKey?: string | undefined;
|
|
40
48
|
upstreamClientEnvs?: Record<string, string> | undefined;
|
|
49
|
+
mcpSessionId?: string | undefined;
|
|
50
|
+
mcpClientInfo?: { name: string; version: string } | undefined;
|
|
41
51
|
}) {
|
|
42
52
|
const server = params.server instanceof McpServer ? params.server.server : params.server;
|
|
43
53
|
|
|
@@ -56,6 +66,12 @@ export async function initMcpServer(params: {
|
|
|
56
66
|
error: logAtLevel('error'),
|
|
57
67
|
};
|
|
58
68
|
|
|
69
|
+
if (params.mcpOptions?.docsSearchMode === 'local') {
|
|
70
|
+
const docsDir = params.mcpOptions?.docsDir;
|
|
71
|
+
const localSearch = await LocalDocsSearch.create(docsDir ? { docsDir } : undefined);
|
|
72
|
+
setLocalSearch(localSearch);
|
|
73
|
+
}
|
|
74
|
+
|
|
59
75
|
let _client: ContextDev | undefined;
|
|
60
76
|
let _clientError: Error | undefined;
|
|
61
77
|
let _logLevel: 'debug' | 'info' | 'warn' | 'error' | 'off' | undefined;
|
|
@@ -120,6 +136,8 @@ export async function initMcpServer(params: {
|
|
|
120
136
|
client,
|
|
121
137
|
stainlessApiKey: params.stainlessApiKey ?? params.mcpOptions?.stainlessApiKey,
|
|
122
138
|
upstreamClientEnvs: params.upstreamClientEnvs,
|
|
139
|
+
mcpSessionId: params.mcpSessionId,
|
|
140
|
+
mcpClientInfo: params.mcpClientInfo,
|
|
123
141
|
},
|
|
124
142
|
args,
|
|
125
143
|
});
|
package/src/stdio.ts
CHANGED
|
@@ -4,7 +4,10 @@ import { initMcpServer, newMcpServer } from './server';
|
|
|
4
4
|
import { getLogger } from './logger';
|
|
5
5
|
|
|
6
6
|
export const launchStdioServer = async (mcpOptions: McpOptions) => {
|
|
7
|
-
const server = await newMcpServer(
|
|
7
|
+
const server = await newMcpServer({
|
|
8
|
+
stainlessApiKey: mcpOptions.stainlessApiKey,
|
|
9
|
+
customInstructionsPath: mcpOptions.customInstructionsPath,
|
|
10
|
+
});
|
|
8
11
|
|
|
9
12
|
await initMcpServer({ server, mcpOptions, stainlessApiKey: mcpOptions.stainlessApiKey });
|
|
10
13
|
|
package/src/types.ts
CHANGED
|
@@ -46,6 +46,8 @@ export type McpRequestContext = {
|
|
|
46
46
|
client: ContextDev;
|
|
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/stdio.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.d.mts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAIrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,
|
|
1
|
+
{"version":3,"file":"stdio.d.mts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAIrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,kBAW7D,CAAC"}
|
package/stdio.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAIrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,
|
|
1
|
+
{"version":3,"file":"stdio.d.ts","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OACO,EAAE,UAAU,EAAE;AAIrB,eAAO,MAAM,iBAAiB,GAAU,YAAY,UAAU,kBAW7D,CAAC"}
|
package/stdio.js
CHANGED
|
@@ -5,7 +5,10 @@ const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
|
5
5
|
const server_1 = require("./server.js");
|
|
6
6
|
const logger_1 = require("./logger.js");
|
|
7
7
|
const launchStdioServer = async (mcpOptions) => {
|
|
8
|
-
const server = await (0, server_1.newMcpServer)(
|
|
8
|
+
const server = await (0, server_1.newMcpServer)({
|
|
9
|
+
stainlessApiKey: mcpOptions.stainlessApiKey,
|
|
10
|
+
customInstructionsPath: mcpOptions.customInstructionsPath,
|
|
11
|
+
});
|
|
9
12
|
await (0, server_1.initMcpServer)({ server, mcpOptions, stainlessApiKey: mcpOptions.stainlessApiKey });
|
|
10
13
|
const transport = new stdio_js_1.StdioServerTransport();
|
|
11
14
|
await server.connect(transport);
|
package/stdio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":";;;AAAA,wEAAiF;AAEjF,wCAAuD;AACvD,wCAAqC;AAE9B,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,EAAC,UAAU,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"stdio.js","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":";;;AAAA,wEAAiF;AAEjF,wCAAuD;AACvD,wCAAqC;AAE9B,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,IAAA,qBAAY,EAAC;QAChC,eAAe,EAAE,UAAU,CAAC,eAAe;QAC3C,sBAAsB,EAAE,UAAU,CAAC,sBAAsB;KAC1D,CAAC,CAAC;IAEH,MAAM,IAAA,sBAAa,EAAC,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;IAEzF,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,IAAA,kBAAS,GAAE,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAClD,CAAC,CAAC;AAXW,QAAA,iBAAiB,qBAW5B"}
|
package/stdio.mjs
CHANGED
|
@@ -2,7 +2,10 @@ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
|
|
|
2
2
|
import { initMcpServer, newMcpServer } from "./server.mjs";
|
|
3
3
|
import { getLogger } from "./logger.mjs";
|
|
4
4
|
export const launchStdioServer = async (mcpOptions) => {
|
|
5
|
-
const server = await newMcpServer(
|
|
5
|
+
const server = await newMcpServer({
|
|
6
|
+
stainlessApiKey: mcpOptions.stainlessApiKey,
|
|
7
|
+
customInstructionsPath: mcpOptions.customInstructionsPath,
|
|
8
|
+
});
|
|
6
9
|
await initMcpServer({ server, mcpOptions, stainlessApiKey: mcpOptions.stainlessApiKey });
|
|
7
10
|
const transport = new StdioServerTransport();
|
|
8
11
|
await server.connect(transport);
|
package/stdio.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio.mjs","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C;OAEzE,EAAE,aAAa,EAAE,YAAY,EAAE;OAC/B,EAAE,SAAS,EAAE;AAEpB,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"stdio.mjs","sourceRoot":"","sources":["src/stdio.ts"],"names":[],"mappings":"OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C;OAEzE,EAAE,aAAa,EAAE,YAAY,EAAE;OAC/B,EAAE,SAAS,EAAE;AAEpB,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,EAAE,UAAsB,EAAE,EAAE;IAChE,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC;QAChC,eAAe,EAAE,UAAU,CAAC,eAAe;QAC3C,sBAAsB,EAAE,UAAU,CAAC,sBAAsB;KAC1D,CAAC,CAAC;IAEH,MAAM,aAAa,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,CAAC;IAEzF,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;AAClD,CAAC,CAAC"}
|
package/types.d.mts
CHANGED
|
@@ -35,6 +35,11 @@ export type McpRequestContext = {
|
|
|
35
35
|
client: ContextDev;
|
|
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,UAAU,MAAM,aAAa;OAC7B,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,QAAQ,EACJ;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAA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F,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: ContextDev;
|
|
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,UAAU,MAAM,aAAa;OAC7B,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,QAAQ,EACJ;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QA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AClB,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;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,OA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