@steipete/oracle 0.8.6 → 0.10.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 (181) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +130 -45
  3. package/dist/bin/oracle-cli.js +613 -379
  4. package/dist/bin/oracle-mcp.js +2 -2
  5. package/dist/bin/oracle.js +165 -279
  6. package/dist/scripts/agent-send.js +31 -31
  7. package/dist/scripts/check.js +6 -6
  8. package/dist/scripts/debug/extract-chatgpt-response.js +10 -10
  9. package/dist/scripts/docs-list.js +30 -30
  10. package/dist/scripts/git-policy.js +25 -23
  11. package/dist/scripts/run-cli.js +8 -8
  12. package/dist/scripts/runner.js +203 -195
  13. package/dist/scripts/test-browser.js +21 -18
  14. package/dist/scripts/test-remote-chrome.js +20 -20
  15. package/dist/src/bridge/connection.js +18 -18
  16. package/dist/src/bridge/userConfigFile.js +7 -7
  17. package/dist/src/browser/actions/assistantResponse.js +149 -101
  18. package/dist/src/browser/actions/attachmentDataTransfer.js +49 -47
  19. package/dist/src/browser/actions/attachments.js +246 -150
  20. package/dist/src/browser/actions/domEvents.js +2 -2
  21. package/dist/src/browser/actions/modelSelection.js +314 -104
  22. package/dist/src/browser/actions/navigation.js +161 -136
  23. package/dist/src/browser/actions/promptComposer.js +100 -64
  24. package/dist/src/browser/actions/remoteFileTransfer.js +10 -10
  25. package/dist/src/browser/actions/thinkingTime.js +207 -110
  26. package/dist/src/browser/chromeLifecycle.js +62 -60
  27. package/dist/src/browser/config.js +34 -15
  28. package/dist/src/browser/constants.js +17 -12
  29. package/dist/src/browser/cookies.js +19 -19
  30. package/dist/src/browser/detect.js +62 -62
  31. package/dist/src/browser/domDebug.js +1 -1
  32. package/dist/src/browser/index.js +452 -303
  33. package/dist/src/browser/modelStrategy.js +1 -1
  34. package/dist/src/browser/pageActions.js +5 -5
  35. package/dist/src/browser/policies.js +16 -13
  36. package/dist/src/browser/profileState.js +44 -39
  37. package/dist/src/browser/prompt.js +72 -42
  38. package/dist/src/browser/promptSummary.js +5 -5
  39. package/dist/src/browser/providerDomFlow.js +17 -0
  40. package/dist/src/browser/providers/chatgptDomProvider.js +49 -0
  41. package/dist/src/browser/providers/geminiDeepThinkDomProvider.js +254 -0
  42. package/dist/src/browser/providers/index.js +2 -0
  43. package/dist/src/browser/reattach.js +67 -34
  44. package/dist/src/browser/reattachHelpers.js +31 -26
  45. package/dist/src/browser/sessionRunner.js +37 -25
  46. package/dist/src/browser/utils.js +9 -9
  47. package/dist/src/browserMode.js +1 -1
  48. package/dist/src/cli/bridge/claudeConfig.js +16 -16
  49. package/dist/src/cli/bridge/client.js +28 -20
  50. package/dist/src/cli/bridge/codexConfig.js +16 -16
  51. package/dist/src/cli/bridge/doctor.js +47 -39
  52. package/dist/src/cli/bridge/host.js +58 -56
  53. package/dist/src/cli/browserConfig.js +65 -45
  54. package/dist/src/cli/browserDefaults.js +27 -26
  55. package/dist/src/cli/bundleWarnings.js +1 -1
  56. package/dist/src/cli/clipboard.js +11 -2
  57. package/dist/src/cli/detach.js +7 -4
  58. package/dist/src/cli/dryRun.js +29 -25
  59. package/dist/src/cli/duplicatePromptGuard.js +3 -3
  60. package/dist/src/cli/engine.js +9 -9
  61. package/dist/src/cli/errorUtils.js +1 -1
  62. package/dist/src/cli/fileSize.js +11 -0
  63. package/dist/src/cli/format.js +2 -2
  64. package/dist/src/cli/help.js +28 -28
  65. package/dist/src/cli/hiddenAliases.js +3 -3
  66. package/dist/src/cli/markdownBundle.js +12 -8
  67. package/dist/src/cli/markdownRenderer.js +15 -15
  68. package/dist/src/cli/notifier.js +77 -67
  69. package/dist/src/cli/options.js +145 -87
  70. package/dist/src/cli/oscUtils.js +1 -1
  71. package/dist/src/cli/promptRequirement.js +2 -2
  72. package/dist/src/cli/renderOutput.js +1 -1
  73. package/dist/src/cli/rootAlias.js +1 -1
  74. package/dist/src/cli/runOptions.js +37 -25
  75. package/dist/src/cli/sessionCommand.js +31 -21
  76. package/dist/src/cli/sessionDisplay.js +182 -79
  77. package/dist/src/cli/sessionLineage.js +60 -0
  78. package/dist/src/cli/sessionRunner.js +118 -90
  79. package/dist/src/cli/sessionTable.js +28 -24
  80. package/dist/src/cli/stdin.js +22 -0
  81. package/dist/src/cli/tagline.js +121 -124
  82. package/dist/src/cli/tui/index.js +140 -127
  83. package/dist/src/cli/writeOutputPath.js +5 -5
  84. package/dist/src/config.js +7 -7
  85. package/dist/src/gemini-web/browserSessionManager.js +80 -0
  86. package/dist/src/gemini-web/client.js +81 -64
  87. package/dist/src/gemini-web/executionMode.js +16 -0
  88. package/dist/src/gemini-web/executor.js +327 -169
  89. package/dist/src/gemini-web/index.js +1 -1
  90. package/dist/src/mcp/server.js +16 -12
  91. package/dist/src/mcp/tools/consult.js +81 -64
  92. package/dist/src/mcp/tools/sessionResources.js +12 -12
  93. package/dist/src/mcp/tools/sessions.js +26 -17
  94. package/dist/src/mcp/types.js +5 -5
  95. package/dist/src/mcp/utils.js +15 -7
  96. package/dist/src/oracle/background.js +15 -15
  97. package/dist/src/oracle/claude.js +53 -25
  98. package/dist/src/oracle/client.js +84 -46
  99. package/dist/src/oracle/config.js +124 -58
  100. package/dist/src/oracle/errors.js +38 -38
  101. package/dist/src/oracle/files.js +69 -45
  102. package/dist/src/oracle/finishLine.js +10 -8
  103. package/dist/src/oracle/format.js +3 -3
  104. package/dist/src/oracle/gemini.js +37 -30
  105. package/dist/src/oracle/logging.js +7 -7
  106. package/dist/src/oracle/markdown.js +28 -28
  107. package/dist/src/oracle/modelResolver.js +16 -16
  108. package/dist/src/oracle/multiModelRunner.js +12 -12
  109. package/dist/src/oracle/oscProgress.js +8 -8
  110. package/dist/src/oracle/promptAssembly.js +6 -3
  111. package/dist/src/oracle/request.js +23 -15
  112. package/dist/src/oracle/run.js +172 -140
  113. package/dist/src/oracle/runUtils.js +8 -5
  114. package/dist/src/oracle/tokenEstimate.js +6 -6
  115. package/dist/src/oracle/tokenStats.js +5 -5
  116. package/dist/src/oracle/tokenStringifier.js +5 -5
  117. package/dist/src/oracle.js +12 -12
  118. package/dist/src/oracleHome.js +3 -3
  119. package/dist/src/remote/client.js +25 -25
  120. package/dist/src/remote/health.js +20 -20
  121. package/dist/src/remote/remoteServiceConfig.js +9 -9
  122. package/dist/src/remote/server.js +129 -118
  123. package/dist/src/sessionManager.js +81 -75
  124. package/dist/src/sessionStore.js +3 -3
  125. package/dist/src/version.js +10 -10
  126. package/dist/vendor/oracle-notifier/OracleNotifier.app/Contents/CodeResources +0 -0
  127. package/dist/vendor/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier +0 -0
  128. package/dist/vendor/oracle-notifier/README.md +2 -0
  129. package/package.json +69 -65
  130. package/vendor/oracle-notifier/OracleNotifier.app/Contents/CodeResources +0 -0
  131. package/vendor/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier +0 -0
  132. package/vendor/oracle-notifier/README.md +2 -0
  133. package/dist/markdansi/types/index.js +0 -4
  134. package/dist/oracle/bin/oracle-cli.js +0 -472
  135. package/dist/oracle/src/browser/actions/assistantResponse.js +0 -471
  136. package/dist/oracle/src/browser/actions/attachments.js +0 -82
  137. package/dist/oracle/src/browser/actions/modelSelection.js +0 -190
  138. package/dist/oracle/src/browser/actions/navigation.js +0 -75
  139. package/dist/oracle/src/browser/actions/promptComposer.js +0 -167
  140. package/dist/oracle/src/browser/chromeLifecycle.js +0 -104
  141. package/dist/oracle/src/browser/config.js +0 -33
  142. package/dist/oracle/src/browser/constants.js +0 -40
  143. package/dist/oracle/src/browser/cookies.js +0 -210
  144. package/dist/oracle/src/browser/domDebug.js +0 -36
  145. package/dist/oracle/src/browser/index.js +0 -331
  146. package/dist/oracle/src/browser/pageActions.js +0 -5
  147. package/dist/oracle/src/browser/prompt.js +0 -88
  148. package/dist/oracle/src/browser/promptSummary.js +0 -20
  149. package/dist/oracle/src/browser/sessionRunner.js +0 -80
  150. package/dist/oracle/src/browser/utils.js +0 -62
  151. package/dist/oracle/src/browserMode.js +0 -1
  152. package/dist/oracle/src/cli/browserConfig.js +0 -44
  153. package/dist/oracle/src/cli/dryRun.js +0 -59
  154. package/dist/oracle/src/cli/engine.js +0 -17
  155. package/dist/oracle/src/cli/errorUtils.js +0 -9
  156. package/dist/oracle/src/cli/help.js +0 -70
  157. package/dist/oracle/src/cli/markdownRenderer.js +0 -15
  158. package/dist/oracle/src/cli/options.js +0 -103
  159. package/dist/oracle/src/cli/promptRequirement.js +0 -14
  160. package/dist/oracle/src/cli/rootAlias.js +0 -30
  161. package/dist/oracle/src/cli/sessionCommand.js +0 -77
  162. package/dist/oracle/src/cli/sessionDisplay.js +0 -270
  163. package/dist/oracle/src/cli/sessionRunner.js +0 -94
  164. package/dist/oracle/src/heartbeat.js +0 -43
  165. package/dist/oracle/src/oracle/client.js +0 -48
  166. package/dist/oracle/src/oracle/config.js +0 -29
  167. package/dist/oracle/src/oracle/errors.js +0 -101
  168. package/dist/oracle/src/oracle/files.js +0 -220
  169. package/dist/oracle/src/oracle/format.js +0 -33
  170. package/dist/oracle/src/oracle/fsAdapter.js +0 -7
  171. package/dist/oracle/src/oracle/oscProgress.js +0 -60
  172. package/dist/oracle/src/oracle/request.js +0 -48
  173. package/dist/oracle/src/oracle/run.js +0 -444
  174. package/dist/oracle/src/oracle/tokenStats.js +0 -39
  175. package/dist/oracle/src/oracle/types.js +0 -1
  176. package/dist/oracle/src/oracle.js +0 -9
  177. package/dist/oracle/src/sessionManager.js +0 -205
  178. package/dist/oracle/src/version.js +0 -39
  179. package/dist/scripts/chrome/browser-tools.js +0 -295
  180. package/dist/src/browser/profileSync.js +0 -141
  181. /package/dist/{oracle/src/browser/types.js → src/gemini-web/executionClients.js} +0 -0
