@glassly/engine 0.1.0-dev.61 → 0.1.0-dev.62
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/README.md +5 -1
- package/build/facades/ota.d.ts +3 -1
- package/build/facades/ota.d.ts.map +1 -1
- package/build/facades/ota.js +4 -2
- package/build/facades/ota.js.map +1 -1
- package/build/generated/releaseMetadata.js +3 -3
- package/build/generated/releaseMetadata.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/react/MentraLiveOtaFlow.d.ts +6 -1
- package/build/react/MentraLiveOtaFlow.d.ts.map +1 -1
- package/build/react/MentraLiveOtaFlow.js +136 -14
- package/build/react/MentraLiveOtaFlow.js.map +1 -1
- package/build/react/useMentraLiveOta.d.ts +5 -1
- package/build/react/useMentraLiveOta.d.ts.map +1 -1
- package/build/react/useMentraLiveOta.js +135 -58
- package/build/react/useMentraLiveOta.js.map +1 -1
- package/build/services/DisplayProcessor.d.ts +3 -3
- package/build/services/DisplayProcessor.js +3 -3
- package/build/services/DisplayProcessor.js.map +1 -1
- package/build/services/LocalDisplayManager.d.ts +2 -2
- package/build/services/LocalDisplayManager.js +2 -2
- package/build/services/LocalDisplayManager.js.map +1 -1
- package/build/services/OtaInstallCoordinator.d.ts +2 -0
- package/build/services/OtaInstallCoordinator.d.ts.map +1 -1
- package/build/services/OtaInstallCoordinator.js +21 -1
- package/build/services/OtaInstallCoordinator.js.map +1 -1
- package/build/services/PhonePhotoCoordinator.js +1 -1
- package/build/services/PhonePhotoCoordinator.js.map +1 -1
- package/build/services/StreamLifecycleController.d.ts +4 -0
- package/build/services/StreamLifecycleController.d.ts.map +1 -1
- package/build/services/StreamLifecycleController.js +4 -0
- package/build/services/StreamLifecycleController.js.map +1 -1
- package/build/services/otaInstallPolicy.d.ts +4 -0
- package/build/services/otaInstallPolicy.d.ts.map +1 -1
- package/build/services/otaInstallPolicy.js +4 -0
- package/build/services/otaInstallPolicy.js.map +1 -1
- package/build/types/applet.d.ts +1 -1
- package/build/types/applet.js.map +1 -1
- package/build/types/capabilities/even-realities-g2.d.ts.map +1 -1
- package/build/types/capabilities/even-realities-g2.js +2 -2
- package/build/types/capabilities/even-realities-g2.js.map +1 -1
- package/build/types/hardware.d.ts.map +1 -1
- package/build/types/hardware.js +1 -0
- package/build/types/hardware.js.map +1 -1
- package/build/types/index.d.ts +1 -1
- package/build/types/index.d.ts.map +1 -1
- package/build/types/index.js +1 -1
- package/build/types/index.js.map +1 -1
- package/build/utils/display/composer/ColumnComposer.d.ts +1 -1
- package/build/utils/display/composer/ColumnComposer.js +1 -1
- package/build/utils/display/composer/ColumnComposer.js.map +1 -1
- package/package.json +8 -7
- package/src/facades/ota.ts +4 -2
- package/src/generated/releaseMetadata.ts +3 -3
- package/src/index.ts +2 -1
- package/src/react/MentraLiveOtaFlow.tsx +226 -41
- package/src/react/useMentraLiveOta.ts +146 -60
- package/src/services/DisplayProcessor.ts +3 -3
- package/src/services/LocalDisplayManager.ts +2 -2
- package/src/services/OtaInstallCoordinator.ts +21 -0
- package/src/services/PhonePhotoCoordinator.ts +1 -1
- package/src/services/StreamLifecycleController.ts +4 -0
- package/src/services/otaInstallPolicy.ts +4 -0
- package/src/types/applet.ts +1 -1
- package/src/types/capabilities/even-realities-g2.ts +3 -2
- package/src/types/hardware.ts +1 -0
- package/src/types/index.ts +1 -1
- package/src/utils/display/composer/ColumnComposer.ts +1 -1
package/README.md
CHANGED
|
@@ -69,7 +69,7 @@ import BluetoothSdk from "@glassly/engine/bluetooth-sdk"
|
|
|
69
69
|
### Mentra Live OTA flow
|
|
70
70
|
|
|
71
71
|
Bluetooth-only hosts can render the OTA flow without configuring or starting
|
|
72
|
-
the authenticated cloud
|
|
72
|
+
the authenticated cloud connection or miniapp runtime:
|
|
73
73
|
|
|
74
74
|
```tsx
|
|
75
75
|
import {MentraLiveOtaFlow} from "@glassly/engine/ota"
|
|
@@ -91,6 +91,10 @@ const ota = useMentraLiveOta({onFinished, onOpenWifiSetup})
|
|
|
91
91
|
// Render ota.state.screen and invoke ota.install(), retryInstall(), finish(), etc.
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
On `up_to_date`, use `ota.state.completedUpdate` to distinguish a completed
|
|
95
|
+
update session from a standalone check. `releaseTransition` is optional release
|
|
96
|
+
metadata and is not a completion marker.
|
|
97
|
+
|
|
94
98
|
Customize presentation only. Engine must remain responsible for OTA ordering,
|
|
95
99
|
hotspot staging, restart recovery, retries, and verification. The canonical
|
|
96
100
|
stock and custom integration guide is
|
package/build/facades/ota.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ import { type OtaInstallSnapshot } from "../services/OtaInstallCoordinator";
|
|
|
3
3
|
import { type OtaCheckCurrentGlassesOptions, type OtaCheckCurrentGlassesResult } from "../services/OtaUpdateCheckService";
|
|
4
4
|
declare function projectSnapshot(): {
|
|
5
5
|
connected: boolean;
|
|
6
|
+
ready: boolean;
|
|
6
7
|
buildNumber: string | null;
|
|
7
8
|
appVersion: string | null;
|
|
8
9
|
mtkFirmwareVersion: string | null;
|
|
9
10
|
besFirmwareVersion: string | null;
|
|
11
|
+
batteryLevel: number | null;
|
|
10
12
|
hotspotOtaVersion: number;
|
|
11
13
|
wifiConnected: boolean;
|
|
12
14
|
wifiStatusKnown: boolean;
|
|
@@ -22,7 +24,7 @@ export type { OtaProgress, OtaProgressStatus, OtaStatus, OtaUpdateInfo, ReleaseC
|
|
|
22
24
|
export declare const ota: {
|
|
23
25
|
/**
|
|
24
26
|
* Start the device-status and OTA projections without starting the authenticated
|
|
25
|
-
* cloud
|
|
27
|
+
* cloud connection or miniapp runtime. This is the explicit entry point for Bluetooth-only hosts.
|
|
26
28
|
* Idempotent and safe when the full engine runtime is already running.
|
|
27
29
|
*/
|
|
28
30
|
initialize: () => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ota.d.ts","sourceRoot":"","sources":["../../src/facades/ota.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,gBAAgB,EACjB,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAwB,KAAK,kBAAkB,EAAC,MAAM,mCAAmC,CAAA;AAGhG,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EAClC,MAAM,mCAAmC,CAAA;AAE1C,iBAAS,eAAe
|
|
1
|
+
{"version":3,"file":"ota.d.ts","sourceRoot":"","sources":["../../src/facades/ota.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,SAAS,EACT,aAAa,EACb,gBAAgB,EACjB,MAAM,wBAAwB,CAAA;AAG/B,OAAO,EAAwB,KAAK,kBAAkB,EAAC,MAAM,mCAAmC,CAAA;AAGhG,OAAO,EAEL,KAAK,6BAA6B,EAClC,KAAK,4BAA4B,EAClC,MAAM,mCAAmC,CAAA;AAE1C,iBAAS,eAAe;;;;;;;;;;;;;;;;;EAoBvB;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAC5D,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,6BAA6B,EAC7B,4BAA4B,GAC7B,CAAA;AAED,eAAO,MAAM,GAAG;IAEd;;;;OAIG;;IAMH;;;;;OAKG;8BACuB,MAAM,GAAG,IAAI,KAAG,OAAO,CAAC,gBAAgB,CAAC;IAQnE;;;OAGG;;IAEH,sGAAsG;gCAC1E,6BAA6B;IACzD,wGAAwG;yCACnE,MAAM,GAAG,IAAI,cAAc,MAAM,GAAG,IAAI,KAAG,gBAAgB,EAAE;IAElG,+CAA+C;;IAE/C,yEAAyE;;IAMzE;;;;;OAKG;4CACqC,aAAa,CAAC,SAAS,CAAC,KAAG,aAAa,GAAG,IAAI;IAQvF;;;;;OAKG;;IAIH;;;OAGG;yCACkC,OAAO;IAE5C;;;;OAIG;;QAED,oFAAoF;0BAClE,4BAA4B;QAC9C,2FAA2F;;QAE3F,+EAA+E;;QAE/E,+EAA+E;;QAE/E,4EAA4E;;QAE5E,8FAA8F;;QAE9F,qFAAqF;wBACvE,kBAAkB;QAChC,iGAAiG;yBAChF,CAAC,QAAQ,EAAE,kBAAkB,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;;IAGxE,8EAA8E;2BACzD,aAAa,GAAG,IAAI;IACzC,iFAAiF;kBACrE,SAAS,GAAG,IAAI;IAC5B,iEAAiE;oBACnD,WAAW;IAEzB,iGAAiG;4BACzE,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAU3E,uEAAuE;mBACxD,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;IAUhE,iEAAiE;qBAChD,CAAC,QAAQ,EAAE,WAAW,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC;CAUhE,CAAA"}
|
package/build/facades/ota.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* progress screen is a pure renderer over its snapshot + attach/detach/retry/finish.
|
|
10
10
|
*/
|
|
11
11
|
import BluetoothSdk from "@glassly/bluetooth-sdk";
|
|
12
|
-
import { isGlassesConnected, useGlassesStore } from "../stores/glasses";
|
|
12
|
+
import { isGlassesConnected, isGlassesReady, useGlassesStore } from "../stores/glasses";
|
|
13
13
|
import { resolveOtaManifestUrl } from "../services/otaManifestUrl";
|
|
14
14
|
import { otaInstallCoordinator } from "../services/OtaInstallCoordinator";
|
|
15
15
|
import { startGlassesStatusProjection } from "../services/GlassesStatusProjection";
|
|
@@ -19,10 +19,12 @@ function projectSnapshot() {
|
|
|
19
19
|
const s = useGlassesStore.getState();
|
|
20
20
|
return {
|
|
21
21
|
connected: isGlassesConnected(s.connection),
|
|
22
|
+
ready: isGlassesReady(s.connection),
|
|
22
23
|
buildNumber: s.buildNumber || null,
|
|
23
24
|
appVersion: s.appVersion || null,
|
|
24
25
|
mtkFirmwareVersion: s.mtkFirmwareVersion || null,
|
|
25
26
|
besFirmwareVersion: s.besFirmwareVersion || null,
|
|
27
|
+
batteryLevel: s.batteryLevel >= 0 ? s.batteryLevel : null,
|
|
26
28
|
hotspotOtaVersion: s.hotspotOtaVersion ?? 0,
|
|
27
29
|
wifiConnected: s.wifi.state === "connected",
|
|
28
30
|
wifiStatusKnown: s.wifiStatusKnown,
|
|
@@ -38,7 +40,7 @@ export const ota = {
|
|
|
38
40
|
// --- actions ---
|
|
39
41
|
/**
|
|
40
42
|
* Start the device-status and OTA projections without starting the authenticated
|
|
41
|
-
* cloud
|
|
43
|
+
* cloud connection or miniapp runtime. This is the explicit entry point for Bluetooth-only hosts.
|
|
42
44
|
* Idempotent and safe when the full engine runtime is already running.
|
|
43
45
|
*/
|
|
44
46
|
initialize: async () => {
|
package/build/facades/ota.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ota.js","sourceRoot":"","sources":["../../src/facades/ota.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,YAAY,MAAM,wBAAwB,CAAA;AASjD,OAAO,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAC,qBAAqB,EAA0B,MAAM,mCAAmC,CAAA;AAChG,OAAO,EAAC,4BAA4B,EAAC,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAA;AACtD,OAAO,EACL,4BAA4B,GAG7B,MAAM,mCAAmC,CAAA;AAE1C,SAAS,eAAe;IACtB,MAAM,CAAC,GAAG,eAAe,CAAC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I,CAAA;YACX,EAAE,CAAC,IAAI,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,uEAAuE;IACvE,QAAQ,EAAE,CAAC,EAAsC,EAAgB,EAAE;QACjE,IAAI,IAAI,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAA;QAC/C,OAAO,eAAe,CAAC,SAAS,CAAC,GAAG,EAAE;YACpC,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAA;YACnD,IAAI,MAAM,KAAK,IAAI;gBAAE,OAAM;YAC3B,IAAI,GAAG,MAAM,CAAA;YACb,EAAE,CAAC,MAAM,CAAC,CAAA;QACZ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,iEAAiE;IACjE,UAAU,EAAE,CAAC,EAAmC,EAAgB,EAAE;QAChE,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,CAAA;QAC5C,OAAO,eAAe,CAAC,SAAS,CAAC,GAAG,EAAE;YACpC,MAAM,IAAI,GAAG,eAAe,EAAE,CAAA;YAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAM;YACxB,IAAI,GAAG,GAAG,CAAA;YACV,EAAE,CAAC,IAAI,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["/**\n * ota facade — `engine.ota`: the OEM-facing OTA read/observe surface. Engine's\n * OtaService projects the glasses' OTA BLE events into the engine store; this facade\n * exposes the snapshot + change subscriptions behind the shared OTA flow exported by\n * `@glassly/engine/ota`. Hosts retain only their surrounding navigation and theme/i18n adapters.\n *\n * Availability checks live in engine. Install orchestration lives in engine too:\n * `installSession` fronts the OtaInstallCoordinator state machine (WP 8B) — the host\n * progress screen is a pure renderer over its snapshot + attach/detach/retry/finish.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk\"\nimport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStartAckEvent,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n} from \"@glassly/bluetooth-sdk\"\nimport {isGlassesConnected, useGlassesStore} from \"../stores/glasses\"\nimport {resolveOtaManifestUrl} from \"../services/otaManifestUrl\"\nimport {otaInstallCoordinator, type OtaInstallSnapshot} from \"../services/OtaInstallCoordinator\"\nimport {startGlassesStatusProjection} from \"../services/GlassesStatusProjection\"\nimport {startOtaService} from \"../services/OtaService\"\nimport {\n checkCurrentGlassesForUpdate,\n type OtaCheckCurrentGlassesOptions,\n type OtaCheckCurrentGlassesResult,\n} from \"../services/OtaUpdateCheckService\"\n\nfunction projectSnapshot() {\n const s = useGlassesStore.getState()\n return {\n connected: isGlassesConnected(s.connection),\n buildNumber: s.buildNumber || null,\n appVersion: s.appVersion || null,\n mtkFirmwareVersion: s.mtkFirmwareVersion || null,\n besFirmwareVersion: s.besFirmwareVersion || null,\n hotspotOtaVersion: s.hotspotOtaVersion ?? 0,\n wifiConnected: s.wifi.state === \"connected\",\n wifiStatusKnown: s.wifiStatusKnown,\n manifestUrl: resolveOtaManifestUrl(s.otaVersionUrl, s.buildNumber),\n updateAvailable: s.otaUpdateAvailable,\n status: s.otaStatus,\n legacyProgress: s.otaProgress,\n inProgress: s.otaInProgress,\n mtkUpdatedThisSession: s.mtkUpdatedThisSession,\n }\n}\n\nexport type OtaSnapshot = ReturnType<typeof projectSnapshot>\nexport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n OtaInstallSnapshot,\n OtaCheckCurrentGlassesOptions,\n OtaCheckCurrentGlassesResult,\n}\n\nexport const ota = {\n // --- actions ---\n /**\n * Start the device-status and OTA projections without starting the authenticated\n * cloud/miniapp runtime. This is the explicit entry point for Bluetooth-only hosts.\n * Idempotent and safe when the full engine runtime is already running.\n */\n initialize: async () => {\n const hydrated = startGlassesStatusProjection()\n startOtaService()\n await hydrated\n },\n /**\n * Start the firmware install with the resolved OTA manifest URL. Progress lands on\n * `status()`/`onStatus()`. (The host resolves the manifest URL — developer override,\n * host pin, or Engine release pin resolution stays with the OTA config; the stuck/retry watchdog is its own\n * resilience layer on top of this command.)\n */\n install: (otaVersionUrl?: string | null): Promise<OtaStartAckEvent> => BluetoothSdk.startOtaUpdate(otaVersionUrl),\n // Deferred: this facade entry was intended to become the engine-owned retry/check\n // action, but BluetoothSdk.checkForOtaUpdate() only returns a boolean. Exposing it\n // here would make callers think the rich otaUpdateAvailable read model is refreshed,\n // while the original view still depends on the host-side manifest compare to build\n // versionName/updates/totalSize. Keep that behavior unchanged until the whole rich\n // availability check moves into engine.\n // retry: () => BluetoothSdk.checkForOtaUpdate(),\n /**\n * Keep glasses awake while an OTA session is actively progressing.\n * @deprecated Legacy progress route (build < 37) only — removed with WP 8D.\n */\n ping: () => BluetoothSdk.ping(),\n /** Resolve and compare the current glasses against the OTA manifest, then update the OTA snapshot. */\n checkForUpdates: (options?: OtaCheckCurrentGlassesOptions) => checkCurrentGlassesForUpdate(options),\n /** Return bundled release changelogs crossed between two coordinated product versions, newest first. */\n getReleaseChangelogs: (fromVersion?: string | null, toVersion?: string | null): ReleaseChangelog[] =>\n BluetoothSdk.getReleaseChangelogs(fromVersion, toVersion),\n /** Clear the available-update prompt state. */\n clearUpdateAvailable: () => useGlassesStore.getState().setOtaUpdateAvailable(null),\n /** Clear active progress/status before entering a fresh install flow. */\n clearProgress: () => {\n const store = useGlassesStore.getState()\n store.setOtaProgress(null)\n store.setOtaStatus(null)\n },\n /**\n * Replace the pending update sequence after an in-flow firmware revalidation.\n * Kept as a named OTA policy operation so host screens do not mutate the raw\n * glasses store.\n * @deprecated Legacy progress route (build < 37) only — removed with WP 8D.\n */\n replacePendingUpdateSequence: (updates: OtaUpdateInfo[\"updates\"]): OtaUpdateInfo | null => {\n const store = useGlassesStore.getState()\n const current = store.otaUpdateAvailable\n if (!current) return null\n const next = {...current, updates}\n store.setOtaUpdateAvailable(next)\n return next\n },\n /**\n * Clear stale build metadata before returning to the update-check screen.\n * This forces the next version_info event through both the native observable\n * store and the engine projection after an APK reboot.\n * @deprecated Legacy progress route (build < 37) only — removed with WP 8D.\n */\n clearBuildNumberForNextCheck: () => {\n useGlassesStore.getState().setGlassesInfo({buildNumber: \"\"})\n },\n /**\n * Mark MTK as already applied during this app session until the glasses reboot/disconnect.\n * @deprecated Legacy progress route (build < 37) only — removed with WP 8D.\n */\n markMtkUpdatedThisSession: (updated: boolean) => useGlassesStore.getState().setMtkUpdatedThisSession(updated),\n\n /**\n * The OTA install state machine (unified `ota_status` sessions, build >= 37).\n * The host progress screen attaches on mount, detaches on unmount, and renders\n * the snapshot; every watchdog/retry/reconnect rule lives in the coordinator.\n */\n installSession: {\n /** Select Wi-Fi or capability-gated hotspot transport for this checked manifest. */\n prepare: (result: OtaCheckCurrentGlassesResult) => otaInstallCoordinator.prepare(result),\n /** Bind the machine to the mounted progress screen. Idempotent per attach/detach cycle. */\n attach: () => otaInstallCoordinator.attach(),\n /** Unbind on unmount: clears all timers/listeners and resets session state. */\n detach: () => otaInstallCoordinator.detach(),\n /** Retry after a failure: clear state and re-send ota_start (if connected). */\n retry: () => otaInstallCoordinator.retry(),\n /** Terminal cleanup for Continue/Done, including hotspot route teardown. */\n finish: () => otaInstallCoordinator.finish(),\n /** Abandon an interrupted session: await finish() then drop the session's status/progress. */\n discard: () => otaInstallCoordinator.discard(),\n /** Current install read model (displayState/errorMsg/lockout + glasses OTA data). */\n snapshot: (): OtaInstallSnapshot => otaInstallCoordinator.snapshot(),\n /** Subscribe to install snapshot changes (deduped on projected JSON). Returns an unsubscribe. */\n onSnapshot: (cb: (snapshot: OtaInstallSnapshot) => void): (() => void) => otaInstallCoordinator.onSnapshot(cb),\n },\n\n /** Current available-update info (versionName/updates/totalSize), or null. */\n updateAvailable: (): OtaUpdateInfo | null => useGlassesStore.getState().otaUpdateAvailable,\n /** Current OTA install status (stepType/phase/percent/status/error), or null. */\n status: (): OtaStatus | null => useGlassesStore.getState().otaStatus,\n /** Current OTA read model for update prompt/progress screens. */\n snapshot: (): OtaSnapshot => projectSnapshot(),\n\n /** Subscribe to OTA availability changes (info or null when cleared). Returns an unsubscribe. */\n onUpdateAvailable: (cb: (info: OtaUpdateInfo | null) => void): (() => void) => {\n let last = useGlassesStore.getState().otaUpdateAvailable\n return useGlassesStore.subscribe(() => {\n const info = useGlassesStore.getState().otaUpdateAvailable\n if (info === last) return\n last = info\n cb(info)\n })\n },\n\n /** Subscribe to OTA install status changes. Returns an unsubscribe. */\n onStatus: (cb: (status: OtaStatus | null) => void): (() => void) => {\n let last = useGlassesStore.getState().otaStatus\n return useGlassesStore.subscribe(() => {\n const status = useGlassesStore.getState().otaStatus\n if (status === last) return\n last = status\n cb(status)\n })\n },\n\n /** Subscribe to OTA snapshot changes. Returns an unsubscribe. */\n onSnapshot: (cb: (snapshot: OtaSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectSnapshot())\n return useGlassesStore.subscribe(() => {\n const snap = projectSnapshot()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ota.js","sourceRoot":"","sources":["../../src/facades/ota.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,YAAY,MAAM,wBAAwB,CAAA;AASjD,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAC,MAAM,mBAAmB,CAAA;AACrF,OAAO,EAAC,qBAAqB,EAAC,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAC,qBAAqB,EAA0B,MAAM,mCAAmC,CAAA;AAChG,OAAO,EAAC,4BAA4B,EAAC,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAC,eAAe,EAAC,MAAM,wBAAwB,CAAA;AACtD,OAAO,EACL,4BAA4B,GAG7B,MAAM,mCAAmC,CAAA;AAE1C,SAAS,eAAe;IACt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kB,CAAA;QACxD,OAAO,eAAe,CAAC,SAAS,CAAC,GAAG,EAAE;YACpC,MAAM,IAAI,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC,kBAAkB,CAAA;YAC1D,IAAI,IAAI,KAAK,IAAI;gBAAE,OAAM;YACzB,IAAI,GAAG,IAAI,CAAA;YACX,EAAE,CAAC,IAAI,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,uEAAuE;IACvE,QAAQ,EAAE,CAAC,EAAsC,EAAgB,EAAE;QACjE,IAAI,IAAI,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAA;QAC/C,OAAO,eAAe,CAAC,SAAS,CAAC,GAAG,EAAE;YACpC,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC,SAAS,CAAA;YACnD,IAAI,MAAM,KAAK,IAAI;gBAAE,OAAM;YAC3B,IAAI,GAAG,MAAM,CAAA;YACb,EAAE,CAAC,MAAM,CAAC,CAAA;QACZ,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,iEAAiE;IACjE,UAAU,EAAE,CAAC,EAAmC,EAAgB,EAAE;QAChE,IAAI,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,CAAA;QAC5C,OAAO,eAAe,CAAC,SAAS,CAAC,GAAG,EAAE;YACpC,MAAM,IAAI,GAAG,eAAe,EAAE,CAAA;YAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,GAAG,KAAK,IAAI;gBAAE,OAAM;YACxB,IAAI,GAAG,GAAG,CAAA;YACV,EAAE,CAAC,IAAI,CAAC,CAAA;QACV,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA","sourcesContent":["/**\n * ota facade — `engine.ota`: the OEM-facing OTA read/observe surface. Engine's\n * OtaService projects the glasses' OTA BLE events into the engine store; this facade\n * exposes the snapshot + change subscriptions behind the shared OTA flow exported by\n * `@glassly/engine/ota`. Hosts retain only their surrounding navigation and theme/i18n adapters.\n *\n * Availability checks live in engine. Install orchestration lives in engine too:\n * `installSession` fronts the OtaInstallCoordinator state machine (WP 8B) — the host\n * progress screen is a pure renderer over its snapshot + attach/detach/retry/finish.\n */\nimport BluetoothSdk from \"@glassly/bluetooth-sdk\"\nimport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStartAckEvent,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n} from \"@glassly/bluetooth-sdk\"\nimport {isGlassesConnected, isGlassesReady, useGlassesStore} from \"../stores/glasses\"\nimport {resolveOtaManifestUrl} from \"../services/otaManifestUrl\"\nimport {otaInstallCoordinator, type OtaInstallSnapshot} from \"../services/OtaInstallCoordinator\"\nimport {startGlassesStatusProjection} from \"../services/GlassesStatusProjection\"\nimport {startOtaService} from \"../services/OtaService\"\nimport {\n checkCurrentGlassesForUpdate,\n type OtaCheckCurrentGlassesOptions,\n type OtaCheckCurrentGlassesResult,\n} from \"../services/OtaUpdateCheckService\"\n\nfunction projectSnapshot() {\n const s = useGlassesStore.getState()\n return {\n connected: isGlassesConnected(s.connection),\n ready: isGlassesReady(s.connection),\n buildNumber: s.buildNumber || null,\n appVersion: s.appVersion || null,\n mtkFirmwareVersion: s.mtkFirmwareVersion || null,\n besFirmwareVersion: s.besFirmwareVersion || null,\n batteryLevel: s.batteryLevel >= 0 ? s.batteryLevel : null,\n hotspotOtaVersion: s.hotspotOtaVersion ?? 0,\n wifiConnected: s.wifi.state === \"connected\",\n wifiStatusKnown: s.wifiStatusKnown,\n manifestUrl: resolveOtaManifestUrl(s.otaVersionUrl, s.buildNumber),\n updateAvailable: s.otaUpdateAvailable,\n status: s.otaStatus,\n legacyProgress: s.otaProgress,\n inProgress: s.otaInProgress,\n mtkUpdatedThisSession: s.mtkUpdatedThisSession,\n }\n}\n\nexport type OtaSnapshot = ReturnType<typeof projectSnapshot>\nexport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n OtaInstallSnapshot,\n OtaCheckCurrentGlassesOptions,\n OtaCheckCurrentGlassesResult,\n}\n\nexport const ota = {\n // --- actions ---\n /**\n * Start the device-status and OTA projections without starting the authenticated\n * cloud connection or miniapp runtime. This is the explicit entry point for Bluetooth-only hosts.\n * Idempotent and safe when the full engine runtime is already running.\n */\n initialize: async () => {\n const hydrated = startGlassesStatusProjection()\n startOtaService()\n await hydrated\n },\n /**\n * Start the firmware install with the resolved OTA manifest URL. Progress lands on\n * `status()`/`onStatus()`. (The host resolves the manifest URL — developer override,\n * host pin, or Engine release pin resolution stays with the OTA config; the stuck/retry watchdog is its own\n * resilience layer on top of this command.)\n */\n install: (otaVersionUrl?: string | null): Promise<OtaStartAckEvent> => BluetoothSdk.startOtaUpdate(otaVersionUrl),\n // Deferred: this facade entry was intended to become the engine-owned retry/check\n // action, but BluetoothSdk.checkForOtaUpdate() only returns a boolean. Exposing it\n // here would make callers think the rich otaUpdateAvailable read model is refreshed,\n // while the original view still depends on the host-side manifest compare to build\n // versionName/updates/totalSize. Keep that behavior unchanged until the whole rich\n // availability check moves into engine.\n // retry: () => BluetoothSdk.checkForOtaUpdate(),\n /**\n * Keep glasses awake while an OTA session is actively progressing.\n * @deprecated Legacy progress route (build < 37) only — removed with WP 8D.\n */\n ping: () => BluetoothSdk.ping(),\n /** Resolve and compare the current glasses against the OTA manifest, then update the OTA snapshot. */\n checkForUpdates: (options?: OtaCheckCurrentGlassesOptions) => checkCurrentGlassesForUpdate(options),\n /** Return bundled release changelogs crossed between two coordinated product versions, newest first. */\n getReleaseChangelogs: (fromVersion?: string | null, toVersion?: string | null): ReleaseChangelog[] =>\n BluetoothSdk.getReleaseChangelogs(fromVersion, toVersion),\n /** Clear the available-update prompt state. */\n clearUpdateAvailable: () => useGlassesStore.getState().setOtaUpdateAvailable(null),\n /** Clear active progress/status before entering a fresh install flow. */\n clearProgress: () => {\n const store = useGlassesStore.getState()\n store.setOtaProgress(null)\n store.setOtaStatus(null)\n },\n /**\n * Replace the pending update sequence after an in-flow firmware revalidation.\n * Kept as a named OTA policy operation so host screens do not mutate the raw\n * glasses store.\n * @deprecated Legacy progress route (build < 37) only — removed with WP 8D.\n */\n replacePendingUpdateSequence: (updates: OtaUpdateInfo[\"updates\"]): OtaUpdateInfo | null => {\n const store = useGlassesStore.getState()\n const current = store.otaUpdateAvailable\n if (!current) return null\n const next = {...current, updates}\n store.setOtaUpdateAvailable(next)\n return next\n },\n /**\n * Clear stale build metadata before returning to the update-check screen.\n * This forces the next version_info event through both the native observable\n * store and the engine projection after an APK reboot.\n * @deprecated Legacy progress route (build < 37) only — removed with WP 8D.\n */\n clearBuildNumberForNextCheck: () => {\n useGlassesStore.getState().setGlassesInfo({buildNumber: \"\"})\n },\n /**\n * Mark MTK as already applied during this app session until the glasses reboot/disconnect.\n * @deprecated Legacy progress route (build < 37) only — removed with WP 8D.\n */\n markMtkUpdatedThisSession: (updated: boolean) => useGlassesStore.getState().setMtkUpdatedThisSession(updated),\n\n /**\n * The OTA install state machine (unified `ota_status` sessions, build >= 37).\n * The host progress screen attaches on mount, detaches on unmount, and renders\n * the snapshot; every watchdog/retry/reconnect rule lives in the coordinator.\n */\n installSession: {\n /** Select Wi-Fi or capability-gated hotspot transport for this checked manifest. */\n prepare: (result: OtaCheckCurrentGlassesResult) => otaInstallCoordinator.prepare(result),\n /** Bind the machine to the mounted progress screen. Idempotent per attach/detach cycle. */\n attach: () => otaInstallCoordinator.attach(),\n /** Unbind on unmount: clears all timers/listeners and resets session state. */\n detach: () => otaInstallCoordinator.detach(),\n /** Retry after a failure: clear state and re-send ota_start (if connected). */\n retry: () => otaInstallCoordinator.retry(),\n /** Terminal cleanup for Continue/Done, including hotspot route teardown. */\n finish: () => otaInstallCoordinator.finish(),\n /** Abandon an interrupted session: await finish() then drop the session's status/progress. */\n discard: () => otaInstallCoordinator.discard(),\n /** Current install read model (displayState/errorMsg/lockout + glasses OTA data). */\n snapshot: (): OtaInstallSnapshot => otaInstallCoordinator.snapshot(),\n /** Subscribe to install snapshot changes (deduped on projected JSON). Returns an unsubscribe. */\n onSnapshot: (cb: (snapshot: OtaInstallSnapshot) => void): (() => void) => otaInstallCoordinator.onSnapshot(cb),\n },\n\n /** Current available-update info (versionName/updates/totalSize), or null. */\n updateAvailable: (): OtaUpdateInfo | null => useGlassesStore.getState().otaUpdateAvailable,\n /** Current OTA install status (stepType/phase/percent/status/error), or null. */\n status: (): OtaStatus | null => useGlassesStore.getState().otaStatus,\n /** Current OTA read model for update prompt/progress screens. */\n snapshot: (): OtaSnapshot => projectSnapshot(),\n\n /** Subscribe to OTA availability changes (info or null when cleared). Returns an unsubscribe. */\n onUpdateAvailable: (cb: (info: OtaUpdateInfo | null) => void): (() => void) => {\n let last = useGlassesStore.getState().otaUpdateAvailable\n return useGlassesStore.subscribe(() => {\n const info = useGlassesStore.getState().otaUpdateAvailable\n if (info === last) return\n last = info\n cb(info)\n })\n },\n\n /** Subscribe to OTA install status changes. Returns an unsubscribe. */\n onStatus: (cb: (status: OtaStatus | null) => void): (() => void) => {\n let last = useGlassesStore.getState().otaStatus\n return useGlassesStore.subscribe(() => {\n const status = useGlassesStore.getState().otaStatus\n if (status === last) return\n last = status\n cb(status)\n })\n },\n\n /** Subscribe to OTA snapshot changes. Returns an unsubscribe. */\n onSnapshot: (cb: (snapshot: OtaSnapshot) => void): (() => void) => {\n let last = JSON.stringify(projectSnapshot())\n return useGlassesStore.subscribe(() => {\n const snap = projectSnapshot()\n const key = JSON.stringify(snap)\n if (key === last) return\n last = key\n cb(snap)\n })\n },\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export const ENGINE_RELEASE_METADATA = Object.freeze({
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"familyBaseVersion": "0.1.0",
|
|
4
|
-
"releaseIdentity": "0.1.0-dev.
|
|
5
|
-
"releaseSetId": "glassly-0.1.0-dev.
|
|
6
|
-
"sourceCommit": "
|
|
4
|
+
"releaseIdentity": "0.1.0-dev.62",
|
|
5
|
+
"releaseSetId": "glassly-0.1.0-dev.62",
|
|
6
|
+
"sourceCommit": "69eee438b882fca1c9b0ad466d71fc2c24053662",
|
|
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,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,cAAc;IACjC,cAAc,EAAE,sBAAsB;IACtC,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 EngineReleaseMetadata {\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 ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"0.1.0\",\n \"releaseIdentity\": \"0.1.0-dev.
|
|
1
|
+
{"version":3,"file":"releaseMetadata.js","sourceRoot":"","sources":["../../src/generated/releaseMetadata.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,uBAAuB,GAAoC,MAAM,CAAC,MAAM,CAAC;IACpF,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,OAAO;IAC5B,iBAAiB,EAAE,cAAc;IACjC,cAAc,EAAE,sBAAsB;IACtC,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 EngineReleaseMetadata {\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 ENGINE_RELEASE_METADATA: Readonly<EngineReleaseMetadata> = Object.freeze({\n \"schemaVersion\": 1,\n \"familyBaseVersion\": \"0.1.0\",\n \"releaseIdentity\": \"0.1.0-dev.62\",\n \"releaseSetId\": \"glassly-0.1.0-dev.62\",\n \"sourceCommit\": \"69eee438b882fca1c9b0ad466d71fc2c24053662\",\n \"otaManifestUrl\": null,\n \"otaManifestSha256\": null\n})\n"]}
|
package/build/index.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export type { CloudClientStatusSnapshot, MiniappAuthToken, InteropAuditEvent, Tt
|
|
|
29
29
|
export { isGlassesConnected, isGlassesReady, isGlassesLinkLayerBusy, waitForGlassesReady, type GlassesConnectionStatus, type WaitForGlassesReadyOptions, } from "./services/GlassesReadiness";
|
|
30
30
|
export { decideReconnect, decideConnectButtonAction, type ReconnectDecision, type ReconnectDecisionInput, type ConnectButtonAction, } from "./services/ConnectionCoordinator";
|
|
31
31
|
export type { VersionInfo, MtkPatch, BesFirmware, VersionJson, OtaCheckResult, OtaCheckCurrentGlassesResult, OtaCheckCurrentGlassesOptions, } from "./services/OtaUpdateCheckService";
|
|
32
|
-
export { MINIMUM_OTA_STATUS_BUILD, MAX_RETRIES, RETRY_INTERVAL_MS, PROGRESS_TIMEOUT_MS, DOWNLOAD_STUCK_TIMEOUT_MS, MTK_INSTALL_TIMEOUT_MS, GLOBAL_OTA_TIMEOUT_MS, PING_INTERVAL_MS, QUERY_REPLY_TIMEOUT_MS, OtaProgressMessages, } from "./services/otaInstallPolicy";
|
|
32
|
+
export { MINIMUM_OTA_STATUS_BUILD, MAX_RETRIES, RETRY_INTERVAL_MS, PROGRESS_TIMEOUT_MS, DOWNLOAD_STUCK_TIMEOUT_MS, MTK_INSTALL_TIMEOUT_MS, GLOBAL_OTA_TIMEOUT_MS, PING_INTERVAL_MS, QUERY_REPLY_TIMEOUT_MS, BES_RESTART_TIMEOUT_MS, OtaProgressMessages, } from "./services/otaInstallPolicy";
|
|
33
33
|
export { deriveDisplayState } from "./services/otaDisplayState";
|
|
34
34
|
export type { DisplayState } from "./services/otaDisplayState";
|
|
35
35
|
export type { OtaProgress, OtaProgressStatus, OtaStatus, OtaUpdateInfo, ReleaseChangelog, OtaSnapshot, OtaInstallSnapshot, } from "./facades/ota";
|
|
@@ -46,6 +46,6 @@ export { DUMMY_APPLET, saveAppsOrder, getAppsOrder, sortAppsByPackageNamePriorit
|
|
|
46
46
|
export { decideDevLaunchRoute, type DecideDevLaunchOptions, type DevLaunchResult, type DevManifest, } from "./utils/devMiniappLaunch";
|
|
47
47
|
export { HardwareCompatibility, type CompatibilityResult } from "./utils/hardware";
|
|
48
48
|
export { BgTimer, throttle, debounce } from "./utils/timers";
|
|
49
|
-
export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes, HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, vuzixZ100, mentraDisplay,
|
|
49
|
+
export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes, HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay, } from "./types";
|
|
50
50
|
export type { HardwareRequirement, CameraCapabilities, DisplayCapabilities, MicrophoneCapabilities, SpeakerCapabilities, IMUCapabilities, ButtonCapabilities, LightCapabilities, PowerCapabilities, Capabilities, AppletType, AppPermissionType, AppletPermission, AppletInterface, ClientApp, } from "./types";
|
|
51
51
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","s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AAsB,EACtB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,MAAM,SAAS,CAAA"}
|
package/build/index.js
CHANGED
|
@@ -31,7 +31,7 @@ export { isGlassesConnected, isGlassesReady, isGlassesLinkLayerBusy, waitForGlas
|
|
|
31
31
|
export { decideReconnect, decideConnectButtonAction, } from "./services/ConnectionCoordinator";
|
|
32
32
|
// OTA install policy (watchdog timings + failure copy) + display-state
|
|
33
33
|
// derivation, consumed by the OTA screens and their tests.
|
|
34
|
-
export { MINIMUM_OTA_STATUS_BUILD, MAX_RETRIES, RETRY_INTERVAL_MS, PROGRESS_TIMEOUT_MS, DOWNLOAD_STUCK_TIMEOUT_MS, MTK_INSTALL_TIMEOUT_MS, GLOBAL_OTA_TIMEOUT_MS, PING_INTERVAL_MS, QUERY_REPLY_TIMEOUT_MS, OtaProgressMessages, } from "./services/otaInstallPolicy";
|
|
34
|
+
export { MINIMUM_OTA_STATUS_BUILD, MAX_RETRIES, RETRY_INTERVAL_MS, PROGRESS_TIMEOUT_MS, DOWNLOAD_STUCK_TIMEOUT_MS, MTK_INSTALL_TIMEOUT_MS, GLOBAL_OTA_TIMEOUT_MS, PING_INTERVAL_MS, QUERY_REPLY_TIMEOUT_MS, BES_RESTART_TIMEOUT_MS, OtaProgressMessages, } from "./services/otaInstallPolicy";
|
|
35
35
|
export { deriveDisplayState } from "./services/otaDisplayState";
|
|
36
36
|
export { beginOtaAutoChain, clearOtaAutoChainReconnectWait, isOtaAutoChainActive, otaAutoChainFingerprint, otaAutoChainReconnectWaitRemaining, stopOtaAutoChain, tryAdvanceOtaAutoChain, MAX_OTA_AUTO_CHAIN_PASSES, OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS, } from "./services/OtaAutoChain";
|
|
37
37
|
export { BES_INSTALL_RESTART_MESSAGE, getOtaErrorMessage, shouldRequireGlassesRebootForBesFailure, shouldShowChangeWifiForOtaDownloadFailure, } from "./services/OtaErrorMapping";
|
|
@@ -47,5 +47,5 @@ export { decideDevLaunchRoute, } from "./utils/devMiniappLaunch";
|
|
|
47
47
|
export { HardwareCompatibility } from "./utils/hardware";
|
|
48
48
|
export { BgTimer, throttle, debounce } from "./utils/timers";
|
|
49
49
|
// Hardware types and capability profiles.
|
|
50
|
-
export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes, HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, vuzixZ100, mentraDisplay,
|
|
50
|
+
export { HardwareType, HardwareRequirementLevel, DeviceTypes, ControllerTypes, HARDWARE_CAPABILITIES, getModelCapabilities, simulatedGlasses, evenRealitiesG1, evenRealitiesG2, mentraLive, nimo, vuzixZ100, mentraDisplay, } from "./types";
|
|
51
51
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAyB/B,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAA;AACtD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,GAGrB,MAAM,iCAAiC,CAAA;AAExC,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAS1F,OAAO,EAAC,wBAAwB,EAAE,gCAAgC,EAAC,MAAM,+BAA+B,CAAA;AAExG,8CAA8C;AAC9C,OA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tB,gBAAgB,EAChB,4BAA4B,EAC5B,gBAAgB,GAGjB,MAAM,eAAe,CAAA;AAEtB,4EAA4E;AAC5E,OAAO,EACL,oBAAoB,GAIrB,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAC,qBAAqB,EAA2B,MAAM,kBAAkB,CAAA;AAChF,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AAE1D,0CAA0C;AAC1C,OAAO,EACL,YAAY,EACZ,wBAAwB,EACxB,WAAW,EACX,eAAe,EACf,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,UAAU,EACV,SAAS,EACT,aAAa,EACb,IAAI,GACL,MAAM,SAAS,CAAA","sourcesContent":["/**\n * `@glassly/engine` — the OEM-facing main entry.\n *\n * The `engine` namespace (configure/start/stop + typed domain facades), the\n * public contract/read-model types, and the pure helpers host UI legitimately\n * renders with (decision functions, sort/order helpers, policy constants,\n * capability tables, timers). Judgment rule: read models, commands, pure\n * functions and types belong here; anything that mutates runtime state or\n * exposes a raw store/service remains private to the GlasslyOS host.\n * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.\n */\n\n// The namespaced OEM-facing engine API (the \"(A) host API\"). See ./engine.\nexport {engine} from \"./engine\"\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n ReportSubmitResult,\n EngineSubmitReportInput,\n} from \"./facades/reports\"\nexport type {IslandNotification, IslandNotificationKind} from \"./facades/notifications\"\nexport type {WifiSearchResult} from \"./facades/glassesWifi\"\nexport type {IdentitySnapshot} from \"./services/PairingIdentity\"\nexport type {DisplayMirrorEvent} from \"./facades/displayMirror\"\nexport type {\n IslandConfigureOptions,\n IslandAuth,\n IslandConfigValues,\n IslandAnalytics,\n IslandUiSeams,\n ScanQrOptions,\n ScanQrResult,\n SubjectTokenType,\n} from \"./runtime/bootstrap\"\n\n// Settings contract: the typed key registry (schema descriptors — the same\n// surface engine.settings.descriptor()/keys() reads), the per-key React hook\n// (the hook layer, same precedent as the apps hooks below), and the pure\n// device-model key helpers. The raw useSettingsStore stays internal;\n// imperative access goes through engine.settings.\nexport {SETTINGS, useSetting} from \"./stores/settings\"\nexport {\n isCustomDashboardEligible,\n normalizeDashboardWidgets,\n DASHBOARD_WIDGET_IDS,\n type DashboardWidgetId,\n type DashboardWidgetSetting,\n} from \"./services/CustomDashboardModel\"\n\n// AI tier registry: the curated per-tier model dropdown options and helpers\n// the Settings > AI Models screen renders. Resolution itself runs inside\n// LocalMiniappRuntime; the screen only reads/writes the ai_model_* settings.\nexport {AI_TIERS, TIER_MODEL_OPTIONS, parseTierSetting} from \"./services/AiTierResolution\"\nexport type {AiTier, AiTierProvider, TierModelOption} from \"./services/AiTierResolution\"\n\n// Shared user memory timeline (engine.memory / Settings > Memory). Entry and\n// session shapes are canonical in @glassly/miniapp (the session.memory\n// surface); the stats read model is engine-side.\nexport type {MemoryStats} from \"./services/MemoryStore\"\nexport type {SpeakerProfile} from \"./services/SpeakerProfileStore\"\nexport type {EnrollOutcome} from \"./facades/speakers\"\nexport {MENTRA_LIVE_SETTING_KEYS, getBluetoothSettingKeysForDevice} from \"./stores/bluetoothSettingKeys\"\n\n// Runtime-shared constants and contract DTOs.\nexport {ISLAND_SETTINGS_KEYS} from \"./runtime/config\"\nexport type {CloudClientStatusSnapshot, MiniappAuthToken, InteropAuditEvent, TtsSynthesisResult} from \"./runtime/config\"\n\n// Pure readiness predicates over glasses connection state.\nexport {\n isGlassesConnected,\n isGlassesReady,\n isGlassesLinkLayerBusy,\n waitForGlassesReady,\n type GlassesConnectionStatus,\n type WaitForGlassesReadyOptions,\n} from \"./services/GlassesReadiness\"\n// Pure connect/reconnect decision helpers (host UI renders the outcome).\nexport {\n decideReconnect,\n decideConnectButtonAction,\n type ReconnectDecision,\n type ReconnectDecisionInput,\n type ConnectButtonAction,\n} from \"./services/ConnectionCoordinator\"\n\n// OTA read-model types for host OTA UI (progress screen, error mapping,\n// progress section) — the check/install machinery itself is internal.\nexport type {\n VersionInfo,\n MtkPatch,\n BesFirmware,\n VersionJson,\n OtaCheckResult,\n OtaCheckCurrentGlassesResult,\n OtaCheckCurrentGlassesOptions,\n} from \"./services/OtaUpdateCheckService\"\n// OTA install policy (watchdog timings + failure copy) + display-state\n// derivation, consumed by the OTA screens and their tests.\nexport {\n MINIMUM_OTA_STATUS_BUILD,\n MAX_RETRIES,\n RETRY_INTERVAL_MS,\n PROGRESS_TIMEOUT_MS,\n DOWNLOAD_STUCK_TIMEOUT_MS,\n MTK_INSTALL_TIMEOUT_MS,\n GLOBAL_OTA_TIMEOUT_MS,\n PING_INTERVAL_MS,\n QUERY_REPLY_TIMEOUT_MS,\n OtaProgressMessages,\n} from \"./services/otaInstallPolicy\"\nexport {deriveDisplayState} from \"./services/otaDisplayState\"\nexport type {DisplayState} from \"./services/otaDisplayState\"\nexport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n OtaSnapshot,\n OtaInstallSnapshot,\n} from \"./facades/ota\"\nexport {\n beginOtaAutoChain,\n clearOtaAutoChainReconnectWait,\n isOtaAutoChainActive,\n otaAutoChainFingerprint,\n otaAutoChainReconnectWaitRemaining,\n stopOtaAutoChain,\n tryAdvanceOtaAutoChain,\n MAX_OTA_AUTO_CHAIN_PASSES,\n OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS,\n} from \"./services/OtaAutoChain\"\nexport type {OtaAutoChainAdvanceResult} from \"./services/OtaAutoChain\"\nexport {\n BES_INSTALL_RESTART_MESSAGE,\n getOtaErrorMessage,\n shouldRequireGlassesRebootForBesFailure,\n shouldShowChangeWifiForOtaDownloadFailure,\n} from \"./services/OtaErrorMapping\"\n\n// Gallery read models: engine.gallery.onNotice payload types, the media\n// permission helper + display-name derivation host gallery UI uses, and the\n// glasses-camera DTO types (re-exported through the host @/types/asg shim).\nexport type {GalleryNotice, GalleryNoticeCode} from \"./services/asg/galleryNotices\"\nexport {MediaLibraryPermissions} from \"./utils/permissions/MediaLibraryPermissions\"\nexport {deriveGalleryDisplayName} from \"./utils/permissions/galleryDisplayName\"\nexport type {\n PhotoInfo,\n CaptureFile,\n CaptureGroup,\n GalleryResponse,\n ServerStatus,\n HealthResponse,\n GalleryEvent,\n} from \"./types/asg\"\n\n// Bluetooth SDK event types host UI subscribes to via engine facades (the\n// BluetoothSdk singleton passthrough itself is internal).\nexport type {PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\n\n// Cloud connection status enum (read model; the connection store is internal).\nexport {WebSocketStatus} from \"./stores/connection\"\n\n// App-list hook layer + pure list helpers (the raw useAppStatusStore and\n// installAppStoreHooks wiring are internal).\nexport {\n DUMMY_APPLET,\n saveAppsOrder,\n getAppsOrder,\n sortAppsByPackageNamePriority,\n saveLastOpenTime,\n getLastOpenTime,\n sortAppsByLastOpenTime,\n useApps,\n useStart,\n useStop,\n useSetForeground,\n useClearForeground,\n useRefresh,\n useStopAll,\n useInstall,\n useUninstall,\n useActiveApps,\n useActiveBackgroundApps,\n useBackgroundApps,\n useActiveForegroundApp,\n useForegroundApp,\n useActiveBackgroundAppsCount,\n useLocalMiniApps,\n type StartOptions,\n type OrderMap,\n} from \"./stores/apps\"\n\n// Pure dev-miniapp launch-route decision (registration itself is internal).\nexport {\n decideDevLaunchRoute,\n type DecideDevLaunchOptions,\n type DevLaunchResult,\n type DevManifest,\n} from \"./utils/devMiniappLaunch\"\nexport {HardwareCompatibility, type CompatibilityResult} from \"./utils/hardware\"\nexport {BgTimer, throttle, debounce} from \"./utils/timers\"\n\n// Hardware types and capability profiles.\nexport {\n HardwareType,\n HardwareRequirementLevel,\n DeviceTypes,\n ControllerTypes,\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n vuzixZ100,\n mentraDisplay,\n nimo,\n} from \"./types\"\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n AppletType,\n AppPermissionType,\n AppletPermission,\n AppletInterface,\n ClientApp,\n} from \"./types\"\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,2EAA2E;AAC3E,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAA;AAyB/B,2EAA2E;AAC3E,6EAA6E;AAC7E,yEAAyE;AACzE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EAAC,QAAQ,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAA;AACtD,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,GAGrB,MAAM,iCAAiC,CAAA;AAExC,4EAA4E;AAC5E,yEAAyE;AACzE,6EAA6E;AAC7E,OAAO,EAAC,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAC,MAAM,6BAA6B,CAAA;AAS1F,OAAO,EAAC,wBAAwB,EAAE,gCAAgC,EAAC,MAAM,+BAA+B,CAAA;AAExG,8CAA8C;AAC9C,OAAO,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAA;AAGrD,2DAA2D;AAC3D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,GAGpB,MAAM,6BAA6B,CAAA;AACpC,yEAAyE;AACzE,OAAO,EACL,eAAe,EACf,yBAAyB,GAI1B,MAAM,kCAAkC,CAAA;AAazC,uEAAuE;AACvE,2DAA2D;AAC3D,OAAO,EACL,wBAAwB,EACxB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACt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,eAAe,EACf,UAAU,EACV,IAAI,EACJ,SAAS,EACT,aAAa,GACd,MAAM,SAAS,CAAA","sourcesContent":["/**\n * `@glassly/engine` — the OEM-facing main entry.\n *\n * The `engine` namespace (configure/start/stop + typed domain facades), the\n * public contract/read-model types, and the pure helpers host UI legitimately\n * renders with (decision functions, sort/order helpers, policy constants,\n * capability tables, timers). Judgment rule: read models, commands, pure\n * functions and types belong here; anything that mutates runtime state or\n * exposes a raw store/service remains private to the GlasslyOS host.\n * See cloud-v2/docs/issues/020-glasses-status-boundary/integration-review.md §D.\n */\n\n// The namespaced OEM-facing engine API (the \"(A) host API\"). See ./engine.\nexport {engine} from \"./engine\"\nexport type {\n ReportAttachmentInput,\n ReportContext,\n ReportDetails,\n ReportStatus,\n ReportTrigger,\n ReportSubmitResult,\n EngineSubmitReportInput,\n} from \"./facades/reports\"\nexport type {IslandNotification, IslandNotificationKind} from \"./facades/notifications\"\nexport type {WifiSearchResult} from \"./facades/glassesWifi\"\nexport type {IdentitySnapshot} from \"./services/PairingIdentity\"\nexport type {DisplayMirrorEvent} from \"./facades/displayMirror\"\nexport type {\n IslandConfigureOptions,\n IslandAuth,\n IslandConfigValues,\n IslandAnalytics,\n IslandUiSeams,\n ScanQrOptions,\n ScanQrResult,\n SubjectTokenType,\n} from \"./runtime/bootstrap\"\n\n// Settings contract: the typed key registry (schema descriptors — the same\n// surface engine.settings.descriptor()/keys() reads), the per-key React hook\n// (the hook layer, same precedent as the apps hooks below), and the pure\n// device-model key helpers. The raw useSettingsStore stays internal;\n// imperative access goes through engine.settings.\nexport {SETTINGS, useSetting} from \"./stores/settings\"\nexport {\n isCustomDashboardEligible,\n normalizeDashboardWidgets,\n DASHBOARD_WIDGET_IDS,\n type DashboardWidgetId,\n type DashboardWidgetSetting,\n} from \"./services/CustomDashboardModel\"\n\n// AI tier registry: the curated per-tier model dropdown options and helpers\n// the Settings > AI Models screen renders. Resolution itself runs inside\n// LocalMiniappRuntime; the screen only reads/writes the ai_model_* settings.\nexport {AI_TIERS, TIER_MODEL_OPTIONS, parseTierSetting} from \"./services/AiTierResolution\"\nexport type {AiTier, AiTierProvider, TierModelOption} from \"./services/AiTierResolution\"\n\n// Shared user memory timeline (engine.memory / Settings > Memory). Entry and\n// session shapes are canonical in @glassly/miniapp (the session.memory\n// surface); the stats read model is engine-side.\nexport type {MemoryStats} from \"./services/MemoryStore\"\nexport type {SpeakerProfile} from \"./services/SpeakerProfileStore\"\nexport type {EnrollOutcome} from \"./facades/speakers\"\nexport {MENTRA_LIVE_SETTING_KEYS, getBluetoothSettingKeysForDevice} from \"./stores/bluetoothSettingKeys\"\n\n// Runtime-shared constants and contract DTOs.\nexport {ISLAND_SETTINGS_KEYS} from \"./runtime/config\"\nexport type {CloudClientStatusSnapshot, MiniappAuthToken, InteropAuditEvent, TtsSynthesisResult} from \"./runtime/config\"\n\n// Pure readiness predicates over glasses connection state.\nexport {\n isGlassesConnected,\n isGlassesReady,\n isGlassesLinkLayerBusy,\n waitForGlassesReady,\n type GlassesConnectionStatus,\n type WaitForGlassesReadyOptions,\n} from \"./services/GlassesReadiness\"\n// Pure connect/reconnect decision helpers (host UI renders the outcome).\nexport {\n decideReconnect,\n decideConnectButtonAction,\n type ReconnectDecision,\n type ReconnectDecisionInput,\n type ConnectButtonAction,\n} from \"./services/ConnectionCoordinator\"\n\n// OTA read-model types for host OTA UI (progress screen, error mapping,\n// progress section) — the check/install machinery itself is internal.\nexport type {\n VersionInfo,\n MtkPatch,\n BesFirmware,\n VersionJson,\n OtaCheckResult,\n OtaCheckCurrentGlassesResult,\n OtaCheckCurrentGlassesOptions,\n} from \"./services/OtaUpdateCheckService\"\n// OTA install policy (watchdog timings + failure copy) + display-state\n// derivation, consumed by the OTA screens and their tests.\nexport {\n MINIMUM_OTA_STATUS_BUILD,\n MAX_RETRIES,\n RETRY_INTERVAL_MS,\n PROGRESS_TIMEOUT_MS,\n DOWNLOAD_STUCK_TIMEOUT_MS,\n MTK_INSTALL_TIMEOUT_MS,\n GLOBAL_OTA_TIMEOUT_MS,\n PING_INTERVAL_MS,\n QUERY_REPLY_TIMEOUT_MS,\n BES_RESTART_TIMEOUT_MS,\n OtaProgressMessages,\n} from \"./services/otaInstallPolicy\"\nexport {deriveDisplayState} from \"./services/otaDisplayState\"\nexport type {DisplayState} from \"./services/otaDisplayState\"\nexport type {\n OtaProgress,\n OtaProgressStatus,\n OtaStatus,\n OtaUpdateInfo,\n ReleaseChangelog,\n OtaSnapshot,\n OtaInstallSnapshot,\n} from \"./facades/ota\"\nexport {\n beginOtaAutoChain,\n clearOtaAutoChainReconnectWait,\n isOtaAutoChainActive,\n otaAutoChainFingerprint,\n otaAutoChainReconnectWaitRemaining,\n stopOtaAutoChain,\n tryAdvanceOtaAutoChain,\n MAX_OTA_AUTO_CHAIN_PASSES,\n OTA_AUTO_CHAIN_RECONNECT_TIMEOUT_MS,\n} from \"./services/OtaAutoChain\"\nexport type {OtaAutoChainAdvanceResult} from \"./services/OtaAutoChain\"\nexport {\n BES_INSTALL_RESTART_MESSAGE,\n getOtaErrorMessage,\n shouldRequireGlassesRebootForBesFailure,\n shouldShowChangeWifiForOtaDownloadFailure,\n} from \"./services/OtaErrorMapping\"\n\n// Gallery read models: engine.gallery.onNotice payload types, the media\n// permission helper + display-name derivation host gallery UI uses, and the\n// glasses-camera DTO types (re-exported through the host @/types/asg shim).\nexport type {GalleryNotice, GalleryNoticeCode} from \"./services/asg/galleryNotices\"\nexport {MediaLibraryPermissions} from \"./utils/permissions/MediaLibraryPermissions\"\nexport {deriveGalleryDisplayName} from \"./utils/permissions/galleryDisplayName\"\nexport type {\n PhotoInfo,\n CaptureFile,\n CaptureGroup,\n GalleryResponse,\n ServerStatus,\n HealthResponse,\n GalleryEvent,\n} from \"./types/asg\"\n\n// Bluetooth SDK event types host UI subscribes to via engine facades (the\n// BluetoothSdk singleton passthrough itself is internal).\nexport type {PairFailureEvent, GlassesNotReadyEvent} from \"@glassly/bluetooth-sdk\"\n\n// Cloud connection status enum (read model; the connection store is internal).\nexport {WebSocketStatus} from \"./stores/connection\"\n\n// App-list hook layer + pure list helpers (the raw useAppStatusStore and\n// installAppStoreHooks wiring are internal).\nexport {\n DUMMY_APPLET,\n saveAppsOrder,\n getAppsOrder,\n sortAppsByPackageNamePriority,\n saveLastOpenTime,\n getLastOpenTime,\n sortAppsByLastOpenTime,\n useApps,\n useStart,\n useStop,\n useSetForeground,\n useClearForeground,\n useRefresh,\n useStopAll,\n useInstall,\n useUninstall,\n useActiveApps,\n useActiveBackgroundApps,\n useBackgroundApps,\n useActiveForegroundApp,\n useForegroundApp,\n useActiveBackgroundAppsCount,\n useLocalMiniApps,\n type StartOptions,\n type OrderMap,\n} from \"./stores/apps\"\n\n// Pure dev-miniapp launch-route decision (registration itself is internal).\nexport {\n decideDevLaunchRoute,\n type DecideDevLaunchOptions,\n type DevLaunchResult,\n type DevManifest,\n} from \"./utils/devMiniappLaunch\"\nexport {HardwareCompatibility, type CompatibilityResult} from \"./utils/hardware\"\nexport {BgTimer, throttle, debounce} from \"./utils/timers\"\n\n// Hardware types and capability profiles.\nexport {\n HardwareType,\n HardwareRequirementLevel,\n DeviceTypes,\n ControllerTypes,\n HARDWARE_CAPABILITIES,\n getModelCapabilities,\n simulatedGlasses,\n evenRealitiesG1,\n evenRealitiesG2,\n mentraLive,\n nimo,\n vuzixZ100,\n mentraDisplay,\n} from \"./types\"\nexport type {\n HardwareRequirement,\n CameraCapabilities,\n DisplayCapabilities,\n MicrophoneCapabilities,\n SpeakerCapabilities,\n IMUCapabilities,\n ButtonCapabilities,\n LightCapabilities,\n PowerCapabilities,\n Capabilities,\n AppletType,\n AppPermissionType,\n AppletPermission,\n AppletInterface,\n ClientApp,\n} from \"./types\"\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { type StyleProp, type ViewStyle } from "react-native";
|
|
3
|
-
import { type MentraLiveOtaFlowPage } from "./useMentraLiveOta";
|
|
3
|
+
import { type MentraLiveOtaController, type MentraLiveOtaFlowPage } from "./useMentraLiveOta";
|
|
4
4
|
export type { MentraLiveOtaFlowPage } from "./useMentraLiveOta";
|
|
5
5
|
export type MentraLiveOtaFlowTheme = {
|
|
6
6
|
background: string;
|
|
@@ -36,4 +36,9 @@ export type MentraLiveOtaFlowProps = {
|
|
|
36
36
|
style?: StyleProp<ViewStyle>;
|
|
37
37
|
};
|
|
38
38
|
export declare function MentraLiveOtaFlow({ allowDevSkip, deviceName, initialPage, initializeRuntime, onFinished, onFirmwareRestartingChange, onOpenWifiSetup, style, superMode, theme, translate, }: MentraLiveOtaFlowProps): React.JSX.Element;
|
|
39
|
+
export declare function ChangelogList({ changelogs, colors, title, }: {
|
|
40
|
+
changelogs: MentraLiveOtaController["state"]["changelogs"];
|
|
41
|
+
colors: MentraLiveOtaFlowTheme;
|
|
42
|
+
title: string;
|
|
43
|
+
}): React.JSX.Element | null;
|
|
39
44
|
//# sourceMappingURL=MentraLiveOtaFlow.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MentraLiveOtaFlow.d.ts","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgB,MAAM,OAAO,CAAA;AACpC,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"MentraLiveOtaFlow.d.ts","sourceRoot":"","sources":["../../src/react/MentraLiveOtaFlow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgB,MAAM,OAAO,CAAA;AACpC,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAA;AAKrB,OAAO,EAGL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC3B,MAAM,oBAAoB,CAAA;AAE3B,YAAY,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAA;AAE7D,MAAM,MAAM,sBAAsB,GAAG;IACnC,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AAsB,qBA0BxB;AA+bD,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,MAAM,EACN,KAAK,GACN,EAAE;IACD,UAAU,EAAE,uBAAuB,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAA;IAC1D,MAAM,EAAE,sBAAsB,CAAA;IAC9B,KAAK,EAAE,MAAM,CAAA;CACd,4BA4BA"}
|
|
@@ -2,9 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
/* eslint-disable react-native/no-raw-text -- BodyText and PercentText are local Text wrappers. */
|
|
3
3
|
import { useMemo } from "react";
|
|
4
4
|
import { ActivityIndicator, Pressable, ScrollView, StyleSheet, Text, View, } from "react-native";
|
|
5
|
+
import { useMarkdown } from "react-native-marked";
|
|
5
6
|
import { SafeAreaView } from "react-native-safe-area-context";
|
|
6
7
|
import Svg, { Path, Rect } from "react-native-svg";
|
|
7
|
-
import { useMentraLiveOta } from "./useMentraLiveOta";
|
|
8
|
+
import { MINIMUM_OTA_BATTERY_LEVEL, useMentraLiveOta, } from "./useMentraLiveOta";
|
|
8
9
|
const DEFAULT_THEME = {
|
|
9
10
|
background: "#FFFFFF",
|
|
10
11
|
border: "#D7DFDA",
|
|
@@ -16,11 +17,19 @@ const DEFAULT_THEME = {
|
|
|
16
17
|
};
|
|
17
18
|
const ENGLISH_COPY = {
|
|
18
19
|
"common:continue": "Continue",
|
|
20
|
+
"common:done": "Done",
|
|
19
21
|
"ota:checkingForUpdates": "Checking for updates",
|
|
20
22
|
"ota:checkingForUpdatesMessage": "Connected devices will perform automatic updates. Automatic updates can be disabled in Device Settings",
|
|
23
|
+
"ota:finishingUpdate": "Finishing your update",
|
|
24
|
+
"ota:checkingAdditionalUpdates": "Checking whether your glasses need any additional updates.",
|
|
21
25
|
"ota:updateAvailable": "{{deviceName}} Update Available",
|
|
26
|
+
"ota:batteryRequiredTitle": "Charge {{deviceName}} to Update",
|
|
27
|
+
"ota:batteryRequiredMessage": "{{deviceName}} is currently at {{batteryLevel}}%. Charge it to at least {{minimumBatteryLevel}}% before updating.",
|
|
28
|
+
"ota:batteryRequiredLiveUpdate": "This screen will update automatically as the battery charges.",
|
|
22
29
|
"ota:updateConnectWifi": "Connect your {{deviceName}} to WiFi to install the update.",
|
|
30
|
+
"ota:wifiRequiredTitle": "WiFi Needed for Update",
|
|
23
31
|
"ota:updateDescription": "A new update is available for your glasses. We recommend updating now for the best experience.",
|
|
32
|
+
"ota:updateSequenceMessage": "Your glasses may install more than one update and restart several times. Keep them nearby until finished.",
|
|
24
33
|
"ota:releaseTransition": "{{fromVersion}} → {{toVersion}}",
|
|
25
34
|
"ota:releaseTransitionUnknown": "Current version unknown → {{toVersion}}",
|
|
26
35
|
"ota:updatedToVersion": "Updated to {{version}}",
|
|
@@ -29,6 +38,8 @@ const ENGLISH_COPY = {
|
|
|
29
38
|
"ota:updateNow": "Update Now",
|
|
30
39
|
"ota:setupWifi": "Setup WiFi",
|
|
31
40
|
"ota:updateLater": "Later",
|
|
41
|
+
"ota:updateComplete": "Update complete",
|
|
42
|
+
"ota:whatsNew": "What's new",
|
|
32
43
|
"ota:upToDate": "Up To Date",
|
|
33
44
|
"ota:devBuild": "Development Build",
|
|
34
45
|
"ota:devBuildNoOta": "This mobile app is a development build, so automatic glasses updates are disabled. Use the developer settings manifest override to update them manually.",
|
|
@@ -41,6 +52,9 @@ const ENGLISH_COPY = {
|
|
|
41
52
|
"ota:versionChangeRestarting": "Installing a different version…",
|
|
42
53
|
"ota:versionChangeVerifying": "Verifying your glasses…",
|
|
43
54
|
"ota:versionChangeKeepNearby": "Keep your glasses nearby and connected. They will restart on their own.",
|
|
55
|
+
"ota:restartingGlasses": "Restarting {{deviceName}}…",
|
|
56
|
+
"ota:restartingGlassesMessage": "The update is installed. Keep your glasses nearby and leave this screen open while they finish starting.",
|
|
57
|
+
"ota:restartingGlassesAutomatic": "We'll continue automatically when they're ready.",
|
|
44
58
|
"ota:versionChangeComplete": "Version Change Complete",
|
|
45
59
|
"ota:versionChangeCompleteMessage": "Your glasses are now on the required version. Their settings were reset and are being restored automatically.",
|
|
46
60
|
"ota:versionChangeFirmwarePassComplete": "Firmware updated",
|
|
@@ -72,21 +86,36 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
|
|
|
72
86
|
if (state.screen === "checking") {
|
|
73
87
|
return (_jsxs(FlowPage, { colors: colors, icon: "download", title: translate("ota:checkingForUpdates"), children: [_jsx(BodyText, { colors: colors, children: translate("ota:checkingForUpdatesMessage") }), _jsx(ActivityIndicator, { size: "large", color: colors.foreground })] }));
|
|
74
88
|
}
|
|
89
|
+
if (state.screen === "battery_required") {
|
|
90
|
+
return (_jsxs(FlowPage, { actions: _jsxs(_Fragment, { children: [_jsx(FlowButton, { colors: colors, disabled: true, label: translate("ota:updateNow"), onPress: controller.install }), state.canDismiss ? (_jsx(FlowButton, { colors: colors, label: translate("ota:updateLater"), onPress: controller.finish, secondary: true })) : null] }), colors: colors, icon: "alert", title: translate("ota:batteryRequiredTitle", { deviceName }), children: [_jsx(BodyText, { colors: colors, children: translate("ota:batteryRequiredMessage", {
|
|
91
|
+
batteryLevel: String(state.batteryLevel),
|
|
92
|
+
deviceName,
|
|
93
|
+
minimumBatteryLevel: String(MINIMUM_OTA_BATTERY_LEVEL),
|
|
94
|
+
}) }), _jsx(BodyText, { colors: colors, children: translate("ota:batteryRequiredLiveUpdate") })] }));
|
|
95
|
+
}
|
|
96
|
+
if (state.screen === "finishing") {
|
|
97
|
+
return (_jsxs(FlowPage, { colors: colors, icon: "download", title: translate("ota:finishingUpdate"), children: [_jsx(BodyText, { colors: colors, children: translate("ota:checkingAdditionalUpdates") }), _jsx(ActivityIndicator, { size: "large", color: colors.foreground })] }));
|
|
98
|
+
}
|
|
75
99
|
if (state.screen === "update_available" || state.screen === "wifi_required") {
|
|
76
|
-
|
|
100
|
+
const titleKey = state.screen === "wifi_required"
|
|
101
|
+
? "ota:wifiRequiredTitle"
|
|
102
|
+
: state.versionChange
|
|
103
|
+
? "ota:downgradeAvailable"
|
|
104
|
+
: "ota:updateAvailable";
|
|
105
|
+
return (_jsxs(FlowPage, { colors: colors, icon: "download", title: translate(titleKey, { deviceName }), actions: _jsxs(_Fragment, { children: [_jsx(FlowButton, { colors: colors, disabled: !state.wifiStatusKnown, label: translate(state.screen === "wifi_required" ? "ota:setupWifi" : "ota:updateNow"), onPress: state.screen === "wifi_required" ? controller.openWifiSetup : controller.install }), state.canDismiss ? (_jsx(FlowButton, { colors: colors, label: translate("ota:updateLater"), onPress: controller.finish, secondary: true })) : null, allowDevSkip && state.updateRequired ? (_jsx(FlowButton, { colors: colors, label: "Skip (dev only)", onPress: controller.finish, secondary: true })) : null] }), children: [state.releaseTransition ? (_jsx(BodyText, { colors: colors, children: state.releaseTransition.fromVersion
|
|
77
106
|
? translate("ota:releaseTransition", {
|
|
78
107
|
fromVersion: state.releaseTransition.fromVersion,
|
|
79
108
|
toVersion: state.releaseTransition.toVersion,
|
|
80
109
|
})
|
|
81
110
|
: translate("ota:releaseTransitionUnknown", { toVersion: state.releaseTransition.toVersion }) })) : null, _jsx(BodyText, { colors: colors, children: state.screen === "wifi_required"
|
|
82
111
|
? translate("ota:updateConnectWifi", { deviceName })
|
|
83
|
-
: translate(state.versionChange ? "ota:downgradeDescription" : "ota:updateDescription") })] }));
|
|
112
|
+
: translate(state.versionChange ? "ota:downgradeDescription" : "ota:updateDescription") }), _jsx(BodyText, { colors: colors, children: translate("ota:updateSequenceMessage") })] }));
|
|
84
113
|
}
|
|
85
114
|
if (state.screen === "dev_build") {
|
|
86
115
|
return (_jsx(FlowPage, { actions: _jsx(FlowButton, { colors: colors, label: translate("common:continue"), onPress: controller.finish }), colors: colors, icon: "settings", title: translate("ota:devBuild"), children: _jsx(BodyText, { colors: colors, children: translate("ota:devBuildNoOta") }) }));
|
|
87
116
|
}
|
|
88
117
|
if (state.screen === "up_to_date") {
|
|
89
|
-
return (_jsxs(FlowPage, { actions: _jsx(FlowButton, { colors: colors, label: translate("common:continue"), onPress: controller.finish }), colors: colors, icon: "check", title: translate("ota:upToDate"), children: [_jsx(BodyText, { colors: colors, children: translate("ota:noUpdatesAvailable") }), state.releaseTransition ? (_jsx(BodyText, { colors: colors, children: translate("ota:updatedToVersion", { version: state.releaseTransition.toVersion }) })) : null, _jsx(ChangelogList, { changelogs: state.changelogs, colors: colors })] }));
|
|
118
|
+
return (_jsxs(FlowPage, { actions: _jsx(FlowButton, { colors: colors, label: translate(state.completedUpdate ? "common:done" : "common:continue"), onPress: controller.finish }), colors: colors, contentAlignment: state.changelogs.length > 0 ? "top" : "center", icon: "check", title: translate(state.completedUpdate ? "ota:updateComplete" : "ota:upToDate"), children: [_jsx(BodyText, { colors: colors, children: translate("ota:noUpdatesAvailable") }), state.releaseTransition ? (_jsx(BodyText, { colors: colors, children: translate("ota:updatedToVersion", { version: state.releaseTransition.toVersion }) })) : null, _jsx(ChangelogList, { changelogs: state.changelogs, colors: colors, title: translate("ota:whatsNew") })] }));
|
|
90
119
|
}
|
|
91
120
|
if (state.screen === "update_info_unavailable") {
|
|
92
121
|
return (_jsx(FlowPage, { actions: _jsx(FlowButton, { colors: colors, label: translate("common:continue"), onPress: controller.finish }), colors: colors, icon: "alert", title: translate("ota:updateInfoUnavailable"), children: _jsx(BodyText, { colors: colors, children: translate("ota:updateInfoUnavailableMessage") }) }));
|
|
@@ -111,7 +140,7 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
|
|
|
111
140
|
return (_jsxs(FlowPage, { colors: colors, icon: "download", title: state.phase === "download" ? "Downloading..." : "Installing...", children: [state.installingApkOnly ? (_jsx(ActivityIndicator, { size: "large", color: colors.foreground })) : (_jsxs(_Fragment, { children: [_jsx(PercentText, { colors: colors, percent: state.progress ?? 0 }), _jsx(View, { style: [styles.progressTrack, { backgroundColor: colors.border }], children: _jsx(View, { style: [styles.progressFill, { backgroundColor: colors.primary, width: `${state.progress ?? 0}%` }] }) })] })), _jsx(BodyText, { colors: colors, children: "Do not disconnect your glasses" }), state.versionChange && state.phase === "install" ? (_jsx(BodyText, { colors: colors, children: translate("ota:downgradeDuration") })) : null] }));
|
|
112
141
|
}
|
|
113
142
|
if (state.screen === "restarting") {
|
|
114
|
-
return (
|
|
143
|
+
return (_jsxs(FlowPage, { colors: colors, icon: "download", title: translate("ota:restartingGlasses", { deviceName }), children: [_jsx(ActivityIndicator, { size: "large", color: colors.foreground }), _jsx(BodyText, { colors: colors, children: translate("ota:restartingGlassesMessage") }), _jsx(BodyText, { colors: colors, children: translate("ota:restartingGlassesAutomatic") })] }));
|
|
115
144
|
}
|
|
116
145
|
if (state.screen === "complete") {
|
|
117
146
|
const title = state.versionChangeConverged
|
|
@@ -124,15 +153,15 @@ function OtaFlowContent({ allowDevSkip, colors, controller, deviceName, superMod
|
|
|
124
153
|
: state.versionChange
|
|
125
154
|
? translate("ota:versionChangeFirmwarePassCompleteMessage")
|
|
126
155
|
: "Your glasses are up to date.";
|
|
127
|
-
return (_jsxs(FlowPage, { actions: _jsx(FlowButton, { colors: colors, label: state.versionChange && !state.versionChangeConverged ? "Continue" : "Done", onPress: controller.finish }), colors: colors, icon: "check", title: title, children: [_jsx(BodyText, { colors: colors, children: message }), state.releaseTransition ? (_jsx(BodyText, { colors: colors, children: translate("ota:updatedToVersion", { version: state.releaseTransition.toVersion }) })) : null, _jsx(ChangelogList, { changelogs: state.changelogs, colors: colors })] }));
|
|
156
|
+
return (_jsxs(FlowPage, { actions: _jsx(FlowButton, { colors: colors, label: state.versionChange && !state.versionChangeConverged ? "Continue" : "Done", onPress: controller.finish }), colors: colors, contentAlignment: state.changelogs.length > 0 ? "top" : "center", icon: "check", title: title, children: [_jsx(BodyText, { colors: colors, children: message }), state.releaseTransition ? (_jsx(BodyText, { colors: colors, children: translate("ota:updatedToVersion", { version: state.releaseTransition.toVersion }) })) : null, _jsx(ChangelogList, { changelogs: state.changelogs, colors: colors, title: translate("ota:whatsNew") })] }));
|
|
128
157
|
}
|
|
129
158
|
if (state.screen === "failed") {
|
|
130
159
|
return (_jsx(FlowPage, { actions: _jsxs(_Fragment, { children: [_jsx(FlowButton, { colors: colors, label: state.canRetry ? "Retry" : "Done", onPress: state.canRetry ? controller.retryInstall : controller.finish }), state.canOpenWifiSetup ? (_jsx(FlowButton, { colors: colors, label: "Change WiFi", onPress: controller.openWifiSetup, secondary: true })) : null] }), colors: colors, icon: "alert", title: "Update Failed", children: _jsx(BodyText, { colors: colors, children: state.error?.message }) }));
|
|
131
160
|
}
|
|
132
161
|
return (_jsxs(FlowPage, { actions: superMode ? (_jsx(FlowButton, { colors: colors, label: "Skip (super)", onPress: controller.discard, secondary: true })) : undefined, colors: colors, icon: "bluetooth", title: "Glasses disconnected", children: [_jsx(BodyText, { colors: colors, children: "Reconnecting..." }), _jsx(ActivityIndicator, { size: "large", color: colors.foreground })] }));
|
|
133
162
|
}
|
|
134
|
-
function FlowPage({ actions, children, colors, icon, title }) {
|
|
135
|
-
return (_jsxs(View, { style: styles.page, testID: "mentra-live-ota-flow", children: [_jsxs(View, { style: styles.centerContent, children: [_jsx(FlowIcon, { colors: colors, name: icon }), _jsx(Text, { style: [styles.title, { color: colors.foreground }], children: title }), children] }), actions ? _jsx(View, { style: styles.actions, children: actions }) : _jsx(View, { style: styles.actionSpacer })] }));
|
|
163
|
+
function FlowPage({ actions, children, colors, contentAlignment = "center", icon, title }) {
|
|
164
|
+
return (_jsxs(View, { style: styles.page, testID: "mentra-live-ota-flow", children: [_jsxs(View, { style: [styles.centerContent, contentAlignment === "top" && styles.topContent], children: [_jsx(FlowIcon, { colors: colors, name: icon }), _jsx(Text, { style: [styles.title, { color: colors.foreground }], children: title }), children] }), actions ? _jsx(View, { style: styles.actions, children: actions }) : _jsx(View, { style: styles.actionSpacer })] }));
|
|
136
165
|
}
|
|
137
166
|
function BodyText({ children, colors }) {
|
|
138
167
|
return _jsx(Text, { style: [styles.body, { color: colors.textDim }], children: children });
|
|
@@ -140,10 +169,90 @@ function BodyText({ children, colors }) {
|
|
|
140
169
|
function PercentText({ colors, percent }) {
|
|
141
170
|
return _jsxs(Text, { style: [styles.percent, { color: colors.primary }], children: [Math.round(percent), "%"] });
|
|
142
171
|
}
|
|
143
|
-
function
|
|
172
|
+
function ChangelogMarkdown({ colors, markdown }) {
|
|
173
|
+
const markdownStyles = useMemo(() => ({
|
|
174
|
+
blockquote: {
|
|
175
|
+
borderLeftColor: colors.primary,
|
|
176
|
+
borderLeftWidth: 3,
|
|
177
|
+
marginVertical: 2,
|
|
178
|
+
opacity: 1,
|
|
179
|
+
paddingLeft: 12,
|
|
180
|
+
},
|
|
181
|
+
code: {
|
|
182
|
+
backgroundColor: colors.background,
|
|
183
|
+
borderColor: colors.border,
|
|
184
|
+
borderRadius: 8,
|
|
185
|
+
borderWidth: 1,
|
|
186
|
+
padding: 12,
|
|
187
|
+
},
|
|
188
|
+
codespan: {
|
|
189
|
+
backgroundColor: colors.border,
|
|
190
|
+
color: colors.foreground,
|
|
191
|
+
fontFamily: "monospace",
|
|
192
|
+
fontSize: 13,
|
|
193
|
+
fontStyle: "normal",
|
|
194
|
+
fontWeight: "400",
|
|
195
|
+
},
|
|
196
|
+
em: { color: colors.textDim, fontSize: 14, lineHeight: 20 },
|
|
197
|
+
h1: {
|
|
198
|
+
borderBottomWidth: 0,
|
|
199
|
+
color: colors.foreground,
|
|
200
|
+
fontSize: 18,
|
|
201
|
+
fontWeight: "700",
|
|
202
|
+
lineHeight: 24,
|
|
203
|
+
marginVertical: 0,
|
|
204
|
+
paddingBottom: 0,
|
|
205
|
+
},
|
|
206
|
+
h2: {
|
|
207
|
+
borderBottomWidth: 0,
|
|
208
|
+
color: colors.foreground,
|
|
209
|
+
fontSize: 17,
|
|
210
|
+
fontWeight: "700",
|
|
211
|
+
lineHeight: 23,
|
|
212
|
+
marginVertical: 0,
|
|
213
|
+
paddingBottom: 0,
|
|
214
|
+
},
|
|
215
|
+
h3: { color: colors.foreground, fontSize: 16, fontWeight: "700", lineHeight: 22, marginVertical: 0 },
|
|
216
|
+
h4: { color: colors.foreground, fontSize: 15, fontWeight: "700", lineHeight: 21, marginVertical: 0 },
|
|
217
|
+
h5: { color: colors.foreground, fontSize: 14, fontWeight: "700", lineHeight: 20, marginVertical: 0 },
|
|
218
|
+
h6: { color: colors.textDim, fontSize: 14, fontWeight: "600", lineHeight: 20, marginVertical: 0 },
|
|
219
|
+
hr: { borderBottomColor: colors.border, marginVertical: 2 },
|
|
220
|
+
image: { borderRadius: 8 },
|
|
221
|
+
li: { color: colors.textDim, fontSize: 14, lineHeight: 20 },
|
|
222
|
+
link: {
|
|
223
|
+
color: colors.primary,
|
|
224
|
+
fontSize: 14,
|
|
225
|
+
fontStyle: "normal",
|
|
226
|
+
lineHeight: 20,
|
|
227
|
+
textDecorationLine: "underline",
|
|
228
|
+
},
|
|
229
|
+
paragraph: { paddingVertical: 0 },
|
|
230
|
+
strikethrough: { color: colors.textDim, fontSize: 14, lineHeight: 20 },
|
|
231
|
+
strong: { color: colors.foreground, fontSize: 14, fontWeight: "700", lineHeight: 20 },
|
|
232
|
+
table: { borderColor: colors.border, borderRadius: 8 },
|
|
233
|
+
tableCell: { padding: 8 },
|
|
234
|
+
text: { color: colors.textDim, fontSize: 14, lineHeight: 20 },
|
|
235
|
+
}), [colors]);
|
|
236
|
+
const markdownTheme = useMemo(() => ({
|
|
237
|
+
colors: {
|
|
238
|
+
background: colors.background,
|
|
239
|
+
border: colors.border,
|
|
240
|
+
code: colors.border,
|
|
241
|
+
link: colors.primary,
|
|
242
|
+
text: colors.textDim,
|
|
243
|
+
},
|
|
244
|
+
}), [colors]);
|
|
245
|
+
const elements = useMarkdown(markdown, { colorScheme: "light", styles: markdownStyles, theme: markdownTheme });
|
|
246
|
+
return (_jsx(View, { style: styles.changelogMarkdownContent, testID: "ota-changelog-markdown", children: elements }));
|
|
247
|
+
}
|
|
248
|
+
export function ChangelogList({ changelogs, colors, title, }) {
|
|
144
249
|
if (changelogs.length === 0)
|
|
145
250
|
return null;
|
|
146
|
-
return (
|
|
251
|
+
return (_jsxs(View, { style: [styles.changelogCard, { borderColor: colors.border }], testID: "ota-changelog-card", children: [_jsx(Text, { style: [styles.changelogTitle, { color: colors.foreground }], children: title }), _jsx(ScrollView, { contentContainerStyle: styles.changelogContent, nestedScrollEnabled: true, showsVerticalScrollIndicator: true, style: styles.changelogList, testID: "ota-changelog-scroll", children: changelogs.map((entry, index) => (_jsxs(View, { style: [
|
|
252
|
+
styles.changelogEntry,
|
|
253
|
+
index > 0 && styles.changelogEntryDivider,
|
|
254
|
+
index > 0 && { borderTopColor: colors.border },
|
|
255
|
+
], children: [_jsx(Text, { selectable: true, style: [styles.changelogVersion, { color: colors.foreground }], children: entry.version }), _jsx(ChangelogMarkdown, { colors: colors, markdown: entry.markdown })] }, entry.version))) })] }));
|
|
147
256
|
}
|
|
148
257
|
function FlowButton({ colors, disabled = false, label, onPress, secondary = false, }) {
|
|
149
258
|
return (_jsx(Pressable, { accessibilityRole: "button", disabled: disabled, onPress: onPress, style: ({ pressed }) => [
|
|
@@ -174,6 +283,7 @@ const styles = StyleSheet.create({
|
|
|
174
283
|
},
|
|
175
284
|
page: { flex: 1, paddingBottom: 24, paddingHorizontal: 24 },
|
|
176
285
|
centerContent: { alignItems: "center", flex: 1, gap: 16, justifyContent: "center" },
|
|
286
|
+
topContent: { justifyContent: "flex-start", paddingTop: 12 },
|
|
177
287
|
actionSpacer: { height: 48 },
|
|
178
288
|
actions: { gap: 12 },
|
|
179
289
|
icon: { fontSize: 64, fontWeight: "500", lineHeight: 72, textAlign: "center" },
|
|
@@ -182,11 +292,23 @@ const styles = StyleSheet.create({
|
|
|
182
292
|
percent: { fontSize: 30, fontVariant: ["tabular-nums"], fontWeight: "700" },
|
|
183
293
|
progressTrack: { borderRadius: 4, height: 8, maxWidth: 420, overflow: "hidden", width: "100%" },
|
|
184
294
|
progressFill: { borderRadius: 4, height: 8 },
|
|
185
|
-
|
|
186
|
-
|
|
295
|
+
changelogCard: {
|
|
296
|
+
borderRadius: 16,
|
|
297
|
+
borderWidth: 1,
|
|
298
|
+
flexShrink: 1,
|
|
299
|
+
gap: 12,
|
|
300
|
+
maxHeight: 300,
|
|
301
|
+
maxWidth: 420,
|
|
302
|
+
padding: 16,
|
|
303
|
+
width: "100%",
|
|
304
|
+
},
|
|
305
|
+
changelogTitle: { fontSize: 16, fontWeight: "700" },
|
|
306
|
+
changelogList: { flexShrink: 1, maxHeight: 232, width: "100%" },
|
|
307
|
+
changelogContent: { gap: 20, paddingBottom: 2 },
|
|
187
308
|
changelogEntry: { gap: 8 },
|
|
188
|
-
|
|
189
|
-
|
|
309
|
+
changelogEntryDivider: { borderTopWidth: StyleSheet.hairlineWidth, paddingTop: 20 },
|
|
310
|
+
changelogVersion: { fontSize: 14, fontWeight: "600" },
|
|
311
|
+
changelogMarkdownContent: { gap: 10 },
|
|
190
312
|
button: {
|
|
191
313
|
alignItems: "center",
|
|
192
314
|
borderRadius: 50,
|