@neurosity/sdk 6.0.0-next.13 → 6.1.1

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 (45) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/browser/neurosity.iife.js +42 -112
  3. package/dist/browser/neurosity.js +8 -14
  4. package/dist/browser/neurosity.js.map +1 -1
  5. package/dist/cjs/{Notion.d.ts → Neurosity.d.ts} +0 -0
  6. package/dist/cjs/{Notion.js → Neurosity.js} +0 -47
  7. package/dist/cjs/api/bluetooth/BluetoothClient.d.ts +1 -0
  8. package/dist/cjs/api/bluetooth/BluetoothClient.js +3 -0
  9. package/dist/cjs/api/bluetooth/BluetoothTransport.d.ts +1 -0
  10. package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -0
  11. package/dist/cjs/api/bluetooth/react-native/ReactNativeTransport.js +21 -2
  12. package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.d.ts +8 -1
  13. package/dist/cjs/api/bluetooth/web/WebBluetoothTransport.js +16 -2
  14. package/dist/cjs/index.d.ts +1 -2
  15. package/dist/cjs/index.js +1 -2
  16. package/dist/electron/index.js +8 -14
  17. package/dist/electron/index.js.map +1 -1
  18. package/dist/esm/{Notion.d.ts → Neurosity.d.ts} +0 -0
  19. package/dist/esm/{Notion.js → Neurosity.js} +1 -48
  20. package/dist/esm/api/bluetooth/BluetoothClient.d.ts +1 -0
  21. package/dist/esm/api/bluetooth/BluetoothClient.js +3 -0
  22. package/dist/esm/api/bluetooth/BluetoothTransport.d.ts +1 -0
  23. package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.d.ts +4 -0
  24. package/dist/esm/api/bluetooth/react-native/ReactNativeTransport.js +21 -2
  25. package/dist/esm/api/bluetooth/web/WebBluetoothTransport.d.ts +8 -1
  26. package/dist/esm/api/bluetooth/web/WebBluetoothTransport.js +16 -2
  27. package/dist/esm/index.d.ts +1 -2
  28. package/dist/esm/index.js +1 -2
  29. package/dist/esm/neurosity.mjs +43 -111
  30. package/dist/examples/neurosity.iife.js +42 -112
  31. package/dist/examples/neurosity.js +8 -14
  32. package/dist/examples/neurosity.mjs +43 -111
  33. package/package.json +1 -1
  34. package/dist/cjs/skills/NotionOnDevice.d.ts +0 -7
  35. package/dist/cjs/skills/NotionOnDevice.js +0 -25
  36. package/dist/cjs/skills/createSkill.d.ts +0 -7
  37. package/dist/cjs/skills/createSkill.js +0 -40
  38. package/dist/cjs/skills/index.d.ts +0 -2
  39. package/dist/cjs/skills/index.js +0 -18
  40. package/dist/esm/skills/NotionOnDevice.d.ts +0 -7
  41. package/dist/esm/skills/NotionOnDevice.js +0 -21
  42. package/dist/esm/skills/createSkill.d.ts +0 -7
  43. package/dist/esm/skills/createSkill.js +0 -36
  44. package/dist/esm/skills/index.d.ts +0 -2
  45. package/dist/esm/skills/index.js +0 -2
File without changes
@@ -7,7 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { combineLatest, Observable, of, throwError } from "rxjs";
10
+ import { combineLatest, of, throwError } from "rxjs";
11
11
  import { ReplaySubject, firstValueFrom, EMPTY } from "rxjs";
12
12
  import { distinctUntilChanged, map, switchMap } from "rxjs/operators";
13
13
  import isEqual from "fast-deep-equal";
