@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 CHANGED
@@ -177,8 +177,8 @@ var AuraCheckApi = class {
177
177
  const { accounts } = await this.request("GET", `/api/projects/${projectId}/test-accounts`);
178
178
  return accounts;
179
179
  }
180
- async createTestAccountLink(projectId, role) {
181
- return this.request("POST", `/api/projects/${projectId}/test-accounts/mcp-link`, { role });
180
+ async createTestAccountLink(projectId, role, addToPool) {
181
+ return this.request("POST", `/api/projects/${projectId}/test-accounts/mcp-link`, { role, ...addToPool ? { addToPool: true } : {} });
182
182
  }
183
183
  // --- Features ---
184
184
  async listFeatures(projectId) {
@@ -318,6 +318,10 @@ var AuraCheckApi = class {
318
318
  async getReleaseVerdict(runId) {
319
319
  return this.request("GET", `/api/runs/${runId}/release-verdict`);
320
320
  }
321
+ /** MEMORY-VISIBLE: what AuraCheck remembered (lessons, project facts) and used in the run. */
322
+ async getRunMemory(runId) {
323
+ return this.request("GET", `/api/runs/${runId}/memory`);
324
+ }
321
325
  async executeRun(runId) {
322
326
  return this.request("POST", `/api/runs/${runId}/execute`, {});
323
327
  }
@@ -1211,6 +1215,9 @@ var accountStatus = defineTool({
1211
1215
  } else if (sub?.readOnly) {
1212
1216
  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}`);
1213
1217
  }
1218
+ if (account.aiRunQuotaMessage) {
1219
+ lines.push(account.aiRunQuotaMessage);
1220
+ }
1214
1221
  return {
1215
1222
  user: account.user,
1216
1223
  company: account.company,
@@ -1337,12 +1344,13 @@ var setProject = defineTool({
1337
1344
  var createProjectFromUrl = defineTool({
1338
1345
  name: "create_project_from_url",
1339
1346
  title: "Create project from URL",
1340
- 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).`,
1347
+ 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.`,
1341
1348
  input: z.object({
1342
1349
  name: z.string().min(1),
1343
1350
  targetUrl: z.string().url(),
1344
1351
  description: z.string().optional(),
1345
- 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.")
1352
+ 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."),
1353
+ 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.")
1346
1354
  }),
1347
1355
  requires: "manageProjectSetup",
1348
1356
  billing: "write",
@@ -1356,13 +1364,17 @@ var createProjectFromUrl = defineTool({
1356
1364
  openWorldHint: true
1357
1365
  },
1358
1366
  handler: async (args, ctx) => {
1367
+ if (ctx.account.isPlatformAdmin && !ctx.account.company && !args.companyId) {
1368
+ 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.");
1369
+ }
1359
1370
  try {
1360
1371
  const project = await ctx.api.createProject({
1361
1372
  name: args.name,
1362
1373
  targetUrl: args.targetUrl,
1363
1374
  platforms: ["web"],
1364
1375
  description: args.description,
1365
- defaultAuthoringMethod: args.defaultAuthoringMethod
1376
+ defaultAuthoringMethod: args.defaultAuthoringMethod,
1377
+ companyId: args.companyId
1366
1378
  });
1367
1379
  await ctx.onSetProject?.(project.id);
1368
1380
  return {
@@ -1464,11 +1476,12 @@ var PROJECT_ID2 = z3.string().optional().describe("AuraCheck project id (see lis
1464
1476
  var requestTestAccount = defineTool({
1465
1477
  name: "request_test_account",
1466
1478
  title: "Request test account",
1467
- 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_testcases/this tool\u2019s own project context first to check whether a matching role already exists (test_my_flow and create_testcase already do this for you); only call this when one is missing.',
1479
+ 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.',
1468
1480
  input: z3.object({
1469
1481
  projectId: PROJECT_ID2,
1470
1482
  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.'),
1471
- loginUrl: z3.string().url().optional().describe("The page this account signs into, shown to the person for context.")
1483
+ loginUrl: z3.string().url().optional().describe("The page this account signs into, shown to the person for context."),
1484
+ 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.")
1472
1485
  }),
1473
1486
  requires: "manageProjectSetup",
1474
1487
  billing: "write",
@@ -1478,16 +1491,17 @@ var requestTestAccount = defineTool({
1478
1491
  destructiveHint: false,
1479
1492
  openWorldHint: false
1480
1493
  },
1481
- handler: async ({ projectId, role, loginUrl }, ctx) => {
1494
+ handler: async ({ projectId, role, loginUrl, addToPool }, ctx) => {
1482
1495
  const pid = requireProjectId(ctx, projectId);
1483
- const { url, expiresAt } = await ctx.api.createTestAccountLink(pid, role);
1496
+ const { url, expiresAt } = await ctx.api.createTestAccountLink(pid, role, addToPool);
1484
1497
  return {
1485
1498
  url,
1486
1499
  expiresAt,
1487
1500
  role,
1488
1501
  projectId: pid,
1489
1502
  loginUrl: loginUrl ?? null,
1490
- instructions: `Open this link, enter the ${role} sign-in on AuraCheck's own page, save it, then tell me "done": ${url}`,
1503
+ addToPool: !!addToPool,
1504
+ 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}`,
1491
1505
  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).`
1492
1506
  };
1493
1507
  }
@@ -3221,6 +3235,14 @@ var PROJECT_ID10 = z12.string().optional().describe("AuraCheck project id (see l
3221
3235
  function runViewUrl3(appUrl, runId, projectId) {
3222
3236
  return projectId ? `${appUrl}/projects/${projectId}/runs/${runId}` : `${appUrl}/runs/${runId}`;
3223
3237
  }
3238
+ async function runMemory(ctx, runId) {
3239
+ try {
3240
+ const r = await ctx.api.getRunMemory?.(runId);
3241
+ return r?.summary ?? null;
3242
+ } catch {
3243
+ return null;
3244
+ }
3245
+ }
3224
3246
  var listRuns = defineTool({
3225
3247
  name: "list_runs",
3226
3248
  title: "List runs",
@@ -3378,6 +3400,7 @@ var waitForRun = defineTool({
3378
3400
  }
3379
3401
  const terminal = TERMINAL_RUN_STATUSES.has(last.status);
3380
3402
  const attempts = await ctx.api.listRunCaseAttempts(args.runId).catch(() => ({ attempts: [] }));
3403
+ const memory = terminal ? await runMemory(ctx, args.runId) : null;
3381
3404
  const summary = attempts.attempts.reduce((acc, a) => {
3382
3405
  acc[a.status] = (acc[a.status] ?? 0) + 1;
3383
3406
  return acc;
@@ -3393,6 +3416,7 @@ var waitForRun = defineTool({
3393
3416
  viewUrl: runViewUrl3(ctx.appUrl, args.runId, last.projectId),
3394
3417
  completedAt: last.completedAt ?? null,
3395
3418
  caseStatusSummary: summary,
3419
+ ...memory ? { memory } : {},
3396
3420
  ...pendingMobile ? {
3397
3421
  message: "Not started yet: Android/iOS runs are started by a person in the AuraCheck desktop app on their own device."
3398
3422
  } : {},
@@ -3474,7 +3498,7 @@ var waitForRuns = defineTool({
3474
3498
  var getRun = defineTool({
3475
3499
  name: "get_run",
3476
3500
  title: "Get run",
3477
- 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).",
3501
+ 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>".',
3478
3502
  input: z12.object({ runId: z12.string().min(1) }),
3479
3503
  requires: "viewProject",
3480
3504
  billing: "read",
@@ -3485,12 +3509,13 @@ var getRun = defineTool({
3485
3509
  openWorldHint: false
3486
3510
  },
3487
3511
  handler: async ({ runId }, ctx) => {
3488
- const [run, diff, releaseVerdict] = await Promise.all([
3512
+ const [run, diff, releaseVerdict, memory] = await Promise.all([
3489
3513
  ctx.api.getRun(runId),
3490
3514
  ctx.api.getRunDiff(runId).catch(() => null),
3491
- ctx.api.getReleaseVerdict(runId).catch(() => null)
3515
+ ctx.api.getReleaseVerdict(runId).catch(() => null),
3516
+ runMemory(ctx, runId)
3492
3517
  ]);
3493
- return { ...run, diff, releaseVerdict };
3518
+ return { ...run, diff, releaseVerdict, memory };
3494
3519
  }
3495
3520
  });
3496
3521
  var runSummary = defineTool({
@@ -3498,7 +3523,7 @@ var runSummary = defineTool({
3498
3523
  // Existing local CLI name, kept so `auracheck.get_run_report` doesn't break.
3499
3524
  localAlias: "get_run_report",
3500
3525
  title: "Run summary",
3501
- 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). Read-only.",
3526
+ 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.',
3502
3527
  input: z12.object({ runId: z12.string().min(1) }),
3503
3528
  requires: "viewReports",
3504
3529
  billing: "read",
@@ -3509,12 +3534,13 @@ var runSummary = defineTool({
3509
3534
  openWorldHint: false
3510
3535
  },
3511
3536
  handler: async ({ runId }, ctx) => {
3512
- const [run, counts, buckets, diff, releaseVerdict] = await Promise.all([
3537
+ const [run, counts, buckets, diff, releaseVerdict, memory] = await Promise.all([
3513
3538
  ctx.api.getRun(runId),
3514
3539
  ctx.api.getRunCaseStatusCounts(runId),
3515
3540
  ctx.api.getRunReportBuckets(runId),
3516
3541
  ctx.api.getRunDiff(runId).catch(() => null),
3517
- ctx.api.getReleaseVerdict(runId).catch(() => null)
3542
+ ctx.api.getReleaseVerdict(runId).catch(() => null),
3543
+ runMemory(ctx, runId)
3518
3544
  ]);
3519
3545
  return {
3520
3546
  run: {
@@ -3526,7 +3552,8 @@ var runSummary = defineTool({
3526
3552
  counts,
3527
3553
  ...buckets,
3528
3554
  diff,
3529
- releaseVerdict
3555
+ releaseVerdict,
3556
+ memory
3530
3557
  };
3531
3558
  }
3532
3559
  });
@@ -5412,6 +5439,12 @@ async function authStatusCommand(opts) {
5412
5439
  process.stdout.write(
5413
5440
  pc3.red(" token: \u2717 not signed in \u2014 run `auracheck login`\n")
5414
5441
  );
5442
+ process.stdout.write(
5443
+ pc3.dim(
5444
+ ` No account yet? Start free at ${ctx.baseUrl}/sign-up?utm_source=cli
5445
+ `
5446
+ )
5447
+ );
5415
5448
  process.exitCode = 1;
5416
5449
  return;
5417
5450
  }
@@ -6024,7 +6057,7 @@ var SourceReader = class {
6024
6057
  };
6025
6058
 
6026
6059
  // src/mcp/server.ts
6027
- var CLI_VERSION = "0.2.8";
6060
+ var CLI_VERSION = "0.2.10";
6028
6061
  var LOCAL_ALL_CAPABILITIES = [
6029
6062
  "viewProject",
6030
6063
  "viewReports",
@@ -6249,10 +6282,13 @@ function logErr(msg) {
6249
6282
  process.stderr.write(`[auracheck-mcp] ${msg}
6250
6283
  `);
6251
6284
  }
6285
+ function signUpSentence(baseUrl) {
6286
+ return `No account yet? Start free at ${baseUrl}/sign-up?utm_source=cli`;
6287
+ }
6252
6288
  var NotSignedInError = class extends Error {
6253
6289
  constructor(baseUrl) {
6254
6290
  super(
6255
- `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.`
6291
+ `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)}`
6256
6292
  );
6257
6293
  }
6258
6294
  };
@@ -6464,7 +6500,7 @@ async function runMcpServer(overrides = {}) {
6464
6500
  }
6465
6501
 
6466
6502
  // src/bin.ts
6467
- var version = "0.2.8";
6503
+ var version = "0.2.10";
6468
6504
  function invokedCommandName() {
6469
6505
  const argv1 = process.argv[1] ?? "";
6470
6506
  const base = path5.basename(argv1).replace(/\.(c|m)?js$/, "");