cbrowser 18.34.1 → 18.35.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.
- package/dist/analysis/accessibility-empathy.d.ts.map +1 -1
- package/dist/analysis/accessibility-empathy.js +44 -8
- package/dist/analysis/accessibility-empathy.js.map +1 -1
- package/dist/analysis/page-understanding.d.ts +118 -0
- package/dist/analysis/page-understanding.d.ts.map +1 -0
- package/dist/analysis/page-understanding.js +940 -0
- package/dist/analysis/page-understanding.js.map +1 -0
- package/dist/browser/index.d.ts +2 -0
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.js +1 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/site-profile-manager.d.ts +116 -0
- package/dist/browser/site-profile-manager.d.ts.map +1 -0
- package/dist/browser/site-profile-manager.js +495 -0
- package/dist/browser/site-profile-manager.js.map +1 -0
- package/dist/cognitive/goal-decomposer.d.ts +127 -0
- package/dist/cognitive/goal-decomposer.d.ts.map +1 -0
- package/dist/cognitive/goal-decomposer.js +902 -0
- package/dist/cognitive/goal-decomposer.js.map +1 -0
- package/dist/cognitive/goal-types.d.ts +140 -0
- package/dist/cognitive/goal-types.d.ts.map +1 -0
- package/dist/cognitive/goal-types.js +136 -0
- package/dist/cognitive/goal-types.js.map +1 -0
- package/dist/cognitive/index.d.ts +2 -0
- package/dist/cognitive/index.d.ts.map +1 -1
- package/dist/cognitive/index.js +4 -0
- package/dist/cognitive/index.js.map +1 -1
- package/dist/mcp-tools/base/audit-tools.d.ts.map +1 -1
- package/dist/mcp-tools/base/audit-tools.js +5 -2
- package/dist/mcp-tools/base/audit-tools.js.map +1 -1
- package/dist/mcp-tools/base/cognitive-tools.d.ts.map +1 -1
- package/dist/mcp-tools/base/cognitive-tools.js +20 -0
- package/dist/mcp-tools/base/cognitive-tools.js.map +1 -1
- package/dist/mcp-tools/base/index.d.ts +4 -2
- package/dist/mcp-tools/base/index.d.ts.map +1 -1
- package/dist/mcp-tools/base/index.js +7 -2
- package/dist/mcp-tools/base/index.js.map +1 -1
- package/dist/mcp-tools/base/interaction-tools.d.ts.map +1 -1
- package/dist/mcp-tools/base/interaction-tools.js +23 -0
- package/dist/mcp-tools/base/interaction-tools.js.map +1 -1
- package/dist/mcp-tools/base/navigation-tools.d.ts.map +1 -1
- package/dist/mcp-tools/base/navigation-tools.js +13 -0
- package/dist/mcp-tools/base/navigation-tools.js.map +1 -1
- package/dist/mcp-tools/base/site-knowledge-tools.d.ts +15 -0
- package/dist/mcp-tools/base/site-knowledge-tools.d.ts.map +1 -0
- package/dist/mcp-tools/base/site-knowledge-tools.js +314 -0
- package/dist/mcp-tools/base/site-knowledge-tools.js.map +1 -0
- package/dist/mcp-tools/index.d.ts +6 -6
- package/dist/mcp-tools/index.d.ts.map +1 -1
- package/dist/mcp-tools/index.js +7 -7
- package/dist/mcp-tools/index.js.map +1 -1
- package/dist/site-model/manager.d.ts +161 -0
- package/dist/site-model/manager.d.ts.map +1 -0
- package/dist/site-model/manager.js +825 -0
- package/dist/site-model/manager.js.map +1 -0
- package/dist/site-model/types.d.ts +108 -0
- package/dist/site-model/types.d.ts.map +1 -0
- package/dist/site-model/types.js +10 -0
- package/dist/site-model/types.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CBrowser MCP Tools - Site Knowledge Tools
|
|
3
|
+
* Page understanding, site model learning, and site profile management.
|
|
4
|
+
*
|
|
5
|
+
* @copyright 2026 Alexandria Eden alexandria.shai.eden@gmail.com https://cbrowser.ai
|
|
6
|
+
* @license MIT
|
|
7
|
+
* @since v18.35.0
|
|
8
|
+
*/
|
|
9
|
+
import { z } from "zod";
|
|
10
|
+
/**
|
|
11
|
+
* Register site knowledge tools (6 tools: page_understand, site_model_status, site_model_query,
|
|
12
|
+
* site_profile_list, site_profile_delete, site_profile_status)
|
|
13
|
+
*/
|
|
14
|
+
export function registerSiteKnowledgeTools(server, { getBrowser, getBrowserByToken }) {
|
|
15
|
+
// ---------------------------------------------------------------------------
|
|
16
|
+
// Tool 1: page_understand
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
server.tool("page_understand", "Analyze the current page to understand its type, available actions, form structure, and navigation. Returns a rich page model with affordances, structure, and element relationships. Useful before interacting with a page to know what's possible.", {
|
|
19
|
+
_browserToken: z.string().optional().describe("Browser session token from a previous tool call. Pass this to analyze the same page you navigated to."),
|
|
20
|
+
}, async ({ _browserToken }) => {
|
|
21
|
+
try {
|
|
22
|
+
let b;
|
|
23
|
+
let token;
|
|
24
|
+
if (getBrowserByToken) {
|
|
25
|
+
const result = await getBrowserByToken(_browserToken);
|
|
26
|
+
b = result.browser;
|
|
27
|
+
token = result.token;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
b = await getBrowser();
|
|
31
|
+
}
|
|
32
|
+
const page = await b.getPage();
|
|
33
|
+
const { PageUnderstandingEngine } = await import("../../analysis/page-understanding.js");
|
|
34
|
+
const engine = new PageUnderstandingEngine();
|
|
35
|
+
const understanding = await engine.analyze(page);
|
|
36
|
+
return {
|
|
37
|
+
content: [
|
|
38
|
+
{
|
|
39
|
+
type: "text",
|
|
40
|
+
text: JSON.stringify({
|
|
41
|
+
url: understanding.url,
|
|
42
|
+
type: understanding.type,
|
|
43
|
+
affordanceCount: understanding.affordances.length,
|
|
44
|
+
formCount: understanding.structure.forms.length,
|
|
45
|
+
ctaCount: understanding.structure.ctas.length,
|
|
46
|
+
navigationGroups: understanding.structure.navigation.length,
|
|
47
|
+
headingDepth: understanding.structure.headingHierarchy.length,
|
|
48
|
+
relationshipCount: understanding.relationships.length,
|
|
49
|
+
computeTimeMs: understanding.computeTimeMs,
|
|
50
|
+
topAffordances: understanding.affordances.slice(0, 20).map((a) => ({
|
|
51
|
+
element: a.element,
|
|
52
|
+
text: a.elementText,
|
|
53
|
+
action: a.action,
|
|
54
|
+
expectedOutcome: a.expectedOutcome,
|
|
55
|
+
confidence: a.confidence,
|
|
56
|
+
reversible: a.reversible,
|
|
57
|
+
})),
|
|
58
|
+
forms: understanding.structure.forms.map((f) => ({
|
|
59
|
+
label: f.label,
|
|
60
|
+
fieldCount: f.fields.length,
|
|
61
|
+
action: f.action,
|
|
62
|
+
method: f.method,
|
|
63
|
+
hasSubmitButton: !!f.submitButton,
|
|
64
|
+
})),
|
|
65
|
+
ctas: understanding.structure.ctas.map((c) => ({
|
|
66
|
+
text: c.text,
|
|
67
|
+
prominence: c.prominence,
|
|
68
|
+
type: c.type,
|
|
69
|
+
})),
|
|
70
|
+
...(token ? { _browserToken: token } : {}),
|
|
71
|
+
}, null, 2),
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
return {
|
|
78
|
+
content: [
|
|
79
|
+
{
|
|
80
|
+
type: "text",
|
|
81
|
+
text: JSON.stringify({
|
|
82
|
+
success: false,
|
|
83
|
+
error: err instanceof Error ? err.message : String(err),
|
|
84
|
+
hint: "Ensure a page is loaded before calling page_understand. Navigate to a URL first.",
|
|
85
|
+
}, null, 2),
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// Tool 2: site_model_status
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
server.tool("site_model_status", "Show what CBrowser knows about a site from previous interactions. Returns navigation graph stats, element reliability scores, known goal paths, and failure patterns.", {
|
|
95
|
+
domain: z.string().describe("Domain to check (e.g., 'example.com')"),
|
|
96
|
+
}, async ({ domain }) => {
|
|
97
|
+
try {
|
|
98
|
+
const { SiteModelManager } = await import("../../site-model/manager.js");
|
|
99
|
+
const manager = SiteModelManager.getInstance();
|
|
100
|
+
const stats = await manager.getModelStats(domain);
|
|
101
|
+
return {
|
|
102
|
+
content: [
|
|
103
|
+
{
|
|
104
|
+
type: "text",
|
|
105
|
+
text: JSON.stringify(stats, null, 2),
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
catch (err) {
|
|
111
|
+
return {
|
|
112
|
+
content: [
|
|
113
|
+
{
|
|
114
|
+
type: "text",
|
|
115
|
+
text: JSON.stringify({
|
|
116
|
+
success: false,
|
|
117
|
+
domain,
|
|
118
|
+
error: err instanceof Error ? err.message : String(err),
|
|
119
|
+
}, null, 2),
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
// Tool 3: site_model_query
|
|
127
|
+
// ---------------------------------------------------------------------------
|
|
128
|
+
server.tool("site_model_query", "Query the site model for the best known path to achieve a goal type on a domain. Returns the most successful action sequence if one exists.", {
|
|
129
|
+
domain: z.string().describe("Domain to query (e.g., 'example.com')"),
|
|
130
|
+
goalType: z.enum([
|
|
131
|
+
"find_information",
|
|
132
|
+
"complete_action",
|
|
133
|
+
"navigate_to",
|
|
134
|
+
"fill_form",
|
|
135
|
+
"compare",
|
|
136
|
+
"explore",
|
|
137
|
+
"extract_data",
|
|
138
|
+
]).describe("Type of goal to find the best path for"),
|
|
139
|
+
}, async ({ domain, goalType }) => {
|
|
140
|
+
try {
|
|
141
|
+
const { SiteModelManager } = await import("../../site-model/manager.js");
|
|
142
|
+
const manager = SiteModelManager.getInstance();
|
|
143
|
+
await manager.loadModel(domain);
|
|
144
|
+
const bestPath = manager.queryBestPath(domain, goalType);
|
|
145
|
+
if (!bestPath) {
|
|
146
|
+
return {
|
|
147
|
+
content: [
|
|
148
|
+
{
|
|
149
|
+
type: "text",
|
|
150
|
+
text: JSON.stringify({
|
|
151
|
+
domain,
|
|
152
|
+
goalType,
|
|
153
|
+
found: false,
|
|
154
|
+
message: `No known path for goal type '${goalType}' on ${domain}. The site model will learn paths as you interact with the site.`,
|
|
155
|
+
}, null, 2),
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
content: [
|
|
162
|
+
{
|
|
163
|
+
type: "text",
|
|
164
|
+
text: JSON.stringify({
|
|
165
|
+
domain,
|
|
166
|
+
goalType,
|
|
167
|
+
found: true,
|
|
168
|
+
path: {
|
|
169
|
+
goalDescription: bestPath.goalDescription,
|
|
170
|
+
successRate: bestPath.successRate,
|
|
171
|
+
attemptCount: bestPath.attemptCount,
|
|
172
|
+
averageSteps: bestPath.averageSteps,
|
|
173
|
+
lastUsed: new Date(bestPath.lastUsed).toISOString(),
|
|
174
|
+
actionSequence: bestPath.actionSequence,
|
|
175
|
+
personaPerformance: bestPath.personaPerformance,
|
|
176
|
+
},
|
|
177
|
+
}, null, 2),
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
catch (err) {
|
|
183
|
+
return {
|
|
184
|
+
content: [
|
|
185
|
+
{
|
|
186
|
+
type: "text",
|
|
187
|
+
text: JSON.stringify({
|
|
188
|
+
success: false,
|
|
189
|
+
domain,
|
|
190
|
+
goalType,
|
|
191
|
+
error: err instanceof Error ? err.message : String(err),
|
|
192
|
+
}, null, 2),
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
// Tool 4: site_profile_list
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
server.tool("site_profile_list", "List all persistent site profiles (saved browser state per domain). Shows which sites have saved cookies, localStorage, and auth state.", {}, async () => {
|
|
202
|
+
try {
|
|
203
|
+
const { SiteProfileManager } = await import("../../browser/site-profile-manager.js");
|
|
204
|
+
const manager = new SiteProfileManager();
|
|
205
|
+
const profiles = await manager.listProfiles();
|
|
206
|
+
return {
|
|
207
|
+
content: [
|
|
208
|
+
{
|
|
209
|
+
type: "text",
|
|
210
|
+
text: JSON.stringify({
|
|
211
|
+
profileCount: profiles.length,
|
|
212
|
+
profiles: profiles.map((p) => ({
|
|
213
|
+
domain: p.domain,
|
|
214
|
+
lastUsed: p.lastUsed,
|
|
215
|
+
cookieCount: p.cookieCount,
|
|
216
|
+
authStatus: p.authStatus,
|
|
217
|
+
sizeBytes: p.sizeBytes,
|
|
218
|
+
healthy: p.healthy,
|
|
219
|
+
})),
|
|
220
|
+
}, null, 2),
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
catch (err) {
|
|
226
|
+
return {
|
|
227
|
+
content: [
|
|
228
|
+
{
|
|
229
|
+
type: "text",
|
|
230
|
+
text: JSON.stringify({
|
|
231
|
+
success: false,
|
|
232
|
+
error: err instanceof Error ? err.message : String(err),
|
|
233
|
+
}, null, 2),
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
// ---------------------------------------------------------------------------
|
|
240
|
+
// Tool 5: site_profile_delete
|
|
241
|
+
// ---------------------------------------------------------------------------
|
|
242
|
+
server.tool("site_profile_delete", "Delete a persistent site profile for a domain. Removes saved cookies, localStorage, and auth state.", {
|
|
243
|
+
domain: z.string().describe("Domain whose profile to delete (e.g., 'example.com')"),
|
|
244
|
+
}, async ({ domain }) => {
|
|
245
|
+
try {
|
|
246
|
+
const { SiteProfileManager } = await import("../../browser/site-profile-manager.js");
|
|
247
|
+
const manager = new SiteProfileManager();
|
|
248
|
+
const deleted = await manager.deleteProfile(domain);
|
|
249
|
+
return {
|
|
250
|
+
content: [
|
|
251
|
+
{
|
|
252
|
+
type: "text",
|
|
253
|
+
text: JSON.stringify({
|
|
254
|
+
success: deleted,
|
|
255
|
+
domain,
|
|
256
|
+
message: deleted
|
|
257
|
+
? `Profile for '${domain}' deleted successfully`
|
|
258
|
+
: `No profile found for '${domain}'`,
|
|
259
|
+
}, null, 2),
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
catch (err) {
|
|
265
|
+
return {
|
|
266
|
+
content: [
|
|
267
|
+
{
|
|
268
|
+
type: "text",
|
|
269
|
+
text: JSON.stringify({
|
|
270
|
+
success: false,
|
|
271
|
+
domain,
|
|
272
|
+
error: err instanceof Error ? err.message : String(err),
|
|
273
|
+
}, null, 2),
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
// ---------------------------------------------------------------------------
|
|
280
|
+
// Tool 6: site_profile_status
|
|
281
|
+
// ---------------------------------------------------------------------------
|
|
282
|
+
server.tool("site_profile_status", "Check the health of a site profile. Shows cookie count, expiry status, auth state, and whether the profile is still usable.", {
|
|
283
|
+
domain: z.string().describe("Domain to check (e.g., 'example.com')"),
|
|
284
|
+
}, async ({ domain }) => {
|
|
285
|
+
try {
|
|
286
|
+
const { SiteProfileManager } = await import("../../browser/site-profile-manager.js");
|
|
287
|
+
const manager = new SiteProfileManager();
|
|
288
|
+
const health = await manager.getProfileHealth(domain);
|
|
289
|
+
return {
|
|
290
|
+
content: [
|
|
291
|
+
{
|
|
292
|
+
type: "text",
|
|
293
|
+
text: JSON.stringify(health, null, 2),
|
|
294
|
+
},
|
|
295
|
+
],
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
catch (err) {
|
|
299
|
+
return {
|
|
300
|
+
content: [
|
|
301
|
+
{
|
|
302
|
+
type: "text",
|
|
303
|
+
text: JSON.stringify({
|
|
304
|
+
success: false,
|
|
305
|
+
domain,
|
|
306
|
+
error: err instanceof Error ? err.message : String(err),
|
|
307
|
+
}, null, 2),
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=site-knowledge-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-knowledge-tools.js","sour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MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;KACrE,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,IAAI,CAAC;YACH,MAAM,EAAE,kBAAkB,EAAE,GAAG,MAAM,MAAM,CAAC,uCAAuC,CAAC,CAAC;YACrF,MAAM,OAAO,GAAG,IAAI,kBAAkB,EAAE,CAAC;YACzC,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;YAEtD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;qBACtC;iBACF;aACF,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,IAAI,CAAC,SAAS,CAClB;4BACE,OAAO,EAAE,KAAK;4BACd,MAAM;4BACN,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;yBACxD,EACD,IAAI,EACJ,CAAC,CACF;qBACF;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
* Tool counts by deployment:
|
|
7
7
|
*
|
|
8
8
|
* LOCAL MCP (npx cbrowser mcp-server):
|
|
9
|
-
* - Base tools:
|
|
9
|
+
* - Base tools: 78 (4 marketing as stubs, 3 remediation, 1 ai_benchmark, 2 llms.txt, 1 webmcp_ready)
|
|
10
10
|
* - Persona creation: 7
|
|
11
11
|
* - Ask user: 1
|
|
12
12
|
* - Enterprise stubs: 18
|
|
13
|
-
* - Total:
|
|
13
|
+
* - Total: 104 (68 real + 23 stubs)
|
|
14
14
|
*
|
|
15
15
|
* DEMO SERVER (MCP_MODE=demo):
|
|
16
|
-
* - Base tools:
|
|
16
|
+
* - Base tools: 78 (4 marketing real, 3 remediation, 1 ai_benchmark, 2 llms.txt, 1 webmcp_ready)
|
|
17
17
|
* - Persona creation: 7
|
|
18
18
|
* - Ask user: 1
|
|
19
19
|
* - Enterprise stubs: 18
|
|
20
|
-
* - Total:
|
|
20
|
+
* - Total: 104 (72 real + 19 stubs)
|
|
21
21
|
*
|
|
22
22
|
* ENTERPRISE (MCP_MODE=enterprise):
|
|
23
23
|
* - All 91 tools fully functional
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
export type { McpServer, CBrowser, ToolRegistrationContext } from "./types.js";
|
|
29
29
|
export { setRemoteMode, getRemoteMode, transformResponseForRemote, MAX_RESPONSE_SIZE, } from "./screenshot-utils.js";
|
|
30
30
|
export { registerBaseTools } from "./base/index.js";
|
|
31
|
-
export { registerNavigationTools, registerInteractionTools, registerExtractionTools, registerAssertionTools, registerAnalysisTools, registerSessionTools, registerHealingTools, registerVisualTestingTools, registerTestingTools, registerBugAnalysisTools, registerPersonaComparisonTools, registerCognitiveTools, registerValuesTools, registerPerformanceTools, registerAuditTools, registerBrowserManagementTools, registerSecurityTools, registerMarketingTools, registerRemediationTools, registerLlmsTxtTools, } from "./base/index.js";
|
|
31
|
+
export { registerNavigationTools, registerInteractionTools, registerExtractionTools, registerAssertionTools, registerAnalysisTools, registerSessionTools, registerHealingTools, registerVisualTestingTools, registerTestingTools, registerBugAnalysisTools, registerPersonaComparisonTools, registerCognitiveTools, registerValuesTools, registerPerformanceTools, registerAuditTools, registerBrowserManagementTools, registerSecurityTools, registerMarketingTools, registerRemediationTools, registerLlmsTxtTools, registerSiteKnowledgeTools, } from "./base/index.js";
|
|
32
32
|
export { registerPersonaCreationTools } from "./persona-creation-tools.js";
|
|
33
33
|
export { registerAskUserTool } from "./ask-user-tools.js";
|
|
34
34
|
export { registerEnterpriseStubs } from "./enterprise-stubs.js";
|
|
@@ -36,7 +36,7 @@ import type { McpServer, ToolRegistrationContext } from "./types.js";
|
|
|
36
36
|
/**
|
|
37
37
|
* Register all public npm tools on an MCP server
|
|
38
38
|
*
|
|
39
|
-
* Tool count:
|
|
39
|
+
* Tool count: 104 tools across all deployments
|
|
40
40
|
* - LOCAL: 91 tools (68 real + 23 stubs including 4 marketing stubs)
|
|
41
41
|
* - DEMO: 91 tools (72 real + 19 stubs)
|
|
42
42
|
* - ENTERPRISE: 91 tools all functional
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp-tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAG/E,OAAO,EACL,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mcp-tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAG/E,OAAO,EACL,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGpD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,0BAA0B,GAC3B,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAG3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAMrE;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,SAAS,EACjB,OAAO,EAAE,uBAAuB,GAC/B,IAAI,CAYN"}
|
package/dist/mcp-tools/index.js
CHANGED
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
* Tool counts by deployment:
|
|
7
7
|
*
|
|
8
8
|
* LOCAL MCP (npx cbrowser mcp-server):
|
|
9
|
-
* - Base tools:
|
|
9
|
+
* - Base tools: 78 (4 marketing as stubs, 3 remediation, 1 ai_benchmark, 2 llms.txt, 1 webmcp_ready)
|
|
10
10
|
* - Persona creation: 7
|
|
11
11
|
* - Ask user: 1
|
|
12
12
|
* - Enterprise stubs: 18
|
|
13
|
-
* - Total:
|
|
13
|
+
* - Total: 104 (68 real + 23 stubs)
|
|
14
14
|
*
|
|
15
15
|
* DEMO SERVER (MCP_MODE=demo):
|
|
16
|
-
* - Base tools:
|
|
16
|
+
* - Base tools: 78 (4 marketing real, 3 remediation, 1 ai_benchmark, 2 llms.txt, 1 webmcp_ready)
|
|
17
17
|
* - Persona creation: 7
|
|
18
18
|
* - Ask user: 1
|
|
19
19
|
* - Enterprise stubs: 18
|
|
20
|
-
* - Total:
|
|
20
|
+
* - Total: 104 (72 real + 19 stubs)
|
|
21
21
|
*
|
|
22
22
|
* ENTERPRISE (MCP_MODE=enterprise):
|
|
23
23
|
* - All 91 tools fully functional
|
|
@@ -30,7 +30,7 @@ export { setRemoteMode, getRemoteMode, transformResponseForRemote, MAX_RESPONSE_
|
|
|
30
30
|
// Re-export base tools
|
|
31
31
|
export { registerBaseTools } from "./base/index.js";
|
|
32
32
|
// Re-export individual base tool categories for granular use
|
|
33
|
-
export { registerNavigationTools, registerInteractionTools, registerExtractionTools, registerAssertionTools, registerAnalysisTools, registerSessionTools, registerHealingTools, registerVisualTestingTools, registerTestingTools, registerBugAnalysisTools, registerPersonaComparisonTools, registerCognitiveTools, registerValuesTools, registerPerformanceTools, registerAuditTools, registerBrowserManagementTools, registerSecurityTools, registerMarketingTools, registerRemediationTools, registerLlmsTxtTools, } from "./base/index.js";
|
|
33
|
+
export { registerNavigationTools, registerInteractionTools, registerExtractionTools, registerAssertionTools, registerAnalysisTools, registerSessionTools, registerHealingTools, registerVisualTestingTools, registerTestingTools, registerBugAnalysisTools, registerPersonaComparisonTools, registerCognitiveTools, registerValuesTools, registerPerformanceTools, registerAuditTools, registerBrowserManagementTools, registerSecurityTools, registerMarketingTools, registerRemediationTools, registerLlmsTxtTools, registerSiteKnowledgeTools, } from "./base/index.js";
|
|
34
34
|
// Re-export persona creation tools
|
|
35
35
|
export { registerPersonaCreationTools } from "./persona-creation-tools.js";
|
|
36
36
|
// Re-export ask user tool
|
|
@@ -44,13 +44,13 @@ import { registerEnterpriseStubs } from "./enterprise-stubs.js";
|
|
|
44
44
|
/**
|
|
45
45
|
* Register all public npm tools on an MCP server
|
|
46
46
|
*
|
|
47
|
-
* Tool count:
|
|
47
|
+
* Tool count: 104 tools across all deployments
|
|
48
48
|
* - LOCAL: 91 tools (68 real + 23 stubs including 4 marketing stubs)
|
|
49
49
|
* - DEMO: 91 tools (72 real + 19 stubs)
|
|
50
50
|
* - ENTERPRISE: 91 tools all functional
|
|
51
51
|
*/
|
|
52
52
|
export function registerAllPublicTools(server, context) {
|
|
53
|
-
// Base tools (
|
|
53
|
+
// Base tools (78)
|
|
54
54
|
registerBaseTools(server, context);
|
|
55
55
|
// Persona creation tools (7)
|
|
56
56
|
registerPersonaCreationTools(server);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,iCAAiC;AACjC,OAAO,EACL,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAE/B,uBAAuB;AACvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,6DAA6D;AAC7D,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,8BAA8B,EAC9B,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,kBAAkB,EAClB,8BAA8B,EAC9B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mcp-tools/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,iCAAiC;AACjC,OAAO,EACL,aAAa,EACb,aAAa,EACb,0BAA0B,EAC1B,iBAAiB,GAClB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
|
|
2
|
+
* CBrowser - Site Model Manager
|
|
3
|
+
* Persistent knowledge graph per site with incremental updates,
|
|
4
|
+
* write-coalescing, data decay, and size-capped storage.
|
|
5
|
+
*
|
|
6
|
+
* @copyright 2026 Alexandria Eden alexandria.shai.eden@gmail.com https://cbrowser.ai
|
|
7
|
+
* @license MIT
|
|
8
|
+
* @since v18.35.0
|
|
9
|
+
*/
|
|
10
|
+
import type { SiteModel, NavigationEdge, GoalPath, GoalAction, GoalType, FailureType, SiteModelStats, PruneResult } from "./types.js";
|
|
11
|
+
export declare class SiteModelManager {
|
|
12
|
+
private modelDir;
|
|
13
|
+
private models;
|
|
14
|
+
private dirty;
|
|
15
|
+
private writeTimer;
|
|
16
|
+
/** Singleton instance for process-wide sharing */
|
|
17
|
+
private static _instance;
|
|
18
|
+
/** Get or create the singleton instance */
|
|
19
|
+
static getInstance(dataDir?: string): SiteModelManager;
|
|
20
|
+
/** Maximum JSON size per domain model file */
|
|
21
|
+
private static readonly MAX_MODEL_SIZE;
|
|
22
|
+
/** Data older than this is subject to decay/pruning */
|
|
23
|
+
private static readonly DECAY_THRESHOLD_MS;
|
|
24
|
+
/** Write-coalescing debounce interval */
|
|
25
|
+
private static readonly WRITE_DEBOUNCE_MS;
|
|
26
|
+
/** Minimum reliability/confidence before an entry is prunable */
|
|
27
|
+
private static readonly MIN_CONFIDENCE;
|
|
28
|
+
/** Maximum goal paths stored per domain */
|
|
29
|
+
private static readonly MAX_GOAL_PATHS;
|
|
30
|
+
/** Maximum failure patterns stored per domain */
|
|
31
|
+
private static readonly MAX_FAILURE_PATTERNS;
|
|
32
|
+
/** Failure pattern expiry */
|
|
33
|
+
private static readonly FAILURE_EXPIRY_MS;
|
|
34
|
+
constructor(dataDir?: string);
|
|
35
|
+
/**
|
|
36
|
+
* Lazy-load a site model from disk. If no file exists, creates an empty model.
|
|
37
|
+
* On load, stale data is pruned automatically.
|
|
38
|
+
*/
|
|
39
|
+
loadModel(domain: string): Promise<SiteModel>;
|
|
40
|
+
/**
|
|
41
|
+
* Get model from cache or create empty one in memory (synchronous).
|
|
42
|
+
* This ensures record methods work without a prior loadModel() call.
|
|
43
|
+
*/
|
|
44
|
+
private getOrCreateModel;
|
|
45
|
+
/**
|
|
46
|
+
* Record a successful navigation from one page to another via a specific element.
|
|
47
|
+
*/
|
|
48
|
+
recordNavigation(domain: string, fromUrl: string, toUrl: string, elementSelector: string, elementText: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Record the result (success/failure) of interacting with a specific element.
|
|
51
|
+
*/
|
|
52
|
+
recordElementResult(domain: string, pageUrl: string, selector: string, success: boolean): void;
|
|
53
|
+
/**
|
|
54
|
+
* Record a completed goal path attempt (success or failure).
|
|
55
|
+
* Matches existing paths by goalType + keyword overlap before creating new entries.
|
|
56
|
+
*/
|
|
57
|
+
recordGoalPath(domain: string, goalDescription: string, goalType: GoalType, actions: GoalAction[], success: boolean, steps: number, persona?: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* Record a failure pattern for a page/element combination.
|
|
60
|
+
*/
|
|
61
|
+
recordFailure(domain: string, pageUrl: string, selector: string | undefined, failureType: FailureType, conditions: string[]): void;
|
|
62
|
+
/**
|
|
63
|
+
* Update or create a page fingerprint for structural change detection.
|
|
64
|
+
*/
|
|
65
|
+
updateFingerprint(domain: string, urlPattern: string, headingHash: string, formCount: number, navLinkCount: number, ctaCount: number, pageType?: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Find the best known path for a given goal type.
|
|
68
|
+
* Weights by successRate * attemptCount to favor frequently successful paths.
|
|
69
|
+
*/
|
|
70
|
+
queryBestPath(domain: string, goalType: GoalType): GoalPath | null;
|
|
71
|
+
/**
|
|
72
|
+
* Get the reliability score for a specific selector on a domain.
|
|
73
|
+
* Returns the success rate multiplied by decay factor. Returns 0 if unknown.
|
|
74
|
+
*/
|
|
75
|
+
queryElementReliability(domain: string, selector: string): number;
|
|
76
|
+
/**
|
|
77
|
+
* Get all known navigation edges departing from a given URL.
|
|
78
|
+
* Sorted by reliability descending.
|
|
79
|
+
*/
|
|
80
|
+
queryNavigationTargets(domain: string, fromUrl: string): NavigationEdge[];
|
|
81
|
+
/**
|
|
82
|
+
* Prune stale data from a domain's model. Can operate on a provided model
|
|
83
|
+
* (used during load) or look up the cached model by domain.
|
|
84
|
+
*/
|
|
85
|
+
pruneStaleData(domain: string, targetModel?: SiteModel): PruneResult;
|
|
86
|
+
/**
|
|
87
|
+
* Get comprehensive statistics for a domain's model.
|
|
88
|
+
*/
|
|
89
|
+
getModelStats(domain: string): Promise<SiteModelStats>;
|
|
90
|
+
/**
|
|
91
|
+
* Flush all pending writes and clear the debounce timer.
|
|
92
|
+
* Call this on process shutdown to avoid data loss.
|
|
93
|
+
*/
|
|
94
|
+
shutdown(): Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Mark a domain's model as needing a write to disk.
|
|
97
|
+
* Starts a debounce timer if one isn't already running.
|
|
98
|
+
*/
|
|
99
|
+
private markDirty;
|
|
100
|
+
/**
|
|
101
|
+
* Write all dirty models to disk. Enforces size cap before writing.
|
|
102
|
+
*/
|
|
103
|
+
private flushDirty;
|
|
104
|
+
/**
|
|
105
|
+
* Enforce the 500KB per-domain model size cap.
|
|
106
|
+
* Evicts oldest/least-used data until the model fits within the cap.
|
|
107
|
+
*/
|
|
108
|
+
private enforceModelSizeCap;
|
|
109
|
+
/**
|
|
110
|
+
* Create a fresh, empty site model for a domain.
|
|
111
|
+
*/
|
|
112
|
+
private createEmptyModel;
|
|
113
|
+
/**
|
|
114
|
+
* Get a model, loading from disk if necessary.
|
|
115
|
+
*/
|
|
116
|
+
private getModel;
|
|
117
|
+
/**
|
|
118
|
+
* Build the file path for a domain's model JSON.
|
|
119
|
+
* Sanitizes domain to be filesystem-safe.
|
|
120
|
+
*/
|
|
121
|
+
private modelFilePath;
|
|
122
|
+
/**
|
|
123
|
+
* Normalize a domain string: lowercase, strip protocol, strip trailing slash.
|
|
124
|
+
*/
|
|
125
|
+
private normalizeDomain;
|
|
126
|
+
/**
|
|
127
|
+
* Normalize a URL to just its path for consistent node keys.
|
|
128
|
+
* Strips query strings, hashes, and trailing slashes.
|
|
129
|
+
*/
|
|
130
|
+
private normalizeUrl;
|
|
131
|
+
/**
|
|
132
|
+
* Find a similar goal path using goalType + keyword overlap in descriptions.
|
|
133
|
+
* Returns the best match if keyword overlap exceeds 50%.
|
|
134
|
+
*/
|
|
135
|
+
private findSimilarGoalPath;
|
|
136
|
+
/**
|
|
137
|
+
* Extract meaningful keywords from a goal description for fuzzy matching.
|
|
138
|
+
*/
|
|
139
|
+
private extractKeywords;
|
|
140
|
+
/**
|
|
141
|
+
* Evict the least valuable goal paths when over the cap.
|
|
142
|
+
* Score = successRate * attemptCount * recency_weight
|
|
143
|
+
*/
|
|
144
|
+
private evictGoalPaths;
|
|
145
|
+
/**
|
|
146
|
+
* Evict the least relevant failure patterns when over the cap.
|
|
147
|
+
* Keeps the most recent and most frequent patterns.
|
|
148
|
+
*/
|
|
149
|
+
private evictFailurePatterns;
|
|
150
|
+
/**
|
|
151
|
+
* When a page's structure changes (fingerprint hash differs),
|
|
152
|
+
* decay element reliability for selectors associated with that page.
|
|
153
|
+
*/
|
|
154
|
+
private decayElementsForPage;
|
|
155
|
+
/**
|
|
156
|
+
* Remove navigation nodes that have no edges referencing them
|
|
157
|
+
* and have not been visited recently.
|
|
158
|
+
*/
|
|
159
|
+
private pruneOrphanedNodes;
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../src/site-model/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EACV,SAAS,EACT,cAAc,EAEd,QAAQ,EACR,UAAU,EACV,QAAQ,EAER,WAAW,EAEX,cAAc,EACd,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,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