@checkview/mcp-server 1.1.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/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/api-client.d.ts +44 -0
- package/dist/api-client.d.ts.map +1 -0
- package/dist/api-client.js +164 -0
- package/dist/api-client.js.map +1 -0
- package/dist/format.d.ts +35 -0
- package/dist/format.d.ts.map +1 -0
- package/dist/format.js +57 -0
- package/dist/format.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +142 -0
- package/dist/index.js.map +1 -0
- package/dist/polling.d.ts +13 -0
- package/dist/polling.d.ts.map +1 -0
- package/dist/polling.js +55 -0
- package/dist/polling.js.map +1 -0
- package/dist/tools/abort-test.d.ts +4 -0
- package/dist/tools/abort-test.d.ts.map +1 -0
- package/dist/tools/abort-test.js +136 -0
- package/dist/tools/abort-test.js.map +1 -0
- package/dist/tools/add-test-comment.d.ts +4 -0
- package/dist/tools/add-test-comment.d.ts.map +1 -0
- package/dist/tools/add-test-comment.js +77 -0
- package/dist/tools/add-test-comment.js.map +1 -0
- package/dist/tools/add-website.d.ts +4 -0
- package/dist/tools/add-website.d.ts.map +1 -0
- package/dist/tools/add-website.js +106 -0
- package/dist/tools/add-website.js.map +1 -0
- package/dist/tools/check-website-availability.d.ts +4 -0
- package/dist/tools/check-website-availability.d.ts.map +1 -0
- package/dist/tools/check-website-availability.js +45 -0
- package/dist/tools/check-website-availability.js.map +1 -0
- package/dist/tools/check-website-health.d.ts +4 -0
- package/dist/tools/check-website-health.d.ts.map +1 -0
- package/dist/tools/check-website-health.js +61 -0
- package/dist/tools/check-website-health.js.map +1 -0
- package/dist/tools/compare-test-runs.d.ts +4 -0
- package/dist/tools/compare-test-runs.d.ts.map +1 -0
- package/dist/tools/compare-test-runs.js +75 -0
- package/dist/tools/compare-test-runs.js.map +1 -0
- package/dist/tools/create-form-test-flow.d.ts +4 -0
- package/dist/tools/create-form-test-flow.d.ts.map +1 -0
- package/dist/tools/create-form-test-flow.js +228 -0
- package/dist/tools/create-form-test-flow.js.map +1 -0
- package/dist/tools/create-test-flow.d.ts +4 -0
- package/dist/tools/create-test-flow.d.ts.map +1 -0
- package/dist/tools/create-test-flow.js +536 -0
- package/dist/tools/create-test-flow.js.map +1 -0
- package/dist/tools/delete-invitation.d.ts +4 -0
- package/dist/tools/delete-invitation.d.ts.map +1 -0
- package/dist/tools/delete-invitation.js +67 -0
- package/dist/tools/delete-invitation.js.map +1 -0
- package/dist/tools/delete-test-comment.d.ts +4 -0
- package/dist/tools/delete-test-comment.d.ts.map +1 -0
- package/dist/tools/delete-test-comment.js +67 -0
- package/dist/tools/delete-test-comment.js.map +1 -0
- package/dist/tools/get-ai-summary.d.ts +4 -0
- package/dist/tools/get-ai-summary.d.ts.map +1 -0
- package/dist/tools/get-ai-summary.js +61 -0
- package/dist/tools/get-ai-summary.js.map +1 -0
- package/dist/tools/get-current-organization.d.ts +4 -0
- package/dist/tools/get-current-organization.d.ts.map +1 -0
- package/dist/tools/get-current-organization.js +41 -0
- package/dist/tools/get-current-organization.js.map +1 -0
- package/dist/tools/get-generation-status.d.ts +4 -0
- package/dist/tools/get-generation-status.d.ts.map +1 -0
- package/dist/tools/get-generation-status.js +45 -0
- package/dist/tools/get-generation-status.js.map +1 -0
- package/dist/tools/get-metrics.d.ts +4 -0
- package/dist/tools/get-metrics.d.ts.map +1 -0
- package/dist/tools/get-metrics.js +90 -0
- package/dist/tools/get-metrics.js.map +1 -0
- package/dist/tools/get-organization-stats.d.ts +4 -0
- package/dist/tools/get-organization-stats.d.ts.map +1 -0
- package/dist/tools/get-organization-stats.js +53 -0
- package/dist/tools/get-organization-stats.js.map +1 -0
- package/dist/tools/get-organization.d.ts +4 -0
- package/dist/tools/get-organization.d.ts.map +1 -0
- package/dist/tools/get-organization.js +71 -0
- package/dist/tools/get-organization.js.map +1 -0
- package/dist/tools/get-results.d.ts +4 -0
- package/dist/tools/get-results.d.ts.map +1 -0
- package/dist/tools/get-results.js +154 -0
- package/dist/tools/get-results.js.map +1 -0
- package/dist/tools/get-settings.d.ts +4 -0
- package/dist/tools/get-settings.d.ts.map +1 -0
- package/dist/tools/get-settings.js +100 -0
- package/dist/tools/get-settings.js.map +1 -0
- package/dist/tools/get-step-screenshot.d.ts +4 -0
- package/dist/tools/get-step-screenshot.d.ts.map +1 -0
- package/dist/tools/get-step-screenshot.js +47 -0
- package/dist/tools/get-step-screenshot.js.map +1 -0
- package/dist/tools/get-test-flow.d.ts +4 -0
- package/dist/tools/get-test-flow.d.ts.map +1 -0
- package/dist/tools/get-test-flow.js +90 -0
- package/dist/tools/get-test-flow.js.map +1 -0
- package/dist/tools/get-test-history.d.ts +4 -0
- package/dist/tools/get-test-history.d.ts.map +1 -0
- package/dist/tools/get-test-history.js +100 -0
- package/dist/tools/get-test-history.js.map +1 -0
- package/dist/tools/get-test-run-video.d.ts +4 -0
- package/dist/tools/get-test-run-video.d.ts.map +1 -0
- package/dist/tools/get-test-run-video.js +66 -0
- package/dist/tools/get-test-run-video.js.map +1 -0
- package/dist/tools/get-test-step-details.d.ts +4 -0
- package/dist/tools/get-test-step-details.d.ts.map +1 -0
- package/dist/tools/get-test-step-details.js +166 -0
- package/dist/tools/get-test-step-details.js.map +1 -0
- package/dist/tools/get-usage-reports.d.ts +4 -0
- package/dist/tools/get-usage-reports.d.ts.map +1 -0
- package/dist/tools/get-usage-reports.js +73 -0
- package/dist/tools/get-usage-reports.js.map +1 -0
- package/dist/tools/get-usage.d.ts +4 -0
- package/dist/tools/get-usage.d.ts.map +1 -0
- package/dist/tools/get-usage.js +32 -0
- package/dist/tools/get-usage.js.map +1 -0
- package/dist/tools/get-ux-audit-report.d.ts +4 -0
- package/dist/tools/get-ux-audit-report.d.ts.map +1 -0
- package/dist/tools/get-ux-audit-report.js +52 -0
- package/dist/tools/get-ux-audit-report.js.map +1 -0
- package/dist/tools/get-website-analytics.d.ts +4 -0
- package/dist/tools/get-website-analytics.d.ts.map +1 -0
- package/dist/tools/get-website-analytics.js +54 -0
- package/dist/tools/get-website-analytics.js.map +1 -0
- package/dist/tools/get-website-logs.d.ts +4 -0
- package/dist/tools/get-website-logs.d.ts.map +1 -0
- package/dist/tools/get-website-logs.js +53 -0
- package/dist/tools/get-website-logs.js.map +1 -0
- package/dist/tools/get-website-screenshot.d.ts +4 -0
- package/dist/tools/get-website-screenshot.d.ts.map +1 -0
- package/dist/tools/get-website-screenshot.js +59 -0
- package/dist/tools/get-website-screenshot.js.map +1 -0
- package/dist/tools/get-website-settings.d.ts +4 -0
- package/dist/tools/get-website-settings.d.ts.map +1 -0
- package/dist/tools/get-website-settings.js +97 -0
- package/dist/tools/get-website-settings.js.map +1 -0
- package/dist/tools/get-website.d.ts +4 -0
- package/dist/tools/get-website.d.ts.map +1 -0
- package/dist/tools/get-website.js +45 -0
- package/dist/tools/get-website.js.map +1 -0
- package/dist/tools/invite-team-member.d.ts +4 -0
- package/dist/tools/invite-team-member.d.ts.map +1 -0
- package/dist/tools/invite-team-member.js +100 -0
- package/dist/tools/invite-team-member.js.map +1 -0
- package/dist/tools/list-forms.d.ts +4 -0
- package/dist/tools/list-forms.d.ts.map +1 -0
- package/dist/tools/list-forms.js +65 -0
- package/dist/tools/list-forms.js.map +1 -0
- package/dist/tools/list-organizations.d.ts +4 -0
- package/dist/tools/list-organizations.d.ts.map +1 -0
- package/dist/tools/list-organizations.js +78 -0
- package/dist/tools/list-organizations.js.map +1 -0
- package/dist/tools/list-team-members.d.ts +4 -0
- package/dist/tools/list-team-members.d.ts.map +1 -0
- package/dist/tools/list-team-members.js +58 -0
- package/dist/tools/list-team-members.js.map +1 -0
- package/dist/tools/list-test-comments.d.ts +4 -0
- package/dist/tools/list-test-comments.d.ts.map +1 -0
- package/dist/tools/list-test-comments.js +55 -0
- package/dist/tools/list-test-comments.js.map +1 -0
- package/dist/tools/list-test-flow-steps.d.ts +4 -0
- package/dist/tools/list-test-flow-steps.d.ts.map +1 -0
- package/dist/tools/list-test-flow-steps.js +59 -0
- package/dist/tools/list-test-flow-steps.js.map +1 -0
- package/dist/tools/list-test-flows.d.ts +4 -0
- package/dist/tools/list-test-flows.d.ts.map +1 -0
- package/dist/tools/list-test-flows.js +90 -0
- package/dist/tools/list-test-flows.js.map +1 -0
- package/dist/tools/list-test-runs.d.ts +4 -0
- package/dist/tools/list-test-runs.d.ts.map +1 -0
- package/dist/tools/list-test-runs.js +94 -0
- package/dist/tools/list-test-runs.js.map +1 -0
- package/dist/tools/list-ux-audits.d.ts +4 -0
- package/dist/tools/list-ux-audits.d.ts.map +1 -0
- package/dist/tools/list-ux-audits.js +59 -0
- package/dist/tools/list-ux-audits.js.map +1 -0
- package/dist/tools/list-websites.d.ts +4 -0
- package/dist/tools/list-websites.d.ts.map +1 -0
- package/dist/tools/list-websites.js +80 -0
- package/dist/tools/list-websites.js.map +1 -0
- package/dist/tools/manage-notification-settings.d.ts +4 -0
- package/dist/tools/manage-notification-settings.d.ts.map +1 -0
- package/dist/tools/manage-notification-settings.js +311 -0
- package/dist/tools/manage-notification-settings.js.map +1 -0
- package/dist/tools/pause-website.d.ts +4 -0
- package/dist/tools/pause-website.d.ts.map +1 -0
- package/dist/tools/pause-website.js +58 -0
- package/dist/tools/pause-website.js.map +1 -0
- package/dist/tools/regenerate-test-steps.d.ts +4 -0
- package/dist/tools/regenerate-test-steps.d.ts.map +1 -0
- package/dist/tools/regenerate-test-steps.js +173 -0
- package/dist/tools/regenerate-test-steps.js.map +1 -0
- package/dist/tools/reinitialize-test-flow.d.ts +4 -0
- package/dist/tools/reinitialize-test-flow.d.ts.map +1 -0
- package/dist/tools/reinitialize-test-flow.js +79 -0
- package/dist/tools/reinitialize-test-flow.js.map +1 -0
- package/dist/tools/remove-team-member.d.ts +4 -0
- package/dist/tools/remove-team-member.d.ts.map +1 -0
- package/dist/tools/remove-team-member.js +68 -0
- package/dist/tools/remove-team-member.js.map +1 -0
- package/dist/tools/remove-test-flow.d.ts +4 -0
- package/dist/tools/remove-test-flow.d.ts.map +1 -0
- package/dist/tools/remove-test-flow.js +74 -0
- package/dist/tools/remove-test-flow.js.map +1 -0
- package/dist/tools/remove-website.d.ts +4 -0
- package/dist/tools/remove-website.d.ts.map +1 -0
- package/dist/tools/remove-website.js +74 -0
- package/dist/tools/remove-website.js.map +1 -0
- package/dist/tools/resume-website.d.ts +4 -0
- package/dist/tools/resume-website.d.ts.map +1 -0
- package/dist/tools/resume-website.js +58 -0
- package/dist/tools/resume-website.js.map +1 -0
- package/dist/tools/run-all-tests.d.ts +4 -0
- package/dist/tools/run-all-tests.d.ts.map +1 -0
- package/dist/tools/run-all-tests.js +165 -0
- package/dist/tools/run-all-tests.js.map +1 -0
- package/dist/tools/run-test.d.ts +4 -0
- package/dist/tools/run-test.d.ts.map +1 -0
- package/dist/tools/run-test.js +186 -0
- package/dist/tools/run-test.js.map +1 -0
- package/dist/tools/run-ux-audit.d.ts +4 -0
- package/dist/tools/run-ux-audit.d.ts.map +1 -0
- package/dist/tools/run-ux-audit.js +192 -0
- package/dist/tools/run-ux-audit.js.map +1 -0
- package/dist/tools/set-organization.d.ts +4 -0
- package/dist/tools/set-organization.d.ts.map +1 -0
- package/dist/tools/set-organization.js +129 -0
- package/dist/tools/set-organization.js.map +1 -0
- package/dist/tools/test-url.d.ts +4 -0
- package/dist/tools/test-url.d.ts.map +1 -0
- package/dist/tools/test-url.js +334 -0
- package/dist/tools/test-url.js.map +1 -0
- package/dist/tools/update-organization.d.ts +4 -0
- package/dist/tools/update-organization.d.ts.map +1 -0
- package/dist/tools/update-organization.js +90 -0
- package/dist/tools/update-organization.js.map +1 -0
- package/dist/tools/update-schedule.d.ts +4 -0
- package/dist/tools/update-schedule.d.ts.map +1 -0
- package/dist/tools/update-schedule.js +157 -0
- package/dist/tools/update-schedule.js.map +1 -0
- package/dist/tools/update-settings.d.ts +4 -0
- package/dist/tools/update-settings.d.ts.map +1 -0
- package/dist/tools/update-settings.js +97 -0
- package/dist/tools/update-settings.js.map +1 -0
- package/dist/tools/update-team-member.d.ts +4 -0
- package/dist/tools/update-team-member.d.ts.map +1 -0
- package/dist/tools/update-team-member.js +102 -0
- package/dist/tools/update-team-member.js.map +1 -0
- package/dist/tools/update-test-flow-steps.d.ts +4 -0
- package/dist/tools/update-test-flow-steps.d.ts.map +1 -0
- package/dist/tools/update-test-flow-steps.js +440 -0
- package/dist/tools/update-test-flow-steps.js.map +1 -0
- package/dist/tools/update-test-flow.d.ts +4 -0
- package/dist/tools/update-test-flow.d.ts.map +1 -0
- package/dist/tools/update-test-flow.js +172 -0
- package/dist/tools/update-test-flow.js.map +1 -0
- package/dist/tools/update-website.d.ts +4 -0
- package/dist/tools/update-website.d.ts.map +1 -0
- package/dist/tools/update-website.js +86 -0
- package/dist/tools/update-website.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ApiError, idempotencyKey } from "../api-client.js";
|
|
3
|
+
import { formatTestRun } from "../format.js";
|
|
4
|
+
import { pollUntil } from "../polling.js";
|
|
5
|
+
const TERMINAL_STATUSES = new Set([
|
|
6
|
+
"success",
|
|
7
|
+
"error",
|
|
8
|
+
"aborted",
|
|
9
|
+
"awaiting_email",
|
|
10
|
+
]);
|
|
11
|
+
export function registerTestUrlTool(server, client) {
|
|
12
|
+
server.registerTool("checkview_test_url", {
|
|
13
|
+
description: "Test a web page by URL using AI-generated steps. Creates a test flow, generates steps via AI, runs the test, and returns pass/fail results. Use this for custom test flows like login pages, search, membership signups, e-commerce, LMS, or any non-WordPress-plugin form. For WordPress plugin forms, use checkview_create_form_test_flow instead (faster, uses progressive scanner). Provide user_context with field values to guide the AI.",
|
|
14
|
+
inputSchema: {
|
|
15
|
+
url: z
|
|
16
|
+
.string()
|
|
17
|
+
.url()
|
|
18
|
+
.refine((u) => u.startsWith("https://"), "URL must use HTTPS")
|
|
19
|
+
.describe("The URL of the page to test (e.g. https://example.com/contact)"),
|
|
20
|
+
test_type: z
|
|
21
|
+
.enum([
|
|
22
|
+
"form",
|
|
23
|
+
"login",
|
|
24
|
+
"search",
|
|
25
|
+
"membership",
|
|
26
|
+
"ecommerce",
|
|
27
|
+
"lms",
|
|
28
|
+
"other",
|
|
29
|
+
])
|
|
30
|
+
.optional()
|
|
31
|
+
.default("form")
|
|
32
|
+
.describe("Type of test to create (default: form)"),
|
|
33
|
+
user_context: z
|
|
34
|
+
.record(z.string().max(1000))
|
|
35
|
+
.refine((obj) => Object.keys(obj).length <= 50, "Maximum 50 keys")
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Key-value context for the test (e.g. { firstName: "John", email: "test@example.com" }). Max 50 keys, 1000 chars per value.'),
|
|
38
|
+
wait_for_result: z
|
|
39
|
+
.boolean()
|
|
40
|
+
.optional()
|
|
41
|
+
.default(true)
|
|
42
|
+
.describe("Wait for test to complete (default true). If false, returns after AI generation."),
|
|
43
|
+
},
|
|
44
|
+
annotations: {
|
|
45
|
+
readOnlyHint: false,
|
|
46
|
+
destructiveHint: false,
|
|
47
|
+
idempotentHint: true,
|
|
48
|
+
},
|
|
49
|
+
}, async (args, extra) => {
|
|
50
|
+
try {
|
|
51
|
+
// Step 1: Create test flow from URL
|
|
52
|
+
const testType = args.test_type ?? "form";
|
|
53
|
+
const userContext = args.user_context ?? {};
|
|
54
|
+
const idemKey = idempotencyKey(`${args.url}:${testType}:${JSON.stringify(userContext)}`);
|
|
55
|
+
await server.sendLoggingMessage({
|
|
56
|
+
level: "info",
|
|
57
|
+
data: `Creating test flow for ${args.url} (type: ${testType})...`,
|
|
58
|
+
});
|
|
59
|
+
let fromUrlResult;
|
|
60
|
+
try {
|
|
61
|
+
const result = await client.post("/test-flows/from-url", {
|
|
62
|
+
url: args.url,
|
|
63
|
+
testType,
|
|
64
|
+
userContext: Object.keys(userContext).length > 0 ? userContext : undefined,
|
|
65
|
+
}, idemKey, extra.signal);
|
|
66
|
+
fromUrlResult = result.body;
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (error instanceof ApiError) {
|
|
70
|
+
if (error.status === 409 &&
|
|
71
|
+
error.type ===
|
|
72
|
+
"https://api.checkview.io/errors/request-in-progress") {
|
|
73
|
+
return {
|
|
74
|
+
content: [
|
|
75
|
+
{
|
|
76
|
+
type: "text",
|
|
77
|
+
text: "A request is currently being processed for this URL. Please try again in a few seconds.",
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
isError: true,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
// Cached error replay — retry with fresh key
|
|
84
|
+
if (error.isReplay && error.status >= 400) {
|
|
85
|
+
const freshKey = idempotencyKey(`${args.url}:${testType}:${JSON.stringify(userContext)}:retry:${Date.now()}`);
|
|
86
|
+
const retryResult = await client.post("/test-flows/from-url", {
|
|
87
|
+
url: args.url,
|
|
88
|
+
testType,
|
|
89
|
+
userContext: Object.keys(userContext).length > 0
|
|
90
|
+
? userContext
|
|
91
|
+
: undefined,
|
|
92
|
+
}, freshKey, extra.signal);
|
|
93
|
+
fromUrlResult = retryResult.body;
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
return {
|
|
97
|
+
content: [
|
|
98
|
+
{
|
|
99
|
+
type: "text",
|
|
100
|
+
text: `Failed to create test flow: ${error.detail}`,
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
isError: true,
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
throw error;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const testFlowId = fromUrlResult.id;
|
|
112
|
+
// Step 2: Poll AI generation status
|
|
113
|
+
await server.sendLoggingMessage({
|
|
114
|
+
level: "info",
|
|
115
|
+
data: `Test flow ${testFlowId} created. Waiting for AI to generate test steps...`,
|
|
116
|
+
});
|
|
117
|
+
let lastGenStatus = { status: "processing" };
|
|
118
|
+
let genResult;
|
|
119
|
+
try {
|
|
120
|
+
genResult = await pollUntil(async () => {
|
|
121
|
+
try {
|
|
122
|
+
const r = await client.get(`/test-flows/${testFlowId}/ai-generate/status`, undefined, extra.signal);
|
|
123
|
+
lastGenStatus = r.body;
|
|
124
|
+
return r.body;
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
// Swallow transient server errors
|
|
128
|
+
if (error instanceof ApiError && error.status >= 500) {
|
|
129
|
+
return lastGenStatus;
|
|
130
|
+
}
|
|
131
|
+
throw error;
|
|
132
|
+
}
|
|
133
|
+
}, (result) => result.status === "complete" || result.status === "failed", {
|
|
134
|
+
intervalMs: 10_000,
|
|
135
|
+
timeoutMs: 300_000, // 5 min
|
|
136
|
+
signal: extra.signal,
|
|
137
|
+
onProgress: (result) => {
|
|
138
|
+
const msg = result.message || `AI generation: ${result.status}`;
|
|
139
|
+
server
|
|
140
|
+
.sendLoggingMessage({ level: "info", data: msg })
|
|
141
|
+
.catch(() => { });
|
|
142
|
+
},
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
catch (error) {
|
|
146
|
+
const isTimeout = error instanceof Error &&
|
|
147
|
+
error.message.startsWith("Operation timed out");
|
|
148
|
+
if (isTimeout) {
|
|
149
|
+
return {
|
|
150
|
+
content: [
|
|
151
|
+
{
|
|
152
|
+
type: "text",
|
|
153
|
+
text: `AI generation still ${lastGenStatus.status} after 5 min.\n\nTest flow ID: ${testFlowId}\n\nUse checkview_get_test_flow("${testFlowId}") to check later.`,
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
// Step 3: Check generation result
|
|
161
|
+
if (genResult.status === "failed") {
|
|
162
|
+
return {
|
|
163
|
+
content: [
|
|
164
|
+
{
|
|
165
|
+
type: "text",
|
|
166
|
+
text: `AI test generation failed: ${genResult.error || "Unknown error"}.\n\nTest flow ID: ${testFlowId}`,
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
isError: true,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
// Zero-step guard
|
|
173
|
+
const stepCount = genResult.steps?.length ?? 0;
|
|
174
|
+
if (stepCount === 0) {
|
|
175
|
+
return {
|
|
176
|
+
content: [
|
|
177
|
+
{
|
|
178
|
+
type: "text",
|
|
179
|
+
text: `AI generation completed but produced no test steps. The page may not contain a detectable ${testType}.\n\nTest flow ID: ${testFlowId}`,
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
isError: true,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
await server.sendLoggingMessage({
|
|
186
|
+
level: "info",
|
|
187
|
+
data: `AI generated ${stepCount} test steps.`,
|
|
188
|
+
});
|
|
189
|
+
// If not waiting for result, return here
|
|
190
|
+
if (!args.wait_for_result) {
|
|
191
|
+
return {
|
|
192
|
+
content: [
|
|
193
|
+
{
|
|
194
|
+
type: "text",
|
|
195
|
+
text: `Test flow created with ${stepCount} steps.\n\nTest flow ID: ${testFlowId}\n\nUse checkview_run_test("${testFlowId}") to execute it.`,
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
// Step 4: Trigger execution
|
|
201
|
+
const execIdemKey = idempotencyKey(`${testFlowId}:${Date.now()}`);
|
|
202
|
+
let execution;
|
|
203
|
+
try {
|
|
204
|
+
const execResult = await client.post(`/test-flows/${testFlowId}/executions`, { trigger: "api" }, execIdemKey, extra.signal);
|
|
205
|
+
execution = execResult.body;
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
if (error instanceof ApiError) {
|
|
209
|
+
if (error.status === 409 &&
|
|
210
|
+
error.type ===
|
|
211
|
+
"https://api.checkview.io/errors/request-in-progress") {
|
|
212
|
+
return {
|
|
213
|
+
content: [
|
|
214
|
+
{
|
|
215
|
+
type: "text",
|
|
216
|
+
text: `Test flow created (${stepCount} steps) but the execution request is still being processed. Please try again in a few seconds.\n\nTest flow ID: ${testFlowId}`,
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
isError: true,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
if (error.status === 409) {
|
|
223
|
+
return {
|
|
224
|
+
content: [
|
|
225
|
+
{
|
|
226
|
+
type: "text",
|
|
227
|
+
text: `Test flow created (${stepCount} steps) but a test is already running.\n\nTest flow ID: ${testFlowId}`,
|
|
228
|
+
},
|
|
229
|
+
],
|
|
230
|
+
isError: true,
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
if (error.status === 403) {
|
|
234
|
+
return {
|
|
235
|
+
content: [
|
|
236
|
+
{
|
|
237
|
+
type: "text",
|
|
238
|
+
text: `Test flow created (${stepCount} steps) but monthly test limit reached.\n\nTest flow ID: ${testFlowId}`,
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
isError: true,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
if (error.isReplay && error.status >= 400) {
|
|
245
|
+
const freshKey = idempotencyKey(`${testFlowId}:retry:${Date.now()}`);
|
|
246
|
+
const retryResult = await client.post(`/test-flows/${testFlowId}/executions`, { trigger: "api" }, freshKey, extra.signal);
|
|
247
|
+
execution = retryResult.body;
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
return {
|
|
251
|
+
content: [
|
|
252
|
+
{
|
|
253
|
+
type: "text",
|
|
254
|
+
text: `Test flow created (${stepCount} steps) but execution failed: ${error.detail}\n\nTest flow ID: ${testFlowId}`,
|
|
255
|
+
},
|
|
256
|
+
],
|
|
257
|
+
isError: true,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
throw error;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
const testRunId = execution.id;
|
|
266
|
+
// Step 5: Poll for completion
|
|
267
|
+
await server.sendLoggingMessage({
|
|
268
|
+
level: "info",
|
|
269
|
+
data: `Test run ${testRunId} started. Polling for completion...`,
|
|
270
|
+
});
|
|
271
|
+
let lastResult = { id: testRunId, status: "started" };
|
|
272
|
+
let finalResult;
|
|
273
|
+
try {
|
|
274
|
+
finalResult = await pollUntil(async () => {
|
|
275
|
+
try {
|
|
276
|
+
const r = await client.get(`/test-runs/${testRunId}`, undefined, extra.signal);
|
|
277
|
+
lastResult = r.body;
|
|
278
|
+
return r.body;
|
|
279
|
+
}
|
|
280
|
+
catch (error) {
|
|
281
|
+
// Swallow transient server errors
|
|
282
|
+
if (error instanceof ApiError && error.status >= 500) {
|
|
283
|
+
return lastResult;
|
|
284
|
+
}
|
|
285
|
+
throw error;
|
|
286
|
+
}
|
|
287
|
+
}, (result) => TERMINAL_STATUSES.has(result.status), {
|
|
288
|
+
intervalMs: 10_000,
|
|
289
|
+
timeoutMs: 600_000, // 10 min
|
|
290
|
+
signal: extra.signal,
|
|
291
|
+
onProgress: (result) => {
|
|
292
|
+
server
|
|
293
|
+
.sendLoggingMessage({
|
|
294
|
+
level: "info",
|
|
295
|
+
data: `Test run ${testRunId}: status=${result.status}`,
|
|
296
|
+
})
|
|
297
|
+
.catch(() => { });
|
|
298
|
+
},
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
const isTimeout = error instanceof Error &&
|
|
303
|
+
error.message.startsWith("Operation timed out");
|
|
304
|
+
if (isTimeout) {
|
|
305
|
+
return {
|
|
306
|
+
content: [
|
|
307
|
+
{
|
|
308
|
+
type: "text",
|
|
309
|
+
text: `Test run ${testRunId} is still ${lastResult.status} after 10 min.\n\nTest flow ID: ${testFlowId}\nUse checkview_get_results("${testRunId}") to check later.`,
|
|
310
|
+
},
|
|
311
|
+
],
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
throw error;
|
|
315
|
+
}
|
|
316
|
+
// Step 6: Return formatted results
|
|
317
|
+
return {
|
|
318
|
+
content: [{ type: "text", text: formatTestRun(finalResult) }],
|
|
319
|
+
};
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
return {
|
|
323
|
+
content: [
|
|
324
|
+
{
|
|
325
|
+
type: "text",
|
|
326
|
+
text: `Failed to test URL: ${error instanceof Error ? error.message : String(error)}`,
|
|
327
|
+
},
|
|
328
|
+
],
|
|
329
|
+
isError: true,
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
//# sourceMappingURL=test-url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-url.js","sourceRoot":"","sources":["../../src/tools/test-url.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC;IAChC,SAAS;IACT,OAAO;IACP,SAAS;IACT,gBAAgB;CACjB,CAAC,CAAC;AAqBH,MAAM,UAAU,mBAAmB,CACjC,MAAiB,EACjB,MAAiB;IAEjB,MAAM,CAAC,YAAY,CACjB,oBAAoB,EACpB;QACE,WAAW,EACT,ibAAib;QACnb,WAAW,EAAE;YACX,GAAG,EAAE,CAAC;iBACH,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,oBAAoB,CAAC;iBAC7D,QAAQ,CACP,gEAAgE,CACjE;YACH,SAAS,EAAE,CAAC;iBACT,IAAI,CAAC;gBACJ,MAAM;gBACN,OAAO;gBACP,QAAQ;gBACR,YAAY;gBACZ,WAAW;gBACX,KAAK;gBACL,OAAO;aACR,CAAC;iBACD,QAAQ,EAAE;iBACV,OAAO,CAAC,MAAM,CAAC;iBACf,QAAQ,CAAC,wCAAw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,aAAa,UAAU,CAAC,MAAM,mCAAmC,UAAU,gCAAgC,SAAS,oBAAoB;6BACpK;yBACF;qBACF,CAAC;gBACJ,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;YAED,mCAAmC;YACnC,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;aAC9D,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,uBAAuB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACtF;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { type ApiClient } from "../api-client.js";
|
|
3
|
+
export declare function registerUpdateOrganizationTool(server: McpServer, client: ApiClient): void;
|
|
4
|
+
//# sourceMappingURL=update-organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-organization.d.ts","sourceRoot":"","sources":["../../src/tools/update-organization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAU5E,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,SAAS,GAChB,IAAI,CAuGN"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ApiError, idempotencyKey } from "../api-client.js";
|
|
3
|
+
export function registerUpdateOrganizationTool(server, client) {
|
|
4
|
+
server.registerTool("checkview_update_organization", {
|
|
5
|
+
description: "Update the current organization's settings such as name, email, and timezone.",
|
|
6
|
+
inputSchema: {
|
|
7
|
+
name: z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1)
|
|
10
|
+
.optional()
|
|
11
|
+
.describe("New name for the organization"),
|
|
12
|
+
email: z
|
|
13
|
+
.string()
|
|
14
|
+
.email()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe("Organization email address"),
|
|
17
|
+
timezone: z
|
|
18
|
+
.string()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Timezone for the organization (e.g. America/New_York)"),
|
|
21
|
+
},
|
|
22
|
+
annotations: {
|
|
23
|
+
readOnlyHint: false,
|
|
24
|
+
destructiveHint: false,
|
|
25
|
+
idempotentHint: true,
|
|
26
|
+
},
|
|
27
|
+
}, async (args, extra) => {
|
|
28
|
+
try {
|
|
29
|
+
const body = {};
|
|
30
|
+
if (args.name !== undefined)
|
|
31
|
+
body.name = args.name;
|
|
32
|
+
if (args.email !== undefined)
|
|
33
|
+
body.email = args.email;
|
|
34
|
+
if (args.timezone !== undefined)
|
|
35
|
+
body.timezone = args.timezone;
|
|
36
|
+
if (Object.keys(body).length === 0) {
|
|
37
|
+
return {
|
|
38
|
+
content: [
|
|
39
|
+
{
|
|
40
|
+
type: "text",
|
|
41
|
+
text: "No fields to update. Provide at least one field (name, email, timezone).",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
isError: true,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const idemKey = idempotencyKey(`update:organization:${JSON.stringify(body)}`);
|
|
48
|
+
let org;
|
|
49
|
+
try {
|
|
50
|
+
const result = await client.patch("/organizations/me", body, idemKey, extra.signal);
|
|
51
|
+
org = result.body;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
if (error instanceof ApiError) {
|
|
55
|
+
if (error.isReplay && error.status >= 400) {
|
|
56
|
+
const freshKey = idempotencyKey(`update:organization:${JSON.stringify(body)}:${Date.now()}`);
|
|
57
|
+
const retryResult = await client.patch("/organizations/me", body, freshKey, extra.signal);
|
|
58
|
+
org = retryResult.body;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
throw error;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
content: [
|
|
70
|
+
{
|
|
71
|
+
type: "text",
|
|
72
|
+
text: `Organization updated: ${org.name}\nEmail: ${org.contact_email} | Timezone: ${org.timezone} | ID: ${org.id}`,
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
return {
|
|
79
|
+
content: [
|
|
80
|
+
{
|
|
81
|
+
type: "text",
|
|
82
|
+
text: `Failed to update organization: ${error instanceof Error ? error.message : String(error)}`,
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
isError: true,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=update-organization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-organization.js","sourceRoot":"","sources":["../../src/tools/update-organization.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAU5E,MAAM,UAAU,8BAA8B,CAC5C,MAAiB,EACjB,MAAiB;IAEjB,MAAM,CAAC,YAAY,CACjB,+BAA+B,EAC/B;QACE,WAAW,EACT,+EAA+E;QACjF,WAAW,EAAE;YACX,IAAI,EAAE,CAAC;iBACJ,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,EAAE;iBACV,QAAQ,C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-schedule.d.ts","sourceRoot":"","sources":["../../src/tools/update-schedule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAyB5E,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,SAAS,EACjB,MAAM,EAAE,SAAS,GAChB,IAAI,CAmLN"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { ApiError, idempotencyKey } from "../api-client.js";
|
|
3
|
+
const DAY_NAMES = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
|
|
4
|
+
function formatDays(days) {
|
|
5
|
+
return days
|
|
6
|
+
.map((d) => {
|
|
7
|
+
if (d === 7)
|
|
8
|
+
return DAY_NAMES[0]; // 7 is also Sunday
|
|
9
|
+
if (d >= 0 && d <= 6)
|
|
10
|
+
return DAY_NAMES[d];
|
|
11
|
+
return `day ${Math.abs(d)}`;
|
|
12
|
+
})
|
|
13
|
+
.join(", ");
|
|
14
|
+
}
|
|
15
|
+
function formatSchedule(schedule) {
|
|
16
|
+
return `${formatDays(schedule.days)} at ${schedule.time} ${schedule.timezone}`;
|
|
17
|
+
}
|
|
18
|
+
export function registerUpdateScheduleTool(server, client) {
|
|
19
|
+
server.registerTool("checkview_update_schedule", {
|
|
20
|
+
description: 'Get, update, or remove the schedule for a test flow. Use action "get" to view, "update" to set, or "remove" to delete.',
|
|
21
|
+
inputSchema: z.discriminatedUnion("action", [
|
|
22
|
+
z.object({
|
|
23
|
+
action: z.literal("get"),
|
|
24
|
+
test_flow_id: z.string().uuid().describe("The test flow ID"),
|
|
25
|
+
}),
|
|
26
|
+
z.object({
|
|
27
|
+
action: z.literal("update"),
|
|
28
|
+
test_flow_id: z.string().uuid().describe("The test flow ID"),
|
|
29
|
+
days: z
|
|
30
|
+
.array(z.number().int().min(-28).max(7))
|
|
31
|
+
.min(1)
|
|
32
|
+
.max(31)
|
|
33
|
+
.refine((days) => {
|
|
34
|
+
const hasWeekly = days.some((d) => d >= 0);
|
|
35
|
+
const hasMonthly = days.some((d) => d < 0);
|
|
36
|
+
return !(hasWeekly && hasMonthly);
|
|
37
|
+
}, {
|
|
38
|
+
message: "Cannot mix weekly days (0-6) and monthly days (negative) in the same schedule",
|
|
39
|
+
})
|
|
40
|
+
.describe("Days to run: 0-7 for weekly (0/7=Sunday, 1=Monday, 6=Saturday), -28 to -1 for monthly day-of-month"),
|
|
41
|
+
time: z
|
|
42
|
+
.string()
|
|
43
|
+
.regex(/^\d{2}:\d{2}:\d{2}$/, "Time must be HH:MM:SS format")
|
|
44
|
+
.describe("Time to run (HH:MM:SS format)"),
|
|
45
|
+
timezone: z
|
|
46
|
+
.string()
|
|
47
|
+
.min(1)
|
|
48
|
+
.describe("Timezone (e.g. America/New_York)"),
|
|
49
|
+
}),
|
|
50
|
+
z.object({
|
|
51
|
+
action: z.literal("remove"),
|
|
52
|
+
test_flow_id: z.string().uuid().describe("The test flow ID"),
|
|
53
|
+
}),
|
|
54
|
+
]),
|
|
55
|
+
annotations: {
|
|
56
|
+
readOnlyHint: false,
|
|
57
|
+
destructiveHint: false,
|
|
58
|
+
idempotentHint: true,
|
|
59
|
+
},
|
|
60
|
+
}, async (args, extra) => {
|
|
61
|
+
try {
|
|
62
|
+
const { action, test_flow_id } = args;
|
|
63
|
+
if (action === "get") {
|
|
64
|
+
const { body } = await client.get(`/test-flows/${test_flow_id}/schedule`, undefined, extra.signal);
|
|
65
|
+
if (!body) {
|
|
66
|
+
return {
|
|
67
|
+
content: [{ type: "text", text: "No schedule configured." }],
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
content: [
|
|
72
|
+
{ type: "text", text: `Schedule: ${formatSchedule(body)}` },
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
if (action === "update") {
|
|
77
|
+
const { days, time, timezone } = args;
|
|
78
|
+
const updateBody = { days, time, timezone };
|
|
79
|
+
const idemKey = idempotencyKey(`update-schedule:${test_flow_id}:${JSON.stringify(updateBody)}`);
|
|
80
|
+
let schedule;
|
|
81
|
+
try {
|
|
82
|
+
const result = await client.patch(`/test-flows/${test_flow_id}/schedule`, updateBody, idemKey, extra.signal);
|
|
83
|
+
schedule = result.body;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
if (error instanceof ApiError) {
|
|
87
|
+
if (error.status === 404) {
|
|
88
|
+
return {
|
|
89
|
+
content: [{ type: "text", text: "Test flow not found." }],
|
|
90
|
+
isError: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (error.isReplay && error.status >= 400) {
|
|
94
|
+
const freshKey = idempotencyKey(`update-schedule:${test_flow_id}:${Date.now()}`);
|
|
95
|
+
const retryResult = await client.patch(`/test-flows/${test_flow_id}/schedule`, updateBody, freshKey, extra.signal);
|
|
96
|
+
schedule = retryResult.body;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
throw error;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
throw error;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
content: [
|
|
108
|
+
{
|
|
109
|
+
type: "text",
|
|
110
|
+
text: `Schedule updated: ${formatSchedule(schedule)}`,
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
// action === 'remove'
|
|
116
|
+
const idemKey = idempotencyKey(`delete-schedule:${test_flow_id}`);
|
|
117
|
+
try {
|
|
118
|
+
await client.delete(`/test-flows/${test_flow_id}/schedule`, idemKey, extra.signal);
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (error instanceof ApiError) {
|
|
122
|
+
// 404 = no schedule to remove — treat as success
|
|
123
|
+
if (error.status === 404) {
|
|
124
|
+
return {
|
|
125
|
+
content: [{ type: "text", text: "No schedule to remove." }],
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
if (error.isReplay && error.status >= 400) {
|
|
129
|
+
const freshKey = idempotencyKey(`delete-schedule:${test_flow_id}:${Date.now()}`);
|
|
130
|
+
await client.delete(`/test-flows/${test_flow_id}/schedule`, freshKey, extra.signal);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return {
|
|
141
|
+
content: [{ type: "text", text: "Schedule removed." }],
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
catch (error) {
|
|
145
|
+
return {
|
|
146
|
+
content: [
|
|
147
|
+
{
|
|
148
|
+
type: "text",
|
|
149
|
+
text: `Failed to manage schedule: ${error instanceof Error ? error.message : String(error)}`,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
isError: true,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=update-schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-schedule.js","sourceRoot":"","sources":["../../src/tools/update-schedule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAkB,MAAM,kBAAkB,CAAC;AAE5E,MAAM,SAAS,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AASpE,SAAS,UAAU,CAAC,IAAc;IAChC,OAAO,IAAI;SACR,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QACT,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,mBAA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