milieu-cli 0.1.12 → 0.2.1
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/README.md +32 -11
- package/dist/bridges/context/agents-json.d.ts +3 -0
- package/dist/bridges/context/agents-json.d.ts.map +1 -0
- package/dist/bridges/context/agents-json.js +17 -0
- package/dist/bridges/context/agents-json.js.map +1 -0
- package/dist/bridges/context/auth-clarity.d.ts +4 -0
- package/dist/bridges/context/auth-clarity.d.ts.map +1 -0
- package/dist/bridges/context/auth-clarity.js +30 -0
- package/dist/bridges/context/auth-clarity.js.map +1 -0
- package/dist/bridges/context/auth-legibility.d.ts +3 -0
- package/dist/bridges/context/auth-legibility.d.ts.map +1 -0
- package/dist/bridges/context/auth-legibility.js +68 -0
- package/dist/bridges/context/auth-legibility.js.map +1 -0
- package/dist/bridges/context/index.d.ts +3 -0
- package/dist/bridges/context/index.d.ts.map +1 -0
- package/dist/bridges/context/index.js +57 -0
- package/dist/bridges/context/index.js.map +1 -0
- package/dist/bridges/context/rate-limits.d.ts +3 -0
- package/dist/bridges/context/rate-limits.d.ts.map +1 -0
- package/dist/bridges/context/rate-limits.js +43 -0
- package/dist/bridges/context/rate-limits.js.map +1 -0
- package/dist/bridges/context/tos-contact.d.ts +5 -0
- package/dist/bridges/context/tos-contact.d.ts.map +1 -0
- package/dist/bridges/context/tos-contact.js +32 -0
- package/dist/bridges/context/tos-contact.js.map +1 -0
- package/dist/bridges/context/versioning.d.ts +4 -0
- package/dist/bridges/context/versioning.d.ts.map +1 -0
- package/dist/bridges/context/versioning.js +22 -0
- package/dist/bridges/context/versioning.js.map +1 -0
- package/dist/bridges/index.d.ts +2 -1
- package/dist/bridges/index.d.ts.map +1 -1
- package/dist/bridges/index.js +2 -2
- package/dist/bridges/index.js.map +1 -1
- package/dist/bridges/schema/descriptions.d.ts +4 -0
- package/dist/bridges/schema/descriptions.d.ts.map +1 -0
- package/dist/bridges/schema/descriptions.js +56 -0
- package/dist/bridges/schema/descriptions.js.map +1 -0
- package/dist/bridges/schema/error-schemas.d.ts +4 -0
- package/dist/bridges/schema/error-schemas.d.ts.map +1 -0
- package/dist/bridges/schema/error-schemas.js +30 -0
- package/dist/bridges/schema/error-schemas.js.map +1 -0
- package/dist/bridges/schema/index.d.ts +3 -0
- package/dist/bridges/schema/index.d.ts.map +1 -0
- package/dist/bridges/schema/index.js +55 -0
- package/dist/bridges/schema/index.js.map +1 -0
- package/dist/bridges/schema/oas-types.d.ts +77 -0
- package/dist/bridges/schema/oas-types.d.ts.map +1 -0
- package/dist/bridges/schema/oas-types.js +24 -0
- package/dist/bridges/schema/oas-types.js.map +1 -0
- package/dist/bridges/schema/operation-ids.d.ts +4 -0
- package/dist/bridges/schema/operation-ids.d.ts.map +1 -0
- package/dist/bridges/schema/operation-ids.js +18 -0
- package/dist/bridges/schema/operation-ids.js.map +1 -0
- package/dist/bridges/schema/required-fields.d.ts +4 -0
- package/dist/bridges/schema/required-fields.d.ts.map +1 -0
- package/dist/bridges/schema/required-fields.js +28 -0
- package/dist/bridges/schema/required-fields.js.map +1 -0
- package/dist/bridges/schema/schema-types.d.ts +4 -0
- package/dist/bridges/schema/schema-types.d.ts.map +1 -0
- package/dist/bridges/schema/schema-types.js +38 -0
- package/dist/bridges/schema/schema-types.js.map +1 -0
- package/dist/bridges/standards/a2a-agent-card.d.ts +3 -0
- package/dist/bridges/standards/a2a-agent-card.d.ts.map +1 -0
- package/dist/bridges/standards/a2a-agent-card.js +18 -0
- package/dist/bridges/standards/a2a-agent-card.js.map +1 -0
- package/dist/bridges/standards/index.d.ts +0 -16
- package/dist/bridges/standards/index.d.ts.map +1 -1
- package/dist/bridges/standards/index.js +16 -52
- package/dist/bridges/standards/index.js.map +1 -1
- package/dist/bridges/standards/openapi.d.ts +2 -0
- package/dist/bridges/standards/openapi.d.ts.map +1 -1
- package/dist/bridges/standards/openapi.js +6 -0
- package/dist/bridges/standards/openapi.js.map +1 -1
- package/dist/bridges/standards/webmcp.d.ts +3 -0
- package/dist/bridges/standards/webmcp.d.ts.map +1 -0
- package/dist/bridges/standards/webmcp.js +18 -0
- package/dist/bridges/standards/webmcp.js.map +1 -0
- package/dist/bridges/standards/well-known.d.ts +0 -7
- package/dist/bridges/standards/well-known.d.ts.map +1 -1
- package/dist/bridges/standards/well-known.js +0 -45
- package/dist/bridges/standards/well-known.js.map +1 -1
- package/dist/core/explanations.d.ts.map +1 -1
- package/dist/core/explanations.js +75 -4
- package/dist/core/explanations.js.map +1 -1
- package/dist/core/scan.d.ts.map +1 -1
- package/dist/core/scan.js +15 -49
- package/dist/core/scan.js.map +1 -1
- package/dist/core/types.d.ts +2 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/render/format-bridge.d.ts.map +1 -1
- package/dist/render/format-bridge.js +0 -6
- package/dist/render/format-bridge.js.map +1 -1
- package/package.json +1 -1
- package/dist/bridges/stubs.d.ts +0 -4
- package/dist/bridges/stubs.d.ts.map +0 -1
- package/dist/bridges/stubs.js +0 -25
- package/dist/bridges/stubs.js.map +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { collectOperations } from "./oas-types.js";
|
|
2
|
+
export function checkErrorSchemas(spec) {
|
|
3
|
+
const id = "schema_error_responses";
|
|
4
|
+
const label = "Error Response Schemas";
|
|
5
|
+
const ops = collectOperations(spec);
|
|
6
|
+
let total4xx = 0;
|
|
7
|
+
let withSchema = 0;
|
|
8
|
+
for (const [, , op] of ops) {
|
|
9
|
+
if (!op.responses)
|
|
10
|
+
continue;
|
|
11
|
+
for (const [code, resp] of Object.entries(op.responses)) {
|
|
12
|
+
if (!code.startsWith("4"))
|
|
13
|
+
continue;
|
|
14
|
+
total4xx++;
|
|
15
|
+
if (resp?.content) {
|
|
16
|
+
const hasSchema = Object.values(resp.content).some((mt) => mt?.schema != null);
|
|
17
|
+
if (hasSchema)
|
|
18
|
+
withSchema++;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
if (total4xx === 0)
|
|
23
|
+
return { id, label, status: "fail", detail: "No 4xx error responses defined in spec", data: { total4xx: 0, withSchema: 0 } };
|
|
24
|
+
if (withSchema === total4xx)
|
|
25
|
+
return { id, label, status: "pass", detail: `All ${total4xx} error responses have body schemas`, data: { total4xx, withSchema } };
|
|
26
|
+
if (withSchema >= 1)
|
|
27
|
+
return { id, label, status: "partial", detail: `${withSchema} of ${total4xx} error responses have body schemas`, data: { total4xx, withSchema } };
|
|
28
|
+
return { id, label, status: "fail", detail: `None of ${total4xx} error responses have body schemas`, data: { total4xx, withSchema: 0 } };
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=error-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-schemas.js","sourceRoot":"","sources":["../../../src/bridges/schema/error-schemas.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,UAAU,iBAAiB,CAAC,IAAmC;IACnE,MAAM,EAAE,GAAG,wBAAwB,CAAC;IACpC,MAAM,KAAK,GAAG,wBAAwB,CAAC;IACvC,MAAM,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACpC,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,KAAK,MAAM,CAAC,EAAE,AAAD,EAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC,EAAE,CAAC,SAAS;YAAE,SAAS;QAC5B,KAAK,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;YACxD,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YACpC,QAAQ,EAAE,CAAC;YACX,IAAI,IAAI,EAAE,OAAO,EAAE,CAAC;gBAClB,MAAM,SAAS,GAA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,GAAG,OAAO,CAAC,YAAY,CAAC,CAuB7E"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { checkOperationIds } from "./operation-ids.js";
|
|
2
|
+
import { checkSchemaTypes } from "./schema-types.js";
|
|
3
|
+
import { checkErrorSchemas } from "./error-schemas.js";
|
|
4
|
+
import { checkRequiredFields } from "./required-fields.js";
|
|
5
|
+
import { checkDescriptions } from "./descriptions.js";
|
|
6
|
+
const NO_SPEC_MESSAGES = {
|
|
7
|
+
schema_operation_ids: "No OpenAPI spec detected — without operation IDs, agents cannot map API capabilities to callable functions",
|
|
8
|
+
schema_types_defined: "No OpenAPI spec detected — without typed schemas, agents cannot construct valid request payloads",
|
|
9
|
+
schema_error_responses: "No OpenAPI spec detected — without error schemas, agents cannot programmatically handle API failures",
|
|
10
|
+
schema_required_fields: "No OpenAPI spec detected — without required field markers, agents must guess which parameters are mandatory",
|
|
11
|
+
schema_descriptions: "No OpenAPI spec detected — without field descriptions, agents lack the context to use parameters correctly",
|
|
12
|
+
};
|
|
13
|
+
const NO_SPEC_CHECKS = [
|
|
14
|
+
{ id: "schema_operation_ids", label: "Operation IDs" },
|
|
15
|
+
{ id: "schema_types_defined", label: "Schema Types" },
|
|
16
|
+
{ id: "schema_error_responses", label: "Error Response Schemas" },
|
|
17
|
+
{ id: "schema_required_fields", label: "Required Fields" },
|
|
18
|
+
{ id: "schema_descriptions", label: "Field Descriptions" },
|
|
19
|
+
];
|
|
20
|
+
function calculateScore(checks) {
|
|
21
|
+
let points = 0;
|
|
22
|
+
let maxPoints = 0;
|
|
23
|
+
for (const check of checks) {
|
|
24
|
+
maxPoints += 1;
|
|
25
|
+
if (check.status === "pass")
|
|
26
|
+
points += 1;
|
|
27
|
+
else if (check.status === "partial")
|
|
28
|
+
points += 0.5;
|
|
29
|
+
}
|
|
30
|
+
const score = maxPoints === 0 ? 0 : Math.round((points / maxPoints) * 100);
|
|
31
|
+
const scoreLabel = score >= 80 ? "pass" : score >= 40 ? "partial" : "fail";
|
|
32
|
+
return { score, scoreLabel };
|
|
33
|
+
}
|
|
34
|
+
export async function runSchemaBridge(ctx) {
|
|
35
|
+
const start = performance.now();
|
|
36
|
+
const hasSpec = ctx.shared.openApiDetected === true && ctx.shared.openApiSpec != null;
|
|
37
|
+
const spec = hasSpec ? ctx.shared.openApiSpec : undefined;
|
|
38
|
+
const checks = hasSpec
|
|
39
|
+
? [
|
|
40
|
+
checkOperationIds(spec),
|
|
41
|
+
checkSchemaTypes(spec),
|
|
42
|
+
checkErrorSchemas(spec),
|
|
43
|
+
checkRequiredFields(spec),
|
|
44
|
+
checkDescriptions(spec),
|
|
45
|
+
]
|
|
46
|
+
: NO_SPEC_CHECKS.map(({ id, label }) => ({
|
|
47
|
+
id, label, status: "fail", detail: NO_SPEC_MESSAGES[id],
|
|
48
|
+
}));
|
|
49
|
+
const { score, scoreLabel } = calculateScore(checks);
|
|
50
|
+
return {
|
|
51
|
+
id: 4, name: "Schema", status: "evaluated", score, scoreLabel, checks,
|
|
52
|
+
durationMs: Math.round(performance.now() - start),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridges/schema/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,gBAAgB,GAA2B;IAC/C,oBAAoB,EAAE,4GAA4G;IAClI,oBAAoB,EAAE,kGAAkG;IACxH,sBAAsB,EAAE,sGAAsG;IAC9H,sBAAsB,EAAE,6GAA6G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M,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,eAAe,KAAK,IAAI,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC;IACtF,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAE,GAAG,CAAC,MAAM,CAAC,WAAiC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEjF,MAAM,MAAM,GAAY,OAAO;QAC7B,CAAC,CAAC;YACE,iBAAiB,CAAC,IAAI,CAAC;YACvB,gBAAgB,CAAC,IAAI,CAAC;YACtB,iBAAiB,CAAC,IAAI,CAAC;YACvB,mBAAmB,CAAC,IAAI,CAAC;YACzB,iBAAiB,CAAC,IAAI,CAAC;SACxB;QACH,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;YACrC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAe,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,CAAC;SACjE,CAAC,CAAC,CAAC;IAER,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAErD,OAAO;QACL,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM;QACrE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;KAClD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export interface OasOperation {
|
|
2
|
+
operationId?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
summary?: string;
|
|
5
|
+
parameters?: Array<{
|
|
6
|
+
name: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
in?: string;
|
|
10
|
+
schema?: {
|
|
11
|
+
type?: string;
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
14
|
+
requestBody?: {
|
|
15
|
+
required?: boolean;
|
|
16
|
+
content?: Record<string, {
|
|
17
|
+
schema?: OasSchema;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
responses?: Record<string, {
|
|
21
|
+
description?: string;
|
|
22
|
+
content?: Record<string, {
|
|
23
|
+
schema?: OasSchema;
|
|
24
|
+
}>;
|
|
25
|
+
}>;
|
|
26
|
+
security?: Array<Record<string, string[]>>;
|
|
27
|
+
}
|
|
28
|
+
export interface OasSchema {
|
|
29
|
+
type?: string;
|
|
30
|
+
$ref?: string;
|
|
31
|
+
properties?: Record<string, OasSchema>;
|
|
32
|
+
required?: string[];
|
|
33
|
+
description?: string;
|
|
34
|
+
items?: OasSchema;
|
|
35
|
+
}
|
|
36
|
+
export interface ParsedOpenApiSpec {
|
|
37
|
+
info?: {
|
|
38
|
+
title?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
termsOfService?: string;
|
|
42
|
+
contact?: {
|
|
43
|
+
name?: string;
|
|
44
|
+
email?: string;
|
|
45
|
+
url?: string;
|
|
46
|
+
};
|
|
47
|
+
license?: {
|
|
48
|
+
name?: string;
|
|
49
|
+
url?: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
paths?: Record<string, Record<string, OasOperation>>;
|
|
53
|
+
components?: {
|
|
54
|
+
securitySchemes?: Record<string, {
|
|
55
|
+
type?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
name?: string;
|
|
58
|
+
in?: string;
|
|
59
|
+
scheme?: string;
|
|
60
|
+
flows?: unknown;
|
|
61
|
+
}>;
|
|
62
|
+
schemas?: Record<string, OasSchema>;
|
|
63
|
+
};
|
|
64
|
+
security?: Array<Record<string, string[]>>;
|
|
65
|
+
securityDefinitions?: Record<string, {
|
|
66
|
+
type?: string;
|
|
67
|
+
description?: string;
|
|
68
|
+
name?: string;
|
|
69
|
+
in?: string;
|
|
70
|
+
}>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Collect all operations from a parsed spec.
|
|
74
|
+
* Returns [path, method, operation] tuples.
|
|
75
|
+
*/
|
|
76
|
+
export declare function collectOperations(spec: ParsedOpenApiSpec | undefined): Array<[string, string, OasOperation]>;
|
|
77
|
+
//# sourceMappingURL=oas-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oas-types.d.ts","sourceRoot":"","sources":["../../../src/bridges/schema/oas-types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KAC5B,CAAC,CAAC;IACH,WAAW,CAAC,EAAE;QACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,MAAM,CAAC,EAAE,SAAS,CAAA;SAAE,CAAC,CAAC;KAClD,CAAC;IACF,SAAS,CAAC,EAAE,MAAM,CAChB,MAAM,EACN;QACE,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,MAAM,CAAC,EAAE,SAAS,CAAA;SAAE,CAAC,CAAC;KAClD,CACF,CAAC;IACF,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,SAAS;IACxB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AAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAC3C,mBAAmB,CAAC,EAAE,MAAM,CAC1B,MAAM,EACN;QACE,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,EAAE,CAAC,EAAE,MAAM,CAAC;KACb,CACF,CAAC;CACH;AAMD;;;GAGG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAClC,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAavC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const HTTP_METHODS = [
|
|
2
|
+
"get", "post", "put", "patch", "delete", "options", "head",
|
|
3
|
+
];
|
|
4
|
+
/**
|
|
5
|
+
* Collect all operations from a parsed spec.
|
|
6
|
+
* Returns [path, method, operation] tuples.
|
|
7
|
+
*/
|
|
8
|
+
export function collectOperations(spec) {
|
|
9
|
+
if (!spec?.paths)
|
|
10
|
+
return [];
|
|
11
|
+
const ops = [];
|
|
12
|
+
for (const [path, pathItem] of Object.entries(spec.paths)) {
|
|
13
|
+
if (!pathItem || typeof pathItem !== "object")
|
|
14
|
+
continue;
|
|
15
|
+
for (const method of HTTP_METHODS) {
|
|
16
|
+
const op = pathItem[method];
|
|
17
|
+
if (op && typeof op === "object") {
|
|
18
|
+
ops.push([path, method, op]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return ops;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=oas-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oas-types.js","sourceRoot":"","sources":["../../../src/bridges/schema/oas-types.ts"],"names":[],"mappings":"AAsEA,MAAM,YAAY,GAAG;IACnB,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM;CAClD,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAmC;IAEnC,IAAI,CAAC,IAAI,EAAE,KAAK;QAAE,OAAO,EAAE,CAAC;IAC5B,MAAM,GAAG,GAA0C,EAAE,CAAC;IACtD,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1D,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;YAAE,SAAS;QACxD,KAAK,MAAM,MAAM,IAAI,YAAY,EAAE,CAAC;YAClC,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;YAC5B,IAAI,EAAE,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE,CAAC;gBACjC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAkB,CAAC,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-ids.d.ts","sourceRoot":"","sources":["../../../src/bridges/schema/operation-ids.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,KAAK,CAa5E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { collectOperations } from "./oas-types.js";
|
|
2
|
+
export function checkOperationIds(spec) {
|
|
3
|
+
const id = "schema_operation_ids";
|
|
4
|
+
const label = "Operation IDs";
|
|
5
|
+
const ops = collectOperations(spec);
|
|
6
|
+
const total = ops.length;
|
|
7
|
+
if (total === 0) {
|
|
8
|
+
return { id, label, status: "fail", detail: "No operations found in spec", data: { total: 0, missing: 0 } };
|
|
9
|
+
}
|
|
10
|
+
const withId = ops.filter(([, , op]) => typeof op.operationId === "string" && op.operationId.trim() !== "").length;
|
|
11
|
+
const missing = total - withId;
|
|
12
|
+
if (withId === total)
|
|
13
|
+
return { id, label, status: "pass", detail: `All ${total} operations have operationId`, data: { total, missing: 0 } };
|
|
14
|
+
if (withId >= Math.ceil(total * 0.8))
|
|
15
|
+
return { id, label, status: "partial", detail: `${withId} of ${total} operations have operationId (${missing} missing)`, data: { total, missing } };
|
|
16
|
+
return { id, label, status: "fail", detail: `Only ${withId} of ${total} operations have operationId (${missing} missing)`, data: { total, missing } };
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=operation-ids.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-ids.js","sourceRoot":"","sources":["../../../src/bridges/schema/operation-ids.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,UAAU,iBAAiB,CAAC,IAAmC;IACnE,MAAM,EAAE,GAAG,sBAAsB,CAAC;IAClC,MAAM,KAAK,GAAG,eAAe,CAAC;IAC9B,MAAM,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC;IACzB,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAChB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,6BAA6B,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;IAC9G,CAAC;IACD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,AAAD,EAAG,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC,WAAW,KAAK,QAAQ,IAAI,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;IACnH,MAAM,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;IAC/B,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,8BAA8B,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;IAC5I,IAAI,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,KAAK,iCAAiC,OAAO,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;IAC1L,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,MAAM,OAAO,KAAK,iCAAiC,OAAO,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;AACxJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-fields.d.ts","sourceRoot":"","sources":["../../../src/bridges/schema/required-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGxD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,KAAK,CAmB9E"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { collectOperations } from "./oas-types.js";
|
|
2
|
+
export function checkRequiredFields(spec) {
|
|
3
|
+
const id = "schema_required_fields";
|
|
4
|
+
const label = "Required Fields";
|
|
5
|
+
const ops = collectOperations(spec);
|
|
6
|
+
let schemasWithProperties = 0;
|
|
7
|
+
let withRequired = 0;
|
|
8
|
+
for (const [, , op] of ops) {
|
|
9
|
+
if (!op.requestBody?.content)
|
|
10
|
+
continue;
|
|
11
|
+
for (const mediaType of Object.values(op.requestBody.content)) {
|
|
12
|
+
const schema = mediaType?.schema;
|
|
13
|
+
if (!schema?.properties || Object.keys(schema.properties).length === 0)
|
|
14
|
+
continue;
|
|
15
|
+
schemasWithProperties++;
|
|
16
|
+
if (Array.isArray(schema.required) && schema.required.length > 0)
|
|
17
|
+
withRequired++;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (schemasWithProperties === 0)
|
|
21
|
+
return { id, label, status: "pass", detail: "No request body schemas with properties to evaluate", data: { schemasWithProperties: 0, withRequired: 0 } };
|
|
22
|
+
if (withRequired === schemasWithProperties)
|
|
23
|
+
return { id, label, status: "pass", detail: `All ${schemasWithProperties} request schemas declare required fields`, data: { schemasWithProperties, withRequired } };
|
|
24
|
+
if (withRequired >= Math.ceil(schemasWithProperties * 0.5))
|
|
25
|
+
return { id, label, status: "partial", detail: `${withRequired} of ${schemasWithProperties} request schemas declare required fields`, data: { schemasWithProperties, withRequired } };
|
|
26
|
+
return { id, label, status: "fail", detail: `Only ${withRequired} of ${schemasWithProperties} request schemas declare required fields`, data: { schemasWithProperties, withRequired } };
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=required-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"required-fields.js","sourceRoot":"","sources":["../../../src/bridges/schema/required-fields.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,UAAU,mBAAmB,CAAC,IAAmC;IACrE,MAAM,EAAE,GAAG,wBAAwB,CAAC;IACpC,MAAM,KAAK,GAAG,iBAAiB,CAAC;IAChC,MAA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,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,YAAY,OAAO,qBAAqB,0CAA0C,EAAE,IAAI,EAAE,EAAE,qBAAqB,EAAE,YAAY,EAAE,EAAE,CAAC;IAClP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,YAAY,OAAO,qBAAqB,0CAA0C,EAAE,IAAI,EAAE,EAAE,qBAAqB,EAAE,YAAY,EAAE,EAAE,CAAC;AAC1L,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-types.d.ts","sourceRoot":"","sources":["../../../src/bridges/schema/schema-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAa,MAAM,gBAAgB,CAAC;AAGnE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,GAAG,SAAS,GAAG,KAAK,CA6B3E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { collectOperations } from "./oas-types.js";
|
|
2
|
+
export function checkSchemaTypes(spec) {
|
|
3
|
+
const id = "schema_types_defined";
|
|
4
|
+
const label = "Schema Types";
|
|
5
|
+
const ops = collectOperations(spec);
|
|
6
|
+
const schemas = [];
|
|
7
|
+
for (const [, , op] of ops) {
|
|
8
|
+
if (op.requestBody?.content) {
|
|
9
|
+
for (const mediaType of Object.values(op.requestBody.content)) {
|
|
10
|
+
if (mediaType?.schema)
|
|
11
|
+
schemas.push(mediaType.schema);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (op.responses) {
|
|
15
|
+
for (const [code, resp] of Object.entries(op.responses)) {
|
|
16
|
+
if (!code.startsWith("2"))
|
|
17
|
+
continue;
|
|
18
|
+
if (resp?.content) {
|
|
19
|
+
for (const mediaType of Object.values(resp.content)) {
|
|
20
|
+
if (mediaType?.schema)
|
|
21
|
+
schemas.push(mediaType.schema);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const total = schemas.length;
|
|
28
|
+
if (total === 0)
|
|
29
|
+
return { id, label, status: "fail", detail: "No request/response schemas found in spec", data: { total: 0, untyped: 0 } };
|
|
30
|
+
const typed = schemas.filter(s => (typeof s.type === "string" && s.type.trim() !== "") || (typeof s.$ref === "string" && s.$ref.trim() !== "")).length;
|
|
31
|
+
const untyped = total - typed;
|
|
32
|
+
if (typed === total)
|
|
33
|
+
return { id, label, status: "pass", detail: `All ${total} schemas have type or $ref defined`, data: { total, untyped: 0 } };
|
|
34
|
+
if (typed >= Math.ceil(total * 0.8))
|
|
35
|
+
return { id, label, status: "partial", detail: `${typed} of ${total} schemas have type or $ref (${untyped} untyped)`, data: { total, untyped } };
|
|
36
|
+
return { id, label, status: "fail", detail: `Only ${typed} of ${total} schemas have type or $ref (${untyped} untyped)`, data: { total, untyped } };
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=schema-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-types.js","sourceRoot":"","sources":["../../../src/bridges/schema/schema-types.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,UAAU,gBAAgB,CAAC,IAAmC;IAClE,MAAM,EAAE,GAAG,sBAAsB,CAAC;IAClC,MAAM,KAAK,GAAG,cAAc,CAAC;IAC7B,MAAM,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,OAAO,GAAgB,EAAE,CAAC;IAChC,KAAK,MAAM,CAAC,EAAE,AAAD,EAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC;QAC3B,IAAI,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC;YAC5B,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC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C,MAAM,CAAC;IACvJ,MAAM,OAAO,GAAG,KAAK,GAAG,KAAK,CAAC;IAC9B,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,oCAAoC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC;IACjJ,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,OAAO,KAAK,+BAA+B,OAAO,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;IACtL,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,KAAK,OAAO,KAAK,+BAA+B,OAAO,WAAW,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC;AACrJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2a-agent-card.d.ts","sourceRoot":"","sources":["../../../src/bridges/standards/a2a-agent-card.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAGjD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAczF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { httpGet } from "../../utils/http-client.js";
|
|
2
|
+
export async function checkA2aAgentCard(baseUrl, timeout) {
|
|
3
|
+
const id = "standards_a2a_agent_card";
|
|
4
|
+
const label = "A2A Agent Card";
|
|
5
|
+
const url = `${baseUrl}/.well-known/agent.json`;
|
|
6
|
+
const result = await httpGet(url, { timeout, headers: { Accept: "application/json" } });
|
|
7
|
+
if (!result.ok) {
|
|
8
|
+
return { id, label, status: "fail", detail: "No A2A Agent Card found at /.well-known/agent.json", data: { url, statusCode: result.error.statusCode ?? null } };
|
|
9
|
+
}
|
|
10
|
+
try {
|
|
11
|
+
JSON.parse(result.body);
|
|
12
|
+
return { id, label, status: "pass", detail: "A2A Agent Card found with valid JSON", data: { url, statusCode: result.status } };
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return { id, label, status: "fail", detail: "A2A Agent Card endpoint returned invalid JSON", data: { url, statusCode: result.status } };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=a2a-agent-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a2a-agent-card.js","sourceRoot":"","sources":["../../../src/bridges/standards/a2a-agent-card.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,OAAe,EAAE,OAAgB;IACvE,MAAM,EAAE,GAAG,0BAA0B,CAAC;IACtC,MAAM,KAAK,GAAG,gBAAgB,CAAC;IAC/B,MAAM,GAAG,GAAG,GAAG,OAAO,yBAAyB,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;IACxF,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,oDAAoD,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,UAAU,IAAI,IAAI,EAAE,EAAE,CAAC;IACjK,CAAC;IACD,IAAI,CAAC;QACH,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,sCAAsC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IACjI,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,+CAA+C,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;IAC1I,CAAC;AACH,CAAC"}
|
|
@@ -1,19 +1,3 @@
|
|
|
1
1
|
import type { BridgeResult, ScanContext } from "../../core/types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Run Bridge 2: Standards.
|
|
4
|
-
*
|
|
5
|
-
* Runs 11 checks in two phases:
|
|
6
|
-
*
|
|
7
|
-
* Phase 1 (parallel): Sitemap + Markdown negotiation + llms.txt + llms-full.txt + security.txt + ai-plugin.json
|
|
8
|
-
* Phase 2 (parallel): OpenAPI (fed sitemap API URLs) + GraphQL + MCP (fed pageBody + llmsTxtBody)
|
|
9
|
-
* Synchronous: JSON-LD + Schema.org (from ctx.shared.pageBody)
|
|
10
|
-
*
|
|
11
|
-
* Two-phase execution is required because sitemap results feed into
|
|
12
|
-
* OpenAPI detection, and llms.txt body feeds into MCP content scanning.
|
|
13
|
-
*
|
|
14
|
-
* Stores ctx.shared.openApiDetected, ctx.shared.graphqlDetected,
|
|
15
|
-
* ctx.shared.mcpDetected, ctx.shared.sitemapUrls, and ctx.shared.llmsTxtBody
|
|
16
|
-
* for Bridge 3 consumption.
|
|
17
|
-
*/
|
|
18
2
|
export declare function runStandardsBridge(ctx: ScanContext): Promise<BridgeResult>;
|
|
19
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bridges/standards/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAS,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/bridges/standards/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAS,WAAW,EAAE,MAAM,qBAAqB,CAAC;AA0B5E,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CA+ChF"}
|
|
@@ -3,15 +3,12 @@ import { checkLlmsTxt, checkLlmsFullTxt } from "./llms-txt.js";
|
|
|
3
3
|
import { checkMcpEndpoint } from "./mcp.js";
|
|
4
4
|
import { checkJsonLd } from "./json-ld.js";
|
|
5
5
|
import { checkSchemaOrg } from "./schema-org.js";
|
|
6
|
-
import { checkSecurityTxt
|
|
6
|
+
import { checkSecurityTxt } from "./well-known.js";
|
|
7
7
|
import { checkGraphql } from "./graphql.js";
|
|
8
8
|
import { checkSitemap } from "./sitemap.js";
|
|
9
9
|
import { checkMarkdownNegotiation } from "./markdown-negotiation.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* - Pass = 1 point, Partial = 0.5 points, Fail/Error = 0 points
|
|
13
|
-
* - All checks always count (no skip concept in Bridge 2)
|
|
14
|
-
*/
|
|
10
|
+
import { checkWebMcp } from "./webmcp.js";
|
|
11
|
+
import { checkA2aAgentCard } from "./a2a-agent-card.js";
|
|
15
12
|
function calculateScore(checks) {
|
|
16
13
|
let points = 0;
|
|
17
14
|
let maxPoints = 0;
|
|
@@ -21,83 +18,50 @@ function calculateScore(checks) {
|
|
|
21
18
|
points += 1;
|
|
22
19
|
else if (check.status === "partial")
|
|
23
20
|
points += 0.5;
|
|
24
|
-
// fail and error = 0 points
|
|
25
21
|
}
|
|
26
22
|
const score = maxPoints === 0 ? 0 : Math.round((points / maxPoints) * 100);
|
|
27
23
|
const scoreLabel = score >= 80 ? "pass" : score >= 40 ? "partial" : "fail";
|
|
28
24
|
return { score, scoreLabel };
|
|
29
25
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Run Bridge 2: Standards.
|
|
32
|
-
*
|
|
33
|
-
* Runs 11 checks in two phases:
|
|
34
|
-
*
|
|
35
|
-
* Phase 1 (parallel): Sitemap + Markdown negotiation + llms.txt + llms-full.txt + security.txt + ai-plugin.json
|
|
36
|
-
* Phase 2 (parallel): OpenAPI (fed sitemap API URLs) + GraphQL + MCP (fed pageBody + llmsTxtBody)
|
|
37
|
-
* Synchronous: JSON-LD + Schema.org (from ctx.shared.pageBody)
|
|
38
|
-
*
|
|
39
|
-
* Two-phase execution is required because sitemap results feed into
|
|
40
|
-
* OpenAPI detection, and llms.txt body feeds into MCP content scanning.
|
|
41
|
-
*
|
|
42
|
-
* Stores ctx.shared.openApiDetected, ctx.shared.graphqlDetected,
|
|
43
|
-
* ctx.shared.mcpDetected, ctx.shared.sitemapUrls, and ctx.shared.llmsTxtBody
|
|
44
|
-
* for Bridge 3 consumption.
|
|
45
|
-
*/
|
|
46
26
|
export async function runStandardsBridge(ctx) {
|
|
47
27
|
const start = performance.now();
|
|
48
|
-
// Get shared context from Bridge 1
|
|
49
28
|
const pageBody = ctx.shared.pageBody ?? "";
|
|
50
29
|
const robotsSitemaps = ctx.shared.robotsSitemaps ?? [];
|
|
51
|
-
// Phase 1:
|
|
52
|
-
const [sitemapResult, markdownResult, llmsTxtResult, llmsFullTxtCheck, securityTxtCheck,
|
|
30
|
+
// Phase 1: parallel independent probes
|
|
31
|
+
const [sitemapResult, markdownResult, llmsTxtResult, llmsFullTxtCheck, securityTxtCheck, webMcpCheck, a2aAgentCardCheck] = await Promise.all([
|
|
53
32
|
checkSitemap(ctx.baseUrl, robotsSitemaps, ctx.options.timeout),
|
|
54
33
|
checkMarkdownNegotiation(ctx.baseUrl, ctx.options.timeout),
|
|
55
34
|
checkLlmsTxt(ctx.baseUrl, ctx.options.timeout),
|
|
56
35
|
checkLlmsFullTxt(ctx.baseUrl, ctx.options.timeout),
|
|
57
36
|
checkSecurityTxt(ctx.baseUrl, ctx.options.timeout),
|
|
58
|
-
|
|
37
|
+
checkWebMcp(ctx.baseUrl, ctx.options.timeout),
|
|
38
|
+
checkA2aAgentCard(ctx.baseUrl, ctx.options.timeout),
|
|
59
39
|
]);
|
|
60
|
-
// Phase 2: OpenAPI
|
|
40
|
+
// Phase 2: OpenAPI + GraphQL + MCP (depend on Phase 1 results)
|
|
61
41
|
const [openApiResult, graphqlResult, mcpResult] = await Promise.all([
|
|
62
42
|
checkOpenApi(ctx.baseUrl, ctx.options.timeout, sitemapResult.apiRelevantUrls),
|
|
63
43
|
checkGraphql(ctx.baseUrl, ctx.options.timeout),
|
|
64
44
|
checkMcpEndpoint(ctx.baseUrl, ctx.options.timeout, pageBody, llmsTxtResult.body ?? undefined),
|
|
65
45
|
]);
|
|
66
|
-
// Synchronous HTML-based checks
|
|
46
|
+
// Synchronous HTML-based checks
|
|
67
47
|
const jsonLdCheck = checkJsonLd(pageBody);
|
|
68
48
|
const schemaOrgCheck = checkSchemaOrg(pageBody, jsonLdCheck);
|
|
69
|
-
// Store
|
|
49
|
+
// Store results for downstream bridges
|
|
70
50
|
ctx.shared.openApiDetected = openApiResult.detected;
|
|
51
|
+
ctx.shared.openApiSpec = openApiResult.parsedSpec ?? null;
|
|
71
52
|
ctx.shared.openApiHasWebhooks = openApiResult.hasWebhooks;
|
|
72
53
|
ctx.shared.openApiHasCallbacks = openApiResult.hasCallbacks;
|
|
73
54
|
ctx.shared.graphqlDetected = graphqlResult.detected;
|
|
74
55
|
ctx.shared.mcpDetected = mcpResult.detected;
|
|
75
56
|
ctx.shared.sitemapUrls = sitemapResult.urls;
|
|
76
57
|
ctx.shared.llmsTxtBody = llmsTxtResult.body;
|
|
77
|
-
// Collect all 11 checks in order
|
|
78
58
|
const checks = [
|
|
79
|
-
openApiResult.check,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
llmsTxtResult.check,
|
|
84
|
-
llmsFullTxtCheck,
|
|
85
|
-
mcpResult.check,
|
|
86
|
-
jsonLdCheck,
|
|
87
|
-
schemaOrgCheck,
|
|
88
|
-
securityTxtCheck,
|
|
89
|
-
aiPluginCheck,
|
|
59
|
+
openApiResult.check, graphqlResult.check, sitemapResult.check,
|
|
60
|
+
markdownResult.check, llmsTxtResult.check, llmsFullTxtCheck,
|
|
61
|
+
mcpResult.check, jsonLdCheck, schemaOrgCheck, securityTxtCheck,
|
|
62
|
+
webMcpCheck, a2aAgentCardCheck,
|
|
90
63
|
];
|
|
91
|
-
// Calculate score
|
|
92
64
|
const { score, scoreLabel } = calculateScore(checks);
|
|
93
|
-
return {
|
|
94
|
-
id: 2,
|
|
95
|
-
name: "Standards",
|
|
96
|
-
status: "evaluated",
|
|
97
|
-
score,
|
|
98
|
-
scoreLabel,
|
|
99
|
-
checks,
|
|
100
|
-
durationMs: Math.round(performance.now() - start),
|
|
101
|
-
};
|
|
65
|
+
return { id: 2, name: "Standards", status: "evaluated", score, scoreLabel, checks, durationMs: Math.round(performance.now() - start) };
|
|
102
66
|
}
|
|
103
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bridges/standards/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":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AAgB;QAC9D,WAAW,EAAE,iBAAiB;KAC/B,CAAC;IAEF,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;IAErD,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,EAAE,CAAC;AACzI,CAAC"}
|
|
@@ -6,6 +6,8 @@ export interface OpenApiResult {
|
|
|
6
6
|
hasWebhooks: boolean;
|
|
7
7
|
/** OpenAPI 3.0+ `callbacks` found in any operation */
|
|
8
8
|
hasCallbacks: boolean;
|
|
9
|
+
/** Full parsed spec object when JSON spec found. For Bridge 4/5 consumption. */
|
|
10
|
+
parsedSpec: unknown | null;
|
|
9
11
|
}
|
|
10
12
|
/**
|
|
11
13
|
* Probe 19 common OpenAPI / Swagger spec paths in parallel, then try
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/bridges/standards/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAA6B,MAAM,qBAAqB,CAAC;AAO5E,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,WAAW,EAAE,OAAO,CAAC;IACrB,sDAAsD;IACtD,YAAY,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"openapi.d.ts","sourceRoot":"","sources":["../../../src/bridges/standards/openapi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAA6B,MAAM,qBAAqB,CAAC;AAO5E,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,WAAW,EAAE,OAAO,CAAC;IACrB,sDAAsD;IACtD,YAAY,EAAE,OAAO,CAAC;IACtB,gFAAgF;IAChF,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B;AAkSD;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,MAAM,EAChB,oBAAoB,GAAE,MAAM,EAAO,GAClC,OAAO,CAAC,aAAa,CAAC,CAkPxB"}
|
|
@@ -302,6 +302,7 @@ export async function checkOpenApi(baseUrl, timeout, sitemapCandidateUrls = [])
|
|
|
302
302
|
detected: true,
|
|
303
303
|
hasWebhooks: info.hasWebhooks,
|
|
304
304
|
hasCallbacks: info.hasCallbacks,
|
|
305
|
+
parsedSpec: JSON.parse(response.body),
|
|
305
306
|
};
|
|
306
307
|
}
|
|
307
308
|
}
|
|
@@ -323,6 +324,7 @@ export async function checkOpenApi(baseUrl, timeout, sitemapCandidateUrls = [])
|
|
|
323
324
|
detected: true,
|
|
324
325
|
hasWebhooks: yamlInfo.hasWebhooks,
|
|
325
326
|
hasCallbacks: yamlInfo.hasCallbacks,
|
|
327
|
+
parsedSpec: null,
|
|
326
328
|
};
|
|
327
329
|
}
|
|
328
330
|
}
|
|
@@ -412,6 +414,7 @@ export async function checkOpenApi(baseUrl, timeout, sitemapCandidateUrls = [])
|
|
|
412
414
|
detected: true,
|
|
413
415
|
hasWebhooks: info.hasWebhooks,
|
|
414
416
|
hasCallbacks: info.hasCallbacks,
|
|
417
|
+
parsedSpec: JSON.parse(response.body),
|
|
415
418
|
};
|
|
416
419
|
}
|
|
417
420
|
}
|
|
@@ -433,6 +436,7 @@ export async function checkOpenApi(baseUrl, timeout, sitemapCandidateUrls = [])
|
|
|
433
436
|
detected: true,
|
|
434
437
|
hasWebhooks: yamlInfo.hasWebhooks,
|
|
435
438
|
hasCallbacks: yamlInfo.hasCallbacks,
|
|
439
|
+
parsedSpec: null,
|
|
436
440
|
};
|
|
437
441
|
}
|
|
438
442
|
}
|
|
@@ -452,6 +456,7 @@ export async function checkOpenApi(baseUrl, timeout, sitemapCandidateUrls = [])
|
|
|
452
456
|
detected: true,
|
|
453
457
|
hasWebhooks: false,
|
|
454
458
|
hasCallbacks: false,
|
|
459
|
+
parsedSpec: null,
|
|
455
460
|
};
|
|
456
461
|
}
|
|
457
462
|
}
|
|
@@ -466,6 +471,7 @@ export async function checkOpenApi(baseUrl, timeout, sitemapCandidateUrls = [])
|
|
|
466
471
|
detected: false,
|
|
467
472
|
hasWebhooks: false,
|
|
468
473
|
hasCallbacks: false,
|
|
474
|
+
parsedSpec: null,
|
|
469
475
|
};
|
|
470
476
|
}
|
|
471
477
|
//# sourceMappingURL=openapi.js.map
|