cbrowser 18.13.4 → 18.14.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.
Files changed (87) hide show
  1. package/dist/agent-personas.d.ts +55 -0
  2. package/dist/agent-personas.d.ts.map +1 -0
  3. package/dist/agent-personas.js +252 -0
  4. package/dist/agent-personas.js.map +1 -0
  5. package/dist/analysis/agent-ready-audit.d.ts.map +1 -1
  6. package/dist/analysis/agent-ready-audit.js +584 -0
  7. package/dist/analysis/agent-ready-audit.js.map +1 -1
  8. package/dist/analysis/competitive-benchmark.d.ts +14 -0
  9. package/dist/analysis/competitive-benchmark.d.ts.map +1 -1
  10. package/dist/analysis/competitive-benchmark.js +245 -0
  11. package/dist/analysis/competitive-benchmark.js.map +1 -1
  12. package/dist/index.d.ts +3 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +5 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/llms-txt/diff.d.ts +85 -0
  17. package/dist/llms-txt/diff.d.ts.map +1 -0
  18. package/dist/llms-txt/diff.js +234 -0
  19. package/dist/llms-txt/diff.js.map +1 -0
  20. package/dist/llms-txt/index.d.ts +19 -0
  21. package/dist/llms-txt/index.d.ts.map +1 -0
  22. package/dist/llms-txt/index.js +19 -0
  23. package/dist/llms-txt/index.js.map +1 -0
  24. package/dist/llms-txt/validator.d.ts +80 -0
  25. package/dist/llms-txt/validator.d.ts.map +1 -0
  26. package/dist/llms-txt/validator.js +341 -0
  27. package/dist/llms-txt/validator.js.map +1 -0
  28. package/dist/mcp-server-remote.d.ts.map +1 -1
  29. package/dist/mcp-server-remote.js +36 -13
  30. package/dist/mcp-server-remote.js.map +1 -1
  31. package/dist/mcp-server.d.ts.map +1 -1
  32. package/dist/mcp-server.js +26 -2
  33. package/dist/mcp-server.js.map +1 -1
  34. package/dist/mcp-tools/base/analysis-tools.d.ts +1 -1
  35. package/dist/mcp-tools/base/analysis-tools.d.ts.map +1 -1
  36. package/dist/mcp-tools/base/analysis-tools.js +56 -2
  37. package/dist/mcp-tools/base/analysis-tools.js.map +1 -1
  38. package/dist/mcp-tools/base/cognitive-tools.d.ts.map +1 -1
  39. package/dist/mcp-tools/base/cognitive-tools.js +14 -1
  40. package/dist/mcp-tools/base/cognitive-tools.js.map +1 -1
  41. package/dist/mcp-tools/base/index.d.ts +7 -3
  42. package/dist/mcp-tools/base/index.d.ts.map +1 -1
  43. package/dist/mcp-tools/base/index.js +14 -4
  44. package/dist/mcp-tools/base/index.js.map +1 -1
  45. package/dist/mcp-tools/base/llms-txt-tools.d.ts +12 -0
  46. package/dist/mcp-tools/base/llms-txt-tools.d.ts.map +1 -0
  47. package/dist/mcp-tools/base/llms-txt-tools.js +119 -0
  48. package/dist/mcp-tools/base/llms-txt-tools.js.map +1 -0
  49. package/dist/mcp-tools/base/persona-comparison-tools.d.ts.map +1 -1
  50. package/dist/mcp-tools/base/persona-comparison-tools.js +12 -2
  51. package/dist/mcp-tools/base/persona-comparison-tools.js.map +1 -1
  52. package/dist/mcp-tools/base/remediation-tools.d.ts +12 -0
  53. package/dist/mcp-tools/base/remediation-tools.d.ts.map +1 -0
  54. package/dist/mcp-tools/base/remediation-tools.js +106 -0
  55. package/dist/mcp-tools/base/remediation-tools.js.map +1 -0
  56. package/dist/mcp-tools/index.d.ts +10 -10
  57. package/dist/mcp-tools/index.d.ts.map +1 -1
  58. package/dist/mcp-tools/index.js +11 -11
  59. package/dist/mcp-tools/index.js.map +1 -1
  60. package/dist/persona-questionnaire.d.ts +1 -1
  61. package/dist/persona-questionnaire.d.ts.map +1 -1
  62. package/dist/persona-questionnaire.js +12 -2
  63. package/dist/persona-questionnaire.js.map +1 -1
  64. package/dist/personas.d.ts +4 -2
  65. package/dist/personas.d.ts.map +1 -1
  66. package/dist/personas.js +12 -1
  67. package/dist/personas.js.map +1 -1
  68. package/dist/remediation/index.d.ts +19 -0
  69. package/dist/remediation/index.d.ts.map +1 -0
  70. package/dist/remediation/index.js +19 -0
  71. package/dist/remediation/index.js.map +1 -0
  72. package/dist/remediation/llms-txt.d.ts +65 -0
  73. package/dist/remediation/llms-txt.d.ts.map +1 -0
  74. package/dist/remediation/llms-txt.js +219 -0
  75. package/dist/remediation/llms-txt.js.map +1 -0
  76. package/dist/remediation/patch-generator.d.ts +54 -0
  77. package/dist/remediation/patch-generator.d.ts.map +1 -0
  78. package/dist/remediation/patch-generator.js +274 -0
  79. package/dist/remediation/patch-generator.js.map +1 -0
  80. package/dist/remediation/structured-data.d.ts +64 -0
  81. package/dist/remediation/structured-data.d.ts.map +1 -0
  82. package/dist/remediation/structured-data.js +352 -0
  83. package/dist/remediation/structured-data.js.map +1 -0
  84. package/dist/types.d.ts +213 -0
  85. package/dist/types.d.ts.map +1 -1
  86. package/dist/types.js.map +1 -1
  87. package/package.json +1 -1
