-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathcontext.ts
More file actions
267 lines (258 loc) · 9.48 KB
/
context.ts
File metadata and controls
267 lines (258 loc) · 9.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
export const REFERENCES = [
{
id: 'configure-agentic-checks',
description: 'Agentic Check construct (`AgenticCheck`) for AI-powered prompt-driven monitoring with skill and env var allowlists',
},
{
id: 'configure-api-checks',
description: 'Api Check construct (`ApiCheck`), assertions, and authentication setup scripts',
},
{
id: 'configure-browser-checks',
description: 'Browser Check construct (`BrowserCheck`) with Playwright test files',
},
{
id: 'configure-playwright-checks',
description: 'Playwright Check Suite construct (`PlaywrightCheck`) for multi-browser test suites',
},
{
id: 'configure-multistep-checks',
description: 'Multistep Check construct (`MultiStepCheck`) for complex user flows',
},
{
id: 'configure-tcp-monitors',
description: 'TCP Monitor construct (`TcpMonitor`) with assertions',
},
{
id: 'configure-url-monitors',
description: 'URL Monitor construct (`UrlMonitor`) with assertions',
},
{
id: 'configure-dns-monitors',
description: 'DNS Monitor construct (`DnsMonitor`) with assertions',
},
{
id: 'configure-icmp-monitors',
description: 'ICMP Monitor construct (`IcmpMonitor`) with latency and packet loss assertions',
},
{
id: 'configure-heartbeat-monitors',
description: 'Heartbeat Monitor construct (`HeartbeatMonitor`)',
},
{
id: 'configure-check-groups',
description: 'CheckGroupV2 construct (`CheckGroupV2`) for organizing checks',
},
{
id: 'configure-alert-channels',
description: 'Email (`EmailAlertChannel`), Phone (`PhoneCallAlertChannel`), and Slack (`SlackAlertChannel`) alert channels',
},
{
id: 'configure-supporting-constructs',
description: 'Status pages (`StatusPage`), dashboards (`Dashboard`), maintenance windows (`MaintenanceWindow`), and private locations (`PrivateLocation`)',
},
] as const
export const INVESTIGATE_REFERENCES = [
{
id: 'investigate-checks',
description: 'Inspecting checks (`checks list`, `checks get`) and triggering on-demand runs',
},
] as const
export const COMMUNICATE_REFERENCES = [
{
id: 'communicate-incidents',
description: 'Incident lifecycle (`incidents create`, `update`, `resolve`, `list`) and status pages',
},
] as const
export const MANAGE_REFERENCES = [
{
id: 'manage-plan',
description: 'Check account plan, entitlements, feature limits, and available locations (`account plan`)',
},
] as const
export const SKILL = {
name: 'checkly',
description: 'Get all the information and context to let your agent initialize, set up, create, test and manage your monitoring checks using the Checkly CLI.',
} as const
export const ACTIONS = [
{
id: 'initialize',
description: 'Learn how to initialize and set up a new Checkly CLI project from scratch.',
},
{
id: 'configure',
description: 'Learn how to create and manage monitoring checks using Checkly constructs and the CLI.',
references: REFERENCES,
},
{
id: 'investigate',
description: 'Access check status, analyze failures, and investigate errors.',
references: INVESTIGATE_REFERENCES,
},
{
id: 'communicate',
description: 'Open incidents and lead customer communications via status pages.',
references: COMMUNICATE_REFERENCES,
},
{
id: 'manage',
description: 'Understand your account plan, entitlements, and feature limits.',
references: MANAGE_REFERENCES,
},
] as const
interface ExampleConfig {
templateString: string
reference: string
exampleConfig?: string
exampleConfigPath?: string
}
export const EXAMPLE_CONFIGS: Record<string, ExampleConfig> = {
CHECKLY_CONFIG: {
templateString: '<!-- EXAMPLE: CHECKLY_CONFIG -->',
exampleConfig: `import { defineConfig } from 'checkly'
import { Frequency } from 'checkly/constructs'
export default defineConfig({
projectName: "Production Monitoring Suite",
logicalId: "prod-monitoring-2025",
repoUrl: "https://github.com/acme/monitoring",
checks: {
activated: true,
muted: false,
runtimeId: "2025.04",
frequency: Frequency.EVERY_10M,
locations: ["us-east-1", "eu-west-1", "ap-southeast-1"],
tags: ["production", "critical"],
checkMatch: "**/__checks__/*.check.ts",
ignoreDirectoriesMatch: ["node_modules/**", "dist/**"],
playwrightConfig: {
use: {
baseURL: "https://app.example.com",
},
},
browserChecks: {
frequency: Frequency.EVERY_30M,
testMatch: "**/__tests__/*.spec.ts",
},
},
cli: {
runLocation: "eu-west-1",
privateRunLocation: "private-dc1",
retries: 2,
},
})
`,
reference: 'https://www.checklyhq.com/docs/constructs/project/',
},
AGENTIC_CHECK: {
templateString: '<!-- EXAMPLE: AGENTIC_CHECK -->',
exampleConfigPath: 'resources/agentic-checks/example-agentic-check.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/agentic-check/',
},
BROWSER_CHECK: {
templateString: '<!-- EXAMPLE: BROWSER_CHECK -->',
exampleConfigPath:
'resources/browser-checks/example-browser-check/example-browser-check.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/browser-check/',
},
PLAYWRIGHT_CHECK: {
templateString: '<!-- EXAMPLE: PLAYWRIGHT_CHECK -->',
exampleConfig: `import { PlaywrightCheck } from "checkly/constructs"
const playwrightChecks = new PlaywrightCheck("multi-browser-check", {
name: "Multi-browser check suite",
playwrightConfigPath: "./playwright.config.ts",
// Playwright Check Suites support all browsers
// defined in your \`playwright.config\`
pwProjects: ["chromium", "firefox", "webkit"],
});
`,
reference: 'https://www.checklyhq.com/docs/constructs/playwright-check/',
},
API_CHECK: {
templateString: '<!-- EXAMPLE: API_CHECK -->',
exampleConfigPath:
'resources/api-checks/example-api-check/example-api-check.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/api-check/',
},
MULTISTEP_CHECK: {
templateString: '<!-- EXAMPLE: MULTISTEP_CHECK -->',
exampleConfigPath:
'resources/multi-step-checks/example-multistep-check/example-multistep-check.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/multistep-check/',
},
TCP_MONITOR: {
templateString: '<!-- EXAMPLE: TCP_MONITOR -->',
exampleConfigPath: 'resources/tcp-monitors/example-tcp-monitor.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/tcp-monitor/',
},
HEARTBEAT_MONITOR: {
templateString: '<!-- EXAMPLE: HEARTBEAT_MONITOR -->',
exampleConfigPath:
'resources/heartbeat-monitors/example-heartbeat-monitor.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/heartbeat-monitor/',
},
URL_MONITOR: {
templateString: '<!-- EXAMPLE: URL_MONITOR -->',
exampleConfigPath: 'resources/url-monitors/example-url-monitor.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/url-monitor/',
},
DNS_MONITOR: {
templateString: '<!-- EXAMPLE: DNS_MONITOR -->',
exampleConfigPath: 'resources/dns-monitors/example-dns-monitor.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/dns-monitor/',
},
ICMP_MONITOR: {
templateString: '<!-- EXAMPLE: ICMP_MONITOR -->',
exampleConfigPath: 'resources/icmp-monitors/example-icmp-monitor.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/icmp-monitor/',
},
CHECK_GROUP: {
templateString: '<!-- EXAMPLE: CHECK_GROUP -->',
exampleConfigPath:
'resources/check-group/example-group/example-group.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/check-group/',
},
STATUS_PAGE: {
templateString: '<!-- EXAMPLE: STATUS_PAGE -->',
exampleConfigPath: 'resources/status-pages/example-status-page.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/status-page/',
},
STATUS_PAGE_SERVICE: {
templateString: '<!-- EXAMPLE: STATUS_PAGE_SERVICE -->',
exampleConfigPath:
'resources/status-pages/services/example-service.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/status-page-service/',
},
DASHBOARD: {
templateString: '<!-- EXAMPLE: DASHBOARD -->',
exampleConfigPath:
'resources/dashboards/example-dashboard/example-dashboard.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/dashboard/',
},
MAINTENANCE_WINDOW: {
templateString: '<!-- EXAMPLE: MAINTENANCE_WINDOW -->',
exampleConfigPath:
'resources/maintenance-windows/example-maintenance-window.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/maintenance-window/',
},
PRIVATE_LOCATION: {
templateString: '<!-- EXAMPLE: PRIVATE_LOCATION -->',
exampleConfigPath:
'resources/private-locations/example-private-location.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/private-location/',
},
EMAIL_ALERT_CHANNEL: {
templateString: '<!-- EXAMPLE: EMAIL_ALERT_CHANNEL -->',
exampleConfigPath: 'resources/alert-channels/email/test.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/email-alert-channel/',
},
PHONE_CALL_ALERT_CHANNEL: {
templateString: '<!-- EXAMPLE: PHONE_CALL_ALERT_CHANNEL -->',
exampleConfigPath: 'resources/alert-channels/phone-call/test-user.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/phone-call-alert-channel/',
},
SLACK_ALERT_CHANNEL: {
templateString: '<!-- EXAMPLE: SLACK_ALERT_CHANNEL -->',
exampleConfigPath: 'resources/alert-channels/slack/general.check.ts',
reference: 'https://www.checklyhq.com/docs/constructs/slack-alert-channel/',
},
}