chrometools-mcp 3.3.6 → 3.3.9
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/CHANGELOG.md +87 -0
- package/README.md +129 -24
- package/SPEC-pom-integration.md +227 -0
- package/SPEC-swagger-api-tools.md +3101 -0
- package/browser/page-manager.js +83 -0
- package/index.js +623 -201
- package/package.json +2 -1
- package/pom/apom-tree-converter.js +287 -51
- package/recorder/page-object-generator.js +45 -1
- package/server/tool-definitions.js +57 -6
- package/server/tool-schemas.js +31 -0
- package/test-swagger-phase1.mjs +959 -0
- package/utils/api-generators/api-models-python.js +448 -0
- package/utils/api-generators/api-models-typescript.js +375 -0
- package/utils/code-generators/code-generator-base.js +111 -6
- package/utils/code-generators/playwright-python.js +74 -0
- package/utils/code-generators/playwright-typescript.js +69 -0
- package/utils/code-generators/pom-integrator.js +373 -0
- package/utils/code-generators/selenium-java.js +72 -0
- package/utils/code-generators/selenium-python.js +75 -0
- package/utils/hints-generator.js +114 -19
- package/utils/openapi/helpers.js +25 -0
- package/utils/openapi/parser.js +448 -0
- package/utils/openapi/ref-resolver.js +149 -0
- package/utils/openapi/type-mapper.js +174 -0
- package/nul +0 -0
package/server/tool-schemas.js
CHANGED
|
@@ -61,6 +61,7 @@ export const DragSchema = z.object({
|
|
|
61
61
|
.describe("Direction to drag: vertical (up, down), horizontal (left, right), or diagonal (up-left, up-right, down-left, down-right)"),
|
|
62
62
|
distance: z.number().min(1).optional().describe("Distance to drag in pixels (default: 100)"),
|
|
63
63
|
duration: z.number().min(100).optional().describe("Duration of drag operation in milliseconds (default: 500)"),
|
|
64
|
+
mode: z.enum(['native', 'synthetic']).optional().describe("Drag mode: 'native' uses Puppeteer mouse API (default, faster), 'synthetic' dispatches DOM events (better compatibility with JS libraries like frappe-gantt, jQuery UI)"),
|
|
64
65
|
});
|
|
65
66
|
|
|
66
67
|
export const ScrollHorizontalSchema = z.object({
|
|
@@ -263,6 +264,8 @@ export const AnalyzePageSchema = z.object({
|
|
|
263
264
|
useLegacyFormat: z.boolean().optional().describe("Return legacy format instead of APOM (default: false - APOM is now the default format)"),
|
|
264
265
|
registerElements: z.boolean().optional().describe("Automatically register elements in selector resolver (default: true)"),
|
|
265
266
|
groupBy: z.enum(['type', 'flat']).optional().describe("Group elements by type or return flat structure (default: 'type')"),
|
|
267
|
+
viewportOnly: z.boolean().optional().describe("Only analyze elements visible in current viewport (default: false). Reduces output for long pages."),
|
|
268
|
+
diff: z.boolean().optional().describe("Return only changes since last analysis: {added, removed, changed} (default: false). Useful after clicks to see what changed."),
|
|
266
269
|
});
|
|
267
270
|
|
|
268
271
|
export const GetElementDetailsSchema = z.object({
|
|
@@ -339,6 +342,10 @@ export const ExportScenarioAsCodeSchema = z.object({
|
|
|
339
342
|
includeComments: z.boolean().optional().describe("Include descriptive comments (default: true)"),
|
|
340
343
|
generatePageObject: z.boolean().optional().describe("Also generate Page Object class for the page (default: false)"),
|
|
341
344
|
pageObjectClassName: z.string().optional().describe("Page Object class name (optional, auto-generated if not provided)"),
|
|
345
|
+
pageObjectMode: z.enum(['none', 'generate', 'generate-integrated', 'use-existing']).optional()
|
|
346
|
+
.describe("POM integration: 'none' (default), 'generate' (separate POM, current behavior), 'generate-integrated' (POM + test using it), 'use-existing' (test uses existing POM file)"),
|
|
347
|
+
pageObjectFile: z.string().optional()
|
|
348
|
+
.describe("Path to existing POM file (for 'use-existing' mode)"),
|
|
342
349
|
directory: z.string().optional().describe("Directory where scenarios are stored (optional)"),
|
|
343
350
|
appendToFile: z.string().optional().describe("Path to existing test file to append to (enables append mode)"),
|
|
344
351
|
testName: z.string().optional().describe("Override test name (default: from scenario name)"),
|
|
@@ -363,3 +370,27 @@ export const SwitchTabSchema = z.object({
|
|
|
363
370
|
]).describe("Tab identifier: index number or URL pattern to match"),
|
|
364
371
|
});
|
|
365
372
|
|
|
373
|
+
// API / Swagger tools
|
|
374
|
+
export const LoadSwaggerSchema = z.object({
|
|
375
|
+
source: z.string().describe("URL (http/https) or local file path to swagger.json / openapi.yaml"),
|
|
376
|
+
format: z.enum(['auto', 'json', 'yaml']).optional()
|
|
377
|
+
.describe("Spec format. 'auto' (default) detects from extension/content"),
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
export const GenerateApiModelsSchema = z.object({
|
|
381
|
+
source: z.string().describe("URL or file path to OpenAPI spec"),
|
|
382
|
+
language: z.enum(['typescript', 'python']).describe("Target language for models"),
|
|
383
|
+
format: z.enum(['auto', 'json', 'yaml']).optional()
|
|
384
|
+
.describe("Spec format (default: auto)"),
|
|
385
|
+
style: z.enum(['interface', 'type']).optional()
|
|
386
|
+
.describe("TypeScript only: 'interface' (default) or 'type' aliases"),
|
|
387
|
+
pythonStyle: z.enum(['dataclass', 'pydantic', 'typeddict']).optional()
|
|
388
|
+
.describe("Python only: 'dataclass' (default), 'pydantic', or 'typeddict'"),
|
|
389
|
+
includeEnums: z.boolean().optional()
|
|
390
|
+
.describe("Generate enum types (default: true)"),
|
|
391
|
+
includeValidation: z.boolean().optional()
|
|
392
|
+
.describe("Include validation constraints as comments (default: false)"),
|
|
393
|
+
schemas: z.array(z.string()).optional()
|
|
394
|
+
.describe("Generate only these schemas (default: all)"),
|
|
395
|
+
});
|
|
396
|
+
|