@swmansion/argent 0.35.1-next.0 → 0.35.1-next.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.
@@ -32125,6 +32125,7 @@ function buildToolsServerEnv(paths, port, baseEnv = process.env, options = {}) {
32125
32125
  env.ARGENT_IDLE_TIMEOUT_MINUTES = String(options.idleTimeoutMinutes);
32126
32126
  }
32127
32127
  env[AUTH_TOKEN_ENV] = options.token ?? "";
32128
+ env.ARGENT_SERVER_MANAGED = options.managed ?? "autospawn";
32128
32129
  if (paths.installKind) env.ARGENT_INSTALL_KIND = paths.installKind;
32129
32130
  if (paths.installProjectRoot) env.ARGENT_PROJECT_ROOT = paths.installProjectRoot;
32130
32131
  return env;
@@ -32889,7 +32890,19 @@ function getWhatsNewSeenVersion(options = {}) {
32889
32890
  return typeof value === "string" ? value : null;
32890
32891
  }
32891
32892
  function setWhatsNewSeenVersion(version2, options = {}) {
32892
- updateConfig((config2) => setAtPath(config2, WHATS_NEW_SEEN_KEY, version2), "global", options);
32893
+ let recorded = false;
32894
+ updateConfig(
32895
+ (config2) => {
32896
+ const value = getAtPath(config2, WHATS_NEW_SEEN_KEY);
32897
+ const seen = typeof value === "string" ? value : null;
32898
+ if (options.ifSeen !== void 0 && options.ifSeen !== seen) return;
32899
+ setAtPath(config2, WHATS_NEW_SEEN_KEY, version2);
32900
+ recorded = true;
32901
+ },
32902
+ "global",
32903
+ options
32904
+ );
32905
+ return recorded;
32893
32906
  }
32894
32907
 
32895
32908
  // ../configuration-core/src/secrets.ts
@@ -33089,6 +33102,15 @@ var CONFIG_SCHEMA = [
33089
33102
  // drained/reset, not just the file rewritten.
33090
33103
  manageCommand: "argent telemetry"
33091
33104
  },
33105
+ {
33106
+ key: "autoUpdate.enabled",
33107
+ description: "Automatically update the global Argent installation. Project-local installs require confirmation.",
33108
+ scopes: ["global"],
33109
+ parse: asBoolean,
33110
+ merge: "prioritize-local",
33111
+ default: true,
33112
+ example: "false"
33113
+ },
33092
33114
  {
33093
33115
  key: "lens.agent",
33094
33116
  description: "Coding-agent id remembered by `argent lens` to skip the picker.",
@@ -33436,7 +33458,10 @@ function collectFlowRequests(doc) {
33436
33458
  visit(step.steps, depth + 1);
33437
33459
  }
33438
33460
  };
33439
- if (isRecord(doc)) visit(doc.steps, 0);
33461
+ if (isRecord(doc)) {
33462
+ visit(doc.steps, 0);
33463
+ visit(doc.shutdown, 0);
33464
+ }
33440
33465
  return { runTargets: [...runTargets], snapshots: [...snapshots], toolSteps, nested };
33441
33466
  }
33442
33467
  function baselineKeyFor(canonicalPath2, flowName) {
@@ -36741,8 +36766,13 @@ async function flowRunToMcpContent(result, ctx) {
36741
36766
  });
36742
36767
  if (typeof result.warning === "string")
36743
36768
  blocks.push({ type: "text", text: `\u26A0 ${result.warning}` });
36769
+ let inShutdown = false;
36744
36770
  for (let i = 0; i < result.steps.length; i++) {
36745
36771
  const step = result.steps[i];
36772
+ if (step.shutdown === true && !inShutdown) {
36773
+ inShutdown = true;
36774
+ blocks.push({ type: "text", text: "shutdown:" });
36775
+ }
36746
36776
  const num = step.index !== void 0 ? step.index + 1 : i + 1;
36747
36777
  const glyph = step.status ? `${STATUS_GLYPH[step.status] ?? "\u2022"} ` : "";
36748
36778
  const reason = step.reason ?? step.error;
@@ -36774,6 +36804,12 @@ async function flowRunToMcpContent(result, ctx) {
36774
36804
  blocks.push({ type: "text", text: `\u2717 baseline not written: ${path18}: ${error2}` });
36775
36805
  }
36776
36806
  }
