@tsed/cli 7.0.0-beta.3 → 7.0.0-beta.5

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.
Files changed (47) hide show
  1. package/lib/esm/bin/tsed.js +3 -1
  2. package/lib/esm/commands/add/AddCmd.js +2 -1
  3. package/lib/esm/commands/generate/GenerateCmd.js +2 -1
  4. package/lib/esm/commands/index.js +3 -1
  5. package/lib/esm/commands/init/InitCmd.js +10 -103
  6. package/lib/esm/commands/init/InitOptionsCmd.js +17 -0
  7. package/lib/esm/commands/init/config/FeaturesPrompt.js +29 -29
  8. package/lib/esm/commands/init/config/InitSchema.js +297 -16
  9. package/lib/esm/commands/mcp/McpCommand.js +15 -0
  10. package/lib/esm/commands/mcp/schema/InitMCPSchema.js +9 -0
  11. package/lib/esm/{mcp → commands/mcp}/schema/ProjectPreferencesSchema.js +2 -2
  12. package/lib/esm/{mcp → commands/mcp}/tools/generateTool.js +3 -3
  13. package/lib/esm/{mcp → commands/mcp}/tools/getTemplateTool.js +2 -2
  14. package/lib/esm/{mcp → commands/mcp}/tools/index.js +2 -1
  15. package/lib/esm/commands/mcp/tools/initProjectTool.js +64 -0
  16. package/lib/esm/{mcp → commands/mcp}/tools/listTemplatesTool.js +2 -2
  17. package/lib/esm/commands/run/RunCmd.js +2 -1
  18. package/lib/esm/commands/template/CreateTemplateCommand.js +2 -1
  19. package/lib/esm/commands/update/UpdateCmd.js +3 -4
  20. package/lib/esm/index.js +2 -2
  21. package/lib/tsconfig.esm.tsbuildinfo +1 -1
  22. package/lib/types/commands/index.d.ts +103 -1
  23. package/lib/types/commands/init/InitCmd.d.ts +1 -4
  24. package/lib/types/commands/init/InitOptionsCmd.d.ts +52 -0
  25. package/lib/types/commands/init/config/FeaturesPrompt.d.ts +25 -25
  26. package/lib/types/commands/init/config/InitSchema.d.ts +12 -7
  27. package/lib/types/commands/mcp/McpCommand.d.ts +52 -0
  28. package/lib/types/commands/mcp/schema/InitMCPSchema.d.ts +5 -0
  29. package/lib/types/{mcp → commands/mcp}/schema/ProjectPreferencesSchema.d.ts +2 -2
  30. package/lib/types/{mcp → commands/mcp}/tools/generateTool.d.ts +45 -17
  31. package/lib/types/{mcp → commands/mcp}/tools/getTemplateTool.d.ts +45 -17
  32. package/lib/types/commands/mcp/tools/initProjectTool.d.ts +116 -0
  33. package/lib/types/{mcp → commands/mcp}/tools/listTemplatesTool.d.ts +45 -17
  34. package/lib/types/{mcp → commands/mcp}/tools/setWorkspaceTool.d.ts +45 -17
  35. package/lib/types/index.d.ts +2 -2
  36. package/lib/types/interfaces/InitCmdOptions.d.ts +1 -1
  37. package/package.json +14 -14
  38. package/lib/esm/bin/tsed-mcp.js +0 -42
  39. package/lib/types/bin/tsed-mcp.d.ts +0 -2
  40. /package/lib/esm/{mcp → commands/mcp}/resources/index.js +0 -0
  41. /package/lib/esm/{mcp → commands/mcp}/resources/projectInfoResource.js +0 -0
  42. /package/lib/esm/{mcp → commands/mcp}/resources/serverInfoResource.js +0 -0
  43. /package/lib/esm/{mcp → commands/mcp}/tools/setWorkspaceTool.js +0 -0
  44. /package/lib/types/{mcp → commands/mcp}/resources/index.d.ts +0 -0
  45. /package/lib/types/{mcp → commands/mcp}/resources/projectInfoResource.d.ts +0 -0
  46. /package/lib/types/{mcp → commands/mcp}/resources/serverInfoResource.d.ts +0 -0
  47. /package/lib/types/{mcp → commands/mcp}/tools/index.d.ts +0 -0
