@paretools/cargo 0.2.0 → 0.5.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/README.md +85 -0
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/lib/cargo-runner.d.ts.map +1 -1
- package/dist/lib/cargo-runner.js +2 -1
- package/dist/lib/cargo-runner.js.map +1 -1
- package/dist/lib/formatters.d.ts +14 -1
- package/dist/lib/formatters.d.ts.map +1 -1
- package/dist/lib/formatters.js +55 -0
- package/dist/lib/formatters.js.map +1 -1
- package/dist/lib/parsers.d.ts +29 -1
- package/dist/lib/parsers.d.ts.map +1 -1
- package/dist/lib/parsers.js +112 -0
- package/dist/lib/parsers.js.map +1 -1
- package/dist/schemas/index.d.ts +84 -143
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +40 -3
- package/dist/schemas/index.js.map +1 -1
- package/dist/tools/add.d.ts +3 -0
- package/dist/tools/add.d.ts.map +1 -0
- package/dist/tools/add.js +37 -0
- package/dist/tools/add.js.map +1 -0
- package/dist/tools/build.js +1 -1
- package/dist/tools/build.js.map +1 -1
- package/dist/tools/check.d.ts +3 -0
- package/dist/tools/check.d.ts.map +1 -0
- package/dist/tools/check.js +26 -0
- package/dist/tools/check.js.map +1 -0
- package/dist/tools/clippy.d.ts.map +1 -1
- package/dist/tools/clippy.js +1 -1
- package/dist/tools/clippy.js.map +1 -1
- package/dist/tools/doc.d.ts +3 -0
- package/dist/tools/doc.d.ts.map +1 -0
- package/dist/tools/doc.js +37 -0
- package/dist/tools/doc.js.map +1 -0
- package/dist/tools/fmt.d.ts +3 -0
- package/dist/tools/fmt.d.ts.map +1 -0
- package/dist/tools/fmt.js +30 -0
- package/dist/tools/fmt.js.map +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +12 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/remove.d.ts +3 -0
- package/dist/tools/remove.d.ts.map +1 -0
- package/dist/tools/remove.js +30 -0
- package/dist/tools/remove.js.map +1 -0
- package/dist/tools/run.d.ts +3 -0
- package/dist/tools/run.d.ts.map +1 -0
- package/dist/tools/run.js +34 -0
- package/dist/tools/run.js.map +1 -0
- package/dist/tools/test.js +1 -1
- package/dist/tools/test.js.map +1 -1
- package/package.json +30 -6
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,187 +1,128 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
/** Zod schema for a single Rust compiler diagnostic with file location, severity, and optional lint code. */
|
|
2
3
|
export declare const CargoDiagnosticSchema: z.ZodObject<{
|
|
3
4
|
file: z.ZodString;
|
|
4
5
|
line: z.ZodNumber;
|
|
5
6
|
column: z.ZodNumber;
|
|
6
|
-
severity: z.ZodEnum<
|
|
7
|
+
severity: z.ZodEnum<{
|
|
8
|
+
error: "error";
|
|
9
|
+
warning: "warning";
|
|
10
|
+
note: "note";
|
|
11
|
+
help: "help";
|
|
12
|
+
}>;
|
|
7
13
|
code: z.ZodOptional<z.ZodString>;
|
|
8
14
|
message: z.ZodString;
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
line: number;
|
|
12
|
-
column: number;
|
|
13
|
-
severity: "error" | "warning" | "note" | "help";
|
|
14
|
-
message: string;
|
|
15
|
-
code?: string | undefined;
|
|
16
|
-
}, {
|
|
17
|
-
file: string;
|
|
18
|
-
line: number;
|
|
19
|
-
column: number;
|
|
20
|
-
severity: "error" | "warning" | "note" | "help";
|
|
21
|
-
message: string;
|
|
22
|
-
code?: string | undefined;
|
|
23
|
-
}>;
|
|
15
|
+
}, z.core.$strip>;
|
|
16
|
+
/** Zod schema for structured cargo build output including success status, diagnostics, and error/warning counts. */
|
|
24
17
|
export declare const CargoBuildResultSchema: z.ZodObject<{
|
|
25
18
|
success: z.ZodBoolean;
|
|
26
19
|
diagnostics: z.ZodArray<z.ZodObject<{
|
|
27
20
|
file: z.ZodString;
|
|
28
21
|
line: z.ZodNumber;
|
|
29
22
|
column: z.ZodNumber;
|
|
30
|
-
severity: z.ZodEnum<
|
|
23
|
+
severity: z.ZodEnum<{
|
|
24
|
+
error: "error";
|
|
25
|
+
warning: "warning";
|
|
26
|
+
note: "note";
|
|
27
|
+
help: "help";
|
|
28
|
+
}>;
|
|
31
29
|
code: z.ZodOptional<z.ZodString>;
|
|
32
30
|
message: z.ZodString;
|
|
33
|
-
},
|
|
34
|
-
file: string;
|
|
35
|
-
line: number;
|
|
36
|
-
column: number;
|
|
37
|
-
severity: "error" | "warning" | "note" | "help";
|
|
38
|
-
message: string;
|
|
39
|
-
code?: string | undefined;
|
|
40
|
-
}, {
|
|
41
|
-
file: string;
|
|
42
|
-
line: number;
|
|
43
|
-
column: number;
|
|
44
|
-
severity: "error" | "warning" | "note" | "help";
|
|
45
|
-
message: string;
|
|
46
|
-
code?: string | undefined;
|
|
47
|
-
}>, "many">;
|
|
31
|
+
}, z.core.$strip>>;
|
|
48
32
|
total: z.ZodNumber;
|
|
49
33
|
errors: z.ZodNumber;
|
|
50
34
|
warnings: z.ZodNumber;
|
|
51
|
-
},
|
|
52
|
-
success: boolean;
|
|
53
|
-
diagnostics: {
|
|
54
|
-
file: string;
|
|
55
|
-
line: number;
|
|
56
|
-
column: number;
|
|
57
|
-
severity: "error" | "warning" | "note" | "help";
|
|
58
|
-
message: string;
|
|
59
|
-
code?: string | undefined;
|
|
60
|
-
}[];
|
|
61
|
-
total: number;
|
|
62
|
-
errors: number;
|
|
63
|
-
warnings: number;
|
|
64
|
-
}, {
|
|
65
|
-
success: boolean;
|
|
66
|
-
diagnostics: {
|
|
67
|
-
file: string;
|
|
68
|
-
line: number;
|
|
69
|
-
column: number;
|
|
70
|
-
severity: "error" | "warning" | "note" | "help";
|
|
71
|
-
message: string;
|
|
72
|
-
code?: string | undefined;
|
|
73
|
-
}[];
|
|
74
|
-
total: number;
|
|
75
|
-
errors: number;
|
|
76
|
-
warnings: number;
|
|
77
|
-
}>;
|
|
35
|
+
}, z.core.$strip>;
|
|
78
36
|
export type CargoBuildResult = z.infer<typeof CargoBuildResultSchema>;
|
|
37
|
+
/** Zod schema for a single cargo test case with name, status (ok/FAILED/ignored), and optional duration. */
|
|
79
38
|
export declare const CargoTestCaseSchema: z.ZodObject<{
|
|
80
39
|
name: z.ZodString;
|
|
81
|
-
status: z.ZodEnum<
|
|
40
|
+
status: z.ZodEnum<{
|
|
41
|
+
ok: "ok";
|
|
42
|
+
FAILED: "FAILED";
|
|
43
|
+
ignored: "ignored";
|
|
44
|
+
}>;
|
|
82
45
|
duration: z.ZodOptional<z.ZodString>;
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
name: string;
|
|
86
|
-
duration?: string | undefined;
|
|
87
|
-
}, {
|
|
88
|
-
status: "ok" | "FAILED" | "ignored";
|
|
89
|
-
name: string;
|
|
90
|
-
duration?: string | undefined;
|
|
91
|
-
}>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
/** Zod schema for structured cargo test output with test list, pass/fail/ignored counts. */
|
|
92
48
|
export declare const CargoTestResultSchema: z.ZodObject<{
|
|
93
49
|
success: z.ZodBoolean;
|
|
94
50
|
tests: z.ZodArray<z.ZodObject<{
|
|
95
51
|
name: z.ZodString;
|
|
96
|
-
status: z.ZodEnum<
|
|
52
|
+
status: z.ZodEnum<{
|
|
53
|
+
ok: "ok";
|
|
54
|
+
FAILED: "FAILED";
|
|
55
|
+
ignored: "ignored";
|
|
56
|
+
}>;
|
|
97
57
|
duration: z.ZodOptional<z.ZodString>;
|
|
98
|
-
},
|
|
99
|
-
status: "ok" | "FAILED" | "ignored";
|
|
100
|
-
name: string;
|
|
101
|
-
duration?: string | undefined;
|
|
102
|
-
}, {
|
|
103
|
-
status: "ok" | "FAILED" | "ignored";
|
|
104
|
-
name: string;
|
|
105
|
-
duration?: string | undefined;
|
|
106
|
-
}>, "many">;
|
|
58
|
+
}, z.core.$strip>>;
|
|
107
59
|
total: z.ZodNumber;
|
|
108
60
|
passed: z.ZodNumber;
|
|
109
61
|
failed: z.ZodNumber;
|
|
110
62
|
ignored: z.ZodNumber;
|
|
111
|
-
},
|
|
112
|
-
success: boolean;
|
|
113
|
-
total: number;
|
|
114
|
-
ignored: number;
|
|
115
|
-
tests: {
|
|
116
|
-
status: "ok" | "FAILED" | "ignored";
|
|
117
|
-
name: string;
|
|
118
|
-
duration?: string | undefined;
|
|
119
|
-
}[];
|
|
120
|
-
passed: number;
|
|
121
|
-
failed: number;
|
|
122
|
-
}, {
|
|
123
|
-
success: boolean;
|
|
124
|
-
total: number;
|
|
125
|
-
ignored: number;
|
|
126
|
-
tests: {
|
|
127
|
-
status: "ok" | "FAILED" | "ignored";
|
|
128
|
-
name: string;
|
|
129
|
-
duration?: string | undefined;
|
|
130
|
-
}[];
|
|
131
|
-
passed: number;
|
|
132
|
-
failed: number;
|
|
133
|
-
}>;
|
|
63
|
+
}, z.core.$strip>;
|
|
134
64
|
export type CargoTestResult = z.infer<typeof CargoTestResultSchema>;
|
|
65
|
+
/** Zod schema for structured cargo clippy output with diagnostics and error/warning counts. */
|
|
135
66
|
export declare const CargoClippyResultSchema: z.ZodObject<{
|
|
136
67
|
diagnostics: z.ZodArray<z.ZodObject<{
|
|
137
68
|
file: z.ZodString;
|
|
138
69
|
line: z.ZodNumber;
|
|
139
70
|
column: z.ZodNumber;
|
|
140
|
-
severity: z.ZodEnum<
|
|
71
|
+
severity: z.ZodEnum<{
|
|
72
|
+
error: "error";
|
|
73
|
+
warning: "warning";
|
|
74
|
+
note: "note";
|
|
75
|
+
help: "help";
|
|
76
|
+
}>;
|
|
141
77
|
code: z.ZodOptional<z.ZodString>;
|
|
142
78
|
message: z.ZodString;
|
|
143
|
-
},
|
|
144
|
-
file: string;
|
|
145
|
-
line: number;
|
|
146
|
-
column: number;
|
|
147
|
-
severity: "error" | "warning" | "note" | "help";
|
|
148
|
-
message: string;
|
|
149
|
-
code?: string | undefined;
|
|
150
|
-
}, {
|
|
151
|
-
file: string;
|
|
152
|
-
line: number;
|
|
153
|
-
column: number;
|
|
154
|
-
severity: "error" | "warning" | "note" | "help";
|
|
155
|
-
message: string;
|
|
156
|
-
code?: string | undefined;
|
|
157
|
-
}>, "many">;
|
|
79
|
+
}, z.core.$strip>>;
|
|
158
80
|
total: z.ZodNumber;
|
|
159
81
|
errors: z.ZodNumber;
|
|
160
82
|
warnings: z.ZodNumber;
|
|
161
|
-
},
|
|
162
|
-
diagnostics: {
|
|
163
|
-
file: string;
|
|
164
|
-
line: number;
|
|
165
|
-
column: number;
|
|
166
|
-
severity: "error" | "warning" | "note" | "help";
|
|
167
|
-
message: string;
|
|
168
|
-
code?: string | undefined;
|
|
169
|
-
}[];
|
|
170
|
-
total: number;
|
|
171
|
-
errors: number;
|
|
172
|
-
warnings: number;
|
|
173
|
-
}, {
|
|
174
|
-
diagnostics: {
|
|
175
|
-
file: string;
|
|
176
|
-
line: number;
|
|
177
|
-
column: number;
|
|
178
|
-
severity: "error" | "warning" | "note" | "help";
|
|
179
|
-
message: string;
|
|
180
|
-
code?: string | undefined;
|
|
181
|
-
}[];
|
|
182
|
-
total: number;
|
|
183
|
-
errors: number;
|
|
184
|
-
warnings: number;
|
|
185
|
-
}>;
|
|
83
|
+
}, z.core.$strip>;
|
|
186
84
|
export type CargoClippyResult = z.infer<typeof CargoClippyResultSchema>;
|
|
85
|
+
/** Zod schema for structured cargo run output with exit code, stdout, stderr, and success flag. */
|
|
86
|
+
export declare const CargoRunResultSchema: z.ZodObject<{
|
|
87
|
+
exitCode: z.ZodNumber;
|
|
88
|
+
stdout: z.ZodString;
|
|
89
|
+
stderr: z.ZodString;
|
|
90
|
+
success: z.ZodBoolean;
|
|
91
|
+
}, z.core.$strip>;
|
|
92
|
+
export type CargoRunResult = z.infer<typeof CargoRunResultSchema>;
|
|
93
|
+
/** Zod schema for a single added dependency entry. */
|
|
94
|
+
export declare const CargoAddedPackageSchema: z.ZodObject<{
|
|
95
|
+
name: z.ZodString;
|
|
96
|
+
version: z.ZodString;
|
|
97
|
+
}, z.core.$strip>;
|
|
98
|
+
/** Zod schema for structured cargo add output with added packages list. */
|
|
99
|
+
export declare const CargoAddResultSchema: z.ZodObject<{
|
|
100
|
+
success: z.ZodBoolean;
|
|
101
|
+
added: z.ZodArray<z.ZodObject<{
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
version: z.ZodString;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
total: z.ZodNumber;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export type CargoAddResult = z.infer<typeof CargoAddResultSchema>;
|
|
108
|
+
/** Zod schema for structured cargo remove output with removed package names. */
|
|
109
|
+
export declare const CargoRemoveResultSchema: z.ZodObject<{
|
|
110
|
+
success: z.ZodBoolean;
|
|
111
|
+
removed: z.ZodArray<z.ZodString>;
|
|
112
|
+
total: z.ZodNumber;
|
|
113
|
+
}, z.core.$strip>;
|
|
114
|
+
export type CargoRemoveResult = z.infer<typeof CargoRemoveResultSchema>;
|
|
115
|
+
/** Zod schema for structured cargo fmt output with changed files list. */
|
|
116
|
+
export declare const CargoFmtResultSchema: z.ZodObject<{
|
|
117
|
+
success: z.ZodBoolean;
|
|
118
|
+
filesChanged: z.ZodNumber;
|
|
119
|
+
files: z.ZodArray<z.ZodString>;
|
|
120
|
+
}, z.core.$strip>;
|
|
121
|
+
export type CargoFmtResult = z.infer<typeof CargoFmtResultSchema>;
|
|
122
|
+
/** Zod schema for structured cargo doc output with success flag and warning count. */
|
|
123
|
+
export declare const CargoDocResultSchema: z.ZodObject<{
|
|
124
|
+
success: z.ZodBoolean;
|
|
125
|
+
warnings: z.ZodNumber;
|
|
126
|
+
}, z.core.$strip>;
|
|
127
|
+
export type CargoDocResult = z.infer<typeof CargoDocResultSchema>;
|
|
187
128
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,E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CAAC,CAAC;AAExE,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,sFAAsF;AACtF,eAAO,MAAM,oBAAoB;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
/** Zod schema for a single Rust compiler diagnostic with file location, severity, and optional lint code. */
|
|
3
3
|
export const CargoDiagnosticSchema = z.object({
|
|
4
4
|
file: z.string(),
|
|
5
5
|
line: z.number(),
|
|
@@ -8,6 +8,7 @@ export const CargoDiagnosticSchema = z.object({
|
|
|
8
8
|
code: z.string().optional(),
|
|
9
9
|
message: z.string(),
|
|
10
10
|
});
|
|
11
|
+
/** Zod schema for structured cargo build output including success status, diagnostics, and error/warning counts. */
|
|
11
12
|
export const CargoBuildResultSchema = z.object({
|
|
12
13
|
success: z.boolean(),
|
|
13
14
|
diagnostics: z.array(CargoDiagnosticSchema),
|
|
@@ -15,12 +16,13 @@ export const CargoBuildResultSchema = z.object({
|
|
|
15
16
|
errors: z.number(),
|
|
16
17
|
warnings: z.number(),
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
+
/** Zod schema for a single cargo test case with name, status (ok/FAILED/ignored), and optional duration. */
|
|
19
20
|
export const CargoTestCaseSchema = z.object({
|
|
20
21
|
name: z.string(),
|
|
21
22
|
status: z.enum(["ok", "FAILED", "ignored"]),
|
|
22
23
|
duration: z.string().optional(),
|
|
23
24
|
});
|
|
25
|
+
/** Zod schema for structured cargo test output with test list, pass/fail/ignored counts. */
|
|
24
26
|
export const CargoTestResultSchema = z.object({
|
|
25
27
|
success: z.boolean(),
|
|
26
28
|
tests: z.array(CargoTestCaseSchema),
|
|
@@ -29,11 +31,46 @@ export const CargoTestResultSchema = z.object({
|
|
|
29
31
|
failed: z.number(),
|
|
30
32
|
ignored: z.number(),
|
|
31
33
|
});
|
|
32
|
-
|
|
34
|
+
/** Zod schema for structured cargo clippy output with diagnostics and error/warning counts. */
|
|
33
35
|
export const CargoClippyResultSchema = z.object({
|
|
34
36
|
diagnostics: z.array(CargoDiagnosticSchema),
|
|
35
37
|
total: z.number(),
|
|
36
38
|
errors: z.number(),
|
|
37
39
|
warnings: z.number(),
|
|
38
40
|
});
|
|
41
|
+
/** Zod schema for structured cargo run output with exit code, stdout, stderr, and success flag. */
|
|
42
|
+
export const CargoRunResultSchema = z.object({
|
|
43
|
+
exitCode: z.number(),
|
|
44
|
+
stdout: z.string(),
|
|
45
|
+
stderr: z.string(),
|
|
46
|
+
success: z.boolean(),
|
|
47
|
+
});
|
|
48
|
+
/** Zod schema for a single added dependency entry. */
|
|
49
|
+
export const CargoAddedPackageSchema = z.object({
|
|
50
|
+
name: z.string(),
|
|
51
|
+
version: z.string(),
|
|
52
|
+
});
|
|
53
|
+
/** Zod schema for structured cargo add output with added packages list. */
|
|
54
|
+
export const CargoAddResultSchema = z.object({
|
|
55
|
+
success: z.boolean(),
|
|
56
|
+
added: z.array(CargoAddedPackageSchema),
|
|
57
|
+
total: z.number(),
|
|
58
|
+
});
|
|
59
|
+
/** Zod schema for structured cargo remove output with removed package names. */
|
|
60
|
+
export const CargoRemoveResultSchema = z.object({
|
|
61
|
+
success: z.boolean(),
|
|
62
|
+
removed: z.array(z.string()),
|
|
63
|
+
total: z.number(),
|
|
64
|
+
});
|
|
65
|
+
/** Zod schema for structured cargo fmt output with changed files list. */
|
|
66
|
+
export const CargoFmtResultSchema = z.object({
|
|
67
|
+
success: z.boolean(),
|
|
68
|
+
filesChanged: z.number(),
|
|
69
|
+
files: z.array(z.string()),
|
|
70
|
+
});
|
|
71
|
+
/** Zod schema for structured cargo doc output with success flag and warning count. */
|
|
72
|
+
export const CargoDocResultSchema = z.object({
|
|
73
|
+
success: z.boolean(),
|
|
74
|
+
warnings: z.number(),
|
|
75
|
+
});
|
|
39
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6GAA6G;AAC7G,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAEH,oHAAoH;AACpH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAIH,4GAA4G;AAC5G,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IA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 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { dualOutput, assertNoFlagInjection } from "@paretools/shared";
|
|
3
|
+
import { cargo } from "../lib/cargo-runner.js";
|
|
4
|
+
import { parseCargoAddOutput } from "../lib/parsers.js";
|
|
5
|
+
import { formatCargoAdd } from "../lib/formatters.js";
|
|
6
|
+
import { CargoAddResultSchema } from "../schemas/index.js";
|
|
7
|
+
export function registerAddTool(server) {
|
|
8
|
+
server.registerTool("add", {
|
|
9
|
+
title: "Cargo Add",
|
|
10
|
+
description: "Adds dependencies to a Rust project and returns structured output. Use instead of running `cargo add` in the terminal.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
path: z.string().optional().describe("Project root path (default: cwd)"),
|
|
13
|
+
packages: z.array(z.string()).describe('Packages to add (e.g. ["serde", "tokio@1.0"])'),
|
|
14
|
+
dev: z.boolean().optional().default(false).describe("Add as dev dependency (--dev)"),
|
|
15
|
+
features: z
|
|
16
|
+
.array(z.string())
|
|
17
|
+
.optional()
|
|
18
|
+
.describe('Features to enable (e.g. ["derive", "full"])'),
|
|
19
|
+
},
|
|
20
|
+
outputSchema: CargoAddResultSchema,
|
|
21
|
+
}, async ({ path, packages, dev, features }) => {
|
|
22
|
+
const cwd = path || process.cwd();
|
|
23
|
+
for (const pkg of packages) {
|
|
24
|
+
assertNoFlagInjection(pkg, "packages");
|
|
25
|
+
}
|
|
26
|
+
const args = ["add", ...packages];
|
|
27
|
+
if (dev)
|
|
28
|
+
args.push("--dev");
|
|
29
|
+
if (features && features.length > 0) {
|
|
30
|
+
args.push("--features", features.join(","));
|
|
31
|
+
}
|
|
32
|
+
const result = await cargo(args, cwd);
|
|
33
|
+
const data = parseCargoAddOutput(result.stdout, result.stderr, result.exitCode);
|
|
34
|
+
return dualOutput(data, formatCargoAdd);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=add.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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AC,GAAG,EAAE,UAAU,CAAC,CAAC;QACzC,CAAC;QAED,MAAM,IAAI,GAAG,CAAC,KAAK,EAAE,GAAG,QAAQ,CAAC,CAAC;QAClC,IAAI,GAAG;YAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAChF,OAAO,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC1C,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/build.js
CHANGED
|
@@ -7,7 +7,7 @@ import { CargoBuildResultSchema } from "../schemas/index.js";
|
|
|
7
7
|
export function registerBuildTool(server) {
|
|
8
8
|
server.registerTool("build", {
|
|
9
9
|
title: "Cargo Build",
|
|
10
|
-
description: "Runs cargo build and returns structured diagnostics (file, line, code, severity, message)",
|
|
10
|
+
description: "Runs cargo build and returns structured diagnostics (file, line, code, severity, message). Use instead of running `cargo build` in the terminal.",
|
|
11
11
|
inputSchema: {
|
|
12
12
|
path: z.string().optional().describe("Project root path (default: cwd)"),
|
|
13
13
|
release: z.boolean().optional().default(false).describe("Build in release mode"),
|
package/dist/tools/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/tools/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM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AAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;QAChD,IAAI,OAAO;YAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEpC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,UAAU,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAC5C,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/tools/check.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,QAuBlD"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { dualOutput } from "@paretools/shared";
|
|
3
|
+
import { cargo } from "../lib/cargo-runner.js";
|
|
4
|
+
import { parseCargoBuildJson } from "../lib/parsers.js";
|
|
5
|
+
import { formatCargoBuild } from "../lib/formatters.js";
|
|
6
|
+
import { CargoBuildResultSchema } from "../schemas/index.js";
|
|
7
|
+
export function registerCheckTool(server) {
|
|
8
|
+
server.registerTool("check", {
|
|
9
|
+
title: "Cargo Check",
|
|
10
|
+
description: "Runs cargo check (type check without full build) and returns structured diagnostics. Faster than build for error checking. Use instead of running `cargo check` in the terminal.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
path: z.string().optional().describe("Project root path (default: cwd)"),
|
|
13
|
+
package: z.string().optional().describe("Package to check in a workspace"),
|
|
14
|
+
},
|
|
15
|
+
outputSchema: CargoBuildResultSchema,
|
|
16
|
+
}, async ({ path, package: pkg }) => {
|
|
17
|
+
const cwd = path || process.cwd();
|
|
18
|
+
const args = ["check", "--message-format=json"];
|
|
19
|
+
if (pkg)
|
|
20
|
+
args.push("-p", pkg);
|
|
21
|
+
const result = await cargo(args, cwd);
|
|
22
|
+
const data = parseCargoBuildJson(result.stdout, result.exitCode);
|
|
23
|
+
return dualOutput(data, formatCargoBuild);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/tools/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,UAAU,iBAAiB,CAAC,MAAiB;IACjD,MAAM,CAAC,YAAY,CACjB,OAAO,EACP;QACE,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,kLAAkL;QACpL,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;YACxE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,iCAAiC,CAAC;SAC3E;QACD,YAAY,EAAE,sBAAsB;KACrC,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,uBAAuB,CAAC,CAAC;QAChD,IAAI,GAAG;YAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QAE9B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,UAAU,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAC5C,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clippy.d.ts","sourceRoot":"","sources":["../../src/tools/clippy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"clippy.d.ts","sourceRoot":"","sources":["../../src/tools/clippy.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,QAqBnD"}
|
package/dist/tools/clippy.js
CHANGED
|
@@ -7,7 +7,7 @@ import { CargoClippyResultSchema } from "../schemas/index.js";
|
|
|
7
7
|
export function registerClippyTool(server) {
|
|
8
8
|
server.registerTool("clippy", {
|
|
9
9
|
title: "Cargo Clippy",
|
|
10
|
-
description: "Runs cargo clippy and returns structured lint diagnostics",
|
|
10
|
+
description: "Runs cargo clippy and returns structured lint diagnostics. Use instead of running `cargo clippy` in the terminal.",
|
|
11
11
|
inputSchema: {
|
|
12
12
|
path: z.string().optional().describe("Project root path (default: cwd)"),
|
|
13
13
|
},
|
package/dist/tools/clippy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clippy.js","sourceRoot":"","sources":["../../src/tools/clippy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,MAAM,CAAC,YAAY,CACjB,QAAQ,EACR;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,
|
|
1
|
+
{"version":3,"file":"clippy.js","sourceRoot":"","sources":["../../src/tools/clippy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,MAAM,CAAC,YAAY,CACjB,QAAQ,EACR;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EACT,mHAAmH;QACrH,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;SACzE;QACD,YAAY,EAAE,uBAAuB;KACtC,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACjB,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,uBAAuB,CAAC,CAAC;QAEjD,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACjD,OAAO,UAAU,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IAC7C,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../src/tools/doc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,QAiChD"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { dualOutput } from "@paretools/shared";
|
|
3
|
+
import { cargo } from "../lib/cargo-runner.js";
|
|
4
|
+
import { parseCargoDocOutput } from "../lib/parsers.js";
|
|
5
|
+
import { formatCargoDoc } from "../lib/formatters.js";
|
|
6
|
+
import { CargoDocResultSchema } from "../schemas/index.js";
|
|
7
|
+
export function registerDocTool(server) {
|
|
8
|
+
server.registerTool("doc", {
|
|
9
|
+
title: "Cargo Doc",
|
|
10
|
+
description: "Generates Rust documentation and returns structured output with warning count. Use instead of running `cargo doc` in the terminal.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
path: z.string().optional().describe("Project root path (default: cwd)"),
|
|
13
|
+
open: z
|
|
14
|
+
.boolean()
|
|
15
|
+
.optional()
|
|
16
|
+
.default(false)
|
|
17
|
+
.describe("Open docs in browser after generating"),
|
|
18
|
+
noDeps: z
|
|
19
|
+
.boolean()
|
|
20
|
+
.optional()
|
|
21
|
+
.default(false)
|
|
22
|
+
.describe("Skip building documentation for dependencies (--no-deps)"),
|
|
23
|
+
},
|
|
24
|
+
outputSchema: CargoDocResultSchema,
|
|
25
|
+
}, async ({ path, open, noDeps }) => {
|
|
26
|
+
const cwd = path || process.cwd();
|
|
27
|
+
const args = ["doc"];
|
|
28
|
+
if (noDeps)
|
|
29
|
+
args.push("--no-deps");
|
|
30
|
+
if (open)
|
|
31
|
+
args.push("--open");
|
|
32
|
+
const result = await cargo(args, cwd);
|
|
33
|
+
const data = parseCargoDocOutput(result.stderr, result.exitCode);
|
|
34
|
+
return dualOutput(data, formatCargoDoc);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=doc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc.js","sourceRoot":"","sources":["../../src/tools/doc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,MAAM,CAAC,YAAY,CACjB,KAAK,EACL;QACE,KAAK,EAAE,WAAW;QAClB,WAAW,EACT,oIAAoI;QACtI,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;YACxE,IAAI,EAAE,CAAC;iBACJ,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,OAAO,CAAC,KAAK,CAAC;iBACd,QAAQ,CAAC,uCAAuC,CAAC;YACpD,MAAM,EAAE,CAAC;iBACN,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,OAAO,CAAC,KAAK,CAAC;iBACd,QAAQ,CAAC,0DAA0D,CAAC;SACxE;QACD,YAAY,EAAE,oBAAoB;KACnC,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE;QAC/B,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,MAAM;YAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACnC,IAAI,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAE9B,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjE,OAAO,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC1C,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fmt.d.ts","sourceRoot":"","sources":["../../src/tools/fmt.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAOzE,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,QA2BhD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { dualOutput } from "@paretools/shared";
|
|
3
|
+
import { cargo } from "../lib/cargo-runner.js";
|
|
4
|
+
import { parseCargoFmtOutput } from "../lib/parsers.js";
|
|
5
|
+
import { formatCargoFmt } from "../lib/formatters.js";
|
|
6
|
+
import { CargoFmtResultSchema } from "../schemas/index.js";
|
|
7
|
+
export function registerFmtTool(server) {
|
|
8
|
+
server.registerTool("fmt", {
|
|
9
|
+
title: "Cargo Fmt",
|
|
10
|
+
description: "Checks or fixes Rust formatting and returns structured output. Use instead of running `cargo fmt` in the terminal.",
|
|
11
|
+
inputSchema: {
|
|
12
|
+
path: z.string().optional().describe("Project root path (default: cwd)"),
|
|
13
|
+
check: z
|
|
14
|
+
.boolean()
|
|
15
|
+
.optional()
|
|
16
|
+
.default(false)
|
|
17
|
+
.describe("Check only without modifying files (--check)"),
|
|
18
|
+
},
|
|
19
|
+
outputSchema: CargoFmtResultSchema,
|
|
20
|
+
}, async ({ path, check }) => {
|
|
21
|
+
const cwd = path || process.cwd();
|
|
22
|
+
const args = ["fmt"];
|
|
23
|
+
if (check)
|
|
24
|
+
args.push("--check");
|
|
25
|
+
const result = await cargo(args, cwd);
|
|
26
|
+
const data = parseCargoFmtOutput(result.stdout, result.stderr, result.exitCode, !!check);
|
|
27
|
+
return dualOutput(data, formatCargoFmt);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=fmt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fmt.js","sourceRoot":"","sources":["../../src/tools/fmt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,MAAM,CAAC,YAAY,CACjB,KAAK,EACL;QACE,KAAK,EAAE,WAAW;QAClB,WAAW,EACT,oHAAoH;QACtH,WAAW,EAAE;YACX,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;YACxE,KAAK,EAAE,CAAC;iBACL,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,OAAO,CAAC,KAAK,CAAC;iBACd,QAAQ,CAAC,8CAA8C,CAAC;SAC5D;QACD,YAAY,EAAE,oBAAoB;KACnC,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;QACxB,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QACrB,IAAI,KAAK;YAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEhC,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtC,MAAM,IAAI,GAAG,mBAAmB,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QACzF,OAAO,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC1C,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAWzE,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,QAUjD"}
|
package/dist/tools/index.js
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { registerBuildTool } from "./build.js";
|
|
2
2
|
import { registerTestTool } from "./test.js";
|
|
3
3
|
import { registerClippyTool } from "./clippy.js";
|
|
4
|
+
import { registerRunTool } from "./run.js";
|
|
5
|
+
import { registerAddTool } from "./add.js";
|
|
6
|
+
import { registerRemoveTool } from "./remove.js";
|
|
7
|
+
import { registerFmtTool } from "./fmt.js";
|
|
8
|
+
import { registerDocTool } from "./doc.js";
|
|
9
|
+
import { registerCheckTool } from "./check.js";
|
|
4
10
|
export function registerAllTools(server) {
|
|
5
11
|
registerBuildTool(server);
|
|
6
12
|
registerTestTool(server);
|
|
7
13
|
registerClippyTool(server);
|
|
14
|
+
registerRunTool(server);
|
|
15
|
+
registerAddTool(server);
|
|
16
|
+
registerRemoveTool(server);
|
|
17
|
+
registerFmtTool(server);
|
|
18
|
+
registerDocTool(server);
|
|
19
|
+
registerCheckTool(server);
|
|
8
20
|
}
|
|
9
21
|
//# sourceMappingURL=index.js.map
|
package/dist/tools/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,UAAU,gBAAgB,CAAC,MAAiB;IAChD,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC1B,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACzB,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC3B,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,eAAe,CAAC,MAAM,CAAC,CAAC;IACxB,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC"}
|