36807
+ if (result.shutdownFailed === true) {
36808
+ blocks.push({
36809
+ type: "text",
36810
+ text: "\u26A0 shutdown did not finish: a shutdown step failed, so the run may have left state behind."
36811
+ });
36812
+ }
36777
36813
  if (result.ok !== void 0) {
36778
36814
  const counted = (result.passed ?? 0) + (result.failed ?? 0) + (result.errored ?? 0) + (result.skipped ?? 0);
36779
36815
  const note = result.ok && counted === 0 ? " (no test steps)" : "";
@@ -37987,11 +38023,15 @@ function formatWhatsNewNote(version2, highlights) {
37987
38023
  ].join("\n");
37988
38024
  }
37989
38025
  function takeWhatsNewNote(current) {
37990
- const seen = getWhatsNewSeenVersion();
37991
- if (!isNewerThanSeen(current, seen)) return void 0;
37992
- setWhatsNewSeenVersion(current);
37993
- const highlights = highlightsSince(seen, current);
37994
- return highlights.length > 0 ? formatWhatsNewNote(current, highlights) : void 0;
38026
+ let seen = getWhatsNewSeenVersion();
38027
+ while (isNewerThanSeen(current, seen)) {
38028
+ if (setWhatsNewSeenVersion(current, { ifSeen: seen })) {
38029
+ const highlights = highlightsSince(seen, current);
38030
+ return highlights.length > 0 ? formatWhatsNewNote(current, highlights) : void 0;
38031
+ }
38032
+ seen = getWhatsNewSeenVersion();
38033
+ }
38034
+ return void 0;
37995
38035
  }
37996
38036
 
37997
38037
  // ../argent-mcp/src/mcp-server.ts