@@ -0,0 +1,116 @@
1
+ export declare const initProjectTool: import("@tsed/cli-core").FactoryTokenProvider<{
2
+ inputSchema: Record<string, import("zod").AnyZodObject> | undefined;
3
+ outputSchema: Record<string, import("zod").AnyZodObject> | undefined;
4
+ handler(args: import("@tsed/schema").PropsToShape<{
5
+ cwd: import("@tsed/schema").JsonSchema<string>;
6
+ }> & {
7
+ [x: string]: unknown;
8
+ }, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
9
+ [x: string]: unknown;
10
+ content: ({
11
+ type: "text";
12
+ text: string;
13
+ annotations?: {
14
+ audience?: ("user" | "assistant")[] | undefined;
15
+ priority?: number | undefined;
16
+ lastModified?: string | undefined;
17
+ } | undefined;
18
+ _meta?: {
19
+ [x: string]: unknown;
20
+ } | undefined;
21
+ } | {
22
+ type: "image";
23
+ data: string;
24
+ mimeType: string;
25
+ annotations?: {
26
+ audience?: ("user" | "assistant")[] | undefined;
27
+ priority?: number | undefined;
28
+ lastModified?: string | undefined;
29
+ } | undefined;
30
+ _meta?: {
31
+ [x: string]: unknown;
32
+ } | undefined;
33
+ } | {
34
+ type: "audio";
35
+ data: string;
36
+ mimeType: string;
37
+ annotations?: {
38
+ audience?: ("user" | "assistant")[] | undefined;
39
+ priority?: number | undefined;
40
+ lastModified?: string | undefined;
41
+ } | undefined;
42
+ _meta?: {
43
+ [x: string]: unknown;
44
+ } | undefined;
45
+ } | {
46
+ uri: string;
47
+ name: string;
48
+ type: "resource_link";
49
+ description?: string | undefined;
50
+ mimeType?: string | undefined;
51
+ annotations?: {
52
+ audience?: ("user" | "assistant")[] | undefined;
53
+ priority?: number | undefined;
54
+ lastModified?: string | undefined;
55
+ } | undefined;
56
+ _meta?: {
57
+ [x: string]: unknown;
58
+ } | undefined;
59
+ icons?: {
60
+ src: string;
61
+ mimeType?: string | undefined;
62
+ sizes?: string[] | undefined;
63
+ theme?: "light" | "dark" | undefined;
64
+ }[] | undefined;
65
+ title?: string | undefined;
66
+ } | {
67
+ type: "resource";
68
+ resource: {
69
+ uri: string;
70
+ text: string;
71
+ mimeType?: string | undefined;
72
+ _meta?: {
73
+ [x: string]: unknown;
74
+ } | undefined;
75
+ } | {
76
+ uri: string;
77
+ blob: string;
78
+ mimeType?: string | undefined;
79
+ _meta?: {
80
+ [x: string]: unknown;
81
+ } | undefined;
82
+ };
83
+ annotations?: {
84
+ audience?: ("user" | "assistant")[] | undefined;
85
+ priority?: number | undefined;
86
+ lastModified?: string | undefined;
87
+ } | undefined;
88
+ _meta?: {
89
+ [x: string]: unknown;
90
+ } | undefined;
91
+ })[];
92
+ _meta?: {
93
+ [x: string]: unknown;
94
+ progressToken?: string | number | undefined;
95
+ "io.modelcontextprotocol/related-task"?: {
96
+ taskId: string;
97
+ } | undefined;
98
+ } | undefined;
99
+ structuredContent?: {
100
+ [x: string]: unknown;
101
+ } | undefined;
102
+ isError?: boolean | undefined;
103
+ } | {
104
+ content: never[];
105
+ structuredContent: {
106
+ code: string;
107
+ message: any;
108
+ };
109
+ }>;
110
+ _meta?: Record<string, unknown> | undefined;
111
+ description?: string | undefined;
112
+ annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations | undefined;
113
+ title?: string | undefined;
114
+ token?: import("@tsed/cli-core").TokenProvider;
115
+ name: string;
116
+ }>;
@@ -6,81 +6,109 @@ export declare const listTemplatesTool: import("@tsed/di").FactoryTokenProvider<
6
6
  }>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
