@bli-cockpit/cli 0.2.288 → 0.2.289

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.
@@ -89,11 +89,15 @@ function fileBytes(file) {
89
89
  return typeof size === 'number' ? size : 0;
90
90
  } catch (e) { return 0; }
91
91
  }
92
+ // macOS 27 no longer exposes AVCaptureDevice on \$ after importing AVFoundation; by name it carries no bridge
93
+ // metadata, so the status comes back as the string "3" and Number() is what makes === work (BLI-23872).
94
+ var CaptureDevice = $.AVCaptureDevice || $.NSClassFromString('AVCaptureDevice');
95
+ function micStatus() { return Number(CaptureDevice.authorizationStatusForMediaType('soun')); }
92
96
  ${RECORDER_STOP_RULE}
93
97
  function run(argv) {
94
98
  var dir = argv[0];
95
99
  var startedMs = Date.now();
96
- var auth = $.AVCaptureDevice.authorizationStatusForMediaType('soun');
100
+ var auth = micStatus();
97
101
  if (auth === 1 || auth === 2) { writeText(dir + '/failed.txt', 'mic_denied'); $.exit(3); }
98
102
  var settings = $.NSDictionary.dictionaryWithObjectsForKeys(
99
103
  $([1819304813, ${RECORDING_SAMPLE_RATE}, 1, 16, 0, 0]),
@@ -105,7 +109,7 @@ function run(argv) {
105
109
  while (!exists(dir + '/stop')) {
106
110
  tick(0.2);
107
111
  waited += 0.2;
108
- var now = $.AVCaptureDevice.authorizationStatusForMediaType('soun');
112
+ var now = micStatus();
109
113
  if (now === 1 || now === 2) { recorder.stop; writeText(dir + '/failed.txt', 'mic_denied'); $.exit(3); }
110
114
  if (!announced && now === 3) { announced = true; writeText(dir + '/ready', 'ok'); }
111
115
  if (!announced && waited > 120) { recorder.stop; writeText(dir + '/failed.txt', 'mic_permission_unanswered'); $.exit(5); }
@@ -21,7 +21,7 @@ export async function runCockpitCli(argv, io) {
21
21
  }
22
22
 
23
23
  if (command === "--version" || command === "-V" || command === "version") {
24
- writeLine(io?.stdout ?? process.stdout, "0.2.288");
24
+ writeLine(io?.stdout ?? process.stdout, "0.2.289");
25
25
  return 0;
26
26
  }
27
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bli-cockpit/cli",
3
- "version": "0.2.288",
3
+ "version": "0.2.289",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {