@flowriki/agent 0.1.0-beta.63 → 0.1.0-beta.64

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.
@@ -68,7 +68,7 @@ import {
68
68
  textIndependent,
69
69
  validateActors,
70
70
  webCloudOf
71
- } from "./chunk-IFUODU4W.js";
71
+ } from "./chunk-RI63WNGU.js";
72
72
 
73
73
  // src/engine/machine.ts
74
74
  import fs from "fs";
@@ -76,7 +76,7 @@ import os from "os";
76
76
  import path from "path";
77
77
  import { createRequire } from "module";
78
78
  import { spawnSync } from "child_process";
79
- var AGENT_VERSION = "0.1.0-beta.63";
79
+ var AGENT_VERSION = "0.1.0-beta.64";
80
80
  async function prepareBrowsers() {
81
81
  if (browsersReady()) {
82
82
  return { ok: true, already: true, message: "chromium is already installed" };
@@ -136,7 +136,7 @@ async function checkMachine() {
136
136
  }
137
137
  } catch {
138
138
  }
139
- const { mobileDoctor: mobileDoctor2 } = await import("./dist-Z67YCHL5.js");
139
+ const { mobileDoctor: mobileDoctor2 } = await import("./dist-FNAQZJYU.js");
140
140
  return {
141
141
  agentVersion: AGENT_VERSION,
142
142
  node: process.versions.node,
@@ -659,6 +659,7 @@ import { z as z10 } from "zod";
659
659
  import { z as z11 } from "zod";
660
660
  import { z as z12 } from "zod";
661
661
  import { z as z13 } from "zod";
662
+ import { z as z14 } from "zod";
662
663
  var EngineSchema = z3.enum(["chromium", "firefox", "webkit", "android", "ios"]);
663
664
  var CapabilitySchema = z3.object({
664
665
  id: z3.string(),
@@ -867,6 +868,10 @@ var TestCaseSchema = z32.object({
867
868
  createdAt: z32.string(),
868
869
  createdBy: z32.string().default(""),
869
870
  updatedAt: z32.string(),
871
+ /** WHO LAST CHANGED IT — a person's id, or "Claude" for the assistant — so
872
+ * a change the assistant made can be told from one a person made. Absent
873
+ * on cases saved before this was kept. Never sent to a machine. */
874
+ updatedBy: z32.string().max(200).optional(),
870
875
  /** The same optimistic-concurrency counter a flow carries, so an edit made
871
876
  * against a stale copy is refused rather than overwriting. */
872
877
  revision: z32.number().int().nonnegative().default(0)
@@ -1768,6 +1773,8 @@ var CaseUpdateRequestSchema = z9.object({
1768
1773
  instruction: z9.string().min(1).max(4e3),
1769
1774
  cases: z9.array(z9.object({
1770
1775
  id: z9.string().min(1),
1776
+ /** Its id as people say it — TC-12. */
1777
+ key: z9.string().max(20).optional(),
1771
1778
  name: z9.string(),
1772
1779
  feature: z9.string(),
1773
1780
  businessSteps: z9.array(BusinessStepSchema)
@@ -1866,6 +1873,15 @@ var WhatToDoSchema = z13.object({
1866
1873
  skipped: z13.array(z13.string().min(1).max(80)).max(100),
1867
1874
  updatedAt: z13.string()
1868
1875
  }).strict();
1876
+ var CaseRegistrySchema = z14.object({
1877
+ id: z14.string().regex(/^creg_/),
1878
+ projectId: z14.string().min(1),
1879
+ next: z14.object({ case: z14.number().int().positive(), feature: z14.number().int().positive() }).strict(),
1880
+ cases: z14.record(z14.string(), z14.number().int().positive()),
1881
+ features: z14.record(z14.string(), z14.number().int().positive()),
1882
+ reviews: z14.record(z14.string(), z14.object({ hash: z14.string(), by: z14.string().max(200), at: z14.string() }).strict()),
1883
+ updatedAt: z14.string()
1884
+ }).strict();
1869
1885
 
1870
1886
  // ../engine-appium/dist/index.js
1871
1887
  import path5 from "path";
package/dist/cli.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  runtimeValue,
25
25
  start,
26
26
  status
27
- } from "./chunk-QIZZ4HZ7.js";
27
+ } from "./chunk-2MTLWAXK.js";
28
28
  import {
29
29
  CLOUD_PROVIDERS,
30
30
  CLOUD_PROVIDER_NAME,
@@ -52,7 +52,7 @@ import {
52
52
  slugify,
53
53
  stepRefusedOn,
54
54
  targetFor
55
- } from "./chunk-IFUODU4W.js";
55
+ } from "./chunk-RI63WNGU.js";
56
56
 
57
57
  // src/cli.ts
58
58
  import { parseArgs } from "util";
@@ -308,8 +308,8 @@ var ServiceClient = class {
308
308
  );
309
309
  }
310
310
  readCases(projectId, refs) {
311
- const ids = refs.filter((r) => /^tc_/.test(r.trim()));
312
- const names = refs.filter((r) => !/^tc_/.test(r.trim()));
311
+ const ids = refs.filter((r) => /^(tc_|tc-?\d+$|#\d+$)/i.test(r.trim()));
312
+ const names = refs.filter((r) => !/^(tc_|tc-?\d+$|#\d+$)/i.test(r.trim()));
313
313
  const q = new URLSearchParams({ projectId, ...ids.length ? { ids: ids.join(",") } : {}, ...names.length ? { names: names.join("|") } : {} });
314
314
  return this.call(`/api/agent/cases/read?${q}`);
315
315
  }
@@ -1562,6 +1562,10 @@ THE MODEL \u2014 get this right before recording anything:
1562
1562
  Only use credentials the person gave you, that the app itself shows for
1563
1563
  testing (a demo login), or of a test user you signed up yourself \u2014 never
1564
1564
  guess or reuse anyone's real password.
1565
+ - IDS: every test case has an id people use \u2014 TC-12 \u2014 and every feature one \u2014
1566
+ F-3. When the person names one, it is that one: read_test_cases takes ids,
1567
+ and save_case's case fills or redoes exactly that test case. Say the id
1568
+ whenever you name a case back.
1565
1569
  - FOLDERS do not nest. Name each one after the product area and what is in it,
1566
1570
  the way a tester would look for it \u2014 "Account \u2013 Sign up", "Account \u2013 Sign in",
1567
1571
  "Ordering \u2013 Pizza builder", "Checkout \u2013 Payment". Flows (features) and the
@@ -1701,6 +1705,7 @@ var CASE_INPUT = {
1701
1705
  }
1702
1706
  },
1703
1707
  platform: { type: "string", enum: ["web", "android", "ios"], description: "The platform this case is for, when the project tests several: its rows are that platform's flows. Its label \u2014 not words in its name." },
1708
+ case: { type: "string", description: "The test case to fill or redo, by its id \u2014 TC-12 \u2014 wherever it is: automating or re-automating a case you were asked about by id. Default: the case of this name in this folder." },
1704
1709
  branch: { type: "string", description: "Optional: save onto this branch (chg_\u2026) instead of the working one." },
1705
1710
  projectId: { type: "string" }
1706
1711
  },
@@ -1714,7 +1719,8 @@ var caseSpec = (args) => ({
1714
1719
  rows: Array.isArray(args["rows"]) ? args["rows"] : [],
1715
1720
  ...Array.isArray(args["businessSteps"]) ? { businessSteps: args["businessSteps"] } : {},
1716
1721
  ...args["branch"] ? { changeId: String(args["branch"]) } : {},
1717
- ...args["platform"] === "web" || args["platform"] === "android" || args["platform"] === "ios" ? { platform: args["platform"] } : {}
1722
+ ...args["platform"] === "web" || args["platform"] === "android" || args["platform"] === "ios" ? { platform: args["platform"] } : {},
1723
+ ...typeof args["case"] === "string" && args["case"].trim() ? { case: args["case"].trim() } : {}
1718
1724
  });
1719
1725
  var text = (value, isError = false) => ({ content: [{ type: "text", text: value }], ...isError ? { isError } : {} });
1720
1726
  var str = (value) => typeof value === "string" ? value : value === void 0 || value === null ? void 0 : String(value);
@@ -1847,12 +1853,12 @@ On Claude's working branch "${c.draft.title}" (${c.draft.changeId}), not yet pub
1847
1853
  ...c.draft.features.length ? [` New features: ${c.draft.features.map((f) => `${f.name} (id ${f.id})`).join(", ")}`] : [],
1848
1854
  ...c.draft.flows.length ? c.draft.flows.map((f) => ` - flow: ${f.name} (${f.steps} steps, feature ${f.featureId}${f.after?.length ? `, after ${f.after.map((a) => `"${a}"`).join(", ")}` : ""})`) : [" (no flows yet)"],
1849
1855
  ...c.draft.caseFolders?.length ? [` New case folders: ${c.draft.caseFolders.map((f) => f.name).join(", ")}`] : [],
1850
- ...(c.draft.cases ?? []).map((t) => ` - case: ${t.name} (folder ${t.folderId}) \u2014 rows: ${t.rows.join(" \u2192 ")}`)
1856
+ ...(c.draft.cases ?? []).map((t) => ` - case: ${t.key ? `${t.key} ` : ""}${t.name} (folder ${t.folderId}) \u2014 rows: ${t.rows.join(" \u2192 ")}`)
1851
1857
  ] : [],
1852
1858
  `
1853
1859
  Test cases:${(c.cases ?? []).length ? "" : " none published"}`,
1854
- ...(c.caseFolders ?? []).map((f) => ` - ${f.name} (id ${f.id})
1855
- ${(c.cases ?? []).filter((t) => t.folderId === f.id).map((t) => ` - ${t.name} \u2014 rows: ${t.rows.join(" \u2192 ")}`).join("\n")}`),
1860
+ ...(c.caseFolders ?? []).map((f) => ` - ${f.key ? `${f.key} ` : ""}${f.name} (id ${f.id})
1861
+ ${(c.cases ?? []).filter((t) => t.folderId === f.id).map((t) => ` - ${t.key ? `${t.key} ` : ""}${t.name} \u2014 ${t.rows.length ? `rows: ${t.rows.join(" \u2192 ")}` : "not automated yet"}`).join("\n")}`),
1856
1862
  `
1857
1863
  Sign-in profiles:${c.signIns.length ? "" : " none"}`,
1858
1864
  ...c.signIns.map((s) => ` - ${s.name} (profileId ${s.profileId})${s.fields?.length ? ` \u2014 fields ${s.fields.map((f) => `"${f}"`).join(", ")}` : ""}: ${s.accounts.map((a) => `${a.name} (accountId ${a.accountId})`).join(", ") || "no accounts yet"}`),
@@ -2278,7 +2284,7 @@ The change document "${doc.name}" \u2014 part ${part} of ${parts}${part < parts
2278
2284
  ${doc.text.slice((part - 1) * PART, part * PART)}
2279
2285
  \u2014 end of part ${part} \u2014`] : [],
2280
2286
  ...r.cases.map((c) => [`
2281
- ${c.feature} \u203A ${c.name} (${c.id})`, ...c.businessSteps.length ? c.businessSteps.map((s) => ` ${s.keyword} ${s.text}`) : [" (no steps written)"]].join("\n"))
2287
+ ${c.key ? `${c.key} ` : ""}${c.feature} \u203A ${c.name} (${c.id})`, ...c.businessSteps.length ? c.businessSteps.map((s) => ` ${s.keyword} ${s.text}`) : [" (no steps written)"]].join("\n"))
2282
2288
  ].join("\n"));
2283
2289
  }
2284
2290
  },
@@ -2316,10 +2322,10 @@ ${c.feature} \u203A ${c.name} (${c.id})`, ...c.businessSteps.length ? c.business
2316
2322
  {
2317
2323
  name: "read_test_cases",
2318
2324
  title: "Read test cases",
2319
- description: "Read test cases by id (tc_\u2026) or exact name: their feature, business steps (Given / When / Then), whether they are automated, and the flows they run. Read a case's steps before automating it.",
2325
+ description: "Read test cases by id \u2014 TC-12 as people say it, or tc_\u2026 \u2014 or exact name: their feature, business steps (Given / When / Then), whether they are automated, and the flows they run. Read a case's steps before automating it.",
2320
2326
  inputSchema: {
2321
2327
  type: "object",
2322
- properties: { projectId: { type: "string" }, cases: { type: "array", items: { type: "string" }, description: "Ids or names." } },
2328
+ properties: { projectId: { type: "string" }, cases: { type: "array", items: { type: "string" }, description: "Ids (TC-12) or names." } },
2323
2329
  required: ["cases"],
2324
2330
  additionalProperties: false
2325
2331
  },
@@ -2329,7 +2335,7 @@ ${c.feature} \u203A ${c.name} (${c.id})`, ...c.businessSteps.length ? c.business
2329
2335
  const refs = Array.isArray(args["cases"]) ? args["cases"].map(String) : [];
2330
2336
  const { cases, missing } = await service.readCases(projectId, refs);
2331
2337
  const parts = cases.map((c) => [
2332
- `${c.folder} \u203A ${c.name} (${c.id}) \u2014 ${c.automated ? `automated, rows: ${c.rows.join(" \u2192 ")}` : "not automated yet"}`,
2338
+ `${c.key ? `${c.key} ` : ""}${c.folder} \u203A ${c.name} (${c.id}) \u2014 ${c.automated ? `automated, rows: ${c.rows.join(" \u2192 ")}` : "not automated yet"}`,
2333
2339
  ...c.description ? [` ${c.description}`] : [],
2334
2340
  ...c.businessSteps.length ? c.businessSteps.map((s) => ` ${s.keyword} ${s.text}`) : [" (no business steps written)"]
2335
2341
  ].join("\n"));
@@ -2390,7 +2396,7 @@ ${c.feature} \u203A ${c.name} (${c.id})`, ...c.businessSteps.length ? c.business
2390
2396
  const done = await service.writeCases(projectId, groups, str(args["branch"]));
2391
2397
  catalogs.delete(projectId);
2392
2398
  const skipped = done.skipped.length ? ` Skipped ${done.skipped.length} the folder already had: ${done.skipped.map((s) => `"${s.name}"`).join(", ")}.` : "";
2393
- return text(`Wrote ${done.created.length} test case${done.created.length === 1 ? "" : "s"}, not automated yet, on Claude's working branch ${done.branch}.${skipped}`);
2399
+ return text(`Wrote ${done.created.length} test case${done.created.length === 1 ? "" : "s"}, not automated yet, on Claude's working branch ${done.branch}${done.created.some((c) => c.key) ? `: ${done.created.map((c) => `${c.key ?? ""} ${c.name}`.trim()).join(", ")}` : ""}.${skipped}`);
2394
2400
  }
2395
2401
  },
2396
2402
  {
@@ -46,7 +46,7 @@ import {
46
46
  textOf,
47
47
  toolEnv,
48
48
  typesSecrets
49
- } from "./chunk-IFUODU4W.js";
49
+ } from "./chunk-RI63WNGU.js";
50
50
  export {
51
51
  AGENT_HOME,
52
52
  APPIUM_DIR,
package/dist/engine.js CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  resolveCheckouts,
10
10
  start,
11
11
  status
12
- } from "./chunk-QIZZ4HZ7.js";
13
- import "./chunk-IFUODU4W.js";
12
+ } from "./chunk-2MTLWAXK.js";
13
+ import "./chunk-RI63WNGU.js";
14
14
  export {
15
15
  AGENT_VERSION,
16
16
  browsersReady,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowriki/agent",
3
- "version": "0.1.0-beta.63",
3
+ "version": "0.1.0-beta.64",
4
4
  "description": "Run Flowriki UI tests on your own computer. Connects this machine to your Flowriki account.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",