7
7
  [x: string]: unknown;
8
8
  content: ({
9
- [x: string]: unknown;
10
9
  type: "text";
11
10
  text: string;
11
+ annotations?: {
12
+ audience?: ("user" | "assistant")[] | undefined;
13
+ priority?: number | undefined;
14
+ lastModified?: string | undefined;
15
+ } | undefined;
12
16
  _meta?: {
13
17
  [x: string]: unknown;
14
18
  } | undefined;
15
19
  } | {
16
- [x: string]: unknown;
17
20
  type: "image";
18
21
  data: string;
19
22
  mimeType: string;
23
+ annotations?: {
24
+ audience?: ("user" | "assistant")[] | undefined;
25
+ priority?: number | undefined;
26
+ lastModified?: string | undefined;
27
+ } | undefined;
20
28
  _meta?: {
21
29
  [x: string]: unknown;
22
30
  } | undefined;
23
31
  } | {
24
- [x: string]: unknown;
25
32
  type: "audio";
26
33
  data: string;
27
34
  mimeType: string;
35
+ annotations?: {
36
+ audience?: ("user" | "assistant")[] | undefined;
37
+ priority?: number | undefined;
38
+ lastModified?: string | undefined;
39
+ } | undefined;
28
40
  _meta?: {
29
41
  [x: string]: unknown;
30
42
  } | undefined;
31
43
  } | {
32
- [x: string]: unknown;
33
- type: "resource_link";
34
- name: string;
35
44
  uri: string;
45
+ name: string;
46
+ type: "resource_link";
47
+ description?: string | undefined;
48
+ mimeType?: string | undefined;
49
+ annotations?: {
50
+ audience?: ("user" | "assistant")[] | undefined;
51
+ priority?: number | undefined;
52
+ lastModified?: string | undefined;
53
+ } | undefined;
36
54
  _meta?: {
37
55
  [x: string]: unknown;
38
56
  } | undefined;
39
- description?: string | undefined;
40
- mimeType?: string | undefined;
41
- title?: string | undefined;
42
57
  icons?: {
43
- [x: string]: unknown;
44
58
  src: string;
45
59
  mimeType?: string | undefined;
46
60
  sizes?: string[] | undefined;
61
+ theme?: "light" | "dark" | undefined;
47
62
  }[] | undefined;
63
+ title?: string | undefined;
48
64
  } | {
49
- [x: string]: unknown;
50
65
  type: "resource";
51
66
  resource: {
52
- [x: string]: unknown;
53
- text: string;
54
67
  uri: string;
68
+ text: string;
69
+ mimeType?: string | undefined;
55
70
  _meta?: {
56
71
  [x: string]: unknown;
57
72
  } | undefined;
58
- mimeType?: string | undefined;
59
73
  } | {
60
- [x: string]: unknown;
61
74
  uri: string;
62
75
  blob: string;
76
+ mimeType?: string | undefined;
63
77
  _meta?: {
64
78
  [x: string]: unknown;
65
79
  } | undefined;
66
- mimeType?: string | undefined;
67
80
  };
81
+ annotations?: {
82
+ audience?: ("user" | "assistant")[] | undefined;
83
+ priority?: number | undefined;
84
+ lastModified?: string | undefined;
85
+ } | undefined;
68
86
  _meta?: {
69
87
  [x: string]: unknown;
70
88
  } | undefined;
71
89
  })[];
