@jrpool/kilotest 31.2.0 → 31.2.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.
Files changed (3) hide show
  1. package/README.md +5 -1
  2. package/index.js +11 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@ The testing paradigm employed by Kilotest is discussed in these papers:
12
12
  - [Testaro: Efficient Ensemble Testing for Web Accessibility](https://arxiv.org/abs/2309.10167)
13
13
  - [Accessibility Metatesting: Comparing Nine Testing Tools](https://arxiv.org/abs/2304.07591)
14
14
 
15
- Kilotest acts as a server with human users (such as you) and with one or more testing agents that obtain jobs from Kilotest and do the actual testing. Those agents are instances of the [Testaro](https://www.npmjs.com/package/testaro) package.
15
+ Kilotest acts as a server with human and agent users and with one or more testing agents that obtain jobs from Kilotest and do the actual testing. Those agents are instances of the [Testaro](https://www.npmjs.com/package/testaro) package.
16
16
 
17
17
  An active production instance of Kilotest may require multiple testing agents to handle the load, because testing one web page typically takes about 3 minutes and agents test only one page at a time.
18
18
 
@@ -42,3 +42,7 @@ Contributions are welcome! You can use GitHub issues to initiate discussions and
42
42
  ## Making Kilotest a service
43
43
 
44
44
  See the `SERVICE.md` file for instructions on how to make Kilotest a service.
45
+
46
+ ## Using Kilotest as an AI tool
47
+
48
+ See the `AI-TOOL.md` file for information about the configuration of Kilotest as an AI tool.
package/index.js CHANGED
@@ -192,6 +192,7 @@ const requestHandler = async (request, response) => {
192
192
  }
193
193
  response.setHeader('Access-Control-Allow-Origin', '*');
194
194
  const lives = {
195
+ ultra: [3, 30],
195
196
  high: [300, 3000],
196
197
  medium: [1000, 10000],
197
198
  low: [5000, 50000]
@@ -236,7 +237,7 @@ const requestHandler = async (request, response) => {
236
237
  else if (pageName === 'openapi.yaml') {
237
238
  const openapi = await fs.readFile('openapi.yaml', 'utf8');
238
239
  // Serve it.
239
- setHeaders('text/yaml', '/openapi.yaml', 'high');
240
+ setHeaders('text/yaml', '/openapi.yaml', 'medium');
240
241
  response.end(openapi);
241
242
  }
242
243
  // Otherwise, if it is for the OpenAPI specification where it is not:
@@ -249,14 +250,14 @@ const requestHandler = async (request, response) => {
249
250
  else if (pageName === 'llms.txt') {
250
251
  const llms = await fs.readFile('llms.txt', 'utf8');
251
252
  // Serve it.
252
- setHeaders('text/plain', '/llms.txt', 'high');
253
+ setHeaders('text/plain', '/llms.txt', 'medium');
253
254
  response.end(llms);
254
255
  }
255
256
  // Otherwise, if it is for the large-language-model detailed guide:
256
257
  else if (pageName === 'llms-full.txt') {
257
258
  const llmsfull = await fs.readFile('llms-full.txt', 'utf8');
258
259
  // Serve it.
259
- setHeaders('text/plain', '/llms-full.txt', 'high');
260
+ setHeaders('text/plain', '/llms-full.txt', 'medium');
260
261
  response.end(llmsfull);
261
262
  }
262
263
  // Otherwise, if it is for a full report download:
@@ -312,7 +313,7 @@ const requestHandler = async (request, response) => {
312
313
  const topic = pageName.slice(0, -5);
313
314
  // If the page can be generated:
314
315
  if (answer[topic]) {
315
- setHeaders('text/html', `${pathname}${search}`, 'medium');
316
+ setHeaders('text/html', `${pathname}${search}`, 'ultra');
316
317
  // Get the answer data.
317
318
  const answerData = await answer[topic](pathTail, search);
318
319
  // If they are valid:
@@ -340,7 +341,7 @@ const requestHandler = async (request, response) => {
340
341
  // Get the response (potentially error) data.
341
342
  const responseData = await require(path.join(__dirname, 'targets', 'api')).response(specs);
342
343
  // Send them.
343
- setHeaders('application/json', null, 'high');
344
+ setHeaders('application/json', null, 'ultra');
344
345
  response.end(JSON.stringify(responseData));
345
346
  }
346
347
  // Otherwise, if the service is provision of issue statistics for a report:
@@ -435,7 +436,7 @@ const requestHandler = async (request, response) => {
435
436
  // If the request is valid:
436
437
  if (isTimeStamp(timeStamp) && isJobID(jobID) && why) {
437
438
  // Serve response headers.
438
- setHeaders('text/html', `${pathname}${search}`, 'high');
439
+ setHeaders('text/html', `${pathname}${search}`, 'ultra');
439
440
  // Get the answer data.
440
441
  const answerData = await require(path.join(__dirname, 'retestRec', 'index'))
441
442
  .answer(pathTail, why);
@@ -469,7 +470,7 @@ const requestHandler = async (request, response) => {
469
470
  // Otherwise, i.e. if no report on the page is available:
470
471
  else {
471
472
  // Serve headers for a response.
472
- setHeaders('text/html', `${pathname}${search}`, 'high');
473
+ setHeaders('text/html', `${pathname}${search}`, 'ultra');
473
474
  // Get the answer data.
474
475
  const answerData = await require(path.join(__dirname, 'testRec', 'index'))
475
476
  .answer(what, url, why);
@@ -498,7 +499,7 @@ const requestHandler = async (request, response) => {
498
499
  // If the request is valid:
499
500
  if (url.startsWith('https://') && authCode === process.env.AUTH_CODE) {
500
501
  // Set the non-location headers for a response.
501
- setHeaders('text/html', null, 'high');
502
+ setHeaders('text/html', null, 'ultra');
502
503
  // If the request is an approval:
503
504
  if (what) {
504
505
  // Set a location header for a response.
@@ -543,7 +544,7 @@ const requestHandler = async (request, response) => {
543
544
  else if (pageName === 'reannotate.html') {
544
545
  const {authCode} = postData;
545
546
  // Set headers for a response.
546
- setHeaders('text/html', `${pathname}${search}`, 'high');
547
+ setHeaders('text/html', `${pathname}${search}`, 'ultra');
547
548
  // Get the answer data.
548
549
  const answerData = await require(path.join(__dirname, 'reannotate', 'index'))
549
550
  .answer(authCode);
@@ -708,7 +709,7 @@ const requestHandler = async (request, response) => {
708
709
  const responseData = await require(path.join(__dirname, 'testRecForm', 'api'))
709
710
  .response(what, url, why);
710
711
  // Send them.
711
- setHeaders('application/json', null, 'high');
712
+ setHeaders('application/json', null, 'ultra');
712
713
  response.end(JSON.stringify(responseData));
713
714
  }
714
715
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jrpool/kilotest",
3
- "version": "31.2.0",
3
+ "version": "31.2.4",
4
4
  "description": "An ensemble testing service with a focus on accessibility",
5
5
  "main": "index.js",
6
6
  "scripts": {