crawlforge-mcp-server 6.1.0 → 6.2.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/package.json +1 -1
- package/server.js +5 -97
- package/src/cli/commands/monitor.js +18 -4
- package/src/skills/agent-skills/crawlforge-change-tracking/SKILL.md +53 -14
- package/src/tools/tracking/trackChanges/hosted.js +176 -0
- package/src/tools/tracking/trackChanges/index.js +123 -7
- package/src/tools/tracking/trackChanges/notifier.js +5 -4
- package/src/tools/tracking/trackChanges/schema.js +36 -22
- package/src/core/AlertNotificationSystem.js +0 -602
|
@@ -6,8 +6,17 @@
|
|
|
6
6
|
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The raw input shape — one declaration (G5). server.js spreads it, with the
|
|
11
|
+
* shared compliance params, into the registered inputSchema, so the
|
|
12
|
+
* `.describe()` strings a client sees and the defaults the tool validates
|
|
13
|
+
* with cannot drift apart again (they had: the `email` block and the default
|
|
14
|
+
* `excludeSelectors` never reached tools/list). `.prefault({})` on the option
|
|
15
|
+
* objects fills their inner defaults when the object is omitted; zod 4's
|
|
16
|
+
* `.default({})` would not.
|
|
17
|
+
*/
|
|
18
|
+
export const TRACK_CHANGES_INPUT_SHAPE = {
|
|
19
|
+
url: z.string().url().optional().describe("The URL to track changes for (optional for list_scheduled_monitors)"),
|
|
11
20
|
operation: z.enum([
|
|
12
21
|
'create_baseline',
|
|
13
22
|
'compare',
|
|
@@ -22,13 +31,10 @@ export const TrackChangesSchema = z.object({
|
|
|
22
31
|
'create_alert_rule',
|
|
23
32
|
'generate_trend_report',
|
|
24
33
|
'get_monitoring_templates'
|
|
25
|
-
]).default('compare'),
|
|
26
|
-
|
|
27
|
-
content: z.string().optional(),
|
|
28
|
-
html: z.string().optional(),
|
|
34
|
+
]).default('compare').describe("Tracking operation to perform"),
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
|
|
36
|
+
content: z.string().optional().describe("Content to compare against baseline"),
|
|
37
|
+
html: z.string().optional().describe("HTML content to compare against baseline"),
|
|
32
38
|
|
|
33
39
|
trackingOptions: z.object({
|
|
34
40
|
granularity: z.enum(['page', 'section', 'element', 'text']).default('section'),
|
|
@@ -48,7 +54,7 @@ export const TrackChangesSchema = z.object({
|
|
|
48
54
|
moderate: z.number().min(0).max(1).default(0.3),
|
|
49
55
|
major: z.number().min(0).max(1).default(0.7)
|
|
50
56
|
}).optional()
|
|
51
|
-
}).optional().prefault({}),
|
|
57
|
+
}).optional().prefault({}).describe("Options for how changes are tracked and compared"),
|
|
52
58
|
|
|
53
59
|
monitoringOptions: z.object({
|
|
54
60
|
enabled: z.boolean().default(false),
|
|
@@ -59,7 +65,7 @@ export const TrackChangesSchema = z.object({
|
|
|
59
65
|
enableWebhook: z.boolean().default(false),
|
|
60
66
|
webhookUrl: z.string().url().optional(),
|
|
61
67
|
webhookSecret: z.string().optional()
|
|
62
|
-
}).optional().prefault({}),
|
|
68
|
+
}).optional().prefault({}).describe("Monitoring schedule and notification settings"),
|
|
63
69
|
|
|
64
70
|
storageOptions: z.object({
|
|
65
71
|
enableSnapshots: z.boolean().default(true),
|
|
@@ -67,7 +73,7 @@ export const TrackChangesSchema = z.object({
|
|
|
67
73
|
maxHistoryEntries: z.number().min(1).max(1000).default(100),
|
|
68
74
|
compressionEnabled: z.boolean().default(true),
|
|
69
75
|
deltaStorageEnabled: z.boolean().default(true)
|
|
70
|
-
}).optional().prefault({}),
|
|
76
|
+
}).optional().prefault({}).describe("Storage and history retention settings"),
|
|
71
77
|
|
|
72
78
|
queryOptions: z.object({
|
|
73
79
|
limit: z.number().min(1).max(500).default(50),
|
|
@@ -76,7 +82,7 @@ export const TrackChangesSchema = z.object({
|
|
|
76
82
|
endTime: z.number().optional(),
|
|
77
83
|
includeContent: z.boolean().default(false),
|
|
78
84
|
significanceFilter: z.enum(['all', 'minor', 'moderate', 'major', 'critical']).optional()
|
|
79
|
-
}).optional().prefault({}),
|
|
85
|
+
}).optional().prefault({}).describe("Query options for history and stats retrieval"),
|
|
80
86
|
|
|
81
87
|
notificationOptions: z.object({
|
|
82
88
|
email: z.object({
|
|
@@ -99,17 +105,19 @@ export const TrackChangesSchema = z.object({
|
|
|
99
105
|
channel: z.string().optional(),
|
|
100
106
|
username: z.string().optional()
|
|
101
107
|
}).optional()
|
|
102
|
-
}).optional(),
|
|
108
|
+
}).optional().describe("Notification configuration for webhooks, Slack and email (email is sent by hosted monitors only)"),
|
|
103
109
|
|
|
104
110
|
scheduledMonitorOptions: z.object({
|
|
105
|
-
schedule: z.string().optional(),
|
|
111
|
+
schedule: z.string().optional().describe("Optional cron expression (power users)"),
|
|
106
112
|
templateId: z.string().optional(),
|
|
107
113
|
enabled: z.boolean().default(true),
|
|
108
|
-
interval: z.number().min(60000).optional(),
|
|
109
|
-
goal: z.string().optional(),
|
|
110
|
-
monitorId: z.string().optional(),
|
|
111
|
-
notificationThreshold: z.enum(['minor', 'moderate', 'major', 'critical']).optional()
|
|
112
|
-
|
|
114
|
+
interval: z.number().min(60000).optional().describe("Polling interval in ms (default 1h)"),
|
|
115
|
+
goal: z.string().optional().describe("Plain-English alert goal; an LLM judges whether a change matches (degrades to threshold if no LLM)"),
|
|
116
|
+
monitorId: z.string().optional().describe("Monitor id for stop_scheduled_monitor"),
|
|
117
|
+
notificationThreshold: z.enum(['minor', 'moderate', 'major', 'critical']).optional(),
|
|
118
|
+
hosted: z.boolean().default(false).describe("Run the monitor on CrawlForge's servers: it fires from the hosted scheduler whether or not this process is alive and sends email and signed webhooks. Each check bills 3 credits per compared target from the account; blocked and errored targets are free. Default false = local, in-process."),
|
|
119
|
+
name: z.string().min(1).max(80).optional().describe("Display name for a hosted monitor (default: the URL host)")
|
|
120
|
+
}).optional().describe("Scheduled monitoring: recurring compare + notify, optional plain-English goal"),
|
|
113
121
|
|
|
114
122
|
alertRuleOptions: z.object({
|
|
115
123
|
ruleId: z.string().optional(),
|
|
@@ -117,7 +125,7 @@ export const TrackChangesSchema = z.object({
|
|
|
117
125
|
actions: z.array(z.enum(['webhook', 'email', 'slack'])).optional(),
|
|
118
126
|
throttle: z.number().min(0).optional(),
|
|
119
127
|
priority: z.enum(['low', 'medium', 'high']).optional()
|
|
120
|
-
}).optional(),
|
|
128
|
+
}).optional().describe("Alert rule configuration for change notifications"),
|
|
121
129
|
|
|
122
130
|
exportOptions: z.object({
|
|
123
131
|
format: z.enum(['json', 'csv']).default('json'),
|
|
@@ -125,11 +133,17 @@ export const TrackChangesSchema = z.object({
|
|
|
125
133
|
endTime: z.number().optional(),
|
|
126
134
|
includeContent: z.boolean().default(false),
|
|
127
135
|
includeSnapshots: z.boolean().default(false)
|
|
128
|
-
}).optional(),
|
|
136
|
+
}).optional().describe("Export options for change history data"),
|
|
129
137
|
|
|
130
138
|
dashboardOptions: z.object({
|
|
131
139
|
includeRecentAlerts: z.boolean().default(true),
|
|
132
140
|
includeTrends: z.boolean().default(true),
|
|
133
141
|
includeMonitorStatus: z.boolean().default(true)
|
|
134
|
-
}).optional()
|
|
142
|
+
}).optional().describe("Dashboard display options")
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export const TrackChangesSchema = z.object({
|
|
146
|
+
...TRACK_CHANGES_INPUT_SHAPE,
|
|
147
|
+
respect_robots: z.boolean().optional(),
|
|
148
|
+
user_agent: z.string().optional()
|
|
135
149
|
});
|