@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.
package/dist/bin.js CHANGED
@@ -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 {
@@ -3223,6 +3235,14 @@ var PROJECT_ID10 = z12.string().optional().describe("AuraCheck project id (see l
3223
3235
  function runViewUrl3(appUrl, runId, projectId) {
3224
3236
  return projectId ? `${appUrl}/projects/${projectId}/runs/${runId}` : `${appUrl}/runs/${runId}`;
3225
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
+ }
3226
3246
  var listRuns = defineTool({
3227
3247
  name: "list_runs",
3228
3248
  title: "List runs",
@@ -3380,6 +3400,7 @@ var waitForRun = defineTool({
3380
3400
  }
3381
3401
  const terminal = TERMINAL_RUN_STATUSES.has(last.status);
3382
3402
  const attempts = await ctx.api.listRunCaseAttempts(args.runId).catch(() => ({ attempts: [] }));
3403
+ const memory = terminal ? await runMemory(ctx, args.runId) : null;
3383
3404
  const summary = attempts.attempts.reduce((acc, a) => {
3384
3405
  acc[a.status] = (acc[a.status] ?? 0) + 1;
3385
3406
  return acc;
@@ -3395,6 +3416,7 @@ var waitForRun = defineTool({
3395
3416
  viewUrl: runViewUrl3(ctx.appUrl, args.runId, last.projectId),
3396
3417
  completedAt: last.completedAt ?? null,
3397
3418
  caseStatusSummary: summary,
3419
+ ...memory ? { memory } : {},
3398
3420
  ...pendingMobile ? {
3399
3421
  message: "Not started yet: Android/iOS runs are started by a person in the AuraCheck desktop app on their own device."
3400
3422
  } : {},
@@ -3476,7 +3498,7 @@ var waitForRuns = defineTool({
3476
3498
  var getRun = defineTool({
3477
3499
  name: "get_run",
3478
3500
  title: "Get run",
3479
- 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>".',
3480
3502
  input: z12.object({ runId: z12.string().min(1) }),
3481
3503
  requires: "viewProject",
3482
3504
  billing: "read",
@@ -3487,12 +3509,13 @@ var getRun = defineTool({
3487
3509
  openWorldHint: false
3488
3510
  },
3489
3511
  handler: async ({ runId }, ctx) => {
3490
- const [run, diff, releaseVerdict] = await Promise.all([
3512
+ const [run, diff, releaseVerdict, memory] = await Promise.all([
3491
3513
  ctx.api.getRun(runId),
3492
3514
  ctx.api.getRunDiff(runId).catch(() => null),
3493
- ctx.api.getReleaseVerdict(runId).catch(() => null)
3515
+ ctx.api.getReleaseVerdict(runId).catch(() => null),
3516
+ runMemory(ctx, runId)
3494
3517
  ]);
3495
- return { ...run, diff, releaseVerdict };
3518
+ return { ...run, diff, releaseVerdict, memory };
3496
3519
  }
3497
3520
  });
3498
3521
  var runSummary = defineTool({
@@ -3500,7 +3523,7 @@ var runSummary = defineTool({
3500
3523
  // Existing local CLI name, kept so `auracheck.get_run_report` doesn't break.
3501
3524
  localAlias: "get_run_report",
3502
3525
  title: "Run summary",
3503
- 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.',
3504
3527
  input: z12.object({ runId: z12.string().min(1) }),
3505
3528
  requires: "viewReports",
3506
3529
  billing: "read",
@@ -3511,12 +3534,13 @@ var runSummary = defineTool({
3511
3534
  openWorldHint: false
3512
3535
  },
3513
3536
  handler: async ({ runId }, ctx) => {
3514
- const [run, counts, buckets, diff, releaseVerdict] = await Promise.all([
3537
+ const [run, counts, buckets, diff, releaseVerdict, memory] = await Promise.all([
3515
3538
  ctx.api.getRun(runId),
3516
3539
  ctx.api.getRunCaseStatusCounts(runId),
3517
3540
  ctx.api.getRunReportBuckets(runId),
3518
3541
  ctx.api.getRunDiff(runId).catch(() => null),
3519
- ctx.api.getReleaseVerdict(runId).catch(() => null)
3542
+ ctx.api.getReleaseVerdict(runId).catch(() => null),
3543
+ runMemory(ctx, runId)
3520
3544
  ]);
3521
3545
  return {
3522
3546
  run: {
@@ -3528,7 +3552,8 @@ var runSummary = defineTool({
3528
3552
  counts,
3529
3553
  ...buckets,
3530
3554
  diff,
3531
- releaseVerdict
3555
+ releaseVerdict,
3556
+ memory
3532
3557
  };
3533
3558
  }
3534
3559
  });
@@ -5414,6 +5439,12 @@ async function authStatusCommand(opts) {
5414
5439
  process.stdout.write(
5415
5440
  pc3.red(" token: \u2717 not signed in \u2014 run `auracheck login`\n")
5416
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
+ );
5417
5448
  process.exitCode = 1;
5418
5449
  return;
5419
5450
  }
@@ -6026,7 +6057,7 @@ var SourceReader = class {
6026
6057
  };
6027
6058
 
6028
6059
  // src/mcp/server.ts
6029
- var CLI_VERSION = "0.2.9";
6060
+ var CLI_VERSION = "0.2.10";
6030
6061
  var LOCAL_ALL_CAPABILITIES = [
6031
6062
  "viewProject",
6032
6063
  "viewReports",
@@ -6251,10 +6282,13 @@ function logErr(msg) {
6251
6282
  process.stderr.write(`[auracheck-mcp] ${msg}
6252
6283
  `);
6253
6284
  }
6285
+ function signUpSentence(baseUrl) {
6286
+ return `No account yet? Start free at ${baseUrl}/sign-up?utm_source=cli`;
6287
+ }
6254
6288
  var NotSignedInError = class extends Error {
6255
6289
  constructor(baseUrl) {
6256
6290
  super(
6257
- `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)}`
6258
6292
  );
6259
6293
  }
6260
6294
  };
@@ -6466,7 +6500,7 @@ async function runMcpServer(overrides = {}) {
6466
6500
  }
6467
6501
 
6468
6502
  // src/bin.ts
6469
- var version = "0.2.9";
6503
+ var version = "0.2.10";
6470
6504
  function invokedCommandName() {
6471
6505
  const argv1 = process.argv[1] ?? "";
6472
6506
  const base = path5.basename(argv1).replace(/\.(c|m)?js$/, "");