@swmansion/argent 0.35.1-next.93 → 0.35.1-next.95

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
@@ -39147,7 +39147,7 @@ function isCi(env = process.env) {
39147
39147
  var SESSION_ID2 = randomUUID5();
39148
39148
  function readCliVersion() {
39149
39149
  if (true) {
39150
- return "0.35.1-next.91";
39150
+ return "0.35.1-next.95";
39151
39151
  }
39152
39152
  return "0.0.0";
39153
39153
  }
@@ -40438,14 +40438,15 @@ Subcommands:
40438
40438
  path and an optional warning and suite per entry,
40439
40439
  plus name, legacy and shadowedBy when no dir is
40440
40440
  given
40441
- check <test|test.yaml> [--json]
40441
+ check <test|test.yaml> [--var NAME=value ...] [--json]
40442
40442
  Check an e2e test without a device and without
40443
40443
  running a step: parse it, apply the checks \`run\`
40444
40444
  makes before the first step, and check tool names,
40445
- tool arguments and script files, also in the run:
40446
- fragments and e2e-execute tests its steps reach.
40447
- Reports every step that does not parse; a file
40448
- with such a step gets no other check.
40445
+ tool arguments, script files and var references,
40446
+ also in the run: fragments and e2e-execute tests
40447
+ its steps reach. --var sets the vars \`run\` would
40448
+ get. Reports every step that does not parse; a
40449
+ file with such a step gets no other check.
40449
40450
  Prints each problem on stderr and exits 1 when it
40450
40451
  finds one.
40451
40452
  --json prints { "ok", "e2eTests": [...] } instead,
@@ -40493,6 +40494,7 @@ Examples:
40493
40494
  argent e2e run login --var PASSWORD='{{secret:ALICE_PASSWORD}}'
40494
40495
  argent e2e run login --secrets-file /tmp/run-42.env
40495
40496
  argent e2e check checkout
40497
+ argent e2e check checkout --var API_URL=https://staging.example.com
40496
40498
  `);
40497
40499
  }
