@glassly/bluetooth-sdk 0.3.0-dev.491 → 0.3.1-beta.514
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.
- package/android/src/main/java/com/glassly/bluetoothsdk/GeneratedChangelogCatalog.kt +1 -0
- package/android/src/main/java/com/glassly/bluetoothsdk/GeneratedReleaseMetadata.kt +4 -4
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G1.kt +0 -3
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G1TextSanitizer.kt +9 -13
- package/android/src/main/java/com/glassly/bluetoothsdk/sgcs/G2.kt +14 -1
- package/android/src/test/java/com/glassly/bluetoothsdk/sgcs/G1TextSanitizerTest.kt +15 -9
- package/build/BluetoothSdk.types.d.ts +10 -0
- package/build/BluetoothSdk.types.d.ts.map +1 -1
- package/build/BluetoothSdk.types.js.map +1 -1
- package/build/_private/BluetoothSdkModule.d.ts +5 -1
- package/build/_private/BluetoothSdkModule.d.ts.map +1 -1
- package/build/_private/BluetoothSdkModule.js.map +1 -1
- package/build/generated/changelogCatalog.d.ts +3 -0
- package/build/generated/changelogCatalog.d.ts.map +1 -1
- package/build/generated/changelogCatalog.js +4 -0
- package/build/generated/changelogCatalog.js.map +1 -1
- package/build/generated/releaseMetadata.js +4 -4
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +4 -0
- package/build/index.js.map +1 -1
- package/ios/BluetoothSdkModule.swift +18 -0
- package/ios/GlasslyBluetoothSDK.podspec +2 -0
- package/ios/Source/BluetoothSdkDefaults.swift +1 -1
- package/ios/Source/GeneratedChangelogCatalog.swift +1 -0
- package/ios/Source/GeneratedReleaseMetadata.swift +4 -4
- package/ios/Source/sgcs/G2.swift +14 -2
- package/ios/Source/translation/OfflineTranslator.swift +224 -0
- package/ios/Source/utils/G1Text.swift +13 -15
- package/package.json +1 -1
- package/src/BluetoothSdk.types.ts +10 -0
- package/src/_private/BluetoothSdkModule.ts +8 -0
- package/src/generated/changelogCatalog.ts +4 -0
- package/src/generated/releaseMetadata.ts +4 -4
- package/src/index.ts +4 -0
|
@@ -5,6 +5,9 @@ export declare const GENERATED_RELEASE_CHANGELOGS: readonly [{
|
|
|
5
5
|
}, {
|
|
6
6
|
readonly version: "3.1.0";
|
|
7
7
|
readonly markdown: "Software updates are more reliable, with clearer progress and recovery when the glasses restart.\n\n- Glassly, Glassly Engine, the Bluetooth SDK, and the glasses client now share one coordinated release version.\n- Mentra Live updates can continue across APK, system, and firmware restarts without asking the user to start the same update again.\n- Bluetooth photo capture and transfer diagnostics are more precise and less disruptive to normal glasses traffic.";
|
|
8
|
+
}, {
|
|
9
|
+
readonly version: "0.3.1";
|
|
10
|
+
readonly markdown: "This release is under active development. User-facing changes will be documented as they land.";
|
|
8
11
|
}, {
|
|
9
12
|
readonly version: "0.3.0";
|
|
10
13
|
readonly markdown: "This release is under active development. User-facing changes will be documented as they land.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelogCatalog.d.ts","sourceRoot":"","sources":["../../src/generated/changelogCatalog.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"changelogCatalog.d.ts","sourceRoot":"","sources":["../../src/generated/changelogCatalog.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+DxC,CAAA"}
|
|
@@ -8,6 +8,10 @@ export const GENERATED_RELEASE_CHANGELOGS = Object.freeze([
|
|
|
8
8
|
"version": "3.1.0",
|
|
9
9
|
"markdown": "Software updates are more reliable, with clearer progress and recovery when the glasses restart.\n\n- Glassly, Glassly Engine, the Bluetooth SDK, and the glasses client now share one coordinated release version.\n- Mentra Live updates can continue across APK, system, and firmware restarts without asking the user to start the same update again.\n- Bluetooth photo capture and transfer diagnostics are more precise and less disruptive to normal glasses traffic."
|
|
10
10
|
},
|
|
11
|
+
{
|
|
12
|
+
"version": "0.3.1",
|
|
13
|
+
"markdown": "This release is under active development. User-facing changes will be documented as they land."
|
|
14
|
+
},
|
|
11
15
|
{
|
|
12
16
|
"version": "0.3.0",
|
|
13
17
|
"markdown": "This release is under active development. User-facing changes will be documented as they land."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelogCatalog.js","sourceRoot":"","sources":["../../src/generated/changelogCatalog.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CACzD;IACE;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,+cAA+c;KAC5d;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,+SAA+S;KAC5T;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,+tBAA+tB;KAC5uB;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,odAAod;KACje;CACO,CACT,CAAA","sourcesContent":["/** Generated from /changelogs. Do not edit directly. */\nexport const GENERATED_RELEASE_CHANGELOGS = Object.freeze(\n[\n {\n \"version\": \"3.2.0\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"3.1.0\",\n \"markdown\": \"Software updates are more reliable, with clearer progress and recovery when the glasses restart.\\n\\n- Glassly, Glassly Engine, the Bluetooth SDK, and the glasses client now share one coordinated release version.\\n- Mentra Live updates can continue across APK, system, and firmware restarts without asking the user to start the same update again.\\n- Bluetooth photo capture and transfer diagnostics are more precise and less disruptive to normal glasses traffic.\"\n },\n {\n \"version\": \"0.3.0\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.9\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.8\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.7\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.6\",\n \"markdown\": \"- Terminal follows light and dark mode, removes the on-glasses status badge, and uses font-scaled line spacing in the glasses session picker.\\n- Notifications uses the explicit 5-second popup default and prevents text selection on iOS.\\n- The session.display example removes the SVG and rotation demo.\"\n },\n {\n \"version\": \"0.2.5\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.4\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.3\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.2\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.1\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.0\",\n \"markdown\": \"The glasses UI on Glassly CFW is now a set of pages over one overlay: the dashboard, side menu, calendar, notification viewer and debug menu each stand on their own.\\n\\n- A phone notification shows the viewer on its own and closes back to whatever was on the glasses; it no longer opens the dashboard first, and the ignore-while-active hold is honoured everywhere on custom firmware.\\n- Double tap on any page returns to the main content; head-down closes only the dashboard.\\n- A debug menu on the dashboard (Debug Settings toggle) queries phone-side state such as isPhoneActive().\\n- The metric toggle moved to Appearance, and miniapps can read the host's preferences.\\n- Messenger group threads show on the notification title row.\"\n },\n {\n \"version\": \"0.1.0\",\n \"markdown\": \"First coordinated Glassly release: the app, Glassly Engine, and the Bluetooth SDK now ship one shared release version.\\n\\n- The Glassly App, Glassly Engine, and the Bluetooth SDK are versioned and published together.\\n- Mentra Live updates can continue across APK, system, and firmware restarts without asking the user to start the same update again.\\n- Bluetooth photo capture and transfer diagnostics are more precise and less disruptive to normal glasses traffic.\"\n }\n] as const,\n)\n"]}
|
|
1
|
+
{"version":3,"file":"changelogCatalog.js","sourceRoot":"","sources":["../../src/generated/changelogCatalog.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CACzD;IACE;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,+cAA+c;KAC5d;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,+SAA+S;KAC5T;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,gGAAgG;KAC7G;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,+tBAA+tB;KAC5uB;IACD;QACE,SAAS,EAAE,OAAO;QAClB,UAAU,EAAE,odAAod;KACje;CACO,CACT,CAAA","sourcesContent":["/** Generated from /changelogs. Do not edit directly. */\nexport const GENERATED_RELEASE_CHANGELOGS = Object.freeze(\n[\n {\n \"version\": \"3.2.0\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"3.1.0\",\n \"markdown\": \"Software updates are more reliable, with clearer progress and recovery when the glasses restart.\\n\\n- Glassly, Glassly Engine, the Bluetooth SDK, and the glasses client now share one coordinated release version.\\n- Mentra Live updates can continue across APK, system, and firmware restarts without asking the user to start the same update again.\\n- Bluetooth photo capture and transfer diagnostics are more precise and less disruptive to normal glasses traffic.\"\n },\n {\n \"version\": \"0.3.1\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.3.0\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.9\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.8\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.7\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.6\",\n \"markdown\": \"- Terminal follows light and dark mode, removes the on-glasses status badge, and uses font-scaled line spacing in the glasses session picker.\\n- Notifications uses the explicit 5-second popup default and prevents text selection on iOS.\\n- The session.display example removes the SVG and rotation demo.\"\n },\n {\n \"version\": \"0.2.5\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.4\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.3\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.2\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.1\",\n \"markdown\": \"This release is under active development. User-facing changes will be documented as they land.\"\n },\n {\n \"version\": \"0.2.0\",\n \"markdown\": \"The glasses UI on Glassly CFW is now a set of pages over one overlay: the dashboard, side menu, calendar, notification viewer and debug menu each stand on their own.\\n\\n- A phone notification shows the viewer on its own and closes back to whatever was on the glasses; it no longer opens the dashboard first, and the ignore-while-active hold is honoured everywhere on custom firmware.\\n- Double tap on any page returns to the main content; head-down closes only the dashboard.\\n- A debug menu on the dashboard (Debug Settings toggle) queries phone-side state such as isPhoneActive().\\n- The metric toggle moved to Appearance, and miniapps can read the host's preferences.\\n- Messenger group threads show on the notification title row.\"\n },\n {\n \"version\": \"0.1.0\",\n \"markdown\": \"First coordinated Glassly release: the app, Glassly Engine, and the Bluetooth SDK now ship one shared release version.\\n\\n- The Glassly App, Glassly Engine, and the Bluetooth SDK are versioned and published together.\\n- Mentra Live updates can continue across APK, system, and firmware restarts without asking the user to start the same update again.\\n- Bluetooth photo capture and transfer diagnostics are more precise and less disruptive to normal glasses traffic.\"\n }\n] as const,\n)\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export const BLUETOOTH_SDK_RELEASE_METADATA = Object.freeze({
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"familyBaseVersion": "0.3.
|
|
4
|
-
"releaseIdentity": "0.3.
|
|
5
|
-
"releaseSetId": "glassly-0.3.
|
|
6
|
-
"sourceCommit": "
|
|
3
|
+
"familyBaseVersion": "0.3.1",
|
|
4
|
+
"releaseIdentity": "0.3.1-beta.514",
|
|
5
|
+
"releaseSetId": "glassly-0.3.1-beta.514",
|
|
6
|
+
"sourceCommit": "3777078a83528c6db9812e0e95cac3fa8faa5284",
|
|
7
7
|
"otaManifestUrl": null,
|
|
8
8
|
"otaManifestSha256": null
|
|
9
9
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,8BAA8B,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjG,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,8BAA8B,GAA0C,MAAM,CAAC,MAAM,CAAC;IACjG,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,gBAAgB;IACnC,cAAc,EAAE,wBAAwB;IACxC,cAAc,EAAE,0CAA0C;IAC1D,gBAAgB,EAAE,IAAI;IACtB,mBAAmB,EAAE,IAAI;CAC1B,CAAC,CAAA","sourcesContent":["/** Generated by release CI. Do not edit in a release checkout. */\nexport interface BluetoothSdkReleaseMetadata {\n schemaVersion: 1\n familyBaseVersion: string | null\n releaseIdentity: string | null\n releaseSetId: string | null\n sourceCommit: string | null\n otaManifestUrl: string | null\n otaManifestSha256: string | null\n}\n\nexport const BLUETOOTH_SDK_RELEASE_METADATA: Readonly<BluetoothSdkReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"0.3.1\",\n \"releaseIdentity\": \"0.3.1-beta.514\",\n \"releaseSetId\": \"glassly-0.3.1-beta.514\",\n \"sourceCommit\": \"3777078a83528c6db9812e0e95cac3fa8faa5284\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,wBAAwB,EAIzB,MAAM,sBAAsB,CAAA;AAoF7B,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAGV,wBAAwB,EAIzB,MAAM,sBAAsB,CAAA;AAoF7B,eAAO,MAAM,YAAY,EAAE,wBAgHzB,CAAA;AAEF,eAAe,YAAY,CAAA;AAE3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,sBAAsB,CAAA;AAE7B,YAAY,EACV,UAAU,EACV,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,IAAI,kBAAkB,EAC9C,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,iBAAiB,EACjB,gCAAgC,EAChC,cAAc,EACd,gCAAgC,EAChC,mBAAmB,EACnB,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,4BAA4B,EAC5B,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,yBAAyB,E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AAsB,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -173,6 +173,10 @@ export const BluetoothSdk = Object.freeze({
|
|
|
173
173
|
validateSttModel: bindPublicMethod("validateSttModel"),
|
|
174
174
|
extractTarBz2: bindPublicMethod("extractTarBz2"),
|
|
175
175
|
restartTranscriber: bindPublicMethod("restartTranscriber"),
|
|
176
|
+
getOfflineTranslationLanguages: bindPublicMethod("getOfflineTranslationLanguages"),
|
|
177
|
+
getOfflineTranslationStatus: bindPublicMethod("getOfflineTranslationStatus"),
|
|
178
|
+
downloadOfflineTranslation: bindPublicMethod("downloadOfflineTranslation"),
|
|
179
|
+
translateOffline: bindPublicMethod("translateOffline"),
|
|
176
180
|
setTtsModelDetails: bindPublicMethod("setTtsModelDetails"),
|
|
177
181
|
getTtsModelPath: bindPublicMethod("getTtsModelPath"),
|
|
178
182
|
getTtsModelLanguage: bindPublicMethod("getTtsModelLanguage"),
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,+BAA+B,CAAA;AASrE,OAAO,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAA;AAEjD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAwB;IACxD,6BAA6B;IAC7B,4BAA4B;IAC5B,KAAK;IACL,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,aAAa;IACb,SAAS;IACT,iCAAiC;IACjC,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACpB,kBAAkB;IAClB,uBAAuB;IACvB,eAAe;IACf,gBAAgB;IAChB,cAAc;IACd,eAAe;IACf,wBAAwB;IACxB,eAAe;IACf,aAAa;IACb,gBAAgB;IAChB,gCAAgC;IAChC,qBAAqB;IACrB,eAAe;IACf,0BAA0B;IAC1B,cAAc;IACd,cAAc;IACd,cAAc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AC/B,MAAM,sBAAsB,CAAA","sourcesContent":["import PrivateBluetoothSdkModule from \"./_private/BluetoothSdkModule\"\nimport type {\n BluetoothSdkEventListener,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n VideoRecordingDefaults,\n} from \"./BluetoothSdk.types\"\nimport {getReleaseChangelogs} from \"./changelogs\"\n\nconst PUBLIC_EVENT_NAMES = new Set<BluetoothSdkEventName>([\n \"glasses_notification_status\",\n \"notification_upload_result\",\n \"log\",\n \"device_discovered\",\n \"default_device_changed\",\n \"glasses_not_ready\",\n \"button_press\",\n \"touch_event\",\n \"accel_event\",\n \"head_up\",\n \"voice_activity_detection_status\",\n \"speaking_status\",\n \"battery_status\",\n \"local_transcription\",\n \"wifi_status_change\",\n \"wifi_scan_result\",\n \"hotspot_status_change\",\n \"hotspot_error\",\n \"photo_response\",\n \"photo_status\",\n \"camera_status\",\n \"video_recording_status\",\n \"media_success\",\n \"media_error\",\n \"gallery_status\",\n \"compatible_glasses_search_stop\",\n \"swipe_volume_status\",\n \"switch_status\",\n \"rgb_led_control_response\",\n \"settings_ack\",\n \"pair_failure\",\n \"pairing_info\",\n \"entering_pairing_mode\",\n \"owner_replaced\",\n \"audio_pairing_needed\",\n \"audio_connected\",\n \"audio_disconnected\",\n \"mic_pcm\",\n \"mic_lc3\",\n \"mic_health\",\n \"stream_status\",\n \"mtk_update_complete\",\n \"glasses_session_changed\",\n \"ota_start_ack\",\n \"ota_status\",\n \"ar99_ota_status\",\n \"g2_firmware_flash_progress\",\n \"version_info\",\n \"extraction_progress\",\n \"keyboard_key\",\n \"keyboard_advert\",\n \"keyboard_pairing\",\n])\n\nconst addListener: BluetoothSdkPublicModule[\"addListener\"] = (eventName, listener) => {\n if (!PUBLIC_EVENT_NAMES.has(eventName)) {\n throw new Error(`Unsupported BluetoothSdk event \"${eventName}\". Use @glassly/bluetooth-sdk/react for status state.`)\n }\n return PrivateBluetoothSdkModule.addListener(eventName, listener as BluetoothSdkEventListener<BluetoothSdkEventName>)\n}\n\nconst startOtaUpdate: BluetoothSdkPublicModule[\"startOtaUpdate\"] = (otaVersionUrl) => {\n return PrivateBluetoothSdkModule.startOtaUpdate(otaVersionUrl)\n}\n\nconst queryOtaStatus: BluetoothSdkPublicModule[\"queryOtaStatus\"] = () => {\n return PrivateBluetoothSdkModule.sendOtaQueryStatus()\n}\n\nconst bindPublicMethod = <K extends keyof BluetoothSdkPublicModule>(name: K): BluetoothSdkPublicModule[K] => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>)[name]\n if (typeof method === \"function\") {\n return method.bind(PrivateBluetoothSdkModule) as BluetoothSdkPublicModule[K]\n }\n\n return (async () => {\n throw new Error(`BluetoothSdk.${String(name)} is not available in this native build. Rebuild the app.`)\n }) as unknown as BluetoothSdkPublicModule[K]\n}\n\nexport const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({\n addListener,\n getGlassesStatus: bindPublicMethod(\"getGlassesStatus\"),\n getBluetoothStatus: bindPublicMethod(\"getBluetoothStatus\"),\n subscribeGlassesStatus: (listener: (changed: Partial<PublicGlassesStatus>) => void) =>\n PrivateBluetoothSdkModule.onGlassesStatus(listener),\n subscribeBluetoothStatus: (listener: (changed: Partial<PublicBluetoothStatus>) => void) =>\n PrivateBluetoothSdkModule.onBluetoothStatus(listener),\n getDefaultDevice: bindPublicMethod(\"getDefaultDevice\"),\n setDefaultDevice: bindPublicMethod(\"setDefaultDevice\"),\n clearDefaultDevice: bindPublicMethod(\"clearDefaultDevice\"),\n startScan: bindPublicMethod(\"startScan\"),\n stopScan: bindPublicMethod(\"stopScan\"),\n scan: bindPublicMethod(\"scan\") as BluetoothSdkPublicModule[\"scan\"],\n connect: bindPublicMethod(\"connect\"),\n connectDefault: bindPublicMethod(\"connectDefault\"),\n cancelConnectionAttempt: bindPublicMethod(\"cancelConnectionAttempt\"),\n disconnect: bindPublicMethod(\"disconnect\"),\n forget: bindPublicMethod(\"forget\"),\n displayText: bindPublicMethod(\"displayText\"),\n clearDisplay: bindPublicMethod(\"clearDisplay\"),\n showDashboard: bindPublicMethod(\"showDashboard\"),\n showNativeNotificationPanel: bindPublicMethod(\"showNativeNotificationPanel\"),\n setGlassesNotificationConfig: bindPublicMethod(\"setGlassesNotificationConfig\"),\n getGlassesNotificationStatus: bindPublicMethod(\"getGlassesNotificationStatus\"),\n setDashboardPosition: bindPublicMethod(\"setDashboardPosition\"),\n setHeadUpAngle: bindPublicMethod(\"setHeadUpAngle\"),\n setImuEnabled: bindPublicMethod(\"setImuEnabled\"),\n setScreenDisabled: bindPublicMethod(\"setScreenDisabled\"),\n ping: bindPublicMethod(\"ping\"),\n requestWifiScan: bindPublicMethod(\"requestWifiScan\"),\n sendWifiCredentials: bindPublicMethod(\"sendWifiCredentials\"),\n forgetWifiNetwork: bindPublicMethod(\"forgetWifiNetwork\"),\n setHotspotState: bindPublicMethod(\"setHotspotState\"),\n setSystemTime: bindPublicMethod(\"setSystemTime\"),\n setWifiAdbState: bindPublicMethod(\"setWifiAdbState\"),\n setGalleryModeEnabled: bindPublicMethod(\"setGalleryModeEnabled\"),\n setVoiceActivityDetectionEnabled: bindPublicMethod(\"setVoiceActivityDetectionEnabled\"),\n setLoudnessGateEnabled: bindPublicMethod(\"setLoudnessGateEnabled\"),\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop, or explicit per-shot\n * fields). Still functional until removed in a future release.\n */\n setPhotoCaptureDefaults: bindPublicMethod(\"setPhotoCaptureDefaults\"),\n setVideoRecordingDefaults: ({width, height, fps}: VideoRecordingDefaults) => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>).setVideoRecordingDefaults\n if (typeof method !== \"function\") {\n return Promise.reject(\n new Error(\"BluetoothSdk.setVideoRecordingDefaults is not available in this native build. Rebuild the app.\"),\n )\n }\n return PrivateBluetoothSdkModule.setVideoRecordingDefaults(width, height, fps)\n },\n setMaxVideoRecordingDuration: bindPublicMethod(\"setMaxVideoRecordingDuration\"),\n setCameraFov: bindPublicMethod(\"setCameraFov\"),\n setLegacyCameraFov: bindPublicMethod(\"setLegacyCameraFov\"),\n setCameraFovOverride: bindPublicMethod(\"setCameraFovOverride\"),\n releaseCameraFovOverride: bindPublicMethod(\"releaseCameraFovOverride\"),\n setCameraTuningConfig: bindPublicMethod(\"setCameraTuningConfig\"),\n queryGalleryStatus: bindPublicMethod(\"queryGalleryStatus\"),\n requestPhoto: bindPublicMethod(\"requestPhoto\"),\n warmUpCamera: bindPublicMethod(\"warmUpCamera\"),\n stopCameraWarmUp: bindPublicMethod(\"stopCameraWarmUp\"),\n startVideoRecording: bindPublicMethod(\"startVideoRecording\"),\n stopVideoRecording: bindPublicMethod(\"stopVideoRecording\"),\n queryVideoRecordingStatus: bindPublicMethod(\"queryVideoRecordingStatus\"),\n startStream: bindPublicMethod(\"startStream\"),\n stopStream: bindPublicMethod(\"stopStream\"),\n setMicState: bindPublicMethod(\"setMicState\"),\n setPreferredMic: bindPublicMethod(\"setPreferredMic\"),\n setOwnAppAudioPlaying: bindPublicMethod(\"setOwnAppAudioPlaying\"),\n getGlassesMediaVolume: bindPublicMethod(\"getGlassesMediaVolume\"),\n setGlassesMediaVolume: bindPublicMethod(\"setGlassesMediaVolume\"),\n rgbLedControl: bindPublicMethod(\"rgbLedControl\"),\n requestVersionInfo: bindPublicMethod(\"requestVersionInfo\"),\n availableG2FirmwareArtifacts: bindPublicMethod(\"availableG2FirmwareArtifacts\"),\n startG2FirmwareFlash: bindPublicMethod(\"startG2FirmwareFlash\"),\n g2KeyboardScan: bindPublicMethod(\"g2KeyboardScan\"),\n g2KeyboardConnect: bindPublicMethod(\"g2KeyboardConnect\"),\n g2KeyboardReconnect: bindPublicMethod(\"g2KeyboardReconnect\"),\n g2KeyboardDisconnect: bindPublicMethod(\"g2KeyboardDisconnect\"),\n g2KeyboardForget: bindPublicMethod(\"g2KeyboardForget\"),\n g2KeyboardPasskey: bindPublicMethod(\"g2KeyboardPasskey\"),\n g2KeyboardCompare: bindPublicMethod(\"g2KeyboardCompare\"),\n g2KeyboardStatus: bindPublicMethod(\"g2KeyboardStatus\"),\n setOtaVersionUrl: bindPublicMethod(\"setOtaVersionUrl\"),\n getOtaVersionUrl: bindPublicMethod(\"getOtaVersionUrl\"),\n checkForOtaUpdate: bindPublicMethod(\"checkForOtaUpdate\"),\n getReleaseChangelogs,\n startOtaUpdate,\n queryOtaStatus,\n startAr99OtaFromFile: bindPublicMethod(\"startAr99OtaFromFile\"),\n cancelAr99Ota: bindPublicMethod(\"cancelAr99Ota\"),\n sendAr99FactoryReset: bindPublicMethod(\"sendAr99FactoryReset\"),\n buildAr99OtaSignature: bindPublicMethod(\"buildAr99OtaSignature\"),\n setSttModelDetails: bindPublicMethod(\"setSttModelDetails\"),\n getSttModelPath: bindPublicMethod(\"getSttModelPath\"),\n checkSttModelAvailable: bindPublicMethod(\"checkSttModelAvailable\"),\n validateSttModel: bindPublicMethod(\"validateSttModel\"),\n extractTarBz2: bindPublicMethod(\"extractTarBz2\"),\n restartTranscriber: bindPublicMethod(\"restartTranscriber\"),\n setTtsModelDetails: bindPublicMethod(\"setTtsModelDetails\"),\n getTtsModelPath: bindPublicMethod(\"getTtsModelPath\"),\n getTtsModelLanguage: bindPublicMethod(\"getTtsModelLanguage\"),\n checkTtsModelAvailable: bindPublicMethod(\"checkTtsModelAvailable\"),\n validateTtsModel: bindPublicMethod(\"validateTtsModel\"),\n generateTtsAudio: bindPublicMethod(\"generateTtsAudio\"),\n})\n\nexport default BluetoothSdk\n\nexport {\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n DeviceModels,\n isBusyGlassesConnectionStatus,\n isConnectedGlassesConnectionStatus,\n isConnectedWifiStatus,\n isEnabledHotspotStatus,\n isReadyGlassesConnectionStatus,\n} from \"./BluetoothSdk.types\"\n\nexport type {\n AccelEvent,\n Ar99OtaStatusEvent,\n AudioConnectedEvent,\n AudioDisconnectedEvent,\n AudioPairingNeededEvent,\n BatteryStatusEvent,\n BluetoothSdkEvent,\n BluetoothSdkEventListener,\n BluetoothSdkEventMap,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule as BluetoothSdkModule,\n BluetoothSdkSubscription,\n ButtonPhotoSize,\n PhotoCaptureDefaults,\n ButtonPressEvent,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovResult,\n CameraRoiPosition,\n CompatibleGlassesSearchStopEvent,\n ConnectOptions,\n ConnectedGlassesConnectionStatus,\n ConnectedWifiStatus,\n Device,\n DeviceModel,\n EnabledHotspotStatus,\n GalleryStatusEvent,\n G2FirmwareArtifact,\n G2FirmwareFlashProgressEvent,\n G2FirmwareFlashResult,\n G2FirmwareTarget,\n KeyboardKeyEvent,\n KeyboardAdvertEvent,\n KeyboardPairingEvent,\n KeyboardBridgeState,\n KeyboardBridgeStatus,\n GlassesConnectionStatus,\n GlassesNotificationConfig,\n GlassesNotificationFeed,\n GlassesNotificationStatus,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesNotReadyEvent,\n HeadUpEvent,\n HotspotErrorEvent,\n HotspotStatus,\n HotspotStatusChangeEvent,\n GlassesSessionChangedEvent,\n KeepAliveAckEvent,\n LocalTranscriptionEvent,\n LogEvent,\n MicLc3Event,\n MicHealthEvent,\n MicMode,\n MicPcmEvent,\n MicPreference,\n OtaStartAckEvent,\n OtaProgress,\n OtaProgressStatus,\n OtaStage,\n OtaStatus,\n OtaStatusEvent,\n OtaQueryResult,\n OtaUpdateInfo,\n ReleaseChangelog,\n SpeakerEnrollProgressEvent,\n SpeakerEnrollResultEvent,\n MtkUpdateCompleteEvent,\n PairFailureEvent,\n PairingInfoEvent,\n EnteringPairingModeEvent,\n OwnerReplacedEvent,\n PhotoCaptureMetadata,\n PhotoResolvedConfig,\n PhotoCompression,\n PhotoFpsRange,\n PhotoMeteredPreview,\n PhotoMode,\n PublicBluetoothStatus,\n NotificationUploadResult,\n PhoneNotificationUpload,\n PublicGlassesStatus,\n PhotoTransferMethod,\n PhotoResponseEvent,\n PhotoRequestedCaptureConfig,\n PhotoRequestParams,\n PhotoSize,\n PhotoStatusEvent,\n PhotoStatusState,\n PhotoSuccessResponseEvent,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlResponseEvent,\n RgbLedControlSuccessResponseEvent,\n ScanModelOptions,\n ScanOptions,\n ScanResultsCallback,\n SpeakingStatusEvent,\n SettingsAckEvent,\n SettingsAckSetting,\n SettingsAckSuccessEvent,\n SettingsAckSuccessStatus,\n SettingsAckStatus,\n StreamAudioConfig,\n StreamResolvedConfig,\n StreamStartRequest,\n StreamStatusEvent,\n StreamStatusLifecycleState,\n StreamStatusReconnectState,\n StreamStatusState,\n StreamVideoConfig,\n SwipeVolumeStatusEvent,\n SwitchStatusEvent,\n TouchEvent,\n VideoRecordingDefaults,\n VideoRecordingStartedStatusEvent,\n VideoRecordingStatusEvent,\n VideoRecordingStatusState,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingSuccessStatusEvent,\n VersionInfoEvent,\n VersionInfoResult,\n WifiScanResultEvent,\n VoiceActivityDetectionStatusEvent,\n WifiSearchResult,\n WifiStatus,\n WifiStatusChangeEvent,\n} from \"./BluetoothSdk.types\"\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,MAAM,+BAA+B,CAAA;AASrE,OAAO,EAAC,oBAAoB,EAAC,MAAM,cAAc,CAAA;AAEjD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAwB;IACxD,6BAA6B;IAC7B,4BAA4B;IAC5B,KAAK;IACL,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,cAAc;IACd,aAAa;IACb,aAAa;IACb,SAAS;IACT,iCAAiC;IACjC,iBAAiB;IACjB,gBAAgB;IAChB,qBAAqB;IACrB,oBAAoB;IACp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EAAE,gBAAgB,CAAC,iBAAiB,CAAC;IACpD,mBAAmB,EAAE,gBAAgB,CAAC,qBAAqB,CAAC;IAC5D,sBAAsB,EAAE,gBAAgB,CAAC,wBAAwB,CAAC;IAClE,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;IACtD,gBAAgB,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;CACvD,CAAC,CAAA;AAEF,eAAe,YAAY,CAAA;AAE3B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC7B,kCAAkC,EAClC,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,GAC/B,MAAM,sBAAsB,CAAA","sourcesContent":["import PrivateBluetoothSdkModule from \"./_private/BluetoothSdkModule\"\nimport type {\n BluetoothSdkEventListener,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule,\n PublicBluetoothStatus,\n PublicGlassesStatus,\n VideoRecordingDefaults,\n} from \"./BluetoothSdk.types\"\nimport {getReleaseChangelogs} from \"./changelogs\"\n\nconst PUBLIC_EVENT_NAMES = new Set<BluetoothSdkEventName>([\n \"glasses_notification_status\",\n \"notification_upload_result\",\n \"log\",\n \"device_discovered\",\n \"default_device_changed\",\n \"glasses_not_ready\",\n \"button_press\",\n \"touch_event\",\n \"accel_event\",\n \"head_up\",\n \"voice_activity_detection_status\",\n \"speaking_status\",\n \"battery_status\",\n \"local_transcription\",\n \"wifi_status_change\",\n \"wifi_scan_result\",\n \"hotspot_status_change\",\n \"hotspot_error\",\n \"photo_response\",\n \"photo_status\",\n \"camera_status\",\n \"video_recording_status\",\n \"media_success\",\n \"media_error\",\n \"gallery_status\",\n \"compatible_glasses_search_stop\",\n \"swipe_volume_status\",\n \"switch_status\",\n \"rgb_led_control_response\",\n \"settings_ack\",\n \"pair_failure\",\n \"pairing_info\",\n \"entering_pairing_mode\",\n \"owner_replaced\",\n \"audio_pairing_needed\",\n \"audio_connected\",\n \"audio_disconnected\",\n \"mic_pcm\",\n \"mic_lc3\",\n \"mic_health\",\n \"stream_status\",\n \"mtk_update_complete\",\n \"glasses_session_changed\",\n \"ota_start_ack\",\n \"ota_status\",\n \"ar99_ota_status\",\n \"g2_firmware_flash_progress\",\n \"version_info\",\n \"extraction_progress\",\n \"keyboard_key\",\n \"keyboard_advert\",\n \"keyboard_pairing\",\n])\n\nconst addListener: BluetoothSdkPublicModule[\"addListener\"] = (eventName, listener) => {\n if (!PUBLIC_EVENT_NAMES.has(eventName)) {\n throw new Error(`Unsupported BluetoothSdk event \"${eventName}\". Use @glassly/bluetooth-sdk/react for status state.`)\n }\n return PrivateBluetoothSdkModule.addListener(eventName, listener as BluetoothSdkEventListener<BluetoothSdkEventName>)\n}\n\nconst startOtaUpdate: BluetoothSdkPublicModule[\"startOtaUpdate\"] = (otaVersionUrl) => {\n return PrivateBluetoothSdkModule.startOtaUpdate(otaVersionUrl)\n}\n\nconst queryOtaStatus: BluetoothSdkPublicModule[\"queryOtaStatus\"] = () => {\n return PrivateBluetoothSdkModule.sendOtaQueryStatus()\n}\n\nconst bindPublicMethod = <K extends keyof BluetoothSdkPublicModule>(name: K): BluetoothSdkPublicModule[K] => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>)[name]\n if (typeof method === \"function\") {\n return method.bind(PrivateBluetoothSdkModule) as BluetoothSdkPublicModule[K]\n }\n\n return (async () => {\n throw new Error(`BluetoothSdk.${String(name)} is not available in this native build. Rebuild the app.`)\n }) as unknown as BluetoothSdkPublicModule[K]\n}\n\nexport const BluetoothSdk: BluetoothSdkPublicModule = Object.freeze({\n addListener,\n getGlassesStatus: bindPublicMethod(\"getGlassesStatus\"),\n getBluetoothStatus: bindPublicMethod(\"getBluetoothStatus\"),\n subscribeGlassesStatus: (listener: (changed: Partial<PublicGlassesStatus>) => void) =>\n PrivateBluetoothSdkModule.onGlassesStatus(listener),\n subscribeBluetoothStatus: (listener: (changed: Partial<PublicBluetoothStatus>) => void) =>\n PrivateBluetoothSdkModule.onBluetoothStatus(listener),\n getDefaultDevice: bindPublicMethod(\"getDefaultDevice\"),\n setDefaultDevice: bindPublicMethod(\"setDefaultDevice\"),\n clearDefaultDevice: bindPublicMethod(\"clearDefaultDevice\"),\n startScan: bindPublicMethod(\"startScan\"),\n stopScan: bindPublicMethod(\"stopScan\"),\n scan: bindPublicMethod(\"scan\") as BluetoothSdkPublicModule[\"scan\"],\n connect: bindPublicMethod(\"connect\"),\n connectDefault: bindPublicMethod(\"connectDefault\"),\n cancelConnectionAttempt: bindPublicMethod(\"cancelConnectionAttempt\"),\n disconnect: bindPublicMethod(\"disconnect\"),\n forget: bindPublicMethod(\"forget\"),\n displayText: bindPublicMethod(\"displayText\"),\n clearDisplay: bindPublicMethod(\"clearDisplay\"),\n showDashboard: bindPublicMethod(\"showDashboard\"),\n showNativeNotificationPanel: bindPublicMethod(\"showNativeNotificationPanel\"),\n setGlassesNotificationConfig: bindPublicMethod(\"setGlassesNotificationConfig\"),\n getGlassesNotificationStatus: bindPublicMethod(\"getGlassesNotificationStatus\"),\n setDashboardPosition: bindPublicMethod(\"setDashboardPosition\"),\n setHeadUpAngle: bindPublicMethod(\"setHeadUpAngle\"),\n setImuEnabled: bindPublicMethod(\"setImuEnabled\"),\n setScreenDisabled: bindPublicMethod(\"setScreenDisabled\"),\n ping: bindPublicMethod(\"ping\"),\n requestWifiScan: bindPublicMethod(\"requestWifiScan\"),\n sendWifiCredentials: bindPublicMethod(\"sendWifiCredentials\"),\n forgetWifiNetwork: bindPublicMethod(\"forgetWifiNetwork\"),\n setHotspotState: bindPublicMethod(\"setHotspotState\"),\n setSystemTime: bindPublicMethod(\"setSystemTime\"),\n setWifiAdbState: bindPublicMethod(\"setWifiAdbState\"),\n setGalleryModeEnabled: bindPublicMethod(\"setGalleryModeEnabled\"),\n setVoiceActivityDetectionEnabled: bindPublicMethod(\"setVoiceActivityDetectionEnabled\"),\n setLoudnessGateEnabled: bindPublicMethod(\"setLoudnessGateEnabled\"),\n /**\n * @deprecated Sticky action-button photo presets are deprecated. Prefer per-request\n * `requestPhoto(...)` options (e.g. `mode: \"text\"` for text sensor size/crop, or explicit per-shot\n * fields). Still functional until removed in a future release.\n */\n setPhotoCaptureDefaults: bindPublicMethod(\"setPhotoCaptureDefaults\"),\n setVideoRecordingDefaults: ({width, height, fps}: VideoRecordingDefaults) => {\n const method = (PrivateBluetoothSdkModule as unknown as Record<string, unknown>).setVideoRecordingDefaults\n if (typeof method !== \"function\") {\n return Promise.reject(\n new Error(\"BluetoothSdk.setVideoRecordingDefaults is not available in this native build. Rebuild the app.\"),\n )\n }\n return PrivateBluetoothSdkModule.setVideoRecordingDefaults(width, height, fps)\n },\n setMaxVideoRecordingDuration: bindPublicMethod(\"setMaxVideoRecordingDuration\"),\n setCameraFov: bindPublicMethod(\"setCameraFov\"),\n setLegacyCameraFov: bindPublicMethod(\"setLegacyCameraFov\"),\n setCameraFovOverride: bindPublicMethod(\"setCameraFovOverride\"),\n releaseCameraFovOverride: bindPublicMethod(\"releaseCameraFovOverride\"),\n setCameraTuningConfig: bindPublicMethod(\"setCameraTuningConfig\"),\n queryGalleryStatus: bindPublicMethod(\"queryGalleryStatus\"),\n requestPhoto: bindPublicMethod(\"requestPhoto\"),\n warmUpCamera: bindPublicMethod(\"warmUpCamera\"),\n stopCameraWarmUp: bindPublicMethod(\"stopCameraWarmUp\"),\n startVideoRecording: bindPublicMethod(\"startVideoRecording\"),\n stopVideoRecording: bindPublicMethod(\"stopVideoRecording\"),\n queryVideoRecordingStatus: bindPublicMethod(\"queryVideoRecordingStatus\"),\n startStream: bindPublicMethod(\"startStream\"),\n stopStream: bindPublicMethod(\"stopStream\"),\n setMicState: bindPublicMethod(\"setMicState\"),\n setPreferredMic: bindPublicMethod(\"setPreferredMic\"),\n setOwnAppAudioPlaying: bindPublicMethod(\"setOwnAppAudioPlaying\"),\n getGlassesMediaVolume: bindPublicMethod(\"getGlassesMediaVolume\"),\n setGlassesMediaVolume: bindPublicMethod(\"setGlassesMediaVolume\"),\n rgbLedControl: bindPublicMethod(\"rgbLedControl\"),\n requestVersionInfo: bindPublicMethod(\"requestVersionInfo\"),\n availableG2FirmwareArtifacts: bindPublicMethod(\"availableG2FirmwareArtifacts\"),\n startG2FirmwareFlash: bindPublicMethod(\"startG2FirmwareFlash\"),\n g2KeyboardScan: bindPublicMethod(\"g2KeyboardScan\"),\n g2KeyboardConnect: bindPublicMethod(\"g2KeyboardConnect\"),\n g2KeyboardReconnect: bindPublicMethod(\"g2KeyboardReconnect\"),\n g2KeyboardDisconnect: bindPublicMethod(\"g2KeyboardDisconnect\"),\n g2KeyboardForget: bindPublicMethod(\"g2KeyboardForget\"),\n g2KeyboardPasskey: bindPublicMethod(\"g2KeyboardPasskey\"),\n g2KeyboardCompare: bindPublicMethod(\"g2KeyboardCompare\"),\n g2KeyboardStatus: bindPublicMethod(\"g2KeyboardStatus\"),\n setOtaVersionUrl: bindPublicMethod(\"setOtaVersionUrl\"),\n getOtaVersionUrl: bindPublicMethod(\"getOtaVersionUrl\"),\n checkForOtaUpdate: bindPublicMethod(\"checkForOtaUpdate\"),\n getReleaseChangelogs,\n startOtaUpdate,\n queryOtaStatus,\n startAr99OtaFromFile: bindPublicMethod(\"startAr99OtaFromFile\"),\n cancelAr99Ota: bindPublicMethod(\"cancelAr99Ota\"),\n sendAr99FactoryReset: bindPublicMethod(\"sendAr99FactoryReset\"),\n buildAr99OtaSignature: bindPublicMethod(\"buildAr99OtaSignature\"),\n setSttModelDetails: bindPublicMethod(\"setSttModelDetails\"),\n getSttModelPath: bindPublicMethod(\"getSttModelPath\"),\n checkSttModelAvailable: bindPublicMethod(\"checkSttModelAvailable\"),\n validateSttModel: bindPublicMethod(\"validateSttModel\"),\n extractTarBz2: bindPublicMethod(\"extractTarBz2\"),\n restartTranscriber: bindPublicMethod(\"restartTranscriber\"),\n getOfflineTranslationLanguages: bindPublicMethod(\"getOfflineTranslationLanguages\"),\n getOfflineTranslationStatus: bindPublicMethod(\"getOfflineTranslationStatus\"),\n downloadOfflineTranslation: bindPublicMethod(\"downloadOfflineTranslation\"),\n translateOffline: bindPublicMethod(\"translateOffline\"),\n setTtsModelDetails: bindPublicMethod(\"setTtsModelDetails\"),\n getTtsModelPath: bindPublicMethod(\"getTtsModelPath\"),\n getTtsModelLanguage: bindPublicMethod(\"getTtsModelLanguage\"),\n checkTtsModelAvailable: bindPublicMethod(\"checkTtsModelAvailable\"),\n validateTtsModel: bindPublicMethod(\"validateTtsModel\"),\n generateTtsAudio: bindPublicMethod(\"generateTtsAudio\"),\n})\n\nexport default BluetoothSdk\n\nexport {\n CAMERA_FOV_DEFAULT,\n CAMERA_FOV_MAX,\n CAMERA_FOV_MIN,\n DeviceModels,\n isBusyGlassesConnectionStatus,\n isConnectedGlassesConnectionStatus,\n isConnectedWifiStatus,\n isEnabledHotspotStatus,\n isReadyGlassesConnectionStatus,\n} from \"./BluetoothSdk.types\"\n\nexport type {\n AccelEvent,\n Ar99OtaStatusEvent,\n AudioConnectedEvent,\n AudioDisconnectedEvent,\n AudioPairingNeededEvent,\n BatteryStatusEvent,\n BluetoothSdkEvent,\n BluetoothSdkEventListener,\n BluetoothSdkEventMap,\n BluetoothSdkEventName,\n BluetoothSdkPublicModule as BluetoothSdkModule,\n BluetoothSdkSubscription,\n ButtonPhotoSize,\n PhotoCaptureDefaults,\n ButtonPressEvent,\n CameraFovPreset,\n CameraFovRequest,\n CameraFovResult,\n CameraRoiPosition,\n CompatibleGlassesSearchStopEvent,\n ConnectOptions,\n ConnectedGlassesConnectionStatus,\n ConnectedWifiStatus,\n Device,\n DeviceModel,\n EnabledHotspotStatus,\n GalleryStatusEvent,\n G2FirmwareArtifact,\n G2FirmwareFlashProgressEvent,\n G2FirmwareFlashResult,\n G2FirmwareTarget,\n KeyboardKeyEvent,\n KeyboardAdvertEvent,\n KeyboardPairingEvent,\n KeyboardBridgeState,\n KeyboardBridgeStatus,\n GlassesConnectionStatus,\n GlassesNotificationConfig,\n GlassesNotificationFeed,\n GlassesNotificationStatus,\n GlassesMediaVolumeGetResult,\n GlassesMediaVolumeSetResult,\n GlassesNotReadyEvent,\n HeadUpEvent,\n HotspotErrorEvent,\n HotspotStatus,\n HotspotStatusChangeEvent,\n GlassesSessionChangedEvent,\n KeepAliveAckEvent,\n LocalTranscriptionEvent,\n LogEvent,\n MicLc3Event,\n MicHealthEvent,\n MicMode,\n MicPcmEvent,\n MicPreference,\n OtaStartAckEvent,\n OtaProgress,\n OtaProgressStatus,\n OtaStage,\n OtaStatus,\n OtaStatusEvent,\n OtaQueryResult,\n OtaUpdateInfo,\n ReleaseChangelog,\n SpeakerEnrollProgressEvent,\n SpeakerEnrollResultEvent,\n MtkUpdateCompleteEvent,\n PairFailureEvent,\n PairingInfoEvent,\n EnteringPairingModeEvent,\n OwnerReplacedEvent,\n PhotoCaptureMetadata,\n PhotoResolvedConfig,\n PhotoCompression,\n PhotoFpsRange,\n PhotoMeteredPreview,\n PhotoMode,\n PublicBluetoothStatus,\n NotificationUploadResult,\n PhoneNotificationUpload,\n PublicGlassesStatus,\n PhotoTransferMethod,\n PhotoResponseEvent,\n PhotoRequestedCaptureConfig,\n PhotoRequestParams,\n PhotoSize,\n PhotoStatusEvent,\n PhotoStatusState,\n PhotoSuccessResponseEvent,\n RgbLedAction,\n RgbLedColor,\n RgbLedControlResponseEvent,\n RgbLedControlSuccessResponseEvent,\n ScanModelOptions,\n ScanOptions,\n ScanResultsCallback,\n SpeakingStatusEvent,\n SettingsAckEvent,\n SettingsAckSetting,\n SettingsAckSuccessEvent,\n SettingsAckSuccessStatus,\n SettingsAckStatus,\n StreamAudioConfig,\n StreamResolvedConfig,\n StreamStartRequest,\n StreamStatusEvent,\n StreamStatusLifecycleState,\n StreamStatusReconnectState,\n StreamStatusState,\n StreamVideoConfig,\n SwipeVolumeStatusEvent,\n SwitchStatusEvent,\n TouchEvent,\n VideoRecordingDefaults,\n VideoRecordingStartedStatusEvent,\n VideoRecordingStatusEvent,\n VideoRecordingStatusState,\n VideoRecordingStoppedStatusEvent,\n VideoRecordingSuccessStatusEvent,\n VersionInfoEvent,\n VersionInfoResult,\n WifiScanResultEvent,\n VoiceActivityDetectionStatusEvent,\n WifiSearchResult,\n WifiStatus,\n WifiStatusChangeEvent,\n} from \"./BluetoothSdk.types\"\n"]}
|
|
@@ -897,6 +897,24 @@ public class BluetoothSdkModule: Module, BluetoothSDKDelegate {
|
|
|
897
897
|
STTTools.extractTarBz2(sourcePath: sourcePath, destinationPath: destinationPath)
|
|
898
898
|
}
|
|
899
899
|
|
|
900
|
+
// MARK: - Offline Translation
|
|
901
|
+
|
|
902
|
+
AsyncFunction("getOfflineTranslationLanguages") { (source: String) -> [[String: String]] in
|
|
903
|
+
await OfflineTranslator.languages(source: source)
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
AsyncFunction("getOfflineTranslationStatus") { (source: String, target: String) -> String in
|
|
907
|
+
await OfflineTranslator.status(source: source, target: target)
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
AsyncFunction("downloadOfflineTranslation") { (source: String, target: String) -> String in
|
|
911
|
+
try await OfflineTranslator.download(source: source, target: target)
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
AsyncFunction("translateOffline") { (text: String, source: String, target: String) -> String in
|
|
915
|
+
try await OfflineTranslator.translate(text: text, source: source, target: target)
|
|
916
|
+
}
|
|
917
|
+
|
|
900
918
|
// MARK: - TTS Model Management
|
|
901
919
|
|
|
902
920
|
AsyncFunction("setTtsModelDetails") { (path: String, languageCode: String) in
|
|
@@ -58,6 +58,8 @@ Pod::Spec.new do |s|
|
|
|
58
58
|
ios_frameworks = ['AVFoundation', 'CoreBluetooth', 'UIKit', 'CoreGraphics']
|
|
59
59
|
ios_frameworks << 'Network' if include_expo_adapter
|
|
60
60
|
s.frameworks = ios_frameworks
|
|
61
|
+
# iOS 18+ only; the deployment target is older, so link it weakly.
|
|
62
|
+
s.weak_frameworks = ['Translation']
|
|
61
63
|
|
|
62
64
|
# System libraries required by Glassly
|
|
63
65
|
# Compression is a .tbd library, not a framework (import Compression autolinks it)
|
|
@@ -11,7 +11,7 @@ enum BluetoothSdkDefaults {
|
|
|
11
11
|
static let voiceActivityDetectionEnabled = false
|
|
12
12
|
static let loudnessGateEnabled = true
|
|
13
13
|
private static let infoSdkVersionKey = "BluetoothSdkVersion"
|
|
14
|
-
private static let swiftPackageSdkVersion = "0.3.
|
|
14
|
+
private static let swiftPackageSdkVersion = "0.3.1-beta.514"
|
|
15
15
|
private static let swiftPackageSdkVersionPlaceholder = "__GLASSLY" + "_BLUETOOTH_SDK_VERSION__"
|
|
16
16
|
|
|
17
17
|
private static func normalizedSdkVersion(_ value: String?) -> String? {
|
|
@@ -4,6 +4,7 @@ import Foundation
|
|
|
4
4
|
let generatedReleaseChangelogs: [ReleaseChangelog] = [
|
|
5
5
|
ReleaseChangelog(version: "3.2.0", markdown: "This release is under active development. User-facing changes will be documented as they land."),
|
|
6
6
|
ReleaseChangelog(version: "3.1.0", markdown: "Software updates are more reliable, with clearer progress and recovery when the glasses restart.\n\n- Glassly, Glassly Engine, the Bluetooth SDK, and the glasses client now share one coordinated release version.\n- Mentra Live updates can continue across APK, system, and firmware restarts without asking the user to start the same update again.\n- Bluetooth photo capture and transfer diagnostics are more precise and less disruptive to normal glasses traffic."),
|
|
7
|
+
ReleaseChangelog(version: "0.3.1", markdown: "This release is under active development. User-facing changes will be documented as they land."),
|
|
7
8
|
ReleaseChangelog(version: "0.3.0", markdown: "This release is under active development. User-facing changes will be documented as they land."),
|
|
8
9
|
ReleaseChangelog(version: "0.2.9", markdown: "This release is under active development. User-facing changes will be documented as they land."),
|
|
9
10
|
ReleaseChangelog(version: "0.2.8", markdown: "This release is under active development. User-facing changes will be documented as they land."),
|
|
@@ -2,10 +2,10 @@ import Foundation
|
|
|
2
2
|
|
|
3
3
|
/// Generated by release CI. Do not edit in a release checkout.
|
|
4
4
|
enum GeneratedReleaseMetadata {
|
|
5
|
-
static let familyBaseVersion = "0.3.
|
|
6
|
-
static let releaseIdentity = "0.3.
|
|
7
|
-
static let releaseSetId = "glassly-0.3.
|
|
8
|
-
static let sourceCommit = "
|
|
5
|
+
static let familyBaseVersion = "0.3.1"
|
|
6
|
+
static let releaseIdentity = "0.3.1-beta.514"
|
|
7
|
+
static let releaseSetId = "glassly-0.3.1-beta.514"
|
|
8
|
+
static let sourceCommit = "3777078a83528c6db9812e0e95cac3fa8faa5284"
|
|
9
9
|
static let otaManifestUrl = ""
|
|
10
10
|
static let otaManifestSha256 = ""
|
|
11
11
|
}
|
package/ios/Source/sgcs/G2.swift
CHANGED
|
@@ -132,8 +132,10 @@ private enum OsEventType: Int32 {
|
|
|
132
132
|
case tapStart = 9 // press recognized (hold start)
|
|
133
133
|
case tapEnd = 10 // released
|
|
134
134
|
case tapThenHold = 11 // CFW extension: 2.2.9 tap-then-hold (stock Menu gesture)
|
|
135
|
-
//
|
|
136
|
-
//
|
|
135
|
+
// CFW extension: IMU head-tilt, forwarded while an EvenHub page is on
|
|
136
|
+
// screen. There is no head-down counterpart.
|
|
137
|
+
case headUp = 12
|
|
138
|
+
// 13 was an experimental temple edge and is burned. 14 is the Glassly CFW's ring
|
|
137
139
|
// touch-down (R1 subtype 0x0d, GLASSLYCFW/37 on 2.3.0.24). Only the ring
|
|
138
140
|
// produces it and the stock sender leaves source 0, so the id itself is the
|
|
139
141
|
// ring marker. Unknown ring wire types arrive as 127 and are dropped.
|
|
@@ -7076,6 +7078,15 @@ final class G2: NSObject, SGCManager {
|
|
|
7076
7078
|
}
|
|
7077
7079
|
}
|
|
7078
7080
|
|
|
7081
|
+
if eventType == .headUp {
|
|
7082
|
+
Bridge.log("G2: HEAD_UP")
|
|
7083
|
+
// The firmware never reports the head coming back down, so
|
|
7084
|
+
// rearm the store or the next head-up would be an unchanged value.
|
|
7085
|
+
DeviceStore.shared.store.set("glasses", "headUp", false)
|
|
7086
|
+
DeviceStore.shared.apply("glasses", "headUp", true)
|
|
7087
|
+
return
|
|
7088
|
+
}
|
|
7089
|
+
|
|
7079
7090
|
guard let gestureName = mapEventTypeToGesture(eventType) else {
|
|
7080
7091
|
Bridge.log("G2: no gesture mapping for \(eventType) \(sysFields)")
|
|
7081
7092
|
return
|
|
@@ -7162,6 +7173,7 @@ final class G2: NSObject, SGCManager {
|
|
|
7162
7173
|
case .tapThenHold: return "tap_then_hold"
|
|
7163
7174
|
case .ringTouchDown: return "touch_down"
|
|
7164
7175
|
case .imuDataReport: return nil
|
|
7176
|
+
case .headUp: return nil // head position, not a gesture
|
|
7165
7177
|
case .abnormalExit: return nil // don't report abnormal exits as gestures
|
|
7166
7178
|
}
|
|
7167
7179
|
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import Foundation
|
|
2
|
+
|
|
3
|
+
#if canImport(Translation) && canImport(UIKit)
|
|
4
|
+
import SwiftUI
|
|
5
|
+
import Translation
|
|
6
|
+
import UIKit
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
enum OfflineTranslationError: LocalizedError {
|
|
10
|
+
case unavailable
|
|
11
|
+
case notInstalled(String)
|
|
12
|
+
case noPresenter
|
|
13
|
+
case failed(String)
|
|
14
|
+
|
|
15
|
+
/// Leading token is the stable code the JS side matches on.
|
|
16
|
+
var errorDescription: String? {
|
|
17
|
+
switch self {
|
|
18
|
+
case .unavailable: "unavailable: on-device translation requires iOS 26"
|
|
19
|
+
case let .notInstalled(pair): "not_installed: \(pair) is not downloaded"
|
|
20
|
+
case .noPresenter: "no_presenter: no visible window to present the download prompt"
|
|
21
|
+
case let .failed(message): "failed: \(message)"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/// On-device text translation backed by Apple's Translation framework.
|
|
27
|
+
/// Sessions are created without UI (`TranslationSession(installedSource:target:)`,
|
|
28
|
+
/// iOS 26), so a pair must be installed before it can translate; installing
|
|
29
|
+
/// goes through the system download prompt in `download`.
|
|
30
|
+
enum OfflineTranslator {
|
|
31
|
+
static var isSupported: Bool {
|
|
32
|
+
#if canImport(Translation) && canImport(UIKit)
|
|
33
|
+
if #available(iOS 26.0, *) {
|
|
34
|
+
return true
|
|
35
|
+
}
|
|
36
|
+
#endif
|
|
37
|
+
return false
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/// Every language the system can translate `source` into, with its install state.
|
|
41
|
+
static func languages(source: String) async -> [[String: String]] {
|
|
42
|
+
#if canImport(Translation) && canImport(UIKit)
|
|
43
|
+
if #available(iOS 26.0, *) {
|
|
44
|
+
let availability = makeAvailability()
|
|
45
|
+
let from = Locale.Language(identifier: source)
|
|
46
|
+
var rows: [[String: String]] = []
|
|
47
|
+
for language in await availability.supportedLanguages {
|
|
48
|
+
let code = language.minimalIdentifier
|
|
49
|
+
let status = await availability.status(from: from, to: language)
|
|
50
|
+
if status == .unsupported {
|
|
51
|
+
continue
|
|
52
|
+
}
|
|
53
|
+
rows.append([
|
|
54
|
+
"code": code,
|
|
55
|
+
"name": Locale.current.localizedString(forIdentifier: code) ?? code,
|
|
56
|
+
"status": statusName(status),
|
|
57
|
+
])
|
|
58
|
+
}
|
|
59
|
+
return rows.sorted { ($0["name"] ?? "") < ($1["name"] ?? "") }
|
|
60
|
+
}
|
|
61
|
+
#endif
|
|
62
|
+
return []
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static func status(source: String, target: String) async -> String {
|
|
66
|
+
#if canImport(Translation) && canImport(UIKit)
|
|
67
|
+
if #available(iOS 26.0, *) {
|
|
68
|
+
let status = await makeAvailability().status(
|
|
69
|
+
from: Locale.Language(identifier: source),
|
|
70
|
+
to: Locale.Language(identifier: target)
|
|
71
|
+
)
|
|
72
|
+
return statusName(status)
|
|
73
|
+
}
|
|
74
|
+
#endif
|
|
75
|
+
return "unavailable"
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/// Shows the system prompt that downloads the pair, then reports its status.
|
|
79
|
+
static func download(source: String, target: String) async throws -> String {
|
|
80
|
+
#if canImport(Translation) && canImport(UIKit)
|
|
81
|
+
if #available(iOS 26.0, *) {
|
|
82
|
+
try await presentDownload(
|
|
83
|
+
source: Locale.Language(identifier: source),
|
|
84
|
+
target: Locale.Language(identifier: target)
|
|
85
|
+
)
|
|
86
|
+
await SessionStore.shared.drop(source: source, target: target)
|
|
87
|
+
return await status(source: source, target: target)
|
|
88
|
+
}
|
|
89
|
+
#endif
|
|
90
|
+
throw OfflineTranslationError.unavailable
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
static func translate(text: String, source: String, target: String) async throws -> String {
|
|
94
|
+
#if canImport(Translation) && canImport(UIKit)
|
|
95
|
+
if #available(iOS 26.0, *) {
|
|
96
|
+
return try await SessionStore.shared.translate(text: text, source: source, target: target)
|
|
97
|
+
}
|
|
98
|
+
#endif
|
|
99
|
+
throw OfflineTranslationError.unavailable
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
#if canImport(Translation) && canImport(UIKit)
|
|
104
|
+
@available(iOS 26.0, *)
|
|
105
|
+
private extension OfflineTranslator {
|
|
106
|
+
static func makeAvailability() -> LanguageAvailability {
|
|
107
|
+
// Low latency keeps the downloadable language-pack flow, which is
|
|
108
|
+
// what works with no network.
|
|
109
|
+
if #available(iOS 26.4, *) {
|
|
110
|
+
return LanguageAvailability(preferredStrategy: .lowLatency)
|
|
111
|
+
}
|
|
112
|
+
return LanguageAvailability()
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static func statusName(_ status: LanguageAvailability.Status) -> String {
|
|
116
|
+
switch status {
|
|
117
|
+
case .installed: return "installed"
|
|
118
|
+
case .supported: return "supported"
|
|
119
|
+
case .unsupported: return "unsupported"
|
|
120
|
+
@unknown default: return "unsupported"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
@MainActor
|
|
125
|
+
static func presentDownload(source: Locale.Language, target: Locale.Language) async throws {
|
|
126
|
+
guard let presenter = topViewController() else { throw OfflineTranslationError.noPresenter }
|
|
127
|
+
let configuration: TranslationSession.Configuration = if #available(iOS 26.4, *) {
|
|
128
|
+
.init(source: source, target: target, preferredStrategy: .lowLatency)
|
|
129
|
+
} else {
|
|
130
|
+
.init(source: source, target: target)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<Void, Error>) in
|
|
134
|
+
var host: UIViewController?
|
|
135
|
+
var finished = false
|
|
136
|
+
let view = DownloadHost(configuration: configuration) { result in
|
|
137
|
+
if finished {
|
|
138
|
+
return
|
|
139
|
+
}
|
|
140
|
+
finished = true
|
|
141
|
+
host?.willMove(toParent: nil)
|
|
142
|
+
host?.view.removeFromSuperview()
|
|
143
|
+
host?.removeFromParent()
|
|
144
|
+
continuation.resume(with: result)
|
|
145
|
+
}
|
|
146
|
+
let controller = UIHostingController(rootView: view)
|
|
147
|
+
controller.view.backgroundColor = .clear
|
|
148
|
+
controller.view.isUserInteractionEnabled = false
|
|
149
|
+
controller.view.frame = CGRect(x: 0, y: 0, width: 1, height: 1)
|
|
150
|
+
presenter.addChild(controller)
|
|
151
|
+
presenter.view.addSubview(controller.view)
|
|
152
|
+
controller.didMove(toParent: presenter)
|
|
153
|
+
host = controller
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@MainActor
|
|
158
|
+
static func topViewController() -> UIViewController? {
|
|
159
|
+
let scenes = UIApplication.shared.connectedScenes.compactMap { $0 as? UIWindowScene }
|
|
160
|
+
let scene = scenes.first { $0.activationState == .foregroundActive } ?? scenes.first
|
|
161
|
+
let window = scene?.windows.first { $0.isKeyWindow } ?? scene?.windows.first
|
|
162
|
+
var top = window?.rootViewController
|
|
163
|
+
while let presented = top?.presentedViewController {
|
|
164
|
+
top = presented
|
|
165
|
+
}
|
|
166
|
+
return top
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/// Invisible host: `.translationTask` is the only API that hands out a
|
|
171
|
+
/// session allowed to request downloads.
|
|
172
|
+
@available(iOS 26.0, *)
|
|
173
|
+
private struct DownloadHost: View {
|
|
174
|
+
let configuration: TranslationSession.Configuration
|
|
175
|
+
let onFinish: @MainActor (Result<Void, Error>) -> Void
|
|
176
|
+
|
|
177
|
+
var body: some View {
|
|
178
|
+
Color.clear.translationTask(configuration) { @MainActor session in
|
|
179
|
+
do {
|
|
180
|
+
try await session.prepareTranslation()
|
|
181
|
+
onFinish(.success(()))
|
|
182
|
+
} catch {
|
|
183
|
+
onFinish(.failure(OfflineTranslationError.failed(error.localizedDescription)))
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@available(iOS 26.0, *)
|
|
190
|
+
private actor SessionStore {
|
|
191
|
+
static let shared = SessionStore()
|
|
192
|
+
|
|
193
|
+
private var sessions: [String: TranslationSession] = [:]
|
|
194
|
+
|
|
195
|
+
func drop(source: String, target: String) {
|
|
196
|
+
sessions.removeValue(forKey: "\(source)>\(target)")?.cancel()
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
func translate(text: String, source: String, target: String) async throws -> String {
|
|
200
|
+
let key = "\(source)>\(target)"
|
|
201
|
+
let session = sessions[key] ?? makeSession(source: source, target: target)
|
|
202
|
+
sessions[key] = session
|
|
203
|
+
do {
|
|
204
|
+
return try await session.translate(text).targetText
|
|
205
|
+
} catch {
|
|
206
|
+
// A failed session may be cancelled or stale; rebuild on the next call.
|
|
207
|
+
sessions.removeValue(forKey: key)
|
|
208
|
+
if TranslationError.notInstalled ~= error {
|
|
209
|
+
throw OfflineTranslationError.notInstalled(key)
|
|
210
|
+
}
|
|
211
|
+
throw OfflineTranslationError.failed(error.localizedDescription)
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
private func makeSession(source: String, target: String) -> TranslationSession {
|
|
216
|
+
let from = Locale.Language(identifier: source)
|
|
217
|
+
let to = Locale.Language(identifier: target)
|
|
218
|
+
if #available(iOS 26.4, *) {
|
|
219
|
+
return TranslationSession(installedSource: from, target: to, preferredStrategy: .lowLatency)
|
|
220
|
+
}
|
|
221
|
+
return TranslationSession(installedSource: from, target: to)
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
#endif
|
|
@@ -23,31 +23,29 @@ class G1Text {
|
|
|
23
23
|
|
|
24
24
|
init() {}
|
|
25
25
|
|
|
26
|
-
/// Converts text to the
|
|
26
|
+
/// Converts text to the Latin glyphs available in G1 firmware: precomposed Latin-1
|
|
27
|
+
/// letters (ä, ö, ü, ß, é, ñ, ...) pass through, anything beyond is folded to base Latin.
|
|
27
28
|
/// Newer glasses bypass this G1-only transport and keep the original text.
|
|
28
29
|
static func sanitizeForDisplay(_ text: String) -> String {
|
|
29
|
-
let
|
|
30
|
+
let foldLocale = Locale(identifier: "en_US_POSIX")
|
|
31
|
+
return text.precomposedStringWithCanonicalMapping.reduce(into: "") { result, character in
|
|
30
32
|
switch character {
|
|
31
|
-
case "Đ"
|
|
32
|
-
case "đ"
|
|
33
|
+
case "Đ": result.append("D")
|
|
34
|
+
case "đ": result.append("d")
|
|
33
35
|
case "Ł": result.append("L")
|
|
34
36
|
case "ł": result.append("l")
|
|
35
|
-
case "Ø": result.append("O")
|
|
36
|
-
case "ø": result.append("o")
|
|
37
|
-
case "Æ": result.append("AE")
|
|
38
|
-
case "æ": result.append("ae")
|
|
39
37
|
case "Œ": result.append("OE")
|
|
40
38
|
case "œ": result.append("oe")
|
|
41
39
|
case "ẞ": result.append("SS")
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
default:
|
|
41
|
+
let scalars = character.unicodeScalars
|
|
42
|
+
if scalars.count == 1, let scalar = scalars.first, (0xC0 ... 0xFF).contains(scalar.value) {
|
|
43
|
+
result.append(character)
|
|
44
|
+
} else {
|
|
45
|
+
result.append(String(character).folding(options: .diacriticInsensitive, locale: foldLocale))
|
|
46
|
+
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
|
-
|
|
49
|
-
return expanded
|
|
50
|
-
.folding(options: .diacriticInsensitive, locale: Locale(identifier: "en_US_POSIX"))
|
|
51
49
|
}
|
|
52
50
|
|
|
53
51
|
// MARK: - Text Wall Methods
|
package/package.json
CHANGED
|
@@ -257,6 +257,10 @@ export type GlassesMediaVolumeSetResult = {
|
|
|
257
257
|
statusCode: number
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
+
export type OfflineTranslationStatus = "installed" | "supported" | "unsupported" | "unavailable"
|
|
261
|
+
|
|
262
|
+
export type OfflineTranslationLanguage = {code: string; name: string; status: OfflineTranslationStatus}
|
|
263
|
+
|
|
260
264
|
export type LocalTranscriptionEvent = {
|
|
261
265
|
text: string
|
|
262
266
|
isFinal?: boolean
|
|
@@ -1562,6 +1566,12 @@ export interface BluetoothSdkPublicModule {
|
|
|
1562
1566
|
extractTarBz2(sourcePath: string, destinationPath: string): Promise<boolean>
|
|
1563
1567
|
restartTranscriber(): Promise<void>
|
|
1564
1568
|
|
|
1569
|
+
// Offline translation (iOS 26+; rejects elsewhere)
|
|
1570
|
+
getOfflineTranslationLanguages(source: string): Promise<OfflineTranslationLanguage[]>
|
|
1571
|
+
getOfflineTranslationStatus(source: string, target: string): Promise<OfflineTranslationStatus>
|
|
1572
|
+
downloadOfflineTranslation(source: string, target: string): Promise<OfflineTranslationStatus>
|
|
1573
|
+
translateOffline(text: string, source: string, target: string): Promise<string>
|
|
1574
|
+
|
|
1565
1575
|
// TTS Commands (TODO: MOVE TO CRUST)
|
|
1566
1576
|
setTtsModelDetails(path: string, languageCode: string): Promise<void>
|
|
1567
1577
|
getTtsModelPath(): Promise<string>
|