@@ -38017,6 +38057,8 @@ async function startMcpServer(options) {
38017
38057
  const autoScreenshotOn = autoScreenshotEnabled();
38018
38058
  const autoDescribeOn = autoDescribeEnabled();
38019
38059
  const whatsNewOn = whatsNewEnabled();
38060
+ const installedVersion = getInstalledVersion();
38061
+ const highlightsVersion = true ? "0.35.1-next.8" : installedVersion;
38020
38062
  const captureTimeoutMs = options.captureTimeoutMs ?? CAPTURE_TIMEOUT_MS;
38021
38063
  const trees = createTreeMemory();
38022
38064
  const screenshots = createScreenshotMemory();
@@ -38183,14 +38225,14 @@ ${shown.text}` }];
38183
38225
  if (!whatsNewOn || whatsNewChecked) return [];
38184
38226
  whatsNewChecked = true;
38185
38227
  try {
38186
- const note = takeWhatsNewNote(getInstalledVersion());
38228
+ const note = takeWhatsNewNote(highlightsVersion);
38187
38229
  return note ? [{ type: "text", text: note }] : [];
38188
38230
  } catch {
38189
38231
  return [];
38190
38232
  }
38191
38233
  }
38192
38234
  const server = new Server(
38193
- { name: "argent", version: getInstalledVersion() },
38235
+ { name: "argent", version: installedVersion },
38194
38236
  {
38195
38237
  capabilities: { tools: {} },
38196
38238
  instructions: SERVER_INSTRUCTIONS
@@ -95,6 +95,8 @@ export interface ArgentToolArgs {
95
95
  readOnly?: boolean;
96
96
  /** Android only: the emulator's console port, an even number from 5554 to 5584 (`emulator -port`), the range adb finds emulators in; its serial is `emulator-<port>`. Without it the emulator takes the first free port from 5554 up, as Android Studio does. The gRPC server Argent needs for screenshots and gestures goes on the port plus 3000, which must be free too. Given a port, the tool reuses only the emulator on that port and fails if another emulator holds it, or if this AVD runs there writable on a read-only boot and `force` is not set. A read-only emulator started with `-port` belongs to the calls that give that port: a call without `port` never reuses or shuts it down. Where the process list cannot be read (Windows, or a failed `ps`), Argent knows only the pinned emulators it booted itself, so a writable call without `port` can reuse, or with `force` shut down, one that someone else pinned. A writable one is still reused, or with `force` shut down, by a writable call without `port`, since the AVD runs one writable emulator at a time. `force` shuts nothing down when another emulator of the AVD would still block the boot. Ignored on other platforms. */
97
97
  port?: number;
98
+ /** Local iOS simulator only: apply accessibility preferences and leave the simulator shut down for a pool manager to boot. Requires Shutdown state. Cannot be combined with force: true. */
99
+ prepareOnly?: boolean;
98
100
  /** iOS only: boot the simulator core WITHOUT opening its GUI window (Simulator.app, or Device Hub on Xcode 27+). The device still streams via simulator-server. The `ARGENT_SIMULATOR_NO_WINDOW` env var (1/true/yes) forces this host-wide. */
99
101
  headless?: boolean;
100
102
  /** Electron: path to the Electron app to launch. Either a packaged .app bundle / executable, or a project directory whose package.json points the Electron binary at the entry script. */
@@ -255,6 +257,10 @@ export interface ArgentToolArgs {
255
257
  path: string;
256
258
  /** Time limit in milliseconds. The default is 30000 and the minimum is 100. */
257
259
  timeout?: number;
260
+ /** Environment overrides for this script. Argent uses them immediately and saves them on the step. Values can include {{secret:NAME}} or {{output:PATH}}. */
261
+ env?: {
262
+ [key: string]: string;
263
+ };
258
264
  };
259
265
  "e2e-add-step": {
260
266
  /** Name of the e2e test being recorded: the one passed to e2e-start-recording. */
@@ -285,6 +291,10 @@ export interface ArgentToolArgs {
285
291
  updateBaselines?: boolean;
286
292
  /** Set to true to confirm the execution prerequisite has been met. Required when a fragment defines an executionPrerequisite: without it, the call runs no step and returns the prerequisite text. Not a dry run: an e2e test with no prerequisite runs in full. To read a prerequisite without running, read executionPrerequisite in the YAML file. */
287
293
  prerequisiteAcknowledged?: boolean;
294
+ /** Script environment overrides for this run, including run: fragments. Names match [A-Za-z_][A-Za-z0-9_]*, except __proto__. Values can include {{secret:NAME}}. A missing secret rejects the run before any step. */
295
+ env?: {
296
+ [key: string]: string;
297
+ };
288
298
  /** @deprecated Renamed to `e2e_test_path`. */
289
299
  flow_path?: string;
290
300
  /** @deprecated Renamed to `e2e_test_file`. */
@@ -310,6 +320,16 @@ export interface ArgentToolArgs {
310
320
  /** @deprecated Renamed to `e2e_test_file`. */
311
321
  flow_file?: string;
312
322
  };
323
+ "e2e-set-env": {
324
+ /** Test name passed to e2e-start-recording. */
325
+ name: string;
326
+ /** Absolute project root passed to e2e-start-recording. */
327
+ project_root: string;
328
+ /** Variable names to update. A null value removes that name. Omitted names keep their values. Use {{secret:NAME}} for credentials. */
329
+ env: {
330
+ [key: string]: string | null;
331
+ };
332
+ };
313
333
  "e2e-start-recording": {
314
334
  /** Name for this e2e test (e.g. "settings-explore"): letters, digits, underscore and hyphen only. */
315
335
  name: string;
@@ -322,6 +342,10 @@ export interface ArgentToolArgs {
322
342
  platform?: "ios" | "android" | "chromium" | "vega" | "macos" | Array<"ios" | "android" | "chromium" | "vega" | "macos">;
323
343
  runtimeKind?: "mobile" | "tv";
324
344
  };
345
+ /** Default script environment values saved in the test's top-level env. Use {{secret:NAME}} for credentials. */
346
+ env?: {
347
+ [key: string]: string;
348
+ };
325
349
  };
326
350
  "file-panel": {
327
351
  /** Mac app id from `list-devices` (macos-app-<bundle id>). */