72
90
  _meta?: {
73
91
  [x: string]: unknown;
92
+ progressToken?: string | number | undefined;
93
+ "io.modelcontextprotocol/related-task"?: {
94
+ taskId: string;
95
+ } | undefined;
74
96
  } | undefined;
75
97
  structuredContent?: {
76
98
  [x: string]: unknown;
77
99
  } | undefined;
78
100
  isError?: boolean | undefined;
101
+ } | {
102
+ content: never[];
103
+ structuredContent: {
104
+ code: string;
105
+ message: any;
106
+ };
79
107
  }>;
80
108
  _meta?: Record<string, unknown> | undefined;
81
109
  description?: string | undefined;
82
- title?: string | undefined;
83
110
  annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations | undefined;
111
+ title?: string | undefined;
84
112
  token?: import("@tsed/di").TokenProvider;
85
113
  name: string;
86
114
  }>;
@@ -11,81 +11,109 @@ export declare const setWorkspaceTool: import("@tsed/cli-core").FactoryTokenProv
11
11
  }>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
12
12
  [x: string]: unknown;
13
13
  content: ({
14
- [x: string]: unknown;
15
14
  type: "text";
16
15
  text: string;
16
+ annotations?: {
17
+ audience?: ("user" | "assistant")[] | undefined;
18
+ priority?: number | undefined;
19
+ lastModified?: string | undefined;
20
+ } | undefined;
17
21
  _meta?: {
18
22
  [x: string]: unknown;
19
23
  } | undefined;
20
24
  } | {
21
- [x: string]: unknown;
22
25
  type: "image";
23
26
  data: string;
24
27
  mimeType: string;
28
+ annotations?: {
29
+ audience?: ("user" | "assistant")[] | undefined;
30
+ priority?: number | undefined;
31
+ lastModified?: string | undefined;
32
+ } | undefined;
25
33
  _meta?: {
26
34
  [x: string]: unknown;
27
35
  } | undefined;
28
36
  } | {
29
- [x: string]: unknown;
30
37
  type: "audio";
31
38
  data: string;
32
39
  mimeType: string;
40
+ annotations?: {
41
+ audience?: ("user" | "assistant")[] | undefined;
42
+ priority?: number | undefined;
43
+ lastModified?: string | undefined;
44
+ } | undefined;
33
45
  _meta?: {
34
46
  [x: string]: unknown;
35
47
  } | undefined;
36
48
  } | {
37
- [x: string]: unknown;
38
- type: "resource_link";
39
- name: string;
40
49
  uri: string;
50
+ name: string;
51
+ type: "resource_link";
52
+ description?: string | undefined;
53
+ mimeType?: string | undefined;
54
+ annotations?: {
55
+ audience?: ("user" | "assistant")[] | undefined;
56
+ priority?: number | undefined;
57
+ lastModified?: string | undefined;
58
+ } | undefined;
41
59
  _meta?: {
42
60
  [x: string]: unknown;
43
61
  } | undefined;
44
- description?: string | undefined;
45
- mimeType?: string | undefined;
46
- title?: string | undefined;
47
62
  icons?: {
48
- [x: string]: unknown;
49
63
  src: string;
50
64
  mimeType?: string | undefined;
51
65
  sizes?: string[] | undefined;
66
+ theme?: "light" | "dark" | undefined;
52
67
  }[] | undefined;
68
+ title?: string | undefined;
53
69
  } | {
54
- [x: string]: unknown;
55
70
  type: "resource";
56
71
  resource: {
57
- [x: string]: unknown;
58
- text: string;
59
72
  uri: string;
73
+ text: string;
74
+ mimeType?: string | undefined;
60
75
  _meta?: {
61
76
  [x: string]: unknown;
62
77
  } | undefined;
63
- mimeType?: string | undefined;
64
78
  } | {
65
- [x: string]: unknown;
66
79
  uri: string;
67
80
  blob: string;
81
+ mimeType?: string | undefined;
68
82
  _meta?: {
69
83
  [x: string]: unknown;
70
84
  } | undefined;
71
- mimeType?: string | undefined;
72
85
  };
86
+ annotations?: {
87
+ audience?: ("user" | "assistant")[] | undefined;
88
+ priority?: number | undefined;
89
+ lastModified?: string | undefined;
90
+ } | undefined;
73
91
  _meta?: {
74
92
  [x: string]: unknown;
75
93
  } | undefined;
76
94
  })[];