@@ -1142,53 +1142,6 @@ export class Neurosity {
1142
1142
  removeOAuthAccess() {
1143
1143
  return this.cloudClient.removeOAuthAccess();
1144
1144
  }
1145
- /**
1146
- * @internal
1147
- * Proof of Concept for Skills - Not user facing yet
1148
- *
1149
- * Accesses a skill by Bundle ID. Additionally, allows to observe
1150
- * and push skill metrics
1151
- *
1152
- * @param bundleId Bundle ID of skill
1153
- * @returns Skill instance
1154
- */
1155
- skill(bundleId) {
1156
- return __awaiter(this, void 0, void 0, function* () {
1157
- if (!(yield this.cloudClient.didSelectDevice())) {
1158
- return Promise.reject(errors.mustSelectDevice);
1159
- }
1160
- const skillData = yield this.cloudClient.skills.get(bundleId);
1161
- if (skillData === null) {
1162
- return Promise.reject(new Error(`${errors.prefix}Access denied for: ${bundleId}. Make sure the skill is installed.`));
1163
- }
1164
- return {
1165
- metric: (label) => {
1166
- const metricName = `skill~${skillData.id}~${label}`;
1167
- const subscription = new Observable((observer) => {
1168
- const subscription = this.cloudClient.metrics.subscribe({
1169
- metric: metricName,
1170
- labels: [label],
1171
- atomic: true
1172
- });
1173
- const listener = this.cloudClient.metrics.on(subscription, (...data) => {
1174
- observer.next(...data);
1175
- });
1176
- return () => {
1177
- this.cloudClient.metrics.unsubscribe(subscription, listener);
1178
- };
1179
- }).pipe(map((metric) => metric[label]));
1180
- Object.defineProperty(subscription, "next", {
1181
- value: (metricValue) => {
1182
- this.cloudClient.metrics.next(metricName, {
1183
- [label]: metricValue
1184
- });
1185
- }
1186
- });
1187
- return subscription;
1188
- }
1189
- };
1190
- });
1191
- }
1192
1145
  /**
1193
1146
  * <StreamingModes wifi={true} />
1194
1147
  *
@@ -37,6 +37,7 @@ export declare class BluetoothClient {
37
37
  _wifiConnections$: Observable<any>;
38
38
  constructor(options: Options);
39
39
  _autoAuthenticate(createBluetoothToken: CreateBluetoothToken): Observable<IsAuthenticatedResponse>;
40
+ enableAutoConnect(autoConnect: boolean): void;
40
41
  _hasBluetoothSupport(): Promise<boolean>;
41
42
  authenticate(token: string): Promise<IsAuthenticatedResponse>;
42
43
  isAuthenticated(): Promise<IsAuthenticatedResponse>;
@@ -83,6 +83,9 @@ export class BluetoothClient {
83
83
  }
84
84
  })))));
85
85
  }
86
+ enableAutoConnect(autoConnect) {
87
+ this.transport.enableAutoConnect(autoConnect);
88
+ }
86
89
  _hasBluetoothSupport() {
87
90
  return __awaiter(this, void 0, void 0, function* () {
88
91
  const selectedDevice = yield firstValueFrom(this.selectedDevice$);
@@ -16,6 +16,7 @@ export interface BluetoothTransport {
16
16
  requestDevice?(): any;
17
17
  addLog: (log: string) => void;
18
18
  logs$: Subject<string>;
19
+ enableAutoConnect?(value: boolean): void;
19
20
  scan?(options?: {
20
21
  seconds?: number;
21
22
  }): Observable<Peripheral[]>;
@@ -20,6 +20,7 @@ declare type Options = {
20
20
  BleManager: BleManager;
21
21
  bleManagerEmitter: NativeEventEmitter;
22
22
  platform: PlatformOSType;
23
+ autoConnect?: boolean;
23
24
  };
24
25
  declare type BleManagerEvents = {
25
26
  stopScan$: Observable<void>;
@@ -30,6 +31,7 @@ declare type BleManagerEvents = {
30
31
  };
31
32
  export declare class ReactNativeTransport implements BluetoothTransport {
32
33
  type: TRANSPORT_TYPE;
34
+ options: Options;
33
35
  BleManager: BleManager;
34
36
  bleManagerEmitter: NativeEventEmitter;
35
37
  platform: PlatformOSType;
@@ -41,10 +43,12 @@ export declare class ReactNativeTransport implements BluetoothTransport {
41
43
  logs$: ReplaySubject<string>;
42
44
  onDisconnected$: Observable<void>;
43
45
  connectionStream$: Observable<BLUETOOTH_CONNECTION>;
46
+ _isAutoConnectEnabled$: ReplaySubject<boolean>;
44
47
  constructor(options: Options);
45
48
  addLog(log: string): void;
46
49
  isConnected(): boolean;
47
50
  _autoConnect(selectedDevice$: Observable<DeviceInfo>): Observable<void>;
51
+ enableAutoConnect(autoConnect: boolean): void;
48
52
  connection(): Observable<BLUETOOTH_CONNECTION>;
49
53
  _fromEvent(eventName: string): Observable<any>;
50
54
  scan(options?: {
@@ -24,6 +24,9 @@ import { CHARACTERISTIC_UUIDS_TO_NAMES } from "../constants";
24
24
  import { ANDROID_MAX_MTU } from "../constants";
25
25
  import { REACT_NATIVE_MAX_BYTE_SIZE } from "../constants";
26
26
  import { osHasBluetoothSupport } from "../utils/osHasBluetoothSupport";
27
+ const defaultOptions = {
28
+ autoConnect: true
29
+ };
27
30
  export class ReactNativeTransport {
28
31
  constructor(options) {
29
32
  this.type = TRANSPORT_TYPE.REACT_NATIVE;
@@ -34,7 +37,14 @@ export class ReactNativeTransport {
34
37
  this.connectionStream$ = this.connection$
35
38
  .asObservable()
36
39
  .pipe(filter((connection) => !!connection), distinctUntilChanged(), shareReplay(1));
37
- const { BleManager, bleManagerEmitter, platform } = options;
40
+ this._isAutoConnectEnabled$ = new ReplaySubject(1);
41
+ if (!options) {
42
+ const errorMessage = "React Native transport: missing options.";
43
+ this.addLog(errorMessage);
44
+ throw new Error(errorMessage);
45
+ }
46
+ this.options = Object.assign(Object.assign({}, defaultOptions), options);
47
+ const { BleManager, bleManagerEmitter, platform, autoConnect } = this.options;
38
48
  if (!BleManager) {
39
49
  const errorMessage = "React Native option: BleManager not provided.";
40
50
  this.addLog(errorMessage);
@@ -53,6 +63,10 @@ export class ReactNativeTransport {
53
63
  this.BleManager = BleManager;
54
64
  this.bleManagerEmitter = bleManagerEmitter;
55
65
  this.platform = platform;
66
+ this._isAutoConnectEnabled$.next(autoConnect);
67
+ this._isAutoConnectEnabled$.subscribe((autoConnect) => {
68
+ this.addLog(`Auto connect: ${autoConnect ? "enabled" : "disabled"}`);
69
+ });
56
70
  // We create a single listener per event type to
57
71
  // avoid missing events when multiple listeners are attached.
58
72
  this.bleEvents = {
@@ -88,7 +102,9 @@ export class ReactNativeTransport {
88
102
  }
89
103
  _autoConnect(selectedDevice$) {
90
104
  const selectedDeviceAfterDisconnect$ = this.onDisconnected$.pipe(switchMap(() => selectedDevice$));
91
- return merge(selectedDevice$, selectedDeviceAfterDisconnect$).pipe(switchMap((selectedDevice) => !osHasBluetoothSupport(selectedDevice)
105
+ return this._isAutoConnectEnabled$.pipe(switchMap((isAutoConnectEnabled) => isAutoConnectEnabled
106
+ ? merge(selectedDevice$, selectedDeviceAfterDisconnect$)
107
+ : NEVER), switchMap((selectedDevice) => !osHasBluetoothSupport(selectedDevice)
92
108
  ? NEVER
93
109
  : this.scan().pipe(switchMap((peripherals) => {
94
110
  const peripheralMatch = peripherals.find((peripheral) => peripheral.name === (selectedDevice === null || selectedDevice === void 0 ? void 0 : selectedDevice.deviceNickname));
@@ -97,6 +113,9 @@ export class ReactNativeTransport {
97
113
  return yield this.connect(peripheral);
98
114
  })));
99
115
  }
116
+ enableAutoConnect(autoConnect) {
117
+ this._isAutoConnectEnabled$.next(autoConnect);
118
+ }
100
119
  connection() {
101
120
  return this.connectionStream$;
102
121
  }
@@ -5,8 +5,12 @@ import { BluetoothTransport } from "../BluetoothTransport";
5
5
  import { ActionOptions, SubscribeOptions } from "../types";
6
6
  import { TRANSPORT_TYPE, BLUETOOTH_CONNECTION } from "../types";
7
7
  import { DeviceInfo } from "../../../types/deviceInfo";
8
+ declare type Options = {
9
+ autoConnect?: boolean;
10
+ };
8
11
  export declare class WebBluetoothTransport implements BluetoothTransport {
9
12
  type: TRANSPORT_TYPE;
13
+ options: Options;
10
14
  device: BluetoothDevice;
11
15
  server: BluetoothRemoteGATTServer;
12
16
  service: BluetoothRemoteGATTService;
@@ -18,9 +22,11 @@ export declare class WebBluetoothTransport implements BluetoothTransport {
18
22
  logs$: ReplaySubject<string>;
19
23
  onDisconnected$: Observable<void>;
20
24
  connectionStream$: Observable<BLUETOOTH_CONNECTION>;
21
- constructor();
25
+ _isAutoConnectEnabled$: ReplaySubject<boolean>;
26
+ constructor(options?: Options);
22
27
  _getPairedDevices(): Promise<BluetoothDevice[]>;
23
28
  _autoConnect(selectedDevice$: Observable<DeviceInfo>): Observable<void>;
29
+ enableAutoConnect(autoConnect: boolean): void;
24
30
  addLog(log: string): void;
25
31
  isConnected(): boolean;
26
32
  connection(): Observable<BLUETOOTH_CONNECTION>;
@@ -45,3 +51,4 @@ export declare class WebBluetoothTransport implements BluetoothTransport {
45
51
  _autoToggleActionNotifications(selectedDevice$: Observable<DeviceInfo>): Promise<void>;
46
52
  dispatchAction({ characteristicName, action }: ActionOptions): Promise<any>;
47
53
  }
54
+ export {};
@@ -24,8 +24,11 @@ import { TRANSPORT_TYPE, BLUETOOTH_CONNECTION } from "../types";
24
24
  import { DEFAULT_ACTION_RESPONSE_TIMEOUT } from "../constants";
25
25
  import { CHARACTERISTIC_UUIDS_TO_NAMES } from "../constants";
26
26
  import { osHasBluetoothSupport } from "../utils/osHasBluetoothSupport";
27
+ const defaultOptions = {
28
+ autoConnect: true
29
+ };
27
30
  export class WebBluetoothTransport {
28
- constructor() {
31
+ constructor(options = {}) {
29
32
  this.type = TRANSPORT_TYPE.WEB;
30
33
  this.characteristicsByName = {};
31
34
  this.connection$ = new BehaviorSubject(BLUETOOTH_CONNECTION.DISCONNECTED);
@@ -35,11 +38,17 @@ export class WebBluetoothTransport {
35
38
  this.connectionStream$ = this.connection$
36
39
  .asObservable()
37
40
  .pipe(filter((connection) => !!connection), distinctUntilChanged(), shareReplay(1));
41
+ this._isAutoConnectEnabled$ = new ReplaySubject(1);
42
+ this.options = Object.assign(Object.assign({}, defaultOptions), options);
38
43
  if (!isWebBluetoothSupported()) {
39
44
  const errorMessage = "Web Bluetooth is not supported";
40
45
  this.addLog(errorMessage);
41
46
  throw new Error(errorMessage);
42
47
  }
48
+ this._isAutoConnectEnabled$.subscribe((autoConnect) => {
49
+ this.addLog(`Auto connect: ${autoConnect ? "enabled" : "disabled"}`);
50
+ });
51
+ this._isAutoConnectEnabled$.next(this.options.autoConnect);
43
52
  this.connection$.asObservable().subscribe((connection) => {
44
53
  this.addLog(`connection status is ${connection}`);
45
54
  });
@@ -53,7 +62,9 @@ export class WebBluetoothTransport {
53
62
  });
54
63
  }
55
64
  _autoConnect(selectedDevice$) {
56
- return merge(selectedDevice$, this.onDisconnected$.pipe(switchMap(() => selectedDevice$))).pipe(switchMap((selectedDevice) => osHasBluetoothSupport(selectedDevice) ? of(selectedDevice) : EMPTY), switchMap((selectedDevice) => __awaiter(this, void 0, void 0, function* () {
65
+ return this._isAutoConnectEnabled$.pipe(switchMap((isAutoConnectEnabled) => isAutoConnectEnabled
66
+ ? merge(selectedDevice$, this.onDisconnected$.pipe(switchMap(() => selectedDevice$)))
67
+ : NEVER), switchMap((selectedDevice) => osHasBluetoothSupport(selectedDevice) ? of(selectedDevice) : EMPTY), switchMap((selectedDevice) => __awaiter(this, void 0, void 0, function* () {
57
68
  var _a;
58
69
  const { deviceNickname } = selectedDevice;
59
70
  if (this.isConnected()) {
@@ -84,6 +95,9 @@ export class WebBluetoothTransport {
84
95
  return yield this.getServerServiceAndCharacteristics(advertisement.device);
85
96
  })));
86
97
  }
98
+ enableAutoConnect(autoConnect) {
99
+ this._isAutoConnectEnabled$.next(autoConnect);
100
+ }
87
101
  addLog(log) {
88
102
  this.logs$.next(log);
89
103
  }
@@ -1,3 +1,2 @@
1
- export * from "./Notion";
1
+ export * from "./Neurosity";
2
2
  export * from "./api/bluetooth";
3
- export * from "./skills";
package/dist/esm/index.js CHANGED
@@ -1,3 +1,2 @@
1
- export * from "./Notion";
1
+ export * from "./Neurosity";
2
2
  export * from "./api/bluetooth";
3
- export * from "./skills";
@@ -46325,8 +46325,11 @@ var __awaiter$d = (undefined && undefined.__awaiter) || function (thisArg, _argu
46325
46325
  step((generator = generator.apply(thisArg, _arguments || [])).next());
46326
46326
  });
46327
46327
  };
46328
+ const defaultOptions$1 = {
46329
+ autoConnect: true
46330
+ };
46328
46331
  class WebBluetoothTransport {
46329
- constructor() {
46332
+ constructor(options = {}) {
46330
46333
  this.type = TRANSPORT_TYPE.WEB;
46331
46334
  this.characteristicsByName = {};
46332
46335
  this.connection$ = new BehaviorSubject(BLUETOOTH_CONNECTION.DISCONNECTED);
@@ -46336,11 +46339,17 @@ class WebBluetoothTransport {
46336
46339
  this.connectionStream$ = this.connection$
46337
46340
  .asObservable()
46338
46341
  .pipe(filter((connection) => !!connection), distinctUntilChanged(), shareReplay(1));
46342
+ this._isAutoConnectEnabled$ = new ReplaySubject(1);
46343
+ this.options = Object.assign(Object.assign({}, defaultOptions$1), options);
46339
46344
  if (!isWebBluetoothSupported()) {
46340
46345
  const errorMessage = "Web Bluetooth is not supported";
46341
46346
  this.addLog(errorMessage);
46342
46347
  throw new Error(errorMessage);
46343
46348
  }
46349
+ this._isAutoConnectEnabled$.subscribe((autoConnect) => {
46350
+ this.addLog(`Auto connect: ${autoConnect ? "enabled" : "disabled"}`);
46351
+ });
46352
+ this._isAutoConnectEnabled$.next(this.options.autoConnect);
46344
46353
  this.connection$.asObservable().subscribe((connection) => {
46345
46354
  this.addLog(`connection status is ${connection}`);
46346
46355
  });
@@ -46354,7 +46363,9 @@ class WebBluetoothTransport {
46354
46363
  });
46355
46364
  }
46356
46365
  _autoConnect(selectedDevice$) {
46357
- return merge(selectedDevice$, this.onDisconnected$.pipe(switchMap(() => selectedDevice$))).pipe(switchMap((selectedDevice) => osHasBluetoothSupport(selectedDevice) ? of(selectedDevice) : EMPTY), switchMap((selectedDevice) => __awaiter$d(this, void 0, void 0, function* () {
46366
+ return this._isAutoConnectEnabled$.pipe(switchMap((isAutoConnectEnabled) => isAutoConnectEnabled
46367
+ ? merge(selectedDevice$, this.onDisconnected$.pipe(switchMap(() => selectedDevice$)))
46368
+ : NEVER), switchMap((selectedDevice) => osHasBluetoothSupport(selectedDevice) ? of(selectedDevice) : EMPTY), switchMap((selectedDevice) => __awaiter$d(this, void 0, void 0, function* () {
46358
46369
  var _a;
46359
46370
  const { deviceNickname } = selectedDevice;
46360
46371
  if (this.isConnected()) {
@@ -46385,6 +46396,9 @@ class WebBluetoothTransport {
46385
46396
  return yield this.getServerServiceAndCharacteristics(advertisement.device);
46386
46397
  })));
46387
46398
  }
46399
+ enableAutoConnect(autoConnect) {
46400
+ this._isAutoConnectEnabled$.next(autoConnect);
46401
+ }
46388
46402
  addLog(log) {
46389
46403
  this.logs$.next(log);
46390
46404
  }
@@ -46721,6 +46735,9 @@ var __awaiter$e = (undefined && undefined.__awaiter) || function (thisArg, _argu
46721
46735
  step((generator = generator.apply(thisArg, _arguments || [])).next());
46722
46736
  });
46723
46737
  };
46738
+ const defaultOptions$2 = {
46739
+ autoConnect: true
46740
+ };
46724
46741
  class ReactNativeTransport {
46725
46742
  constructor(options) {
46726
46743
  this.type = TRANSPORT_TYPE.REACT_NATIVE;
@@ -46731,7 +46748,14 @@ class ReactNativeTransport {
46731
46748
  this.connectionStream$ = this.connection$
46732
46749
  .asObservable()
46733
46750
  .pipe(filter((connection) => !!connection), distinctUntilChanged(), shareReplay(1));
46734
- const { BleManager, bleManagerEmitter, platform } = options;
46751
+ this._isAutoConnectEnabled$ = new ReplaySubject(1);
46752
+ if (!options) {
46753
+ const errorMessage = "React Native transport: missing options.";
46754
+ this.addLog(errorMessage);
46755
+ throw new Error(errorMessage);
46756
+ }
46757
+ this.options = Object.assign(Object.assign({}, defaultOptions$2), options);
46758
+ const { BleManager, bleManagerEmitter, platform, autoConnect } = this.options;
46735
46759
  if (!BleManager) {
46736
46760
  const errorMessage = "React Native option: BleManager not provided.";
46737
46761
  this.addLog(errorMessage);
@@ -46750,6 +46774,10 @@ class ReactNativeTransport {
46750
46774
  this.BleManager = BleManager;
46751
46775
  this.bleManagerEmitter = bleManagerEmitter;
46752
46776
  this.platform = platform;
46777
+ this._isAutoConnectEnabled$.next(autoConnect);
46778
+ this._isAutoConnectEnabled$.subscribe((autoConnect) => {
46779
+ this.addLog(`Auto connect: ${autoConnect ? "enabled" : "disabled"}`);
46780
+ });
46753
46781
  // We create a single listener per event type to
46754
46782
  // avoid missing events when multiple listeners are attached.
46755
46783
  this.bleEvents = {
@@ -46785,7 +46813,9 @@ class ReactNativeTransport {
46785
46813
  }
46786
46814
  _autoConnect(selectedDevice$) {
46787
46815
  const selectedDeviceAfterDisconnect$ = this.onDisconnected$.pipe(switchMap(() => selectedDevice$));
46788
- return merge(selectedDevice$, selectedDeviceAfterDisconnect$).pipe(switchMap((selectedDevice) => !osHasBluetoothSupport(selectedDevice)
46816
+ return this._isAutoConnectEnabled$.pipe(switchMap((isAutoConnectEnabled) => isAutoConnectEnabled
46817
+ ? merge(selectedDevice$, selectedDeviceAfterDisconnect$)
46818
+ : NEVER), switchMap((selectedDevice) => !osHasBluetoothSupport(selectedDevice)
46789
46819
  ? NEVER
46790
46820
  : this.scan().pipe(switchMap((peripherals) => {
46791
46821
  const peripheralMatch = peripherals.find((peripheral) => peripheral.name === (selectedDevice === null || selectedDevice === void 0 ? void 0 : selectedDevice.deviceNickname));
@@ -46794,6 +46824,9 @@ class ReactNativeTransport {
46794
46824
  return yield this.connect(peripheral);
46795
46825
  })));
46796
46826
  }
46827
+ enableAutoConnect(autoConnect) {
46828
+ this._isAutoConnectEnabled$.next(autoConnect);
46829
+ }
46797
46830
  connection() {
46798
46831
  return this.connectionStream$;
46799
46832
  }
@@ -47247,6 +47280,9 @@ class BluetoothClient {
47247
47280
  }
47248
47281
  })))));
47249
47282
  }
47283
+ enableAutoConnect(autoConnect) {
47284
+ this.transport.enableAutoConnect(autoConnect);
47285
+ }
47250
47286
  _hasBluetoothSupport() {
47251
47287
  return __awaiter$f(this, void 0, void 0, function* () {
47252
47288
  const selectedDevice = yield firstValueFrom(this.selectedDevice$);
@@ -47475,7 +47511,7 @@ var __awaiter$g = (undefined && undefined.__awaiter) || function (thisArg, _argu
47475
47511
  step((generator = generator.apply(thisArg, _arguments || [])).next());
47476
47512
  });
47477
47513
  };
47478
- const defaultOptions$1 = {
47514
+ const defaultOptions$3 = {
47479
47515
  timesync: false,
47480
47516
  autoSelectDevice: true,
47481
47517
  streamingMode: STREAMING_MODE.WIFI_ONLY,
@@ -47513,7 +47549,7 @@ class Neurosity {
47513
47549
  */
47514
47550
  this.streamingMode$ = new ReplaySubject(1);
47515
47551
  const { streamingMode, bluetoothTransport } = options;
47516
- this.options = Object.freeze(Object.assign(Object.assign({}, defaultOptions$1), options));
47552
+ this.options = Object.freeze(Object.assign(Object.assign({}, defaultOptions$3), options));
47517
47553
  this.cloudClient = new CloudClient(this.options);
47518
47554
  if (!!bluetoothTransport) {
47519
47555
  this.bluetoothClient = new BluetoothClient({
@@ -48590,53 +48626,6 @@ class Neurosity {
48590
48626
  removeOAuthAccess() {
48591
48627
  return this.cloudClient.removeOAuthAccess();
48592
48628
  }
48593
- /**
48594
- * @internal
48595
- * Proof of Concept for Skills - Not user facing yet
48596
- *
48597
- * Accesses a skill by Bundle ID. Additionally, allows to observe
48598
- * and push skill metrics
48599
- *
48600
- * @param bundleId Bundle ID of skill
48601
- * @returns Skill instance
48602
- */
48603
- skill(bundleId) {
48604
- return __awaiter$g(this, void 0, void 0, function* () {
48605
- if (!(yield this.cloudClient.didSelectDevice())) {
48606
- return Promise.reject(mustSelectDevice);
48607
- }
48608
- const skillData = yield this.cloudClient.skills.get(bundleId);
48609
- if (skillData === null) {
48610
- return Promise.reject(new Error(`${prefix}Access denied for: ${bundleId}. Make sure the skill is installed.`));
48611
- }
48612
- return {
48613
- metric: (label) => {
48614
- const metricName = `skill~${skillData.id}~${label}`;
48615
- const subscription = new Observable((observer) => {
48616
- const subscription = this.cloudClient.metrics.subscribe({
48617
- metric: metricName,
48618
- labels: [label],
48619
- atomic: true
48620
- });
48621
- const listener = this.cloudClient.metrics.on(subscription, (...data) => {
48622
- observer.next(...data);
48623
- });
48624
- return () => {
48625
- this.cloudClient.metrics.unsubscribe(subscription, listener);
48626
- };
48627
- }).pipe(map((metric) => metric[label]));
48628
- Object.defineProperty(subscription, "next", {
48629
- value: (metricValue) => {
48630
- this.cloudClient.metrics.next(metricName, {
48631
- [label]: metricValue
48632
- });
48633
- }
48634
- });
48635
- return subscription;
48636
- }
48637
- };
48638
- });
48639
- }
48640
48629
  /**
48641
48630
  * <StreamingModes wifi={true} />
48642
48631
  *
@@ -48707,61 +48696,4 @@ class Notion extends Neurosity {
48707
48696
  }
48708
48697
  }
48709
48698
 
48710
- var __awaiter$h = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
48711
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48712
- return new (P || (P = Promise))(function (resolve, reject) {
48713
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
48714
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48715
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
48716
- step((generator = generator.apply(thisArg, _arguments || [])).next());
48717
- });
48718
- };
48719
- /**
48720
- * @internal
48721
- */
48722
- function createNotionOnDevice(options) {
48723
- return __awaiter$h(this, void 0, void 0, function* () {
48724
- const neurosity = new Neurosity(options);
48725
- const skill = Object.assign(Object.assign({}, (yield neurosity.skill(options.skill.bundleId))), { props: "props" in options.skill ? options.skill.props : {} });
48726
- delete neurosity.skill;
48727
- return [neurosity, skill];
48728
- });
48729
- }
48730
-
48731
- var __awaiter$i = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
48732
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48733
- return new (P || (P = Promise))(function (resolve, reject) {
48734
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
48735
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48736
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
48737
- step((generator = generator.apply(thisArg, _arguments || [])).next());
48738
- });
48739
- };
48740
- function createSkill(app) {
48741
- return {
48742
- subscribe: (options) => __awaiter$i(this, void 0, void 0, function* () {
48743
- const [neurosity, skill] = yield createNotionOnDevice(Object.assign({}, options));
48744
- const teardown = app(neurosity, skill);
48745
- return {
48746
- unsubscribe: () => __awaiter$i(this, void 0, void 0, function* () {
48747
- yield neurosity.disconnect();
48748
- if (teardown && "then" in teardown) {
48749
- const cleanUp = yield teardown;
48750
- if (typeof cleanUp === "function") {
48751
- cleanUp();
48752
- }
48753
- }
48754
- if (typeof teardown === "function" && "then" in teardown()) {
48755
- return yield teardown();
48756
- }
48757
- if (typeof teardown === "function") {
48758
- return teardown();
48759
- }
48760
- return teardown;
48761
- })
48762
- };
48763
- })
48764
- };
48765
- }
48766
-
48767
- export { Neurosity, Notion, BluetoothClient, WebBluetoothTransport, ReactNativeTransport, osHasBluetoothSupport, createSkill, createNotionOnDevice };
48699
+ export { Neurosity, Notion, BluetoothClient, WebBluetoothTransport, ReactNativeTransport, osHasBluetoothSupport };