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,54 @@
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
+ * Remediation Patch Generator
8
+ *
9
+ * Transforms audit issues into actionable before/after code patches.
10
+ * Each issue type maps to a specific fix template.
11
+ *
12
+ * @since 17.0.0
13
+ */
14
+ import type { AgentReadyIssue, AgentReadyAuditResult } from "../types.js";
15
+ /**
16
+ * Represents a code patch to fix an audit issue
17
+ */
18
+ export interface RemediationPatch {
19
+ /** Issue being fixed */
20
+ issueId: string;
21
+ /** Issue category */
22
+ category: string;
23
+ /** Issue description */
24
+ description: string;
25
+ /** Original problematic code */
26
+ before: string;
27
+ /** Fixed code */
28
+ after: string;
29
+ /** Explanation of the fix */
30
+ explanation: string;
31
+ /** Effort level to implement */
32
+ effort: "trivial" | "easy" | "medium" | "hard";
33
+ /** Impact of the fix */
34
+ impact: "low" | "medium" | "high";
35
+ }
36
+ /**
37
+ * Generate a remediation patch for a single audit issue
38
+ */
39
+ export declare function generatePatch(issue: AgentReadyIssue): RemediationPatch;
40
+ /**
41
+ * Generate remediation patches for all issues in an audit result
42
+ */
43
+ export declare function generateRemediationPatches(auditResult: AgentReadyAuditResult): RemediationPatch[];
44
+ /**
45
+ * Get a summary of patches grouped by category
46
+ */
47
+ export declare function summarizePatches(patches: RemediationPatch[]): {
48
+ total: number;
49
+ byCategory: Record<string, number>;
50
+ byEffort: Record<string, number>;
51
+ byImpact: Record<string, number>;
52
+ quickWins: number;
53
+ };
54
+ //# sourceMappingURL=patch-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-generator.d.ts","sourceRoot":"","sources":["../../src/remediation/patch-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,wBAAwB;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,wBAAwB;IACxB,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACnC;AAiOD;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAMtE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,qBAAqB,GACjC,gBAAgB,EAAE,CAmBpB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB,CA0BA"}
@@ -0,0 +1,274 @@
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
+ * Patch templates keyed by detection method
8
+ */
9
+ const PATCH_TEMPLATES = {
10
+ "button-label-check": (issue) => ({
11
+ issueId: `btn-${Date.now()}`,
12
+ category: issue.category,
13
+ description: issue.description,
14
+ before: `<button class="icon-btn">
15
+ <svg>...</svg>
16
+ </button>`,
17
+ after: `<button class="icon-btn" aria-label="Describe the action">
18
+ <svg aria-hidden="true">...</svg>
19
+ </button>`,
20
+ explanation: "Add aria-label to describe the button's action. Hide decorative icons from screen readers with aria-hidden.",
21
+ effort: "trivial",
22
+ impact: "high",
23
+ }),
24
+ "input-label-check": (issue) => ({
25
+ issueId: `input-${Date.now()}`,
26
+ category: issue.category,
27
+ description: issue.description,
28
+ before: `<input type="text" name="email" placeholder="Enter email" />`,
29
+ after: `<label for="email-input" class="visually-hidden">Email address</label>
30
+ <input type="text" id="email-input" name="email" placeholder="Enter email" aria-describedby="email-hint" />
31
+ <span id="email-hint" class="hint">We'll never share your email</span>`,
32
+ explanation: "Add an explicit label (visible or visually-hidden). Use aria-describedby for hints. Labels provide context for both screen readers and AI agents.",
33
+ effort: "easy",
34
+ impact: "high",
35
+ }),
36
+ "custom-select-check": (issue) => ({
37
+ issueId: `select-${Date.now()}`,
38
+ category: issue.category,
39
+ description: issue.description,
40
+ before: `<div class="custom-select" onclick="toggle()">
41
+ <span class="selected">Select option</span>
42
+ <div class="options" hidden>
43
+ <div data-value="1">Option 1</div>
44
+ <div data-value="2">Option 2</div>
45
+ </div>
46
+ </div>`,
47
+ after: `<div class="custom-select" role="combobox" aria-haspopup="listbox" aria-expanded="false" aria-label="Select an option">
48
+ <span class="selected" id="selected-value">Select option</span>
49
+ <div class="options" role="listbox" hidden>
50
+ <div role="option" data-value="1" tabindex="0">Option 1</div>
51
+ <div role="option" data-value="2" tabindex="0">Option 2</div>
52
+ </div>
53
+ </div>
54
+
55
+ <!-- Better: Use native select with custom styling -->
56
+ <select name="options" class="styled-select">
57
+ <option value="">Select option</option>
58
+ <option value="1">Option 1</option>
59
+ <option value="2">Option 2</option>
60
+ </select>`,
61
+ explanation: "Either add proper ARIA roles (combobox, listbox, option) to custom selects, or better yet, use native <select> with CSS styling. Native selects work better with AI agents.",
62
+ effort: "medium",
63
+ impact: "high",
64
+ }),
65
+ "dynamic-content-check": (issue) => ({
66
+ issueId: `dynamic-${Date.now()}`,
67
+ category: issue.category,
68
+ description: issue.description,
69
+ before: `<div class="infinite-scroll" onscroll="loadMore()">
70
+ <div class="items">...</div>
71
+ <div class="loading-spinner" hidden>Loading...</div>
72
+ </div>`,
73
+ after: `<div class="paginated-content">
74
+ <div class="items">...</div>
75
+ <nav aria-label="Pagination">
76
+ <a href="?page=1" aria-current="page">1</a>
77
+ <a href="?page=2">2</a>
78
+ <a href="?page=3">3</a>
79
+ <a href="?page=4">Next</a>
80
+ </nav>
81
+ </div>
82
+
83
+ <!-- If infinite scroll is required, add a fallback -->
84
+ <div class="items" aria-live="polite">...</div>
85
+ <button id="load-more" aria-describedby="load-status">Load more items</button>
86
+ <span id="load-status" class="visually-hidden">Loading additional items</span>`,
87
+ explanation: "Replace infinite scroll with pagination links that AI agents can follow. If infinite scroll is required, add a 'Load more' button as fallback and use aria-live regions.",
88
+ effort: "hard",
89
+ impact: "high",
90
+ }),
91
+ "link-text-check": (issue) => ({
92
+ issueId: `link-${Date.now()}`,
93
+ category: issue.category,
94
+ description: issue.description,
95
+ before: `<a href="/docs">Click here</a>
96
+ <a href="/pricing">Read more</a>`,
97
+ after: `<a href="/docs">View documentation</a>
98
+ <a href="/pricing">See pricing details</a>`,
99
+ explanation: "Use descriptive link text that explains where the link goes. Avoid 'click here', 'read more', 'learn more' - these are meaningless out of context.",
100
+ effort: "trivial",
101
+ impact: "medium",
102
+ }),
103
+ "navigation-structure-check": (issue) => ({
104
+ issueId: `nav-${Date.now()}`,
105
+ category: issue.category,
106
+ description: issue.description,
107
+ before: `<div class="nav">
108
+ <div class="nav-item"><a href="/">Home</a></div>
109
+ <div class="nav-item"><a href="/about">About</a></div>
110
+ <div class="nav-item"><a href="/contact">Contact</a></div>
111
+ </div>`,
112
+ after: `<nav aria-label="Main navigation">
113
+ <ul>
114
+ <li><a href="/">Home</a></li>
115
+ <li><a href="/about">About</a></li>
116
+ <li><a href="/contact">Contact</a></li>
117
+ </ul>
118
+ </nav>
119
+
120
+ <!-- Add breadcrumbs for deep pages -->
121
+ <nav aria-label="Breadcrumb">
122
+ <ol>
123
+ <li><a href="/">Home</a></li>
124
+ <li><a href="/products">Products</a></li>
125
+ <li aria-current="page">Widget Pro</li>
126
+ </ol>
127
+ </nav>`,
128
+ explanation: "Use semantic <nav> with aria-label to distinguish multiple navigations. Add breadcrumbs for pages more than 2 levels deep. Use lists for nav items.",
129
+ effort: "easy",
130
+ impact: "medium",
131
+ }),
132
+ "actionable-elements-check": (issue) => ({
133
+ issueId: `action-${Date.now()}`,
134
+ category: issue.category,
135
+ description: issue.description,
136
+ before: `<div class="btn" onclick="submit()">Submit</div>
137
+ <span class="link" onclick="navigate('/home')">Go Home</span>`,
138
+ after: `<button type="submit">Submit</button>
139
+ <a href="/home">Go Home</a>
140
+
141
+ <!-- If JS behavior is required -->
142
+ <button type="button" onclick="submit()">Submit</button>`,
143
+ explanation: "Use native interactive elements (<button>, <a>) instead of divs/spans with click handlers. Native elements have built-in keyboard support and are easier for AI agents to identify.",
144
+ effort: "easy",
145
+ impact: "high",
146
+ }),
147
+ "state-persistence-check": (issue) => ({
148
+ issueId: `state-${Date.now()}`,
149
+ category: issue.category,
150
+ description: issue.description,
151
+ before: `<form action="/purchase" method="POST">
152
+ <input type="hidden" name="item" value="widget-123" />
153
+ <button type="submit">Buy Now</button>
154
+ </form>`,
155
+ after: `<form action="/purchase" method="POST">
156
+ <input type="hidden" name="item" value="widget-123" />
157
+ <input type="hidden" name="_csrf" value="{{csrfToken}}" />
158
+ <button type="submit" data-action="purchase" data-confirms="true">Buy Now</button>
159
+ </form>
160
+
161
+ <!-- Add confirmation for destructive actions -->
162
+ <button type="submit"
163
+ data-action="delete"
164
+ data-confirms="true"
165
+ data-confirm-message="Are you sure you want to delete this item?">
166
+ Delete
167
+ </button>`,
168
+ explanation: "Mark non-idempotent actions with data attributes so AI agents can identify state-changing operations. Include CSRF tokens and add confirmation prompts for destructive actions.",
169
+ effort: "medium",
170
+ impact: "high",
171
+ }),
172
+ "machine-metadata-check": (issue) => ({
173
+ issueId: `meta-${Date.now()}`,
174
+ category: issue.category,
175
+ description: issue.description,
176
+ before: `<head>
177
+ <title>My Site</title>
178
+ </head>`,
179
+ after: `<head>
180
+ <title>My Site - Brief description</title>
181
+ <meta name="description" content="Clear description of page content" />
182
+
183
+ <!-- OpenGraph for social/AI context -->
184
+ <meta property="og:title" content="My Site" />
185
+ <meta property="og:description" content="Clear description" />
186
+ <meta property="og:type" content="website" />
187
+
188
+ <!-- JSON-LD for structured data -->
189
+ <script type="application/ld+json">
190
+ {
191
+ "@context": "https://schema.org",
192
+ "@type": "Organization",
193
+ "name": "My Site",
194
+ "url": "https://example.com",
195
+ "description": "Clear description"
196
+ }
197
+ </script>
198
+ </head>`,
199
+ explanation: "Add OpenGraph meta tags for social context. Include JSON-LD structured data for machine-readable semantics. Both help AI agents understand page purpose.",
200
+ effort: "easy",
201
+ impact: "high",
202
+ }),
203
+ };
204
+ /**
205
+ * Default patch template for unknown issue types
206
+ */
207
+ function createDefaultPatch(issue) {
208
+ return {
209
+ issueId: `issue-${Date.now()}`,
210
+ category: issue.category,
211
+ description: issue.description,
212
+ before: issue.element || "<!-- Current implementation -->",
213
+ after: issue.codeExample || "<!-- See recommendation below -->",
214
+ explanation: issue.recommendation || "Review the element and apply accessibility best practices.",
215
+ effort: "medium",
216
+ impact: "medium",
217
+ };
218
+ }
219
+ /**
220
+ * Generate a remediation patch for a single audit issue
221
+ */
222
+ export function generatePatch(issue) {
223
+ const template = PATCH_TEMPLATES[issue.detectionMethod];
224
+ if (template) {
225
+ return template(issue);
226
+ }
227
+ return createDefaultPatch(issue);
228
+ }
229
+ /**
230
+ * Generate remediation patches for all issues in an audit result
231
+ */
232
+ export function generateRemediationPatches(auditResult) {
233
+ const patches = [];
234
+ for (const issue of auditResult.issues) {
235
+ const patch = generatePatch(issue);
236
+ patches.push(patch);
237
+ }
238
+ // Sort by impact (high first) then effort (easy first)
239
+ const impactOrder = { high: 0, medium: 1, low: 2 };
240
+ const effortOrder = { trivial: 0, easy: 1, medium: 2, hard: 3 };
241
+ patches.sort((a, b) => {
242
+ const impactDiff = impactOrder[a.impact] - impactOrder[b.impact];
243
+ if (impactDiff !== 0)
244
+ return impactDiff;
245
+ return effortOrder[a.effort] - effortOrder[b.effort];
246
+ });
247
+ return patches;
248
+ }
249
+ /**
250
+ * Get a summary of patches grouped by category
251
+ */
252
+ export function summarizePatches(patches) {
253
+ const byCategory = {};
254
+ const byEffort = {};
255
+ const byImpact = {};
256
+ let quickWins = 0;
257
+ for (const patch of patches) {
258
+ byCategory[patch.category] = (byCategory[patch.category] || 0) + 1;
259
+ byEffort[patch.effort] = (byEffort[patch.effort] || 0) + 1;
260
+ byImpact[patch.impact] = (byImpact[patch.impact] || 0) + 1;
261
+ if ((patch.effort === "trivial" || patch.effort === "easy") &&
262
+ patch.impact === "high") {
263
+ quickWins++;
264
+ }
265
+ }
266
+ return {
267
+ total: patches.length,
268
+ byCategory,
269
+ byEffort,
270
+ byImpact,
271
+ quickWins,
272
+ };
273
+ }
274
+ //# sourceMappingURL=patch-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch-generator.js","sourceRoot":"","sources":["../../src/remediation/patch-generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsCH;;GAEG;AACH,MAAM,eAAe,GAAiE;IACpF,oBAAoB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAChC,OAAO,EAAE,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE;QAC5B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,MAAM,EAAE;;UAEF;QACN,KAAK,EAAE;;UAED;QACN,WAAW,EAAE,6GAA6G;QAC1H,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,MAAM;KACf,CAAC;IAEF,mBAAmB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC/B,OAAO,EAAE,SAAS,IAAI,CAAC,GAAG,EAAE,EAAE;QAC9B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,MAAM,EAAE,8DAA8D;QACtE,KAAK,EAAE;;uEAE4D;QACnE,WAAW,EAAE,mJAAmJ;QAChK,MAAM,EAAE,MAAM;QACd,MAAM,EAAE,MAAM;KACf,CAAC;IAEF,qBAAqB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACjC,OAAO,EAAE,UAAU,IAAI,CAAC,GAAG,EAAE,EAAE;QAC/B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,MAAM,EAAE;;;;;;OAML;QACH,KAAK,EAAE;;;;;;;;;;;;;UAaD;QACN,WAAW,EAAE,6KAA6K;QAC1L,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,MAAM;KACf,CAAC;IAEF,uBAAuB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,OAAO,EAAE,WA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E,CAAC;IAC5C,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QACnE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAC3D,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;QAE3D,IACE,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM,CAAC;YACvD,KAAK,CAAC,MAAM,KAAK,MAAM,EACvB,CAAC;YACD,SAAS,EAAE,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,MAAM;QACrB,UAAU;QACV,QAAQ;QACR,QAAQ;QACR,SAAS;KACV,CAAC;AACJ,CAAC"}
@@ -0,0 +1,64 @@
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
+ * Detected page type
8
+ */
9
+ export type PageType = "homepage" | "article" | "product" | "organization" | "person" | "event" | "faq" | "howto" | "recipe" | "local-business" | "unknown";
10
+ /**
11
+ * Page signals used for type detection
12
+ */
13
+ export interface PageSignals {
14
+ url: string;
15
+ title: string;
16
+ hasArticleTag: boolean;
17
+ hasProductSchema: boolean;
18
+ hasPrice: boolean;
19
+ hasAddToCart: boolean;
20
+ hasPublishDate: boolean;
21
+ hasAuthor: boolean;
22
+ hasFaqSection: boolean;
23
+ hasStepsList: boolean;
24
+ hasEventDate: boolean;
25
+ hasAddress: boolean;
26
+ hasPhone: boolean;
27
+ isHomepage: boolean;
28
+ ogType?: string;
29
+ existingSchema: string[];
30
+ }
31
+ /**
32
+ * Structured data suggestion
33
+ */
34
+ export interface StructuredDataSuggestion {
35
+ pageType: PageType;
36
+ confidence: number;
37
+ existingSchema: string[];
38
+ suggestedSchema: object;
39
+ suggestedSchemaString: string;
40
+ reasoning: string;
41
+ }
42
+ /**
43
+ * Options for structured data suggestion
44
+ */
45
+ export interface StructuredDataOptions {
46
+ url: string;
47
+ headless?: boolean;
48
+ }
49
+ /**
50
+ * Detect page type from signals
51
+ */
52
+ export declare function detectPageType(signals: PageSignals): {
53
+ type: PageType;
54
+ confidence: number;
55
+ };
56
+ /**
57
+ * Generate structured data based on detected page type
58
+ */
59
+ export declare function generateStructuredData(signals: PageSignals, pageType: PageType): object;
60
+ /**
61
+ * Suggest structured data for a URL
62
+ */
63
+ export declare function suggestStructuredData(options: StructuredDataOptions): Promise<StructuredDataSuggestion>;
64
+ //# sourceMappingURL=structured-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structured-data.d.ts","sourceRoot":"","sources":["../../src/remediation/structured-data.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,SAAS,GACT,SAAS,GACT,cAAc,GACd,QAAQ,GACR,OAAO,GACP,KAAK,GACL,OAAO,GACP,QAAQ,GACR,gBAAgB,GAChB,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,OAAO,CAAC;IACvB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB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