@limrun/api 0.34.0 → 0.35.0

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/index.d.mts +3 -1
  3. package/index.d.mts.map +1 -1
  4. package/index.d.ts +3 -1
  5. package/index.d.ts.map +1 -1
  6. package/index.js +17 -1
  7. package/index.js.map +1 -1
  8. package/index.mjs +2 -0
  9. package/index.mjs.map +1 -1
  10. package/internal/direct-instance-errors.d.mts +9 -0
  11. package/internal/direct-instance-errors.d.mts.map +1 -1
  12. package/internal/direct-instance-errors.d.ts +9 -0
  13. package/internal/direct-instance-errors.d.ts.map +1 -1
  14. package/internal/direct-instance-errors.js +6 -1
  15. package/internal/direct-instance-errors.js.map +1 -1
  16. package/internal/direct-instance-errors.mjs +5 -1
  17. package/internal/direct-instance-errors.mjs.map +1 -1
  18. package/internal/proxy-transport.d.mts +9 -0
  19. package/internal/proxy-transport.d.mts.map +1 -1
  20. package/internal/proxy-transport.d.ts +9 -0
  21. package/internal/proxy-transport.d.ts.map +1 -1
  22. package/internal/proxy-transport.js +19 -0
  23. package/internal/proxy-transport.js.map +1 -1
  24. package/internal/proxy-transport.mjs +19 -0
  25. package/internal/proxy-transport.mjs.map +1 -1
  26. package/package.json +21 -1
  27. package/rbe-session.d.mts +35 -0
  28. package/rbe-session.d.mts.map +1 -0
  29. package/rbe-session.d.ts +35 -0
  30. package/rbe-session.d.ts.map +1 -0
  31. package/rbe-session.js +72 -0
  32. package/rbe-session.js.map +1 -0
  33. package/rbe-session.mjs +65 -0
  34. package/rbe-session.mjs.map +1 -0
  35. package/rbe-workspace.d.mts +163 -0
  36. package/rbe-workspace.d.mts.map +1 -0
  37. package/rbe-workspace.d.ts +163 -0
  38. package/rbe-workspace.d.ts.map +1 -0
  39. package/rbe-workspace.js +394 -0
  40. package/rbe-workspace.js.map +1 -0
  41. package/rbe-workspace.mjs +382 -0
  42. package/rbe-workspace.mjs.map +1 -0
  43. package/resources/xcode-instances-helpers.d.mts +29 -0
  44. package/resources/xcode-instances-helpers.d.mts.map +1 -1
  45. package/resources/xcode-instances-helpers.d.ts +29 -0
  46. package/resources/xcode-instances-helpers.d.ts.map +1 -1
  47. package/resources/xcode-instances-helpers.js +58 -7
  48. package/resources/xcode-instances-helpers.js.map +1 -1
  49. package/resources/xcode-instances-helpers.mjs +59 -8
  50. package/resources/xcode-instances-helpers.mjs.map +1 -1
  51. package/src/index.ts +23 -0
  52. package/src/internal/direct-instance-errors.ts +11 -1
  53. package/src/internal/proxy-transport.ts +22 -0
  54. package/src/rbe-session.ts +92 -0
  55. package/src/rbe-workspace.ts +407 -0
  56. package/src/resources/xcode-instances-helpers.ts +110 -13
  57. package/src/version.ts +1 -1
  58. package/version.d.mts +1 -1
  59. package/version.d.ts +1 -1
  60. package/version.js +1 -1
  61. package/version.mjs +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.35.0 (2026-07-03)
