@wix/himalaya-cli 0.1727.0 → 0.1728.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/barcode-detection/src/index.d.ts +39 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/image-labeling/src/index.d.ts +32 -0
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +4 -1
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/text-recognition/src/index.d.ts +43 -0
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +6 -0
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +1 -1
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +3 -0
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/barcode-detection.mjs +36 -0
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +3 -0
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +3 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +3 -0
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +3 -0
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/image-labeling.mjs +37 -0
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +3 -0
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +3 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +3 -0
  17. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +3 -0
  18. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +3 -0
  19. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/text-recognition.mjs +41 -0
  20. package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +12 -0
  21. package/dist/browser-plane/assets.json +5 -5
  22. package/dist/browser-plane/preview-deferred/{962f3ed94715c3a8d073254239901e2ffd5bb99015fd5d37ae36eaa0f0dce2be.bin → ec5d778f3e7ecbc2351ab7a8f3509483b798094de9f889fe8b03447db1413cb6.bin} +1 -1
  23. package/dist/browser-plane/sw.js +6 -6
  24. package/dist/cli.mjs +375 -88
  25. package/dist/preview-assets.generated.bin +0 -0
  26. package/guides/app-config.md +1 -1
  27. package/guides/capabilities.md +3 -0
  28. package/guides/himi-test.md +4 -2
  29. package/guides/importable-sdks.md +3 -0
  30. package/guides/qa-builds.md +104 -1
  31. package/guides/sdk-reference.json +210 -0
  32. package/guides/tier-5-add-a-screen.md +18 -0
  33. package/guides/web-page-sdk-reference.md +3 -0
  34. package/package.json +2 -2
