@auracheck-ai/cli 0.2.8 → 0.2.10
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/bin.js +57 -21
- package/dist/bin.js.map +1 -1
- package/dist/mcp/server.js +50 -20
- package/dist/mcp/server.js.map +1 -1
- package/package.json +3 -3
package/dist/mcp/server.js
CHANGED
|
@@ -169,8 +169,8 @@ var AuraCheckApi = class {
|
|
|
169
169
|
const { accounts } = await this.request("GET", `/api/projects/${projectId}/test-accounts`);
|
|
170
170
|
return accounts;
|
|
171
171
|
}
|
|
172
|
-
async createTestAccountLink(projectId, role) {
|
|
173
|
-
return this.request("POST", `/api/projects/${projectId}/test-accounts/mcp-link`, { role });
|
|
172
|
+
async createTestAccountLink(projectId, role, addToPool) {
|
|
173
|
+
return this.request("POST", `/api/projects/${projectId}/test-accounts/mcp-link`, { role, ...addToPool ? { addToPool: true } : {} });
|
|
174
174
|
}
|
|
175
175
|
// --- Features ---
|
|
176
176
|
async listFeatures(projectId) {
|
|
@@ -310,6 +310,10 @@ var AuraCheckApi = class {
|
|
|
310
310
|
async getReleaseVerdict(runId) {
|
|
311
311
|
return this.request("GET", `/api/runs/${runId}/release-verdict`);
|
|
312
312
|
}
|
|
313
|
+
/** MEMORY-VISIBLE: what AuraCheck remembered (lessons, project facts) and used in the run. */
|
|
314
|
+
async getRunMemory(runId) {
|
|
315
|
+
return this.request("GET", `/api/runs/${runId}/memory`);
|
|
316
|
+
}
|
|
313
317
|
async executeRun(runId) {
|
|
314
318
|
return this.request("POST", `/api/runs/${runId}/execute`, {});
|
|
315
319
|
}
|
|
@@ -1203,6 +1207,9 @@ var accountStatus = defineTool({
|
|
|
1203
1207
|
} else if (sub?.readOnly) {
|
|
1204
1208
|
lines.push(account.adminContact ? `Your company's AuraCheck plan has ended, so new runs are paused. Please ask your admin ${account.adminContact.name ?? account.adminContact.email} (${account.adminContact.email}) to renew. Existing results are still available.` : `Your AuraCheck plan has ended, so new runs are paused. Existing results are still available. Renew here: ${ctx.renewalUrl}`);
|
|
1205
1209
|
}
|
|
1210
|
+
if (account.aiRunQuotaMessage) {
|
|
1211
|
+
lines.push(account.aiRunQuotaMessage);
|
|
1212
|
+
}
|
|
1206
1213
|
return {
|
|
1207
1214
|
user: account.user,
|
|
1208
1215
|
company: account.company,
|
|
@@ -1329,12 +1336,13 @@ var setProject = defineTool({
|
|
|
1329
1336
|
var createProjectFromUrl = defineTool({
|
|
1330
1337
|
name: "create_project_from_url",
|
|
1331
1338
|
title: "Create project from URL",
|
|
1332
|
-
description: `"Start testing my website": create a new AuraCheck project with the given URL as its web environment. Needs the manageProjectSetup permission. Optionally pass defaultAuthoringMethod when you already know the answer (e.g. the user already said "Gherkin" earlier in this conversation) \u2014 otherwise the response carries an ask-once instruction for create_testcase/design_test_suite/import_feature_file's authoring method (steps vs Gherkin).`,
|
|
1339
|
+
description: `"Start testing my website": create a new AuraCheck project with the given URL as its web environment. Needs the manageProjectSetup permission. Optionally pass defaultAuthoringMethod when you already know the answer (e.g. the user already said "Gherkin" earlier in this conversation) \u2014 otherwise the response carries an ask-once instruction for create_testcase/design_test_suite/import_feature_file's authoring method (steps vs Gherkin). A platform admin with no company selected must pass companyId (from set_company) \u2014 omitting it fails with a clear instruction to call list_companies/set_company first.`,
|
|
1333
1340
|
input: z.object({
|
|
1334
1341
|
name: z.string().min(1),
|
|
1335
1342
|
targetUrl: z.string().url(),
|
|
1336
1343
|
description: z.string().optional(),
|
|
1337
|
-
defaultAuthoringMethod: z.enum(["steps", "gherkin"]).optional().describe("Set this project's authoring-method default at create time, skipping the ask-once prompt. Omit it to let the next authoring tool call surface the ask-once instruction instead.")
|
|
1344
|
+
defaultAuthoringMethod: z.enum(["steps", "gherkin"]).optional().describe("Set this project's authoring-method default at create time, skipping the ask-once prompt. Omit it to let the next authoring tool call surface the ask-once instruction instead."),
|
|
1345
|
+
companyId: z.string().optional().describe("Only meaningful for a platform admin acting with no company selected \u2014 the companyId from set_company. Required in that case; the server rejects project creation without it.")
|
|
1338
1346
|
}),
|
|
1339
1347
|
requires: "manageProjectSetup",
|
|
1340
1348
|
billing: "write",
|
|
@@ -1348,13 +1356,17 @@ var createProjectFromUrl = defineTool({
|
|
|
1348
1356
|
openWorldHint: true
|
|
1349
1357
|
},
|
|
1350
1358
|
handler: async (args, ctx) => {
|
|
1359
|
+
if (ctx.account.isPlatformAdmin && !ctx.account.company && !args.companyId) {
|
|
1360
|
+
throw new Error("companyId is required to create a project as a platform admin with no company selected. Call list_companies, then set_company, then retry with that companyId.");
|
|
1361
|
+
}
|
|
1351
1362
|
try {
|
|
1352
1363
|
const project = await ctx.api.createProject({
|
|
1353
1364
|
name: args.name,
|
|
1354
1365
|
targetUrl: args.targetUrl,
|
|
1355
1366
|
platforms: ["web"],
|
|
1356
1367
|
description: args.description,
|
|
1357
|
-
defaultAuthoringMethod: args.defaultAuthoringMethod
|
|
1368
|
+
defaultAuthoringMethod: args.defaultAuthoringMethod,
|
|
1369
|
+
companyId: args.companyId
|
|
1358
1370
|
});
|
|
1359
1371
|
await ctx.onSetProject?.(project.id);
|
|
1360
1372
|
return {
|
|
@@ -1456,11 +1468,12 @@ var PROJECT_ID2 = z3.string().optional().describe("AuraCheck project id (see lis
|
|
|
1456
1468
|
var requestTestAccount = defineTool({
|
|
1457
1469
|
name: "request_test_account",
|
|
1458
1470
|
title: "Request test account",
|
|
1459
|
-
description: 'Ask the person to enter real sign-in credentials for a role (e.g. "standard_user", "admin") on AuraCheck\u2019s own secure page \u2014 never in this chat. Returns a short-lived link (15 min). The credentials never pass through you: they go straight into AuraCheck\u2019s encrypted Test Accounts store, referenced in steps as {{accounts.<slug>.*}}. Call
|
|
1471
|
+
description: 'Ask the person to enter real sign-in credentials for a role (e.g. "standard_user", "admin") on AuraCheck\u2019s own secure page \u2014 never in this chat. Returns a short-lived link (15 min). The credentials never pass through you: they go straight into AuraCheck\u2019s encrypted Test Accounts store, referenced in steps as {{accounts.<slug>.*}}. Call list_test_account_roles first to check whether a matching role already exists (test_my_flow and create_testcase already do this for you). If it DOES exist and you want a login-heavy suite to spread its cases across more than one account instead of queueing them all behind one, call this with addToPool:true instead of skipping it \u2014 it mints a link that ADDS another account to that role instead of replacing it.',
|
|
1460
1472
|
input: z3.object({
|
|
1461
1473
|
projectId: PROJECT_ID2,
|
|
1462
1474
|
role: z3.string().min(1).max(80).describe('A short name for who is logging in, e.g. "standard_user", "admin", "buyer". Becomes the Test Account\u2019s name/slug.'),
|
|
1463
|
-
loginUrl: z3.string().url().optional().describe("The page this account signs into, shown to the person for context.")
|
|
1475
|
+
loginUrl: z3.string().url().optional().describe("The page this account signs into, shown to the person for context."),
|
|
1476
|
+
addToPool: z3.boolean().optional().describe("True when `role` already has credentials and you want ONE MORE account added to its pool (so a cloud run can lease a different one per case), not a fresh setup. Check with list_test_account_roles first.")
|
|
1464
1477
|
}),
|
|
1465
1478
|
requires: "manageProjectSetup",
|
|
1466
1479
|
billing: "write",
|
|
@@ -1470,16 +1483,17 @@ var requestTestAccount = defineTool({
|
|
|
1470
1483
|
destructiveHint: false,
|
|
1471
1484
|
openWorldHint: false
|
|
1472
1485
|
},
|
|
1473
|
-
handler: async ({ projectId, role, loginUrl }, ctx) => {
|
|
1486
|
+
handler: async ({ projectId, role, loginUrl, addToPool }, ctx) => {
|
|
1474
1487
|
const pid = requireProjectId(ctx, projectId);
|
|
1475
|
-
const { url, expiresAt } = await ctx.api.createTestAccountLink(pid, role);
|
|
1488
|
+
const { url, expiresAt } = await ctx.api.createTestAccountLink(pid, role, addToPool);
|
|
1476
1489
|
return {
|
|
1477
1490
|
url,
|
|
1478
1491
|
expiresAt,
|
|
1479
1492
|
role,
|
|
1480
1493
|
projectId: pid,
|
|
1481
1494
|
loginUrl: loginUrl ?? null,
|
|
1482
|
-
|
|
1495
|
+
addToPool: !!addToPool,
|
|
1496
|
+
instructions: addToPool ? `Open this link, enter ANOTHER ${role} sign-in on AuraCheck's own page (adds to the pool, doesn't replace the existing one), save it, then tell me "done": ${url}` : `Open this link, enter the ${role} sign-in on AuraCheck's own page, save it, then tell me "done": ${url}`,
|
|
1483
1497
|
note: `The person's username/password/PIN/OTP never passes through this conversation \u2014 they're entered directly on AuraCheck and stored encrypted. Once they say "done", retry with the matching {{accounts.*}} placeholder (test_my_flow / create_testcase will pick it up automatically).`
|
|
1484
1498
|
};
|
|
1485
1499
|
}
|
|
@@ -3213,6 +3227,14 @@ var PROJECT_ID10 = z12.string().optional().describe("AuraCheck project id (see l
|
|
|
3213
3227
|
function runViewUrl3(appUrl, runId, projectId) {
|
|
3214
3228
|
return projectId ? `${appUrl}/projects/${projectId}/runs/${runId}` : `${appUrl}/runs/${runId}`;
|
|
3215
3229
|
}
|
|
3230
|
+
async function runMemory(ctx, runId) {
|
|
3231
|
+
try {
|
|
3232
|
+
const r = await ctx.api.getRunMemory?.(runId);
|
|
3233
|
+
return r?.summary ?? null;
|
|
3234
|
+
} catch {
|
|
3235
|
+
return null;
|
|
3236
|
+
}
|
|
3237
|
+
}
|
|
3216
3238
|
var listRuns = defineTool({
|
|
3217
3239
|
name: "list_runs",
|
|
3218
3240
|
title: "List runs",
|
|
@@ -3370,6 +3392,7 @@ var waitForRun = defineTool({
|
|
|
3370
3392
|
}
|
|
3371
3393
|
const terminal = TERMINAL_RUN_STATUSES.has(last.status);
|
|
3372
3394
|
const attempts = await ctx.api.listRunCaseAttempts(args.runId).catch(() => ({ attempts: [] }));
|
|
3395
|
+
const memory = terminal ? await runMemory(ctx, args.runId) : null;
|
|
3373
3396
|
const summary = attempts.attempts.reduce((acc, a) => {
|
|
3374
3397
|
acc[a.status] = (acc[a.status] ?? 0) + 1;
|
|
3375
3398
|
return acc;
|
|
@@ -3385,6 +3408,7 @@ var waitForRun = defineTool({
|
|
|
3385
3408
|
viewUrl: runViewUrl3(ctx.appUrl, args.runId, last.projectId),
|
|
3386
3409
|
completedAt: last.completedAt ?? null,
|
|
3387
3410
|
caseStatusSummary: summary,
|
|
3411
|
+
...memory ? { memory } : {},
|
|
3388
3412
|
...pendingMobile ? {
|
|
3389
3413
|
message: "Not started yet: Android/iOS runs are started by a person in the AuraCheck desktop app on their own device."
|
|
3390
3414
|
} : {},
|
|
@@ -3466,7 +3490,7 @@ var waitForRuns = defineTool({
|
|
|
3466
3490
|
var getRun = defineTool({
|
|
3467
3491
|
name: "get_run",
|
|
3468
3492
|
title: "Get run",
|
|
3469
|
-
description:
|
|
3493
|
+
description: 'Fetch a single run by id including current status, started/completed timestamps, reportUrl when available, the run diff vs the previous comparable run (newlyFailing/fixed/stillFailing/newCases), and the release verdict (Ready based on tested coverage / Needs review / Blocked, with reasons and coverage). Also `memory`: what AuraCheck remembered and used in this run (project facts, lessons from past failures); when `memory.count > 0`, tell the person in one line, e.g. "AuraCheck ingat: <text>".',
|
|
3470
3494
|
input: z12.object({ runId: z12.string().min(1) }),
|
|
3471
3495
|
requires: "viewProject",
|
|
3472
3496
|
billing: "read",
|
|
@@ -3477,12 +3501,13 @@ var getRun = defineTool({
|
|
|
3477
3501
|
openWorldHint: false
|
|
3478
3502
|
},
|
|
3479
3503
|
handler: async ({ runId }, ctx) => {
|
|
3480
|
-
const [run, diff, releaseVerdict] = await Promise.all([
|
|
3504
|
+
const [run, diff, releaseVerdict, memory] = await Promise.all([
|
|
3481
3505
|
ctx.api.getRun(runId),
|
|
3482
3506
|
ctx.api.getRunDiff(runId).catch(() => null),
|
|
3483
|
-
ctx.api.getReleaseVerdict(runId).catch(() => null)
|
|
3507
|
+
ctx.api.getReleaseVerdict(runId).catch(() => null),
|
|
3508
|
+
runMemory(ctx, runId)
|
|
3484
3509
|
]);
|
|
3485
|
-
return { ...run, diff, releaseVerdict };
|
|
3510
|
+
return { ...run, diff, releaseVerdict, memory };
|
|
3486
3511
|
}
|
|
3487
3512
|
});
|
|
3488
3513
|
var runSummary = defineTool({
|
|
@@ -3490,7 +3515,7 @@ var runSummary = defineTool({
|
|
|
3490
3515
|
// Existing local CLI name, kept so `auracheck.get_run_report` doesn't break.
|
|
3491
3516
|
localAlias: "get_run_report",
|
|
3492
3517
|
title: "Run summary",
|
|
3493
|
-
description:
|
|
3518
|
+
description: 'Results of a run as the Run Report groups them: case counts (passed/failed/skipped/pending) plus buckets \u2014 potential bugs (with bug report, severity), script issues, blocked cases and passed cases. Also includes the run diff vs the previous comparable run and the release verdict (Ready based on tested coverage / Needs review / Blocked, with reasons, coverage and evidence links). Also `memory`: what AuraCheck remembered and used in this run (project facts, lessons from past failures); when `memory.count > 0`, tell the person in one line, e.g. "AuraCheck ingat: <text>". Read-only.',
|
|
3494
3519
|
input: z12.object({ runId: z12.string().min(1) }),
|
|
3495
3520
|
requires: "viewReports",
|
|
3496
3521
|
billing: "read",
|
|
@@ -3501,12 +3526,13 @@ var runSummary = defineTool({
|
|
|
3501
3526
|
openWorldHint: false
|
|
3502
3527
|
},
|
|
3503
3528
|
handler: async ({ runId }, ctx) => {
|
|
3504
|
-
const [run, counts, buckets, diff, releaseVerdict] = await Promise.all([
|
|
3529
|
+
const [run, counts, buckets, diff, releaseVerdict, memory] = await Promise.all([
|
|
3505
3530
|
ctx.api.getRun(runId),
|
|
3506
3531
|
ctx.api.getRunCaseStatusCounts(runId),
|
|
3507
3532
|
ctx.api.getRunReportBuckets(runId),
|
|
3508
3533
|
ctx.api.getRunDiff(runId).catch(() => null),
|
|
3509
|
-
ctx.api.getReleaseVerdict(runId).catch(() => null)
|
|
3534
|
+
ctx.api.getReleaseVerdict(runId).catch(() => null),
|
|
3535
|
+
runMemory(ctx, runId)
|
|
3510
3536
|
]);
|
|
3511
3537
|
return {
|
|
3512
3538
|
run: {
|
|
@@ -3518,7 +3544,8 @@ var runSummary = defineTool({
|
|
|
3518
3544
|
counts,
|
|
3519
3545
|
...buckets,
|
|
3520
3546
|
diff,
|
|
3521
|
-
releaseVerdict
|
|
3547
|
+
releaseVerdict,
|
|
3548
|
+
memory
|
|
3522
3549
|
};
|
|
3523
3550
|
}
|
|
3524
3551
|
});
|
|
@@ -5283,7 +5310,7 @@ var SourceReader = class {
|
|
|
5283
5310
|
};
|
|
5284
5311
|
|
|
5285
5312
|
// src/mcp/server.ts
|
|
5286
|
-
var CLI_VERSION = "0.2.
|
|
5313
|
+
var CLI_VERSION = "0.2.10";
|
|
5287
5314
|
var LOCAL_ALL_CAPABILITIES = [
|
|
5288
5315
|
"viewProject",
|
|
5289
5316
|
"viewReports",
|
|
@@ -5509,10 +5536,13 @@ function logErr(msg) {
|
|
|
5509
5536
|
process.stderr.write(`[auracheck-mcp] ${msg}
|
|
5510
5537
|
`);
|
|
5511
5538
|
}
|
|
5539
|
+
function signUpSentence(baseUrl) {
|
|
5540
|
+
return `No account yet? Start free at ${baseUrl}/sign-up?utm_source=cli`;
|
|
5541
|
+
}
|
|
5512
5542
|
var NotSignedInError = class extends Error {
|
|
5513
5543
|
constructor(baseUrl) {
|
|
5514
5544
|
super(
|
|
5515
|
-
`Not signed in to AuraCheck (${baseUrl}). Call auracheck.login (or run \`auracheck login\` in a terminal) \u2014 the MCP server picks up the new sign-in on the next call, no restart needed
|
|
5545
|
+
`Not signed in to AuraCheck (${baseUrl}). Call auracheck.login (or run \`auracheck login\` in a terminal) \u2014 the MCP server picks up the new sign-in on the next call, no restart needed. ${signUpSentence(baseUrl)}`
|
|
5516
5546
|
);
|
|
5517
5547
|
}
|
|
5518
5548
|
};
|