4
+
5
+ Full Changelog: [v0.34.0...v0.35.0](https://github.com/limrun-inc/typescript-sdk/compare/v0.34.0...v0.35.0)
6
+
7
+ ### Features
8
+
9
+ * **xcode:** RBE workspace/session helpers in the SDK and uploadLatestRbeBuild ([fdfb7b0](https://github.com/limrun-inc/typescript-sdk/commit/fdfb7b03010a38e129691aba97789a77887fdf2d))
10
+
11
+
12
+ ### Refactors
13
+
14
+ * **xcode:** apply cleanup review to the RBE upload surface ([ae34cb9](https://github.com/limrun-inc/typescript-sdk/commit/ae34cb9d40bc9f689a0cf231f1e474bafefcfbe6))
15
+
3
16
  ## 0.34.0 (2026-07-01)
4
17
 
5
18
  Full Changelog: [v0.33.5...v0.34.0](https://github.com/limrun-inc/typescript-sdk/compare/v0.33.5...v0.34.0)
package/index.d.mts CHANGED
@@ -8,6 +8,8 @@ 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
10
  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 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";
11
+ export { type XcodeCreateClientParams, type XcodeClient, type RbeStatus, type RbeStartOptions, type RbeTunnelOptions, type RbeInstallResult, type RbeUploadOptions, type RbeUploadResult, 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 { LIMRUN_DIR, TRY_IMPORT_LINE, findBazelWorkspaceRoot, inferBuildTarget, detectBazelMajorVersion, isBazel9OrLater, renderXcodeConfigBuild, renderLimrunBazelrc, ensureTryImport, writeRbeWorkspaceFiles, type RbeWorkspaceFiles, } from "./rbe-workspace.mjs";
13
+ export { isTransientError, retryTransient, waitForRbeRunning, defaultSleep, type Sleep, type RunningRbeStatus, } from "./rbe-session.mjs";
12
14
  export { LimrunError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.mjs";
13
15
  //# 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,gBAAgB,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"}
1
+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B,EAChB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,KAAK,EACV,KAAK,gBAAgB,GACtB,0BAAsB;AACvB,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
@@ -8,6 +8,8 @@ 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
10
  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 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";
11
+ export { type XcodeCreateClientParams, type XcodeClient, type RbeStatus, type RbeStartOptions, type RbeTunnelOptions, type RbeInstallResult, type RbeUploadOptions, type RbeUploadResult, 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 { LIMRUN_DIR, TRY_IMPORT_LINE, findBazelWorkspaceRoot, inferBuildTarget, detectBazelMajorVersion, isBazel9OrLater, renderXcodeConfigBuild, renderLimrunBazelrc, ensureTryImport, writeRbeWorkspaceFiles, type RbeWorkspaceFiles, } from "./rbe-workspace.js";
13
+ export { isTransientError, retryTransient, waitForRbeRunning, defaultSleep, type Sleep, type RunningRbeStatus, } from "./rbe-session.js";
12
14
  export { LimrunError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.js";
13
15
  //# 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,gBAAgB,EACrB,KAAK,MAAM,EACX,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,iBAAi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iB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,qBAAqB,GAC3B,+CAA4C;AAC7C,OAAO,EACL,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,KAAK,iBAAiB,GACvB,2BAAwB;AACzB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,KAAK,KAAK,EACV,KAAK,gBAAgB,GACtB,yBAAsB;AACvB,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.defaultSleep = exports.waitForRbeRunning = exports.retryTransient = exports.isTransientError = exports.writeRbeWorkspaceFiles = exports.ensureTryImport = exports.renderLimrunBazelrc = exports.renderXcodeConfigBuild = exports.isBazel9OrLater = exports.detectBazelMajorVersion = exports.inferBuildTarget = exports.findBazelWorkspaceRoot = exports.TRY_IMPORT_LINE = exports.LIMRUN_DIR = 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;
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; } });
@@ -30,6 +30,22 @@ var xcode_instances_helpers_1 = require("./resources/xcode-instances-helpers.js"
30
30
  Object.defineProperty(exports, "RbeUnsupportedError", { enumerable: true, get: function () { return xcode_instances_helpers_1.RbeUnsupportedError; } });
31
31
  Object.defineProperty(exports, "deriveRbeTunnelUrl", { enumerable: true, get: function () { return xcode_instances_helpers_1.deriveRbeTunnelUrl; } });
32
32
  Object.defineProperty(exports, "DEFAULT_RBE_TUNNEL_PORT", { enumerable: true, get: function () { return xcode_instances_helpers_1.DEFAULT_RBE_TUNNEL_PORT; } });
33
+ var rbe_workspace_1 = require("./rbe-workspace.js");
34
+ Object.defineProperty(exports, "LIMRUN_DIR", { enumerable: true, get: function () { return rbe_workspace_1.LIMRUN_DIR; } });
35
+ Object.defineProperty(exports, "TRY_IMPORT_LINE", { enumerable: true, get: function () { return rbe_workspace_1.TRY_IMPORT_LINE; } });
36
+ Object.defineProperty(exports, "findBazelWorkspaceRoot", { enumerable: true, get: function () { return rbe_workspace_1.findBazelWorkspaceRoot; } });
37
+ Object.defineProperty(exports, "inferBuildTarget", { enumerable: true, get: function () { return rbe_workspace_1.inferBuildTarget; } });
38
+ Object.defineProperty(exports, "detectBazelMajorVersion", { enumerable: true, get: function () { return rbe_workspace_1.detectBazelMajorVersion; } });
39
+ Object.defineProperty(exports, "isBazel9OrLater", { enumerable: true, get: function () { return rbe_workspace_1.isBazel9OrLater; } });
40
+ Object.defineProperty(exports, "renderXcodeConfigBuild", { enumerable: true, get: function () { return rbe_workspace_1.renderXcodeConfigBuild; } });
41
+ Object.defineProperty(exports, "renderLimrunBazelrc", { enumerable: true, get: function () { return rbe_workspace_1.renderLimrunBazelrc; } });
42
+ Object.defineProperty(exports, "ensureTryImport", { enumerable: true, get: function () { return rbe_workspace_1.ensureTryImport; } });
43
+ Object.defineProperty(exports, "writeRbeWorkspaceFiles", { enumerable: true, get: function () { return rbe_workspace_1.writeRbeWorkspaceFiles; } });
44
+ var rbe_session_1 = require("./rbe-session.js");
45
+ Object.defineProperty(exports, "isTransientError", { enumerable: true, get: function () { return rbe_session_1.isTransientError; } });
46
+ Object.defineProperty(exports, "retryTransient", { enumerable: true, get: function () { return rbe_session_1.retryTransient; } });
47
+ Object.defineProperty(exports, "waitForRbeRunning", { enumerable: true, get: function () { return rbe_session_1.waitForRbeRunning; } });
48
+ Object.defineProperty(exports, "defaultSleep", { enumerable: true, get: function () { return rbe_session_1.defaultSleep; } });
33
49
  var error_1 = require("./core/error.js");
34
50
  Object.defineProperty(exports, "LimrunError", { enumerable: true, get: function () { return error_1.LimrunError; } });
35
51
  Object.defineProperty(exports, "APIError", { enumerable: true, get: function () { return error_1.APIError; } });
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;AA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AMuB;AALrB,mGAAA,IAAI,OAAA;AAMN,kFAsB6C;AAZ3C,8HAAA,mBAAmB,OAAA;AACnB,6HAAA,kBAAkB,OAAA;AAClB,kIAAA,uBAAuB,OAAA;AAWzB,oDAYyB;AAXvB,2GAAA,UAAU,OAAA;AACV,gHAAA,eAAe,OAAA;AACf,uHAAA,sBAAsB,OAAA;AACtB,iHAAA,gBAAgB,OAAA;AAChB,wHAAA,uBAAuB,OAAA;AACvB,gHAAA,eAAe,OAAA;AACf,uHAAA,sBAAsB,OAAA;AACtB,oHAAA,mBAAmB,OAAA;AACnB,gHAAA,eAAe,OAAA;AACf,uHAAA,sBAAsB,OAAA;AAGxB,gDAOuB;AANrB,+GAAA,gBAAgB,OAAA;AAChB,6GAAA,cAAc,OAAA;AACd,gHAAA,iBAAiB,OAAA;AACjB,2GAAA,YAAY,OAAA;AAId,yCAcsB;AAbpB,oGAAA,WAAW,OAAA;AACX,iGAAA,QAAQ,OAAA;AACR,2GAAA,kBAAkB,OAAA;AAClB,kHAAA,yBAAyB,OAAA;AACzB,0GAAA,iBAAiB,OAAA;AACjB,sGAAA,aAAa,OAAA;AACb,sGAAA,aAAa,OAAA;AACb,uGAAA,cAAc,OAAA;AACd,wGAAA,eAAe,OAAA;AACf,4GAAA,mBAAmB,OAAA;AACnB,4GAAA,mBAAmB,OAAA;AACnB,8GAAA,qBAAqB,OAAA;AACrB,iHAAA,wBAAwB,OAAA"}
package/index.mjs CHANGED
@@ -10,5 +10,7 @@ export { startHttpProxy } from "./http-proxy.mjs";
10
10
  export { buildSettingKeyPattern, parseBuildSettingEntries, validateBuildSettings } from "./build-settings.mjs";
11
11
  export { exec, } from "./exec-client.mjs";
12
12
  export { RbeUnsupportedError, deriveRbeTunnelUrl, DEFAULT_RBE_TUNNEL_PORT, } from "./resources/xcode-instances-helpers.mjs";
13
+ export { LIMRUN_DIR, TRY_IMPORT_LINE, findBazelWorkspaceRoot, inferBuildTarget, detectBazelMajorVersion, isBazel9OrLater, renderXcodeConfigBuild, renderLimrunBazelrc, ensureTryImport, writeRbeWorkspaceFiles, } from "./rbe-workspace.mjs";
14
+ export { isTransientError, retryTransient, waitForRbeRunning, defaultSleep, } from "./rbe-session.mjs";
13
15
  export { LimrunError, APIError, APIConnectionError, APIConnectionTimeoutError, APIUserAbortError, NotFoundError, ConflictError, RateLimitError, BadRequestError, AuthenticationError, InternalServerError, PermissionDeniedError, UnprocessableEntityError, } from "./core/error.mjs";
14
16
  //# sourceMappingURL=index.mjs.map
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,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"}
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,EAUL,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GAUxB,gDAA4C;AAC7C,OAAO,EACL,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,sBAAsB,GAEvB,4BAAwB;AACzB,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,YAAY,GAGb,0BAAsB;AACvB,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,2 +1,11 @@
1
+ /** Error thrown for non-2xx direct-instance responses, carrying the HTTP
2
+ * status and raw body so callers can match on them structurally instead of
3
+ * parsing the message. */
4
+ export type DirectInstanceHttpError = Error & {
5
+ status: number;
6
+ body: string;
7
+ };
1
8
  export declare function directInstanceHttpError(operation: string, status: number, text: string, headers: Headers): Error;
9
+ /** Narrow an unknown error to a direct-instance HTTP error with the given status. */
10
+ export declare function isDirectInstanceHttpError(err: unknown, status: number): err is DirectInstanceHttpError;
2
11
  //# sourceMappingURL=direct-instance-errors.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"direct-instance-errors.d.mts","sourceRoot":"","sources":["../src/internal/direct-instance-errors.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACf,KAAK,CAMP"}
1
+ {"version":3,"file":"direct-instance-errors.d.mts","sourceRoot":"","sources":["../src/internal/direct-instance-errors.ts"],"names":[],"mappings":"AAEA;;2BAE2B;AAC3B,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACf,KAAK,CAMP;AAED,qFAAqF;AACrF,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,uBAAuB,CAEtG"}
@@ -1,2 +1,11 @@
1
+ /** Error thrown for non-2xx direct-instance responses, carrying the HTTP
2
+ * status and raw body so callers can match on them structurally instead of
3
+ * parsing the message. */
4
+ export type DirectInstanceHttpError = Error & {
5
+ status: number;
6
+ body: string;
7
+ };
1
8
  export declare function directInstanceHttpError(operation: string, status: number, text: string, headers: Headers): Error;
9
+ /** Narrow an unknown error to a direct-instance HTTP error with the given status. */
10
+ export declare function isDirectInstanceHttpError(err: unknown, status: number): err is DirectInstanceHttpError;
2
11
  //# sourceMappingURL=direct-instance-errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"direct-instance-errors.d.ts","sourceRoot":"","sources":["../src/internal/direct-instance-errors.ts"],"names":[],"mappings":"AAEA,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACf,KAAK,CAMP"}
1
+ {"version":3,"file":"direct-instance-errors.d.ts","sourceRoot":"","sources":["../src/internal/direct-instance-errors.ts"],"names":[],"mappings":"AAEA;;2BAE2B;AAC3B,MAAM,MAAM,uBAAuB,GAAG,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,OAAO,GACf,KAAK,CAMP;AAED,qFAAqF;AACrF,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,GAAG,IAAI,uBAAuB,CAEtG"}
@@ -1,12 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.directInstanceHttpError = directInstanceHttpError;
4
+ exports.isDirectInstanceHttpError = isDirectInstanceHttpError;
4
5
  const error_1 = require("../core/error.js");
5
6
  function directInstanceHttpError(operation, status, text, headers) {
6
7
  const message = `${operation} failed: ${status}${text ? ` ${text}` : ''}`;
7
8
  if (status === 404) {
8
9
  return new error_1.NotFoundError(404, { message }, undefined, headers);
9
10
  }
10
- return new Error(message);
11
+ return Object.assign(new Error(message), { status, body: text });
12
+ }
13
+ /** Narrow an unknown error to a direct-instance HTTP error with the given status. */
14
+ function isDirectInstanceHttpError(err, status) {
15
+ return err instanceof Error && err.status === status;
11
16
  }
12
17
  //# sourceMappingURL=direct-instance-errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"direct-instance-errors.js","sourceRoot":"","sources":["../src/internal/direct-instance-errors.ts"],"names":[],"mappings":";;AAEA,0DAWC;AAbD,4CAA8C;AAE9C,SAAgB,uBAAuB,CACrC,SAAiB,EACjB,MAAc,EACd,IAAY,EACZ,OAAgB;IAEhB,MAAM,OAAO,GAAG,GAAG,SAAS,YAAY,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC1E,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,IAAI,qBAAa,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC"}
1
+ {"version":3,"file":"direct-instance-errors.js","sourceRoot":"","sources":["../src/internal/direct-instance-errors.ts"],"names":[],"mappings":";;AAOA,0DAWC;AAGD,8DAEC;AAvBD,4CAA8C;AAO9C,SAAgB,uBAAuB,CACrC,SAAiB,EACjB,MAAc,EACd,IAAY,EACZ,OAAgB;IAEhB,MAAM,OAAO,GAAG,GAAG,SAAS,YAAY,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC1E,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,IAAI,qBAAa,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,qFAAqF;AACrF,SAAgB,yBAAyB,CAAC,GAAY,EAAE,MAAc;IACpE,OAAO,GAAG,YAAY,KAAK,IAAK,GAAwC,CAAC,MAAM,KAAK,MAAM,CAAC;AAC7F,CAAC"}
@@ -4,6 +4,10 @@ export function directInstanceHttpError(operation, status, text, headers) {
4
4
  if (status === 404) {
5
5
  return new NotFoundError(404, { message }, undefined, headers);
6
6
  }
7
- return new Error(message);
7
+ return Object.assign(new Error(message), { status, body: text });
8
+ }
9
+ /** Narrow an unknown error to a direct-instance HTTP error with the given status. */
10
+ export function isDirectInstanceHttpError(err, status) {
11
+ return err instanceof Error && err.status === status;
8
12
  }
9
13
  //# sourceMappingURL=direct-instance-errors.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"direct-instance-errors.mjs","sourceRoot":"","sources":["../src/internal/direct-instance-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAE9C,MAAM,UAAU,uBAAuB,CACrC,SAAiB,EACjB,MAAc,EACd,IAAY,EACZ,OAAgB;IAEhB,MAAM,OAAO,GAAG,GAAG,SAAS,YAAY,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC1E,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,IAAI,aAAa,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC5B,CAAC"}
1
+ {"version":3,"file":"direct-instance-errors.mjs","sourceRoot":"","sources":["../src/internal/direct-instance-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAO9C,MAAM,UAAU,uBAAuB,CACrC,SAAiB,EACjB,MAAc,EACd,IAAY,EACZ,OAAgB;IAEhB,MAAM,OAAO,GAAG,GAAG,SAAS,YAAY,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC1E,IAAI,MAAM,KAAK,GAAG,EAAE,CAAC;QACnB,OAAO,IAAI,aAAa,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AACnE,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,yBAAyB,CAAC,GAAY,EAAE,MAAc;IACpE,OAAO,GAAG,YAAY,KAAK,IAAK,GAAwC,CAAC,MAAM,KAAK,MAAM,CAAC;AAC7F,CAAC"}
@@ -2,8 +2,17 @@ import type { Agent as HttpAgent } from 'http';
2
2
  import type { Fetch } from "./builtin-types.mjs";
3
3
  declare class NodeProxyTransport {
4
4
  private envHttpProxyAgent;
5
+ private longRequestDispatcher;
5
6
  private websocketAgents;
6
7
  fetch: Fetch;
8
+ /**
9
+ * fetch for requests that legitimately receive no response bytes for many
10
+ * minutes (the server answers only after completing long work). Plain fetch
11
+ * would abort them at undici's default 300s headersTimeout.
12
+ * EnvHttpProxyAgent covers the no-proxy case too: it routes non-proxied
13
+ * origins through an internal Agent built with these same options.
14
+ */
15
+ fetchLongRequest: Fetch;
7
16
  getWebSocketAgent(url: string): HttpAgent | undefined;
8
17
  private getEnvHttpProxyAgent;
9
18
  private hasProxyEnv;
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-transport.d.mts","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAM/C,OAAO,KAAK,EAAE,KAAK,EAAE,4BAAwB;AAE7C,cAAM,kBAAkB;IACtB,OAAO,CAAC,iBAAiB,CAAgC;IACzD,OAAO,CAAC,eAAe,CAAgC;IAEvD,KAAK,EAAE,KAAK,CASV;IAEF,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAoBrD,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,0BAA0B;CASnC;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
1
+ {"version":3,"file":"proxy-transport.d.mts","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAM/C,OAAO,KAAK,EAAE,KAAK,EAAE,4BAAwB;AAQ7C,cAAM,kBAAkB;IACtB,OAAO,CAAC,iBAAiB,CAAgC;IACzD,OAAO,CAAC,qBAAqB,CAAgC;IAC7D,OAAO,CAAC,eAAe,CAAgC;IAEvD,KAAK,EAAE,KAAK,CASV;IAEF;;;;;;OAMG;IACH,gBAAgB,EAAE,KAAK,CAMrB;IAEF,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAoBrD,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,0BAA0B;CASnC;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
@@ -2,8 +2,17 @@ import type { Agent as HttpAgent } from 'http';
2
2
  import type { Fetch } from "./builtin-types.js";
3
3
  declare class NodeProxyTransport {
4
4
  private envHttpProxyAgent;
5
+ private longRequestDispatcher;
5
6
  private websocketAgents;
6
7
  fetch: Fetch;
8
+ /**
9
+ * fetch for requests that legitimately receive no response bytes for many
10
+ * minutes (the server answers only after completing long work). Plain fetch
11
+ * would abort them at undici's default 300s headersTimeout.
12
+ * EnvHttpProxyAgent covers the no-proxy case too: it routes non-proxied
13
+ * origins through an internal Agent built with these same options.
14
+ */
15
+ fetchLongRequest: Fetch;
7
16
  getWebSocketAgent(url: string): HttpAgent | undefined;
8
17
  private getEnvHttpProxyAgent;
9
18
  private hasProxyEnv;
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-transport.d.ts","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAM/C,OAAO,KAAK,EAAE,KAAK,EAAE,2BAAwB;AAE7C,cAAM,kBAAkB;IACtB,OAAO,CAAC,iBAAiB,CAAgC;IACzD,OAAO,CAAC,eAAe,CAAgC;IAEvD,KAAK,EAAE,KAAK,CASV;IAEF,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAoBrD,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,0BAA0B;CASnC;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
1
+ {"version":3,"file":"proxy-transport.d.ts","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAM/C,OAAO,KAAK,EAAE,KAAK,EAAE,2BAAwB;AAQ7C,cAAM,kBAAkB;IACtB,OAAO,CAAC,iBAAiB,CAAgC;IACzD,OAAO,CAAC,qBAAqB,CAAgC;IAC7D,OAAO,CAAC,eAAe,CAAgC;IAEvD,KAAK,EAAE,KAAK,CASV;IAEF;;;;;;OAMG;IACH,gBAAgB,EAAE,KAAK,CAMrB;IAEF,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAoBrD,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,0BAA0B;CASnC;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"}
@@ -4,6 +4,11 @@ exports.nodeProxyTransport = void 0;
4
4
  const https_proxy_agent_1 = require("https-proxy-agent");
5
5
  const proxy_from_env_1 = require("proxy-from-env");
6
6
  const undici_1 = require("undici");
7
+ // For requests whose server responds only after finishing long work (no bytes
8
+ // until then). Matches the ingress proxy-read-timeout so the client is never
9
+ // the first to give up. undici's defaults are 300s, which would abort e.g. an
10
+ // instance-side artifact upload that takes longer.
11
+ const longRequestTimeouts = { headersTimeout: 3600000, bodyTimeout: 3600000 };
7
12
  class NodeProxyTransport {
8
13
  constructor() {
9
14
  this.websocketAgents = new Map();
@@ -16,6 +21,20 @@ class NodeProxyTransport {
16
21
  dispatcher: this.getEnvHttpProxyAgent(),
17
22
  });
18
23
  };
24
+ /**
25
+ * fetch for requests that legitimately receive no response bytes for many
26
+ * minutes (the server answers only after completing long work). Plain fetch
27
+ * would abort them at undici's default 300s headersTimeout.
28
+ * EnvHttpProxyAgent covers the no-proxy case too: it routes non-proxied
29
+ * origins through an internal Agent built with these same options.
30
+ */
31
+ this.fetchLongRequest = async (input, init) => {
32
+ this.longRequestDispatcher ?? (this.longRequestDispatcher = new undici_1.EnvHttpProxyAgent(longRequestTimeouts));
33
+ return fetch(input, {
34
+ ...(init ?? {}),
35
+ dispatcher: this.longRequestDispatcher,
36
+ });
37
+ };
19
38
  }
20
39
  getWebSocketAgent(url) {
21
40
  if (!this.hasProxyEnv()) {
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-transport.js","sourceRoot":"","sources":["../src/internal/proxy-transport.ts"],"names":[],"mappings":";;;AAEA,yDAAoD;AACpD,mDAAgD;AAChD,mCAA2C;AAI3C,MAAM,kBAAkB;IAAxB;QAEU,oBAAe,GAAG,IAAI,GAAG,EAAqB,CAAC;QAEvD,UAAK,GAAU,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;YACnC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAC5B,CAAC;YAED,OAAQ,KAAa,CAAC,KAAK,EAAE;gBAC3B,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;gBACf,UAAU,EAAE,IAAI,CAAC,oBAAoB,EAAE;aACxC,CAAC,CAAC;QACL,CAAC,CAAC;IA6CJ,CAAC;IA3CC,iBAAiB,CAAC,GAAW;QAC3B,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,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QAAQ,KAAK,KAAK,EAAE,CAAC;YACjC,SAAS,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC/B,CAAC;aAAM,IAAI,SAAS,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YACzC,SAAS,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAChC,CAAC;QACD,OAAO,SAAS,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;CACF;AAEY,QAAA,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC"}
@@ -1,6 +1,11 @@
1
1
  import { HttpsProxyAgent } from 'https-proxy-agent';
2
2
  import { getProxyForUrl } from 'proxy-from-env';
3
3
  import { EnvHttpProxyAgent } from 'undici';
4
+ // For requests whose server responds only after finishing long work (no bytes
5
+ // until then). Matches the ingress proxy-read-timeout so the client is never
6
+ // the first to give up. undici's defaults are 300s, which would abort e.g. an
7
+ // instance-side artifact upload that takes longer.
8
+ const longRequestTimeouts = { headersTimeout: 3600000, bodyTimeout: 3600000 };
4
9
  class NodeProxyTransport {
5
10
  constructor() {
6
11
  this.websocketAgents = new Map();
@@ -13,6 +18,20 @@ class NodeProxyTransport {
13
18
  dispatcher: this.getEnvHttpProxyAgent(),
14
19
  });
15
20
  };
21
+ /**
22
+ * fetch for requests that legitimately receive no response bytes for many
23
+ * minutes (the server answers only after completing long work). Plain fetch
24
+ * would abort them at undici's default 300s headersTimeout.
25
+ * EnvHttpProxyAgent covers the no-proxy case too: it routes non-proxied
26
+ * origins through an internal Agent built with these same options.
27
+ */
28
+ this.fetchLongRequest = async (input, init) => {
29
+ this.longRequestDispatcher ?? (this.longRequestDispatcher = new EnvHttpProxyAgent(longRequestTimeouts));
30
+ return fetch(input, {
31
+ ...(init ?? {}),
32
+ dispatcher: this.longRequestDispatcher,
33
+ });
34
+ };
16
35
  }
17
36
  getWebSocketAgent(url) {
18
37
  if (!this.hasProxyEnv()) {
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-transport.mjs","sourceRoot":"","sources":["../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3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "The official TypeScript library for the Limrun API",
5
5
  "author": "Limrun <contact@limrun.com>",
6
6
  "types": "./index.d.ts",
@@ -218,6 +218,26 @@
218
218
  "./pagination.mjs": {
219
219
  "default": "./pagination.mjs"
220
220
  },
221
+ "./rbe-session": {
222
+ "import": "./rbe-session.mjs",
223
+ "require": "./rbe-session.js"
224
+ },
225
+ "./rbe-session.js": {
226
+ "default": "./rbe-session.js"
227
+ },
228
+ "./rbe-session.mjs": {
229
+ "default": "./rbe-session.mjs"
230
+ },
231
+ "./rbe-workspace": {
232
+ "import": "./rbe-workspace.mjs",
233
+ "require": "./rbe-workspace.js"
234
+ },
235
+ "./rbe-workspace.js": {
236
+ "default": "./rbe-workspace.js"
237
+ },
238
+ "./rbe-workspace.mjs": {
239
+ "default": "./rbe-workspace.mjs"
240
+ },
221
241
  "./resource": {
222
242
  "import": "./resource.mjs",
223
243
  "require": "./resource.js"
@@ -0,0 +1,35 @@
1
+ import type { RbeStatus, XcodeClient } from "./resources/xcode-instances-helpers.mjs";
2
+ /**
3
+ * Client-side helpers for driving an instance's RBE stack: waiting for it to
4
+ * come up and riding out the transient gateway errors that occur right after
5
+ * instance creation. Shared by the CLI and pure-SDK consumers (e.g. CI
6
+ * actions).
7
+ */
8
+ export type Sleep = (ms: number) => Promise<void>;
9
+ export declare const defaultSleep: Sleep;
10
+ export declare function isTransientError(err: unknown): boolean;
11
+ /**
12
+ * Retries `fn` on transient gateway errors (or on whatever `retryOn` matches
13
+ * when given). Non-matching errors propagate immediately. After exhausting
14
+ * `attempts`, throws the last error.
15
+ */
16
+ export declare function retryTransient<T>(fn: () => Promise<T>, opts?: {
17
+ sleep?: Sleep;
18
+ log?: (msg: string) => void;
19
+ attempts?: number;
20
+ retryOn?: (err: unknown) => boolean;
21
+ }): Promise<T>;
22
+ /** RbeStatus once the stack is running: frontendPort and xcodeVersion are set. */
23
+ export type RunningRbeStatus = RbeStatus & Required<Pick<RbeStatus, 'frontendPort' | 'xcodeVersion'>>;
24
+ /**
25
+ * Polls `getRbe` until the stack is `running` (with a usable frontend port and
26
+ * Xcode version), starting from the `initial` status returned by `startRbe`.
27
+ * Each poll is wrapped in retryTransient so a transient blip mid-startup does
28
+ * not abort. Throws when the stack ends in `failed`, stays `starting` past
29
+ * `maxAttempts`, or reports `running` without the fields the caller needs.
30
+ */
31
+ export declare function waitForRbeRunning(client: Pick<XcodeClient, 'getRbe'>, initial: RbeStatus, opts?: {
32
+ sleep?: Sleep;
33
+ maxAttempts?: number;
34
+ }): Promise<RunningRbeStatus>;
35
+ //# sourceMappingURL=rbe-session.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbe-session.d.mts","sourceRoot":"","sources":["src/rbe-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,gDAA4C;AAElF;;;;;GAKG;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAClD,eAAO,MAAM,YAAY,EAAE,KAAiE,CAAC;AAc7F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGtD;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,IAAI,GAAE;IACJ,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;CAChC,GACL,OAAO,CAAC,CAAC,CAAC,CAqBZ;AAED,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC;AAEtG;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EACnC,OAAO,EAAE,SAAS,EAClB,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,gBAAgB,CAAC,CAY3B"}
@@ -0,0 +1,35 @@
1
+ import type { RbeStatus, XcodeClient } from "./resources/xcode-instances-helpers.js";
2
+ /**
3
+ * Client-side helpers for driving an instance's RBE stack: waiting for it to
4
+ * come up and riding out the transient gateway errors that occur right after
5
+ * instance creation. Shared by the CLI and pure-SDK consumers (e.g. CI
6
+ * actions).
7
+ */
8
+ export type Sleep = (ms: number) => Promise<void>;
9
+ export declare const defaultSleep: Sleep;
10
+ export declare function isTransientError(err: unknown): boolean;
11
+ /**
12
+ * Retries `fn` on transient gateway errors (or on whatever `retryOn` matches
13
+ * when given). Non-matching errors propagate immediately. After exhausting
14
+ * `attempts`, throws the last error.
15
+ */
16
+ export declare function retryTransient<T>(fn: () => Promise<T>, opts?: {
17
+ sleep?: Sleep;
18
+ log?: (msg: string) => void;
19
+ attempts?: number;
20
+ retryOn?: (err: unknown) => boolean;
21
+ }): Promise<T>;
22
+ /** RbeStatus once the stack is running: frontendPort and xcodeVersion are set. */
23
+ export type RunningRbeStatus = RbeStatus & Required<Pick<RbeStatus, 'frontendPort' | 'xcodeVersion'>>;
24
+ /**
25
+ * Polls `getRbe` until the stack is `running` (with a usable frontend port and
26
+ * Xcode version), starting from the `initial` status returned by `startRbe`.
27
+ * Each poll is wrapped in retryTransient so a transient blip mid-startup does
28
+ * not abort. Throws when the stack ends in `failed`, stays `starting` past
29
+ * `maxAttempts`, or reports `running` without the fields the caller needs.
30
+ */
31
+ export declare function waitForRbeRunning(client: Pick<XcodeClient, 'getRbe'>, initial: RbeStatus, opts?: {
32
+ sleep?: Sleep;
33
+ maxAttempts?: number;
34
+ }): Promise<RunningRbeStatus>;
35
+ //# sourceMappingURL=rbe-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbe-session.d.ts","sourceRoot":"","sources":["src/rbe-session.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,+CAA4C;AAElF;;;;;GAKG;AAEH,MAAM,MAAM,KAAK,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAClD,eAAO,MAAM,YAAY,EAAE,KAAiE,CAAC;AAc7F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAGtD;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,CAAC,EACpC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,IAAI,GAAE;IACJ,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC;CAChC,GACL,OAAO,CAAC,CAAC,CAAC,CAqBZ;AAED,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,cAAc,CAAC,CAAC,CAAC;AAEtG;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,EACnC,OAAO,EAAE,SAAS,EAClB,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAO,GACjD,OAAO,CAAC,gBAAgB,CAAC,CAY3B"}
package/rbe-session.js ADDED
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defaultSleep = void 0;
4
+ exports.isTransientError = isTransientError;
5
+ exports.retryTransient = retryTransient;
6
+ exports.waitForRbeRunning = waitForRbeRunning;
7
+ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
8
+ exports.defaultSleep = defaultSleep;
9
+ /**
10
+ * Matches the transient gateway / dropped-connection errors that occur right
11
+ * after an instance is created, when its proxy path is not fully serving yet.
12
+ *
13
+ * The HTTP part anchors on the exact `failed: <code>` shape `directInstanceHttpError`
14
+ * produces (`${operation} failed: ${status}...`), so a bare 502/503/504 buried in
15
+ * a response body or an instance id does NOT count as transient. Fetch-thrown
16
+ * network errors carry their own names and are matched directly. A 404 never
17
+ * reaches here; `readRbeResponse` maps it to RbeUnsupportedError first.
18
+ */
19
+ const TRANSIENT = /failed: (?:502|503|504)\b|\bEOF\b|ECONNRESET|ECONNREFUSED|socket hang up|fetch failed/i;
20
+ function isTransientError(err) {
21
+ const message = err instanceof Error ? err.message : String(err);
22
+ return TRANSIENT.test(message);
23
+ }
24
+ /**
25
+ * Retries `fn` on transient gateway errors (or on whatever `retryOn` matches
26
+ * when given). Non-matching errors propagate immediately. After exhausting
27
+ * `attempts`, throws the last error.
28
+ */
29
+ async function retryTransient(fn, opts = {}) {
30
+ const sleep = opts.sleep ?? exports.defaultSleep;
31
+ const attempts = opts.attempts ?? 5;
32
+ const retryOn = opts.retryOn ?? isTransientError;
33
+ let lastErr;
34
+ for (let attempt = 1; attempt <= attempts; attempt++) {
35
+ try {
36
+ return await fn();
37
+ }
38
+ catch (err) {
39
+ if (!retryOn(err)) {
40
+ throw err;
41
+ }
42
+ lastErr = err;
43
+ if (attempt < attempts) {
44
+ const message = err instanceof Error ? err.message : String(err);
45
+ opts.log?.(`Retrying after error (${message.trim()})...`);
46
+ await sleep(2000 * attempt);
47
+ }
48
+ }
49
+ }
50
+ throw lastErr;
51
+ }
52
+ /**
53
+ * Polls `getRbe` until the stack is `running` (with a usable frontend port and
54
+ * Xcode version), starting from the `initial` status returned by `startRbe`.
55
+ * Each poll is wrapped in retryTransient so a transient blip mid-startup does
56
+ * not abort. Throws when the stack ends in `failed`, stays `starting` past
57
+ * `maxAttempts`, or reports `running` without the fields the caller needs.
58
+ */
59
+ async function waitForRbeRunning(client, initial, opts = {}) {
60
+ const sleep = opts.sleep ?? exports.defaultSleep;
61
+ const maxAttempts = opts.maxAttempts ?? 15;
62
+ let status = initial;
63
+ for (let attempt = 0; status.state === 'starting' && attempt < maxAttempts; attempt++) {
64
+ await sleep(2000);
65
+ status = await retryTransient(() => client.getRbe(), { sleep });
66
+ }
67
+ if (status.state !== 'running' || !status.frontendPort || !status.xcodeVersion) {
68
+ throw new Error(`Remote-execution stack failed to start: ${status.error ?? `state is ${status.state}`}`);
69
+ }
70
+ return status;
71
+ }
72
+ //# sourceMappingURL=rbe-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rbe-session.js","sourceRoot":"","sources":["src/rbe-session.ts"],"names":[],"mappings":";;;AAwBA,4CAGC;AAOD,wCA6BC;AAYD,8CAgBC;AAjFM,MAAM,YAAY,GAAU,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAAhF,QAAA,YAAY,gBAAoE;AAE7F;;;;;;;;;GASG;AACH,MAAM,SAAS,GAAG,wFAAwF,CAAC;AAE3G,SAAgB,gBAAgB,CAAC,GAAY;IAC3C,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,cAAc,CAClC,EAAoB,E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UAAU,IAAI,OAAO,GAAG,WAAW,EAAE,OAAO,EAAE,EAAE,CAAC;QACtF,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QAClB,MAAM,GAAG,MAAM,cAAc,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IAClE,CAAC;IACD,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC;QAC/E,MAAM,IAAI,KAAK,CAAC,2CAA2C,MAAM,CAAC,KAAK,IAAI,YAAY,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC3G,CAAC;IACD,OAAO,MAA0B,CAAC;AACpC,CAAC"}
@@ -0,0 +1,65 @@
1
+ export const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
2
+ /**
3
+ * Matches the transient gateway / dropped-connection errors that occur right
4
+ * after an instance is created, when its proxy path is not fully serving yet.
5
+ *
6
+ * The HTTP part anchors on the exact `failed: <code>` shape `directInstanceHttpError`
7
+ * produces (`${operation} failed: ${status}...`), so a bare 502/503/504 buried in
8
+ * a response body or an instance id does NOT count as transient. Fetch-thrown
9
+ * network errors carry their own names and are matched directly. A 404 never
10
+ * reaches here; `readRbeResponse` maps it to RbeUnsupportedError first.
11
+ */
12
+ const TRANSIENT = /failed: (?:502|503|504)\b|\bEOF\b|ECONNRESET|ECONNREFUSED|socket hang up|fetch failed/i;
13
+ export function isTransientError(err) {
14
+ const message = err instanceof Error ? err.message : String(err);
15
+ return TRANSIENT.test(message);
16
+ }
17
+ /**
18
+ * Retries `fn` on transient gateway errors (or on whatever `retryOn` matches
19
+ * when given). Non-matching errors propagate immediately. After exhausting
20
+ * `attempts`, throws the last error.
21
+ */
22
+ export async function retryTransient(fn, opts = {}) {
23
+ const sleep = opts.sleep ?? defaultSleep;
24
+ const attempts = opts.attempts ?? 5;
25
+ const retryOn = opts.retryOn ?? isTransientError;
26
+ let lastErr;
27
+ for (let attempt = 1; attempt <= attempts; attempt++) {
28
+ try {
29
+ return await fn();
30
+ }
31
+ catch (err) {
32
+ if (!retryOn(err)) {
33
+ throw err;
34
+ }
35
+ lastErr = err;
36
+ if (attempt < attempts) {
37
+ const message = err instanceof Error ? err.message : String(err);
38
+ opts.log?.(`Retrying after error (${message.trim()})...`);
39
+ await sleep(2000 * attempt);
40
+ }
41
+ }
42
+ }
43
+ throw lastErr;
44
+ }
45
+ /**
46
+ * Polls `getRbe` until the stack is `running` (with a usable frontend port and
47
+ * Xcode version), starting from the `initial` status returned by `startRbe`.
48
+ * Each poll is wrapped in retryTransient so a transient blip mid-startup does
49
+ * not abort. Throws when the stack ends in `failed`, stays `starting` past
50
+ * `maxAttempts`, or reports `running` without the fields the caller needs.
51
+ */
52
+ export async function waitForRbeRunning(client, initial, opts = {}) {
53
+ const sleep = opts.sleep ?? defaultSleep;
54
+ const maxAttempts = opts.maxAttempts ?? 15;
55
+ let status = initial;
56
+ for (let attempt = 0; status.state === 'starting' && attempt < maxAttempts; attempt++) {
57
+ await sleep(2000);
58
+ status = await retryTransient(() => client.getRbe(), { sleep });
59
+ }
60
+ if (status.state !== 'running' || !status.frontendPort || !status.xcodeVersion) {
61
+ throw new Error(`Remote-execution stack failed to start: ${status.error ?? `state is ${status.state}`}`);
62
+ }
63
+ return status;
64
+ }
65
+ //# sourceMappingURL=rbe-session.mjs.map