@swmansion/argent 0.22.1-next.1 → 0.22.1-next.2

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
@@ -7216,7 +7216,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
7216
7216
  var SESSION_ID2 = randomUUID5();
7217
7217
  function readCliVersion() {
7218
7218
  if (true) {
7219
- return "0.22.1-next.1";
7219
+ return "0.22.1-next.2";
7220
7220
  }
7221
7221
  return "0.0.0";
7222
7222
  }
@@ -16436,7 +16436,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
16436
16436
  var SESSION_ID = randomUUID4();
16437
16437
  function readCliVersion() {
16438
16438
  if (true) {
16439
- return "0.22.1-next.1";
16439
+ return "0.22.1-next.2";
16440
16440
  }
16441
16441
  return "0.0.0";
16442
16442
  }
@@ -434,12 +434,13 @@ var init_artifacts = __esm({
434
434
  };
435
435
  ArtifactStore = class {
436
436
  entries = /* @__PURE__ */ new Map();
437
- async register(hostPath, opts) {
438
- const filename = opts?.filename ?? (0, import_node_path.basename)(hostPath);
439
- const mimeType = opts?.mimeType ?? inferMimeType(hostPath);
437
+ async register(opts) {
438
+ const { hostPath, kind } = opts;
439
+ const filename = opts.filename ?? (0, import_node_path.basename)(hostPath);
440
+ const mimeType = opts.mimeType ?? inferMimeType(hostPath);
440
441
  let size = 0;
441
442
  let mtimeMs;
442
- let isDirectory2 = opts?.archive === "tar.gz";
443
+ let isDirectory2 = opts.archive === "tar.gz";
443
444
  try {
444
445
  const st = await (0, import_promises.stat)(hostPath);
445
446
  size = st.size;
@@ -448,10 +449,11 @@ var init_artifacts = __esm({
448
449
  } catch {
449
450
  }
450
451
  const id = (0, import_node_crypto.randomUUID)();
451
- this.entries.set(id, { path: hostPath, filename, mimeType, size, isDirectory: isDirectory2 });
452
+ this.entries.set(id, { path: hostPath, kind, filename, mimeType, size, isDirectory: isDirectory2 });
452
453
  const handle = {
453
454
  [ARTIFACT_MARKER]: true,
454
455
  id,
456
+ kind,
455
457
  filename,
456
458
  mimeType,
457
459
  size,
@@ -459,7 +461,7 @@ var init_artifacts = __esm({
459
461
  };
460
462
  if (mtimeMs != null) handle.mtimeMs = mtimeMs;
461
463
  if (isDirectory2) handle.archive = "tar.gz";
462
- if (opts?.saveDir) handle.saveDir = opts.saveDir;
464
+ if (opts.saveDir) handle.saveDir = opts.saveDir;
463
465
  return handle;
464
466
  }
465
467
  get(id) {
@@ -468,6 +470,7 @@ var init_artifacts = __esm({
468
470
  list() {
469
471
  return [...this.entries.entries()].map(([id, entry]) => ({
470
472
  id,
473
+ kind: entry.kind,
471
474
  filename: entry.filename,
472
475
  mimeType: entry.mimeType,
473
476
  size: entry.size,
@@ -95692,7 +95695,7 @@ var _CI_VENDOR_COUNT_FOR_TEST = vendors_default.length;
95692
95695
  var SESSION_ID = (0, import_node_crypto3.randomUUID)();
95693
95696
  function readCliVersion() {
95694
95697
  if (true) {
95695
- return "0.22.1-next.1";
95698
+ return "0.22.1-next.2";
95696
95699
  }
95697
95700
  return "0.0.0";
95698
95701
  }
@@ -121231,17 +121234,29 @@ Fails if the simulator-server / emulator backend / Chromium CDP is not reachable
121231
121234
  scale: params.scale,
121232
121235
  downscaler: params.downscaler
121233
121236
  });
121234
- const image2 = await requireArtifacts(ctx).register(capturedPath2, { mimeType: "image/png" });
121237
+ const image2 = await requireArtifacts(ctx).register({
121238
+ hostPath: capturedPath2,
121239
+ kind: "screenshot",
121240
+ mimeType: "image/png"
121241
+ });
121235
121242
  return { image: image2 };
121236
121243
  }
121237
121244
  if (device.platform === "ios" && await isTvOsSimulator(params.udid)) {
121238
121245
  const pngPath = await tvScreenshot(params.udid, scale, signal);
121239
- const image2 = await requireArtifacts(ctx).register(pngPath, { mimeType: "image/png" });
121246
+ const image2 = await requireArtifacts(ctx).register({
121247
+ hostPath: pngPath,
121248
+ kind: "screenshot",
121249
+ mimeType: "image/png"
121250
+ });
121240
121251
  return { image: image2 };
121241
121252
  }
121242
121253
  if (device.platform === "vega") {
121243
121254
  const pngPath = await captureVegaScreenshotPng({ scale: params.scale });
121244
- const image2 = await requireArtifacts(ctx).register(pngPath, { mimeType: "image/png" });
121255
+ const image2 = await requireArtifacts(ctx).register({
121256
+ hostPath: pngPath,
121257
+ kind: "screenshot",
121258
+ mimeType: "image/png"
121259
+ });
121245
121260
  return { image: image2 };
121246
121261
  }
121247
121262
  const ref = simulatorServerRef(device);
@@ -121255,7 +121270,11 @@ Fails if the simulator-server / emulator backend / Chromium CDP is not reachable
121255
121270
  void 0,
121256
121271
  androidDevtoolsRotationPeek(registry2, device)
121257
121272
  );
121258
- const image = await requireArtifacts(ctx).register(capturedPath, { mimeType: "image/png" });
121273
+ const image = await requireArtifacts(ctx).register({
121274
+ hostPath: capturedPath,
121275
+ kind: "screenshot",
121276
+ mimeType: "image/png"
121277
+ });
121259
121278
  return { image };
121260
121279
  }
121261
121280
  };
@@ -134743,8 +134762,8 @@ async function writeReport(path41, content) {
134743
134762
  }
134744
134763
 
134745
134764
  // ../tool-server/src/tools/profiler/react/react-profiler-analyze.ts
134746
- async function fileArtifact(store, p) {
134747
- return p ? store.register(p) : null;
134765
+ async function fileArtifact(store, p, kind) {
134766
+ return p ? store.register({ hostPath: p, kind }) : null;
134748
134767
  }
134749
134768
  var annotationSchema = external_exports.object({
134750
134769
  offsetMs: external_exports.coerce.number().describe(
@@ -134903,13 +134922,13 @@ Fails if react-profiler-stop has not been called or no profiling data is stored.
134903
134922
  const artifacts = requireArtifacts(ctx);
134904
134923
  const result = {
134905
134924
  report,
134906
- reportFile: await fileArtifact(artifacts, reportFile),
134925
+ reportFile: await fileArtifact(artifacts, reportFile, "react-profile-report"),
134907
134926
  hotCommitsTotal,
134908
134927
  hotCommitsShown,
134909
134928
  sessionFiles: {
134910
134929
  sessionId: sessionPaths.sessionId,
134911
- cpuProfile: await fileArtifact(artifacts, sessionPaths.cpuProfilePath),
134912
- commits: await fileArtifact(artifacts, sessionPaths.commitsPath)
134930
+ cpuProfile: await fileArtifact(artifacts, sessionPaths.cpuProfilePath, "react-profile-cpu"),
134931
+ commits: await fileArtifact(artifacts, sessionPaths.commitsPath, "react-profile-commits")
134913
134932
  }
134914
134933
  };
134915
134934
  if (hotCommitIndices === null) {
@@ -135882,7 +135901,11 @@ async function tryCpuExportFallback(traceFile, outPath, diagnostics) {
135882
135901
  return false;
135883
135902
  }
135884
135903
  async function exportIosTraceData(traceFile) {
135885
- const exportedFiles = {};
135904
+ const exportedFiles = {
135905
+ cpu: null,
135906
+ hangs: null,
135907
+ leaks: null
135908
+ };
135886
135909
  const diagnostics = {
135887
135910
  tocSchemas: [],
135888
135911
  cpuSchemaUsed: null,
@@ -135890,7 +135913,8 @@ async function exportIosTraceData(traceFile) {
135890
135913
  };
135891
135914
  const dir = path23.dirname(traceFile);
135892
135915
  const baseName = path23.basename(traceFile, ".trace");
135893
- for (const [key2, config2] of Object.entries(EXPORTS)) {
135916
+ for (const key2 of Object.keys(EXPORTS)) {
135917
+ const config2 = EXPORTS[key2];
135894
135918
  const outPath = path23.join(dir, `${baseName}${config2.suffix}`);
135895
135919
  if (key2 === "cpu") {
135896
135920
  const resolvedXpath = await resolveCpuXpath(traceFile, diagnostics);
@@ -139093,7 +139117,8 @@ async function stopNativeProfilerAndroid(api) {
139093
139117
  api.lastExitInfo = null;
139094
139118
  }
139095
139119
  const { hostTracePath, warning } = stopResult;
139096
- api.exportedFiles = { pftrace: hostTracePath };
139120
+ const exportedFiles = { pftrace: hostTracePath };
139121
+ api.exportedFiles = exportedFiles;
139097
139122
  if (api.appProcess) {
139098
139123
  await writeAndroidNativeProfilerMetadata(hostTracePath, {
139099
139124
  platform: "android",
@@ -139103,7 +139128,7 @@ async function stopNativeProfilerAndroid(api) {
139103
139128
  }
139104
139129
  const result = {
139105
139130
  traceFile: hostTracePath,
139106
- exportedFiles: api.exportedFiles
139131
+ exportedFiles
139107
139132
  };
139108
139133
  if (warning) result.warning = warning;
139109
139134
  return result;
@@ -139224,15 +139249,22 @@ var capability26 = {
139224
139249
  apple: { simulator: true, device: true },
139225
139250
  android: { emulator: true, device: true, unknown: true }
139226
139251
  };
139252
+ var EXPORTED_FILE_KINDS = {
139253
+ cpu: "native-profile-cpu",
139254
+ hangs: "native-profile-hangs",
139255
+ leaks: "native-profile-leaks",
139256
+ pftrace: "native-profile-trace"
139257
+ };
139227
139258
  async function exportedFilesToArtifacts(store, files) {
139228
139259
  const out = {};
139229
- for (const [key2, filePath] of Object.entries(files)) {
139230
- out[key2] = filePath ? await store.register(filePath) : null;
139260
+ for (const key2 of Object.keys(files)) {
139261
+ const filePath = files[key2];
139262
+ out[key2] = filePath ? await store.register({ hostPath: filePath, kind: EXPORTED_FILE_KINDS[key2] }) : null;
139231
139263
  }
139232
139264
  return out;
139233
139265
  }
139234
139266
  function registerTrace(store, traceFile) {
139235
- return store.register(traceFile, { archive: "tar.gz" });
139267
+ return store.register({ hostPath: traceFile, kind: "native-profile-trace", archive: "tar.gz" });
139236
139268
  }
139237
139269
  var nativeProfilerStopTool = {
139238
139270
  id: "native-profiler-stop",
@@ -139329,7 +139361,10 @@ Fails if native-profiler-stop has not been called first to export trace data.`,
139329
139361
  }
139330
139362
  return {
139331
139363
  ...result,
139332
- reportFile: result.reportFile ? await requireArtifacts(ctx).register(result.reportFile) : null
139364
+ reportFile: result.reportFile ? await requireArtifacts(ctx).register({
139365
+ hostPath: result.reportFile,
139366
+ kind: "native-profile-report"
139367
+ }) : null
139333
139368
  };
139334
139369
  }
139335
139370
  };
@@ -140432,7 +140467,9 @@ Fails if no recording (running or finished-but-unretrieved) exists for the given
140432
140467
  assertSupported("screen-recording-stop", capability29, device);
140433
140468
  const stopped = await stopCapture(api);
140434
140469
  const artifacts = requireArtifacts(ctx);
140435
- const video = await artifacts.register(stopped.outputFile, {
140470
+ const video = await artifacts.register({
140471
+ hostPath: stopped.outputFile,
140472
+ kind: "screen-recording",
140436
140473
  mimeType: "video/mp4",
140437
140474
  // Drop the internal `argent-` temp prefix so the saved file reads cleanly
140438
140475
  // as `.argent/recordings/screen-recording-<device>-<ts>.mp4`.
@@ -148743,7 +148780,9 @@ async function runSnapshot(env, opts) {
148743
148780
  const currentArtifact = async () => {
148744
148781
  if (cropDir === void 0) return shot.image;
148745
148782
  keepCropped = true;
148746
- return store.register(currentPath, {
148783
+ return store.register({
148784
+ hostPath: currentPath,
148785
+ kind: "screenshot",
148747
148786
  mimeType: "image/png",
148748
148787
  filename: `${snapshotKey}-current.png`
148749
148788
  });
@@ -148768,7 +148807,11 @@ async function runSnapshot(env, opts) {
148768
148807
  if (opts.updateBaselines) {
148769
148808
  await fs50.mkdir(dir, { recursive: true });
148770
148809
  await fs50.copyFile(currentPath, baselinePath);
148771
- const baseline = await store.register(baselinePath, { mimeType: "image/png" });
148810
+ const baseline = await store.register({
148811
+ hostPath: baselinePath,
148812
+ kind: "screenshot",
148813
+ mimeType: "image/png"
148814
+ });
148772
148815
  return {
148773
148816
  status: "pass",
148774
148817
  reason: exists2 ? `baseline updated (${key2})` : `baseline written (${key2})`,
@@ -148809,7 +148852,11 @@ async function runSnapshot(env, opts) {
148809
148852
  reason: `baseline is ${expected.width}x${expected.height} but the ${opts.cropOn ? "cropOn region" : "capture"} is ${actual.width}x${actual.height} (${key2}) \u2014 nothing was compared` + (opts.cropOn ? `. The element's size drifted \u2014 crop a fixed-size container, or re-adopt with updateBaselines` : ""),
148810
148853
  snapshotKey,
148811
148854
  artifacts: {
148812
- baseline: await store.register(baselinePath, { mimeType: "image/png" }),
148855
+ baseline: await store.register({
148856
+ hostPath: baselinePath,
148857
+ kind: "screenshot",
148858
+ mimeType: "image/png"
148859
+ }),
148813
148860
  current: await currentArtifact()
148814
148861
  }
148815
148862
  };
@@ -148820,11 +148867,17 @@ async function runSnapshot(env, opts) {
148820
148867
  return { status: "pass", reason };
148821
148868
  }
148822
148869
  const artifacts = {
148823
- baseline: await store.register(baselinePath, { mimeType: "image/png" }),
148870
+ baseline: await store.register({
148871
+ hostPath: baselinePath,
148872
+ kind: "screenshot",
148873
+ mimeType: "image/png"
148874
+ }),
148824
148875
  current: await currentArtifact()
148825
148876
  };
148826
148877
  if (result.contextDiffPath) {
148827
- artifacts.diff = await store.register(result.contextDiffPath, {
148878
+ artifacts.diff = await store.register({
148879
+ hostPath: result.contextDiffPath,
148880
+ kind: "screenshot-diff-context",
148828
148881
  mimeType: "image/png",
148829
148882
  filename: `${snapshotKey}-diff.png`
148830
148883
  });
@@ -150847,9 +150900,17 @@ async function executeScreenshotDiffTool(services, params, options, captureScree
150847
150900
  const artifacts = requireArtifacts(options);
150848
150901
  return {
150849
150902
  summary: result.summary,
150850
- ...result.diffPath ? { diffPath: await artifacts.register(result.diffPath, { mimeType: "image/png" }) } : {},
150903
+ ...result.diffPath ? {
150904
+ diffPath: await artifacts.register({
150905
+ hostPath: result.diffPath,
150906
+ kind: "screenshot-diff",
150907
+ mimeType: "image/png"
150908
+ })
150909
+ } : {},
150851
150910
  ...result.contextDiffPath ? {
150852
- contextDiffPath: await artifacts.register(result.contextDiffPath, {
150911
+ contextDiffPath: await artifacts.register({
150912
+ hostPath: result.contextDiffPath,
150913
+ kind: "screenshot-diff-context",
150853
150914
  mimeType: "image/png"
150854
150915
  })
150855
150916
  } : {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swmansion/argent",
3
- "version": "0.22.1-next.1",
3
+ "version": "0.22.1-next.2",
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",