77
95
  _meta?: {
78
96
  [x: string]: unknown;
97
+ progressToken?: string | number | undefined;
98
+ "io.modelcontextprotocol/related-task"?: {
99
+ taskId: string;
100
+ } | undefined;
79
101
  } | undefined;
80
102
  structuredContent?: {
81
103
  [x: string]: unknown;
82
104
  } | undefined;
83
105
  isError?: boolean | undefined;
106
+ } | {
107
+ content: never[];
108
+ structuredContent: {
109
+ code: string;
110
+ message: any;
111
+ };
84
112
  }>;
85
113
  _meta?: Record<string, unknown> | undefined;
86
114
  description?: string | undefined;
87
- title?: string | undefined;
88
115
  annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations | undefined;
116
+ title?: string | undefined;
89
117
  token?: import("@tsed/cli-core").TokenProvider;
90
118
  name: string;
91
119
  }>;
@@ -8,13 +8,13 @@ export * from "./commands/init/config/FeaturesPrompt.js";
8
8
  export * from "./commands/init/config/FeaturesPrompt.js";
9
9
  export * from "./commands/init/InitCmd.js";
10
10
  export * from "./commands/init/prompts/getFeaturesPrompt.js";
11
+ export { default as resources } from "./commands/mcp/resources/index.js";
12
+ export { default as tools } from "./commands/mcp/tools/index.js";
11
13
  export * from "./commands/update/UpdateCmd.js";
12
14
  export * from "./constants/index.js";
13
15
  export * from "./fn/exec.js";
14
16
  export * from "./fn/render.js";
15
17
  export * from "./interfaces/index.js";
16
- export { default as resources } from "./mcp/resources/index.js";
17
- export { default as tools } from "./mcp/tools/index.js";
18
18
  export * from "./pipes/index.js";
19
19
  export * from "./runtimes/index.js";
20
20
  export * from "./services/CliProjectService.js";
@@ -2,7 +2,7 @@ import type { RenderDataContext } from "./RenderDataContext.js";
2
2
  export interface InitOptions extends RenderDataContext {
3
3
  root: string;
4
4
  srcDir: string;
5
- skipPrompt: boolean;
5
+ skipPrompt?: boolean;
6
6
  GH_TOKEN?: string;
7
7
  }
8
8
  export type InitCmdContext = InitOptions;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tsed/cli",
3
3
  "description": "CLI to bootstrap your Ts.ED project",
4
- "version": "7.0.0-beta.3",
4
+ "version": "7.0.0-beta.5",
5
5
  "type": "module",
6
6
  "main": "./lib/esm/index.js",
7
7
  "source": "./src/index.ts",
@@ -22,8 +22,7 @@
22
22
  "test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
23
23
  },
24
24
  "bin": {
25
- "tsed": "lib/esm/bin/tsed.js",
26
- "tsed-mcp": "lib/esm/bin/tsed-mcp.js"
25
+ "tsed": "lib/esm/bin/tsed.js"
27
26
  },
28
27
  "files": [
29
28
  "lib/esm/bin/tsed.js",
@@ -46,21 +45,21 @@
46
45
  "node": ">=14"
47
46
  },