@@ -0,0 +1,39 @@
1
+ import type { FileHandle } from "@wix/himalaya/sdk-types";
2
+ /** A file the worker holds: a FileHandle, or just its `uri` (+ `ownerScope`). */
3
+ export type ImageInput = FileHandle | {
4
+ uri: string;
5
+ ownerScope?: string;
6
+ };
7
+ export type BarcodeFormat = "qr" | "aztec" | "data_matrix" | "pdf417" | "ean13" | "ean8" | "upc_a" | "upc_e" | "code128" | "code39" | "code93" | "codabar" | "itf" | "unknown";
8
+ /** A rectangle normalised to 0..1 of the image's width / height, origin top-left. */
9
+ export interface NormalizedBox {
10
+ x: number;
11
+ y: number;
12
+ width: number;
13
+ height: number;
14
+ }
15
+ export interface BarcodeDetectionAvailability {
16
+ available: boolean;
17
+ /** "apple_vision" | "mlkit" | "barcode_detector" when available. */
18
+ engine?: string;
19
+ reason?: string;
20
+ }
21
+ export interface DetectOptions {
22
+ /** Only these formats (default: all). Narrowing speeds detection up. */
23
+ formats?: BarcodeFormat[];
24
+ }
25
+ export interface Barcode {
26
+ /** The decoded payload (a URL, a product number, a Wi-Fi config…). */
27
+ value: string;
28
+ format: BarcodeFormat;
29
+ box: NormalizedBox;
30
+ }
31
+ export interface DetectResult {
32
+ barcodes: Barcode[];
33
+ engine: string;
34
+ }
35
+ /** Whether on-device barcode detection is available on this device / host (spec R8). Never rejects. */
36
+ export declare function availability(): Promise<BarcodeDetectionAvailability>;
37
+ /** Find and decode the barcodes in an image the worker holds. Rejects when unavailable or the file is missing. */
38
+ export declare function detect(image: ImageInput, opts?: DetectOptions): Promise<DetectResult>;
39
+ export declare const version = 1;
@@ -0,0 +1,32 @@
1
+ import type { FileHandle } from "@wix/himalaya/sdk-types";
2
+ /** A file the worker holds: a FileHandle, or just its `uri` (+ `ownerScope`). */
3
+ export type ImageInput = FileHandle | {
4
+ uri: string;
5
+ ownerScope?: string;
6
+ };
7
+ export interface ImageLabelingAvailability {
8
+ available: boolean;
9
+ /** "apple_vision" | "mlkit" when available. */
10
+ engine?: string;
11
+ reason?: string;
12
+ }
13
+ export interface LabelOptions {
14
+ /** Drop labels below this confidence (0..1). Default 0.5. */
15
+ minConfidence?: number;
16
+ /** At most this many labels. Default 10. */
17
+ maxResults?: number;
18
+ }
19
+ export interface ImageLabel {
20
+ label: string;
21
+ confidence: number;
22
+ }
23
+ export interface LabelResult {
24
+ /** Most confident first. */
25
+ labels: ImageLabel[];
26
+ engine: string;
27
+ }
28
+ /** Whether on-device image labelling is available on this device / host (spec R8). Never rejects. */
29
+ export declare function availability(): Promise<ImageLabelingAvailability>;
30
+ /** Label an image the worker holds. Rejects when unavailable or the file is missing. */
31
+ export declare function label(image: ImageInput, opts?: LabelOptions): Promise<LabelResult>;
32
+ export declare const version = 1;
@@ -2,6 +2,7 @@
2
2
  export declare const CAPABILITY_REGISTRY: {
3
3
  readonly app_info: readonly ["get"];
4
4
  readonly audio_record: readonly ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"];
5
+ readonly barcode_detection: readonly ["availability", "detect"];
5
6
  readonly base44: readonly ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"];
6
7
  readonly biometrics: readonly ["available", "confirm"];
7
8
  readonly browser_auth: readonly ["start"];
@@ -17,6 +18,7 @@ export declare const CAPABILITY_REGISTRY: {
17
18
  readonly health: readonly ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"];
18
19
  readonly himi_apps: readonly ["canOpen", "current", "hostInfo", "open"];
19
20
  readonly iap: readonly ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"];
21
+ readonly image_labeling: readonly ["availability", "label"];
20
22
  readonly keyboard: readonly ["dismiss"];
21
23
  readonly legacy_import: readonly ["ack", "read"];
22
24
  readonly live_activity: readonly ["end", "start", "update"];
@@ -38,6 +40,7 @@ export declare const CAPABILITY_REGISTRY: {
38
40
  readonly speech: readonly ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"];
39
41
  readonly system_intents: readonly ["donate", "refreshShortcuts"];
40
42
  readonly tasks: readonly ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"];
43
+ readonly text_recognition: readonly ["availability", "recognize"];
41
44
  readonly theme: readonly ["applyOverlay", "clearOverlay", "surfaces"];
42
45
  readonly torch: readonly ["off", "on", "status", "toggle"];
43
46
  readonly ui: readonly ["alert", "snackbar"];
@@ -45,7 +48,7 @@ export declare const CAPABILITY_REGISTRY: {
45
48
  readonly wix_chat: readonly ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"];
46
49
  };
47
50
  /** A capability id backed by an @himalaya/* SDK binding. */
48
- export type SdkCapability = "app_info" | "audio_record" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "keyboard" | "legacy_import" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "network" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "theme" | "torch" | "ui" | "wix_cashier" | "wix_chat";
51
+ export type SdkCapability = "app_info" | "audio_record" | "barcode_detection" | "base44" | "biometrics" | "browser_auth" | "calendar" | "calls" | "camera" | "clipboard" | "contacts" | "file_picker" | "files" | "godot" | "haptic" | "health" | "himi_apps" | "iap" | "image_labeling" | "keyboard" | "legacy_import" | "live_activity" | "local_database" | "location" | "media_playback" | "motion" | "network" | "on_device_ai" | "open_url" | "pdf" | "photos" | "presigned_upload" | "push" | "release_control" | "secure_storage" | "share" | "speaker_diarization" | "speech" | "system_intents" | "tasks" | "text_recognition" | "theme" | "torch" | "ui" | "wix_cashier" | "wix_chat";
49
52
  /** All `capability.<id>.<verb>` action ids, flattened (the worker-bridge wire vocabulary). */
50
53
  export declare const CAPABILITY_ACTION_IDS: readonly string[];
51
54
  /** Capability id → the @himalaya/* package(s) a worker imports to reach it — every dispatch
@@ -0,0 +1,43 @@
1
+ import type { FileHandle } from "@wix/himalaya/sdk-types";
2
+ /** A file the worker holds: a FileHandle, or just its `uri` (+ `ownerScope`). */
3
+ export type ImageInput = FileHandle | {
4
+ uri: string;
5
+ ownerScope?: string;
6
+ };
7
+ /** A rectangle normalised to 0..1 of the image's width / height, origin top-left. */
8
+ export interface NormalizedBox {
9
+ x: number;
10
+ y: number;
11
+ width: number;
12
+ height: number;
13
+ }
14
+ export interface TextRecognitionAvailability {
15
+ available: boolean;
16
+ /** "apple_vision" | "mlkit" when available. */
17
+ engine?: string;
18
+ /** Why it is unavailable ("module_not_linked", "OCR is not available in this browser", …). */
19
+ reason?: string;
20
+ }
21
+ export interface RecognizeOptions {
22
+ /** BCP-47 language hints, most likely first (e.g. ["en", "fr"]). Engines may ignore them. */
23
+ languages?: string[];
24
+ /** "accurate" (default) or "fast". */
25
+ level?: "accurate" | "fast";
26
+ }
27
+ export interface TextBlock {
28
+ text: string;
29
+ /** 0..1, absent when the engine reports none. */
30
+ confidence?: number;
31
+ box: NormalizedBox;
32
+ }
33
+ export interface RecognizeResult {
34
+ /** Every block's text, joined by newlines in reading order. */
35
+ text: string;
36
+ blocks: TextBlock[];
37
+ engine: string;
38
+ }
39
+ /** Whether on-device OCR is available on this device / host (spec R8). Never rejects. */
40
+ export declare function availability(): Promise<TextRecognitionAvailability>;
41
+ /** Recognise the text in an image the worker holds. Rejects when unavailable or the file is missing. */
42
+ export declare function recognize(image: ImageInput, opts?: RecognizeOptions): Promise<RecognizeResult>;
43
+ export declare const version = 1;
@@ -1,5 +1,6 @@
1
1
  import type * as AppInfoSdk from "@wix/himalaya/app-info";
2
2
  import type * as AudioRecordSdk from "@wix/himalaya/audio-record";
3
+ import type * as BarcodeDetectionSdk from "@wix/himalaya/barcode-detection";
3
4
  import type * as Base44Sdk from "@wix/himalaya/base44";
4
5
  import type * as BiometricsSdk from "@wix/himalaya/biometrics";
5
6
  import type * as BrowserAuthSdk from "@wix/himalaya/browser-auth";
@@ -15,6 +16,7 @@ import type * as HapticSdk from "@wix/himalaya/haptic";
15
16
  import type * as HealthSdk from "@wix/himalaya/health";
16
17
  import type * as HimiAppsSdk from "@wix/himalaya/himi-apps";
17
18
  import type * as IapSdk from "@wix/himalaya/iap";
19
+ import type * as ImageLabelingSdk from "@wix/himalaya/image-labeling";
18
20
  import type * as KeyboardSdk from "@wix/himalaya/keyboard";
19
21
  import type * as LegacyImportSdk from "@wix/himalaya/legacy-import";
20
22
  import type * as LiveActivitySdk from "@wix/himalaya/live-activity";
@@ -36,6 +38,7 @@ import type * as SpeakerDiarizationSdk from "@wix/himalaya/speaker-diarization";
36
38
  import type * as SpeechSdk from "@wix/himalaya/speech";
37
39
  import type * as SystemIntentsSdk from "@wix/himalaya/system-intents";
38
40
  import type * as TasksSdk from "@wix/himalaya/tasks";
41
+ import type * as TextRecognitionSdk from "@wix/himalaya/text-recognition";
39
42
  import type * as ThemeSdk from "@wix/himalaya/theme";
40
43
  import type * as TorchSdk from "@wix/himalaya/torch";
41
44
  import type * as UiSdk from "@wix/himalaya/ui";
@@ -55,6 +58,7 @@ type PageEvents = {
55
58
  export interface HimalayaPageCapabilities {
56
59
  readonly "app_info": PageModule<typeof AppInfoSdk> & PageEvents;
57
60
  readonly "audio_record": PageModule<typeof AudioRecordSdk> & PageEvents;
61
+ readonly "barcode_detection": PageModule<typeof BarcodeDetectionSdk> & PageEvents;
58
62
  readonly "base44": PageModule<typeof Base44Sdk> & PageEvents;
59
63
  readonly "biometrics": PageModule<typeof BiometricsSdk> & PageEvents;
60
64
  readonly "browser_auth": PageModule<typeof BrowserAuthSdk> & PageEvents;
@@ -70,6 +74,7 @@ export interface HimalayaPageCapabilities {
70
74
  readonly "health": PageModule<typeof HealthSdk> & PageEvents;
71
75
  readonly "himi_apps": PageModule<typeof HimiAppsSdk> & PageEvents;
72
76
  readonly "iap": PageModule<typeof IapSdk> & PageEvents;
77
+ readonly "image_labeling": PageModule<typeof ImageLabelingSdk> & PageEvents;
73
78
  readonly "keyboard": PageModule<typeof KeyboardSdk> & PageEvents;
74
79
  readonly "legacy_import": PageModule<typeof LegacyImportSdk> & PageEvents;
75
80
  readonly "live_activity": PageModule<typeof LiveActivitySdk> & PageEvents;
@@ -91,6 +96,7 @@ export interface HimalayaPageCapabilities {
91
96
  readonly "speech": PageModule<typeof SpeechSdk> & PageEvents;
92
97
  readonly "system_intents": PageModule<typeof SystemIntentsSdk> & PageEvents;
93
98
  readonly "tasks": PageModule<typeof TasksSdk> & PageEvents;
99
+ readonly "text_recognition": PageModule<typeof TextRecognitionSdk> & PageEvents;
94
100
  readonly "theme": PageModule<typeof ThemeSdk> & PageEvents;
95
101
  readonly "torch": PageModule<typeof TorchSdk> & PageEvents;
96
102
  readonly "ui": PageModule<typeof UiSdk> & PageEvents;
@@ -883,7 +883,7 @@ export interface OrientationEnvelope {
883
883
  export declare const DEFAULT_ORIENTATION_ENVELOPE: Required<OrientationEnvelope>;
884
884
  /** Fill in the absent families. Total, so callers never branch on `undefined`. */
885
885
  export declare function resolveOrientationEnvelope(env?: OrientationEnvelope): Required<OrientationEnvelope>;
886
- export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "l10n" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "torch" | "network" | "wix_cashier" | "wix_chat" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "app_info" | "release_control" | "legacy_import" | "godot" | "base44" | "animation" | "video_playback";
886
+ export type Capability = "camera" | "barcode_scanner" | "biometrics" | "secure_storage" | "share" | "push" | "file_picker" | "files" | "open_url" | "pdf" | "clipboard" | "theme" | "l10n" | "photos" | "presigned_upload" | "ui" | "calendar" | "contacts" | "tasks" | "audio_record" | "audio_record_background" | "calls" | "location" | "location_background" | "motion" | "health" | "media_playback" | "webview" | "browser_auth" | "haptic" | "himi_apps" | "iap" | "keyboard" | "torch" | "network" | "wix_cashier" | "wix_chat" | "live_activity" | "local_database" | "speech" | "speaker_diarization" | "system_intents" | "on_device_ai" | "text_recognition" | "image_labeling" | "barcode_detection" | "app_info" | "release_control" | "legacy_import" | "godot" | "base44" | "animation" | "video_playback";
887
887
  /** `defineApp({ wixIap })` — the purchases-service app a build binds this app to. */
888
888
  export interface WixIapConfig {
889
889
  /** The purchases service's app UUID, registered on the app's own auth site. Not a secret. */
@@ -17,6 +17,7 @@ function dispatch(handlerId, params, _options) {
17
17
  var CAPABILITY_REGISTRY = {
18
18
  "app_info": ["get"],
19
19
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
20
+ "barcode_detection": ["availability", "detect"],
20
21
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
21
22
  "biometrics": ["available", "confirm"],
22
23
  "browser_auth": ["start"],
@@ -32,6 +33,7 @@ var CAPABILITY_REGISTRY = {
32
33
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
34
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
35
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "image_labeling": ["availability", "label"],
35
37
  "keyboard": ["dismiss"],
36
38
  "legacy_import": ["ack", "read"],
37
39
  "live_activity": ["end", "start", "update"],
@@ -53,6 +55,7 @@ var CAPABILITY_REGISTRY = {
53
55
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
54
56
  "system_intents": ["donate", "refreshShortcuts"],
55
57
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
58
+ "text_recognition": ["availability", "recognize"],
56
59
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
57
60
  "torch": ["off", "on", "status", "toggle"],
58
61
  "ui": ["alert", "snackbar"],
@@ -0,0 +1,36 @@
1
+ // ../../core/sdk/dispatch/src/index.ts
2
+ function dispatch(handlerId, params, _options) {
3
+ const himalaya = globalThis.himalaya;
4
+ if (!himalaya) {
5
+ return Promise.reject(
6
+ new Error("@himalaya/dispatch: called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5).")
7
+ );
8
+ }
9
+ const stringParams = {};
10
+ if (params) {
11
+ for (const [k, v] of Object.entries(params)) stringParams[k] = String(v);
12
+ }
13
+ return himalaya.dispatch(handlerId, stringParams);
14
+ }
15
+
16
+ // ../../core/sdk/barcode-detection/src/index.ts
17
+ async function availability() {
18
+ const r = await dispatch("capability.barcode_detection.availability");
19
+ return { available: r?.available === true, engine: r?.engine, reason: r?.reason };
20
+ }
21
+ async function detect(image, opts = {}) {
22
+ if (!image?.uri) throw new Error("barcode-detection.detect: an image with a uri is required");
23
+ const r = await dispatch("capability.barcode_detection.detect", {
24
+ uri: image.uri,
25
+ ...image.ownerScope ? { ownerScope: image.ownerScope } : {},
26
+ ...opts.formats?.length ? { formats: opts.formats.join(",") } : {}
27
+ });
28
+ return { barcodes: Array.isArray(r?.barcodes) ? r.barcodes : [], engine: r?.engine ?? "" };
29
+ }
30
+ var version = 1;
31
+ export {
32
+ availability,
33
+ detect,
34
+ version
35
+ };
36
+ //# sourceMappingURL=barcode-detection.mjs.map
@@ -17,6 +17,7 @@ function dispatch(handlerId, params, _options) {
17
17
  var CAPABILITY_REGISTRY = {
18
18
  "app_info": ["get"],
19
19
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
20
+ "barcode_detection": ["availability", "detect"],
20
21
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
21
22
  "biometrics": ["available", "confirm"],
22
23
  "browser_auth": ["start"],
@@ -32,6 +33,7 @@ var CAPABILITY_REGISTRY = {
32
33
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
34
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
35
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "image_labeling": ["availability", "label"],
35
37
  "keyboard": ["dismiss"],
36
38
  "legacy_import": ["ack", "read"],
37
39
  "live_activity": ["end", "start", "update"],
@@ -53,6 +55,7 @@ var CAPABILITY_REGISTRY = {
53
55
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
54
56
  "system_intents": ["donate", "refreshShortcuts"],
55
57
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
58
+ "text_recognition": ["availability", "recognize"],
56
59
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
57
60
  "torch": ["off", "on", "status", "toggle"],
58
61
  "ui": ["alert", "snackbar"],
@@ -17,6 +17,7 @@ function dispatch(handlerId, params, _options) {
17
17
  var CAPABILITY_REGISTRY = {
18
18
  "app_info": ["get"],
19
19
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
20
+ "barcode_detection": ["availability", "detect"],
20
21
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
21
22
  "biometrics": ["available", "confirm"],
22
23
  "browser_auth": ["start"],
@@ -32,6 +33,7 @@ var CAPABILITY_REGISTRY = {
32
33
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
34
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
35
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "image_labeling": ["availability", "label"],
35
37
  "keyboard": ["dismiss"],
36
38
  "legacy_import": ["ack", "read"],
37
39
  "live_activity": ["end", "start", "update"],
@@ -53,6 +55,7 @@ var CAPABILITY_REGISTRY = {
53
55
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
54
56
  "system_intents": ["donate", "refreshShortcuts"],
55
57
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
58
+ "text_recognition": ["availability", "recognize"],
56
59
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
57
60
  "torch": ["off", "on", "status", "toggle"],
58
61
  "ui": ["alert", "snackbar"],
@@ -17,6 +17,7 @@ function dispatch(handlerId, params, _options) {
17
17
  var CAPABILITY_REGISTRY = {
18
18
  "app_info": ["get"],
19
19
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
20
+ "barcode_detection": ["availability", "detect"],
20
21
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
21
22
  "biometrics": ["available", "confirm"],
22
23
  "browser_auth": ["start"],
@@ -32,6 +33,7 @@ var CAPABILITY_REGISTRY = {
32
33
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
34
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
35
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "image_labeling": ["availability", "label"],
35
37
  "keyboard": ["dismiss"],
36
38
  "legacy_import": ["ack", "read"],
37
39
  "live_activity": ["end", "start", "update"],
@@ -53,6 +55,7 @@ var CAPABILITY_REGISTRY = {
53
55
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
54
56
  "system_intents": ["donate", "refreshShortcuts"],
55
57
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
58
+ "text_recognition": ["availability", "recognize"],
56
59
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
57
60
  "torch": ["off", "on", "status", "toggle"],
58
61
  "ui": ["alert", "snackbar"],
@@ -15432,6 +15432,7 @@ function assertSiteShellConfig(site, opts) {
15432
15432
  var PAGE_CAPABILITY_DISPATCHES = {
15433
15433
  "app_info": [],
15434
15434
  "audio_record": [],
15435
+ "barcode_detection": [],
15435
15436
  "base44": [],
15436
15437
  "biometrics": [],
15437
15438
  "browser_auth": [],
@@ -15447,6 +15448,7 @@ var PAGE_CAPABILITY_DISPATCHES = {
15447
15448
  "health": [],
15448
15449
  "himi_apps": [],
15449
15450
  "iap": ["wix_api"],
15451
+ "image_labeling": [],
15450
15452
  "keyboard": [],
15451
15453
  "legacy_import": [],
15452
15454
  "live_activity": [],
@@ -15468,6 +15470,7 @@ var PAGE_CAPABILITY_DISPATCHES = {
15468
15470
  "speech": [],
15469
15471
  "system_intents": [],
15470
15472
  "tasks": [],
15473
+ "text_recognition": [],
15471
15474
  "theme": [],
15472
15475
  "torch": [],
15473
15476
  "ui": [],
@@ -0,0 +1,37 @@
1
+ // ../../core/sdk/dispatch/src/index.ts
2
+ function dispatch(handlerId, params, _options) {
3
+ const himalaya = globalThis.himalaya;
4
+ if (!himalaya) {
5
+ return Promise.reject(
6
+ new Error("@himalaya/dispatch: called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5).")
7
+ );
8
+ }
9
+ const stringParams = {};
10
+ if (params) {
11
+ for (const [k, v] of Object.entries(params)) stringParams[k] = String(v);
12
+ }
13
+ return himalaya.dispatch(handlerId, stringParams);
14
+ }
15
+
16
+ // ../../core/sdk/image-labeling/src/index.ts
17
+ async function availability() {
18
+ const r = await dispatch("capability.image_labeling.availability");
19
+ return { available: r?.available === true, engine: r?.engine, reason: r?.reason };
20
+ }
21
+ async function label(image, opts = {}) {
22
+ if (!image?.uri) throw new Error("image-labeling.label: an image with a uri is required");
23
+ const r = await dispatch("capability.image_labeling.label", {
24
+ uri: image.uri,
25
+ ...image.ownerScope ? { ownerScope: image.ownerScope } : {},
26
+ ...opts.minConfidence !== void 0 ? { minConfidence: String(opts.minConfidence) } : {},
27
+ ...opts.maxResults !== void 0 ? { maxResults: String(opts.maxResults) } : {}
28
+ });
29
+ return { labels: Array.isArray(r?.labels) ? r.labels : [], engine: r?.engine ?? "" };
30
+ }
31
+ var version = 1;
32
+ export {
33
+ availability,
34
+ label,
35
+ version
36
+ };
37
+ //# sourceMappingURL=image-labeling.mjs.map
@@ -17,6 +17,7 @@ function dispatch(handlerId, params, _options) {
17
17
  var CAPABILITY_REGISTRY = {
18
18
  "app_info": ["get"],
19
19
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
20
+ "barcode_detection": ["availability", "detect"],
20
21
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
21
22
  "biometrics": ["available", "confirm"],
22
23
  "browser_auth": ["start"],
@@ -32,6 +33,7 @@ var CAPABILITY_REGISTRY = {
32
33
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
34
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
35
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "image_labeling": ["availability", "label"],
35
37
  "keyboard": ["dismiss"],
36
38
  "legacy_import": ["ack", "read"],
37
39
  "live_activity": ["end", "start", "update"],
@@ -53,6 +55,7 @@ var CAPABILITY_REGISTRY = {
53
55
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
54
56
  "system_intents": ["donate", "refreshShortcuts"],
55
57
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
58
+ "text_recognition": ["availability", "recognize"],
56
59
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
57
60
  "torch": ["off", "on", "status", "toggle"],
58
61
  "ui": ["alert", "snackbar"],
@@ -17,6 +17,7 @@ function dispatch(handlerId, params, _options) {
17
17
  var CAPABILITY_REGISTRY = {
18
18
  "app_info": ["get"],
19
19
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
20
+ "barcode_detection": ["availability", "detect"],
20
21
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
21
22
  "biometrics": ["available", "confirm"],
22
23
  "browser_auth": ["start"],
@@ -32,6 +33,7 @@ var CAPABILITY_REGISTRY = {
32
33
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
34
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
35
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "image_labeling": ["availability", "label"],
35
37
  "keyboard": ["dismiss"],
36
38
  "legacy_import": ["ack", "read"],
37
39
  "live_activity": ["end", "start", "update"],
@@ -53,6 +55,7 @@ var CAPABILITY_REGISTRY = {
53
55
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
54
56
  "system_intents": ["donate", "refreshShortcuts"],
55
57
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
58
+ "text_recognition": ["availability", "recognize"],
56
59
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
57
60
  "torch": ["off", "on", "status", "toggle"],
58
61
  "ui": ["alert", "snackbar"],
@@ -17,6 +17,7 @@ function dispatch(handlerId, params, _options) {
17
17
  var CAPABILITY_REGISTRY = {
18
18
  "app_info": ["get"],
19
19
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
20
+ "barcode_detection": ["availability", "detect"],
20
21
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
21
22
  "biometrics": ["available", "confirm"],
22
23
  "browser_auth": ["start"],
@@ -32,6 +33,7 @@ var CAPABILITY_REGISTRY = {
32
33
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
34
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
35
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "image_labeling": ["availability", "label"],
35
37
  "keyboard": ["dismiss"],
36
38
  "legacy_import": ["ack", "read"],
37
39
  "live_activity": ["end", "start", "update"],
@@ -53,6 +55,7 @@ var CAPABILITY_REGISTRY = {
53
55
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
54
56
  "system_intents": ["donate", "refreshShortcuts"],
55
57
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
58
+ "text_recognition": ["availability", "recognize"],
56
59
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
57
60
  "torch": ["off", "on", "status", "toggle"],
58
61
  "ui": ["alert", "snackbar"],
@@ -2,6 +2,7 @@
2
2
  var CAPABILITY_REGISTRY = {
3
3
  "app_info": ["get"],
4
4
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
5
+ "barcode_detection": ["availability", "detect"],
5
6
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
6
7
  "biometrics": ["available", "confirm"],
7
8
  "browser_auth": ["start"],
@@ -17,6 +18,7 @@ var CAPABILITY_REGISTRY = {
17
18
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
18
19
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
19
20
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
21
+ "image_labeling": ["availability", "label"],
20
22
  "keyboard": ["dismiss"],
21
23
  "legacy_import": ["ack", "read"],
22
24
  "live_activity": ["end", "start", "update"],
@@ -38,6 +40,7 @@ var CAPABILITY_REGISTRY = {
38
40
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
39
41
  "system_intents": ["donate", "refreshShortcuts"],
40
42
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
43
+ "text_recognition": ["availability", "recognize"],
41
44
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
42
45
  "torch": ["off", "on", "status", "toggle"],
43
46
  "ui": ["alert", "snackbar"],
@@ -17,6 +17,7 @@ function dispatch(handlerId, params, _options) {
17
17
  var CAPABILITY_REGISTRY = {
18
18
  "app_info": ["get"],
19
19
  "audio_record": ["cancel", "cancelSession", "getPermissionStatus", "getSession", "listSegments", "listSessions", "pause", "requestPermission", "resume", "start", "startSession", "stop", "stopSession", "subscribeLevel", "watchNext", "watchStart", "watchStop"],
20
+ "barcode_detection": ["availability", "detect"],
20
21
  "base44": ["authLoginViaEmailPassword", "authLoginViaOtp", "authLoginWithProvider", "authLogout", "authMe", "authRegister", "authResetPassword", "authStatus", "authUpdateMe", "authVerifyOtp", "entitiesBulkCreate", "entitiesCreate", "entitiesDelete", "entitiesFilter", "entitiesGet", "entitiesList", "entitiesUpdate", "functionsInvoke"],
21
22
  "biometrics": ["available", "confirm"],
22
23
  "browser_auth": ["start"],
@@ -32,6 +33,7 @@ var CAPABILITY_REGISTRY = {
32
33
  "health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
33
34
  "himi_apps": ["canOpen", "current", "hostInfo", "open"],
34
35
  "iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
36
+ "image_labeling": ["availability", "label"],
35
37
  "keyboard": ["dismiss"],
36
38
  "legacy_import": ["ack", "read"],
37
39
  "live_activity": ["end", "start", "update"],
@@ -53,6 +55,7 @@ var CAPABILITY_REGISTRY = {
53
55
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
54
56
  "system_intents": ["donate", "refreshShortcuts"],
55
57
  "tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
58
+ "text_recognition": ["availability", "recognize"],
56
59
  "theme": ["applyOverlay", "clearOverlay", "surfaces"],
57
60
  "torch": ["off", "on", "status", "toggle"],
58
61
  "ui": ["alert", "snackbar"],
@@ -0,0 +1,41 @@
1
+ // ../../core/sdk/dispatch/src/index.ts
2
+ function dispatch(handlerId, params, _options) {
3
+ const himalaya = globalThis.himalaya;
4
+ if (!himalaya) {
5
+ return Promise.reject(
6
+ new Error("@himalaya/dispatch: called outside a Himalaya runtime. This bundle must run inside a JSWorker (Tier 5).")
7
+ );
8
+ }
9
+ const stringParams = {};
10
+ if (params) {
11
+ for (const [k, v] of Object.entries(params)) stringParams[k] = String(v);
12
+ }
13
+ return himalaya.dispatch(handlerId, stringParams);
14
+ }
15
+
16
+ // ../../core/sdk/text-recognition/src/index.ts
17
+ async function availability() {
18
+ const r = await dispatch("capability.text_recognition.availability");
19
+ return { available: r?.available === true, engine: r?.engine, reason: r?.reason };
20
+ }
21
+ async function recognize(image, opts = {}) {
22
+ if (!image?.uri) throw new Error("text-recognition.recognize: an image with a uri is required");
23
+ const r = await dispatch("capability.text_recognition.recognize", {
24
+ uri: image.uri,
25
+ ...image.ownerScope ? { ownerScope: image.ownerScope } : {},
26
+ ...opts.languages?.length ? { languages: opts.languages.join(",") } : {},
27
+ ...opts.level ? { level: opts.level } : {}
28
+ });
29
+ return {
30
+ text: typeof r?.text === "string" ? r.text : "",
31
+ blocks: Array.isArray(r?.blocks) ? r.blocks : [],
32
+ engine: r?.engine ?? ""
33
+ };
34
+ }
35
+ var version = 1;
36
+ export {
37
+ availability,
38
+ recognize,
39
+ version
40
+ };
41
+ //# sourceMappingURL=text-recognition.mjs.map