@@ -1,13 +1,13 @@
1
- import notifier from 'toasted-notifier';
2
- import { spawn } from 'node:child_process';
3
- import { formatUSD, formatNumber } from '../oracle/format.js';
4
- import { MODEL_CONFIGS } from '../oracle/config.js';
5
- import { estimateUsdCost } from 'tokentally';
6
- import fs from 'node:fs/promises';
7
- import path from 'node:path';
8
- import { createRequire } from 'node:module';
9
- import { fileURLToPath } from 'node:url';
10
- const ORACLE_EMOJI = '🧿';
1
+ import notifier from "toasted-notifier";
2
+ import { spawn } from "node:child_process";
3
+ import { formatUSD, formatNumber } from "../oracle/format.js";
4
+ import { MODEL_CONFIGS } from "../oracle/config.js";
5
+ import { estimateUsdCost } from "tokentally";
6
+ import fs from "node:fs/promises";
7
+ import path from "node:path";
8
+ import { createRequire } from "node:module";
9
+ import { fileURLToPath } from "node:url";
10
+ const ORACLE_EMOJI = "🧿";
11
11
  export function resolveNotificationSettings({ cliNotify, cliNotifySound, env, config, }) {
12
12
  const defaultEnabled = !(bool(env.CI) || bool(env.SSH_CONNECTION) || muteByConfig(env, config));
13
13
  const envNotify = parseToggle(env.ORACLE_NOTIFY);
@@ -20,7 +20,12 @@ export function deriveNotificationSettingsFromMetadata(metadata, env, config) {
20
20
  if (metadata?.notifications) {
21
21
  return metadata.notifications;
22
22
  }
23
- return resolveNotificationSettings({ cliNotify: undefined, cliNotifySound: undefined, env, config });
23
+ return resolveNotificationSettings({
24
+ cliNotify: undefined,
25
+ cliNotifySound: undefined,
26
+ env,
27
+ config,
28
+ });
24
29
  }
25
30
  export async function sendSessionNotification(payload, settings, log, answerPreview) {
26
31
  if (!settings.enabled || isTestEnv(process.env)) {
@@ -47,7 +52,7 @@ export async function sendSessionNotification(payload, settings, log, answerPrev
47
52
  const repaired = await repairMacNotifier(log);
48
53
  if (repaired) {
49
54
  try {
50
- await notifier.notify({ title, message, sound: settings.sound, ...(macAppIconOption()) });
55
+ await notifier.notify({ title, message, sound: settings.sound, ...macAppIconOption() });
51
56
  return;
52
57
  }
53
58
  catch (retryError) {
@@ -66,7 +71,7 @@ export async function sendSessionNotification(payload, settings, log, answerPrev
66
71
  log(`(notify skipped: ${reason})`);
67
72
  }
68
73
  // Last-resort macOS fallback: AppleScript alert (simple, noisy, but works when helpers are blocked).
69
- if (process.platform === 'darwin') {
74
+ if (process.platform === "darwin") {
70
75
  try {
71
76
  await sendOsascriptAlert(title, message, log);
72
77
  return;
@@ -82,7 +87,7 @@ function buildMessage(payload, answerPreview) {
82
87
  const sessionLabel = payload.sessionName || payload.sessionId;
83
88
  parts.push(sessionLabel);
84
89
  // Show cost only for API runs.
85
- if (payload.mode === 'api') {
90
+ if (payload.mode === "api") {
86
91
  const cost = payload.costUsd ?? inferCost(payload);
87
92
  if (cost !== undefined) {
88
93
  // Round to $0.00 for a concise toast.
@@ -95,26 +100,26 @@ function buildMessage(payload, answerPreview) {
95
100
  if (answerPreview) {
96
101
  parts.push(answerPreview);
97
102
  }
98
- return parts.join(' · ');
103
+ return parts.join(" · ");
99
104
  }
100
105
  function sanitizePreview(preview) {
101
106
  if (!preview)
102
107
  return undefined;
103
108
  let text = preview;
104
109
  // Strip code fences and inline code markers.
105
- text = text.replace(/```[\s\S]*?```/g, ' ');
106
- text = text.replace(/`([^`]+)`/g, '$1');
110
+ text = text.replace(/```[\s\S]*?```/g, " ");
111
+ text = text.replace(/`([^`]+)`/g, "$1");
107
112
  // Convert markdown links and images to their visible text.
108
- text = text.replace(/!\[([^\]]*)\]\([^)]+\)/g, '$1');
109
- text = text.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1');
113
+ text = text.replace(/!\[([^\]]*)\]\([^)]+\)/g, "$1");
114
+ text = text.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1");
110
115
  // Drop bold/italic markers.
111
- text = text.replace(/(\*\*|__|\*|_)/g, '');
116
+ text = text.replace(/(\*\*|__|\*|_)/g, "");
112
117
  // Remove headings / list markers / blockquotes.
113
- text = text.replace(/^\s*#+\s*/gm, '');
114
- text = text.replace(/^\s*[-*+]\s+/gm, '');
115
- text = text.replace(/^\s*>\s+/gm, '');
118
+ text = text.replace(/^\s*#+\s*/gm, "");
119
+ text = text.replace(/^\s*[-*+]\s+/gm, "");
120
+ text = text.replace(/^\s*>\s+/gm, "");
116
121
  // Collapse whitespace and trim.
117
- text = text.replace(/\s+/g, ' ').trim();
122
+ text = text.replace(/\s+/g, " ").trim();
118
123
  // Limit length to keep notifications short.
119
124
  const max = 200;
120
125
  if (text.length > max) {
@@ -144,9 +149,9 @@ function parseToggle(value) {
144
149
  if (value == null)
145
150
  return undefined;
146
151
  const normalized = value.trim().toLowerCase();
147
- if (['1', 'true', 'yes', 'on'].includes(normalized))
152
+ if (["1", "true", "yes", "on"].includes(normalized))
148
153
  return true;
149
- if (['0', 'false', 'no', 'off'].includes(normalized))
154
+ if (["0", "false", "no", "off"].includes(normalized))
150
155
  return false;
151
156
  return undefined;
152
157
  }
@@ -154,17 +159,17 @@ function bool(value) {
154
159
  return Boolean(value && String(value).length > 0);
155
160
  }
156
161
  function isMacExecError(error) {
157
- return Boolean(process.platform === 'darwin' &&
162
+ return Boolean(process.platform === "darwin" &&
158
163
  error &&
159
- typeof error === 'object' &&
160
- 'code' in error &&
161
- error.code === 'EACCES');
164
+ typeof error === "object" &&
165
+ "code" in error &&
166
+ error.code === "EACCES");
162
167
  }
163
168
  function isMacBadCpuError(error) {
164
- return Boolean(process.platform === 'darwin' &&
169
+ return Boolean(process.platform === "darwin" &&
165
170
  error &&
166
- typeof error === 'object' &&
167
- 'errno' in error &&
171
+ typeof error === "object" &&
172
+ "errno" in error &&
168
173
  error.errno === -86);
169
174
  }
170
175
  async function repairMacNotifier(log) {
@@ -182,40 +187,45 @@ async function repairMacNotifier(log) {
182
187
  }
183
188
  }
184
189
  function macNotifierPath() {
185
- if (process.platform !== 'darwin')
190
+ if (process.platform !== "darwin")
186
191
  return null;
187
192
  try {
188
193
  const req = createRequire(import.meta.url);
189
- const modPath = req.resolve('toasted-notifier');
194
+ const modPath = req.resolve("toasted-notifier");
190
195
  const base = path.dirname(modPath);
191
- return path.join(base, 'vendor', 'mac.noindex', 'terminal-notifier.app', 'Contents', 'MacOS', 'terminal-notifier');
196
+ return path.join(base, "vendor", "mac.noindex", "terminal-notifier.app", "Contents", "MacOS", "terminal-notifier");
192
197
  }
193
198
  catch {
194
199
  return null;
195
200
  }
196
201
  }
197
202
  async function shouldSkipToastedNotifier() {
198
- if (process.platform !== 'darwin')
203
+ if (process.platform !== "darwin")
199
204
  return false;
200
205
  // On Apple Silicon without Rosetta, prefer the native helper and skip x86-only fallback.
201
206
  const arch = process.arch;
202
- if (arch !== 'arm64')
207
+ if (arch !== "arm64")
203
208
  return false;
204
209
  return !(await hasRosetta());
205
210
  }
206
211
  async function hasRosetta() {
207
212
  return new Promise((resolve) => {
208
- const child = spawn('pkgutil', ['--files', 'com.apple.pkg.RosettaUpdateAuto'], { stdio: 'ignore' });
209
- child.on('exit', (code) => resolve(code === 0));
210
- child.on('error', () => resolve(false));
213
+ const child = spawn("pkgutil", ["--files", "com.apple.pkg.RosettaUpdateAuto"], {
214
+ stdio: "ignore",
215
+ });
216
+ child.on("exit", (code) => resolve(code === 0));
217
+ child.on("error", () => resolve(false));
211
218
  });
212
219
  }
213
220
  async function sendOsascriptAlert(title, message, _log) {
214
221
  return new Promise((resolve, reject) => {
215
- const child = spawn('osascript', ['-e', `display notification "${escapeAppleScript(message)}" with title "${escapeAppleScript(title)}"`], {
216
- stdio: 'ignore',
222
+ const child = spawn("osascript", [
223
+ "-e",
224
+ `display notification "${escapeAppleScript(message)}" with title "${escapeAppleScript(title)}"`,
225
+ ], {
226
+ stdio: "ignore",
217
227
  });
218
- child.on('exit', (code) => {
228
+ child.on("exit", (code) => {
219
229
  if (code === 0) {
220
230
  resolve();
221
231
  }
@@ -223,18 +233,18 @@ async function sendOsascriptAlert(title, message, _log) {
223
233
  reject(new Error(`osascript exited with code ${code ?? -1}`));
224
234
  }
225
235
  });
226
- child.on('error', reject);
236
+ child.on("error", reject);
227
237
  });
228
238
  }
229
239
  function escapeAppleScript(value) {
230
- return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
240
+ return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
231
241
  }
232
242
  function macAppIconOption() {
233
- if (process.platform !== 'darwin')
243
+ if (process.platform !== "darwin")
234
244
  return {};
235
245
  const iconPaths = [
236
- path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../assets-oracle-icon.png'),
237
- path.resolve(process.cwd(), 'assets-oracle-icon.png'),
246
+ path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../assets-oracle-icon.png"),
247
+ path.resolve(process.cwd(), "assets-oracle-icon.png"),
238
248
  ];
239
249
  for (const candidate of iconPaths) {
240
250
  if (candidate && fsExistsSync(candidate)) {
@@ -245,7 +255,7 @@ function macAppIconOption() {
245
255
  }
246
256
  function fsExistsSync(target) {
247
257
  try {
248
- return Boolean(require('node:fs').statSync(target));
258
+ return Boolean(require("node:fs").statSync(target));
249
259
  }
250
260
  catch {
251
261
  return false;
@@ -256,19 +266,19 @@ async function tryMacNativeNotifier(title, message, settings) {
256
266
  if (!binary)
257
267
  return false;
258
268
  return new Promise((resolve) => {
259
- const child = spawn(binary, [title, message, settings.sound ? 'Glass' : ''], {
260
- stdio: 'ignore',
269
+ const child = spawn(binary, [title, message, settings.sound ? "Glass" : ""], {
270
+ stdio: "ignore",
261
271
  });
262
- child.on('error', () => resolve(false));
263
- child.on('exit', (code) => resolve(code === 0));
272
+ child.on("error", () => resolve(false));
273
+ child.on("exit", (code) => resolve(code === 0));
264
274
  });
265
275
  }
266
276
  function macNativeNotifierPath() {
267
- if (process.platform !== 'darwin')
277
+ if (process.platform !== "darwin")
268
278
  return null;
269
279
  const candidates = [
270
- path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../vendor/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier'),
271
- path.resolve(process.cwd(), 'vendor/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier'),
280
+ path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../../vendor/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier"),
281
+ path.resolve(process.cwd(), "vendor/oracle-notifier/OracleNotifier.app/Contents/MacOS/OracleNotifier"),
272
282
  ];
273
283
  for (const candidate of candidates) {
274
284
  if (fsExistsSync(candidate)) {
@@ -280,27 +290,27 @@ function macNativeNotifierPath() {
280
290
  function muteByConfig(env, config) {
281
291
  if (!config?.muteIn)
282
292
  return false;
283
- return ((config.muteIn.includes('CI') && bool(env.CI)) ||
284
- (config.muteIn.includes('SSH') && bool(env.SSH_CONNECTION)));
293
+ return ((config.muteIn.includes("CI") && bool(env.CI)) ||
294
+ (config.muteIn.includes("SSH") && bool(env.SSH_CONNECTION)));
285
295
  }
286
296
  function isTestEnv(env) {
287
- return (env.ORACLE_DISABLE_NOTIFICATIONS === '1' ||
288
- env.NODE_ENV === 'test' ||
297
+ return (env.ORACLE_DISABLE_NOTIFICATIONS === "1" ||
298
+ env.NODE_ENV === "test" ||
289
299
  Boolean(env.VITEST || env.VITEST_WORKER_ID || env.JEST_WORKER_ID));
290
300
  }
291
301
  function describeNotifierError(error) {
292
- if (error && typeof error === 'object') {
302
+ if (error && typeof error === "object") {
293
303
  const err = error;
294
- if (typeof err.errno === 'number' || typeof err.code === 'string') {
295
- const errno = typeof err.errno === 'number' ? err.errno : undefined;
304
+ if (typeof err.errno === "number" || typeof err.code === "string") {
305
+ const errno = typeof err.errno === "number" ? err.errno : undefined;
296
306
  // macOS returns errno -86 for “Bad CPU type in executable” (e.g., wrong arch or quarantined binary).
297
307
  if (errno === -86) {
298
- return 'notifier binary failed to launch (Bad CPU type/quarantine); try xattr -dr com.apple.quarantine vendor/oracle-notifier && ./vendor/oracle-notifier/build-notifier.sh';
308
+ return "notifier binary failed to launch (Bad CPU type/quarantine); try xattr -dr com.apple.quarantine vendor/oracle-notifier && ./vendor/oracle-notifier/build-notifier.sh";
299
309
  }
300
310
  }
301
- if (typeof err.message === 'string') {
311
+ if (typeof err.message === "string") {
302
312
  return err.message;
303
313
  }
304
314
  }
305
- return typeof error === 'string' ? error : String(error);
315
+ return typeof error === "string" ? error : String(error);
306
316
  }