40498
40500
  var RUN_OPTIONS = {
@@ -40513,7 +40515,8 @@ var LIST_OPTIONS = {
40513
40515
  recursive: { kind: "boolean", alias: "r" }
40514
40516
  };
40515
40517
  var CHECK_OPTIONS = {
40516
- json: { kind: "boolean" }
40518
+ json: { kind: "boolean" },
40519
+ var: { kind: "value", repeatable: true }
40517
40520
  };
40518
40521
  function parseRunArgs(argv) {
40519
40522
  let parsed;
@@ -41427,6 +41430,7 @@ async function e2eCheck(argv, options) {
41427
41430
  }
41428
41431
  let ref;
41429
41432
  let json2;
41433
+ let vars;
41430
41434
  try {
41431
41435
  const parsed = parseCommandArgs(argv, CHECK_OPTIONS);
41432
41436
  if (parsed.positionals.length > 1) {
@@ -41441,8 +41445,9 @@ async function e2eCheck(argv, options) {
41441
41445
  }
41442
41446
  ref = parsed.positionals[0];
41443
41447
  json2 = parsed.options.json === true;
41448
+ if (parsed.options.var !== void 0) vars = parseVarFlags(parsed.options.var);
41444
41449
  } catch (err) {
41445
- if (!(err instanceof UsageError)) throw err;
41450
+ if (!(err instanceof UsageError) && !(err instanceof FlagParseException)) throw err;
41446
41451
  console.error(
41447
41452
  argv.some((tok) => tok === "--json" || tok.startsWith("--json=")) ? JSON.stringify(errorRecord(err.message)) : `Error: ${err.message}
41448
41453
  Run \`argent e2e --help\`.`
@@ -41488,7 +41493,8 @@ Run \`argent e2e --help\`.`
41488
41493
  try {
41489
41494
  const resp = await client2.callTool(CHECK_TOOL_ID, {
41490
41495
  e2e_test_path: target.path,
41491
- project_root: projectRoot
41496
+ project_root: projectRoot,
41497
+ ...vars !== void 0 && { vars }
41492
41498
  });
41493
41499
  const found = resp.data.problems;
41494
41500
  problems = found.map((problem) => ({ file: suppliedPath, ...problem }));
@@ -17177,7 +17177,7 @@ function isCi(env = process.env) {
17177
17177
  var SESSION_ID = randomUUID4();
17178
17178
  function readCliVersion() {
17179
17179
  if (true) {
17180
- return "0.35.1-next.91";
17180
+ return "0.35.1-next.95";
17181
17181
  }
17182
17182
  return "0.0.0";
17183
17183
  }
@@ -38588,7 +38588,7 @@ async function startMcpServer(options) {
38588
38588
  const autoDescribeOn = autoDescribeEnabled();
38589
38589
  const whatsNewOn = whatsNewEnabled();
38590
38590
  const installedVersion = getInstalledVersion();
38591
- const highlightsVersion = true ? "0.35.1-next.91" : installedVersion;
38591
+ const highlightsVersion = true ? "0.35.1-next.95" : installedVersion;
38592
38592
  const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
38593
38593
  const trees = createTreeMemory();
38594
38594
  const screenshots = createScreenshotMemory();
@@ -340,6 +340,10 @@ export interface ArgentToolArgs {
340
340
  e2e_test_file?: string;
341
341
  /** Absolute path to an e2e test .yaml on the client. */
342
342
  e2e_test_path?: string;
343
+ /** The vars the run would set, as e2e-execute takes them. */
344
+ vars?: {
345
+ [key: string]: string;
346
+ };
343
347
  };
344
348
  "e2e-execute": {
345
349
  /** Saved e2e test name in `<project_root>/.argent/e2e/` (or `.argent/flows/`). */
@@ -73425,7 +73425,7 @@ function isCi(env = process.env) {
73425
73425
  var SESSION_ID = (0, import_node_crypto4.randomUUID)();
73426
73426
  function readCliVersion() {
73427
73427
  if (true) {
73428
- return "0.35.1-next.91";
73428
+ return "0.35.1-next.95";
73429
73429
  }
73430
73430
  return "0.0.0";
73431
73431
  }
@@ -75241,6 +75241,7 @@ var import_semver2 = __toESM(require_semver2());
75241
75241
  init_command_on_path();
75242
75242
  var execFileAsync6 = (0, import_node_util6.promisify)(import_node_child_process8.execFile);
75243
75243
  var MIN_ARGENT_CLOUD_VERSION = "1.1.0";
75244
+ var ARGENT_CLOUD_INSTALL_DOCS_URL = "https://docs.swmansion.com/argent/docs/cloud/fundamentals/installation";
75244
75245
  var LEGACY_NAME = "sim-remote";
75245
75246
  var VERSION_TIMEOUT_MS = 5e3;
75246
75247
  var VERSION_TTL_MS = 6e4;
@@ -75477,7 +75478,7 @@ var INSTALL_HINTS = {
75477
75478
  "xcrun": "Xcode command-line tools not found \u2014 iOS/tvOS simulators need a macOS host with them installed. On macOS, run `xcode-select --install` (or install Xcode from the App Store) and retry.",
75478
75479
  "adb": "Android SDK Platform Tools not found. Install `platform-tools` via Android Studio \u2192 SDK Manager or `sdkmanager 'platform-tools'` (`brew install --cask android-platform-tools` on macOS). If installed, ensure `adb` is on PATH or point `$ANDROID_HOME` (or the `android.sdkRoot` config key) at the SDK root (the resolver checks `<root>/platform-tools/adb`). Only required for Android devices and emulators.",
75479
75480
  "emulator": "Android Emulator not found. Install via Android Studio \u2192 SDK Manager \u2192 Emulator, or `sdkmanager 'emulator'`. If installed, ensure `emulator` is on PATH or point `$ANDROID_HOME` (or the `android.sdkRoot` config key) at the SDK root (the resolver checks `<root>/emulator/emulator`). Only required to launch new Android emulators via `boot-device`.",
75480
- "sim-remote": "Argent Cloud CLI not found: `ARGENT_CLOUD_BIN` is unset or not executable, and no `argent-cloud` or `sim-remote` is on PATH or in `~/.local/bin`. Install it as described at https://docs.swmansion.com/argent/docs/cloud/fundamentals/installation, then run its `login` command (`sim-remote login`) before invoking any ios-remote tool. Only required for remote iOS simulators.",
75481
+ "sim-remote": `Argent Cloud CLI not found: \`ARGENT_CLOUD_BIN\` is unset or not executable, and no \`argent-cloud\` or \`sim-remote\` is on PATH or in \`~/.local/bin\`. Install it as described at ${ARGENT_CLOUD_INSTALL_DOCS_URL}, then run its \`login\` command (\`sim-remote login\`) before invoking any ios-remote tool. Only required for remote iOS simulators.`,
75481
75482
  "vega": "Vega SDK CLI not found. Install the Amazon Vega SDK and run `source ~/vega/env` so `vega` (or its `kepler` alias) is on PATH; the resolver also checks `~/vega/bin/vega`. Only required for Vega (Fire TV) devices.",
75482
75483
  "harmony-emulator": "HarmonyOS emulator manager not found. Install DevEco Studio; a macOS install at `/Applications/DevEco-Studio.app` is found automatically, and anywhere else set `$DEVECO_STUDIO_HOME` to the directory holding `tools/emulator/Emulator` (the resolver also checks that path under `Contents/`, so a macOS app bundle works too). Only required to list or launch HarmonyOS emulators.",
75483
75484
  "hdc": "`hdc`, the HarmonyOS device connector, was not found. Install DevEco Studio (it ships `hdc` under `sdk/default/openharmony/toolchains`, and a macOS install at `/Applications/DevEco-Studio.app` is found automatically), or put `hdc` from the OpenHarmony command-line tools on PATH, or set `$DEVECO_STUDIO_HOME` to the directory holding `sdk/default/openharmony/toolchains/hdc` (the resolver also checks that path under `Contents/`, so a macOS app bundle works too). Only required to drive HarmonyOS devices."
@@ -80030,11 +80031,7 @@ function resolveStepReferences(step, output2, vars) {
80030
80031
  let value = field2.value;
80031
80032
  if (holdsVarMarker(field2.value)) {
80032
80033
  const secret = field2.secretOk ? void 0 : secretVarNames(field2.value, vars)[0];
80033
- if (secret !== void 0) {
80034
- throw new VarReferenceError(
80035
- `\`${field2.where}\` takes {{var:${secret}}}, whose value is a {{secret:...}} placeholder. A secret resolves only in text a step types, a tool's arguments and a script's env; here it would be compared as literal text that is never on screen`
80036
- );
80037
- }
80034
+ if (secret !== void 0) throw new VarReferenceError(secretVarReason(field2.where, secret));
80038
80035
  value = field2.typed ? resolveVarValue(field2.value, vars) : resolveVarText(field2.value, vars);
80039
80036
  }
80040
80037
  if (typeof value === "string" && holdsOutputMarker(value)) {
@@ -80052,6 +80049,17 @@ function resolveStepReferences(step, output2, vars) {
80052
80049
  }
80053
80050
  return copy;
80054
80051
  }
80052
+ function secretVarReason(where, name) {
80053
+ return `\`${where}\` takes {{var:${name}}}, whose value is a {{secret:...}} placeholder. A secret resolves only in text a step types, a tool's arguments and a script's env; here it would be compared as literal text that is never on screen`;
80054
+ }
80055
+ function secretVarProblem(step, vars) {
80056
+ for (const field2 of outputReferenceFields(step)) {
80057
+ if (!field2.set || field2.secretOk) continue;
80058
+ const secret = secretVarNames(field2.value, vars)[0];
80059
+ if (secret !== void 0) return secretVarReason(field2.where, secret);
80060
+ }
80061
+ return void 0;
80062
+ }
80055
80063
  function stepReferenceProblem(step) {
80056
80064
  for (const field2 of outputReferenceFields(step)) {
80057
80065
  if (!holdsReferenceMarker(field2.value)) continue;
@@ -108953,7 +108961,7 @@ function cloudAndroidHeldNote(serials) {
108953
108961
  }
108954
108962
  function outdatedCloudCliNote(version3) {
108955
108963
  if (!version3 || !isArgentCloudOutdated(version3)) return null;
108956
- return `iOS: ${argentCloudCommand()} ${version3} is older than ${MIN_ARGENT_CLOUD_VERSION}, the version Argent expects. Argent Cloud simulators still work. The user can update it with \`argent cloud install\`.`;
108964
+ return `iOS: ${argentCloudCommand()} ${version3} is older than ${MIN_ARGENT_CLOUD_VERSION}, the version Argent expects. Argent Cloud simulators still work. The user can update it to the latest release: ${ARGENT_CLOUD_INSTALL_DOCS_URL}`;
108957
108965
  }
108958
108966
  var ANDROID_SDK_MISSING_NOTE = "Android: no SDK found (adb, emulator). Installing the platform tools and creating an AVD adds Android targets.";
108959
108967
  var EXTERNAL_DEVICES_HINT = `Some entries are tagged 'external: true': another application is already driving that device, and its 'provider' field names it ('provider.workspace' names the project it opened, when it published one). Drive them with the usual tools, by the 'ext:'-prefixed id. Two rules differ: prefer the external device whose 'provider.workspace.path' matches the project you are working in, and do NOT call boot-device on them, since the provider owns their lifecycle. stop-simulator-server IS safe on them and never stops the provider's server \u2014 it drops argent's cached handles, which is the recovery when calls keep failing against an endpoint the provider has since moved. stop-all-simulator-servers does the same for that server, also under the device's plain UDID / serial, and leaves it out of 'stopped', so an empty 'stopped' does not mean the provider's server is gone. Each entry's 'capabilities' lists the mechanisms that provider granted; a tool relying on one it withheld fails with a clear message naming the provider.`;
@@ -173826,6 +173834,21 @@ async function unrunnableScriptRefusal(flow, flowName) {
173826
173834
  message: `E2E test "${flowName}" was not run. ${reason2}`
173827
173835
  };
173828
173836
  }
173837
+ function unsetVarRefusal(flow, flowName, vars) {
173838
+ const problem = unsetVarProblem([...flow.steps, ...flow.shutdown ?? []], vars);
173839
+ if (!problem) return void 0;
173840
+ return {
173841
+ code: FAILURE_CODES.FLOW_FILE_INVALID,
173842
+ message: `E2E test "${flowName}" was not run. ${problem}`
173843
+ };
173844
+ }
173845
+ function fragmentUnsetVarProblem(fragment, target, vars) {
173846
+ return unsetVarProblem(
173847
+ [...fragment.steps, ...fragment.shutdown ?? []],
173848
+ vars,
173849
+ `Fragment "${escapeInline(target)}" step`
173850
+ );
173851
+ }
173829
173852
  function chromiumPinnable(app, platform) {
173830
173853
  if (typeof app === "string") return platform === "chromium";
173831
173854
  return chromiumLaunchSpec(app) !== null;
@@ -173866,15 +173889,25 @@ function toolArgsRefusal(tool, def, stepArgs) {
173866
173889
  if (issues.length === 0) return void 0;
173867
173890
  return `Invalid params for tool "${toolId}": ${describeParamIssues({ issues }, args)}`;
173868
173891
  }
173869
- async function stepProblem(walk, step, flowDir) {
173892
+ async function stepProblem(walk, step, flowDir, vars) {
173870
173893
  if (step.kind === "script") {
173871
173894
  const located = await locateScript(flowDir, step.path);
173872
173895
  return "refused" in located ? located.refused.reason : void 0;
173873
173896
  }
173874
- if (step.kind !== "tool") return void 0;
173897
+ if (step.kind !== "tool") return vars && secretVarProblem(step, scopeVars(vars));
173875
173898
  const def = walk.schemas(step.name);
173876
173899
  return def ? toolArgsRefusal(step.name, def, step.args) : `Tool "${step.name}" not found`;
173877
173900
  }
173901
+ function scopeVars(scope) {
173902
+ return mergeScriptEnv(scope.fileVars, scope.runVars);
173903
+ }
173904
+ function nestedRunVars(args) {
173905
+ const { vars } = args;
173906
+ if (vars === void 0) return {};
173907
+ if (typeof vars !== "object" || vars === null || Array.isArray(vars)) return void 0;
173908
+ if (!Object.values(vars).every((value) => typeof value === "string")) return void 0;
173909
+ return mergeScriptEnv(vars);
173910
+ }
173878
173911
  function report(walk, at, message, code) {
173879
173912
  walk.problems.push({
173880
173913
  ...at !== void 0 && { at },
@@ -173909,13 +173942,15 @@ function childFloor(floor, visit3, stack) {
173909
173942
  function isNewRefusal(floor, refusal) {
173910
173943
  return floor === void 0 || refusal.tooDeep === true || refusal.cycleAt !== void 0 && refusal.cycleAt < floor;
173911
173944
  }
173912
- async function checkTest(walk, flow, flowName, stack, edge, floor) {
173945
+ async function checkTest(walk, flow, flowName, stack, runVars, edge, floor) {
173946
+ const vars = runVars && { fileVars: mergeScriptEnv(flow.vars), runVars };
173913
173947
  if (floor !== void 0) {
173914
- return followReferences(walk, flow, stack, flowName, edge?.prefix ?? [], floor);
173948
+ return followReferences(walk, flow, stack, flowName, edge?.prefix ?? [], vars, floor);
173915
173949
  }
173916
173950
  const refusals = [
173917
173951
  retiredArgRefusal(walk.schemas, flow, flowName),
173918
173952
  await unrunnableScriptRefusal(flow, flowName),
173953
+ vars && unsetVarRefusal(flow, flowName, scopeVars(vars)),
173919
173954
  flow.executionPrerequisite ? await leadingLaunchRefusal(
173920
173955
  flow,
173921
173956
  stack,
@@ -173927,24 +173962,27 @@ async function checkTest(walk, flow, flowName, stack, edge, floor) {
173927
173962
  for (const refusal of refusals) {
173928
173963
  if (refusal) report(walk, edge?.at, refusal.message, edge ? void 0 : refusal.code);
173929
173964
  }
173930
- await followReferences(walk, flow, stack, flowName, edge?.prefix ?? [], void 0);
173965
+ await followReferences(walk, flow, stack, flowName, edge?.prefix ?? [], vars, void 0);
173931
173966
  }
173932
- async function followReferences(walk, flow, stack, rootDisplay, prefix, floor) {
173967
+ async function followReferences(walk, flow, stack, rootDisplay, prefix, vars, floor) {
173933
173968
  const flowDir = path70.dirname(stack[stack.length - 1].canonical);
173934
173969
  for (const { step, at } of walkFlow(flow, "", prefix)) {
173935
173970
  if (floor === void 0) {
173936
- const problem = await stepProblem(walk, step, flowDir);
173971
+ const problem = await stepProblem(walk, step, flowDir, vars);
173937
173972
  if (problem !== void 0) report(walk, at, problem);
173938
173973
  }
173939
173974
  if (step.kind === "run") {
173940
- await followRun(walk, step.flow, stack, rootDisplay, at, floor);
173975
+ await followRun(walk, step.flow, stack, rootDisplay, at, vars, floor);
173941
173976
  } else if (step.kind === "tool" && canonicalToolId(step.name) === "e2e-execute") {
173942
173977
  const target = nestedFlowTarget(step.args);
173943
- if (target) await followNested(walk, step.name, target, stack, at, floor);
173978
+ if (target) {
173979
+ const runVars = nestedRunVars(step.args);
173980
+ await followNested(walk, step.name, target, stack, at, runVars, floor);
173981
+ }
173944
173982
  }
173945
173983
  }
173946
173984
  }
173947
- async function followRun(walk, target, stack, rootDisplay, at, floor) {
173985
+ async function followRun(walk, target, stack, rootDisplay, at, vars, floor) {
173948
173986
  const guarded = await guardRunHop(walk.project, stack, rootDisplay, target);
173949
173987
  if ("refusal" in guarded) {
173950
173988
  if (isNewRefusal(floor, guarded)) report(walk, at, guarded.refusal);
@@ -173968,8 +174006,12 @@ async function followRun(walk, target, stack, rootDisplay, at, floor) {
173968
174006
  return;
173969
174007
  }
173970
174008
  if (fragment === void 0) return;
174009
+ const fragmentVars = vars && {
174010
+ fileVars: mergeScriptEnv(fragment.vars, vars.fileVars),
174011
+ runVars: vars.runVars
174012
+ };
173971
174013
  if (inner === void 0) {
173972
- const refusal = await fragmentLoadRefusal(walk.schemas, fragment, target);
174014
+ const refusal = await fragmentLoadRefusal(walk.schemas, fragment, target) ?? (fragmentVars && fragmentUnsetVarProblem(fragment, target, scopeVars(fragmentVars)));
173973
174015
  if (refusal !== void 0) report(walk, at, refusal);
173974
174016
  }
173975
174017
  await followReferences(
@@ -173978,10 +174020,11 @@ async function followRun(walk, target, stack, rootDisplay, at, floor) {
173978
174020
  [...stack, { canonical: hop.canonical, display }],
173979
174021
  rootDisplay,
173980
174022
  prefix,
174023
+ fragmentVars,
173981
174024
  inner
173982
174025
  );
173983
174026
  }
173984
- async function followNested(walk, toolName, target, stack, at, floor) {
174027
+ async function followNested(walk, toolName, target, stack, at, runVars, floor) {
173985
174028
  const nested = await readNestedTest(walk.project, target, toolName);
173986
174029
  if ("refusal" in nested) {
173987
174030
  if (floor === void 0) report(walk, at, nested.refusal);
@@ -174005,7 +174048,7 @@ async function followNested(walk, toolName, target, stack, at, floor) {
174005
174048
  return;
174006
174049
  }
174007
174050
  if (flow === void 0) return;
174008
- await checkTest(walk, flow, nested.flowName, [...stack, entry], { at, prefix }, inner);
174051
+ await checkTest(walk, flow, nested.flowName, [...stack, entry], runVars, { at, prefix }, inner);
174009
174052
  }
174010
174053
  async function readNestedTest(project, target, toolName) {
174011
174054
  if (project.mode === "client" && target.kind === "name") {
@@ -174064,10 +174107,10 @@ function parseForCheck(text) {
174064
174107
  return parsing;
174065
174108
  }
174066
174109
  async function checkFlow(input2) {
174067
- const { flow, flowName, canonical, schemas, project } = input2;
174110
+ const { flow, flowName, canonical, schemas, project, vars } = input2;
174068
174111
  const walk = { schemas, project, reached: /* @__PURE__ */ new Map(), problems: [] };
174069
174112
  reach(walk, "test", canonical, 1);
174070
- await checkTest(walk, flow, flowName, [{ canonical, display: flowName }]);
174113
+ await checkTest(walk, flow, flowName, [{ canonical, display: flowName }], mergeScriptEnv(vars));
174071
174114
  return walk.problems;
174072
174115
  }
174073
174116
 
@@ -177125,18 +177168,8 @@ Over a link (\`argent link\` / \`ARGENT_TOOLS_URL\`), the client uploads the tes
177125
177168
  if (unrunnableScript) throw preflightFailure(unrunnableScript);
177126
177169
  const runVars = mergeScriptEnv(params.vars);
177127
177170
  resolveScriptEnv(runVars, params.project_root, ctx?.clientSecrets);
177128
- const unsetVar = unsetVarProblem(
177129
- [...flow.steps, ...flow.shutdown ?? []],
177130
- mergeScriptEnv(flow.vars, runVars)
177131
- );
177132
- if (unsetVar) {
177133
- throw new FailureError(`E2E test "${flowName}" was not run. ${unsetVar}`, {
177134
- error_code: FAILURE_CODES.FLOW_FILE_INVALID,
177135
- failure_stage: "flow_run_validate",
177136
- failure_area: "tool_server",
177137
- error_kind: "validation"
177138
- });
177139
- }
177171
+ const unsetVar = unsetVarRefusal(flow, flowName, mergeScriptEnv(flow.vars, runVars));
177172
+ if (unsetVar) throw preflightFailure(unsetVar);
177140
177173
  const enclosing = ctx?.flowStack ?? [];
177141
177174
  const nesting = nestedRunRefusal(enclosing, rootEntry);
177142
177175
  if (nesting !== void 0) throw nestingFailure(nesting.refusal);
@@ -177508,7 +177541,7 @@ function pushReport(state3, report2) {
177508
177541
  state3.reports.push(report2);
177509
177542
  state3.onStepReport?.(report2);
177510
177543
  }
177511
- function scopeVars(state3, scope) {
177544
+ function scopeVars2(state3, scope) {
177512
177545
  return mergeScriptEnv(scope.fileVars, state3.runVars);
177513
177546
  }
177514
177547
  function scopeFlow(scope) {
@@ -177611,7 +177644,7 @@ async function execSteps(state3, steps, scope) {
177611
177644
  if (typesSecret(step)) state3.secret.typed = true;
177612
177645
  let leaf;
177613
177646
  try {
177614
- leaf = resolveStepReferences(step, state3.output.doc, scopeVars(state3, scope));
177647
+ leaf = resolveStepReferences(step, state3.output.doc, scopeVars2(state3, scope));
177615
177648
  if (typesSecret(leaf)) state3.secret.typed = true;
177616
177649
  } catch (err) {
177617
177650
  if (!(err instanceof StepReferenceError)) throw err;
@@ -177755,7 +177788,7 @@ async function execWhenStep(state3, authored, scope) {
177755
177788
  const inner = childScope(scope);
177756
177789
  let step;
177757
177790
  try {
177758
- step = resolveStepReferences(authored, state3.output.doc, scopeVars(state3, scope));
177791
+ step = resolveStepReferences(authored, state3.output.doc, scopeVars2(state3, scope));
177759
177792
  } catch (err) {
177760
177793
  if (!(err instanceof StepReferenceError)) throw err;
177761
177794
  pushReport(state3, { ...unresolved, status: "error", reason: escapeInline(err.message) });
@@ -177849,10 +177882,10 @@ async function execRunStep(state3, step, scope) {
177849
177882
  }
177850
177883
  }
177851
177884
  const fileVars = mergeScriptEnv(fragment.vars, scope.fileVars);
177852
- const unsetVar = unsetVarProblem(
177853
- [...fragment.steps, ...fragment.shutdown ?? []],
177854
- mergeScriptEnv(fileVars, state3.runVars),
177855
- `Fragment "${shown}" step`
177885
+ const unsetVar = fragmentUnsetVarProblem(
177886
+ fragment,
177887
+ target,
177888
+ mergeScriptEnv(fileVars, state3.runVars)
177856
177889
  );
177857
177890
  if (unsetVar) return fail(unsetVar);
177858
177891
  pushReport(state3, {
@@ -177883,7 +177916,7 @@ async function runScriptStep(state3, step, scope) {
177883
177916
  step,
177884
177917
  projectRoot: state3.projectRoot,
177885
177918
  device: state3.device,
177886
- vars: scopeVars(state3, scope),
177919
+ vars: scopeVars2(state3, scope),
177887
177920
  output: state3.output.doc,
177888
177921
  ...state3.ctx?.clientSecrets ? { clientSecrets: state3.ctx.clientSecrets } : {},
177889
177922
  logBudget: state3.scriptLogBudget,
@@ -178256,8 +178289,13 @@ var zodSchema79 = external_exports.object({
178256
178289
  e2e_test_file: external_exports.string().optional().describe(
178257
178290
  "Path to the e2e test .yaml as readable by the tool-server. Internal: the argent client derives it from project_root and name automatically; leave unset."
178258
178291
  ),
178259
- e2e_test_path: external_exports.string().optional().describe("Absolute path to an e2e test .yaml on the client.")
178292
+ e2e_test_path: external_exports.string().optional().describe("Absolute path to an e2e test .yaml on the client."),
178293
+ vars: external_exports.record(external_exports.string(), external_exports.string()).optional().describe("The vars the run would set, as e2e-execute takes them.")
178260
178294
  }).superRefine((params, ctx) => {
178295
+ const varsProblem = params.vars === void 0 ? void 0 : flowVarsProblem(params.vars);
178296
+ if (varsProblem) {
178297
+ ctx.addIssue({ code: external_exports.ZodIssueCode.custom, message: varsProblem, path: ["vars"] });
178298
+ }
178261
178299
  if (params.name === void 0 === (params.e2e_test_path === void 0)) {
178262
178300
  ctx.addIssue({
178263
178301
  code: external_exports.ZodIssueCode.custom,
@@ -178279,7 +178317,8 @@ function createCheckFlowTool(registry2) {
178279
178317
  description: `Check an e2e test without a device and without running a step.
178280
178318
  Returns { problems }: each problem that makes e2e-execute refuse the e2e test before its first step, and
178281
178319
  each step that fails when it runs for a reason a device does not change, in this e2e test and in the
178282
- run: fragments and nested e2e tests its steps reach. Each problem holds at?, code? and message.
178320
+ run: fragments and nested e2e tests its steps reach. Pass vars to check with the vars a run would set.
178321
+ Each problem holds at?, code? and message.
178283
178322
  at lists the steps from the e2e test to the problem, each { step, run?, e2e?, when? }.
178284
178323
  Pass exactly one e2e test source: name (under project_root) or e2e_test_path.`,
178285
178324
  zodSchema: zodSchema79,
@@ -178317,7 +178356,8 @@ Pass exactly one e2e test source: name (under project_root) or e2e_test_path.`,
178317
178356
  flowName: root.flowName,
178318
178357
  canonical,
178319
178358
  schemas: callableSchemas(registry2),
178320
- project: root.project
178359
+ project: root.project,
178360
+ vars: params.vars
178321
178361
  });
178322
178362
  return { problems };
178323
178363
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.35.1-next.93",
3
+ "version": "0.35.1-next.95",
4
4
  "mcpName": "io.github.software-mansion/argent",
5
5
  "description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
6
6
  "license": "Apache-2.0",
@@ -98,5 +98,5 @@
98
98
  "vitest": "^5.0.5",
99
99
  "yaml": "^2.9.1"
100
100
  },
101
- "gitHead": "7b99b3dcad9de16cefd21590123231633a103381"
101
+ "gitHead": "c7dc48cecc703a224b39398b011ce8c2fbc07972"
102
102
  }
@@ -13,7 +13,7 @@ For a saved QA test case, ticket, or acceptance criterion, load `argent-qa-e2e`
13
13
 
14
14
  - Before creating or changing an e2e test, read [Live authoring](references/live-authoring.md) completely.
15
15
  - When polishing, composing, or manually reviewing YAML, read [E2E YAML](references/e2e-yaml.md). For Vega, read its platform limits before recording remote or keyboard tools.
16
- - After you edit the YAML by hand, run `argent e2e check <file>`. It finds the problems that make `argent e2e run` refuse the test before the first step, without a device.
16
+ - After you edit the YAML by hand, run `argent e2e check <file>`, with the `--var` options the run gets. It finds the problems that make `argent e2e run` refuse the test before the first step, without a device.
17
17
  - E2E tests run on physical iPhones (an iOS `list-devices` entry with kind `"device"`), but replay never auto-binds one, even when no simulator is booted: pass the phone's udid as `device` (CLI `--device`), and only a `connected` phone can run. `pinch`/`rotate` steps need the app drawn in portrait. On hardware the runner tree is the `describe` tree: same ids and roles, no UIView hierarchy. See `argent-ios-device-interact` for the hardware contract.
18
18
  - On capture warnings, raw coordinates, unavailable trees, mistimed transitions, overlays, or replay failures, read [Reliability and recovery](references/reliability-and-recovery.md).
19
19