@intuned/runtime 1.3.10 → 1.3.12

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 (230) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/bin/intuned-get-headless-user-agent +4 -0
  3. package/dist/commands/get-headless-user-agent.js +18 -0
  4. package/dist/commands/intuned-cli/commands/attempt_api.command.js +1 -1
  5. package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +1 -1
  6. package/dist/commands/intuned-cli/commands/run_api.command.js +1 -1
  7. package/dist/commands/intuned-cli/controller/authSession.d.ts +12 -12
  8. package/dist/commands/intuned-cli/controller/deploy.d.ts +1 -0
  9. package/dist/commands/intuned-cli/controller/deploy.js +143 -6
  10. package/dist/commands/intuned-cli/controller/save.d.ts +4 -1
  11. package/dist/commands/intuned-cli/controller/save.js +8 -2
  12. package/dist/commands/intuned-cli/helpers/auth.d.ts +2 -2
  13. package/dist/commands/intuned-cli/helpers/backend.js +1 -1
  14. package/dist/commands/intuned-cli/helpers/errors.d.ts +4 -1
  15. package/dist/commands/intuned-cli/helpers/errors.js +10 -3
  16. package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +23 -53
  17. package/dist/commands/intuned-cli/helpers/intunedJson.js +12 -63
  18. package/dist/commands/intuned-cli/helpers/wrapper.js +5 -0
  19. package/dist/common/binStartupScript.js +8 -5
  20. package/dist/common/intunedJson.d.ts +229 -0
  21. package/{package/dist/commands/intuned-cli/helpers → dist/common}/intunedJson.js +74 -12
  22. package/dist/common/launchBrowser.d.ts +6 -0
  23. package/dist/common/launchBrowser.js +39 -16
  24. package/dist/common/runApi/index.js +5 -1
  25. package/dist/common/runApi/types.d.ts +40 -40
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.js +6 -0
  28. package/dist/runtime/attemptStore.d.ts +2 -2
  29. package/dist/runtime/export.d.ts +69 -13
  30. package/dist/runtime/index.d.ts +1 -0
  31. package/dist/runtime/index.js +7 -0
  32. package/dist/runtime/persistentStore.d.ts +2 -0
  33. package/dist/runtime/persistentStore.js +37 -0
  34. package/dist/runtime/persistentStore.test.js +101 -0
  35. package/package.json +15 -12
  36. package/package/dist/commands/api/run.d.ts +0 -6
  37. package/package/dist/commands/api/run.js +0 -123
  38. package/package/dist/commands/auth-sessions/load.d.ts +0 -2
  39. package/package/dist/commands/auth-sessions/load.js +0 -35
  40. package/package/dist/commands/auth-sessions/run-check.d.ts +0 -2
  41. package/package/dist/commands/auth-sessions/run-check.js +0 -74
  42. package/package/dist/commands/auth-sessions/run-create.d.ts +0 -2
  43. package/package/dist/commands/auth-sessions/run-create.js +0 -78
  44. package/package/dist/commands/browser/save-state.d.ts +0 -2
  45. package/package/dist/commands/browser/save-state.js +0 -17
  46. package/package/dist/commands/browser/start-browser.d.ts +0 -2
  47. package/package/dist/commands/browser/start-browser.js +0 -14
  48. package/package/dist/commands/build.js +0 -84
  49. package/package/dist/commands/common/browserUtils.d.ts +0 -14
  50. package/package/dist/commands/common/browserUtils.js +0 -58
  51. package/package/dist/commands/common/getFirstLineNumber.d.ts +0 -9
  52. package/package/dist/commands/common/getFirstLineNumber.js +0 -101
  53. package/package/dist/commands/common/getFirstLineNumber.test.js +0 -228
  54. package/package/dist/commands/common/projectExclusions.d.ts +0 -2
  55. package/package/dist/commands/common/projectExclusions.js +0 -8
  56. package/package/dist/commands/common/sendMessageToClient.d.ts +0 -1
  57. package/package/dist/commands/common/sendMessageToClient.js +0 -10
  58. package/package/dist/commands/common/tsNodeImport.d.ts +0 -2
  59. package/package/dist/commands/common/tsNodeImport.js +0 -34
  60. package/package/dist/commands/common/utils/fileUtils.d.ts +0 -6
  61. package/package/dist/commands/common/utils/fileUtils.js +0 -33
  62. package/package/dist/commands/common/utils/settings.d.ts +0 -2
  63. package/package/dist/commands/common/utils/settings.js +0 -31
  64. package/package/dist/commands/common/utils/template.d.ts +0 -2
  65. package/package/dist/commands/common/utils/template.js +0 -31
  66. package/package/dist/commands/common/utils/unixSocket.d.ts +0 -9
  67. package/package/dist/commands/common/utils/unixSocket.js +0 -44
  68. package/package/dist/commands/interface/run.d.ts +0 -1
  69. package/package/dist/commands/interface/run.js +0 -216
  70. package/package/dist/commands/intuned-cli/commands/attempt.command.d.ts +0 -1
  71. package/package/dist/commands/intuned-cli/commands/attempt.command.js +0 -8
  72. package/package/dist/commands/intuned-cli/commands/attempt_api.command.d.ts +0 -1
  73. package/package/dist/commands/intuned-cli/commands/attempt_api.command.js +0 -30
  74. package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.d.ts +0 -1
  75. package/package/dist/commands/intuned-cli/commands/attempt_authsession.command.js +0 -8
  76. package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.d.ts +0 -1
  77. package/package/dist/commands/intuned-cli/commands/attempt_authsession_check.command.js +0 -19
  78. package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.d.ts +0 -1
  79. package/package/dist/commands/intuned-cli/commands/attempt_authsession_create.command.js +0 -24
  80. package/package/dist/commands/intuned-cli/commands/authsession.command.d.ts +0 -1
  81. package/package/dist/commands/intuned-cli/commands/authsession.command.js +0 -8
  82. package/package/dist/commands/intuned-cli/commands/authsession_record.command.d.ts +0 -1
  83. package/package/dist/commands/intuned-cli/commands/authsession_record.command.js +0 -31
  84. package/package/dist/commands/intuned-cli/commands/build.command.d.ts +0 -1
  85. package/package/dist/commands/intuned-cli/commands/build.command.js +0 -12
  86. package/package/dist/commands/intuned-cli/commands/command.d.ts +0 -2
  87. package/package/dist/commands/intuned-cli/commands/command.js +0 -9
  88. package/package/dist/commands/intuned-cli/commands/deploy.command.d.ts +0 -1
  89. package/package/dist/commands/intuned-cli/commands/deploy.command.js +0 -38
  90. package/package/dist/commands/intuned-cli/commands/index.d.ts +0 -18
  91. package/package/dist/commands/intuned-cli/commands/index.js +0 -203
  92. package/package/dist/commands/intuned-cli/commands/init.command.d.ts +0 -1
  93. package/package/dist/commands/intuned-cli/commands/init.command.js +0 -13
  94. package/package/dist/commands/intuned-cli/commands/run.command.d.ts +0 -1
  95. package/package/dist/commands/intuned-cli/commands/run.command.js +0 -8
  96. package/package/dist/commands/intuned-cli/commands/run_api.command.d.ts +0 -1
  97. package/package/dist/commands/intuned-cli/commands/run_api.command.js +0 -46
  98. package/package/dist/commands/intuned-cli/commands/run_authsession.command.d.ts +0 -28
  99. package/package/dist/commands/intuned-cli/commands/run_authsession.command.js +0 -17
  100. package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.d.ts +0 -1
  101. package/package/dist/commands/intuned-cli/commands/run_authsession_create.command.js +0 -35
  102. package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.d.ts +0 -1
  103. package/package/dist/commands/intuned-cli/commands/run_authsession_update.command.js +0 -35
  104. package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.d.ts +0 -1
  105. package/package/dist/commands/intuned-cli/commands/run_authsession_validate.command.js +0 -33
  106. package/package/dist/commands/intuned-cli/commands/save.command.d.ts +0 -13
  107. package/package/dist/commands/intuned-cli/commands/save.command.js +0 -42
  108. package/package/dist/commands/intuned-cli/commands/types.d.ts +0 -31
  109. package/package/dist/commands/intuned-cli/commands/types.js +0 -29
  110. package/package/dist/commands/intuned-cli/constants/index.d.ts +0 -17
  111. package/package/dist/commands/intuned-cli/constants/index.js +0 -25
  112. package/package/dist/commands/intuned-cli/controller/__test__/api.test.js +0 -397
  113. package/package/dist/commands/intuned-cli/controller/__test__/authSession.test.js +0 -1059
  114. package/package/dist/commands/intuned-cli/controller/api.d.ts +0 -42
  115. package/package/dist/commands/intuned-cli/controller/api.js +0 -189
  116. package/package/dist/commands/intuned-cli/controller/authSession.d.ts +0 -209
  117. package/package/dist/commands/intuned-cli/controller/authSession.js +0 -420
  118. package/package/dist/commands/intuned-cli/controller/build.d.ts +0 -1
  119. package/package/dist/commands/intuned-cli/controller/build.js +0 -36
  120. package/package/dist/commands/intuned-cli/controller/deploy.d.ts +0 -4
  121. package/package/dist/commands/intuned-cli/controller/deploy.js +0 -139
  122. package/package/dist/commands/intuned-cli/controller/index.d.ts +0 -1
  123. package/package/dist/commands/intuned-cli/controller/index.js +0 -46
  124. package/package/dist/commands/intuned-cli/controller/save.d.ts +0 -14
  125. package/package/dist/commands/intuned-cli/controller/save.js +0 -345
  126. package/package/dist/commands/intuned-cli/helpers/__test__/browser.test.js +0 -103
  127. package/package/dist/commands/intuned-cli/helpers/__test__/tracing.test.js +0 -40
  128. package/package/dist/commands/intuned-cli/helpers/api.d.ts +0 -3
  129. package/package/dist/commands/intuned-cli/helpers/api.js +0 -19
  130. package/package/dist/commands/intuned-cli/helpers/auth.d.ts +0 -46
  131. package/package/dist/commands/intuned-cli/helpers/auth.js +0 -144
  132. package/package/dist/commands/intuned-cli/helpers/backend.d.ts +0 -8
  133. package/package/dist/commands/intuned-cli/helpers/backend.js +0 -27
  134. package/package/dist/commands/intuned-cli/helpers/browser.d.ts +0 -14
  135. package/package/dist/commands/intuned-cli/helpers/browser.js +0 -57
  136. package/package/dist/commands/intuned-cli/helpers/context.d.ts +0 -3
  137. package/package/dist/commands/intuned-cli/helpers/context.js +0 -33
  138. package/package/dist/commands/intuned-cli/helpers/errors.d.ts +0 -13
  139. package/package/dist/commands/intuned-cli/helpers/errors.js +0 -37
  140. package/package/dist/commands/intuned-cli/helpers/index.d.ts +0 -12
  141. package/package/dist/commands/intuned-cli/helpers/index.js +0 -137
  142. package/package/dist/commands/intuned-cli/helpers/intunedJson.d.ts +0 -69
  143. package/package/dist/commands/intuned-cli/helpers/proxy.d.ts +0 -5
  144. package/package/dist/commands/intuned-cli/helpers/proxy.js +0 -23
  145. package/package/dist/commands/intuned-cli/helpers/terminal.d.ts +0 -5
  146. package/package/dist/commands/intuned-cli/helpers/terminal.js +0 -13
  147. package/package/dist/commands/intuned-cli/helpers/timeout.d.ts +0 -1
  148. package/package/dist/commands/intuned-cli/helpers/timeout.js +0 -23
  149. package/package/dist/commands/intuned-cli/helpers/traces.d.ts +0 -2
  150. package/package/dist/commands/intuned-cli/helpers/traces.js +0 -32
  151. package/package/dist/commands/intuned-cli/helpers/validation.d.ts +0 -2
  152. package/package/dist/commands/intuned-cli/helpers/validation.js +0 -14
  153. package/package/dist/commands/intuned-cli/helpers/wrapper.d.ts +0 -2
  154. package/package/dist/commands/intuned-cli/helpers/wrapper.js +0 -60
  155. package/package/dist/commands/intuned-cli/index.d.ts +0 -1
  156. package/package/dist/commands/intuned-cli/index.js +0 -16
  157. package/package/dist/commands/intuned-cli/main.d.ts +0 -1
  158. package/package/dist/commands/intuned-cli/main.js +0 -22
  159. package/package/dist/commands/intuned-cli/types.d.ts +0 -41
  160. package/package/dist/commands/intuned-cli/types.js +0 -12
  161. package/package/dist/commands/ts-check.d.ts +0 -2
  162. package/package/dist/commands/ts-check.js +0 -56
  163. package/package/dist/common/Logger/Logger/index.d.ts +0 -12
  164. package/package/dist/common/Logger/Logger/index.js +0 -60
  165. package/package/dist/common/Logger/Logger/types.d.ts +0 -8
  166. package/package/dist/common/Logger/Logger/types.js +0 -5
  167. package/package/dist/common/Logger/index.d.ts +0 -12
  168. package/package/dist/common/Logger/index.js +0 -60
  169. package/package/dist/common/Logger/types.d.ts +0 -8
  170. package/package/dist/common/Logger/types.js +0 -5
  171. package/package/dist/common/assets/browser_scripts.js +0 -2580
  172. package/package/dist/common/asyncLocalStorage/index.d.ts +0 -16
  173. package/package/dist/common/asyncLocalStorage/index.js +0 -17
  174. package/package/dist/common/backendFunctions/getAuthSessionParameters.d.ts +0 -1
  175. package/package/dist/common/backendFunctions/getAuthSessionParameters.js +0 -38
  176. package/package/dist/common/cleanEnvironmentVariables.d.ts +0 -1
  177. package/package/dist/common/cleanEnvironmentVariables.js +0 -16
  178. package/package/dist/common/constants.d.ts +0 -10
  179. package/package/dist/common/constants.js +0 -16
  180. package/package/dist/common/contextStorageStateHelpers.d.ts +0 -21
  181. package/package/dist/common/contextStorageStateHelpers.js +0 -81
  182. package/package/dist/common/extensionsHelpers.d.ts +0 -8
  183. package/package/dist/common/extensionsHelpers.js +0 -80
  184. package/package/dist/common/formatZodError.d.ts +0 -2
  185. package/package/dist/common/formatZodError.js +0 -18
  186. package/package/dist/common/jwtTokenManager.d.ts +0 -17
  187. package/package/dist/common/jwtTokenManager.js +0 -109
  188. package/package/dist/common/launchBrowser.d.ts +0 -25
  189. package/package/dist/common/launchBrowser.js +0 -172
  190. package/package/dist/common/playwrightContext.d.ts +0 -31
  191. package/package/dist/common/playwrightContext.js +0 -144
  192. package/package/dist/common/runApi/errors.d.ts +0 -72
  193. package/package/dist/common/runApi/errors.js +0 -169
  194. package/package/dist/common/runApi/importUsingImportFunction.d.ts +0 -9
  195. package/package/dist/common/runApi/importUsingImportFunction.js +0 -46
  196. package/package/dist/common/runApi/index.d.ts +0 -11
  197. package/package/dist/common/runApi/index.js +0 -199
  198. package/package/dist/common/runApi/types.d.ts +0 -830
  199. package/package/dist/common/runApi/types.js +0 -73
  200. package/package/dist/common/settingsSchema.d.ts +0 -518
  201. package/package/dist/common/settingsSchema.js +0 -57
  202. package/package/dist/common/setupContextHook.d.ts +0 -17
  203. package/package/dist/common/setupContextHook.js +0 -22
  204. package/package/dist/common/telemetry.d.ts +0 -3
  205. package/package/dist/common/telemetry.js +0 -32
  206. package/package/dist/index.d.ts +0 -4
  207. package/package/dist/index.js +0 -69
  208. package/package/dist/runtime/RunError.d.ts +0 -5
  209. package/package/dist/runtime/RunError.js +0 -19
  210. package/package/dist/runtime/attemptStore.d.ts +0 -2
  211. package/package/dist/runtime/attemptStore.js +0 -23
  212. package/package/dist/runtime/downloadDirectory.d.ts +0 -1
  213. package/package/dist/runtime/downloadDirectory.js +0 -19
  214. package/package/dist/runtime/enums.d.js +0 -5
  215. package/package/dist/runtime/enums.d.ts +0 -11
  216. package/package/dist/runtime/enums.js +0 -18
  217. package/package/dist/runtime/executionHelpers.test.js +0 -52
  218. package/package/dist/runtime/export.d.js +0 -5
  219. package/package/dist/runtime/export.d.ts +0 -228
  220. package/package/dist/runtime/extendPayload.d.ts +0 -2
  221. package/package/dist/runtime/extendPayload.js +0 -21
  222. package/package/dist/runtime/extendTimeout.d.ts +0 -1
  223. package/package/dist/runtime/extendTimeout.js +0 -23
  224. package/package/dist/runtime/getAuthSessionParameters.d.ts +0 -1
  225. package/package/dist/runtime/getAuthSessionParameters.js +0 -20
  226. package/package/dist/runtime/index.d.ts +0 -7
  227. package/package/dist/runtime/index.js +0 -54
  228. package/package/dist/runtime/runInfo.d.ts +0 -2
  229. package/package/dist/runtime/runInfo.js +0 -21
  230. /package/{package/dist/commands/build.d.ts → dist/commands/get-headless-user-agent.d.ts} +0 -0
