replicant-mcp 1.6.2 → 1.6.4
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/adapters/ui-automator.d.ts +6 -6
- package/dist/adapters/ui-automator.js +19 -31
- package/dist/adapters/ui-fallback-find.js +44 -4
- package/dist/parsers/ui-dump.d.ts +1 -0
- package/dist/parsers/ui-dump.js +34 -2
- package/dist/schemas/derive.d.ts +8 -0
- package/dist/schemas/derive.js +19 -0
- package/dist/schemas/inputs.d.ts +9 -0
- package/dist/schemas/inputs.js +44 -0
- package/dist/server.js +3 -18
- package/dist/tools/adb-app.d.ts +6 -30
- package/dist/tools/adb-app.js +10 -29
- package/dist/tools/adb-device.d.ts +4 -12
- package/dist/tools/adb-device.js +4 -12
- package/dist/tools/adb-logcat.d.ts +5 -29
- package/dist/tools/adb-logcat.js +6 -14
- package/dist/tools/adb-shell.d.ts +8 -28
- package/dist/tools/adb-shell.js +10 -16
- package/dist/tools/cache.d.ts +9 -32
- package/dist/tools/cache.js +9 -25
- package/dist/tools/emulator-device.d.ts +4 -25
- package/dist/tools/emulator-device.js +5 -27
- package/dist/tools/gradle-build.d.ts +4 -16
- package/dist/tools/gradle-build.js +5 -14
- package/dist/tools/gradle-get-details.d.ts +7 -27
- package/dist/tools/gradle-get-details.js +11 -27
- package/dist/tools/gradle-list.d.ts +4 -13
- package/dist/tools/gradle-list.js +5 -13
- package/dist/tools/gradle-test.d.ts +4 -20
- package/dist/tools/gradle-test.js +9 -19
- package/dist/tools/index.d.ts +197 -0
- package/dist/tools/index.js +33 -0
- package/dist/tools/rtfm.d.ts +4 -12
- package/dist/tools/rtfm.js +10 -11
- package/dist/tools/ui-action.d.ts +18 -41
- package/dist/tools/ui-action.js +179 -35
- package/dist/tools/ui-capture.d.ts +7 -26
- package/dist/tools/ui-capture.js +9 -21
- package/dist/tools/ui-query.d.ts +13 -72
- package/dist/tools/ui-query.js +39 -46
- package/dist/types/errors.d.ts +1 -0
- package/dist/types/errors.js +1 -0
- package/dist/types/schemas/ui-output.d.ts +92 -6
- package/dist/types/schemas/ui-output.js +20 -0
- package/docs/contracts/replicant-mcp.contract.json +241 -57
- package/docs/contracts/tool-schema-tokens.json +67 -0
- package/package.json +9 -6
|
@@ -2,40 +2,20 @@ import { z } from "zod";
|
|
|
2
2
|
import { ServerContext } from "../server.js";
|
|
3
3
|
export declare const adbShellInputSchema: z.ZodObject<{
|
|
4
4
|
command: z.ZodString;
|
|
5
|
-
timeout: z.ZodOptional<z.
|
|
6
|
-
maxChars: z.ZodOptional<z.
|
|
7
|
-
summaryOnly: z.ZodOptional<z.ZodBoolean
|
|
8
|
-
previewChars: z.ZodOptional<z.
|
|
9
|
-
}, z.core.$
|
|
5
|
+
timeout: z.ZodOptional<z.ZodPipe<z.ZodTransform<string | number, unknown>, z.ZodCoercedNumber<unknown>>>;
|
|
6
|
+
maxChars: z.ZodOptional<z.ZodPipe<z.ZodTransform<string | number, unknown>, z.ZodCoercedNumber<unknown>>>;
|
|
7
|
+
summaryOnly: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
8
|
+
previewChars: z.ZodOptional<z.ZodPipe<z.ZodTransform<string | number, unknown>, z.ZodCoercedNumber<unknown>>>;
|
|
9
|
+
}, z.core.$strict>;
|
|
10
10
|
export type AdbShellInput = z.infer<typeof adbShellInputSchema>;
|
|
11
11
|
export declare function handleAdbShellTool(input: AdbShellInput, context: ServerContext): Promise<Record<string, unknown>>;
|
|
12
12
|
export declare const adbShellToolDefinition: {
|
|
13
13
|
name: string;
|
|
14
14
|
description: string;
|
|
15
15
|
inputSchema: {
|
|
16
|
-
type:
|
|
17
|
-
properties
|
|
18
|
-
|
|
19
|
-
type: string;
|
|
20
|
-
};
|
|
21
|
-
timeout: {
|
|
22
|
-
type: string;
|
|
23
|
-
description: string;
|
|
24
|
-
};
|
|
25
|
-
maxChars: {
|
|
26
|
-
type: string;
|
|
27
|
-
description: string;
|
|
28
|
-
};
|
|
29
|
-
summaryOnly: {
|
|
30
|
-
type: string;
|
|
31
|
-
description: string;
|
|
32
|
-
};
|
|
33
|
-
previewChars: {
|
|
34
|
-
type: string;
|
|
35
|
-
description: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
required: string[];
|
|
16
|
+
type: "object";
|
|
17
|
+
properties?: Record<string, unknown>;
|
|
18
|
+
required?: string[];
|
|
39
19
|
};
|
|
40
20
|
annotations: {
|
|
41
21
|
readOnlyHint: boolean;
|
package/dist/tools/adb-shell.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
2
|
+
import { booleanInput, numberInput, toolSchema } from "../schemas/inputs.js";
|
|
3
|
+
import { toMcpJsonSchema } from "../schemas/derive.js";
|
|
4
|
+
export const adbShellInputSchema = toolSchema({
|
|
3
5
|
command: z.string(),
|
|
4
|
-
timeout:
|
|
5
|
-
maxChars:
|
|
6
|
-
summaryOnly:
|
|
7
|
-
previewChars:
|
|
6
|
+
timeout: numberInput().optional().describe("ms, default: 30000, max: 120000"),
|
|
7
|
+
maxChars: numberInput({ min: 1 }).optional().describe("Truncate output to N chars"),
|
|
8
|
+
summaryOnly: booleanInput().optional().describe("Compact preview only"),
|
|
9
|
+
previewChars: numberInput({ min: 1 })
|
|
10
|
+
.optional()
|
|
11
|
+
.describe("Preview length (default: 200)"),
|
|
8
12
|
});
|
|
9
13
|
export async function handleAdbShellTool(input, context) {
|
|
10
14
|
const device = await context.deviceState.ensureDevice(context.adb);
|
|
@@ -44,17 +48,7 @@ export async function handleAdbShellTool(input, context) {
|
|
|
44
48
|
export const adbShellToolDefinition = {
|
|
45
49
|
name: "adb-shell",
|
|
46
50
|
description: "Execute shell commands with safety guards.",
|
|
47
|
-
inputSchema:
|
|
48
|
-
type: "object",
|
|
49
|
-
properties: {
|
|
50
|
-
command: { type: "string" },
|
|
51
|
-
timeout: { type: "number", description: "ms, default: 30000, max: 120000" },
|
|
52
|
-
maxChars: { type: "number", description: "Truncate output to N chars" },
|
|
53
|
-
summaryOnly: { type: "boolean", description: "Compact preview only" },
|
|
54
|
-
previewChars: { type: "number", description: "Preview length (default: 200)" },
|
|
55
|
-
},
|
|
56
|
-
required: ["command"],
|
|
57
|
-
},
|
|
51
|
+
inputSchema: toMcpJsonSchema(adbShellInputSchema),
|
|
58
52
|
annotations: {
|
|
59
53
|
readOnlyHint: false,
|
|
60
54
|
destructiveHint: true,
|
package/dist/tools/cache.d.ts
CHANGED
|
@@ -8,44 +8,21 @@ export declare const cacheInputSchema: z.ZodObject<{
|
|
|
8
8
|
"set-config": "set-config";
|
|
9
9
|
}>;
|
|
10
10
|
key: z.ZodOptional<z.ZodString>;
|
|
11
|
-
config: z.ZodOptional<z.ZodObject<{
|
|
12
|
-
maxEntries: z.ZodOptional<z.
|
|
13
|
-
maxEntrySizeBytes: z.ZodOptional<z.
|
|
14
|
-
defaultTtlMs: z.ZodOptional<z.
|
|
15
|
-
}, z.core.$
|
|
16
|
-
}, z.core.$
|
|
11
|
+
config: z.ZodOptional<z.ZodPipe<z.ZodTransform<any, unknown>, z.ZodObject<{
|
|
12
|
+
maxEntries: z.ZodOptional<z.ZodPipe<z.ZodTransform<string | number, unknown>, z.ZodCoercedNumber<unknown>>>;
|
|
13
|
+
maxEntrySizeBytes: z.ZodOptional<z.ZodPipe<z.ZodTransform<string | number, unknown>, z.ZodCoercedNumber<unknown>>>;
|
|
14
|
+
defaultTtlMs: z.ZodOptional<z.ZodPipe<z.ZodTransform<string | number, unknown>, z.ZodCoercedNumber<unknown>>>;
|
|
15
|
+
}, z.core.$strict>>>;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
17
|
export type CacheInput = z.infer<typeof cacheInputSchema>;
|
|
18
18
|
export declare function handleCacheTool(input: CacheInput, cache: CacheManager): Promise<Record<string, unknown>>;
|
|
19
19
|
export declare const cacheToolDefinition: {
|
|
20
20
|
name: string;
|
|
21
21
|
description: string;
|
|
22
22
|
inputSchema: {
|
|
23
|
-
type:
|
|
24
|
-
properties
|
|
25
|
-
|
|
26
|
-
type: string;
|
|
27
|
-
enum: string[];
|
|
28
|
-
};
|
|
29
|
-
key: {
|
|
30
|
-
type: string;
|
|
31
|
-
description: string;
|
|
32
|
-
};
|
|
33
|
-
config: {
|
|
34
|
-
type: string;
|
|
35
|
-
properties: {
|
|
36
|
-
maxEntries: {
|
|
37
|
-
type: string;
|
|
38
|
-
};
|
|
39
|
-
maxEntrySizeBytes: {
|
|
40
|
-
type: string;
|
|
41
|
-
};
|
|
42
|
-
defaultTtlMs: {
|
|
43
|
-
type: string;
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
required: string[];
|
|
23
|
+
type: "object";
|
|
24
|
+
properties?: Record<string, unknown>;
|
|
25
|
+
required?: string[];
|
|
49
26
|
};
|
|
50
27
|
annotations: {
|
|
51
28
|
readOnlyHint: boolean;
|
package/dist/tools/cache.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ReplicantError, ErrorCode } from "../types/index.js";
|
|
3
|
-
|
|
3
|
+
import { jsonObjectInput, numberInput, toolSchema } from "../schemas/inputs.js";
|
|
4
|
+
import { toMcpJsonSchema } from "../schemas/derive.js";
|
|
5
|
+
export const cacheInputSchema = toolSchema({
|
|
4
6
|
operation: z.enum(["get-stats", "clear", "get-config", "set-config"]),
|
|
5
|
-
key: z.string().optional(),
|
|
6
|
-
config:
|
|
7
|
-
maxEntries:
|
|
8
|
-
maxEntrySizeBytes:
|
|
9
|
-
defaultTtlMs:
|
|
7
|
+
key: z.string().optional().describe("Key to clear (optional)"),
|
|
8
|
+
config: jsonObjectInput({
|
|
9
|
+
maxEntries: numberInput().optional(),
|
|
10
|
+
maxEntrySizeBytes: numberInput().optional(),
|
|
11
|
+
defaultTtlMs: numberInput().optional(),
|
|
10
12
|
}).optional(),
|
|
11
13
|
});
|
|
12
14
|
export async function handleCacheTool(input, cache) {
|
|
@@ -36,25 +38,7 @@ export async function handleCacheTool(input, cache) {
|
|
|
36
38
|
export const cacheToolDefinition = {
|
|
37
39
|
name: "cache",
|
|
38
40
|
description: "Manage the cache. See rtfm for details.",
|
|
39
|
-
inputSchema:
|
|
40
|
-
type: "object",
|
|
41
|
-
properties: {
|
|
42
|
-
operation: {
|
|
43
|
-
type: "string",
|
|
44
|
-
enum: ["get-stats", "clear", "get-config", "set-config"],
|
|
45
|
-
},
|
|
46
|
-
key: { type: "string", description: "Key to clear (optional)" },
|
|
47
|
-
config: {
|
|
48
|
-
type: "object",
|
|
49
|
-
properties: {
|
|
50
|
-
maxEntries: { type: "number" },
|
|
51
|
-
maxEntrySizeBytes: { type: "number" },
|
|
52
|
-
defaultTtlMs: { type: "number" },
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
required: ["operation"],
|
|
57
|
-
},
|
|
41
|
+
inputSchema: toMcpJsonSchema(cacheInputSchema),
|
|
58
42
|
annotations: {
|
|
59
43
|
readOnlyHint: false,
|
|
60
44
|
destructiveHint: true,
|
|
@@ -17,37 +17,16 @@ export declare const emulatorDeviceInputSchema: z.ZodObject<{
|
|
|
17
17
|
systemImage: z.ZodOptional<z.ZodString>;
|
|
18
18
|
snapshotName: z.ZodOptional<z.ZodString>;
|
|
19
19
|
emulatorId: z.ZodOptional<z.ZodString>;
|
|
20
|
-
}, z.core.$
|
|
20
|
+
}, z.core.$strict>;
|
|
21
21
|
export type EmulatorDeviceInput = z.infer<typeof emulatorDeviceInputSchema>;
|
|
22
22
|
export declare function handleEmulatorDeviceTool(input: EmulatorDeviceInput, context: ServerContext): Promise<Record<string, unknown>>;
|
|
23
23
|
export declare const emulatorDeviceToolDefinition: {
|
|
24
24
|
name: string;
|
|
25
25
|
description: string;
|
|
26
26
|
inputSchema: {
|
|
27
|
-
type:
|
|
28
|
-
properties
|
|
29
|
-
|
|
30
|
-
type: string;
|
|
31
|
-
enum: string[];
|
|
32
|
-
};
|
|
33
|
-
avdName: {
|
|
34
|
-
type: string;
|
|
35
|
-
};
|
|
36
|
-
device: {
|
|
37
|
-
type: string;
|
|
38
|
-
description: string;
|
|
39
|
-
};
|
|
40
|
-
systemImage: {
|
|
41
|
-
type: string;
|
|
42
|
-
};
|
|
43
|
-
snapshotName: {
|
|
44
|
-
type: string;
|
|
45
|
-
};
|
|
46
|
-
emulatorId: {
|
|
47
|
-
type: string;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
required: string[];
|
|
27
|
+
type: "object";
|
|
28
|
+
properties?: Record<string, unknown>;
|
|
29
|
+
required?: string[];
|
|
51
30
|
};
|
|
52
31
|
annotations: {
|
|
53
32
|
readOnlyHint: boolean;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ReplicantError, ErrorCode } from "../types/index.js";
|
|
3
|
-
|
|
3
|
+
import { toolSchema } from "../schemas/inputs.js";
|
|
4
|
+
import { toMcpJsonSchema } from "../schemas/derive.js";
|
|
5
|
+
export const emulatorDeviceInputSchema = toolSchema({
|
|
4
6
|
operation: z.enum([
|
|
5
7
|
"list",
|
|
6
8
|
"create",
|
|
@@ -13,7 +15,7 @@ export const emulatorDeviceInputSchema = z.object({
|
|
|
13
15
|
"snapshot-delete",
|
|
14
16
|
]),
|
|
15
17
|
avdName: z.string().optional(),
|
|
16
|
-
device: z.string().optional(),
|
|
18
|
+
device: z.string().optional().describe("e.g., 'pixel_7'"),
|
|
17
19
|
systemImage: z.string().optional(),
|
|
18
20
|
snapshotName: z.string().optional(),
|
|
19
21
|
emulatorId: z.string().optional(),
|
|
@@ -116,31 +118,7 @@ export async function handleEmulatorDeviceTool(input, context) {
|
|
|
116
118
|
export const emulatorDeviceToolDefinition = {
|
|
117
119
|
name: "emulator-device",
|
|
118
120
|
description: "Manage Android emulators.",
|
|
119
|
-
inputSchema:
|
|
120
|
-
type: "object",
|
|
121
|
-
properties: {
|
|
122
|
-
operation: {
|
|
123
|
-
type: "string",
|
|
124
|
-
enum: [
|
|
125
|
-
"list",
|
|
126
|
-
"create",
|
|
127
|
-
"start",
|
|
128
|
-
"kill",
|
|
129
|
-
"wipe",
|
|
130
|
-
"snapshot-save",
|
|
131
|
-
"snapshot-load",
|
|
132
|
-
"snapshot-list",
|
|
133
|
-
"snapshot-delete",
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
avdName: { type: "string" },
|
|
137
|
-
device: { type: "string", description: "e.g., 'pixel_7'" },
|
|
138
|
-
systemImage: { type: "string" },
|
|
139
|
-
snapshotName: { type: "string" },
|
|
140
|
-
emulatorId: { type: "string" },
|
|
141
|
-
},
|
|
142
|
-
required: ["operation"],
|
|
143
|
-
},
|
|
121
|
+
inputSchema: toMcpJsonSchema(emulatorDeviceInputSchema),
|
|
144
122
|
annotations: {
|
|
145
123
|
readOnlyHint: false,
|
|
146
124
|
destructiveHint: true,
|
|
@@ -8,28 +8,16 @@ export declare const gradleBuildInputSchema: z.ZodObject<{
|
|
|
8
8
|
}>;
|
|
9
9
|
module: z.ZodOptional<z.ZodString>;
|
|
10
10
|
flavor: z.ZodOptional<z.ZodString>;
|
|
11
|
-
}, z.core.$
|
|
11
|
+
}, z.core.$strict>;
|
|
12
12
|
export type GradleBuildInput = z.infer<typeof gradleBuildInputSchema>;
|
|
13
13
|
export declare function handleGradleBuildTool(input: GradleBuildInput, context: ServerContext): Promise<Record<string, unknown>>;
|
|
14
14
|
export declare const gradleBuildToolDefinition: {
|
|
15
15
|
name: string;
|
|
16
16
|
description: string;
|
|
17
17
|
inputSchema: {
|
|
18
|
-
type:
|
|
19
|
-
properties
|
|
20
|
-
|
|
21
|
-
type: string;
|
|
22
|
-
enum: string[];
|
|
23
|
-
};
|
|
24
|
-
module: {
|
|
25
|
-
type: string;
|
|
26
|
-
description: string;
|
|
27
|
-
};
|
|
28
|
-
flavor: {
|
|
29
|
-
type: string;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
required: string[];
|
|
18
|
+
type: "object";
|
|
19
|
+
properties?: Record<string, unknown>;
|
|
20
|
+
required?: string[];
|
|
33
21
|
};
|
|
34
22
|
annotations: {
|
|
35
23
|
readOnlyHint: boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CACHE_TTLS } from "../types/index.js";
|
|
3
|
-
|
|
3
|
+
import { toolSchema } from "../schemas/inputs.js";
|
|
4
|
+
import { toMcpJsonSchema } from "../schemas/derive.js";
|
|
5
|
+
export const gradleBuildInputSchema = toolSchema({
|
|
4
6
|
operation: z.enum(["assembleDebug", "assembleRelease", "bundle"]),
|
|
5
|
-
module: z.string().optional(),
|
|
7
|
+
module: z.string().optional().describe("e.g., ':app'"),
|
|
6
8
|
flavor: z.string().optional(),
|
|
7
9
|
});
|
|
8
10
|
export async function handleGradleBuildTool(input, context) {
|
|
@@ -24,18 +26,7 @@ export async function handleGradleBuildTool(input, context) {
|
|
|
24
26
|
export const gradleBuildToolDefinition = {
|
|
25
27
|
name: "gradle-build",
|
|
26
28
|
description: "Build. Returns summary with buildId.",
|
|
27
|
-
inputSchema:
|
|
28
|
-
type: "object",
|
|
29
|
-
properties: {
|
|
30
|
-
operation: {
|
|
31
|
-
type: "string",
|
|
32
|
-
enum: ["assembleDebug", "assembleRelease", "bundle"],
|
|
33
|
-
},
|
|
34
|
-
module: { type: "string", description: "e.g., ':app'" },
|
|
35
|
-
flavor: { type: "string" },
|
|
36
|
-
},
|
|
37
|
-
required: ["operation"],
|
|
38
|
-
},
|
|
29
|
+
inputSchema: toMcpJsonSchema(gradleBuildInputSchema),
|
|
39
30
|
annotations: {
|
|
40
31
|
readOnlyHint: false,
|
|
41
32
|
destructiveHint: false,
|
|
@@ -8,39 +8,19 @@ export declare const gradleGetDetailsInputSchema: z.ZodObject<{
|
|
|
8
8
|
tasks: "tasks";
|
|
9
9
|
logs: "logs";
|
|
10
10
|
}>>>;
|
|
11
|
-
maxChars: z.ZodOptional<z.
|
|
12
|
-
summaryOnly: z.ZodOptional<z.ZodBoolean
|
|
13
|
-
previewChars: z.ZodOptional<z.
|
|
14
|
-
}, z.core.$
|
|
11
|
+
maxChars: z.ZodOptional<z.ZodPipe<z.ZodTransform<string | number, unknown>, z.ZodCoercedNumber<unknown>>>;
|
|
12
|
+
summaryOnly: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodBoolean>>;
|
|
13
|
+
previewChars: z.ZodOptional<z.ZodPipe<z.ZodTransform<string | number, unknown>, z.ZodCoercedNumber<unknown>>>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
15
|
export type GradleGetDetailsInput = z.infer<typeof gradleGetDetailsInputSchema>;
|
|
16
16
|
export declare function handleGradleGetDetailsTool(input: GradleGetDetailsInput, context: ServerContext): Promise<Record<string, unknown>>;
|
|
17
17
|
export declare const gradleGetDetailsToolDefinition: {
|
|
18
18
|
name: string;
|
|
19
19
|
description: string;
|
|
20
20
|
inputSchema: {
|
|
21
|
-
type:
|
|
22
|
-
properties
|
|
23
|
-
|
|
24
|
-
type: string;
|
|
25
|
-
};
|
|
26
|
-
detailType: {
|
|
27
|
-
type: string;
|
|
28
|
-
enum: string[];
|
|
29
|
-
};
|
|
30
|
-
maxChars: {
|
|
31
|
-
type: string;
|
|
32
|
-
description: string;
|
|
33
|
-
};
|
|
34
|
-
summaryOnly: {
|
|
35
|
-
type: string;
|
|
36
|
-
description: string;
|
|
37
|
-
};
|
|
38
|
-
previewChars: {
|
|
39
|
-
type: string;
|
|
40
|
-
description: string;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
required: string[];
|
|
21
|
+
type: "object";
|
|
22
|
+
properties?: Record<string, unknown>;
|
|
23
|
+
required?: string[];
|
|
44
24
|
};
|
|
45
25
|
annotations: {
|
|
46
26
|
readOnlyHint: boolean;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { ReplicantError, ErrorCode } from "../types/index.js";
|
|
3
|
-
|
|
3
|
+
import { booleanInput, numberInput, toolSchema } from "../schemas/inputs.js";
|
|
4
|
+
import { toMcpJsonSchema } from "../schemas/derive.js";
|
|
5
|
+
export const gradleGetDetailsInputSchema = toolSchema({
|
|
4
6
|
id: z.string(),
|
|
5
7
|
detailType: z.enum(["logs", "errors", "tasks", "all"]).optional().default("all"),
|
|
6
|
-
maxChars:
|
|
7
|
-
summaryOnly:
|
|
8
|
-
|
|
8
|
+
maxChars: numberInput({ min: 1 }).optional().describe("Truncate to N chars"),
|
|
9
|
+
summaryOnly: booleanInput()
|
|
10
|
+
.optional()
|
|
11
|
+
.describe("Return compact summary payload for logs/tasks/all detail types (ignored for errors)"),
|
|
12
|
+
previewChars: numberInput({ min: 1 })
|
|
13
|
+
.optional()
|
|
14
|
+
.describe("For summaryOnly with detailType logs/all: preview length in characters (default: 400)"),
|
|
9
15
|
});
|
|
10
16
|
function truncateText(text, maxChars) {
|
|
11
17
|
if (!maxChars || text.length <= maxChars) {
|
|
@@ -136,29 +142,7 @@ export async function handleGradleGetDetailsTool(input, context) {
|
|
|
136
142
|
export const gradleGetDetailsToolDefinition = {
|
|
137
143
|
name: "gradle-get-details",
|
|
138
144
|
description: "Fetch full output for a previous build/test by ID.",
|
|
139
|
-
inputSchema:
|
|
140
|
-
type: "object",
|
|
141
|
-
properties: {
|
|
142
|
-
id: { type: "string" },
|
|
143
|
-
detailType: {
|
|
144
|
-
type: "string",
|
|
145
|
-
enum: ["logs", "errors", "tasks", "all"],
|
|
146
|
-
},
|
|
147
|
-
maxChars: {
|
|
148
|
-
type: "number",
|
|
149
|
-
description: "Truncate to N chars",
|
|
150
|
-
},
|
|
151
|
-
summaryOnly: {
|
|
152
|
-
type: "boolean",
|
|
153
|
-
description: "Return compact summary payload for logs/tasks/all detail types (ignored for errors)",
|
|
154
|
-
},
|
|
155
|
-
previewChars: {
|
|
156
|
-
type: "number",
|
|
157
|
-
description: "For summaryOnly with detailType logs/all: preview length in characters (default: 400)",
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
required: ["id"],
|
|
161
|
-
},
|
|
145
|
+
inputSchema: toMcpJsonSchema(gradleGetDetailsInputSchema),
|
|
162
146
|
annotations: {
|
|
163
147
|
readOnlyHint: true,
|
|
164
148
|
destructiveHint: false,
|
|
@@ -7,25 +7,16 @@ export declare const gradleListInputSchema: z.ZodObject<{
|
|
|
7
7
|
variants: "variants";
|
|
8
8
|
}>;
|
|
9
9
|
module: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, z.core.$
|
|
10
|
+
}, z.core.$strict>;
|
|
11
11
|
export type GradleListInput = z.infer<typeof gradleListInputSchema>;
|
|
12
12
|
export declare function handleGradleListTool(input: GradleListInput, context: ServerContext): Promise<Record<string, unknown>>;
|
|
13
13
|
export declare const gradleListToolDefinition: {
|
|
14
14
|
name: string;
|
|
15
15
|
description: string;
|
|
16
16
|
inputSchema: {
|
|
17
|
-
type:
|
|
18
|
-
properties
|
|
19
|
-
|
|
20
|
-
type: string;
|
|
21
|
-
enum: string[];
|
|
22
|
-
};
|
|
23
|
-
module: {
|
|
24
|
-
type: string;
|
|
25
|
-
description: string;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
required: string[];
|
|
17
|
+
type: "object";
|
|
18
|
+
properties?: Record<string, unknown>;
|
|
19
|
+
required?: string[];
|
|
29
20
|
};
|
|
30
21
|
annotations: {
|
|
31
22
|
readOnlyHint: boolean;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CACHE_TTLS, ReplicantError, ErrorCode } from "../types/index.js";
|
|
3
|
-
|
|
3
|
+
import { toolSchema } from "../schemas/inputs.js";
|
|
4
|
+
import { toMcpJsonSchema } from "../schemas/derive.js";
|
|
5
|
+
export const gradleListInputSchema = toolSchema({
|
|
4
6
|
operation: z.enum(["variants", "modules", "tasks"]),
|
|
5
|
-
module: z.string().optional(),
|
|
7
|
+
module: z.string().optional().describe("e.g., ':app'"),
|
|
6
8
|
});
|
|
7
9
|
export async function handleGradleListTool(input, context) {
|
|
8
10
|
switch (input.operation) {
|
|
@@ -39,17 +41,7 @@ export async function handleGradleListTool(input, context) {
|
|
|
39
41
|
export const gradleListToolDefinition = {
|
|
40
42
|
name: "gradle-list",
|
|
41
43
|
description: "Introspect project structure.",
|
|
42
|
-
inputSchema:
|
|
43
|
-
type: "object",
|
|
44
|
-
properties: {
|
|
45
|
-
operation: {
|
|
46
|
-
type: "string",
|
|
47
|
-
enum: ["variants", "modules", "tasks"],
|
|
48
|
-
},
|
|
49
|
-
module: { type: "string", description: "e.g., ':app'" },
|
|
50
|
-
},
|
|
51
|
-
required: ["operation"],
|
|
52
|
-
},
|
|
44
|
+
inputSchema: toMcpJsonSchema(gradleListInputSchema),
|
|
53
45
|
annotations: {
|
|
54
46
|
readOnlyHint: true,
|
|
55
47
|
destructiveHint: false,
|
|
@@ -12,7 +12,7 @@ export declare const gradleTestInputSchema: z.ZodObject<{
|
|
|
12
12
|
module: z.ZodOptional<z.ZodString>;
|
|
13
13
|
filter: z.ZodOptional<z.ZodString>;
|
|
14
14
|
taskName: z.ZodOptional<z.ZodString>;
|
|
15
|
-
}, z.core.$
|
|
15
|
+
}, z.core.$strict>;
|
|
16
16
|
export type GradleTestInput = z.infer<typeof gradleTestInputSchema>;
|
|
17
17
|
/**
|
|
18
18
|
* Convert gradle TestResult into BaselineTestResult[] for baseline storage/comparison.
|
|
@@ -24,25 +24,9 @@ export declare const gradleTestToolDefinition: {
|
|
|
24
24
|
name: string;
|
|
25
25
|
description: string;
|
|
26
26
|
inputSchema: {
|
|
27
|
-
type:
|
|
28
|
-
properties
|
|
29
|
-
|
|
30
|
-
type: string;
|
|
31
|
-
enum: string[];
|
|
32
|
-
};
|
|
33
|
-
module: {
|
|
34
|
-
type: string;
|
|
35
|
-
};
|
|
36
|
-
filter: {
|
|
37
|
-
type: string;
|
|
38
|
-
description: string;
|
|
39
|
-
};
|
|
40
|
-
taskName: {
|
|
41
|
-
type: string;
|
|
42
|
-
description: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
required: string[];
|
|
27
|
+
type: "object";
|
|
28
|
+
properties?: Record<string, unknown>;
|
|
29
|
+
required?: string[];
|
|
46
30
|
};
|
|
47
31
|
annotations: {
|
|
48
32
|
readOnlyHint: boolean;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { CACHE_TTLS } from "../types/index.js";
|
|
3
3
|
import { saveBaseline, loadBaseline, clearBaseline, compareResults, } from "../services/test-baseline.js";
|
|
4
|
-
|
|
4
|
+
import { toolSchema } from "../schemas/inputs.js";
|
|
5
|
+
import { toMcpJsonSchema } from "../schemas/derive.js";
|
|
6
|
+
export const gradleTestInputSchema = toolSchema({
|
|
5
7
|
operation: z.enum(["unitTest", "connectedTest", "saveBaseline", "clearBaseline"]),
|
|
6
8
|
module: z.string().optional(),
|
|
7
|
-
filter: z.string().optional(),
|
|
8
|
-
taskName: z
|
|
9
|
+
filter: z.string().optional().describe("e.g., '*LoginTest*'"),
|
|
10
|
+
taskName: z
|
|
11
|
+
.string()
|
|
12
|
+
.optional()
|
|
13
|
+
.describe("Task name for baseline operations. Defaults to operation name."),
|
|
9
14
|
});
|
|
10
15
|
/**
|
|
11
16
|
* Convert gradle TestResult into BaselineTestResult[] for baseline storage/comparison.
|
|
@@ -82,22 +87,7 @@ export async function handleGradleTestTool(input, context) {
|
|
|
82
87
|
export const gradleTestToolDefinition = {
|
|
83
88
|
name: "gradle-test",
|
|
84
89
|
description: "Run tests. Returns summary with testId. With baseline, auto-detects regressions.",
|
|
85
|
-
inputSchema:
|
|
86
|
-
type: "object",
|
|
87
|
-
properties: {
|
|
88
|
-
operation: {
|
|
89
|
-
type: "string",
|
|
90
|
-
enum: ["unitTest", "connectedTest", "saveBaseline", "clearBaseline"],
|
|
91
|
-
},
|
|
92
|
-
module: { type: "string" },
|
|
93
|
-
filter: { type: "string", description: "e.g., '*LoginTest*'" },
|
|
94
|
-
taskName: {
|
|
95
|
-
type: "string",
|
|
96
|
-
description: "Task name for baseline operations. Defaults to operation name.",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
required: ["operation"],
|
|
100
|
-
},
|
|
90
|
+
inputSchema: toMcpJsonSchema(gradleTestInputSchema),
|
|
101
91
|
annotations: {
|
|
102
92
|
readOnlyHint: false,
|
|
103
93
|
destructiveHint: true,
|