@auracheck-ai/cli 0.2.9 → 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.
@@ -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 {
@@ -3215,6 +3227,14 @@ var PROJECT_ID10 = z12.string().optional().describe("AuraCheck project id (see l
3215
3227
  function runViewUrl3(appUrl, runId, projectId) {
3216
3228
  return projectId ? `${appUrl}/projects/${projectId}/runs/${runId}` : `${appUrl}/runs/${runId}`;
3217
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
+ }
3218
3238
  var listRuns = defineTool({
3219
3239
  name: "list_runs",
3220
3240
  title: "List runs",
@@ -3372,6 +3392,7 @@ var waitForRun = defineTool({
3372
3392
  }
3373
3393
  const terminal = TERMINAL_RUN_STATUSES.has(last.status);
3374
3394
  const attempts = await ctx.api.listRunCaseAttempts(args.runId).catch(() => ({ attempts: [] }));
3395
+ const memory = terminal ? await runMemory(ctx, args.runId) : null;
3375
3396
  const summary = attempts.attempts.reduce((acc, a) => {
3376
3397
  acc[a.status] = (acc[a.status] ?? 0) + 1;
3377
3398
  return acc;
@@ -3387,6 +3408,7 @@ var waitForRun = defineTool({
3387
3408
  viewUrl: runViewUrl3(ctx.appUrl, args.runId, last.projectId),
3388
3409
  completedAt: last.completedAt ?? null,
3389
3410
  caseStatusSummary: summary,
3411
+ ...memory ? { memory } : {},
3390
3412
  ...pendingMobile ? {
3391
3413
  message: "Not started yet: Android/iOS runs are started by a person in the AuraCheck desktop app on their own device."
3392
3414
  } : {},
@@ -3468,7 +3490,7 @@ var waitForRuns = defineTool({
3468
3490
  var getRun = defineTool({
3469
3491
  name: "get_run",
3470
3492
  title: "Get run",
3471
- 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).",
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>".',
3472
3494
  input: z12.object({ runId: z12.string().min(1) }),
3473
3495
  requires: "viewProject",
3474
3496
  billing: "read",
@@ -3479,12 +3501,13 @@ var getRun = defineTool({
3479
3501
  openWorldHint: false
3480
3502
  },
3481
3503
  handler: async ({ runId }, ctx) => {
3482
- const [run, diff, releaseVerdict] = await Promise.all([
3504
+ const [run, diff, releaseVerdict, memory] = await Promise.all([
3483
3505
  ctx.api.getRun(runId),
3484
3506
  ctx.api.getRunDiff(runId).catch(() => null),
3485
- ctx.api.getReleaseVerdict(runId).catch(() => null)
3507
+ ctx.api.getReleaseVerdict(runId).catch(() => null),
3508
+ runMemory(ctx, runId)
3486
3509
  ]);
3487
- return { ...run, diff, releaseVerdict };
3510
+ return { ...run, diff, releaseVerdict, memory };
3488
3511
  }
3489
3512
  });
3490
3513
  var runSummary = defineTool({
@@ -3492,7 +3515,7 @@ var runSummary = defineTool({
3492
3515
  // Existing local CLI name, kept so `auracheck.get_run_report` doesn't break.
3493
3516
  localAlias: "get_run_report",
3494
3517
  title: "Run summary",
3495
- 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.",
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.',
3496
3519
  input: z12.object({ runId: z12.string().min(1) }),
3497
3520
  requires: "viewReports",
3498
3521
  billing: "read",
@@ -3503,12 +3526,13 @@ var runSummary = defineTool({
3503
3526
  openWorldHint: false
3504
3527
  },
3505
3528
  handler: async ({ runId }, ctx) => {
3506
- const [run, counts, buckets, diff, releaseVerdict] = await Promise.all([
3529
+ const [run, counts, buckets, diff, releaseVerdict, memory] = await Promise.all([
3507
3530
  ctx.api.getRun(runId),
3508
3531
  ctx.api.getRunCaseStatusCounts(runId),
3509
3532
  ctx.api.getRunReportBuckets(runId),
3510
3533
  ctx.api.getRunDiff(runId).catch(() => null),
3511
- ctx.api.getReleaseVerdict(runId).catch(() => null)
3534
+ ctx.api.getReleaseVerdict(runId).catch(() => null),
3535
+ runMemory(ctx, runId)
3512
3536
  ]);
3513
3537
  return {
3514
3538
  run: {
@@ -3520,7 +3544,8 @@ var runSummary = defineTool({
3520
3544
  counts,
3521
3545
  ...buckets,
3522
3546
  diff,
3523
- releaseVerdict
3547
+ releaseVerdict,
3548
+ memory
3524
3549
  };
3525
3550
  }
3526
3551
  });
@@ -5285,7 +5310,7 @@ var SourceReader = class {
5285
5310
  };
5286
5311
 
5287
5312
  // src/mcp/server.ts
5288
- var CLI_VERSION = "0.2.9";
5313
+ var CLI_VERSION = "0.2.10";
5289
5314
  var LOCAL_ALL_CAPABILITIES = [
5290
5315
  "viewProject",
5291
5316
  "viewReports",
@@ -5511,10 +5536,13 @@ function logErr(msg) {
5511
5536
  process.stderr.write(`[auracheck-mcp] ${msg}
5512
5537
  `);
5513
5538
  }
5539
+ function signUpSentence(baseUrl) {
5540
+ return `No account yet? Start free at ${baseUrl}/sign-up?utm_source=cli`;
5541
+ }
5514
5542
  var NotSignedInError = class extends Error {
5515
5543
  constructor(baseUrl) {
5516
5544
  super(
5517
- `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)}`
5518
5546
  );
5519
5547
  }
5520
5548
  };