@limrun/api 0.31.0 → 0.31.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.31.2 (2026-06-09)
4
+
5
+ Full Changelog: [v0.31.1...v0.31.2](https://github.com/limrun-inc/typescript-sdk/compare/v0.31.1...v0.31.2)
6
+
7
+ ### Chores
8
+
9
+ * bump cli version ([556bd22](https://github.com/limrun-inc/typescript-sdk/commit/556bd22ef59dd480015db5cc9c35f2d224d7741d))
10
+
11
+ ## 0.31.1 (2026-06-09)
12
+
13
+ Full Changelog: [v0.31.0...v0.31.1](https://github.com/limrun-inc/typescript-sdk/compare/v0.31.0...v0.31.1)
14
+
3
15
  ## 0.31.0 (2026-06-08)
4
16
 
5
17
  Full Changelog: [v0.30.0...v0.31.0](https://github.com/limrun-inc/typescript-sdk/compare/v0.30.0...v0.31.0)
package/index.d.mts CHANGED
@@ -7,7 +7,8 @@ export * from "./instance-client.mjs";
7
7
  export * as Ios from "./ios-client.mjs";
8
8
  export { startHttpProxy, type HttpProxy, type StartHttpProxyOptions } from "./http-proxy.mjs";
9
9
  export { buildSettingKeyPattern, parseBuildSettingEntries, validateBuildSettings } from "./build-settings.mjs";
10
+ export { parseTopLevelIpaDigest, type BepIpaDigest } from "./rbe-bep.mjs";
10
11
  export { exec, type ExecRequest, type ExecOptions, type ExecResult, type ExecChildProcess, } from "./exec-client.mjs";
11
- export { type XcodeCreateClientParams, type XcodeClient, type RbeStatus, type RbeStartOptions, type RbeTunnelOptions, type Tunnel, RbeUnsupportedError, deriveRbeTunnelUrl, DEFAULT_RBE_TUNNEL_PORT, type XcodeProjectConfig, type XcodeBuildOptions, type ReactNativeBuildConfig, type SimulatorAttachResult, type SimulatorStatus, type SimulatorBuildStatus, type SimulatorAttachment, type SimulatorDeviceInfo, type SimulatorInstallState, } from "./resources/xcode-instances-helpers.mjs";
12
+ export { type XcodeCreateClientParams, type XcodeClient, type RbeStatus, type RbeStartOptions, type RbeTunnelOptions, type RbeInstallResult, type Tunnel, RbeUnsupportedError, deriveRbeTunnelUrl, DEFAULT_RBE_TUNNEL_PORT, type XcodeProjectConfig, type XcodeBuildOptions, type ReactNativeBuildConfig, type SimulatorAttachResult, type SimulatorStatus, type SimulatorBuildStatus, type SimulatorAttachment, type SimulatorDeviceInfo, type SimulatorInstallState, } from "./resources/xcode-instances-helpers.mjs";
12
13
  export { LimrunError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.mjs";
13
14
  //# sourceMappingURL=index.d.mts.map
package/index.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,qBAAiB;AAE7C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE,2BAAuB;AACzD,OAAO,EAAE,UAAU,EAAE,+BAA2B;AAChD,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,qBAAiB;AACtD,OAAO,EAAE,WAAW,EAAE,8BAA0B;AAChD,sCAAkC;AAClC,OAAO,KAAK,GAAG,yBAAqB;AACpC,OAAO,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,yBAAqB;AAC1F,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,6BAAyB;AAC3G,OAAO,EACL,IAAI,EACJ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,0BAAsB;AACvB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,gB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BAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,gDAA4C;AAC7C,OAAO,EACL,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,yBAAqB"}
package/index.d.ts CHANGED
@@ -7,7 +7,8 @@ export * from "./instance-client.js";
7
7
  export * as Ios from "./ios-client.js";
8
8
  export { startHttpProxy, type HttpProxy, type StartHttpProxyOptions } from "./http-proxy.js";
9
9
  export { buildSettingKeyPattern, parseBuildSettingEntries, validateBuildSettings } from "./build-settings.js";
10
+ export { parseTopLevelIpaDigest, type BepIpaDigest } from "./rbe-bep.js";
10
11
  export { exec, type ExecRequest, type ExecOptions, type ExecResult, type ExecChildProcess, } from "./exec-client.js";
11
- export { type XcodeCreateClientParams, type XcodeClient, type RbeStatus, type RbeStartOptions, type RbeTunnelOptions, type Tunnel, RbeUnsupportedError, deriveRbeTunnelUrl, DEFAULT_RBE_TUNNEL_PORT, type XcodeProjectConfig, type XcodeBuildOptions, type ReactNativeBuildConfig, type SimulatorAttachResult, type SimulatorStatus, type SimulatorBuildStatus, type SimulatorAttachment, type SimulatorDeviceInfo, type SimulatorInstallState, } from "./resources/xcode-instances-helpers.js";
12
+ export { type XcodeCreateClientParams, type XcodeClient, type RbeStatus, type RbeStartOptions, type RbeTunnelOptions, type RbeInstallResult, type Tunnel, RbeUnsupportedError, deriveRbeTunnelUrl, DEFAULT_RBE_TUNNEL_PORT, type XcodeProjectConfig, type XcodeBuildOptions, type ReactNativeBuildConfig, type SimulatorAttachResult, type SimulatorStatus, type SimulatorBuildStatus, type SimulatorAttachment, type SimulatorDeviceInfo, type SimulatorInstallState, } from "./resources/xcode-instances-helpers.js";
12
13
  export { LimrunError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.js";
13
14
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,oBAAiB;AAE7C,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,EAAE,0BAAuB;AACzD,OAAO,EAAE,UAAU,EAAE,8BAA2B;AAChD,OAAO,EAAE,MAAM,EAAE,KAAK,aAAa,EAAE,oBAAiB;AACtD,OAAO,EAAE,WAAW,EAAE,6BAA0B;AAChD,qCAAkC;AAClC,OAAO,KAAK,GAAG,wBAAqB;AACpC,OAAO,EAAE,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,qBAAqB,EAAE,wBAAqB;AAC1F,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,4BAAyB;AAC3G,OAAO,EACL,IAAI,EACJ,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,gBAAgB,GACtB,yBAAsB;AACvB,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1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B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,+CAA4C;AAC7C,OAAO,EACL,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,wBAAqB"}
package/index.js CHANGED
@@ -4,7 +4,7 @@ exports = module.exports = function (...args) {
4
4
  return new exports.default(...args)
5
5
  }
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.LimrunError = exports.DEFAULT_RBE_TUNNEL_PORT = exports.deriveRbeTunnelUrl = exports.RbeUnsupportedError = exports.exec = exports.validateBuildSettings = exports.parseBuildSettingEntries = exports.buildSettingKeyPattern = exports.startHttpProxy = exports.Ios = exports.PagePromise = exports.Limrun = exports.APIPromise = exports.toFile = exports.default = void 0;
7
+ exports.UnprocessableEntityError = exports.PermissionDeniedError = exports.InternalServerError = exports.AuthenticationError = exports.BadRequestError = exports.RateLimitError = exports.ConflictError = exports.NotFoundError = exports.APIUserAbortError = exports.APIConnectionTimeoutError = exports.APIConnectionError = exports.APIError = exports.LimrunError = exports.DEFAULT_RBE_TUNNEL_PORT = exports.deriveRbeTunnelUrl = exports.RbeUnsupportedError = exports.exec = exports.parseTopLevelIpaDigest = exports.validateBuildSettings = exports.parseBuildSettingEntries = exports.buildSettingKeyPattern = exports.startHttpProxy = exports.Ios = exports.PagePromise = exports.Limrun = exports.APIPromise = exports.toFile = exports.default = void 0;
8
8
  const tslib_1 = require("./internal/tslib.js");
9
9
  var client_1 = require("./client.js");
10
10
  Object.defineProperty(exports, "default", { enumerable: true, get: function () { return client_1.Limrun; } });
@@ -24,6 +24,8 @@ var build_settings_1 = require("./build-settings.js");
24
24
  Object.defineProperty(exports, "buildSettingKeyPattern", { enumerable: true, get: function () { return build_settings_1.buildSettingKeyPattern; } });
25
25
  Object.defineProperty(exports, "parseBuildSettingEntries", { enumerable: true, get: function () { return build_settings_1.parseBuildSettingEntries; } });
26
26
  Object.defineProperty(exports, "validateBuildSettings", { enumerable: true, get: function () { return build_settings_1.validateBuildSettings; } });
27
+ var rbe_bep_1 = require("./rbe-bep.js");
28
+ Object.defineProperty(exports, "parseTopLevelIpaDigest", { enumerable: true, get: function () { return rbe_bep_1.parseTopLevelIpaDigest; } });
27
29
  var exec_client_1 = require("./exec-client.js");
28
30
  Object.defineProperty(exports, "exec", { enumerable: true, get: function () { return exec_client_1.exec; } });
29
31
  var xcode_instances_helpers_1 = require("./resources/xcode-instances-helpers.js");
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,sCAA6C;AAApC,iGAAA,MAAM,OAAW;AAE1B,6CAAyD;AAA/B,iGAAA,MAAM,OAAA;AAChC,qDAAgD;AAAvC,yGAAA,UAAU,OAAA;AACnB,sCAAsD;AAA7C,gGAAA,MAAM,OAAA;AACf,mDAAgD;AAAvC,yGAAA,WAAW,OAAA;AACpB,+DAAkC;AAClC,+DAAoC;AACpC,8CAA0F;AAAjF,4GAAA,cAAc,OAAA;AACvB,sDAA2G;AAAlG,wHAAA,sBAAsB,OAAA;AAAE,0HAAA,wBAAwB,OAAA;AAAE,uHAAA,qBAAqB,OAAA;AAChF,gDAMuB;AALrB,mGAAA,IAAI,OAAA;AAMN,kFAmB6C;AAZ3C,8HAAA,mBAAmB,OAAA;AACnB,6HAAA,kBAAkB,OAAA;AAClB,kIAAA,uBAAuB,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AA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA"}
package/index.mjs CHANGED
@@ -8,6 +8,7 @@ export * from "./instance-client.mjs";
8
8
  export * as Ios from "./ios-client.mjs";
9
9
  export { startHttpProxy } from "./http-proxy.mjs";
10
10
  export { buildSettingKeyPattern, parseBuildSettingEntries, validateBuildSettings } from "./build-settings.mjs";
11
+ export { parseTopLevelIpaDigest } from "./rbe-bep.mjs";
11
12
  export { exec, } from "./exec-client.mjs";
12
13
  export { RbeUnsupportedError, deriveRbeTunnelUrl, DEFAULT_RBE_TUNNEL_PORT, } from "./resources/xcode-instances-helpers.mjs";
13
14
  export { LimrunError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.mjs";
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,qBAAiB;AAE7C,OAAO,EAAmB,MAAM,EAAE,2BAAuB;AACzD,OAAO,EAAE,UAAU,EAAE,+BAA2B;AAChD,OAAO,EAAE,MAAM,EAAsB,qBAAiB;AACtD,OAAO,EAAE,WAAW,EAAE,8BAA0B;AAChD,sCAAkC;AAClC,OAAO,KAAK,GAAG,yBAAqB;AACpC,OAAO,EAAE,cAAc,EAA8C,yBAAqB;AAC1F,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,6BAAyB;AAC3G,OAAO,EACL,IAAI,GAKL,0BAAsB;AACvB,OAAO,EAOL,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GAUxB,gDAA4C;AAC7C,OAAO,EACL,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,yBAAqB"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,qBAAiB;AAE7C,OAAO,EAAmB,MAAM,EAAE,2BAAuB;AACzD,OAAO,EAAE,UAAU,EAAE,+BAA2B;AAChD,OAAO,EAAE,MAAM,EAAsB,qBAAiB;AACtD,OAAO,EAAE,WAAW,EAAE,8BAA0B;AAChD,sCAAkC;AAClC,OAAO,KAAK,GAAG,yBAAqB;AACpC,OAAO,EAAE,cAAc,EAA8C,yBAAqB;AAC1F,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,6BAAyB;AAC3G,OAAO,EAAE,sBAAsB,EAAqB,sBAAkB;AACtE,OAAO,EACL,IAAI,GAKL,0BAAsB;AACvB,OAAO,EAQL,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GAUxB,gDAA4C;AAC7C,OAAO,EACL,WAAW,EACX,QAAQ,EACR,kBAAkB,EAClB,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,wBAAwB,GACzB,yBAAqB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@limrun/api",
3
- "version": "0.31.0",
3
+ "version": "0.31.2",
4
4
  "description": "The official TypeScript library for the Limrun API",
5
5
  "author": "Limrun <contact@limrun.com>",
6
6
  "types": "./index.d.ts",
@@ -203,6 +203,16 @@
203
203
  "./pagination.mjs": {
204
204
  "default": "./pagination.mjs"
205
205
  },
206
+ "./rbe-bep": {
207
+ "import": "./rbe-bep.mjs",
208
+ "require": "./rbe-bep.js"
209
+ },
210
+ "./rbe-bep.js": {
211
+ "default": "./rbe-bep.js"
212
+ },
213
+ "./rbe-bep.mjs": {
214
+ "default": "./rbe-bep.mjs"
215
+ },
206
216
  "./resource": {
207
217
  "import": "./resource.mjs",
208
218
  "require": "./resource.js"
package/rbe-bep.d.mts ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Parses Bazel's Build Event Protocol (BEP, the `--build_event_json_file`
3
+ * newline-delimited JSON) to find a built target's top-level `.ipa` and its
4
+ * content-addressed (CAS) digest.
5
+ *
6
+ * A remotely-executed output carries a `bytestream://<host>[/<instance>]/blobs/
7
+ * <hash>/<size>` URI in its BEP `file` entry regardless of whether Bazel also
8
+ * downloads the bytes (`--remote_download_outputs`), because the URI names the
9
+ * output's CAS identity, not its local availability. `lim xcode rbe install`
10
+ * reads that digest and hands it to the instance, which fetches the blob from
11
+ * its own RBE cache and installs it — no round-trip. The printed build command
12
+ * passes `--remote_download_outputs=minimal` to skip the (unneeded) local
13
+ * download by default; dropping it does not affect this parser.
14
+ */
15
+ export type BepIpaDigest = {
16
+ /** Lowercase hex SHA-256 of the .ipa blob. */
17
+ hash: string;
18
+ /** Size of the .ipa blob in bytes. */
19
+ sizeBytes: number;
20
+ /** The .ipa file name as Bazel reported it (e.g. "App/App.ipa"). */
21
+ ipaName: string;
22
+ };
23
+ /**
24
+ * Finds the `.ipa` produced for `label` in a BEP stream and returns its CAS
25
+ * digest. Throws a descriptive Error when the target/.ipa is absent, its output
26
+ * was materialized locally (a `file://` URI) instead of left in CAS, or it was
27
+ * built with a non-SHA256 digest the instance cache cannot resolve.
28
+ */
29
+ export declare function parseTopLevelIpaDigest(bepJson: string, label: string): BepIpaDigest;
30
+ //# sourceMappingURL=rbe-bep.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbe-bep.d.mts","sourceRoot":"","sources":["src/rbe-bep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA8CF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAmFnF"}
package/rbe-bep.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Parses Bazel's Build Event Protocol (BEP, the `--build_event_json_file`
3
+ * newline-delimited JSON) to find a built target's top-level `.ipa` and its
4
+ * content-addressed (CAS) digest.
5
+ *
6
+ * A remotely-executed output carries a `bytestream://<host>[/<instance>]/blobs/
7
+ * <hash>/<size>` URI in its BEP `file` entry regardless of whether Bazel also
8
+ * downloads the bytes (`--remote_download_outputs`), because the URI names the
9
+ * output's CAS identity, not its local availability. `lim xcode rbe install`
10
+ * reads that digest and hands it to the instance, which fetches the blob from
11
+ * its own RBE cache and installs it — no round-trip. The printed build command
12
+ * passes `--remote_download_outputs=minimal` to skip the (unneeded) local
13
+ * download by default; dropping it does not affect this parser.
14
+ */
15
+ export type BepIpaDigest = {
16
+ /** Lowercase hex SHA-256 of the .ipa blob. */
17
+ hash: string;
18
+ /** Size of the .ipa blob in bytes. */
19
+ sizeBytes: number;
20
+ /** The .ipa file name as Bazel reported it (e.g. "App/App.ipa"). */
21
+ ipaName: string;
22
+ };
23
+ /**
24
+ * Finds the `.ipa` produced for `label` in a BEP stream and returns its CAS
25
+ * digest. Throws a descriptive Error when the target/.ipa is absent, its output
26
+ * was materialized locally (a `file://` URI) instead of left in CAS, or it was
27
+ * built with a non-SHA256 digest the instance cache cannot resolve.
28
+ */
29
+ export declare function parseTopLevelIpaDigest(bepJson: string, label: string): BepIpaDigest;
30
+ //# sourceMappingURL=rbe-bep.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbe-bep.d.ts","sourceRoot":"","sources":["src/rbe-bep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA8CF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,YAAY,CAmFnF"}
package/rbe-bep.js ADDED
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ /**
3
+ * Parses Bazel's Build Event Protocol (BEP, the `--build_event_json_file`
4
+ * newline-delimited JSON) to find a built target's top-level `.ipa` and its
5
+ * content-addressed (CAS) digest.
6
+ *
7
+ * A remotely-executed output carries a `bytestream://<host>[/<instance>]/blobs/
8
+ * <hash>/<size>` URI in its BEP `file` entry regardless of whether Bazel also
9
+ * downloads the bytes (`--remote_download_outputs`), because the URI names the
10
+ * output's CAS identity, not its local availability. `lim xcode rbe install`
11
+ * reads that digest and hands it to the instance, which fetches the blob from
12
+ * its own RBE cache and installs it — no round-trip. The printed build command
13
+ * passes `--remote_download_outputs=minimal` to skip the (unneeded) local
14
+ * download by default; dropping it does not affect this parser.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.parseTopLevelIpaDigest = parseTopLevelIpaDigest;
18
+ /** A SHA-256 digest is exactly 64 lowercase hex chars; the instance CAS is keyed by it. */
19
+ const SHA256_HEX = /^[0-9a-f]{64}$/;
20
+ /** Extracts (hash, size) from a `bytestream://…/blobs/<hash>/<size>` URI. */
21
+ function parseBytestreamDigest(uri) {
22
+ // Tolerate an optional instance-name segment before /blobs/ by anchoring on
23
+ // the /blobs/<hash>/<size> tail rather than a fixed segment count. The hash is
24
+ // left length-agnostic here (validated as SHA-256 by the caller).
25
+ const m = uri.match(/\/blobs\/([0-9a-f]+)\/(\d+)(?:$|\/)/);
26
+ if (!m || m[1] === undefined || m[2] === undefined)
27
+ return null;
28
+ return { hash: m[1], sizeBytes: Number(m[2]) };
29
+ }
30
+ /**
31
+ * Canonicalizes a Bazel target label to the `//pkg:name` form BEP records.
32
+ * Bazel expands the `//pkg` shorthand to `//pkg:<basename(pkg)>` in its
33
+ * targetCompleted events, so `install //App` must match BEP's `//App:App`.
34
+ */
35
+ function canonicalizeLabel(label) {
36
+ if (label.includes(':'))
37
+ return label;
38
+ // Strip trailing slashes with a linear scan rather than a regex: `/\/+$/`
39
+ // backtracks quadratically on a label of many trailing slashes (CodeQL ReDoS).
40
+ let end = label.length;
41
+ while (end > 0 && label[end - 1] === '/')
42
+ end--;
43
+ const pkg = label.slice(0, end);
44
+ const name = pkg.split('/').pop() ?? '';
45
+ return name ? `${pkg}:${name}` : pkg;
46
+ }
47
+ /**
48
+ * Finds the `.ipa` produced for `label` in a BEP stream and returns its CAS
49
+ * digest. Throws a descriptive Error when the target/.ipa is absent, its output
50
+ * was materialized locally (a `file://` URI) instead of left in CAS, or it was
51
+ * built with a non-SHA256 digest the instance cache cannot resolve.
52
+ */
53
+ function parseTopLevelIpaDigest(bepJson, label) {
54
+ const canonical = canonicalizeLabel(label);
55
+ const events = [];
56
+ for (const line of bepJson.split('\n')) {
57
+ const trimmed = line.trim();
58
+ if (!trimmed)
59
+ continue;
60
+ try {
61
+ events.push(JSON.parse(trimmed));
62
+ }
63
+ catch {
64
+ // Ignore partial/garbled lines (BEP is flushed incrementally).
65
+ }
66
+ }
67
+ // The successful TargetComplete for the requested label (matched against the
68
+ // canonical //pkg:name form Bazel records, so `//App` matches `//App:App`).
69
+ const completed = events.find((e) => e.id?.targetCompleted?.label === canonical && e.completed?.success)
70
+ ?.completed;
71
+ if (!completed) {
72
+ throw new Error(`No successful build of ${label} found in the build event log. ` +
73
+ `Build it first with --config=limrun (e.g. \`bazelisk --digest_function=sha256 build --config=limrun ${label}\`).`);
74
+ }
75
+ // Default output group -> the fileSet (namedSetOfFiles) ids holding its outputs.
76
+ const rootFileSetIds = (completed.outputGroup ?? [])
77
+ .filter((og) => og.name === 'default' || !og.name)
78
+ .flatMap((og) => (og.fileSets ?? []).map((fs) => fs.id))
79
+ .filter((id) => !!id);
80
+ if (rootFileSetIds.length === 0) {
81
+ throw new Error(`Build of ${label} reported no default output files.`);
82
+ }
83
+ // Index namedSetOfFiles by id and walk transitively (sets can nest).
84
+ const namedSets = new Map();
85
+ for (const e of events) {
86
+ const id = e.id?.namedSet?.id;
87
+ if (id && e.namedSetOfFiles)
88
+ namedSets.set(id, e.namedSetOfFiles);
89
+ }
90
+ const seen = new Set();
91
+ const queue = [...rootFileSetIds];
92
+ // Set to the name of an .ipa that was seen but had no bytestream digest (its
93
+ // output was downloaded locally) — distinguishes that case from "no .ipa at all".
94
+ let localOnlyIpa;
95
+ while (queue.length > 0) {
96
+ const id = queue.shift();
97
+ if (seen.has(id))
98
+ continue;
99
+ seen.add(id);
100
+ const set = namedSets.get(id);
101
+ if (!set)
102
+ continue;
103
+ for (const f of set.files ?? []) {
104
+ if (!f.name || !f.name.endsWith('.ipa'))
105
+ continue;
106
+ const digest = f.uri ? parseBytestreamDigest(f.uri) : null;
107
+ if (digest) {
108
+ // The instance cache is keyed by SHA-256. A non-64-hex digest means the
109
+ // build used a different digest function (Bazel 9 defaults to BLAKE3),
110
+ // which the server CAS cannot resolve — surface that clearly here rather
111
+ // than letting it fail later as a cryptic cache miss.
112
+ if (!SHA256_HEX.test(digest.hash)) {
113
+ throw new Error(`Built ${f.name} with a non-SHA256 digest (got ${digest.hash.length} hex chars, expected 64; ` +
114
+ `likely BLAKE3 on Bazel 9). The instance cache is keyed by SHA-256 — rebuild with ` +
115
+ `--digest_function=sha256, e.g. \`bazelisk --digest_function=sha256 build --config=limrun ${label}\`.`);
116
+ }
117
+ return { hash: digest.hash, sizeBytes: digest.sizeBytes, ipaName: f.name };
118
+ }
119
+ localOnlyIpa = f.name;
120
+ }
121
+ for (const nested of set.fileSets ?? []) {
122
+ if (nested.id)
123
+ queue.push(nested.id);
124
+ }
125
+ }
126
+ if (localOnlyIpa) {
127
+ throw new Error(`Found ${label}'s .ipa (${localOnlyIpa}) but it has no remote (bytestream) digest — it was ` +
128
+ `built locally, not remotely executed. Ensure you built with --config=limrun so the .ipa is ` +
129
+ `produced in the instance's cache.`);
130
+ }
131
+ throw new Error(`No .ipa output found for ${label} in the build event log.`);
132
+ }
133
+ //# sourceMappingURL=rbe-bep.js.map
package/rbe-bep.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbe-bep.js","sourceRoot":"","sources":["src/rbe-bep.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;AA6DH,wDAmFC;AAtHD,2FAA2F;AAC3F,MAAM,UAAU,GAAG,gBAAgB,CAAC;AAEpC,6EAA6E;AAC7E,SAAS,qBAAqB,CAAC,GAAW;IACxC,4EAA4E;IAC5E,+EAA+E;IAC/E,kEAAkE;IAClE,MAAM,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAC3D,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IAChE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACjD,CAAC;AAED;;;;GAIG;AACH,SAAS,iBAAiB,CAAC,KAAa;IACtC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,0EAA0E;IAC1E,+EAA+E;IAC/E,IAAI,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC;IACvB,OAAO,GAAG,GAAG,CAAC,IAA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DAAsD;YAC1F,6FAA6F;YAC7F,mCAAmC,CACtC,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,0BAA0B,CAAC,CAAC;AAC/E,CAAC"}
package/rbe-bep.mjs ADDED
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Parses Bazel's Build Event Protocol (BEP, the `--build_event_json_file`
3
+ * newline-delimited JSON) to find a built target's top-level `.ipa` and its
4
+ * content-addressed (CAS) digest.
5
+ *
6
+ * A remotely-executed output carries a `bytestream://<host>[/<instance>]/blobs/
7
+ * <hash>/<size>` URI in its BEP `file` entry regardless of whether Bazel also
8
+ * downloads the bytes (`--remote_download_outputs`), because the URI names the
9
+ * output's CAS identity, not its local availability. `lim xcode rbe install`
10
+ * reads that digest and hands it to the instance, which fetches the blob from
11
+ * its own RBE cache and installs it — no round-trip. The printed build command
12
+ * passes `--remote_download_outputs=minimal` to skip the (unneeded) local
13
+ * download by default; dropping it does not affect this parser.
14
+ */
15
+ /** A SHA-256 digest is exactly 64 lowercase hex chars; the instance CAS is keyed by it. */
16
+ const SHA256_HEX = /^[0-9a-f]{64}$/;
17
+ /** Extracts (hash, size) from a `bytestream://…/blobs/<hash>/<size>` URI. */
18
+ function parseBytestreamDigest(uri) {
19
+ // Tolerate an optional instance-name segment before /blobs/ by anchoring on
20
+ // the /blobs/<hash>/<size> tail rather than a fixed segment count. The hash is
21
+ // left length-agnostic here (validated as SHA-256 by the caller).
22
+ const m = uri.match(/\/blobs\/([0-9a-f]+)\/(\d+)(?:$|\/)/);
23
+ if (!m || m[1] === undefined || m[2] === undefined)
24
+ return null;
25
+ return { hash: m[1], sizeBytes: Number(m[2]) };
26
+ }
27
+ /**
28
+ * Canonicalizes a Bazel target label to the `//pkg:name` form BEP records.
29
+ * Bazel expands the `//pkg` shorthand to `//pkg:<basename(pkg)>` in its
30
+ * targetCompleted events, so `install //App` must match BEP's `//App:App`.
31
+ */
32
+ function canonicalizeLabel(label) {
33
+ if (label.includes(':'))
34
+ return label;
35
+ // Strip trailing slashes with a linear scan rather than a regex: `/\/+$/`
36
+ // backtracks quadratically on a label of many trailing slashes (CodeQL ReDoS).
37
+ let end = label.length;
38
+ while (end > 0 && label[end - 1] === '/')
39
+ end--;
40
+ const pkg = label.slice(0, end);
41
+ const name = pkg.split('/').pop() ?? '';
42
+ return name ? `${pkg}:${name}` : pkg;
43
+ }
44
+ /**
45
+ * Finds the `.ipa` produced for `label` in a BEP stream and returns its CAS
46
+ * digest. Throws a descriptive Error when the target/.ipa is absent, its output
47
+ * was materialized locally (a `file://` URI) instead of left in CAS, or it was
48
+ * built with a non-SHA256 digest the instance cache cannot resolve.
49
+ */
50
+ export function parseTopLevelIpaDigest(bepJson, label) {
51
+ const canonical = canonicalizeLabel(label);
52
+ const events = [];
53
+ for (const line of bepJson.split('\n')) {
54
+ const trimmed = line.trim();
55
+ if (!trimmed)
56
+ continue;
57
+ try {
58
+ events.push(JSON.parse(trimmed));
59
+ }
60
+ catch {
61
+ // Ignore partial/garbled lines (BEP is flushed incrementally).
62
+ }
63
+ }
64
+ // The successful TargetComplete for the requested label (matched against the
65
+ // canonical //pkg:name form Bazel records, so `//App` matches `//App:App`).
66
+ const completed = events.find((e) => e.id?.targetCompleted?.label === canonical && e.completed?.success)
67
+ ?.completed;
68
+ if (!completed) {
69
+ throw new Error(`No successful build of ${label} found in the build event log. ` +
70
+ `Build it first with --config=limrun (e.g. \`bazelisk --digest_function=sha256 build --config=limrun ${label}\`).`);
71
+ }
72
+ // Default output group -> the fileSet (namedSetOfFiles) ids holding its outputs.
73
+ const rootFileSetIds = (completed.outputGroup ?? [])
74
+ .filter((og) => og.name === 'default' || !og.name)
75
+ .flatMap((og) => (og.fileSets ?? []).map((fs) => fs.id))
76
+ .filter((id) => !!id);
77
+ if (rootFileSetIds.length === 0) {
78
+ throw new Error(`Build of ${label} reported no default output files.`);
79
+ }
80
+ // Index namedSetOfFiles by id and walk transitively (sets can nest).
81
+ const namedSets = new Map();
82
+ for (const e of events) {
83
+ const id = e.id?.namedSet?.id;
84
+ if (id && e.namedSetOfFiles)
85
+ namedSets.set(id, e.namedSetOfFiles);
86
+ }
87
+ const seen = new Set();
88
+ const queue = [...rootFileSetIds];
89
+ // Set to the name of an .ipa that was seen but had no bytestream digest (its
90
+ // output was downloaded locally) — distinguishes that case from "no .ipa at all".
91
+ let localOnlyIpa;
92
+ while (queue.length > 0) {
93
+ const id = queue.shift();
94
+ if (seen.has(id))
95
+ continue;
96
+ seen.add(id);
97
+ const set = namedSets.get(id);
98
+ if (!set)
99
+ continue;
100
+ for (const f of set.files ?? []) {
101
+ if (!f.name || !f.name.endsWith('.ipa'))
102
+ continue;
103
+ const digest = f.uri ? parseBytestreamDigest(f.uri) : null;
104
+ if (digest) {
105
+ // The instance cache is keyed by SHA-256. A non-64-hex digest means the
106
+ // build used a different digest function (Bazel 9 defaults to BLAKE3),
107
+ // which the server CAS cannot resolve — surface that clearly here rather
108
+ // than letting it fail later as a cryptic cache miss.
109
+ if (!SHA256_HEX.test(digest.hash)) {
110
+ throw new Error(`Built ${f.name} with a non-SHA256 digest (got ${digest.hash.length} hex chars, expected 64; ` +
111
+ `likely BLAKE3 on Bazel 9). The instance cache is keyed by SHA-256 — rebuild with ` +
112
+ `--digest_function=sha256, e.g. \`bazelisk --digest_function=sha256 build --config=limrun ${label}\`.`);
113
+ }
114
+ return { hash: digest.hash, sizeBytes: digest.sizeBytes, ipaName: f.name };
115
+ }
116
+ localOnlyIpa = f.name;
117
+ }
118
+ for (const nested of set.fileSets ?? []) {
119
+ if (nested.id)
120
+ queue.push(nested.id);
121
+ }
122
+ }
123
+ if (localOnlyIpa) {
124
+ throw new Error(`Found ${label}'s .ipa (${localOnlyIpa}) but it has no remote (bytestream) digest — it was ` +
125
+ `built locally, not remotely executed. Ensure you built with --config=limrun so the .ipa is ` +
126
+ `produced in the instance's cache.`);
127
+ }
128
+ throw new Error(`No .ipa output found for ${label} in the build event log.`);
129
+ }
130
+ //# sourceM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C,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;YAC3D,IAAI,MAAM,EAAE,CAAC;gBACX,wEAAwE;gBACxE,uEAAuE;gBACvE,yEAAyE;gBACzE,sDAAsD;gBACtD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;oBAClC,MAAM,IAAI,KAAK,CACb,SAAS,CAAC,CAAC,IAAI,kCAAkC,MAAM,CAAC,IAAI,CAAC,MAAM,2BAA2B;wBAC5F,mFAAmF;wBACnF,4FAA4F,KAAK,KAAK,CACzG,CAAC;gBACJ,CAAC;gBACD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7E,CAAC;YACD,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC;QACxB,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;YACxC,IAAI,MAAM,CAAC,EAAE;gBAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAED,IAAI,YAAY,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,SAAS,KAAK,YAAY,YAAY,sDAAsD;YAC1F,6FAA6F;YAC7F,mCAAmC,CACtC,CAAC;IACJ,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,KAAK,0BAA0B,CAAC,CAAC;AAC/E,CAAC"}
@@ -3,5 +3,5 @@ export { type Asset, type AssetListResponse, type AssetGetOrCreateResponse, type
3
3
  export { IosInstances, type IosInstance, type IosInstanceCreateParams, type IosInstanceListParams, type IosInstancesItems, } from "./ios-instances.mjs";
4
4
  export { type XcodeInstance, type XcodeInstanceCreateParams, type XcodeInstanceListParams, type XcodeInstancesItems, } from "./xcode-instances.mjs";
5
5
  export { Assets, AssetGetOrUploadParams, AssetGetOrUploadResponse } from "./assets-helpers.mjs";
6
- export { XcodeInstances, RbeUnsupportedError, DEFAULT_RBE_TUNNEL_PORT, type XcodeCreateClientParams, type XcodeClient, type XcodeProjectConfig, type XcodeBuildOptions, type ReactNativeBuildConfig, type SimulatorAttachResult, type SimulatorStatus, type SimulatorBuildStatus, type SimulatorAttachment, type SimulatorDeviceInfo, type SimulatorInstallState, } from "./xcode-instances-helpers.mjs";
6
+ export { XcodeInstances, RbeUnsupportedError, DEFAULT_RBE_TUNNEL_PORT, type XcodeCreateClientParams, type XcodeClient, type XcodeProjectConfig, type XcodeBuildOptions, type ReactNativeBuildConfig, type SimulatorAttachResult, type SimulatorStatus, type SimulatorBuildStatus, type SimulatorAttachment, type SimulatorDeviceInfo, type SimulatorInstallState, type RbeInstallResult, } from "./xcode-instances-helpers.mjs";
7
7
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,gCAA4B;AAC7B,OAAO,EACL,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,qBAAiB;AAClB,OAAO,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,GACvB,4BAAwB;AACzB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,GACzB,8BAA0B;AAE3B,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,6BAAyB;AAC5F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 -3,5 +3,5 @@ export { type Asset, type AssetListResponse, type AssetGetOrCreateResponse, type
3
3
  export { IosInstances, type IosInstance, type IosInstanceCreateParams, type IosInstanceListParams, type IosInstancesItems, } from "./ios-instances.js";
4
4
  export { type XcodeInstance, type XcodeInstanceCreateParams, type XcodeInstanceListParams, type XcodeInstancesItems, } from "./xcode-instances.js";
5
5
  export { Assets, AssetGetOrUploadParams, AssetGetOrUploadResponse } from "./assets-helpers.js";
6
- export { XcodeInstances, RbeUnsupportedError, DEFAULT_RBE_TUNNEL_PORT, type XcodeCreateClientParams, type XcodeClient, type XcodeProjectConfig, type XcodeBuildOptions, type ReactNativeBuildConfig, type SimulatorAttachResult, type SimulatorStatus, type SimulatorBuildStatus, type SimulatorAttachment, type SimulatorDeviceInfo, type SimulatorInstallState, } from "./xcode-instances-helpers.js";
6
+ export { XcodeInstances, RbeUnsupportedError, DEFAULT_RBE_TUNNEL_PORT, type XcodeCreateClientParams, type XcodeClient, type XcodeProjectConfig, type XcodeBuildOptions, type ReactNativeBuildConfig, type SimulatorAttachResult, type SimulatorStatus, type SimulatorBuildStatus, type SimulatorAttachment, type SimulatorDeviceInfo, type SimulatorInstallState, type RbeInstallResult, } from "./xcode-instances-helpers.js";
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,gBAAgB,EAChB,KAAK,eAAe,EACpB,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,GAC3B,+BAA4B;AAC7B,OAAO,EACL,KAAK,KAAK,EACV,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,GAC5B,oBAAiB;AAClB,OAAO,EACL,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KA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kB,EACvB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,qCAAkC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAM6B;AAL3B,qHAAA,gBAAgB,OAAA;AAclB,oDAMyB;AALvB,6GAAA,YAAY,OAAA;AAad,sDAA4F;AAAnF,wGAAA,MAAM,OAAA;AACf,wEAemC;AAdjC,yHAAA,cAAc,OAAA;AACd,8HAAA,mBAAmB,OAAA;AACnB,kIAAA,uBAAuB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,4DAM6B;AAL3B,qHAAA,gBAAgB,OAAA;AAclB,oDAMyB;AALvB,6GAAA,YAAY,OAAA;AAad,sDAA4F;AAAnF,wGAAA,MAAM,OAAA;AACf,wEAgBmC;AAfjC,yHAAA,cAAc,OAAA;AACd,8HAAA,mBAAmB,OAAA;AACnB,kIAAA,uBAAuB,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,gBAAgB,GAKjB,gCAA4B;AAS7B,OAAO,EACL,YAAY,GAKb,4BAAwB;AAQzB,OAAO,EAAE,MAAM,EAAoD,6BAAyB;AAC5F,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,uBAAuB,GAYxB,sCAAkC"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EACL,gBAAgB,GAKjB,gCAA4B;AAS7B,OAAO,EACL,YAAY,GAKb,4BAAwB;AAQzB,OAAO,EAAE,MAAM,EAAoD,6BAAyB;AAC5F,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,uBAAuB,GAaxB,sCAAkC"}
@@ -149,6 +149,18 @@ export type RbeTunnelOptions = {
149
149
  host?: string;
150
150
  logLevel?: LogLevel;
151
151
  };
152
+ export type RbeInstallResult = {
153
+ /** True when the app was synced and installed on the attached simulator. */
154
+ installed: boolean;
155
+ /** CFBundleIdentifier of the installed app, as reported by the simulator. */
156
+ bundleId?: string;
157
+ /** The .app bundle name discovered inside the .ipa (Payload/<appName>.app). */
158
+ appName?: string;
159
+ /** Differential-sync duration in milliseconds. */
160
+ syncDurationMs?: number;
161
+ /** Simulator install duration in milliseconds. */
162
+ installDurationMs?: number;
163
+ };
152
164
  export type XcodeClient = {
153
165
  /**
154
166
  * Sync source code to the xcode instance. In watch mode, keeps syncing on changes.
@@ -166,7 +178,9 @@ export type XcodeClient = {
166
178
  xcodebuild: (settings?: XcodeProjectConfig, options?: XcodeBuildOptions) => ExecChildProcess;
167
179
  /**
168
180
  * Attach a simulator to this xcode instance.
169
- * After attaching, builds will auto-install on the simulator.
181
+ * After attaching, the latest xcodebuild build (if any) is installed on the
182
+ * simulator. RBE builds are not auto-installed on attach — install them
183
+ * explicitly with `installRbeBuildFromBep` while a simulator is attached.
170
184
  */
171
185
  attachSimulator: (simulator: IosInstance | {
172
186
  apiUrl: string;
@@ -185,12 +199,41 @@ export type XcodeClient = {
185
199
  getRbe: () => Promise<RbeStatus>;
186
200
  /** Stop the RBE stack. */
187
201
  stopRbe: () => Promise<RbeStatus>;
202
+ /**
203
+ * Install a Bazel RBE build on the attached simulator, server-side, from its
204
+ * build event log (BEP). Parses the top-level `.ipa`'s CAS digest for `target`
205
+ * out of `bep` (the contents of `--build_event_json_file`); the instance fetches
206
+ * the blob from its embedded cache, unpacks the .app, and pushes it to the
207
+ * attached simulator via the differential-sync path — no client round-trip.
208
+ * Requires a running RBE stack and an attached simulator (installed=false when
209
+ * none is attached — attach one and call again). Throws a descriptive error if
210
+ * the target/.ipa is absent, was downloaded locally, or was built with a
211
+ * non-SHA256 digest (e.g. BLAKE3) the instance cache can't resolve. `ipaName` is
212
+ * the `.ipa` file name Bazel reported.
213
+ */
214
+ installRbeBuildFromBep: (opts: {
215
+ bep: string;
216
+ target: string;
217
+ }) => Promise<RbeInstallResult & {
218
+ ipaName: string;
219
+ }>;
188
220
  /**
189
221
  * Open a local TCP listener bridged to the instance's RBE gRPC frontend
190
222
  * over a multiplexed websocket. Point bazel at it with
191
223
  * --remote_executor=grpc://127.0.0.1:<port>.
192
224
  */
193
225
  startRbeTunnel: (opts?: RbeTunnelOptions) => Promise<Tunnel>;
226
+ /**
227
+ * Create a new iOS simulator instance and attach it to this xcode instance.
228
+ * Deletes the simulator if attach fails so it is never leaked. Returns the new
229
+ * simulator's instance id (record it for teardown) and the instance itself.
230
+ */
231
+ attachNewSimulator: () => Promise<{
232
+ iosInstanceId: string;
233
+ simulator: IosInstance;
234
+ }>;
235
+ /** Best-effort delete of a simulator instance. Never throws; returns success. */
236
+ deleteSimulator: (iosInstanceId: string) => Promise<boolean>;
194
237
  };
195
238
  export type XcodeCreateClientParams = {
196
239
  instance: XcodeInstance;