@@ -0,0 +1,352 @@
1
+ /**
2
+ * CBrowser - Cognitive Browser Automation
3
+ * Copyright 2026 Alexandria Eden alexandria.shai.eden@gmail.com
4
+ * Learn more at https://cbrowser.ai - MIT License
5
+ */
6
+ /**
7
+ * Structured Data Suggester
8
+ *
9
+ * Recommends Schema.org JSON-LD structured data based on detected page content.
10
+ * Helps sites become more machine-readable for AI agents.
11
+ *
12
+ * @since 17.0.0
13
+ */
14
+ import { chromium } from "playwright";
15
+ /**
16
+ * Extract signals from a page for type detection
17
+ */
18
+ async function extractPageSignals(page, url) {
19
+ await page.goto(url, { waitUntil: "domcontentloaded", timeout: 30000 });
20
+ const signals = await page.evaluate(() => {
21
+ const title = document.querySelector("title")?.textContent?.trim() || "";
22
+ // Check for article indicators
23
+ const hasArticleTag = !!document.querySelector("article");
24
+ const hasPublishDate = !!(document.querySelector('time[datetime], [class*="publish"], [class*="date"], meta[property="article:published_time"]'));
25
+ const hasAuthor = !!(document.querySelector('[rel="author"], [class*="author"], [class*="byline"], meta[name="author"]'));
26
+ // Check for product indicators
27
+ const hasPrice = !!(document.querySelector('[class*="price"], [itemprop="price"], .price'));
28
+ const hasAddToCart = !!(document.querySelector('[class*="add-to-cart"], [class*="addtocart"], button:has-text("Add to Cart"), button:has-text("Buy")'));
29
+ const hasProductSchema = !!(document.querySelector('script[type="application/ld+json"]')?.textContent?.includes('"@type":"Product"') ||
30
+ document.querySelector('[itemtype*="Product"]'));
31
+ // Check for FAQ indicators
32
+ const hasFaqSection = !!(document.querySelector('[class*="faq"], details, [itemtype*="FAQPage"]') ||
33
+ document.querySelector("h2, h3")?.textContent?.toLowerCase().includes("faq"));
34
+ // Check for how-to/steps
35
+ const hasStepsList = !!(document.querySelector('[class*="step"], ol li, [itemtype*="HowTo"]'));
36
+ // Check for event indicators
37
+ const hasEventDate = !!(document.querySelector('[class*="event-date"], [itemtype*="Event"], time[datetime]')?.closest('[class*="event"]'));
38
+ // Check for local business indicators
39
+ const hasAddress = !!(document.querySelector('[class*="address"], address, [itemprop="address"]'));
40
+ const hasPhone = !!(document.querySelector('a[href^="tel:"], [itemprop="telephone"]'));
41
+ // Get og:type
42
+ const ogType = document.querySelector('meta[property="og:type"]')?.getAttribute("content") || undefined;
43
+ // Check for existing schema
44
+ const schemaScripts = document.querySelectorAll('script[type="application/ld+json"]');
45
+ const existingSchema = [];
46
+ schemaScripts.forEach((script) => {
47
+ try {
48
+ const json = JSON.parse(script.textContent || "{}");
49
+ if (json["@type"]) {
50
+ existingSchema.push(json["@type"]);
51
+ }
52
+ else if (Array.isArray(json)) {
53
+ json.forEach((item) => {
54
+ if (item["@type"])
55
+ existingSchema.push(item["@type"]);
56
+ });
57
+ }
58
+ }
59
+ catch {
60
+ // Ignore parse errors
61
+ }
62
+ });
63
+ // Check if homepage
64
+ const isHomepage = window.location.pathname === "/" || window.location.pathname === "";
65
+ return {
66
+ title,
67
+ hasArticleTag,
68
+ hasProductSchema,
69
+ hasPrice,
70
+ hasAddToCart,
71
+ hasPublishDate,
72
+ hasAuthor,
73
+ hasFaqSection,
74
+ hasStepsList,
75
+ hasEventDate,
76
+ hasAddress,
77
+ hasPhone,
78
+ isHomepage,
79
+ ogType,
80
+ existingSchema,
81
+ };
82
+ });
83
+ return { ...signals, url };
84
+ }
85
+ /**
86
+ * Detect page type from signals
87
+ */
88
+ export function detectPageType(signals) {
89
+ // Score each type based on signals
90
+ const scores = {
91
+ homepage: 0,
92
+ article: 0,
93
+ product: 0,
94
+ organization: 0,
95
+ person: 0,
96
+ event: 0,
97
+ faq: 0,
98
+ howto: 0,
99
+ recipe: 0,
100
+ "local-business": 0,
101
+ unknown: 0.1, // Base score for unknown
102
+ };
103
+ // Homepage detection
104
+ if (signals.isHomepage) {
105
+ scores.homepage += 0.6;
106
+ scores.organization += 0.3;
107
+ }
108
+ // Article detection
109
+ if (signals.hasArticleTag)
110
+ scores.article += 0.4;
111
+ if (signals.hasPublishDate)
112
+ scores.article += 0.3;
113
+ if (signals.hasAuthor)
114
+ scores.article += 0.2;
115
+ if (signals.ogType === "article")
116
+ scores.article += 0.3;
117
+ // Product detection
118
+ if (signals.hasProductSchema)
119
+ scores.product += 0.5;
120
+ if (signals.hasPrice)
121
+ scores.product += 0.3;
122
+ if (signals.hasAddToCart)
123
+ scores.product += 0.4;
124
+ // FAQ detection
125
+ if (signals.hasFaqSection)
126
+ scores.faq += 0.7;
127
+ // HowTo detection
128
+ if (signals.hasStepsList && !signals.hasFaqSection)
129
+ scores.howto += 0.5;
130
+ // Event detection
131
+ if (signals.hasEventDate)
132
+ scores.event += 0.6;
133
+ // Local business detection
134
+ if (signals.hasAddress && signals.hasPhone)
135
+ scores["local-business"] += 0.6;
136
+ if (signals.hasAddress && !signals.hasPhone)
137
+ scores["local-business"] += 0.3;
138
+ // Find highest scoring type
139
+ let maxScore = 0;
140
+ let detectedType = "unknown";
141
+ for (const [type, score] of Object.entries(scores)) {
142
+ if (score > maxScore) {
143
+ maxScore = score;
144
+ detectedType = type;
145
+ }
146
+ }
147
+ // Normalize confidence
148
+ const confidence = Math.min(1, maxScore);
149
+ return { type: detectedType, confidence };
150
+ }
151
+ /**
152
+ * Generate Organization schema
153
+ */
154
+ function generateOrganizationSchema(signals) {
155
+ const url = new URL(signals.url);
156
+ return {
157
+ "@context": "https://schema.org",
158
+ "@type": "Organization",
159
+ name: signals.title.split("|")[0].split("-")[0].trim(),
160
+ url: `${url.protocol}//${url.hostname}`,
161
+ description: "", // To be filled
162
+ logo: "", // To be filled
163
+ sameAs: [], // Social links to be added
164
+ };
165
+ }
166
+ /**
167
+ * Generate Article schema
168
+ */
169
+ function generateArticleSchema(signals) {
170
+ return {
171
+ "@context": "https://schema.org",
172
+ "@type": "Article",
173
+ headline: signals.title,
174
+ description: "", // To be filled
175
+ author: {
176
+ "@type": "Person",
177
+ name: "", // To be filled
178
+ },
179
+ datePublished: "", // To be filled from time[datetime]
180
+ dateModified: "", // To be filled
181
+ publisher: {
182
+ "@type": "Organization",
183
+ name: "", // To be filled
184
+ logo: {
185
+ "@type": "ImageObject",
186
+ url: "", // To be filled
187
+ },
188
+ },
189
+ image: "", // To be filled
190
+ };
191
+ }
192
+ /**
193
+ * Generate Product schema
194
+ */
195
+ function generateProductSchema(signals) {
196
+ return {
197
+ "@context": "https://schema.org",
198
+ "@type": "Product",
199
+ name: signals.title,
200
+ description: "", // To be filled
201
+ image: "", // To be filled
202
+ brand: {
203
+ "@type": "Brand",
204
+ name: "", // To be filled
205
+ },
206
+ offers: {
207
+ "@type": "Offer",
208
+ price: "", // To be filled
209
+ priceCurrency: "USD",
210
+ availability: "https://schema.org/InStock",
211
+ url: signals.url,
212
+ },
213
+ };
214
+ }
215
+ /**
216
+ * Generate FAQ schema
217
+ */
218
+ function generateFaqSchema(_signals) {
219
+ return {
220
+ "@context": "https://schema.org",
221
+ "@type": "FAQPage",
222
+ mainEntity: [
223
+ {
224
+ "@type": "Question",
225
+ name: "Question 1?", // To be filled from FAQ content
226
+ acceptedAnswer: {
227
+ "@type": "Answer",
228
+ text: "Answer 1", // To be filled
229
+ },
230
+ },
231
+ // Add more Q&A pairs
232
+ ],
233
+ };
234
+ }
235
+ /**
236
+ * Generate LocalBusiness schema
237
+ */
238
+ function generateLocalBusinessSchema(signals) {
239
+ return {
240
+ "@context": "https://schema.org",
241
+ "@type": "LocalBusiness",
242
+ name: signals.title.split("|")[0].split("-")[0].trim(),
243
+ url: signals.url,
244
+ address: {
245
+ "@type": "PostalAddress",
246
+ streetAddress: "", // To be filled
247
+ addressLocality: "", // To be filled
248
+ addressRegion: "", // To be filled
249
+ postalCode: "", // To be filled
250
+ addressCountry: "", // To be filled
251
+ },
252
+ telephone: "", // To be filled
253
+ openingHours: "", // To be filled
254
+ };
255
+ }
256
+ /**
257
+ * Generate structured data based on detected page type
258
+ */
259
+ export function generateStructuredData(signals, pageType) {
260
+ switch (pageType) {
261
+ case "homepage":
262
+ case "organization":
263
+ return generateOrganizationSchema(signals);
264
+ case "article":
265
+ return generateArticleSchema(signals);
266
+ case "product":
267
+ return generateProductSchema(signals);
268
+ case "faq":
269
+ return generateFaqSchema(signals);
270
+ case "local-business":
271
+ return generateLocalBusinessSchema(signals);
272
+ default:
273
+ // Default to WebPage
274
+ return {
275
+ "@context": "https://schema.org",
276
+ "@type": "WebPage",
277
+ name: signals.title,
278
+ url: signals.url,
279
+ description: "", // To be filled
280
+ };
281
+ }
282
+ }
283
+ /**
284
+ * Get reasoning for the suggested schema
285
+ */
286
+ function getReasoningForType(pageType, signals, confidence) {
287
+ const reasons = [];
288
+ switch (pageType) {
289
+ case "homepage":
290
+ reasons.push("Page is the site root (/)");
291
+ break;
292
+ case "article":
293
+ if (signals.hasArticleTag)
294
+ reasons.push("Has <article> tag");
295
+ if (signals.hasPublishDate)
296
+ reasons.push("Has publish date");
297
+ if (signals.hasAuthor)
298
+ reasons.push("Has author attribution");
299
+ break;
300
+ case "product":
301
+ if (signals.hasPrice)
302
+ reasons.push("Has price display");
303
+ if (signals.hasAddToCart)
304
+ reasons.push("Has add-to-cart button");
305
+ break;
306
+ case "faq":
307
+ reasons.push("Has FAQ section or Q&A structure");
308
+ break;
309
+ case "local-business":
310
+ if (signals.hasAddress)
311
+ reasons.push("Has physical address");
312
+ if (signals.hasPhone)
313
+ reasons.push("Has phone number");
314
+ break;
315
+ default:
316
+ reasons.push("No specific page type detected");
317
+ }
318
+ const confidenceText = confidence > 0.7 ? "High" : confidence > 0.4 ? "Medium" : "Low";
319
+ return `${confidenceText} confidence. ${reasons.join(". ")}.`;
320
+ }
321
+ /**
322
+ * Suggest structured data for a URL
323
+ */
324
+ export async function suggestStructuredData(options) {
325
+ const { url, headless = true } = options;
326
+ let browser = null;
327
+ try {
328
+ browser = await chromium.launch({ headless });
329
+ const context = await browser.newContext();
330
+ const page = await context.newPage();
331
+ const signals = await extractPageSignals(page, url);
332
+ await browser.close();
333
+ browser = null;
334
+ const { type, confidence } = detectPageType(signals);
335
+ const suggestedSchema = generateStructuredData(signals, type);
336
+ const reasoning = getReasoningForType(type, signals, confidence);
337
+ return {
338
+ pageType: type,
339
+ confidence,
340
+ existingSchema: signals.existingSchema,
341
+ suggestedSchema,
342
+ suggestedSchemaString: JSON.stringify(suggestedSchema, null, 2),
343
+ reasoning,
344
+ };
345
+ }
346
+ finally {
347
+ if (browser) {
348
+ await browser.close();
349
+ }
350
+ }
351
+ }
352
+ //# sourceMappingURL=structured-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured-data.js","sourceRoot":"","sources":["../../src/remediation/structured-data.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAA2B,MAAM,YAAY,CAAC;AA4D/D;;GAEG;AACH,KAAK,UAAU,kBAAkB,CAAC,IAAU,EAAE,GAAW;IACvD,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;IAExE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE;QACvC,MAAM,KAAK,GACT,QAAQ,CAAC,aAAa,CAAC,OAAO,CAA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AAI,EAAE,UAAU,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;QACrD,MAAM,eAAe,GAAG,sBAAsB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;QAEjE,OAAO;YACL,QAAQ,EAAE,IAAI;YACd,UAAU;YACV,cAAc,EAAE,OAAO,CAAC,cAAc;YACtC,eAAe;YACf,qBAAqB,EAAE,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/D,SAAS;SACV,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,EAAE,CAAC;YACZ,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;AACH,CAAC"}
package/dist/types.d.ts CHANGED
@@ -378,6 +378,119 @@ export interface CognitiveTraits {
378
378
  */
379
379
  mentalModelRigidity?: number;
380
380
  }
