@posthog/wizard 1.19.0 → 1.21.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/dist/src/lib/agent-interface.d.ts +36 -1
- package/dist/src/lib/agent-interface.js +119 -4
- package/dist/src/lib/agent-interface.js.map +1 -1
- package/dist/src/lib/agent-runner.d.ts +7 -0
- package/dist/src/lib/agent-runner.js +201 -0
- package/dist/src/lib/agent-runner.js.map +1 -0
- package/dist/src/lib/constants.d.ts +1 -0
- package/dist/src/lib/constants.js +2 -1
- package/dist/src/lib/constants.js.map +1 -1
- package/dist/src/lib/framework-config.d.ts +95 -0
- package/dist/src/lib/framework-config.js +3 -0
- package/dist/src/lib/framework-config.js.map +1 -0
- package/dist/src/nextjs/nextjs-wizard-agent.d.ts +1 -1
- package/dist/src/nextjs/nextjs-wizard-agent.js +69 -133
- package/dist/src/nextjs/nextjs-wizard-agent.js.map +1 -1
- package/dist/src/steps/add-mcp-server-to-clients/MCPClient.d.ts +2 -7
- package/dist/src/steps/add-mcp-server-to-clients/MCPClient.js.map +1 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude-code.d.ts +33 -7
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude-code.js +2 -47
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude-code.js.map +1 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/claude.d.ts +33 -6
- package/dist/src/steps/add-mcp-server-to-clients/clients/codex.d.ts +33 -6
- package/dist/src/steps/add-mcp-server-to-clients/clients/cursor.d.ts +35 -7
- package/dist/src/steps/add-mcp-server-to-clients/clients/cursor.js +4 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/cursor.js.map +1 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/visual-studio-code.d.ts +47 -7
- package/dist/src/steps/add-mcp-server-to-clients/clients/visual-studio-code.js +25 -5
- package/dist/src/steps/add-mcp-server-to-clients/clients/visual-studio-code.js.map +1 -1
- package/dist/src/steps/add-mcp-server-to-clients/clients/zed.d.ts +47 -16
- package/dist/src/steps/add-mcp-server-to-clients/clients/zed.js +22 -11
- package/dist/src/steps/add-mcp-server-to-clients/clients/zed.js.map +1 -1
- package/dist/src/steps/add-mcp-server-to-clients/defaults.d.ts +40 -6
- package/dist/src/steps/add-mcp-server-to-clients/defaults.js +29 -8
- package/dist/src/steps/add-mcp-server-to-clients/defaults.js.map +1 -1
- package/dist/src/utils/__tests__/analytics.test.js +11 -10
- package/dist/src/utils/__tests__/analytics.test.js.map +1 -1
- package/dist/src/utils/analytics.js +1 -1
- package/dist/src/utils/analytics.js.map +1 -1
- package/dist/src/utils/oauth.js +42 -4
- package/dist/src/utils/oauth.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@ import { DefaultMCPClient } from '../MCPClient';
|
|
|
2
2
|
import { DefaultMCPClientConfig } from '../defaults';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export declare const ClaudeMCPConfig: z.ZodObject<{
|
|
5
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
6
6
|
command: z.ZodOptional<z.ZodString>;
|
|
7
7
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
8
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -14,9 +14,18 @@ export declare const ClaudeMCPConfig: z.ZodObject<{
|
|
|
14
14
|
command?: string | undefined;
|
|
15
15
|
args?: string[] | undefined;
|
|
16
16
|
env?: Record<string, string> | undefined;
|
|
17
|
-
}
|
|
17
|
+
}>, z.ZodObject<{
|
|
18
|
+
url: z.ZodString;
|
|
19
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
url: string;
|
|
22
|
+
headers?: Record<string, string> | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
url: string;
|
|
25
|
+
headers?: Record<string, string> | undefined;
|
|
26
|
+
}>]>>;
|
|
18
27
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
19
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
28
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
20
29
|
command: z.ZodOptional<z.ZodString>;
|
|
21
30
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
22
31
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -28,9 +37,18 @@ export declare const ClaudeMCPConfig: z.ZodObject<{
|
|
|
28
37
|
command?: string | undefined;
|
|
29
38
|
args?: string[] | undefined;
|
|
30
39
|
env?: Record<string, string> | undefined;
|
|
31
|
-
}
|
|
40
|
+
}>, z.ZodObject<{
|
|
41
|
+
url: z.ZodString;
|
|
42
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
url: string;
|
|
45
|
+
headers?: Record<string, string> | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
url: string;
|
|
48
|
+
headers?: Record<string, string> | undefined;
|
|
49
|
+
}>]>>;
|
|
32
50
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
33
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
51
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
34
52
|
command: z.ZodOptional<z.ZodString>;
|
|
35
53
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
36
54
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -42,7 +60,16 @@ export declare const ClaudeMCPConfig: z.ZodObject<{
|
|
|
42
60
|
command?: string | undefined;
|
|
43
61
|
args?: string[] | undefined;
|
|
44
62
|
env?: Record<string, string> | undefined;
|
|
45
|
-
}
|
|
63
|
+
}>, z.ZodObject<{
|
|
64
|
+
url: z.ZodString;
|
|
65
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
url: string;
|
|
68
|
+
headers?: Record<string, string> | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
url: string;
|
|
71
|
+
headers?: Record<string, string> | undefined;
|
|
72
|
+
}>]>>;
|
|
46
73
|
}, z.ZodTypeAny, "passthrough">>;
|
|
47
74
|
export type ClaudeMCPConfig = z.infer<typeof DefaultMCPClientConfig>;
|
|
48
75
|
export declare class ClaudeMCPClient extends DefaultMCPClient {
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
import { DefaultMCPClient } from '../MCPClient';
|
|
3
3
|
import { DefaultMCPClientConfig } from '../defaults';
|
|
4
4
|
export declare const CodexMCPConfig: z.ZodObject<{
|
|
5
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
6
6
|
command: z.ZodOptional<z.ZodString>;
|
|
7
7
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
8
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -14,9 +14,18 @@ export declare const CodexMCPConfig: z.ZodObject<{
|
|
|
14
14
|
command?: string | undefined;
|
|
15
15
|
args?: string[] | undefined;
|
|
16
16
|
env?: Record<string, string> | undefined;
|
|
17
|
-
}
|
|
17
|
+
}>, z.ZodObject<{
|
|
18
|
+
url: z.ZodString;
|
|
19
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
url: string;
|
|
22
|
+
headers?: Record<string, string> | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
url: string;
|
|
25
|
+
headers?: Record<string, string> | undefined;
|
|
26
|
+
}>]>>;
|
|
18
27
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
19
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
28
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
20
29
|
command: z.ZodOptional<z.ZodString>;
|
|
21
30
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
22
31
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -28,9 +37,18 @@ export declare const CodexMCPConfig: z.ZodObject<{
|
|
|
28
37
|
command?: string | undefined;
|
|
29
38
|
args?: string[] | undefined;
|
|
30
39
|
env?: Record<string, string> | undefined;
|
|
31
|
-
}
|
|
40
|
+
}>, z.ZodObject<{
|
|
41
|
+
url: z.ZodString;
|
|
42
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
url: string;
|
|
45
|
+
headers?: Record<string, string> | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
url: string;
|
|
48
|
+
headers?: Record<string, string> | undefined;
|
|
49
|
+
}>]>>;
|
|
32
50
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
33
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
51
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
34
52
|
command: z.ZodOptional<z.ZodString>;
|
|
35
53
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
36
54
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -42,7 +60,16 @@ export declare const CodexMCPConfig: z.ZodObject<{
|
|
|
42
60
|
command?: string | undefined;
|
|
43
61
|
args?: string[] | undefined;
|
|
44
62
|
env?: Record<string, string> | undefined;
|
|
45
|
-
}
|
|
63
|
+
}>, z.ZodObject<{
|
|
64
|
+
url: z.ZodString;
|
|
65
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
url: string;
|
|
68
|
+
headers?: Record<string, string> | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
url: string;
|
|
71
|
+
headers?: Record<string, string> | undefined;
|
|
72
|
+
}>]>>;
|
|
46
73
|
}, z.ZodTypeAny, "passthrough">>;
|
|
47
74
|
export type CodexMCPConfig = z.infer<typeof DefaultMCPClientConfig>;
|
|
48
75
|
export declare class CodexMCPClient extends DefaultMCPClient {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DefaultMCPClient } from '../MCPClient';
|
|
1
|
+
import { DefaultMCPClient, MCPServerConfig } from '../MCPClient';
|
|
2
2
|
import { DefaultMCPClientConfig } from '../defaults';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export declare const CursorMCPConfig: z.ZodObject<{
|
|
5
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
5
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
6
6
|
command: z.ZodOptional<z.ZodString>;
|
|
7
7
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
8
8
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -14,9 +14,18 @@ export declare const CursorMCPConfig: z.ZodObject<{
|
|
|
14
14
|
command?: string | undefined;
|
|
15
15
|
args?: string[] | undefined;
|
|
16
16
|
env?: Record<string, string> | undefined;
|
|
17
|
-
}
|
|
17
|
+
}>, z.ZodObject<{
|
|
18
|
+
url: z.ZodString;
|
|
19
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
url: string;
|
|
22
|
+
headers?: Record<string, string> | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
url: string;
|
|
25
|
+
headers?: Record<string, string> | undefined;
|
|
26
|
+
}>]>>;
|
|
18
27
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
19
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
28
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
20
29
|
command: z.ZodOptional<z.ZodString>;
|
|
21
30
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
22
31
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -28,9 +37,18 @@ export declare const CursorMCPConfig: z.ZodObject<{
|
|
|
28
37
|
command?: string | undefined;
|
|
29
38
|
args?: string[] | undefined;
|
|
30
39
|
env?: Record<string, string> | undefined;
|
|
31
|
-
}
|
|
40
|
+
}>, z.ZodObject<{
|
|
41
|
+
url: z.ZodString;
|
|
42
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
url: string;
|
|
45
|
+
headers?: Record<string, string> | undefined;
|
|
46
|
+
}, {
|
|
47
|
+
url: string;
|
|
48
|
+
headers?: Record<string, string> | undefined;
|
|
49
|
+
}>]>>;
|
|
32
50
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
33
|
-
mcpServers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
51
|
+
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
34
52
|
command: z.ZodOptional<z.ZodString>;
|
|
35
53
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
36
54
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -42,7 +60,16 @@ export declare const CursorMCPConfig: z.ZodObject<{
|
|
|
42
60
|
command?: string | undefined;
|
|
43
61
|
args?: string[] | undefined;
|
|
44
62
|
env?: Record<string, string> | undefined;
|
|
45
|
-
}
|
|
63
|
+
}>, z.ZodObject<{
|
|
64
|
+
url: z.ZodString;
|
|
65
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
url: string;
|
|
68
|
+
headers?: Record<string, string> | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
url: string;
|
|
71
|
+
headers?: Record<string, string> | undefined;
|
|
72
|
+
}>]>>;
|
|
46
73
|
}, z.ZodTypeAny, "passthrough">>;
|
|
47
74
|
export type CursorMCPConfig = z.infer<typeof DefaultMCPClientConfig>;
|
|
48
75
|
export declare class CursorMCPClient extends DefaultMCPClient {
|
|
@@ -50,6 +77,7 @@ export declare class CursorMCPClient extends DefaultMCPClient {
|
|
|
50
77
|
constructor();
|
|
51
78
|
isClientSupported(): Promise<boolean>;
|
|
52
79
|
getConfigPath(): Promise<string>;
|
|
80
|
+
getServerConfig(apiKey: string, type: 'sse' | 'streamable-http', selectedFeatures?: string[], local?: boolean): MCPServerConfig;
|
|
53
81
|
addServer(apiKey: string, selectedFeatures?: string[], local?: boolean): Promise<{
|
|
54
82
|
success: boolean;
|
|
55
83
|
}>;
|
|
@@ -50,8 +50,11 @@ class CursorMCPClient extends MCPClient_1.DefaultMCPClient {
|
|
|
50
50
|
async getConfigPath() {
|
|
51
51
|
return Promise.resolve(path.join(os.homedir(), '.cursor', 'mcp.json'));
|
|
52
52
|
}
|
|
53
|
+
getServerConfig(apiKey, type, selectedFeatures, local) {
|
|
54
|
+
return (0, defaults_1.getNativeHTTPServerConfig)(apiKey, type, selectedFeatures, local);
|
|
55
|
+
}
|
|
53
56
|
async addServer(apiKey, selectedFeatures, local) {
|
|
54
|
-
return this._addServerType(apiKey, '
|
|
57
|
+
return this._addServerType(apiKey, 'streamable-http', selectedFeatures, local);
|
|
55
58
|
}
|
|
56
59
|
}
|
|
57
60
|
exports.CursorMCPClient = CursorMCPClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../../src/steps/add-mcp-server-to-clients/clients/cursor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../../../src/steps/add-mcp-server-to-clients/clients/cursor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAAiE;AACjE,2CAA6B;AAC7B,uCAAyB;AACzB,0CAAgF;AAGnE,QAAA,eAAe,GAAG,iCAAsB,CAAC;AAItD,MAAa,eAAgB,SAAQ,4BAAgB;IACnD,IAAI,GAAG,QAAQ,CAAC;IAEhB;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,OAAO,OAAO,CAAC,OAAO,CACpB,OAAO,CAAC,QAAQ,KAAK,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,CAC9D,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,eAAe,CACb,MAAc,EACd,IAA+B,EAC/B,gBAA2B,EAC3B,KAAe;QAEf,OAAO,IAAA,oCAAyB,EAAC,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;IAED,KAAK,CAAC,SAAS,CACb,MAAc,EACd,gBAA2B,EAC3B,KAAe;QAEf,OAAO,IAAI,CAAC,cAAc,CACxB,MAAM,EACN,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,CACN,CAAC;IACJ,CAAC;CACF;AAtCD,0CAsCC","sourcesContent":["import { DefaultMCPClient, MCPServerConfig } from '../MCPClient';\nimport * as path from 'path';\nimport * as os from 'os';\nimport { DefaultMCPClientConfig, getNativeHTTPServerConfig } from '../defaults';\nimport { z } from 'zod';\n\nexport const CursorMCPConfig = DefaultMCPClientConfig;\n\nexport type CursorMCPConfig = z.infer<typeof DefaultMCPClientConfig>;\n\nexport class CursorMCPClient extends DefaultMCPClient {\n name = 'Cursor';\n\n constructor() {\n super();\n }\n\n async isClientSupported(): Promise<boolean> {\n return Promise.resolve(\n process.platform === 'darwin' || process.platform === 'win32',\n );\n }\n\n async getConfigPath(): Promise<string> {\n return Promise.resolve(path.join(os.homedir(), '.cursor', 'mcp.json'));\n }\n\n getServerConfig(\n apiKey: string,\n type: 'sse' | 'streamable-http',\n selectedFeatures?: string[],\n local?: boolean,\n ): MCPServerConfig {\n return getNativeHTTPServerConfig(apiKey, type, selectedFeatures, local);\n }\n\n async addServer(\n apiKey: string,\n selectedFeatures?: string[],\n local?: boolean,\n ): Promise<{ success: boolean }> {\n return this._addServerType(\n apiKey,\n 'streamable-http',\n selectedFeatures,\n local,\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { DefaultMCPClient } from '../MCPClient';
|
|
2
|
+
import { DefaultMCPClient, MCPServerConfig } from '../MCPClient';
|
|
3
3
|
export declare const VisualStudioCodeMCPConfig: z.ZodObject<{
|
|
4
|
-
servers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4
|
+
servers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
5
5
|
command: z.ZodOptional<z.ZodString>;
|
|
6
6
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
7
7
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -13,9 +13,21 @@ export declare const VisualStudioCodeMCPConfig: z.ZodObject<{
|
|
|
13
13
|
command?: string | undefined;
|
|
14
14
|
args?: string[] | undefined;
|
|
15
15
|
env?: Record<string, string> | undefined;
|
|
16
|
-
}
|
|
16
|
+
}>, z.ZodObject<{
|
|
17
|
+
type: z.ZodEnum<["http", "sse"]>;
|
|
18
|
+
url: z.ZodString;
|
|
19
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
type: "http" | "sse";
|
|
22
|
+
url: string;
|
|
23
|
+
headers?: Record<string, string> | undefined;
|
|
24
|
+
}, {
|
|
25
|
+
type: "http" | "sse";
|
|
26
|
+
url: string;
|
|
27
|
+
headers?: Record<string, string> | undefined;
|
|
28
|
+
}>]>>;
|
|
17
29
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
18
|
-
servers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
30
|
+
servers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
19
31
|
command: z.ZodOptional<z.ZodString>;
|
|
20
32
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
21
33
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -27,9 +39,21 @@ export declare const VisualStudioCodeMCPConfig: z.ZodObject<{
|
|
|
27
39
|
command?: string | undefined;
|
|
28
40
|
args?: string[] | undefined;
|
|
29
41
|
env?: Record<string, string> | undefined;
|
|
30
|
-
}
|
|
42
|
+
}>, z.ZodObject<{
|
|
43
|
+
type: z.ZodEnum<["http", "sse"]>;
|
|
44
|
+
url: z.ZodString;
|
|
45
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
type: "http" | "sse";
|
|
48
|
+
url: string;
|
|
49
|
+
headers?: Record<string, string> | undefined;
|
|
50
|
+
}, {
|
|
51
|
+
type: "http" | "sse";
|
|
52
|
+
url: string;
|
|
53
|
+
headers?: Record<string, string> | undefined;
|
|
54
|
+
}>]>>;
|
|
31
55
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
32
|
-
servers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
56
|
+
servers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
33
57
|
command: z.ZodOptional<z.ZodString>;
|
|
34
58
|
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
35
59
|
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -41,7 +65,19 @@ export declare const VisualStudioCodeMCPConfig: z.ZodObject<{
|
|
|
41
65
|
command?: string | undefined;
|
|
42
66
|
args?: string[] | undefined;
|
|
43
67
|
env?: Record<string, string> | undefined;
|
|
44
|
-
}
|
|
68
|
+
}>, z.ZodObject<{
|
|
69
|
+
type: z.ZodEnum<["http", "sse"]>;
|
|
70
|
+
url: z.ZodString;
|
|
71
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
type: "http" | "sse";
|
|
74
|
+
url: string;
|
|
75
|
+
headers?: Record<string, string> | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
type: "http" | "sse";
|
|
78
|
+
url: string;
|
|
79
|
+
headers?: Record<string, string> | undefined;
|
|
80
|
+
}>]>>;
|
|
45
81
|
}, z.ZodTypeAny, "passthrough">>;
|
|
46
82
|
export type VisualStudioCodeMCPConfig = z.infer<typeof VisualStudioCodeMCPConfig>;
|
|
47
83
|
export declare class VisualStudioCodeClient extends DefaultMCPClient {
|
|
@@ -49,4 +85,8 @@ export declare class VisualStudioCodeClient extends DefaultMCPClient {
|
|
|
49
85
|
getServerPropertyName(): string;
|
|
50
86
|
isClientSupported(): Promise<boolean>;
|
|
51
87
|
getConfigPath(): Promise<string>;
|
|
88
|
+
getServerConfig(apiKey: string, type: 'sse' | 'streamable-http', selectedFeatures?: string[], local?: boolean): MCPServerConfig;
|
|
89
|
+
addServer(apiKey: string, selectedFeatures?: string[], local?: boolean): Promise<{
|
|
90
|
+
success: boolean;
|
|
91
|
+
}>;
|
|
52
92
|
}
|
|
@@ -41,13 +41,21 @@ const zod_1 = __importDefault(require("zod"));
|
|
|
41
41
|
const path = __importStar(require("path"));
|
|
42
42
|
const os = __importStar(require("os"));
|
|
43
43
|
const MCPClient_1 = require("../MCPClient");
|
|
44
|
+
const defaults_1 = require("../defaults");
|
|
44
45
|
exports.VisualStudioCodeMCPConfig = zod_1.default
|
|
45
46
|
.object({
|
|
46
|
-
servers: zod_1.default.record(zod_1.default.string(), zod_1.default.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
servers: zod_1.default.record(zod_1.default.string(), zod_1.default.union([
|
|
48
|
+
zod_1.default.object({
|
|
49
|
+
command: zod_1.default.string().optional(),
|
|
50
|
+
args: zod_1.default.array(zod_1.default.string()).optional(),
|
|
51
|
+
env: zod_1.default.record(zod_1.default.string(), zod_1.default.string()).optional(),
|
|
52
|
+
}),
|
|
53
|
+
zod_1.default.object({
|
|
54
|
+
type: zod_1.default.enum(['http', 'sse']),
|
|
55
|
+
url: zod_1.default.string(),
|
|
56
|
+
headers: zod_1.default.record(zod_1.default.string(), zod_1.default.string()).optional(),
|
|
57
|
+
}),
|
|
58
|
+
])),
|
|
51
59
|
})
|
|
52
60
|
.passthrough();
|
|
53
61
|
class VisualStudioCodeClient extends MCPClient_1.DefaultMCPClient {
|
|
@@ -76,6 +84,18 @@ class VisualStudioCodeClient extends MCPClient_1.DefaultMCPClient {
|
|
|
76
84
|
}
|
|
77
85
|
throw new Error(`Unsupported platform: ${process.platform}`);
|
|
78
86
|
}
|
|
87
|
+
getServerConfig(apiKey, type, selectedFeatures, local) {
|
|
88
|
+
return {
|
|
89
|
+
type: 'http',
|
|
90
|
+
url: (0, defaults_1.buildMCPUrl)(type, selectedFeatures, local),
|
|
91
|
+
headers: {
|
|
92
|
+
Authorization: `Bearer ${apiKey}`,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
async addServer(apiKey, selectedFeatures, local) {
|
|
97
|
+
return this._addServerType(apiKey, 'streamable-http', selectedFeatures, local);
|
|
98
|
+
}
|
|
79
99
|
}
|
|
80
100
|
exports.VisualStudioCodeClient = VisualStudioCodeClient;
|
|
81
101
|
//# sourceMappingURL=visual-studio-code.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visual-studio-code.js","sourceRoot":"","sources":["../../../../../src/steps/add-mcp-server-to-clients/clients/visual-studio-code.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAoB;AACpB,2CAA6B;AAC7B,uCAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"visual-studio-code.js","sourceRoot":"","sources":["../../../../../src/steps/add-mcp-server-to-clients/clients/visual-studio-code.ts"],"names":[],"mappings":"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","sourcesContent":["import z from 'zod';\nimport * as path from 'path';\nimport * as os from 'os';\nimport { DefaultMCPClient, MCPServerConfig } from '../MCPClient';\nimport { buildMCPUrl } from '../defaults';\n\nexport const VisualStudioCodeMCPConfig = z\n .object({\n servers: z.record(\n z.string(),\n z.union([\n z.object({\n command: z.string().optional(),\n args: z.array(z.string()).optional(),\n env: z.record(z.string(), z.string()).optional(),\n }),\n z.object({\n type: z.enum(['http', 'sse']),\n url: z.string(),\n headers: z.record(z.string(), z.string()).optional(),\n }),\n ]),\n ),\n })\n .passthrough();\n\nexport type VisualStudioCodeMCPConfig = z.infer<\n typeof VisualStudioCodeMCPConfig\n>;\n\nexport class VisualStudioCodeClient extends DefaultMCPClient {\n name = 'Visual Studio Code';\n\n getServerPropertyName(): string {\n return 'servers';\n }\n\n async isClientSupported(): Promise<boolean> {\n return Promise.resolve(\n process.platform === 'darwin' ||\n process.platform === 'win32' ||\n process.platform === 'linux',\n );\n }\n\n async getConfigPath(): Promise<string> {\n const homeDir = os.homedir();\n const isWindows = process.platform === 'win32';\n const isMac = process.platform === 'darwin';\n const isLinux = process.platform === 'linux';\n\n if (isMac) {\n return Promise.resolve(\n path.join(\n homeDir,\n 'Library',\n 'Application Support',\n 'Code',\n 'User',\n 'mcp.json',\n ),\n );\n }\n\n if (isWindows) {\n return Promise.resolve(\n path.join(process.env.APPDATA || '', 'Code', 'User', 'mcp.json'),\n );\n }\n\n if (isLinux) {\n return Promise.resolve(\n path.join(homeDir, '.config', 'Code', 'User', 'mcp.json'),\n );\n }\n\n throw new Error(`Unsupported platform: ${process.platform}`);\n }\n\n getServerConfig(\n apiKey: string,\n type: 'sse' | 'streamable-http',\n selectedFeatures?: string[],\n local?: boolean,\n ): MCPServerConfig {\n return {\n type: 'http',\n url: buildMCPUrl(type, selectedFeatures, local),\n headers: {\n Authorization: `Bearer ${apiKey}`,\n },\n };\n }\n\n async addServer(\n apiKey: string,\n selectedFeatures?: string[],\n local?: boolean,\n ): Promise<{ success: boolean }> {\n return this._addServerType(\n apiKey,\n 'streamable-http',\n selectedFeatures,\n local,\n );\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
-
import { DefaultMCPClient } from '../MCPClient';
|
|
2
|
+
import { DefaultMCPClient, MCPServerConfig } from '../MCPClient';
|
|
3
3
|
export declare const ZedMCPConfig: z.ZodObject<{
|
|
4
|
-
context_servers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
4
|
+
context_servers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
5
5
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
6
6
|
source: z.ZodOptional<z.ZodString>;
|
|
7
7
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -19,9 +19,21 @@ export declare const ZedMCPConfig: z.ZodObject<{
|
|
|
19
19
|
env?: Record<string, string> | undefined;
|
|
20
20
|
enabled?: boolean | undefined;
|
|
21
21
|
source?: string | undefined;
|
|
22
|
-
}
|
|
22
|
+
}>, z.ZodObject<{
|
|
23
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
url: z.ZodString;
|
|
25
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
url: string;
|
|
28
|
+
headers?: Record<string, string> | undefined;
|
|
29
|
+
enabled?: boolean | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
url: string;
|
|
32
|
+
headers?: Record<string, string> | undefined;
|
|
33
|
+
enabled?: boolean | undefined;
|
|
34
|
+
}>]>>;
|
|
23
35
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
24
|
-
context_servers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
36
|
+
context_servers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
25
37
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
26
38
|
source: z.ZodOptional<z.ZodString>;
|
|
27
39
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -39,9 +51,21 @@ export declare const ZedMCPConfig: z.ZodObject<{
|
|
|
39
51
|
env?: Record<string, string> | undefined;
|
|
40
52
|
enabled?: boolean | undefined;
|
|
41
53
|
source?: string | undefined;
|
|
42
|
-
}
|
|
54
|
+
}>, z.ZodObject<{
|
|
55
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
+
url: z.ZodString;
|
|
57
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
url: string;
|
|
60
|
+
headers?: Record<string, string> | undefined;
|
|
61
|
+
enabled?: boolean | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
url: string;
|
|
64
|
+
headers?: Record<string, string> | undefined;
|
|
65
|
+
enabled?: boolean | undefined;
|
|
66
|
+
}>]>>;
|
|
43
67
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
44
|
-
context_servers: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
68
|
+
context_servers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
45
69
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
46
70
|
source: z.ZodOptional<z.ZodString>;
|
|
47
71
|
command: z.ZodOptional<z.ZodString>;
|
|
@@ -59,7 +83,19 @@ export declare const ZedMCPConfig: z.ZodObject<{
|
|
|
59
83
|
env?: Record<string, string> | undefined;
|
|
60
84
|
enabled?: boolean | undefined;
|
|
61
85
|
source?: string | undefined;
|
|
62
|
-
}
|
|
86
|
+
}>, z.ZodObject<{
|
|
87
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
url: z.ZodString;
|
|
89
|
+
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
url: string;
|
|
92
|
+
headers?: Record<string, string> | undefined;
|
|
93
|
+
enabled?: boolean | undefined;
|
|
94
|
+
}, {
|
|
95
|
+
url: string;
|
|
96
|
+
headers?: Record<string, string> | undefined;
|
|
97
|
+
enabled?: boolean | undefined;
|
|
98
|
+
}>]>>;
|
|
63
99
|
}, z.ZodTypeAny, "passthrough">>;
|
|
64
100
|
export type ZedMCPConfig = z.infer<typeof ZedMCPConfig>;
|
|
65
101
|
export declare class ZedClient extends DefaultMCPClient {
|
|
@@ -67,13 +103,8 @@ export declare class ZedClient extends DefaultMCPClient {
|
|
|
67
103
|
getServerPropertyName(): string;
|
|
68
104
|
isClientSupported(): Promise<boolean>;
|
|
69
105
|
getConfigPath(): Promise<string>;
|
|
70
|
-
getServerConfig(apiKey: string, type: 'sse' | 'streamable-http', selectedFeatures?: string[]):
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
POSTHOG_AUTH_HEADER: string;
|
|
75
|
-
};
|
|
76
|
-
enabled: boolean;
|
|
77
|
-
source: string;
|
|
78
|
-
};
|
|
106
|
+
getServerConfig(apiKey: string, type: 'sse' | 'streamable-http', selectedFeatures?: string[], local?: boolean): MCPServerConfig;
|
|
107
|
+
addServer(apiKey: string, selectedFeatures?: string[], local?: boolean): Promise<{
|
|
108
|
+
success: boolean;
|
|
109
|
+
}>;
|
|
79
110
|
}
|
|
@@ -44,13 +44,20 @@ const MCPClient_1 = require("../MCPClient");
|
|
|
44
44
|
const defaults_1 = require("../defaults");
|
|
45
45
|
exports.ZedMCPConfig = zod_1.default
|
|
46
46
|
.object({
|
|
47
|
-
context_servers: zod_1.default.record(zod_1.default.string(), zod_1.default.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
context_servers: zod_1.default.record(zod_1.default.string(), zod_1.default.union([
|
|
48
|
+
zod_1.default.object({
|
|
49
|
+
enabled: zod_1.default.boolean().optional(),
|
|
50
|
+
source: zod_1.default.string().optional(),
|
|
51
|
+
command: zod_1.default.string().optional(),
|
|
52
|
+
args: zod_1.default.array(zod_1.default.string()).optional(),
|
|
53
|
+
env: zod_1.default.record(zod_1.default.string(), zod_1.default.string()).optional(),
|
|
54
|
+
}),
|
|
55
|
+
zod_1.default.object({
|
|
56
|
+
enabled: zod_1.default.boolean().optional(),
|
|
57
|
+
url: zod_1.default.string(),
|
|
58
|
+
headers: zod_1.default.record(zod_1.default.string(), zod_1.default.string()).optional(),
|
|
59
|
+
}),
|
|
60
|
+
])),
|
|
54
61
|
})
|
|
55
62
|
.passthrough();
|
|
56
63
|
class ZedClient extends MCPClient_1.DefaultMCPClient {
|
|
@@ -78,14 +85,18 @@ class ZedClient extends MCPClient_1.DefaultMCPClient {
|
|
|
78
85
|
}
|
|
79
86
|
throw new Error(`Unsupported platform: ${process.platform}`);
|
|
80
87
|
}
|
|
81
|
-
getServerConfig(apiKey, type, selectedFeatures) {
|
|
82
|
-
const baseConfig = (0, defaults_1.getDefaultServerConfig)(apiKey, type, selectedFeatures);
|
|
88
|
+
getServerConfig(apiKey, type, selectedFeatures, local) {
|
|
83
89
|
return {
|
|
84
90
|
enabled: true,
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
url: (0, defaults_1.buildMCPUrl)(type, selectedFeatures, local),
|
|
92
|
+
headers: {
|
|
93
|
+
Authorization: `Bearer ${apiKey}`,
|
|
94
|
+
},
|
|
87
95
|
};
|
|
88
96
|
}
|
|
97
|
+
async addServer(apiKey, selectedFeatures, local) {
|
|
98
|
+
return this._addServerType(apiKey, 'streamable-http', selectedFeatures, local);
|
|
99
|
+
}
|
|
89
100
|
}
|
|
90
101
|
exports.ZedClient = ZedClient;
|
|
91
102
|
//# sourceMappingURL=zed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zed.js","sourceRoot":"","sources":["../../../../../src/steps/add-mcp-server-to-clients/clients/zed.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAoB;AACpB,2CAA6B;AAC7B,uCAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"zed.js","sourceRoot":"","sources":["../../../../../src/steps/add-mcp-server-to-clients/clients/zed.ts"],"names":[],"mappings":"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","sourcesContent":["import z from 'zod';\nimport * as path from 'path';\nimport * as os from 'os';\nimport { DefaultMCPClient, MCPServerConfig } from '../MCPClient';\nimport { buildMCPUrl } from '../defaults';\n\nexport const ZedMCPConfig = z\n .object({\n context_servers: z.record(\n z.string(),\n z.union([\n z.object({\n enabled: z.boolean().optional(),\n source: z.string().optional(),\n command: z.string().optional(),\n args: z.array(z.string()).optional(),\n env: z.record(z.string(), z.string()).optional(),\n }),\n z.object({\n enabled: z.boolean().optional(),\n url: z.string(),\n headers: z.record(z.string(), z.string()).optional(),\n }),\n ]),\n ),\n })\n .passthrough();\n\nexport type ZedMCPConfig = z.infer<typeof ZedMCPConfig>;\n\nexport class ZedClient extends DefaultMCPClient {\n name = 'Zed';\n\n getServerPropertyName(): string {\n return 'context_servers';\n }\n\n async isClientSupported(): Promise<boolean> {\n return Promise.resolve(\n process.platform === 'darwin' || process.platform === 'linux',\n );\n }\n\n async getConfigPath(): Promise<string> {\n const homeDir = os.homedir();\n const isMac = process.platform === 'darwin';\n const isLinux = process.platform === 'linux';\n\n if (isMac) {\n return Promise.resolve(\n path.join(homeDir, '.config', 'zed', 'settings.json'),\n );\n }\n\n if (isLinux) {\n // https://zed.dev/docs/configuring-zed#settings-files\n const xdgConfigHome = process.env.XDG_CONFIG_HOME;\n if (xdgConfigHome) {\n return Promise.resolve(\n path.join(xdgConfigHome, 'zed', 'settings.json'),\n );\n }\n return Promise.resolve(\n path.join(homeDir, '.config', 'zed', 'settings.json'),\n );\n }\n\n throw new Error(`Unsupported platform: ${process.platform}`);\n }\n\n getServerConfig(\n apiKey: string,\n type: 'sse' | 'streamable-http',\n selectedFeatures?: string[],\n local?: boolean,\n ): MCPServerConfig {\n return {\n enabled: true,\n url: buildMCPUrl(type, selectedFeatures, local),\n headers: {\n Authorization: `Bearer ${apiKey}`,\n },\n };\n }\n\n async addServer(\n apiKey: string,\n selectedFeatures?: string[],\n local?: boolean,\n ): Promise<{ success: boolean }> {\n return this._addServerType(\n apiKey,\n 'streamable-http',\n selectedFeatures,\n local,\n );\n }\n}\n"]}
|