@jrpool/kilotest 39.0.3 → 40.0.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/api/requestFeature.js +5 -5
- package/api/routes.js +1 -1
- package/api/schemas.js +10 -4
- package/api/testSuite.js +9 -5
- package/index.js +2 -2
- package/openapi.yaml +9 -9
- package/package.json +1 -1
- package/scripts/generate-openapi.js +1 -0
- package/CLAUDE.md +0 -5
package/api/requestFeature.js
CHANGED
|
@@ -12,13 +12,13 @@ const {sendAlert} = require('../alerts');
|
|
|
12
12
|
|
|
13
13
|
// Returns the response body.
|
|
14
14
|
exports.response = async args => {
|
|
15
|
-
const [
|
|
15
|
+
const [feature = ''] = args;
|
|
16
16
|
// Initialize the response content.
|
|
17
17
|
const responseContent = {
|
|
18
18
|
'details about your request': null
|
|
19
19
|
};
|
|
20
|
-
// If the
|
|
21
|
-
if (!
|
|
20
|
+
// If the requested feature or improvement is empty:
|
|
21
|
+
if (!feature) {
|
|
22
22
|
// Add this to the response content.
|
|
23
23
|
responseContent['details about your request'] = {
|
|
24
24
|
error: 'request invalid: request is empty'
|
|
@@ -27,7 +27,7 @@ exports.response = async args => {
|
|
|
27
27
|
// Otherwise, i.e. if it exists:
|
|
28
28
|
else {
|
|
29
29
|
// Notify the manager.
|
|
30
|
-
await sendAlert('MCP feature request received',
|
|
30
|
+
await sendAlert('MCP feature request received', feature);
|
|
31
31
|
// Add the disposition to the response content.
|
|
32
32
|
responseContent['details about your request'] = {
|
|
33
33
|
'date and time received': new Date().toISOString(),
|
|
@@ -43,7 +43,7 @@ exports.response = async args => {
|
|
|
43
43
|
method: 'POST',
|
|
44
44
|
URL: `${thisHost}/api/requestFeature`,
|
|
45
45
|
body: {
|
|
46
|
-
|
|
46
|
+
feature
|
|
47
47
|
},
|
|
48
48
|
'closest ancestor request': null
|
|
49
49
|
},
|
package/api/routes.js
CHANGED
|
@@ -90,7 +90,7 @@ module.exports = [
|
|
|
90
90
|
operationId: 'requestFeature',
|
|
91
91
|
method: 'post',
|
|
92
92
|
path: '/api/requestFeature',
|
|
93
|
-
summary: 'Request a
|
|
93
|
+
summary: 'Request a feature improvement or new feature',
|
|
94
94
|
bodySchema: z.object(requestFeatureSchema),
|
|
95
95
|
responseSchema: requestFeatureResponseSchema
|
|
96
96
|
}
|
package/api/schemas.js
CHANGED
|
@@ -52,7 +52,7 @@ exports.requestRetestSchema = {
|
|
|
52
52
|
|
|
53
53
|
// requestFeature: POST /api/requestFeature
|
|
54
54
|
exports.requestFeatureSchema = {
|
|
55
|
-
|
|
55
|
+
feature: z.string().describe('description of requested feature improvement or new feature')
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
// listReports takes no input; omitted (mcp.js already uses inputSchema: {}).
|
|
@@ -105,11 +105,16 @@ const thisRequestSchema = (method, bodySchema) => z.object({
|
|
|
105
105
|
'closest ancestor request': requestReferenceSchema.nullable()
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
-
const envelope = (
|
|
108
|
+
const envelope = (
|
|
109
|
+
method,
|
|
110
|
+
responseContentSchema,
|
|
111
|
+
bodySchema,
|
|
112
|
+
/** @type {z.ZodType} */ similarWebSchema = similarWebRequestsSchema
|
|
113
|
+
) => z.object({
|
|
109
114
|
'tool collection': toolsFactsSchema,
|
|
110
115
|
'tool name': z.string(),
|
|
111
116
|
'this request': thisRequestSchema(method, bodySchema),
|
|
112
|
-
'URLs of similar requests for web users':
|
|
117
|
+
'URLs of similar requests for web users': similarWebSchema,
|
|
113
118
|
'response metadata': responseMetadataSchema,
|
|
114
119
|
'response content': responseContentSchema
|
|
115
120
|
});
|
|
@@ -293,5 +298,6 @@ exports.requestFeatureResponseSchema = envelope(
|
|
|
293
298
|
disposition: z.string()
|
|
294
299
|
})
|
|
295
300
|
])}),
|
|
296
|
-
z.object(exports.requestFeatureSchema)
|
|
301
|
+
z.object(exports.requestFeatureSchema),
|
|
302
|
+
z.null()
|
|
297
303
|
);
|
package/api/testSuite.js
CHANGED
|
@@ -272,13 +272,17 @@ const requestService = async () => {
|
|
|
272
272
|
return;
|
|
273
273
|
}
|
|
274
274
|
console.log('======================\nRequest: Make a feature request');
|
|
275
|
-
path =
|
|
275
|
+
path = '/api/requestFeature';
|
|
276
|
+
const featureRequest = 'Do the impossible';
|
|
276
277
|
body = await submitRequest(path, method, {
|
|
277
|
-
feature:
|
|
278
|
+
feature: featureRequest
|
|
278
279
|
});
|
|
279
|
-
|
|
280
|
-
requestDetails =
|
|
281
|
-
if (
|
|
280
|
+
const feature = body?.['this request']?.body?.feature ?? {};
|
|
281
|
+
requestDetails = body?.['response content']?.['details about your request'] ?? {};
|
|
282
|
+
if (
|
|
283
|
+
feature !== featureRequest
|
|
284
|
+
|| !requestDetails.disposition?.includes('received and logged')
|
|
285
|
+
) {
|
|
282
286
|
console.log(`requestDetails: ${JSON.stringify(requestDetails, null, 2)}`);
|
|
283
287
|
return;
|
|
284
288
|
}
|
package/index.js
CHANGED
|
@@ -750,10 +750,10 @@ const requestHandler = async (request, response) => {
|
|
|
750
750
|
}
|
|
751
751
|
// Otherwise, if the service is to receive a feature request:
|
|
752
752
|
else if (segments[0] === 'requestFeature') {
|
|
753
|
-
const {
|
|
753
|
+
const {feature} = postData;
|
|
754
754
|
// Get the response body.
|
|
755
755
|
const responseBody = await require(path.join(__dirname, 'api', 'requestFeature'))
|
|
756
|
-
.response(
|
|
756
|
+
.response([feature]);
|
|
757
757
|
// Send it.
|
|
758
758
|
setHeaders('application/json', null, 'ultra');
|
|
759
759
|
response.end(JSON.stringify(responseBody));
|
package/openapi.yaml
CHANGED
|
@@ -2,7 +2,7 @@ openapi: 3.1.0
|
|
|
2
2
|
info:
|
|
3
3
|
title: Kilotest API
|
|
4
4
|
description: 'Kilotest is an ensemble testing and reporting service for front-end web quality. It uses an ensemble of 10 rule engines to test public web pages for front-end quality (accessibility, usability, and standards conformity). Kilotest acts as a web server for human users, an MCP server for AI platforms, and an API for programmatic access. With this API you can request that a page be tested or retested, discover available reports, incrementally retrieve facts from a report: from what reports are available, to what issues were reported in one report, to what elements violated one issue, to what diagnoses rule engines gave for one violation.'
|
|
5
|
-
version: 39.0.
|
|
5
|
+
version: 39.0.3
|
|
6
6
|
license:
|
|
7
7
|
name: MIT
|
|
8
8
|
identifier: MIT
|
|
@@ -1045,21 +1045,21 @@ paths:
|
|
|
1045
1045
|
/api/requestFeature:
|
|
1046
1046
|
post:
|
|
1047
1047
|
operationId: requestFeature
|
|
1048
|
-
summary: Request a
|
|
1048
|
+
summary: Request a feature improvement or new feature
|
|
1049
1049
|
requestBody:
|
|
1050
1050
|
content:
|
|
1051
1051
|
application/json:
|
|
1052
1052
|
schema:
|
|
1053
1053
|
type: object
|
|
1054
1054
|
properties:
|
|
1055
|
-
|
|
1055
|
+
feature:
|
|
1056
1056
|
type: string
|
|
1057
|
-
description: description of requested
|
|
1057
|
+
description: description of requested feature improvement or new feature
|
|
1058
1058
|
required:
|
|
1059
|
-
-
|
|
1059
|
+
- feature
|
|
1060
1060
|
responses:
|
|
1061
1061
|
'200':
|
|
1062
|
-
description: Request a
|
|
1062
|
+
description: Request a feature improvement or new feature
|
|
1063
1063
|
content:
|
|
1064
1064
|
application/json:
|
|
1065
1065
|
schema:
|
|
@@ -1082,11 +1082,11 @@ paths:
|
|
|
1082
1082
|
body:
|
|
1083
1083
|
type: object
|
|
1084
1084
|
properties:
|
|
1085
|
-
|
|
1085
|
+
feature:
|
|
1086
1086
|
type: string
|
|
1087
|
-
description: description of requested
|
|
1087
|
+
description: description of requested feature improvement or new feature
|
|
1088
1088
|
required:
|
|
1089
|
-
-
|
|
1089
|
+
- feature
|
|
1090
1090
|
additionalProperties: false
|
|
1091
1091
|
closest ancestor request:
|
|
1092
1092
|
anyOf:
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ const outputPath = path.join(__dirname, '..', 'openapi.yaml');
|
|
|
20
20
|
|
|
21
21
|
// Builds the paths object for createDocument from the route table.
|
|
22
22
|
const buildPaths = () => {
|
|
23
|
+
/** @type {import('zod-openapi').ZodOpenApiPathsObject} */
|
|
23
24
|
const paths = {};
|
|
24
25
|
routes.forEach(route => {
|
|
25
26
|
const {method, path: routePath, summary, pathParamsSchema, bodySchema, responseSchema} = route;
|
package/CLAUDE.md
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
# Cascade Rules
|
|
2
|
-
|
|
3
|
-
- Ask mode: If the current mode is Ask, answer questions and provide code, diffs, or edit suggestions in code blocks or as plain text. Do not invite the user to switch to Normal or Code mode or any mode that permits writing files.
|
|
4
|
-
- Comply with the current convention to omit line breaks in long lines in `.md` files and in code comments.
|
|
5
|
-
- In conversation responses (not files), when a Markdown table cell would contain a line longer than 120 characters divided by the number of columns, insert `<br>` tags to keep displayed line lengths shorter than that maximum, since raw newlines are not valid inside table cells. If this rule makes any table cumbersome, use a non-tabular format, such as a list, instead.
|