381
+ /**
382
+ * Selector strategy used by AI agents to find elements.
383
+ * Different agents prefer different selection approaches.
384
+ * @since 17.0.0
385
+ */
386
+ export type AgentSelectorStrategy = "css" | "xpath" | "aria" | "text" | "visual";
387
+ /**
388
+ * Domain knowledge level for AI agents.
389
+ * @since 17.0.0
390
+ */
391
+ export type AgentDomainKnowledge = "general" | "specialized" | "none";
392
+ /**
393
+ * Traits that define how an AI agent interacts with web pages.
394
+ * Fundamentally different from human CognitiveTraits - agents don't have emotions.
395
+ * @since 17.0.0
396
+ */
397
+ export interface AgentTraits {
398
+ /**
399
+ * Primary strategy for selecting elements.
400
+ * - css: Fast, fragile to changes (crawlers)
401
+ * - xpath: Flexible path-based selection
402
+ * - aria: Accessibility-focused, robust (task agents)
403
+ * - text: Content-based selection (retrieval agents)
404
+ * - visual: Screenshot-based selection (multimodal agents)
405
+ */
406
+ selectorStrategy: AgentSelectorStrategy;
407
+ /**
408
+ * Context window size in tokens (affects how much page context agent considers).
409
+ * Lower values = faster but may miss context. Higher = thorough but slower.
410
+ * Typical range: 4096 - 128000
411
+ */
412
+ contextWindow: number;
413
+ /**
414
+ * Maximum retry attempts before abandoning a selector/action.
415
+ * Unlike human patience (emotional), this is a hard limit.
416
+ * Typical range: 1 - 10
417
+ */
418
+ retryBudget: number;
419
+ /**
420
+ * Willingness to backtrack and try alternative paths (0-1).
421
+ * 0 = commits to first path, never backtracks
422
+ * 1 = freely explores alternatives, high backtrack tolerance
423
+ */
424
+ backtrackWillingness: number;
425
+ /**
426
+ * Exploration strategy preference (0-1).
427
+ * 0 = depth-first (follows links deeply before trying siblings)
428
+ * 1 = breadth-first (explores all options at current level first)
429
+ */
430
+ explorationVsBreadth: number;
431
+ /**
432
+ * Tolerance for ambiguous or unclear element matches (0-1).
433
+ * 0 = only acts on exact matches, very strict
434
+ * 1 = acts on partial/fuzzy matches, lenient
435
+ */
436
+ ambiguityTolerance: number;
437
+ /**
438
+ * Ability to recover from errors and continue (0-1).
439
+ * 0 = fails fast on any error
440
+ * 1 = robust error handling, continues despite issues
441
+ */
442
+ errorRecovery: number;
443
+ /**
444
+ * Level of domain-specific knowledge.
445
+ * - none: Generic web navigation only
446
+ * - general: Understands common patterns (forms, auth, e-commerce)
447
+ * - specialized: Deep knowledge of specific domain (e.g., healthcare, finance)
448
+ */
449
+ domainKnowledge: AgentDomainKnowledge;
450
+ /**
451
+ * Whether agent can process visual content (screenshots, images).
452
+ * Multimodal agents can "see" the page, not just parse DOM.
453
+ */
454
+ multiModalCapability: boolean;
455
+ }
456
+ /**
457
+ * State tracking for agent journeys (different from human emotional state).
458
+ * @since 17.0.0
459
+ */
460
+ export interface AgentJourneyState {
461
+ /** Total actions taken in this journey */
462
+ actionCount: number;
463
+ /** Remaining retries before abandonment */
464
+ retriesRemaining: number;
465
+ /** Number of selector failures encountered */
466
+ selectorFailures: number;
467
+ /** Number of times agent backtracked */
468
+ backtrackCount: number;
469
+ /** Number of ambiguous situations encountered */
470
+ ambiguityEncountered: number;
471
+ /** URLs/elements already visited (for loop detection) */
472
+ visitedPaths: Set<string>;
473
+ /** Whether agent is stuck in a loop */
474
+ loopDetected: boolean;
475
+ /** Current exploration depth */
476
+ depth: number;
477
+ }
478
+ /**
479
+ * Agent persona definition combining traits with metadata.
480
+ * @since 17.0.0
481
+ */
482
+ export interface AgentPersona {
483
+ /** Unique identifier for the agent persona */
484
+ name: string;
485
+ /** Human-readable description of agent's purpose */
486
+ description: string;
487
+ /** Agent behavioral traits */
488
+ agentTraits: AgentTraits;
489
+ /** Primary use case for this agent type */
490
+ useCase: "retrieval" | "task-completion" | "crawling" | "conversation";
491
+ /** Optional: specific domains this agent excels at */
492
+ domains?: string[];
493
+ }
381
494
  /**
382
495
  * Attention patterns that define how a persona visually scans pages.
383
496
  */
