@swmansion/argent 0.32.1-next.5 → 0.32.1-next.7

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/cli-cmds.mjs CHANGED
@@ -10704,6 +10704,7 @@ var FAILURE_CODES = {
10704
10704
  FLOW_NAME_INVALID: "FLOW_NAME_INVALID",
10705
10705
  FLOW_NO_ACTIVE_RECORDING: "FLOW_NO_ACTIVE_RECORDING",
10706
10706
  FLOW_FILE_INVALID: "FLOW_FILE_INVALID",
10707
+ FLOW_FILE_NEWER_VERSION: "FLOW_FILE_NEWER_VERSION",
10707
10708
  FLOW_FILE_WRITE_FAILED: "FLOW_FILE_WRITE_FAILED",
10708
10709
  FLOW_ENTRY_UNRECOGNIZED: "FLOW_ENTRY_UNRECOGNIZED",
10709
10710
  FLOW_E2E_HAS_PREREQUISITE: "FLOW_E2E_HAS_PREREQUISITE",
@@ -35811,7 +35812,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
35811
35812
  var SESSION_ID2 = randomUUID5();
35812
35813
  function readCliVersion() {
35813
35814
  if (true) {
35814
- return "0.32.1-next.5";
35815
+ return "0.32.1-next.7";
35815
35816
  }
35816
35817
  return "0.0.0";
35817
35818
  }
@@ -37742,6 +37743,8 @@ function rejectionVerdict(code) {
37742
37743
  case FAILURE_CODES.FLOW_ENTRY_UNRECOGNIZED:
37743
37744
  case FAILURE_CODES.FLOW_E2E_HAS_PREREQUISITE:
37744
37745
  return "not run (invalid e2e test)";
37746
+ case FAILURE_CODES.FLOW_FILE_NEWER_VERSION:
37747
+ return "not run (needs a newer Argent)";
37745
37748
  case FAILURE_CODES.FLOW_DEVICE_RESOLUTION:
37746
37749
  return "not run (no device resolved)";
37747
37750
  case FAILURE_CODES.FLOW_REQUIREMENTS_UNMET:
package/dist/client.js CHANGED
@@ -9277,6 +9277,7 @@ var FAILURE_CODES = {
9277
9277
  FLOW_NAME_INVALID: "FLOW_NAME_INVALID",
9278
9278
  FLOW_NO_ACTIVE_RECORDING: "FLOW_NO_ACTIVE_RECORDING",
9279
9279
  FLOW_FILE_INVALID: "FLOW_FILE_INVALID",
9280
+ FLOW_FILE_NEWER_VERSION: "FLOW_FILE_NEWER_VERSION",
9280
9281
  FLOW_FILE_WRITE_FAILED: "FLOW_FILE_WRITE_FAILED",
9281
9282
  FLOW_ENTRY_UNRECOGNIZED: "FLOW_ENTRY_UNRECOGNIZED",
9282
9283
  FLOW_E2E_HAS_PREREQUISITE: "FLOW_E2E_HAS_PREREQUISITE",
@@ -16041,6 +16041,7 @@ var FAILURE_CODES = {
16041
16041
  FLOW_NAME_INVALID: "FLOW_NAME_INVALID",
16042
16042
  FLOW_NO_ACTIVE_RECORDING: "FLOW_NO_ACTIVE_RECORDING",
16043
16043
  FLOW_FILE_INVALID: "FLOW_FILE_INVALID",
16044
+ FLOW_FILE_NEWER_VERSION: "FLOW_FILE_NEWER_VERSION",
16044
16045
  FLOW_FILE_WRITE_FAILED: "FLOW_FILE_WRITE_FAILED",
16045
16046
  FLOW_ENTRY_UNRECOGNIZED: "FLOW_ENTRY_UNRECOGNIZED",
16046
16047
  FLOW_E2E_HAS_PREREQUISITE: "FLOW_E2E_HAS_PREREQUISITE",
@@ -16936,7 +16937,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16936
16937
  var SESSION_ID = randomUUID4();
16937
16938
  function readCliVersion() {
16938
16939
  if (true) {
16939
- return "0.32.1-next.5";
16940
+ return "0.32.1-next.7";
16940
16941
  }
16941
16942
  return "0.0.0";
16942
16943
  }
@@ -25987,6 +25987,7 @@ var FAILURE_CODES = {
25987
25987
  FLOW_NAME_INVALID: "FLOW_NAME_INVALID",
25988
25988
  FLOW_NO_ACTIVE_RECORDING: "FLOW_NO_ACTIVE_RECORDING",
25989
25989
  FLOW_FILE_INVALID: "FLOW_FILE_INVALID",
25990
+ FLOW_FILE_NEWER_VERSION: "FLOW_FILE_NEWER_VERSION",
25990
25991
  FLOW_FILE_WRITE_FAILED: "FLOW_FILE_WRITE_FAILED",
25991
25992
  FLOW_ENTRY_UNRECOGNIZED: "FLOW_ENTRY_UNRECOGNIZED",
25992
25993
  FLOW_E2E_HAS_PREREQUISITE: "FLOW_E2E_HAS_PREREQUISITE",
@@ -1747,6 +1747,7 @@ var init_failure_codes = __esm({
1747
1747
  FLOW_NAME_INVALID: "FLOW_NAME_INVALID",
1748
1748
  FLOW_NO_ACTIVE_RECORDING: "FLOW_NO_ACTIVE_RECORDING",
1749
1749
  FLOW_FILE_INVALID: "FLOW_FILE_INVALID",
1750
+ FLOW_FILE_NEWER_VERSION: "FLOW_FILE_NEWER_VERSION",
1750
1751
  FLOW_FILE_WRITE_FAILED: "FLOW_FILE_WRITE_FAILED",
1751
1752
  FLOW_ENTRY_UNRECOGNIZED: "FLOW_ENTRY_UNRECOGNIZED",
1752
1753
  FLOW_E2E_HAS_PREREQUISITE: "FLOW_E2E_HAS_PREREQUISITE",
@@ -101159,7 +101160,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
101159
101160
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
101160
101161
  function readCliVersion() {
101161
101162
  if (true) {
101162
- return "0.32.1-next.5";
101163
+ return "0.32.1-next.7";
101163
101164
  }
101164
101165
  return "0.0.0";
101165
101166
  }
@@ -169350,10 +169351,10 @@ function toYamlStep(step) {
169350
169351
  }
169351
169352
  }
169352
169353
  var MAX_ENTRY_RENDER_CHARS = 200;
169353
- function badEntry(raw, detail) {
169354
+ function renderEntry(raw) {
169354
169355
  let rendered;
169355
169356
  try {
169356
- rendered = JSON.stringify(raw) ?? String(raw);
169357
+ rendered = typeof raw === "number" ? String(raw) : JSON.stringify(raw) ?? String(raw);
169357
169358
  } catch {
169358
169359
  rendered = "[cyclic entry]";
169359
169360
  }
@@ -169361,7 +169362,10 @@ function badEntry(raw, detail) {
169361
169362
  const elided = rendered.length - MAX_ENTRY_RENDER_CHARS;
169362
169363
  rendered = `${rendered.slice(0, MAX_ENTRY_RENDER_CHARS)}\u2026(+${elided} chars)`;
169363
169364
  }
169364
- throw new FailureError(`Unrecognized e2e test entry (${detail}): ${rendered}`, {
169365
+ return rendered;
169366
+ }
169367
+ function badEntry(raw, detail) {
169368
+ throw new FailureError(`Unrecognized e2e test entry (${detail}): ${renderEntry(raw)}`, {
169365
169369
  error_code: FAILURE_CODES.FLOW_ENTRY_UNRECOGNIZED,
169366
169370
  failure_stage: "flow_file_parse_step",
169367
169371
  failure_area: "tool_server",
@@ -170621,6 +170625,7 @@ function fromYamlStep(raw, blockDepth = 0) {
170621
170625
  }
170622
170626
  return badEntry(raw, "unrecognized step kind");
170623
170627
  }
170628
+ var FLOW_FILE_VERSION = 1;
170624
170629
  function requiresToYaml({ platform, runtimeKind }) {
170625
170630
  return {
170626
170631
  ...platform ? { platform: platform.length === 1 ? platform[0] : platform } : {},
@@ -170629,6 +170634,7 @@ function requiresToYaml({ platform, runtimeKind }) {
170629
170634
  }
170630
170635
  function serializeFlow(flow) {
170631
170636
  const doc = {
170637
+ version: FLOW_FILE_VERSION,
170632
170638
  ...flow.requires ? { requires: requiresToYaml(flow.requires) } : {},
170633
170639
  steps: flow.steps.map(toYamlStep)
170634
170640
  };
@@ -170669,15 +170675,38 @@ function parseFlow(content) {
170669
170675
  err instanceof Error ? { cause: err } : void 0
170670
170676
  );
170671
170677
  }
170672
- if (typeof parsed !== "object" || parsed === null || !("steps" in parsed) || !Array.isArray(parsed.steps)) {
170673
- throw new FailureError("Invalid e2e test file: expected an object with a steps array", {
170674
- error_code: FAILURE_CODES.FLOW_FILE_INVALID,
170675
- failure_stage: "flow_file_parse",
170676
- failure_area: "tool_server",
170677
- error_kind: "validation"
170678
- });
170678
+ const notAFlow = () => new FailureError("Invalid e2e test file: expected an object with a steps array", {
170679
+ error_code: FAILURE_CODES.FLOW_FILE_INVALID,
170680
+ failure_stage: "flow_file_parse",
170681
+ failure_area: "tool_server",
170682
+ error_kind: "validation"
170683
+ });
170684
+ if (typeof parsed !== "object" || parsed === null) throw notAFlow();
170685
+ const version3 = parsed.version ?? 1;
170686
+ if (typeof version3 !== "number" || !Number.isInteger(version3) || version3 < 1) {
170687
+ throw new FailureError(
170688
+ `Invalid e2e test file: version must be a positive integer, got ${renderEntry(version3)}`,
170689
+ {
170690
+ error_code: FAILURE_CODES.FLOW_FILE_INVALID,
170691
+ failure_stage: "flow_file_parse",
170692
+ failure_area: "tool_server",
170693
+ error_kind: "validation"
170694
+ }
170695
+ );
170696
+ }
170697
+ if (version3 > FLOW_FILE_VERSION) {
170698
+ throw new FailureError(
170699
+ `The e2e test file is version ${version3}, but this Argent reads up to version ${FLOW_FILE_VERSION}. Update Argent to run it.`,
170700
+ {
170701
+ error_code: FAILURE_CODES.FLOW_FILE_NEWER_VERSION,
170702
+ failure_stage: "flow_file_parse",
170703
+ failure_area: "tool_server",
170704
+ error_kind: "validation"
170705
+ }
170706
+ );
170679
170707
  }
170680
- const topKeys = ["executionPrerequisite", "requires", "steps"];
170708
+ if (!("steps" in parsed) || !Array.isArray(parsed.steps)) throw notAFlow();
170709
+ const topKeys = ["version", "executionPrerequisite", "requires", "steps"];
170681
170710
  const unknownTop = Object.keys(parsed).filter((k) => !topKeys.includes(k));
170682
170711
  if (unknownTop.length > 0) {
170683
170712
  throw new FailureError(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.32.1-next.5",
3
+ "version": "0.32.1-next.7",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator and Android Emulator control",
6
6
  "license": "Apache-2.0",
@@ -38,6 +38,8 @@ executionPrerequisite: User is signed in and viewing Settings
38
38
  steps: []
39
39
  ```
40
40
 
41
+ The recorder also writes `version: 1`, the file format version. Keep it. A file without it is version 1, and a version newer than the installed Argent reads is refused.
42
+
41
43
  E2E tests never store a device id. The runner binds the device. `launch:` restarts the process but does not clear app, account, or backend data.
42
44
 
43
45
  The one exception is a device _scope_ rather than a target: `stop-all-simulator-servers`' `devices` list **is** kept in the YAML, because without it the step means the machine-wide sweep and would tear down devices other agents are mid-session on. Replay rebinds a recorded scope only when you pass `device` explicitly: an auto-detected device would retarget the teardown at a device the test never named. So the recorded ids are what run when you replay without `device`; on another host they reap nothing and come back in `unmatched`, so re-record the cleanup test there or pass `device`. A step that recorded no scope is narrowed onto the run's device **only when the run resolved one**. A cleanup test whose only step is that teardown needs no device, so with none or several booted it resolves none, replays as the machine-wide sweep, and still reports a pass. Record the scope, or pass `device` at replay, whenever the sweep must stay confined.
@@ -195,6 +195,7 @@ e2e-finish-recording { TEST }
195
195
  After meaning-preserving conversion:
196
196
 
197
197
  ```yaml
198
+ version: 1
198
199
  steps:
199
200
  - echo: Restart Acme Notes. Expect Home
200
201
  - launch: com.acme.notes