@cutleryapp/agent 1.0.25 → 1.0.26
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/mcp-executor.js +33 -0
- package/package.json +1 -1
package/dist/mcp-executor.js
CHANGED
|
@@ -101,6 +101,39 @@ class TestExecutor {
|
|
|
101
101
|
handled = true;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
+
// 3a. Multi-field fill: "Fill firstname, lastname" → fill each with inferred value
|
|
105
|
+
if (!handled && /^(?:fill|type)\s+/i.test(raw) && !/\s+(?:in|into|with)\s+/i.test(raw)) {
|
|
106
|
+
const fieldsPart = raw.replace(/^(?:fill|type)\s+/i, "").trim();
|
|
107
|
+
const fields = fieldsPart.split(/,\s*/).map((f) => f.trim().replace(/^["']|["']$/g, "")).filter(Boolean);
|
|
108
|
+
if (fields.length > 1) {
|
|
109
|
+
const valueMap = {
|
|
110
|
+
firstname: "John", first: "John", fname: "John",
|
|
111
|
+
lastname: "Smith", last: "Smith", lname: "Smith", surname: "Smith",
|
|
112
|
+
name: "John Smith", fullname: "John Smith",
|
|
113
|
+
email: "john.smith@example.com", emailaddress: "john.smith@example.com",
|
|
114
|
+
phone: "9876543210", mobile: "9876543210", phonenumber: "9876543210", mobilenumber: "9876543210",
|
|
115
|
+
address: "123 Test Street", currentaddress: "123 Test Street", streetaddress: "123 Test Street",
|
|
116
|
+
city: "New York", state: "New York",
|
|
117
|
+
zip: "10001", zipcode: "10001", postalcode: "10001",
|
|
118
|
+
dob: "01/01/1990", dateofbirth: "01/01/1990", birthdate: "01/01/1990",
|
|
119
|
+
age: "30", username: "john.smith",
|
|
120
|
+
password: "Test@1234", company: "Acme Corp",
|
|
121
|
+
subject: "Mathematics", subjects: "Mathematics",
|
|
122
|
+
message: "This is a test message.", comment: "Test comment.",
|
|
123
|
+
description: "Test description.",
|
|
124
|
+
};
|
|
125
|
+
for (const field of fields) {
|
|
126
|
+
const key = field.toLowerCase().replace(/[\s_-]+/g, "");
|
|
127
|
+
const value = valueMap[key] || "Test Value";
|
|
128
|
+
console.log(` ⌨️ Multi-fill: "${field}" → "${value}"`);
|
|
129
|
+
try {
|
|
130
|
+
await tryFill(page, field, value);
|
|
131
|
+
}
|
|
132
|
+
catch { /* ignore individual failures */ }
|
|
133
|
+
}
|
|
134
|
+
handled = true;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
104
137
|
// 3. Fill — smart selector strategies via MCP/Playwright
|
|
105
138
|
if (!handled && (lower.includes("fill") || lower.includes("type") || lower.includes("enter"))) {
|
|
106
139
|
const match = raw.match(/(?:enter|fill|type)\s+"([^"]+)"\s+(?:in|into)\s+(?:the\s+)?"?([^"]+?)"?\s*(?:field|input|box|area)?\s*$/i) ||
|