@@ -3053,6 +3166,12 @@ export interface DismissOverlayResult {
3053
3166
  export type AgentReadyIssueCategory = "findability" | "stability" | "accessibility" | "semantics";
3054
3167
  /** Severity level for agent-ready issues */
3055
3168
  export type AgentReadyIssueSeverity = "low" | "medium" | "high" | "critical";
3169
+ /**
3170
+ * AI-specific audit subcategories for granular reporting.
3171
+ * These provide more detail within the main categories without affecting scoring.
3172
+ * @since 17.0.0
3173
+ */
3174
+ export type AIAuditSubcategory = "machine-metadata" | "navigation-patterns" | "actionable-elements" | "content-chrome" | "api-exposure" | "llms-txt" | "state-persistence" | "dynamic-content";
3056
3175
  /** Effort level for fixing issues */
3057
3176
  export type AgentReadyEffort = "trivial" | "easy" | "medium" | "hard";
3058
3177
  /** Impact level for fixing issues */
@@ -3063,6 +3182,8 @@ export interface AgentReadyIssue {
3063
3182
  category: AgentReadyIssueCategory;
3064
3183
  /** Severity level */
3065
3184
  severity: AgentReadyIssueSeverity;
3185
+ /** AI-specific subcategory for granular reporting @since 17.0.0 */
3186
+ subcategory?: AIAuditSubcategory;
3066
3187
  /** Element selector or description */
3067
3188
  element: string;
3068
3189
  /** Description of the issue */
@@ -3120,6 +3241,16 @@ export interface AgentReadySummary {
3120
3241
  customDropdowns: number;
3121
3242
  /** Elements without visible text */
3122
3243
  elementsWithoutText: number;
3244
+ /** Machine-readable metadata found (JSON-LD, OG, Twitter) */
3245
+ machineMetadataCount?: number;
3246
+ /** Navigation aids found (breadcrumbs, skip links) */
3247
+ navigationAidsCount?: number;
3248
+ /** Whether /llms.txt was found */
3249
+ hasLlmsTxt?: boolean;
3250
+ /** API endpoints detected in page */
3251
+ apiEndpointsCount?: number;
3252
+ /** Dynamic content patterns detected */
3253
+ dynamicContentCount?: number;
3123
3254
  }
3124
3255
  /** Letter grade for agent-ready audit */
3125
3256
  export type AgentReadyGrade = "A" | "B" | "C" | "D" | "F";
@@ -3261,6 +3392,88 @@ export interface CompetitiveBenchmarkOptions {
3261
3392
  /** Generate HTML report */
3262
3393
  html?: boolean;
3263
3394
  }
3395
+ /** Result for a single site in AI benchmark */
3396
+ export interface AIBenchmarkSiteResult {
3397
+ /** URL tested */
3398
+ url: string;
3399
+ /** Site name (extracted from hostname) */
3400
+ siteName: string;
3401
+ /** AI readiness grade (A-F) */
3402
+ grade: AgentReadyGrade;
3403
+ /** AI readiness score (0-100) */
3404
+ score: number;
3405
+ /** Score breakdown by category */
3406
+ scoreBreakdown: AgentReadyScore;
3407
+ /** Top issues found */
3408
+ topIssues: string[];
3409
+ /** Strengths for AI agents */
3410
+ strengths: string[];
3411
+ /** Weaknesses for AI agents */
3412
+ weaknesses: string[];
3413
+ /** Duration of audit in ms */
3414
+ duration: number;
3415
+ /** Error message if audit failed */
3416
+ error?: string;
3417
+ }
3418
+ /** Comparison data between sites */
3419
+ export interface AIBenchmarkComparison {
3420
+ /** Best overall site for AI agents */
3421
+ bestOverall: string;
3422
+ /** Best site for findability */
3423
+ bestFindability: string;
3424
+ /** Best site for stability */
3425
+ bestStability: string;
3426
+ /** Best site for accessibility */
3427
+ bestAccessibility: string;
3428
+ /** Best site for semantics */
3429
+ bestSemantics: string;
3430
+ /** Common issues across all sites */
3431
+ commonIssues: string[];
3432
+ /** What each site does better */
3433
+ siteAdvantages: Record<string, string[]>;
3434
+ }
3435
+ /** Recommendation for improving AI readiness */
3436
+ export interface AIBenchmarkRecommendation {
3437
+ /** Site this applies to */
3438
+ site: string;
3439
+ /** Priority (1=highest) */
3440
+ priority: number;
3441
+ /** What to improve */
3442
+ improvement: string;
3443
+ /** Which competitor does it better */
3444
+ competitorReference?: string;
3445
+ }
3446
+ /** Result of AI readiness benchmark */
3447
+ export interface AIBenchmarkResult {
3448
+ /** When benchmark was run */
3449
+ timestamp: string;
3450
+ /** Duration of entire benchmark in ms */
3451
+ duration: number;
3452
+ /** Results per site */
3453
+ sites: AIBenchmarkSiteResult[];
3454
+ /** Sites ranked by AI readiness */
3455
+ ranking: Array<{
3456
+ rank: number;
3457
+ site: string;
3458
+ grade: AgentReadyGrade;
3459
+ score: number;
3460
+ }>;
3461
+ /** Comparative analysis */
3462
+ comparison: AIBenchmarkComparison;
3463
+ /** Prioritized recommendations */
3464
+ recommendations: AIBenchmarkRecommendation[];
3465
+ }
3466
+ /** Options for AI readiness benchmark */
3467
+ export interface AIBenchmarkOptions {
3468
+ /** URLs to benchmark */
3469
+ urls: string[];
3470
+ /** Optional goal for agent journey simulation */
3471
+ goal?: string;
3472
+ /** Run headless */
3473
+ headless?: boolean;
3474
+ /** Max concurrent audits */
3475
+ maxConcurrency?: number;
3476
+ }
3264
3477
  /** Accessibility traits for personas */
3265
3478
  export interface AccessibilityTraits {
3266
3479
  /** Motor control level 0-1 (0=severe impairment, 1=full control) */