@bryan-thompson/inspector-assessment-client 1.32.2 → 1.32.3
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/lib/lib/assessment/configSchemas.d.ts +763 -0
- package/lib/lib/assessment/configSchemas.d.ts.map +1 -0
- package/lib/lib/assessment/configSchemas.js +187 -0
- package/lib/lib/assessment/coreTypes.d.ts +41 -0
- package/lib/lib/assessment/coreTypes.d.ts.map +1 -1
- package/lib/lib/assessment/jsonlEventSchemas.d.ts +1667 -0
- package/lib/lib/assessment/jsonlEventSchemas.d.ts.map +1 -0
- package/lib/lib/assessment/jsonlEventSchemas.js +437 -0
- package/lib/lib/assessment/progressTypes.d.ts +49 -1
- package/lib/lib/assessment/progressTypes.d.ts.map +1 -1
- package/lib/services/assessment/AssessmentOrchestrator.d.ts +3 -3
- package/lib/services/assessment/AssessmentOrchestrator.d.ts.map +1 -1
- package/lib/services/assessment/TestDataGenerator.d.ts +42 -8
- package/lib/services/assessment/TestDataGenerator.d.ts.map +1 -1
- package/lib/services/assessment/TestDataGenerator.js +23 -153
- package/lib/services/assessment/modules/CrossCapabilitySecurityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/DeveloperExperienceAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/DocumentationAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ErrorHandlingAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ErrorHandlingAssessor.js +18 -1
- package/lib/services/assessment/modules/FunctionalityAssessor.d.ts +2 -2
- package/lib/services/assessment/modules/FunctionalityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/FunctionalityAssessor.js +6 -3
- package/lib/services/assessment/modules/MCPSpecComplianceAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/PortabilityAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ProhibitedLibrariesAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/ProtocolComplianceAssessor.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/SecurityPayloadTester.d.ts.map +1 -1
- package/lib/services/assessment/modules/securityTests/SecurityPayloadTester.js +78 -2
- package/lib/services/assessment/testdata/index.d.ts +12 -0
- package/lib/services/assessment/testdata/index.d.ts.map +1 -0
- package/lib/services/assessment/testdata/index.js +11 -0
- package/lib/services/assessment/testdata/realistic-values.d.ts +126 -0
- package/lib/services/assessment/testdata/realistic-values.d.ts.map +1 -0
- package/lib/services/assessment/testdata/realistic-values.js +162 -0
- package/lib/services/assessment/testdata/tool-category-data.d.ts +28 -0
- package/lib/services/assessment/testdata/tool-category-data.d.ts.map +1 -0
- package/lib/services/assessment/testdata/tool-category-data.js +60 -0
- package/package.json +1 -1
|
@@ -8,11 +8,19 @@
|
|
|
8
8
|
* @internal
|
|
9
9
|
* @module assessment/TestDataGenerator
|
|
10
10
|
*/
|
|
11
|
+
import { REALISTIC_DATA, TOOL_CATEGORY_DATA, SPECIFIC_FIELD_PATTERNS, } from "./testdata/index.js";
|
|
11
12
|
export class TestDataGenerator {
|
|
12
13
|
// Optional Claude Code bridge for intelligent test generation
|
|
13
14
|
static claudeBridge = null;
|
|
14
15
|
// Optional logger for diagnostic output
|
|
15
16
|
static logger = null;
|
|
17
|
+
/**
|
|
18
|
+
* Re-exported REALISTIC_DATA for backward compatibility.
|
|
19
|
+
* Data is now defined in ./testdata/realistic-values.ts
|
|
20
|
+
* Accessed via (TestDataGenerator as any).REALISTIC_DATA in tests.
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
static REALISTIC_DATA = REALISTIC_DATA;
|
|
16
24
|
/**
|
|
17
25
|
* Set the Claude Code bridge for intelligent test generation
|
|
18
26
|
* Call this once during initialization if Claude integration is enabled
|
|
@@ -34,99 +42,6 @@ export class TestDataGenerator {
|
|
|
34
42
|
return (this.claudeBridge !== null &&
|
|
35
43
|
this.claudeBridge.isFeatureEnabled("intelligentTestGeneration"));
|
|
36
44
|
}
|
|
37
|
-
// Realistic data pools for different types - using values that are more likely to exist
|
|
38
|
-
static REALISTIC_DATA = {
|
|
39
|
-
urls: [
|
|
40
|
-
"https://www.google.com", // Public, always accessible
|
|
41
|
-
"https://api.github.com/users/octocat", // Public API endpoint that exists
|
|
42
|
-
"https://jsonplaceholder.typicode.com/posts/1", // Test API that always works
|
|
43
|
-
"https://httpbin.org/get", // HTTP testing service
|
|
44
|
-
"https://example.com", // RFC 2606 reserved domain for examples
|
|
45
|
-
"https://www.wikipedia.org", // Public, stable site
|
|
46
|
-
"https://api.openweathermap.org/data/2.5/weather?q=London", // Public API
|
|
47
|
-
],
|
|
48
|
-
emails: [
|
|
49
|
-
"admin@example.com", // Common admin email
|
|
50
|
-
"support@example.com", // Common support email
|
|
51
|
-
"info@example.com", // Common info email
|
|
52
|
-
"test@test.com", // Generic test email
|
|
53
|
-
"user@domain.com", // Generic user email
|
|
54
|
-
"noreply@example.com", // Common no-reply format
|
|
55
|
-
"hello@world.com", // Simple, memorable
|
|
56
|
-
],
|
|
57
|
-
names: [
|
|
58
|
-
"Default", // Common default name
|
|
59
|
-
"Admin", // Common admin user
|
|
60
|
-
"Test User", // Clear test user
|
|
61
|
-
"Sample Item", // Generic sample
|
|
62
|
-
"Example Project", // Clear example
|
|
63
|
-
"Demo Application", // Common demo name
|
|
64
|
-
"Main", // Common main/primary name
|
|
65
|
-
],
|
|
66
|
-
ids: [
|
|
67
|
-
"1", // Simple numeric ID that often exists
|
|
68
|
-
"123", // Common test ID
|
|
69
|
-
"550e8400-e29b-41d4-a716-446655440000", // Valid UUID v4 (replaces "test")
|
|
70
|
-
"default", // Common default ID
|
|
71
|
-
"main", // Common main ID
|
|
72
|
-
"264051cd-48ab-80ff-864e-d1aa9bc41429", // Valid UUID from realistic data
|
|
73
|
-
"00000000-0000-0000-0000-000000000000", // Nil UUID (often used as placeholder)
|
|
74
|
-
"admin", // Common admin ID
|
|
75
|
-
"user1", // Common user ID pattern
|
|
76
|
-
],
|
|
77
|
-
paths: [
|
|
78
|
-
"/tmp/test.txt", // Common temp file path (usually writable)
|
|
79
|
-
"/home", // Common home directory
|
|
80
|
-
"./README.md", // Often exists in projects
|
|
81
|
-
"./package.json", // Common in Node projects
|
|
82
|
-
"./src", // Common source directory
|
|
83
|
-
"./test", // Common test directory
|
|
84
|
-
"./config", // Common config directory
|
|
85
|
-
"/var/log", // Common log directory (readable)
|
|
86
|
-
"/etc", // Common config directory (readable)
|
|
87
|
-
],
|
|
88
|
-
queries: [
|
|
89
|
-
"test", // Simple search term
|
|
90
|
-
"hello", // Common greeting
|
|
91
|
-
"*", // Wildcard that matches everything
|
|
92
|
-
"name", // Common field name
|
|
93
|
-
"id:1", // Common ID search
|
|
94
|
-
"status:active", // Common status filter
|
|
95
|
-
"type:user", // Common type filter
|
|
96
|
-
"limit:10", // Common pagination
|
|
97
|
-
'{"match_all": {}}', // Elasticsearch match all
|
|
98
|
-
],
|
|
99
|
-
numbers: [0, 1, 10, 100, 1000, 5, 50, 200, 404, 500],
|
|
100
|
-
booleans: [true, false],
|
|
101
|
-
jsonObjects: [
|
|
102
|
-
{ message: "Hello World" }, // Simple message object
|
|
103
|
-
{ status: "ok", code: 200 }, // Common status response
|
|
104
|
-
{ data: [], total: 0 }, // Empty result set
|
|
105
|
-
{ id: 1, name: "Test" }, // Simple entity
|
|
106
|
-
{ success: true }, // Common success response
|
|
107
|
-
{ error: false }, // Common no-error response
|
|
108
|
-
{ results: [] }, // Common empty results
|
|
109
|
-
{}, // Empty object (often valid)
|
|
110
|
-
],
|
|
111
|
-
arrays: [
|
|
112
|
-
[], // Empty array (often valid)
|
|
113
|
-
[1], // Single item
|
|
114
|
-
["a", "b", "c"], // Simple string array
|
|
115
|
-
[1, 2, 3], // Simple number array
|
|
116
|
-
[{ id: 1 }, { id: 2 }], // Simple object array
|
|
117
|
-
["test"], // Single test item
|
|
118
|
-
[true, false], // Boolean array
|
|
119
|
-
],
|
|
120
|
-
timestamps: [
|
|
121
|
-
new Date().toISOString(), // Current time (always valid)
|
|
122
|
-
new Date(Date.now() - 86400000).toISOString(), // Yesterday
|
|
123
|
-
new Date(Date.now() + 86400000).toISOString(), // Tomorrow
|
|
124
|
-
"2024-01-01T00:00:00Z", // New Year 2024
|
|
125
|
-
"2023-12-31T23:59:59Z", // End of 2023
|
|
126
|
-
new Date(0).toISOString(), // Unix epoch
|
|
127
|
-
"2024-06-15T12:00:00Z", // Midday mid-year
|
|
128
|
-
],
|
|
129
|
-
};
|
|
130
45
|
/**
|
|
131
46
|
* Generate multiple test scenarios for a tool
|
|
132
47
|
* Uses Claude Code if available for intelligent generation,
|
|
@@ -427,7 +342,7 @@ export class TestDataGenerator {
|
|
|
427
342
|
? "https://very-long-domain-name-for-testing-maximum-length.example.com/path/to/resource?param1=value1¶m2=value2"
|
|
428
343
|
: variant === "special"
|
|
429
344
|
? "https://example.com/path?special=!@#$%^&*()"
|
|
430
|
-
:
|
|
345
|
+
: REALISTIC_DATA.urls[Math.floor(Math.random() * REALISTIC_DATA.urls.length)];
|
|
431
346
|
}
|
|
432
347
|
if (lowerFieldName.includes("email") ||
|
|
433
348
|
lowerFieldName.includes("mail")) {
|
|
@@ -437,7 +352,7 @@ export class TestDataGenerator {
|
|
|
437
352
|
? "very.long.email.address.for.testing@subdomain.example-company.co.uk"
|
|
438
353
|
: variant === "special"
|
|
439
354
|
? "user+tag@example.com"
|
|
440
|
-
:
|
|
355
|
+
: REALISTIC_DATA.emails[Math.floor(Math.random() * REALISTIC_DATA.emails.length)];
|
|
441
356
|
}
|
|
442
357
|
if (lowerFieldName.includes("path") ||
|
|
443
358
|
lowerFieldName.includes("file") ||
|
|
@@ -449,7 +364,7 @@ export class TestDataGenerator {
|
|
|
449
364
|
? "/very/long/path/to/deeply/nested/directory/structure/for/testing/file.txt"
|
|
450
365
|
: variant === "special"
|
|
451
366
|
? "./path/with spaces/and-special#chars.txt"
|
|
452
|
-
:
|
|
367
|
+
: REALISTIC_DATA.paths[Math.floor(Math.random() * REALISTIC_DATA.paths.length)];
|
|
453
368
|
}
|
|
454
369
|
if (lowerFieldName.includes("query") ||
|
|
455
370
|
lowerFieldName.includes("search") ||
|
|
@@ -460,7 +375,7 @@ export class TestDataGenerator {
|
|
|
460
375
|
? "very long search query with many terms for testing maximum input length handling"
|
|
461
376
|
: variant === "special"
|
|
462
377
|
? 'search with "quotes" and special: characters!'
|
|
463
|
-
:
|
|
378
|
+
: REALISTIC_DATA.queries[Math.floor(Math.random() * REALISTIC_DATA.queries.length)];
|
|
464
379
|
}
|
|
465
380
|
if (lowerFieldName.includes("id") ||
|
|
466
381
|
lowerFieldName.includes("key") ||
|
|
@@ -490,7 +405,7 @@ export class TestDataGenerator {
|
|
|
490
405
|
? "1" // Minimal non-empty ID to avoid creating invalid entities
|
|
491
406
|
: variant === "maximum"
|
|
492
407
|
? "very_long_identifier_string_for_testing_maximum_length_handling_in_system"
|
|
493
|
-
:
|
|
408
|
+
: REALISTIC_DATA.ids[Math.floor(Math.random() * REALISTIC_DATA.ids.length)];
|
|
494
409
|
}
|
|
495
410
|
if (lowerFieldName.includes("name") ||
|
|
496
411
|
lowerFieldName.includes("title") ||
|
|
@@ -501,11 +416,11 @@ export class TestDataGenerator {
|
|
|
501
416
|
? "Very Long Name For Testing Maximum String Length Handling In The System"
|
|
502
417
|
: variant === "special"
|
|
503
418
|
? "Name with Special™ Characters® and Émojis 🎉"
|
|
504
|
-
:
|
|
419
|
+
: REALISTIC_DATA.names[Math.floor(Math.random() * REALISTIC_DATA.names.length)];
|
|
505
420
|
}
|
|
506
421
|
if (lowerFieldName.includes("date") ||
|
|
507
422
|
lowerFieldName.includes("time")) {
|
|
508
|
-
return variant === "empty" ? "" :
|
|
423
|
+
return variant === "empty" ? "" : REALISTIC_DATA.timestamps[0];
|
|
509
424
|
}
|
|
510
425
|
// Default string value - try to be contextual
|
|
511
426
|
return variant === "empty"
|
|
@@ -596,13 +511,13 @@ export class TestDataGenerator {
|
|
|
596
511
|
if (lowerFieldName.includes("id")) {
|
|
597
512
|
return ["id_1", "id_2", "id_3"];
|
|
598
513
|
}
|
|
599
|
-
return
|
|
514
|
+
return REALISTIC_DATA.arrays[1];
|
|
600
515
|
case "object":
|
|
601
516
|
// Don't return empty object for "empty" variant
|
|
602
517
|
// Let it fall through to generate minimal object properties
|
|
603
518
|
// This avoids creating objects with no required fields
|
|
604
519
|
if (variant === "maximum") {
|
|
605
|
-
return
|
|
520
|
+
return REALISTIC_DATA.jsonObjects[4]; // Common success response
|
|
606
521
|
}
|
|
607
522
|
// Context-aware object generation
|
|
608
523
|
if (lowerFieldName.includes("config") ||
|
|
@@ -627,9 +542,7 @@ export class TestDataGenerator {
|
|
|
627
542
|
? { limit: 1 }
|
|
628
543
|
: { status: "active", type: "user", limit: 10 };
|
|
629
544
|
}
|
|
630
|
-
return variant === "empty"
|
|
631
|
-
? { id: 1 }
|
|
632
|
-
: this.REALISTIC_DATA.jsonObjects[0];
|
|
545
|
+
return variant === "empty" ? { id: 1 } : REALISTIC_DATA.jsonObjects[0];
|
|
633
546
|
default:
|
|
634
547
|
// Return safe default instead of null to prevent tool crashes
|
|
635
548
|
return "test";
|
|
@@ -699,53 +612,10 @@ export class TestDataGenerator {
|
|
|
699
612
|
// Tool Category-Aware Generation
|
|
700
613
|
// ============================================================================
|
|
701
614
|
/**
|
|
702
|
-
*
|
|
703
|
-
*
|
|
704
|
-
*/
|
|
705
|
-
static TOOL_CATEGORY_DATA = {
|
|
706
|
-
// Keys must match ToolClassifier category names (lowercase)
|
|
707
|
-
calculator: {
|
|
708
|
-
default: ["2+2", "10*5", "100/4", "sqrt(16)", "15-7"],
|
|
709
|
-
},
|
|
710
|
-
search_retrieval: {
|
|
711
|
-
default: [
|
|
712
|
-
"hello world",
|
|
713
|
-
"example query",
|
|
714
|
-
"recent changes",
|
|
715
|
-
"find documents",
|
|
716
|
-
],
|
|
717
|
-
},
|
|
718
|
-
system_exec: {
|
|
719
|
-
default: ["echo hello", "pwd", "date", "whoami"],
|
|
720
|
-
},
|
|
721
|
-
url_fetcher: {
|
|
722
|
-
default: [
|
|
723
|
-
"https://api.github.com",
|
|
724
|
-
"https://httpbin.org/get",
|
|
725
|
-
"https://jsonplaceholder.typicode.com/posts/1",
|
|
726
|
-
],
|
|
727
|
-
},
|
|
728
|
-
};
|
|
729
|
-
/**
|
|
730
|
-
* Field names that indicate specific data types regardless of tool category.
|
|
731
|
-
* These take precedence over category-specific generation.
|
|
615
|
+
* Re-exported TOOL_CATEGORY_DATA for backward compatibility.
|
|
616
|
+
* Data is now defined in ./testdata/tool-category-data.ts
|
|
732
617
|
*/
|
|
733
|
-
static
|
|
734
|
-
/url/i,
|
|
735
|
-
/endpoint/i,
|
|
736
|
-
/link/i,
|
|
737
|
-
/email/i,
|
|
738
|
-
/mail/i,
|
|
739
|
-
/path/i,
|
|
740
|
-
/file/i,
|
|
741
|
-
/directory/i,
|
|
742
|
-
/folder/i,
|
|
743
|
-
/uuid/i,
|
|
744
|
-
/page_id/i,
|
|
745
|
-
/database_id/i,
|
|
746
|
-
/user_id/i,
|
|
747
|
-
/block_id/i,
|
|
748
|
-
];
|
|
618
|
+
static TOOL_CATEGORY_DATA = TOOL_CATEGORY_DATA;
|
|
749
619
|
/**
|
|
750
620
|
* Generate a value using tool category as hint.
|
|
751
621
|
* For specific field names (url, email, path, etc.), uses field-name detection.
|
|
@@ -760,13 +630,13 @@ export class TestDataGenerator {
|
|
|
760
630
|
static generateValueForCategory(fieldName, schema, category) {
|
|
761
631
|
// Specific field names (url, email, path, etc.) take precedence over category
|
|
762
632
|
// These indicate explicit data type requirements regardless of tool category
|
|
763
|
-
const isSpecificFieldName =
|
|
633
|
+
const isSpecificFieldName = SPECIFIC_FIELD_PATTERNS.some((pattern) => pattern.test(fieldName));
|
|
764
634
|
if (isSpecificFieldName) {
|
|
765
635
|
return this.generateSingleValue(fieldName, schema);
|
|
766
636
|
}
|
|
767
637
|
// For specific tool categories (not GENERIC), use category-specific test values
|
|
768
638
|
// This ensures calculator tools get math expressions, search tools get search queries, etc.
|
|
769
|
-
const categoryData =
|
|
639
|
+
const categoryData = TOOL_CATEGORY_DATA[category];
|
|
770
640
|
if (categoryData?.default) {
|
|
771
641
|
return categoryData.default[0];
|
|
772
642
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CrossCapabilitySecurityAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/CrossCapabilitySecurityAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,iCAAiC,
|
|
1
|
+
{"version":3,"file":"CrossCapabilitySecurityAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/CrossCapabilitySecurityAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,iCAAiC,EAIlC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,iBAAiB,EAGlB,MAAM,2BAA2B,CAAC;AAwDnC,qBAAa,+BAAgC,SAAQ,YAAY;IACzD,MAAM,CACV,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,iCAAiC,CAAC;IAsE7C;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAqD9B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAoEjC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAqEhC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAiB9B;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAanC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAsG/B,OAAO,CAAC,oBAAoB;IAa5B,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,sBAAsB;IAqB9B,OAAO,CAAC,8BAA8B;IAUtC,OAAO,CAAC,mBAAmB;IA+B3B,OAAO,CAAC,uBAAuB;CA+ChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeveloperExperienceAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/DeveloperExperienceAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAEhB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"DeveloperExperienceAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/DeveloperExperienceAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAEhB,gBAAgB,EAKjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,yCAAyC;IACzC,aAAa,EAAE,oBAAoB,CAAC;IACpC,qCAAqC;IACrC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,gDAAgD;IAChD,MAAM,EAAE,gBAAgB,CAAC;IACzB,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iDAAiD;IACjD,MAAM,EAAE;QACN,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;CACH;AAED,qBAAa,2BAA4B,SAAQ,YAAY,CAAC,6BAA6B,CAAC;IACpF,MAAM,CACV,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,6BAA6B,CAAC;IAsEzC,OAAO,CAAC,oBAAoB;IAmH5B,OAAO,CAAC,yBAAyB;IA4CjC,OAAO,CAAC,wBAAwB;IAiBhC,OAAO,CAAC,sBAAsB;IA8B9B,OAAO,CAAC,aAAa;IAKrB,OAAO,CAAC,mBAAmB;IAoB3B,OAAO,CAAC,mBAAmB;IAwC3B,OAAO,CAAC,wBAAwB;IAahC,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,mBAAmB;IA6B3B;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAkBlC;;;;;OAKG;IACH,OAAO,CAAC,sBAAsB;IAW9B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,qBAAqB;IAgC7B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAgBjC;;;OAGG;IACH,OAAO,CAAC,aAAa;IAoBrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAsEzB,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,uBAAuB;IAsC/B,OAAO,CAAC,uBAAuB;IAwC/B,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,kBAAkB;IAsC1B,OAAO,CAAC,iBAAiB;IAiCzB,OAAO,CAAC,aAAa;IAQrB,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,sBAAsB;IAM9B,OAAO,CAAC,mBAAmB;IAyC3B,OAAO,CAAC,uBAAuB;CAmDhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentationAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/DocumentationAssessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EAKxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentationAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/DocumentationAssessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EAKxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;gBACzC,MAAM,EAAE,uBAAuB;IAYrC,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAyC1E,OAAO,CAAC,oBAAoB;IAuJ5B;;;OAGG;IACH,OAAO,CAAC,yBAAyB;IAuEjC;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAiBhC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAmC9B;;OAEG;IACH,OAAO,CAAC,aAAa;IAKrB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAqB3B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IA4C3B,OAAO,CAAC,wBAAwB;IAchC,OAAO,CAAC,eAAe;IAavB,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,cAAc;IAUtB;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAY9B;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IA4B3B,OAAO,CAAC,4BAA4B;IAmBpC,OAAO,CAAC,mBAAmB;IAyB3B,OAAO,CAAC,uBAAuB;CA+BhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorHandlingAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/ErrorHandlingAssessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,
|
|
1
|
+
{"version":3,"file":"ErrorHandlingAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/ErrorHandlingAssessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EAKxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAS9D,qBAAa,qBAAsB,SAAQ,YAAY;IACrD,OAAO,CAAC,iBAAiB,CAA4B;IACrD,OAAO,CAAC,oBAAoB,CAAuB;gBAEvC,MAAM,EAAE,uBAAuB;IAMrC,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IA0F1E,OAAO,CAAC,qBAAqB;YAuDf,qBAAqB;YA0BrB,qBAAqB;YAsGrB,cAAc;YAsFd,iBAAiB;YAiEjB,kBAAkB;IAgEhC,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,uBAAuB;IAkC/B,OAAO,CAAC,0BAA0B;IAkClC,OAAO,CAAC,uBAAuB;IA4B/B;;;;;;;;;;OAUG;IACH,OAAO,CAAC,4BAA4B;IAgEpC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAc/B;;;OAGG;IACH,OAAO,CAAC,8BAA8B;IAetC,OAAO,CAAC,gBAAgB;IA8GxB,OAAO,CAAC,4BAA4B;IAapC,OAAO,CAAC,mBAAmB;IAuE3B,OAAO,CAAC,uBAAuB;CA4ChC"}
|
|
@@ -26,6 +26,23 @@ export class ErrorHandlingAssessor extends BaseAssessor {
|
|
|
26
26
|
this.logger.info(`Testing ${toolsToTest.length} tools for error handling with concurrency limit of ${concurrency}`);
|
|
27
27
|
const allToolTests = await Promise.all(toolsToTest.map((tool) => limit(async () => {
|
|
28
28
|
const toolTests = await this.testToolErrorHandling(tool, context.callTool);
|
|
29
|
+
// Emit per-tool validation summary for auditor UI (Phase 7)
|
|
30
|
+
if (context.onProgress) {
|
|
31
|
+
// Count failures by test type (failed = tool didn't reject invalid input)
|
|
32
|
+
const wrongType = toolTests.filter((t) => t.testType === "wrong_type" && !t.passed).length;
|
|
33
|
+
const missingRequired = toolTests.filter((t) => t.testType === "missing_required" && !t.passed).length;
|
|
34
|
+
const invalidValues = toolTests.filter((t) => t.testType === "invalid_values" && !t.passed).length;
|
|
35
|
+
const summaryEvent = {
|
|
36
|
+
type: "validation_summary",
|
|
37
|
+
tool: tool.name,
|
|
38
|
+
wrongType,
|
|
39
|
+
missingRequired,
|
|
40
|
+
extraParams: 0, // Not tested in current implementation
|
|
41
|
+
nullValues: 0, // Not tested explicitly
|
|
42
|
+
invalidValues,
|
|
43
|
+
};
|
|
44
|
+
context.onProgress(summaryEvent);
|
|
45
|
+
}
|
|
29
46
|
// Add delay between tests to avoid rate limiting
|
|
30
47
|
if (this.config.delayBetweenTests &&
|
|
31
48
|
this.config.delayBetweenTests > 0) {
|
|
@@ -354,7 +371,7 @@ export class ErrorHandlingAssessor extends BaseAssessor {
|
|
|
354
371
|
}
|
|
355
372
|
getToolSchema(tool) {
|
|
356
373
|
if (!tool.inputSchema)
|
|
357
|
-
return
|
|
374
|
+
return null;
|
|
358
375
|
return typeof tool.inputSchema === "string"
|
|
359
376
|
? this.safeJsonParse(tool.inputSchema)
|
|
360
377
|
: tool.inputSchema;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Functionality Assessor Module
|
|
3
3
|
* Tests tool functionality and basic operations
|
|
4
4
|
*/
|
|
5
|
-
import { FunctionalityAssessment } from "../../../lib/assessmentTypes.js";
|
|
5
|
+
import { FunctionalityAssessment, JSONSchema7 } from "../../../lib/assessmentTypes.js";
|
|
6
6
|
import { BaseAssessor } from "./BaseAssessor.js";
|
|
7
7
|
import { AssessmentContext } from "../AssessmentOrchestrator.js";
|
|
8
8
|
export declare class FunctionalityAssessor extends BaseAssessor {
|
|
@@ -29,7 +29,7 @@ export declare class FunctionalityAssessor extends BaseAssessor {
|
|
|
29
29
|
* Determine overall generation strategy based on field sources
|
|
30
30
|
*/
|
|
31
31
|
private determineStrategy;
|
|
32
|
-
generateTestInput(schema:
|
|
32
|
+
generateTestInput(schema: JSONSchema7): unknown;
|
|
33
33
|
private generateExplanation;
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=FunctionalityAssessor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FunctionalityAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/FunctionalityAssessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,
|
|
1
|
+
{"version":3,"file":"FunctionalityAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/FunctionalityAssessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,uBAAuB,EAGvB,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAc9D,qBAAa,qBAAsB,SAAQ,YAAY;IACrD,OAAO,CAAC,cAAc,CAAwB;IAE9C;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAoCvB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,CAAC;YAmI5D,QAAQ;IAoGtB,OAAO,CAAC,qBAAqB;IAoE7B,OAAO,CAAC,kBAAkB;IAoH1B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAe7C;IAEF;;;OAGG;IACH,OAAO,CAAC,mCAAmC;IAsF3C;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAWlB,iBAAiB,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO;IAItD,OAAO,CAAC,mBAAmB;CA+B5B"}
|
|
@@ -222,9 +222,9 @@ export class FunctionalityAssessor extends BaseAssessor {
|
|
|
222
222
|
};
|
|
223
223
|
if (!tool.inputSchema)
|
|
224
224
|
return emptyResult;
|
|
225
|
-
const schema = typeof tool.inputSchema === "string"
|
|
225
|
+
const schema = (typeof tool.inputSchema === "string"
|
|
226
226
|
? this.safeJsonParse(tool.inputSchema)
|
|
227
|
-
: tool.inputSchema;
|
|
227
|
+
: tool.inputSchema);
|
|
228
228
|
if (!schema?.properties)
|
|
229
229
|
return emptyResult;
|
|
230
230
|
const params = {};
|
|
@@ -295,8 +295,11 @@ export class FunctionalityAssessor extends BaseAssessor {
|
|
|
295
295
|
case "array":
|
|
296
296
|
// Generate array with sample items based on items schema
|
|
297
297
|
if (prop.items) {
|
|
298
|
+
// Handle items as array (tuple schema) or single schema
|
|
299
|
+
let itemsSchema = Array.isArray(prop.items)
|
|
300
|
+
? prop.items[0]
|
|
301
|
+
: prop.items;
|
|
298
302
|
// Resolve $ref and normalize union types for items schema
|
|
299
|
-
let itemsSchema = prop.items;
|
|
300
303
|
if (itemsSchema.$ref) {
|
|
301
304
|
itemsSchema = resolveRef(itemsSchema, prop);
|
|
302
305
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MCPSpecComplianceAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/MCPSpecComplianceAssessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,2BAA2B,EAM3B,uBAAuB,
|
|
1
|
+
{"version":3,"file":"MCPSpecComplianceAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/MCPSpecComplianceAssessor.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,2BAA2B,EAM3B,uBAAuB,EAMxB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,YAAY;IACzD,OAAO,CAAC,GAAG,CAAc;gBAEb,MAAM,EAAE,uBAAuB;IAa3C;;;OAGG;IACG,MAAM,CACV,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,2BAA2B,CAAC;IAyHvC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA4B9B;;;OAGG;YACW,sBAAsB;IA6BpC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAyB/B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA0C7B;;;OAGG;YACW,mBAAmB;IAsCjC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAoDnC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IA8FnC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAyFjC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAsB/B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA4B9B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA2C7B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAoF5B;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAyBjC;;OAEG;IACH,OAAO,CAAC,6BAA6B;CA0DtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PortabilityAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/PortabilityAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,qBAAqB,
|
|
1
|
+
{"version":3,"file":"PortabilityAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/PortabilityAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,qBAAqB,EAItB,MAAM,uBAAuB,CAAC;AA8H/B,qBAAa,mBAAoB,SAAQ,YAAY;IACnD;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAyHxE;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiD5B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAuE/B;;OAEG;IACH,OAAO,CAAC,QAAQ;IAiIhB;;OAEG;IACH,OAAO,CAAC,cAAc;IAkBtB;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAmClC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAqC3B;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAmDhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProhibitedLibrariesAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/ProhibitedLibrariesAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,6BAA6B,
|
|
1
|
+
{"version":3,"file":"ProhibitedLibrariesAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/ProhibitedLibrariesAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EACV,6BAA6B,EAI9B,MAAM,uBAAuB,CAAC;AAS/B,qBAAa,2BAA4B,SAAQ,YAAY;IAC3D;;OAEG;IACG,MAAM,CACV,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,6BAA6B,CAAC;IAiKzC;;OAEG;IACH,OAAO,CAAC,YAAY;IA0BpB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAqB1B;;;;;;;OAOG;IACH,OAAO,CAAC,0BAA0B;IAiClC;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAoD3B;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;CA2EhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProtocolComplianceAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/ProtocolComplianceAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,2BAA2B,EAM3B,uBAAuB,
|
|
1
|
+
{"version":3,"file":"ProtocolComplianceAssessor.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/modules/ProtocolComplianceAssessor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,2BAA2B,EAM3B,uBAAuB,EAMxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAOpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAmB9D;;;GAGG;AACH,MAAM,WAAW,4BAA6B,SAAQ,2BAA2B;IAC/E,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE;QAClB,mBAAmB,EAAE,aAAa,CAAC;QACnC,kBAAkB,EAAE,aAAa,CAAC;QAClC,uBAAuB,EAAE,aAAa,CAAC;KACxC,CAAC;CACH;AAED,qBAAa,0BAA2B,SAAQ,YAAY,CAAC,4BAA4B,CAAC;IACxF,OAAO,CAAC,GAAG,CAAc;gBAEb,MAAM,EAAE,uBAAuB;IAK3C;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;OAEG;IACH,OAAO,CAAC,cAAc;IAItB;;;OAGG;IACG,MAAM,CACV,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,4BAA4B,CAAC;IAyIxC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAyB9B;;OAEG;YACW,sBAAsB;IAuBpC;;OAEG;IACH,OAAO,CAAC,uBAAuB;IAsB/B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAwC7B;;OAEG;YACW,mBAAmB;IAiCjC;;;OAGG;IACH,OAAO,CAAC,2BAA2B;IAiDnC;;OAEG;IACH,OAAO,CAAC,2BAA2B;IAkEnC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAS7B;;OAEG;YACW,wBAAwB;IA4GtC;;OAEG;YACW,uBAAuB;IA2FrC;;OAEG;YACW,4BAA4B;IAoD1C,OAAO,CAAC,yBAAyB;IAkEjC,OAAO,CAAC,uBAAuB;IAqB/B,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,qBAAqB;IAgC7B,OAAO,CAAC,oBAAoB;IA8E5B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAoC3B;;OAEG;IACH,OAAO,CAAC,uBAAuB;CAqEhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SecurityPayloadTester.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/SecurityPayloadTester.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,gBAAgB,
|
|
1
|
+
{"version":3,"file":"SecurityPayloadTester.d.ts","sourceRoot":"","sources":["../../../../../src/services/assessment/modules/securityTests/SecurityPayloadTester.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,gBAAgB,EAIjB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,2BAA2B,EAC3B,IAAI,EACL,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAGL,eAAe,EAChB,MAAM,wBAAwB,CAAC;AAOhC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,qBAAa,qBAAqB;IAO9B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,kBAAkB;IAR5B,OAAO,CAAC,gBAAgB,CAA2B;IACnD,OAAO,CAAC,gBAAgB,CAA2B;IACnD,OAAO,CAAC,oBAAoB,CAAuB;IACnD,OAAO,CAAC,SAAS,CAAK;gBAGZ,MAAM,EAAE,iBAAiB,EACzB,MAAM,EAAE,UAAU,EAClB,kBAAkB,EAAE,CAAC,CAAC,EAC5B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,OAAO,EAAE,MAAM,KACZ,OAAO,CAAC,CAAC,CAAC;IAOjB;;;OAGG;IACG,yBAAyB,CAC7B,KAAK,EAAE,IAAI,EAAE,EACb,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,2BAA2B,CAAC,EACzC,UAAU,CAAC,EAAE,oBAAoB,GAChC,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAqMhC;;;OAGG;IACG,qBAAqB,CACzB,KAAK,EAAE,IAAI,EAAE,EACb,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,2BAA2B,CAAC,EACzC,UAAU,CAAC,EAAE,oBAAoB,GAChC,OAAO,CAAC,kBAAkB,EAAE,CAAC;IA6LhC;;OAEG;IACG,WAAW,CACf,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,CACR,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,2BAA2B,CAAC,GACxC,OAAO,CAAC,kBAAkB,CAAC;IA6P9B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAO3B;;OAEG;IACH,OAAO,CAAC,KAAK;CAGd"}
|
|
@@ -75,6 +75,7 @@ export class SecurityPayloadTester {
|
|
|
75
75
|
this.logger.log(`Starting ADVANCED security assessment - testing ${tools.length} tools with ${attackPatterns.length} security patterns (~${totalEstimate} tests) [concurrency: ${concurrency}]`);
|
|
76
76
|
const allToolResults = await Promise.all(tools.map((tool) => limit(async () => {
|
|
77
77
|
const toolResults = [];
|
|
78
|
+
const toolStartTime = Date.now();
|
|
78
79
|
// Tools with no input parameters can't be exploited
|
|
79
80
|
if (!this.payloadGenerator.hasInputParameters(tool)) {
|
|
80
81
|
this.logger.log(`${tool.name} has no input parameters - adding passing results`);
|
|
@@ -92,6 +93,20 @@ export class SecurityPayloadTester {
|
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
}
|
|
96
|
+
// Emit per-tool completion event for auditor UI (Phase 7)
|
|
97
|
+
if (onProgress) {
|
|
98
|
+
const toolCompleteEvent = {
|
|
99
|
+
type: "tool_test_complete",
|
|
100
|
+
tool: tool.name,
|
|
101
|
+
module: "security",
|
|
102
|
+
scenariosPassed: toolResults.length,
|
|
103
|
+
scenariosExecuted: toolResults.length,
|
|
104
|
+
confidence: "high",
|
|
105
|
+
status: "PASS",
|
|
106
|
+
executionTime: Date.now() - toolStartTime,
|
|
107
|
+
};
|
|
108
|
+
onProgress(toolCompleteEvent);
|
|
109
|
+
}
|
|
95
110
|
return toolResults;
|
|
96
111
|
}
|
|
97
112
|
this.logger.log(`Testing ${tool.name} with all attack patterns`);
|
|
@@ -132,6 +147,27 @@ export class SecurityPayloadTester {
|
|
|
132
147
|
}
|
|
133
148
|
}
|
|
134
149
|
}
|
|
150
|
+
// Emit per-tool completion event for auditor UI (Phase 7)
|
|
151
|
+
if (onProgress) {
|
|
152
|
+
const passed = toolResults.filter((r) => !r.vulnerable).length;
|
|
153
|
+
const vulnCount = toolResults.filter((r) => r.vulnerable).length;
|
|
154
|
+
const hasHighConfidence = toolResults.some((r) => r.vulnerable && r.confidence === "high");
|
|
155
|
+
const toolCompleteEvent = {
|
|
156
|
+
type: "tool_test_complete",
|
|
157
|
+
tool: tool.name,
|
|
158
|
+
module: "security",
|
|
159
|
+
scenariosPassed: passed,
|
|
160
|
+
scenariosExecuted: toolResults.length,
|
|
161
|
+
confidence: hasHighConfidence
|
|
162
|
+
? "high"
|
|
163
|
+
: vulnCount > 0
|
|
164
|
+
? "medium"
|
|
165
|
+
: "high",
|
|
166
|
+
status: vulnCount > 0 ? "FAIL" : "PASS",
|
|
167
|
+
executionTime: Date.now() - toolStartTime,
|
|
168
|
+
};
|
|
169
|
+
onProgress(toolCompleteEvent);
|
|
170
|
+
}
|
|
135
171
|
return toolResults;
|
|
136
172
|
})));
|
|
137
173
|
for (const toolResults of allToolResults) {
|
|
@@ -184,13 +220,15 @@ export class SecurityPayloadTester {
|
|
|
184
220
|
};
|
|
185
221
|
this.logger.log(`Starting BASIC security assessment - testing ${tools.length} tools with ${basicPatterns.length} critical injection patterns (~${totalEstimate} tests)`);
|
|
186
222
|
for (const tool of tools) {
|
|
223
|
+
const toolStartTime = Date.now();
|
|
224
|
+
const toolResults = [];
|
|
187
225
|
if (!this.payloadGenerator.hasInputParameters(tool)) {
|
|
188
226
|
this.logger.log(`${tool.name} has no input parameters - adding passing results`);
|
|
189
227
|
for (const attackPattern of basicPatterns) {
|
|
190
228
|
const allPayloads = getPayloadsForAttack(attackPattern.attackName);
|
|
191
229
|
const payload = allPayloads[0];
|
|
192
230
|
if (payload) {
|
|
193
|
-
|
|
231
|
+
const result = {
|
|
194
232
|
testName: attackPattern.attackName,
|
|
195
233
|
description: payload.description,
|
|
196
234
|
payload: payload.payload,
|
|
@@ -198,9 +236,25 @@ export class SecurityPayloadTester {
|
|
|
198
236
|
toolName: tool.name,
|
|
199
237
|
vulnerable: false,
|
|
200
238
|
evidence: "Tool has no input parameters - cannot be exploited via payload injection",
|
|
201
|
-
}
|
|
239
|
+
};
|
|
240
|
+
results.push(result);
|
|
241
|
+
toolResults.push(result);
|
|
202
242
|
}
|
|
203
243
|
}
|
|
244
|
+
// Emit per-tool completion event for auditor UI (Phase 7)
|
|
245
|
+
if (onProgress) {
|
|
246
|
+
const toolCompleteEvent = {
|
|
247
|
+
type: "tool_test_complete",
|
|
248
|
+
tool: tool.name,
|
|
249
|
+
module: "security",
|
|
250
|
+
scenariosPassed: toolResults.length,
|
|
251
|
+
scenariosExecuted: toolResults.length,
|
|
252
|
+
confidence: "high",
|
|
253
|
+
status: "PASS",
|
|
254
|
+
executionTime: Date.now() - toolStartTime,
|
|
255
|
+
};
|
|
256
|
+
onProgress(toolCompleteEvent);
|
|
257
|
+
}
|
|
204
258
|
continue;
|
|
205
259
|
}
|
|
206
260
|
this.logger.log(`Testing ${tool.name} with ${basicPatterns.length} critical patterns`);
|
|
@@ -215,6 +269,7 @@ export class SecurityPayloadTester {
|
|
|
215
269
|
try {
|
|
216
270
|
const result = await this.testPayload(tool, attackPattern.attackName, payload, callTool);
|
|
217
271
|
results.push(result);
|
|
272
|
+
toolResults.push(result);
|
|
218
273
|
if (result.vulnerable && onProgress) {
|
|
219
274
|
this.logger.log(`🚨 VULNERABILITY: ${tool.name} - ${attackPattern.attackName}`);
|
|
220
275
|
const vulnEvent = {
|
|
@@ -241,6 +296,27 @@ export class SecurityPayloadTester {
|
|
|
241
296
|
await this.sleep(100);
|
|
242
297
|
}
|
|
243
298
|
}
|
|
299
|
+
// Emit per-tool completion event for auditor UI (Phase 7)
|
|
300
|
+
if (onProgress) {
|
|
301
|
+
const passed = toolResults.filter((r) => !r.vulnerable).length;
|
|
302
|
+
const vulnCount = toolResults.filter((r) => r.vulnerable).length;
|
|
303
|
+
const hasHighConfidence = toolResults.some((r) => r.vulnerable && r.confidence === "high");
|
|
304
|
+
const toolCompleteEvent = {
|
|
305
|
+
type: "tool_test_complete",
|
|
306
|
+
tool: tool.name,
|
|
307
|
+
module: "security",
|
|
308
|
+
scenariosPassed: passed,
|
|
309
|
+
scenariosExecuted: toolResults.length,
|
|
310
|
+
confidence: hasHighConfidence
|
|
311
|
+
? "high"
|
|
312
|
+
: vulnCount > 0
|
|
313
|
+
? "medium"
|
|
314
|
+
: "high",
|
|
315
|
+
status: vulnCount > 0 ? "FAIL" : "PASS",
|
|
316
|
+
executionTime: Date.now() - toolStartTime,
|
|
317
|
+
};
|
|
318
|
+
onProgress(toolCompleteEvent);
|
|
319
|
+
}
|
|
244
320
|
}
|
|
245
321
|
if (batchCount > 0) {
|
|
246
322
|
emitProgressBatch();
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Data Module
|
|
3
|
+
*
|
|
4
|
+
* Central export for all test data used by the assessment module.
|
|
5
|
+
* Provides realistic, context-aware test values for generating
|
|
6
|
+
* meaningful test inputs across different tool types.
|
|
7
|
+
*
|
|
8
|
+
* @module assessment/testdata
|
|
9
|
+
*/
|
|
10
|
+
export { REALISTIC_URLS, REALISTIC_EMAILS, REALISTIC_NAMES, REALISTIC_IDS, REALISTIC_PATHS, REALISTIC_QUERIES, REALISTIC_NUMBERS, REALISTIC_BOOLEANS, REALISTIC_JSON_OBJECTS, REALISTIC_ARRAYS, generateRealisticTimestamps, REALISTIC_DATA, type RealisticDataType, } from "./realistic-values.js";
|
|
11
|
+
export { TOOL_CATEGORY_DATA, SPECIFIC_FIELD_PATTERNS, type SpecificFieldPatternsType, } from "./tool-category-data.js";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/assessment/testdata/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,2BAA2B,EAC3B,cAAc,EACd,KAAK,iBAAiB,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,yBAAyB,GAC/B,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test Data Module
|
|
3
|
+
*
|
|
4
|
+
* Central export for all test data used by the assessment module.
|
|
5
|
+
* Provides realistic, context-aware test values for generating
|
|
6
|
+
* meaningful test inputs across different tool types.
|
|
7
|
+
*
|
|
8
|
+
* @module assessment/testdata
|
|
9
|
+
*/
|
|
10
|
+
export { REALISTIC_URLS, REALISTIC_EMAILS, REALISTIC_NAMES, REALISTIC_IDS, REALISTIC_PATHS, REALISTIC_QUERIES, REALISTIC_NUMBERS, REALISTIC_BOOLEANS, REALISTIC_JSON_OBJECTS, REALISTIC_ARRAYS, generateRealisticTimestamps, REALISTIC_DATA, } from "./realistic-values.js";
|
|
11
|
+
export { TOOL_CATEGORY_DATA, SPECIFIC_FIELD_PATTERNS, } from "./tool-category-data.js";
|