@@ -3,69 +3,18 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getIntunedSettingsFile = getIntunedSettingsFile;
7
- exports.getIntunedSettingsFileName = getIntunedSettingsFileName;
8
- exports.intunedSettingsFileNames = exports.intunedJsonSchema = void 0;
9
- exports.loadIntunedJson = loadIntunedJson;
10
- var _path = _interopRequireDefault(require("path"));
11
- var fs = _interopRequireWildcard(require("fs-extra"));
12
- var _zod = require("zod");
6
+ exports.loadIntunedJson = exports.getIntunedSettingsFileName = exports.getIntunedSettingsFile = void 0;
13
7
  var _errors = require("./errors");
14
- var JSONC = _interopRequireWildcard(require("jsonc-parser"));
15
- var YAML = _interopRequireWildcard(require("yaml"));
16
- var TOML = _interopRequireWildcard(require("smol-toml"));
17
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
- const intunedJsonSchema = exports.intunedJsonSchema = _zod.z.object({
21
- authSessions: _zod.z.union([_zod.z.object({
22
- enabled: _zod.z.literal(false)
23
- }), _zod.z.object({
24
- enabled: _zod.z.literal(true),
25
- type: _zod.z.enum(["MANUAL", "API"]),
26
- startUrl: _zod.z.string().optional(),
27
- finishUrl: _zod.z.string().optional()
28
- })]),
29
- projectName: _zod.z.string().optional(),
30
- workspaceId: _zod.z.string().optional()
31
- });
32
- const intunedSettingsFileNames = exports.intunedSettingsFileNames = ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
33
- async function loadIntunedJson() {
34
- const settingsFile = await getIntunedSettingsFile();
35
- const intunedJsonContent = await fs.readFile(settingsFile.path, "utf-8");
36
- let intunedJson;
37
- try {
38
- intunedJson = settingsFile.parse(intunedJsonContent);
39
- } catch (e) {
40
- throw new _errors.CLIError(`Failed to parse ${settingsFile.name}: ${e.message}`);
41
- }
42
- const parseResult = intunedJsonSchema.safeParse(intunedJson);
43
- if (!parseResult.success) {
44
- const formattedError = parseResult.error.errors.map(e => `- ${e.path.join(".")}: ${e.message}`).join("\n");
45
- throw new _errors.CLIError(`${settingsFile.name} is not valid:\n${formattedError}\nPlease fix the errors and try again.`);
46
- }
47
- return parseResult.data;
48
- }
49
- const intunedSettingsParsers = {
50
- "Intuned.json": JSON.parse,
51
- "Intuned.jsonc": JSONC.parse,
52
- "Intuned.yaml": YAML.parse,
53
- "Intuned.yml": YAML.parse,
54
- "Intuned.toml": TOML.parse
55
- };
56
- async function getIntunedSettingsFile() {
57
- for (const fileName of intunedSettingsFileNames) {
58
- const filePath = _path.default.join(process.cwd(), fileName);
59
- if (await fs.exists(filePath)) {
60
- return {
61
- name: fileName,
62
- path: filePath,
63
- parse: intunedSettingsParsers[fileName]
64
- };
8
+ var _intunedJson = require("../../../common/intunedJson");
9
+ function unwrapped(fn) {
10
+ return async (...args) => {
11
+ const result = await fn(...args);
12
+ if (result.isErr()) {
13
+ throw new _errors.CLIError(result.error);
65
14
  }
66
- }
67
- throw new _errors.CLIError(`No Intuned settings file found.`);
15
+ return result.value;
16
+ };
68
17
  }
69
- async function getIntunedSettingsFileName() {
70
- return (await getIntunedSettingsFile()).name;
71
- }
18
+ const loadIntunedJson = exports.loadIntunedJson = unwrapped(_intunedJson.loadIntunedJson);
19
+ const getIntunedSettingsFile = exports.getIntunedSettingsFile = unwrapped(_intunedJson.getIntunedSettingsFile);
20
+ const getIntunedSettingsFileName = exports.getIntunedSettingsFileName = unwrapped(_intunedJson.getIntunedSettingsFileName);
@@ -34,6 +34,11 @@ function cliCommandWrapper(argsSchema, optionsSchema, fn) {
34
34
  await (0, _browser.closeCliBrowser)();
35
35
  process.exit(0);
36
36
  } catch (error) {
37
+ if (error instanceof _errors.AbortedCLIError) {
38
+ (0, _terminal.terminal)(`\n^r^+Aborted.^:\n`);
39
+ await (0, _browser.closeCliBrowser)();
40
+ process.exit(1);
41
+ }
37
42
  if (error instanceof _errors.CLIError) {
38
43
  if (error.autoColor) {
39
44
  (0, _terminal.terminal)(`^r^+${error.message}^:\n`);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  var _dotenv = _interopRequireDefault(require("dotenv"));
4
- var fs = _interopRequireWildcard(require("fs"));
5
4
  var path = _interopRequireWildcard(require("path"));
5
+ var _intunedJson = require("./intunedJson");
6
6
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
7
7
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
8
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -11,10 +11,13 @@ _dotenv.default.config({
11
11
  });
12
12
  function isStealthModeEnabled() {
13
13
  try {
14
- const intunedConfigPath = path.resolve(process.cwd(), process.env.ROOT || "./", "Intuned.json");
15
- const configContent = fs.readFileSync(intunedConfigPath, "utf8");
16
- const config = JSON.parse(configContent);
17
- return config.stealthMode?.enabled === true;
14
+ const settingsResult = (0, _intunedJson.loadIntunedJsonSync)();
15
+ if (settingsResult.isErr()) {
16
+ console.error(`Warning: Failed to load Intuned settings: ${settingsResult.error}
17
+ Stealth mode will not be enabled.`);
18
+ return false;
19
+ }
20
+ return settingsResult.value.stealthMode?.enabled === true;
18
21
  } catch (error) {
19
22
  console.error("Error reading Intuned.json:", error.message);
20
23
  return false;
@@ -0,0 +1,229 @@
1
+ import { z } from "zod";
2
+ import { type Err, type Ok } from "neverthrow";
3
+ export declare const intunedJsonSchema: z.ZodIntersection<z.ZodObject<{
4
+ projectName: z.ZodOptional<z.ZodString>;
5
+ workspaceId: z.ZodOptional<z.ZodString>;
6
+ metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
7
+ defaultJobInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
8
+ defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
9
+ testAuthSessionInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ defaultJobInput?: Record<string, any> | undefined;
12
+ defaultRunPlaygroundInput?: Record<string, any> | undefined;
13
+ testAuthSessionInput?: Record<string, any> | undefined;
14
+ }, {
15
+ defaultJobInput?: unknown;
16
+ defaultRunPlaygroundInput?: unknown;
17
+ testAuthSessionInput?: unknown;
18
+ }>>>;
19
+ stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
20
+ enabled: z.ZodBoolean;
21
+ }, "strip", z.ZodTypeAny, {
22
+ enabled: boolean;
23
+ }, {
24
+ enabled: boolean;
25
+ }>>>;
26
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
27
+ projectName: z.ZodOptional<z.ZodString>;
28
+ workspaceId: z.ZodOptional<z.ZodString>;
29
+ metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
30
+ defaultJobInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
31
+ defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
32
+ testAuthSessionInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ defaultJobInput?: Record<string, any> | undefined;
35
+ defaultRunPlaygroundInput?: Record<string, any> | undefined;
36
+ testAuthSessionInput?: Record<string, any> | undefined;
37
+ }, {
38
+ defaultJobInput?: unknown;
39
+ defaultRunPlaygroundInput?: unknown;
40
+ testAuthSessionInput?: unknown;
41
+ }>>>;
42
+ stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
43
+ enabled: z.ZodBoolean;
44
+ }, "strip", z.ZodTypeAny, {
45
+ enabled: boolean;
46
+ }, {
47
+ enabled: boolean;
48
+ }>>>;
49
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
50
+ projectName: z.ZodOptional<z.ZodString>;
51
+ workspaceId: z.ZodOptional<z.ZodString>;
52
+ metadata: z.ZodCatch<z.ZodOptional<z.ZodObject<{
53
+ defaultJobInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
54
+ defaultRunPlaygroundInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
55
+ testAuthSessionInput: z.ZodCatch<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ defaultJobInput?: Record<string, any> | undefined;
58
+ defaultRunPlaygroundInput?: Record<string, any> | undefined;
59
+ testAuthSessionInput?: Record<string, any> | undefined;
60
+ }, {
61
+ defaultJobInput?: unknown;
62
+ defaultRunPlaygroundInput?: unknown;
63
+ testAuthSessionInput?: unknown;
64
+ }>>>;
65
+ stealthMode: z.ZodCatch<z.ZodOptional<z.ZodObject<{
66
+ enabled: z.ZodBoolean;
67
+ }, "strip", z.ZodTypeAny, {
68
+ enabled: boolean;
69
+ }, {
70
+ enabled: boolean;
71
+ }>>>;
72
+ }, z.ZodTypeAny, "passthrough">>, z.ZodUnion<[z.ZodObject<{
73
+ authSessions: z.ZodObject<{
74
+ enabled: z.ZodLiteral<false>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ enabled: false;
77
+ }, {
78
+ enabled: false;
79
+ }>;
80
+ apiAccess: z.ZodObject<{
81
+ enabled: z.ZodLiteral<false>;
82
+ }, "strip", z.ZodTypeAny, {
83
+ enabled: false;
84
+ }, {
85
+ enabled: false;
86
+ }>;
87
+ }, "strip", z.ZodTypeAny, {
88
+ authSessions: {
89
+ enabled: false;
90
+ };
91
+ apiAccess: {
92
+ enabled: false;
93
+ };
94
+ }, {
95
+ authSessions: {
96
+ enabled: false;
97
+ };
98
+ apiAccess: {
99
+ enabled: false;
100
+ };
101
+ }>, z.ZodObject<{
102
+ authSessions: z.ZodUnion<[z.ZodObject<{
103
+ enabled: z.ZodLiteral<false>;
104
+ }, "strip", z.ZodTypeAny, {
105
+ enabled: false;
106
+ }, {
107
+ enabled: false;
108
+ }>, z.ZodObject<{
109
+ enabled: z.ZodLiteral<true>;
110
+ type: z.ZodEnum<["MANUAL", "API"]>;
111
+ startUrl: z.ZodOptional<z.ZodString>;
112
+ finishUrl: z.ZodOptional<z.ZodString>;
113
+ }, "strip", z.ZodTypeAny, {
114
+ type: "API" | "MANUAL";
115
+ enabled: true;
116
+ startUrl?: string | undefined;
117
+ finishUrl?: string | undefined;
118
+ }, {
119
+ type: "API" | "MANUAL";
120
+ enabled: true;
121
+ startUrl?: string | undefined;
122
+ finishUrl?: string | undefined;
123
+ }>]>;
124
+ apiAccess: z.ZodObject<{
125
+ enabled: z.ZodLiteral<true>;
126
+ }, "strip", z.ZodTypeAny, {
127
+ enabled: true;
128
+ }, {
129
+ enabled: true;
130
+ }>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ authSessions: {
133
+ enabled: false;
134
+ } | {
135
+ type: "API" | "MANUAL";
136
+ enabled: true;
137
+ startUrl?: string | undefined;
138
+ finishUrl?: string | undefined;
139
+ };
140
+ apiAccess: {
141
+ enabled: true;
142
+ };
143
+ }, {
144
+ authSessions: {
145
+ enabled: false;
146
+ } | {
147
+ type: "API" | "MANUAL";
148
+ enabled: true;
149
+ startUrl?: string | undefined;
150
+ finishUrl?: string | undefined;
151
+ };
152
+ apiAccess: {
153
+ enabled: true;
154
+ };
155
+ }>]>>;
156
+ export type IntunedJson = z.infer<typeof intunedJsonSchema>;
157
+ export declare const intunedSettingsFileNames: readonly ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
158
+ export declare function loadIntunedJson(): Promise<Err<never, string> | Ok<{
159
+ projectName?: string | undefined;
160
+ workspaceId?: string | undefined;
161
+ metadata?: {
162
+ defaultJobInput?: Record<string, any> | undefined;
163
+ defaultRunPlaygroundInput?: Record<string, any> | undefined;
164
+ testAuthSessionInput?: Record<string, any> | undefined;
165
+ } | undefined;
166
+ stealthMode?: {
167
+ enabled: boolean;
168
+ } | undefined;
169
+ } & {
170
+ [k: string]: unknown;
171
+ } & ({
172
+ authSessions: {
173
+ enabled: false;
174
+ };
175
+ apiAccess: {
176
+ enabled: false;
177
+ };
178
+ } | {
179
+ authSessions: {
180
+ enabled: false;
181
+ } | {
182
+ type: "API" | "MANUAL";
183
+ enabled: true;
184
+ startUrl?: string | undefined;
185
+ finishUrl?: string | undefined;
186
+ };
187
+ apiAccess: {
188
+ enabled: true;
189
+ };
190
+ }), never>>;
191
+ export declare function getIntunedSettingsFile(): Promise<Ok<{
192
+ name: typeof intunedSettingsFileNames[number];
193
+ path: string;
194
+ parse: (content: string) => any;
195
+ }, never> | Err<never, string>>;
196
+ export declare function getIntunedSettingsFileName(): Promise<Err<never, string> | Ok<"Intuned.json" | "Intuned.jsonc" | "Intuned.yaml" | "Intuned.yml" | "Intuned.toml", never>>;
197
+ export declare function loadIntunedJsonSync(): Err<never, string> | Ok<{
198
+ projectName?: string | undefined;
199
+ workspaceId?: string | undefined;
200
+ metadata?: {
201
+ defaultJobInput?: Record<string, any> | undefined;
202
+ defaultRunPlaygroundInput?: Record<string, any> | undefined;
203
+ testAuthSessionInput?: Record<string, any> | undefined;
204
+ } | undefined;
205
+ stealthMode?: {
206
+ enabled: boolean;
207
+ } | undefined;
208
+ } & {
209
+ [k: string]: unknown;
210
+ } & ({
211
+ authSessions: {
212
+ enabled: false;
213
+ };
214
+ apiAccess: {
215
+ enabled: false;
216
+ };
217
+ } | {
218
+ authSessions: {
219
+ enabled: false;
220
+ } | {
221
+ type: "API" | "MANUAL";
222
+ enabled: true;
223
+ startUrl?: string | undefined;
224
+ finishUrl?: string | undefined;
225
+ };
226
+ apiAccess: {
227
+ enabled: true;
228
+ };
229
+ }), never>;
@@ -7,17 +7,37 @@ exports.getIntunedSettingsFile = getIntunedSettingsFile;
7
7
  exports.getIntunedSettingsFileName = getIntunedSettingsFileName;
8
8
  exports.intunedSettingsFileNames = exports.intunedJsonSchema = void 0;
9
9
  exports.loadIntunedJson = loadIntunedJson;
10
+ exports.loadIntunedJsonSync = loadIntunedJsonSync;
10
11
  var _path = _interopRequireDefault(require("path"));
11
12
  var fs = _interopRequireWildcard(require("fs-extra"));
12
13
  var _zod = require("zod");
13
- var _errors = require("./errors");
14
14
  var JSONC = _interopRequireWildcard(require("jsonc-parser"));
15
15
  var YAML = _interopRequireWildcard(require("yaml"));
16
16
  var TOML = _interopRequireWildcard(require("smol-toml"));
17
+ var _neverthrow = require("neverthrow");
17
18
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
19
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
20
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
+ const playwright = undefined;
20
22
  const intunedJsonSchema = exports.intunedJsonSchema = _zod.z.object({
23
+ projectName: _zod.z.string().optional(),
24
+ workspaceId: _zod.z.string().optional(),
25
+ metadata: _zod.z.object({
26
+ defaultJobInput: _zod.z.record(_zod.z.any()).optional().catch(undefined),
27
+ defaultRunPlaygroundInput: _zod.z.record(_zod.z.any()).optional().catch(undefined),
28
+ testAuthSessionInput: _zod.z.record(_zod.z.any()).optional().catch(undefined)
29
+ }).optional().catch(undefined),
30
+ stealthMode: _zod.z.object({
31
+ enabled: _zod.z.boolean()
32
+ }).optional().catch(undefined)
33
+ }).passthrough().and(_zod.z.union([_zod.z.object({
34
+ authSessions: _zod.z.object({
35
+ enabled: _zod.z.literal(false)
36
+ }),
37
+ apiAccess: _zod.z.object({
38
+ enabled: _zod.z.literal(false)
39
+ })
40
+ }), _zod.z.object({
21
41
  authSessions: _zod.z.union([_zod.z.object({
22
42
  enabled: _zod.z.literal(false)
23
43
  }), _zod.z.object({
@@ -26,25 +46,30 @@ const intunedJsonSchema = exports.intunedJsonSchema = _zod.z.object({
26
46
  startUrl: _zod.z.string().optional(),
27
47
  finishUrl: _zod.z.string().optional()
28
48
  })]),
29
- projectName: _zod.z.string().optional(),
30
- workspaceId: _zod.z.string().optional()
31
- });
49
+ apiAccess: _zod.z.object({
50
+ enabled: _zod.z.literal(true)
51
+ })
52
+ })]));
32
53
  const intunedSettingsFileNames = exports.intunedSettingsFileNames = ["Intuned.json", "Intuned.jsonc", "Intuned.yaml", "Intuned.yml", "Intuned.toml"];
33
54
  async function loadIntunedJson() {
34
- const settingsFile = await getIntunedSettingsFile();
55
+ const settingsFileResult = await getIntunedSettingsFile();
56
+ if (!settingsFileResult.isOk()) {
57
+ return settingsFileResult;
58
+ }
59
+ const settingsFile = settingsFileResult.value;
35
60
  const intunedJsonContent = await fs.readFile(settingsFile.path, "utf-8");
36
61
  let intunedJson;
37
62
  try {
38
63
  intunedJson = settingsFile.parse(intunedJsonContent);
39
64
  } catch (e) {
40
- throw new _errors.CLIError(`Failed to parse ${settingsFile.name}: ${e.message}`);
65
+ return (0, _neverthrow.err)(`Failed to parse ${settingsFile.name}: ${e.message}`);
41
66
  }
42
67
  const parseResult = intunedJsonSchema.safeParse(intunedJson);
43
68
  if (!parseResult.success) {
44
69
  const formattedError = parseResult.error.errors.map(e => `- ${e.path.join(".")}: ${e.message}`).join("\n");
45
- throw new _errors.CLIError(`${settingsFile.name} is not valid:\n${formattedError}\nPlease fix the errors and try again.`);
70
+ return (0, _neverthrow.err)(`${settingsFile.name} is not valid:\n${formattedError}\nPlease fix the errors and try again.`);
46
71
  }
47
- return parseResult.data;
72
+ return (0, _neverthrow.ok)(parseResult.data);
48
73
  }
49
74
  const intunedSettingsParsers = {
50
75
  "Intuned.json": JSON.parse,
@@ -57,15 +82,52 @@ async function getIntunedSettingsFile() {
57
82
  for (const fileName of intunedSettingsFileNames) {
58
83
  const filePath = _path.default.join(process.cwd(), fileName);
59
84
  if (await fs.exists(filePath)) {
60
- return {
85
+ return (0, _neverthrow.ok)({
61
86
  name: fileName,
62
87
  path: filePath,
63
88
  parse: intunedSettingsParsers[fileName]
64
- };
89
+ });
65
90
  }
66
91
  }
67
- throw new _errors.CLIError(`No Intuned settings file found.`);
92
+ return (0, _neverthrow.err)("No Intuned settings file found.");
68
93
  }
69
94
  async function getIntunedSettingsFileName() {
70
- return (await getIntunedSettingsFile()).name;
95
+ const settingsFileResult = await getIntunedSettingsFile();
96
+ if (!settingsFileResult.isOk()) {
97
+ return settingsFileResult;
98
+ }
99
+ return (0, _neverthrow.ok)(settingsFileResult.value.name);
100
+ }
101
+ function loadIntunedJsonSync() {
102
+ const settingsFileResult = getIntunedSettingsFileSync();
103
+ if (!settingsFileResult.isOk()) {
104
+ return settingsFileResult;
105
+ }
106
+ const settingsFile = settingsFileResult.value;
107
+ const intunedJsonContent = fs.readFileSync(settingsFile.path, "utf-8");
108
+ let intunedJson;
109
+ try {
110
+ intunedJson = settingsFile.parse(intunedJsonContent);
111
+ } catch (e) {
112
+ return (0, _neverthrow.err)(`Failed to parse ${settingsFile.name}: ${e.message}`);
113
+ }
114
+ const parseResult = intunedJsonSchema.safeParse(intunedJson);
115
+ if (!parseResult.success) {
116
+ const formattedError = parseResult.error.errors.map(e => `- ${e.path.join(".")}: ${e.message}`).join("\n");
117
+ return (0, _neverthrow.err)(`${settingsFile.name} is not valid:\n${formattedError}\nPlease fix the errors and try again.`);
118
+ }
119
+ return (0, _neverthrow.ok)(parseResult.data);
120
+ }
121
+ function getIntunedSettingsFileSync() {
122
+ for (const fileName of intunedSettingsFileNames) {
123
+ const filePath = _path.default.join(process.cwd(), fileName);
124
+ if (fs.existsSync(filePath)) {
125
+ return (0, _neverthrow.ok)({
126
+ name: fileName,
127
+ path: filePath,
128
+ parse: intunedSettingsParsers[fileName]
129
+ });
130
+ }
131
+ }
132
+ return (0, _neverthrow.err)("No Intuned settings file found.");
71
133
  }
@@ -21,5 +21,11 @@ export type LaunchChromiumCdpOptions = {
21
21
  };
22
22
  export declare function launchChromium(options: LaunchChromiumStandaloneOptions): Promise<LaunchBrowserResult>;
23
23
  export declare function launchChromium(options: LaunchChromiumCdpOptions): Promise<LaunchBrowserResult>;
24
+ export declare function getBrowserExecutablePath(): Promise<string | undefined>;
24
25
  export declare function launchBrowser(options: Omit<LaunchChromiumStandaloneOptions, "executablePath"> | LaunchChromiumCdpOptions): Promise<LaunchBrowserResult>;
25
26
  export declare function getLocalCdpAddress(port: number): string;
27
+ export declare function getHeadlessUserAgent({ executablePath, args, ignoreDefaultArgs, }: {
28
+ executablePath?: string;
29
+ args?: string[];
30
+ ignoreDefaultArgs?: string[];
31
+ }): Promise<string | undefined>;
@@ -3,6 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.getBrowserExecutablePath = getBrowserExecutablePath;
7
+ exports.getHeadlessUserAgent = getHeadlessUserAgent;
6
8
  exports.getLocalCdpAddress = getLocalCdpAddress;
7
9
  exports.launchBrowser = launchBrowser;
8
10
  exports.launchChromium = launchChromium;
@@ -86,10 +88,15 @@ async function launchChromium(options) {
86
88
  executablePath = undefined;
87
89
  }
88
90
  }
91
+ const viewport = null;
92
+ const userAgent = process.env.__PLAYWRIGHT_USER_AGENT_OVERRIDE ?? (await getHeadlessUserAgent({
93
+ executablePath
94
+ }));
89
95
  const context = await playwright.chromium.launchPersistentContext(userDataDir, {
96
+ userAgent,
90
97
  executablePath,
91
98
  headless,
92
- viewport: null,
99
+ viewport,
93
100
  proxy,
94
101
  downloadsPath,
95
102
  args: extraArgs,
@@ -120,25 +127,20 @@ async function launchChromium(options) {
120
127
  context
121
128
  };
122
129
  }
130
+ async function getBrowserExecutablePath() {
131
+ const browserType = getBrowserType();
132
+ if (browserType === "brave") {
133
+ return await getBraveExecutablePath();
134
+ }
135
+ }
123
136
  async function launchBrowser(options) {
124
137
  if ("cdpAddress" in options) {
125
138
  return launchChromium(options);
126
139
  }
127
- const browserType = getBrowserType();
128
- switch (browserType) {
129
- case "chromium":
130
- {
131
- return launchChromium(options);
132
- }
133
- case "brave":
134
- {
135
- const braveExecutablePath = await getBraveExecutablePath();
136
- return launchChromium({
137
- ...options,
138
- executablePath: braveExecutablePath
139
- });
140
- }
141
- }
140
+ return launchChromium({
141
+ ...options,
142
+ executablePath: await getBrowserExecutablePath()
143
+ });
142
144
  }
143
145
  function getBrowserType() {
144
146
  if (process.env.BROWSER_TYPE === "brave") {
@@ -169,4 +171,25 @@ async function waitOnCdpAddress(cdpAddress) {
169
171
  tcpTimeout: 1000,
170
172
  window: 1000
171
173
  });
174
+ }
175
+ async function getHeadlessUserAgent({
176
+ executablePath,
177
+ args,
178
+ ignoreDefaultArgs
179
+ }) {
180
+ const browser = await playwright.chromium.launch({
181
+ headless: true,
182
+ executablePath,
183
+ args,
184
+ ignoreDefaultArgs
185
+ });
186
+ const context = await browser.newContext();
187
+ const page = await context.newPage();
188
+ let userAgent = await page.evaluate(() => navigator.userAgent);
189
+ await browser.close();
190
+ if (!userAgent || typeof userAgent !== "string") {
191
+ return undefined;
192
+ }
193
+ userAgent = userAgent.replace("HeadlessChrome", "Chrome");
194
+ return userAgent;
172
195
  }
@@ -100,6 +100,7 @@ async function runApi({
100
100
  apiParameters: params,
101
101
  importFunction
102
102
  };
103
+ const intunedContext = (0, _asyncLocalStorage.getExecutionContext)();
103
104
  const runAutomationWithContext = async (context, page) => {
104
105
  async function saveTraceIfNeeded({
105
106
  errorMessage
@@ -148,7 +149,7 @@ async function runApi({
148
149
  }
149
150
  return (0, _neverthrow.ok)({
150
151
  result: automationFunctionResult,
151
- extendedPayloads: (0, _asyncLocalStorage.getExecutionContext)()?.extendedPayloads,
152
+ extendedPayloads: intunedContext?.extendedPayloads,
152
153
  session: retrieveSession ? await (0, _contextStorageStateHelpers.getStorageState)(context) : undefined
153
154
  });
154
155
  } catch (error) {
@@ -159,6 +160,9 @@ async function runApi({
159
160
  });
160
161
  }
161
162
  };
163
+ if (intunedContext?.store) {
164
+ intunedContext.store = {};
165
+ }
162
166
  if (runOptions.environment === "standalone") {
163
167
  const downloadsPath = (0, _downloadDirectory.getDownloadDirectoryPath)();
164
168
  try {