48
47
  "dependencies": {
49
- "@modelcontextprotocol/sdk": "^1.19.1",
48
+ "@modelcontextprotocol/sdk": "^1.25.1",
50
49
  "@npmcli/run-script": "9.0.0",
51
50
  "@swc-node/register": "^1.10.9",
52
51
  "@swc/core": "1.7.26",
53
52
  "@swc/helpers": "^0.5.13",
54
- "@tsed/cli-core": "7.0.0-beta.3",
55
- "@tsed/cli-mcp": "7.0.0-beta.3",
56
- "@tsed/core": ">=8.18.0",
57
- "@tsed/di": ">=8.18.0",
58
- "@tsed/hooks": ">=8.18.0",
53
+ "@tsed/cli-core": "7.0.0-beta.5",
54
+ "@tsed/cli-mcp": "7.0.0-beta.5",
55
+ "@tsed/core": ">=8.21.0",
56
+ "@tsed/di": ">=8.21.0",
57
+ "@tsed/hooks": ">=8.21.0",
59
58
  "@tsed/logger": ">=8.0.3",
60
59
  "@tsed/logger-std": ">=8.0.3",
61
- "@tsed/normalize-path": ">=8.18.0",
62
- "@tsed/openspec": ">=8.18.0",
63
- "@tsed/schema": ">=8.18.0",
60
+ "@tsed/normalize-path": ">=8.21.0",
61
+ "@tsed/openspec": ">=8.21.0",
62
+ "@tsed/schema": ">=8.21.0",
64
63
  "chalk": "^5.3.0",
65
64
  "change-case": "^5.4.4",
66
65
  "consolidate": "^1.0.4",
@@ -72,10 +71,11 @@
72
71
  "rxjs": "^7.8.1",
73
72
  "semver": "^7.6.3",
74
73
  "ts-morph": "27.0.0",
75
- "tslib": "^2.7.0"
74
+ "tslib": "^2.7.0",
75
+ "zod": "3.25.76"
76
76
  },
77
77
  "devDependencies": {
78
- "@tsed/typescript": "7.0.0-beta.3",
78
+ "@tsed/typescript": "7.0.0-beta.5",
79
79
  "@types/change-case": "^2.3.1",
80
80
  "@types/consolidate": "0.14.4",
81
81
  "cross-env": "7.0.3",
@@ -1,42 +0,0 @@
1
- #!/usr/bin/env node
2
- import "@swc-node/register/esm-register";
3
- import { register } from "node:module";
4
- import { join } from "node:path";
5
- import { pathToFileURL } from "node:url";
6
- import { CLIMCPServer } from "@tsed/cli-mcp";
7
- const EXT = process.env.CLI_MODE === "ts" ? "ts" : "js";
8
- register(pathToFileURL(join(import.meta.dirname, `../loaders/alias.hook.${EXT}`)), {
9
- parentURL: import.meta.dirname,
10
- data: {
11
- "@tsed/core": import.meta.resolve("@tsed/core"),
12
- "@tsed/di": import.meta.resolve("@tsed/di"),
13
- "@tsed/schema": import.meta.resolve("@tsed/schema"),
14
- "@tsed/cli-core": import.meta.resolve("@tsed/cli-core"),
15
- "@tsed/cli": import.meta.resolve("@tsed/cli")
16
- },
17
- transferList: []
18
- });
19
- const { tools, resources, PKG, TEMPLATE_DIR, ArchitectureConvention, ProjectConvention } = await import("../index.js");
20
- CLIMCPServer.bootstrap({
21
- name: "tsed",
22
- version: PKG.version,
23
- pkg: PKG,
24
- templateDir: TEMPLATE_DIR,
25
- tools,
26
- resources,
27
- mcp: {
28
- mode: process.env.args?.includes("--http") || process.env.USE_MCP_HTTP ? "streamable-http" : "stdio"
29
- },
30
- defaultProjectPreferences() {
31
- return {
32
- convention: ProjectConvention.DEFAULT,
33
- architecture: ArchitectureConvention.DEFAULT
34
- };
35
- },
36
- project: {
37
- reinstallAfterRun: true
38
- }
39
- }).catch((error) => {
40
- console.error(error);
41
- process.exit(-1);
42
- });
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import "@swc-node/register/esm-register";