@tsed/cli 7.0.0-beta.1 → 7.0.0-beta.3
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/lib/esm/bin/tsed-mcp.js +42 -0
- package/lib/esm/commands/init/InitCmd.js +9 -9
- package/lib/esm/commands/init/config/InitSchema.js +27 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/mcp/resources/index.js +3 -0
- package/lib/esm/mcp/resources/projectInfoResource.js +43 -0
- package/lib/esm/mcp/resources/serverInfoResource.js +40 -0
- package/lib/esm/mcp/schema/ProjectPreferencesSchema.js +16 -0
- package/lib/esm/mcp/tools/generateTool.js +105 -0
- package/lib/esm/mcp/tools/getTemplateTool.js +47 -0
- package/lib/esm/mcp/tools/index.js +6 -0
- package/lib/esm/mcp/tools/listTemplatesTool.js +37 -0
- package/lib/esm/mcp/tools/setWorkspaceTool.js +64 -0
- package/lib/esm/services/CliProjectService.js +7 -3
- package/lib/esm/services/CliStats.js +45 -0
- package/lib/esm/services/CliTemplatesService.js +13 -4
- package/lib/esm/templates/asyncFactory.template.js +4 -3
- package/lib/esm/templates/barrels.template.js +0 -3
- package/lib/esm/templates/command.template.js +1 -0
- package/lib/esm/templates/controller.template.js +7 -0
- package/lib/esm/templates/decorator.template.js +22 -11
- package/lib/esm/templates/dockerfile.template.js +5 -0
- package/lib/esm/templates/exception-filter.template.js +1 -0
- package/lib/esm/templates/factory.template.js +4 -3
- package/lib/esm/templates/index.logger.template.js +0 -1
- package/lib/esm/templates/interceptor.template.js +1 -0
- package/lib/esm/templates/interface.template.js +1 -0
- package/lib/esm/templates/middleware.template.js +14 -4
- package/lib/esm/templates/model.template.js +1 -0
- package/lib/esm/templates/module.template.js +1 -0
- package/lib/esm/templates/pipe.template.js +1 -0
- package/lib/esm/templates/prisma.service.template.js +1 -0
- package/lib/esm/templates/repository.template.js +1 -0
- package/lib/esm/templates/response-filter.template.js +1 -0
- package/lib/esm/templates/service.template.js +1 -0
- package/lib/esm/templates/value.template.js +1 -0
- package/lib/esm/utils/resolveSchema.js +17 -0
- package/lib/esm/utils/summarizeSchema.js +24 -0
- package/lib/tsconfig.esm.tsbuildinfo +1 -1
- package/lib/types/bin/tsed-mcp.d.ts +2 -0
- package/lib/types/commands/generate/GenerateCmd.d.ts +38 -1
- package/lib/types/commands/init/InitCmd.d.ts +1 -1
- package/lib/types/commands/init/config/InitSchema.d.ts +13 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/mcp/resources/index.d.ts +2 -0
- package/lib/types/mcp/resources/projectInfoResource.d.ts +1 -0
- package/lib/types/mcp/resources/serverInfoResource.d.ts +1 -0
- package/lib/types/mcp/schema/ProjectPreferencesSchema.d.ts +9 -0
- package/lib/types/mcp/tools/generateTool.d.ts +88 -0
- package/lib/types/mcp/tools/getTemplateTool.d.ts +86 -0
- package/lib/types/mcp/tools/index.d.ts +2 -0
- package/lib/types/mcp/tools/listTemplatesTool.d.ts +86 -0
- package/lib/types/mcp/tools/setWorkspaceTool.d.ts +91 -0
- package/lib/types/pipes/SymbolNamePipe.d.ts +1 -1
- package/lib/types/services/CliProjectService.d.ts +1 -1
- package/lib/types/services/CliStats.d.ts +36 -0
- package/lib/types/services/CliTemplatesService.d.ts +6 -5
- package/lib/types/templates/asyncFactory.template.d.ts +1 -0
- package/lib/types/templates/barrels.template.d.ts +1 -0
- package/lib/types/templates/command.template.d.ts +1 -0
- package/lib/types/templates/config.template.d.ts +1 -0
- package/lib/types/templates/controller.template.d.ts +1 -0
- package/lib/types/templates/decorator.template.d.ts +1 -0
- package/lib/types/templates/docker-compose.template.d.ts +1 -0
- package/lib/types/templates/exception-filter.template.d.ts +1 -0
- package/lib/types/templates/factory.template.d.ts +1 -0
- package/lib/types/templates/index.command.template.d.ts +1 -0
- package/lib/types/templates/index.config.utils.template.d.ts +1 -0
- package/lib/types/templates/index.controller.template.d.ts +1 -0
- package/lib/types/templates/index.logger.template.d.ts +3 -2
- package/lib/types/templates/index.template.d.ts +1 -0
- package/lib/types/templates/interceptor.template.d.ts +1 -0
- package/lib/types/templates/interface.template.d.ts +1 -0
- package/lib/types/templates/middleware.template.d.ts +1 -0
- package/lib/types/templates/model.template.d.ts +1 -0
- package/lib/types/templates/module.template.d.ts +1 -0
- package/lib/types/templates/pipe.template.d.ts +1 -0
- package/lib/types/templates/prisma.service.template.d.ts +1 -0
- package/lib/types/templates/readme.template.d.ts +1 -0
- package/lib/types/templates/repository.template.d.ts +1 -0
- package/lib/types/templates/response-filter.template.d.ts +1 -0
- package/lib/types/templates/server.template.d.ts +1 -0
- package/lib/types/templates/service.template.d.ts +1 -0
- package/lib/types/templates/tsconfig.spec.template.d.ts +1 -0
- package/lib/types/templates/value.template.d.ts +1 -0
- package/lib/types/utils/defineTemplate.d.ts +11 -0
- package/lib/types/utils/resolveSchema.d.ts +2 -0
- package/lib/types/utils/summarizeSchema.d.ts +8 -0
- package/package.json +15 -10
- package/lib/esm/commands/init/config/InitFileSchema.js +0 -49
- package/lib/types/commands/init/config/InitFileSchema.d.ts +0 -49
|
@@ -6,7 +6,44 @@ export declare class GenerateCmd implements CommandProvider {
|
|
|
6
6
|
protected projectPackageJson: ProjectPackageJson;
|
|
7
7
|
protected projectService: CliProjectService;
|
|
8
8
|
protected templates: CliTemplatesService;
|
|
9
|
-
$prompt(data: Partial<GenerateCmdContext>): Promise<
|
|
9
|
+
$prompt(data: Partial<GenerateCmdContext>): Promise<(import("inquirer").NumberQuestion<GenerateCmdContext> | import("inquirer").ListQuestion<GenerateCmdContext> | import("inquirer").CheckboxQuestion<GenerateCmdContext> | import("inquirer").PasswordQuestion<GenerateCmdContext> | import("inquirer").InputQuestion<GenerateCmdContext> | import("inquirer").RawListQuestion<GenerateCmdContext> | import("inquirer").ExpandQuestion<GenerateCmdContext> | import("inquirer").ConfirmQuestion<GenerateCmdContext> | import("inquirer").EditorQuestion<GenerateCmdContext> | import("inquirer-autocomplete-prompt").default.AutocompleteQuestionOptions<GenerateCmdContext> | readonly import("inquirer").DistinctQuestion<GenerateCmdContext>[] | import("rxjs").Observable<import("inquirer").DistinctQuestion<GenerateCmdContext>> | {
|
|
10
|
+
[x: string]: (import("inquirer").NumberQuestion<GenerateCmdContext> & {
|
|
11
|
+
name?: never;
|
|
12
|
+
}) | (import("inquirer").ListQuestion<GenerateCmdContext> & {
|
|
13
|
+
name?: never;
|
|
14
|
+
}) | (import("inquirer").CheckboxQuestion<GenerateCmdContext> & {
|
|
15
|
+
name?: never;
|
|
16
|
+
}) | (import("inquirer").PasswordQuestion<GenerateCmdContext> & {
|
|
17
|
+
name?: never;
|
|
18
|
+
}) | (import("inquirer").InputQuestion<GenerateCmdContext> & {
|
|
19
|
+
name?: never;
|
|
20
|
+
}) | (import("inquirer").RawListQuestion<GenerateCmdContext> & {
|
|
21
|
+
name?: never;
|
|
22
|
+
}) | (import("inquirer").ExpandQuestion<GenerateCmdContext> & {
|
|
23
|
+
name?: never;
|
|
24
|
+
}) | (import("inquirer").ConfirmQuestion<GenerateCmdContext> & {
|
|
25
|
+
name?: never;
|
|
26
|
+
}) | (import("inquirer").EditorQuestion<GenerateCmdContext> & {
|
|
27
|
+
name?: never;
|
|
28
|
+
}) | undefined;
|
|
29
|
+
} | {
|
|
30
|
+
type: string;
|
|
31
|
+
name: string;
|
|
32
|
+
message: string;
|
|
33
|
+
default: string | undefined;
|
|
34
|
+
when: () => boolean;
|
|
35
|
+
source: (_: any, keyword: string) => {
|
|
36
|
+
name: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}[];
|
|
39
|
+
} | {
|
|
40
|
+
type: string;
|
|
41
|
+
name: string;
|
|
42
|
+
message: string;
|
|
43
|
+
default: ((state: Partial<GenerateCmdContext>) => string) | undefined;
|
|
44
|
+
when: boolean;
|
|
45
|
+
source?: undefined;
|
|
46
|
+
})[]>;
|
|
10
47
|
$mapContext(ctx: Partial<GenerateCmdContext>): GenerateCmdContext;
|
|
11
48
|
$exec(ctx: GenerateCmdContext): Task[];
|
|
12
49
|
}
|
|
@@ -17,7 +17,7 @@ export declare class InitCmd implements CommandProvider {
|
|
|
17
17
|
protected execa: CliExeca;
|
|
18
18
|
protected fs: CliFs;
|
|
19
19
|
checkPrecondition(ctx: InitOptions): void;
|
|
20
|
-
$beforePrompt(initialOptions: Partial<InitOptions>): Promise<
|
|
20
|
+
$beforePrompt(initialOptions: Partial<InitOptions>): Promise<Partial<InitOptions>>;
|
|
21
21
|
$prompt(initialOptions: Partial<InitOptions>): QuestionOptions;
|
|
22
22
|
$mapContext(ctx: any): InitOptions;
|
|
23
23
|
$beforeExec(ctx: InitOptions): Promise<any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PackageManager } from "@tsed/cli-core";
|
|
2
|
+
import { PlatformType, ProjectConvention } from "../../../interfaces/index.js";
|
|
3
|
+
import { FeatureType } from "./FeaturesPrompt.js";
|
|
4
|
+
export declare const InitSchema: import("@tsed/schema").JsonSchema<import("@tsed/schema").PropsToShape<{
|
|
5
|
+
tsedVersion: import("@tsed/schema").JsonSchema<string | undefined>;
|
|
6
|
+
projectName: import("@tsed/schema").JsonSchema<string | undefined>;
|
|
7
|
+
platform: import("@tsed/schema").JsonSchema<PlatformType>;
|
|
8
|
+
convention: import("@tsed/schema").JsonSchema<ProjectConvention>;
|
|
9
|
+
packageManager: import("@tsed/schema").JsonSchema<PackageManager>;
|
|
10
|
+
runtime: import("@tsed/schema").JsonSchema<"node" | "babel" | "webpack" | "bun" | "swc">;
|
|
11
|
+
features: import("@tsed/schema").JsonSchema<FeatureType[]>;
|
|
12
|
+
skipPrompt: import("@tsed/schema").JsonSchema<boolean>;
|
|
13
|
+
}> & Record<string, unknown>>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "@tsed/logger-std";
|
|
2
2
|
import "./templates/index.js";
|
|
3
|
+
import "./services/CliStats.js";
|
|
3
4
|
export * from "./commands/add/AddCmd.js";
|
|
4
5
|
export * from "./commands/generate/GenerateCmd.js";
|
|
5
6
|
export { default as commands } from "./commands/index.js";
|
|
@@ -12,6 +13,8 @@ export * from "./constants/index.js";
|
|
|
12
13
|
export * from "./fn/exec.js";
|
|
13
14
|
export * from "./fn/render.js";
|
|
14
15
|
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";
|
|
15
18
|
export * from "./pipes/index.js";
|
|
16
19
|
export * from "./runtimes/index.js";
|
|
17
20
|
export * from "./services/CliProjectService.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const projectInfoResource: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const serverInfoResource: any;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PackageManager } from "@tsed/cli-core";
|
|
2
|
+
import { PlatformType } from "../../interfaces/PlatformType.js";
|
|
3
|
+
import { ProjectConvention } from "../../interfaces/ProjectConvention.js";
|
|
4
|
+
export declare const ProjectPreferenceSchema: import("@tsed/schema").JsonSchema<import("@tsed/schema").PropsToShape<{
|
|
5
|
+
convention: import("@tsed/schema").JsonSchema<ProjectConvention>;
|
|
6
|
+
packageManager: import("@tsed/schema").JsonSchema<PackageManager>;
|
|
7
|
+
runtime: import("@tsed/schema").JsonSchema<"node" | "babel" | "webpack" | "bun" | "swc">;
|
|
8
|
+
platform: import("@tsed/schema").JsonSchema<PlatformType>;
|
|
9
|
+
}> | undefined>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export declare const generateTool: 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
|
+
id: import("@tsed/schema").JsonSchema<string>;
|
|
6
|
+
name: import("@tsed/schema").JsonSchema<string>;
|
|
7
|
+
properties: import("@tsed/schema").JsonSchema<(import("@tsed/schema").PropsToShape<Record<string, import("@tsed/schema").JsonSchema<any>>> & Record<string, unknown>) | undefined>;
|
|
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
|
+
[x: string]: unknown;
|
|
12
|
+
type: "text";
|
|
13
|
+
text: string;
|
|
14
|
+
_meta?: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
} | undefined;
|
|
17
|
+
} | {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
type: "image";
|
|
20
|
+
data: string;
|
|
21
|
+
mimeType: string;
|
|
22
|
+
_meta?: {
|
|
23
|
+
[x: string]: unknown;
|
|
24
|
+
} | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
type: "audio";
|
|
28
|
+
data: string;
|
|
29
|
+
mimeType: string;
|
|
30
|
+
_meta?: {
|
|
31
|
+
[x: string]: unknown;
|
|
32
|
+
} | undefined;
|
|
33
|
+
} | {
|
|
34
|
+
[x: string]: unknown;
|
|
35
|
+
type: "resource_link";
|
|
36
|
+
name: string;
|
|
37
|
+
uri: string;
|
|
38
|
+
_meta?: {
|
|
39
|
+
[x: string]: unknown;
|
|
40
|
+
} | undefined;
|
|
41
|
+
description?: string | undefined;
|
|
42
|
+
mimeType?: string | undefined;
|
|
43
|
+
title?: string | undefined;
|
|
44
|
+
icons?: {
|
|
45
|
+
[x: string]: unknown;
|
|
46
|
+
src: string;
|
|
47
|
+
mimeType?: string | undefined;
|
|
48
|
+
sizes?: string[] | undefined;
|
|
49
|
+
}[] | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
[x: string]: unknown;
|
|
52
|
+
type: "resource";
|
|
53
|
+
resource: {
|
|
54
|
+
[x: string]: unknown;
|
|
55
|
+
text: string;
|
|
56
|
+
uri: string;
|
|
57
|
+
_meta?: {
|
|
58
|
+
[x: string]: unknown;
|
|
59
|
+
} | undefined;
|
|
60
|
+
mimeType?: string | undefined;
|
|
61
|
+
} | {
|
|
62
|
+
[x: string]: unknown;
|
|
63
|
+
uri: string;
|
|
64
|
+
blob: string;
|
|
65
|
+
_meta?: {
|
|
66
|
+
[x: string]: unknown;
|
|
67
|
+
} | undefined;
|
|
68
|
+
mimeType?: string | undefined;
|
|
69
|
+
};
|
|
70
|
+
_meta?: {
|
|
71
|
+
[x: string]: unknown;
|
|
72
|
+
} | undefined;
|
|
73
|
+
})[];
|
|
74
|
+
_meta?: {
|
|
75
|
+
[x: string]: unknown;
|
|
76
|
+
} | undefined;
|
|
77
|
+
structuredContent?: {
|
|
78
|
+
[x: string]: unknown;
|
|
79
|
+
} | undefined;
|
|
80
|
+
isError?: boolean | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
_meta?: Record<string, unknown> | undefined;
|
|
83
|
+
description?: string | undefined;
|
|
84
|
+
title?: string | undefined;
|
|
85
|
+
annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations | undefined;
|
|
86
|
+
token?: import("@tsed/cli-core").TokenProvider;
|
|
87
|
+
name: string;
|
|
88
|
+
}>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare const getTemplateTool: import("@tsed/di").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
|
+
id: import("@tsed/schema").JsonSchema<string>;
|
|
6
|
+
}>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
|
|
7
|
+
[x: string]: unknown;
|
|
8
|
+
content: ({
|
|
9
|
+
[x: string]: unknown;
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
_meta?: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
} | undefined;
|
|
15
|
+
} | {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
type: "image";
|
|
18
|
+
data: string;
|
|
19
|
+
mimeType: string;
|
|
20
|
+
_meta?: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
} | undefined;
|
|
23
|
+
} | {
|
|
24
|
+
[x: string]: unknown;
|
|
25
|
+
type: "audio";
|
|
26
|
+
data: string;
|
|
27
|
+
mimeType: string;
|
|
28
|
+
_meta?: {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
} | undefined;
|
|
31
|
+
} | {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
type: "resource_link";
|
|
34
|
+
name: string;
|
|
35
|
+
uri: string;
|
|
36
|
+
_meta?: {
|
|
37
|
+
[x: string]: unknown;
|
|
38
|
+
} | undefined;
|
|
39
|
+
description?: string | undefined;
|
|
40
|
+
mimeType?: string | undefined;
|
|
41
|
+
title?: string | undefined;
|
|
42
|
+
icons?: {
|
|
43
|
+
[x: string]: unknown;
|
|
44
|
+
src: string;
|
|
45
|
+
mimeType?: string | undefined;
|
|
46
|
+
sizes?: string[] | undefined;
|
|
47
|
+
}[] | undefined;
|
|
48
|
+
} | {
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
type: "resource";
|
|
51
|
+
resource: {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
text: string;
|
|
54
|
+
uri: string;
|
|
55
|
+
_meta?: {
|
|
56
|
+
[x: string]: unknown;
|
|
57
|
+
} | undefined;
|
|
58
|
+
mimeType?: string | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
[x: string]: unknown;
|
|
61
|
+
uri: string;
|
|
62
|
+
blob: string;
|
|
63
|
+
_meta?: {
|
|
64
|
+
[x: string]: unknown;
|
|
65
|
+
} | undefined;
|
|
66
|
+
mimeType?: string | undefined;
|
|
67
|
+
};
|
|
68
|
+
_meta?: {
|
|
69
|
+
[x: string]: unknown;
|
|
70
|
+
} | undefined;
|
|
71
|
+
})[];
|
|
72
|
+
_meta?: {
|
|
73
|
+
[x: string]: unknown;
|
|
74
|
+
} | undefined;
|
|
75
|
+
structuredContent?: {
|
|
76
|
+
[x: string]: unknown;
|
|
77
|
+
} | undefined;
|
|
78
|
+
isError?: boolean | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
_meta?: Record<string, unknown> | undefined;
|
|
81
|
+
description?: string | undefined;
|
|
82
|
+
title?: string | undefined;
|
|
83
|
+
annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations | undefined;
|
|
84
|
+
token?: import("@tsed/di").TokenProvider;
|
|
85
|
+
name: string;
|
|
86
|
+
}>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
export declare const listTemplatesTool: import("@tsed/di").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
|
+
search: import("@tsed/schema").JsonSchema<string>;
|
|
6
|
+
}>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
|
|
7
|
+
[x: string]: unknown;
|
|
8
|
+
content: ({
|
|
9
|
+
[x: string]: unknown;
|
|
10
|
+
type: "text";
|
|
11
|
+
text: string;
|
|
12
|
+
_meta?: {
|
|
13
|
+
[x: string]: unknown;
|
|
14
|
+
} | undefined;
|
|
15
|
+
} | {
|
|
16
|
+
[x: string]: unknown;
|
|
17
|
+
type: "image";
|
|
18
|
+
data: string;
|
|
19
|
+
mimeType: string;
|
|
20
|
+
_meta?: {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
} | undefined;
|
|
23
|
+
} | {
|
|
24
|
+
[x: string]: unknown;
|
|
25
|
+
type: "audio";
|
|
26
|
+
data: string;
|
|
27
|
+
mimeType: string;
|
|
28
|
+
_meta?: {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
} | undefined;
|
|
31
|
+
} | {
|
|
32
|
+
[x: string]: unknown;
|
|
33
|
+
type: "resource_link";
|
|
34
|
+
name: string;
|
|
35
|
+
uri: string;
|
|
36
|
+
_meta?: {
|
|
37
|
+
[x: string]: unknown;
|
|
38
|
+
} | undefined;
|
|
39
|
+
description?: string | undefined;
|
|
40
|
+
mimeType?: string | undefined;
|
|
41
|
+
title?: string | undefined;
|
|
42
|
+
icons?: {
|
|
43
|
+
[x: string]: unknown;
|
|
44
|
+
src: string;
|
|
45
|
+
mimeType?: string | undefined;
|
|
46
|
+
sizes?: string[] | undefined;
|
|
47
|
+
}[] | undefined;
|
|
48
|
+
} | {
|
|
49
|
+
[x: string]: unknown;
|
|
50
|
+
type: "resource";
|
|
51
|
+
resource: {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
text: string;
|
|
54
|
+
uri: string;
|
|
55
|
+
_meta?: {
|
|
56
|
+
[x: string]: unknown;
|
|
57
|
+
} | undefined;
|
|
58
|
+
mimeType?: string | undefined;
|
|
59
|
+
} | {
|
|
60
|
+
[x: string]: unknown;
|
|
61
|
+
uri: string;
|
|
62
|
+
blob: string;
|
|
63
|
+
_meta?: {
|
|
64
|
+
[x: string]: unknown;
|
|
65
|
+
} | undefined;
|
|
66
|
+
mimeType?: string | undefined;
|
|
67
|
+
};
|
|
68
|
+
_meta?: {
|
|
69
|
+
[x: string]: unknown;
|
|
70
|
+
} | undefined;
|
|
71
|
+
})[];
|
|
72
|
+
_meta?: {
|
|
73
|
+
[x: string]: unknown;
|
|
74
|
+
} | undefined;
|
|
75
|
+
structuredContent?: {
|
|
76
|
+
[x: string]: unknown;
|
|
77
|
+
} | undefined;
|
|
78
|
+
isError?: boolean | undefined;
|
|
79
|
+
}>;
|
|
80
|
+
_meta?: Record<string, unknown> | undefined;
|
|
81
|
+
description?: string | undefined;
|
|
82
|
+
title?: string | undefined;
|
|
83
|
+
annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations | undefined;
|
|
84
|
+
token?: import("@tsed/di").TokenProvider;
|
|
85
|
+
name: string;
|
|
86
|
+
}>;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simplified behavior per MVP:
|
|
3
|
+
* - If the provided cwd exists: set it, resolve the nearest package.json root via ProjectPackageJson, return that resolved cwd.
|
|
4
|
+
* - If the provided cwd does not exist: do not create anything; return an error suggesting to confirm creation and run init-project.
|
|
5
|
+
*/
|
|
6
|
+
export declare const setWorkspaceTool: import("@tsed/cli-core").FactoryTokenProvider<{
|
|
7
|
+
inputSchema: Record<string, import("zod").AnyZodObject> | undefined;
|
|
8
|
+
outputSchema: Record<string, import("zod").AnyZodObject> | undefined;
|
|
9
|
+
handler(args: import("@tsed/schema").PropsToShape<{
|
|
10
|
+
cwd: import("@tsed/schema").JsonSchema<string>;
|
|
11
|
+
}>, extra: import("@modelcontextprotocol/sdk/shared/protocol.js").RequestHandlerExtra<import("@modelcontextprotocol/sdk/types.js").ServerRequest, import("@modelcontextprotocol/sdk/types.js").ServerNotification>): Promise<{
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
content: ({
|
|
14
|
+
[x: string]: unknown;
|
|
15
|
+
type: "text";
|
|
16
|
+
text: string;
|
|
17
|
+
_meta?: {
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
} | undefined;
|
|
20
|
+
} | {
|
|
21
|
+
[x: string]: unknown;
|
|
22
|
+
type: "image";
|
|
23
|
+
data: string;
|
|
24
|
+
mimeType: string;
|
|
25
|
+
_meta?: {
|
|
26
|
+
[x: string]: unknown;
|
|
27
|
+
} | undefined;
|
|
28
|
+
} | {
|
|
29
|
+
[x: string]: unknown;
|
|
30
|
+
type: "audio";
|
|
31
|
+
data: string;
|
|
32
|
+
mimeType: string;
|
|
33
|
+
_meta?: {
|
|
34
|
+
[x: string]: unknown;
|
|
35
|
+
} | undefined;
|
|
36
|
+
} | {
|
|
37
|
+
[x: string]: unknown;
|
|
38
|
+
type: "resource_link";
|
|
39
|
+
name: string;
|
|
40
|
+
uri: string;
|
|
41
|
+
_meta?: {
|
|
42
|
+
[x: string]: unknown;
|
|
43
|
+
} | undefined;
|
|
44
|
+
description?: string | undefined;
|
|
45
|
+
mimeType?: string | undefined;
|
|
46
|
+
title?: string | undefined;
|
|
47
|
+
icons?: {
|
|
48
|
+
[x: string]: unknown;
|
|
49
|
+
src: string;
|
|
50
|
+
mimeType?: string | undefined;
|
|
51
|
+
sizes?: string[] | undefined;
|
|
52
|
+
}[] | undefined;
|
|
53
|
+
} | {
|
|
54
|
+
[x: string]: unknown;
|
|
55
|
+
type: "resource";
|
|
56
|
+
resource: {
|
|
57
|
+
[x: string]: unknown;
|
|
58
|
+
text: string;
|
|
59
|
+
uri: string;
|
|
60
|
+
_meta?: {
|
|
61
|
+
[x: string]: unknown;
|
|
62
|
+
} | undefined;
|
|
63
|
+
mimeType?: string | undefined;
|
|
64
|
+
} | {
|
|
65
|
+
[x: string]: unknown;
|
|
66
|
+
uri: string;
|
|
67
|
+
blob: string;
|
|
68
|
+
_meta?: {
|
|
69
|
+
[x: string]: unknown;
|
|
70
|
+
} | undefined;
|
|
71
|
+
mimeType?: string | undefined;
|
|
72
|
+
};
|
|
73
|
+
_meta?: {
|
|
74
|
+
[x: string]: unknown;
|
|
75
|
+
} | undefined;
|
|
76
|
+
})[];
|
|
77
|
+
_meta?: {
|
|
78
|
+
[x: string]: unknown;
|
|
79
|
+
} | undefined;
|
|
80
|
+
structuredContent?: {
|
|
81
|
+
[x: string]: unknown;
|
|
82
|
+
} | undefined;
|
|
83
|
+
isError?: boolean | undefined;
|
|
84
|
+
}>;
|
|
85
|
+
_meta?: Record<string, unknown> | undefined;
|
|
86
|
+
description?: string | undefined;
|
|
87
|
+
title?: string | undefined;
|
|
88
|
+
annotations?: import("@modelcontextprotocol/sdk/types.js").ToolAnnotations | undefined;
|
|
89
|
+
token?: import("@tsed/cli-core").TokenProvider;
|
|
90
|
+
name: string;
|
|
91
|
+
}>;
|
|
@@ -4,7 +4,7 @@ import { CliTemplatesService, type TemplateRenderOptions, type TemplateRenderRet
|
|
|
4
4
|
export declare class CliProjectService {
|
|
5
5
|
readonly templates: CliTemplatesService;
|
|
6
6
|
private project;
|
|
7
|
-
|
|
7
|
+
get rootDir(): string;
|
|
8
8
|
get srcDir(): string;
|
|
9
9
|
getRelativePath(path: string): string;
|
|
10
10
|
getServerFileName(): "server" | "Server";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CliHttpClient, ProjectPackageJson } from "@tsed/cli-core";
|
|
2
|
+
declare global {
|
|
3
|
+
namespace TsED {
|
|
4
|
+
interface Configuration {
|
|
5
|
+
stats?: {
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
url?: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
type InitStatPayload = {
|
|
13
|
+
tsed_version: string;
|
|
14
|
+
platform: string;
|
|
15
|
+
convention: string;
|
|
16
|
+
package_manager: string;
|
|
17
|
+
runtime: string;
|
|
18
|
+
features: string[];
|
|
19
|
+
channel: string;
|
|
20
|
+
cli_version: string;
|
|
21
|
+
os: string;
|
|
22
|
+
is_success: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare class CliStats extends CliHttpClient {
|
|
25
|
+
protected disabled: boolean;
|
|
26
|
+
protected host: string;
|
|
27
|
+
protected projectPackage: ProjectPackageJson;
|
|
28
|
+
sendInit(opts: Partial<InitStatPayload>): Promise<unknown> | undefined;
|
|
29
|
+
$onFinish(data: {
|
|
30
|
+
commandName?: string;
|
|
31
|
+
features?: string[];
|
|
32
|
+
}, er?: Error): Promise<unknown> | undefined;
|
|
33
|
+
protected onSuccess(options: Record<string, unknown>): void;
|
|
34
|
+
protected onError(error: any, options: any): void;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { CliFs } from "@tsed/cli-core";
|
|
2
2
|
import type { SourceFile } from "ts-morph";
|
|
3
3
|
import type { RenderDataContext } from "../interfaces/index.js";
|
|
4
|
+
import type { DefineTemplateOptions } from "../utils/defineTemplate.js";
|
|
4
5
|
export type TemplateRenderOptions = {
|
|
5
6
|
name?: string;
|
|
6
7
|
symbolName?: string;
|
|
@@ -20,16 +21,16 @@ export type TemplateRenderReturnType = {
|
|
|
20
21
|
};
|
|
21
22
|
export declare class CliTemplatesService {
|
|
22
23
|
#private;
|
|
23
|
-
readonly rootDir: string;
|
|
24
24
|
readonly fs: CliFs;
|
|
25
|
-
|
|
25
|
+
get rootDir(): string;
|
|
26
26
|
get srcDir(): string;
|
|
27
27
|
get templatesDir(): string;
|
|
28
28
|
$onInit(): Promise<void>;
|
|
29
29
|
loadTemplates(): Promise<void>;
|
|
30
|
-
getAll():
|
|
31
|
-
find(id?: string):
|
|
32
|
-
get(id: string):
|
|
30
|
+
getAll(): DefineTemplateOptions[];
|
|
31
|
+
find(id?: string): DefineTemplateOptions[];
|
|
32
|
+
get(id: string): DefineTemplateOptions | undefined;
|
|
33
33
|
render(templateId: string, data: TemplateRenderOptions): Promise<TemplateRenderReturnType | undefined>;
|
|
34
|
+
getRenderedFiles(): TemplateRenderReturnType[];
|
|
34
35
|
protected pushRenderResult(renderedFile: TemplateRenderReturnType): TemplateRenderReturnType;
|
|
35
36
|
}
|
|
@@ -9,6 +9,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
9
9
|
hidden?: boolean;
|
|
10
10
|
preserveCase?: boolean;
|
|
11
11
|
preserveDirectory?: boolean;
|
|
12
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
12
13
|
render(symbolName: string, data: import("../index.js").GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
13
14
|
prompts?(data: import("../index.js").GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[]>;
|
|
14
15
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -9,6 +9,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
9
9
|
hidden?: boolean;
|
|
10
10
|
preserveCase?: boolean;
|
|
11
11
|
preserveDirectory?: boolean;
|
|
12
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
12
13
|
render(symbolName: string, data: import("../index.js").GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
13
14
|
prompts?(data: import("../index.js").GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[]>;
|
|
14
15
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -9,6 +9,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
9
9
|
hidden?: boolean;
|
|
10
10
|
preserveCase?: boolean;
|
|
11
11
|
preserveDirectory?: boolean;
|
|
12
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
12
13
|
render(symbolName: string, data: import("../index.js").GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
13
14
|
prompts?(data: import("../index.js").GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[]>;
|
|
14
15
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -9,6 +9,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
9
9
|
hidden?: boolean;
|
|
10
10
|
preserveCase?: boolean;
|
|
11
11
|
preserveDirectory?: boolean;
|
|
12
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
12
13
|
render(symbolName: string, data: import("../index.js").GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
13
14
|
prompts?(data: import("../index.js").GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[]>;
|
|
14
15
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -10,6 +10,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
10
10
|
hidden?: boolean;
|
|
11
11
|
preserveCase?: boolean;
|
|
12
12
|
preserveDirectory?: boolean;
|
|
13
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
13
14
|
render(symbolName: string, data: GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
14
15
|
prompts?(data: GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<GenerateCmdContext>[]>;
|
|
15
16
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -10,6 +10,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
10
10
|
hidden?: boolean;
|
|
11
11
|
preserveCase?: boolean;
|
|
12
12
|
preserveDirectory?: boolean;
|
|
13
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
13
14
|
render(symbolName: string, data: GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
14
15
|
prompts?(data: GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<GenerateCmdContext>[]>;
|
|
15
16
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -9,6 +9,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
9
9
|
hidden?: boolean;
|
|
10
10
|
preserveCase?: boolean;
|
|
11
11
|
preserveDirectory?: boolean;
|
|
12
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
12
13
|
render(symbolName: string, data: import("../index.js").GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
13
14
|
prompts?(data: import("../index.js").GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[]>;
|
|
14
15
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -9,6 +9,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
9
9
|
hidden?: boolean;
|
|
10
10
|
preserveCase?: boolean;
|
|
11
11
|
preserveDirectory?: boolean;
|
|
12
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
12
13
|
render(symbolName: string, data: import("../index.js").GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
13
14
|
prompts?(data: import("../index.js").GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[]>;
|
|
14
15
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -9,6 +9,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
9
9
|
hidden?: boolean;
|
|
10
10
|
preserveCase?: boolean;
|
|
11
11
|
preserveDirectory?: boolean;
|
|
12
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
12
13
|
render(symbolName: string, data: import("../index.js").GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
13
14
|
prompts?(data: import("../index.js").GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[]>;
|
|
14
15
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|
|
@@ -9,6 +9,7 @@ declare const _default: import("@tsed/di").FactoryTokenProvider<{
|
|
|
9
9
|
hidden?: boolean;
|
|
10
10
|
preserveCase?: boolean;
|
|
11
11
|
preserveDirectory?: boolean;
|
|
12
|
+
schema?: import("@tsed/schema").JsonSchema;
|
|
12
13
|
render(symbolName: string, data: import("../index.js").GenerateCmdContext): Promise<string | undefined | import("../index.js").TemplateRenderReturnType> | string | undefined | import("../index.js").TemplateRenderReturnType;
|
|
13
14
|
prompts?(data: import("../index.js").GenerateCmdContext): import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[] | Promise<import("@tsed/cli-core").QuestionOptions<import("../index.js").GenerateCmdContext>[]>;
|
|
14
15
|
hooks?: import("@tsed/di").ProviderOpts["hooks"];
|