@wix/himalaya-cli 0.1727.0 → 0.1729.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.
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/barcode-detection/src/index.d.ts +39 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/entity-extraction/src/index.d.ts +34 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/image-labeling/src/index.d.ts +32 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +7 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/text-embedding/src/index.d.ts +37 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/text-recognition/src/index.d.ts +43 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/translation/src/index.d.ts +51 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/webview-page/src/capabilities.generated.d.ts +12 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/define-app.d.ts +1 -1
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/barcode-detection.mjs +36 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/entity-extraction.mjs +38 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/image-labeling.mjs +37 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +6 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/text-embedding.mjs +76 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/text-recognition.mjs +41 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/translation.mjs +66 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/package.json +24 -0
- package/dist/browser-plane/assets.json +5 -5
- package/dist/browser-plane/preview-deferred/{962f3ed94715c3a8d073254239901e2ffd5bb99015fd5d37ae36eaa0f0dce2be.bin → ad21c55bd7cec9a3951ff818f08792daab5d3698b7e54af1b1764499335604ea.bin} +1 -1
- package/dist/browser-plane/sw.js +6 -6
- package/dist/cli.mjs +531 -91
- package/dist/preview-assets.generated.bin +0 -0
- package/guides/app-config.md +1 -1
- package/guides/capabilities.md +6 -0
- package/guides/himi-test.md +4 -2
- package/guides/importable-sdks.md +6 -0
- package/guides/qa-builds.md +104 -1
- package/guides/release-notes.md +30 -0
- package/guides/sdk-reference.json +448 -0
- package/guides/tier-5-add-a-screen.md +18 -0
- package/guides/web-page-sdk-reference.md +6 -0
- package/package.json +2 -2
- package/templates/beauty-salon-owner/dev/index.ts +35 -0
- package/templates/branded-lite/dev/index.ts +16 -0
- package/templates/community-club/dev/index.ts +2 -0
- package/templates/community-club-owner/dev/index.ts +35 -0
- package/templates/conference/dev/index.ts +1 -0
- package/templates/events-meetups/dev/index.ts +2 -0
- package/templates/events-meetups-owner/dev/index.ts +31 -0
- package/templates/gym-fitness/dev/index.ts +1 -0
- package/templates/gym-fitness-owner/dev/index.ts +37 -0
- package/templates/nonprofit-cause/dev/index.ts +2 -0
- package/templates/nonprofit-cause-owner/dev/index.ts +33 -0
- package/templates/owner-lite/dev/index.ts +37 -0
- package/templates/podcast-creator/dev/index.ts +2 -0
- package/templates/podcast-creator-owner/dev/index.ts +35 -0
- package/templates/portfolio-creative/dev/index.ts +2 -0
- package/templates/portfolio-creative-owner/dev/index.ts +35 -0
- package/templates/restaurant/dev/index.ts +2 -0
- package/templates/restaurant-owner/dev/index.ts +37 -0
- package/templates/retail-store-owner/dev/index.ts +33 -0
- package/templates/yoga-studio/dev/index.ts +2 -0
- package/templates/yoga-studio-owner/dev/index.ts +33 -0
|
@@ -0,0 +1,38 @@
|
|
|
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/entity-extraction/src/index.ts
|
|
17
|
+
async function availability(language) {
|
|
18
|
+
const r = await dispatch("capability.entity_extraction.availability", language ? { language } : {});
|
|
19
|
+
return { available: r?.available === true, engine: r?.engine, reason: r?.reason };
|
|
20
|
+
}
|
|
21
|
+
async function extract(text, opts = {}) {
|
|
22
|
+
if (typeof text !== "string") throw new Error("entity-extraction.extract: text is required");
|
|
23
|
+
if (text.length === 0) return { entities: [], engine: "" };
|
|
24
|
+
const r = await dispatch("capability.entity_extraction.extract", {
|
|
25
|
+
text,
|
|
26
|
+
...opts.language ? { language: opts.language } : {},
|
|
27
|
+
...opts.types?.length ? { types: opts.types.join(",") } : {}
|
|
28
|
+
});
|
|
29
|
+
const entities = Array.isArray(r?.entities) ? [...r.entities].sort((a, b) => a.start - b.start) : [];
|
|
30
|
+
return { entities, engine: r?.engine ?? "" };
|
|
31
|
+
}
|
|
32
|
+
var version = 1;
|
|
33
|
+
export {
|
|
34
|
+
availability,
|
|
35
|
+
extract,
|
|
36
|
+
version
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=entity-extraction.mjs.map
|
|
@@ -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"],
|
|
@@ -25,6 +26,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
25
26
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
27
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
27
28
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
29
|
+
"entity_extraction": ["availability", "extract"],
|
|
28
30
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
29
31
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
30
32
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -32,6 +34,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
32
34
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
33
35
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
34
36
|
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
37
|
+
"image_labeling": ["availability", "label"],
|
|
35
38
|
"keyboard": ["dismiss"],
|
|
36
39
|
"legacy_import": ["ack", "read"],
|
|
37
40
|
"live_activity": ["end", "start", "update"],
|
|
@@ -53,8 +56,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
56
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
54
57
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
55
58
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
59
|
+
"text_embedding": ["availability", "embed"],
|
|
60
|
+
"text_recognition": ["availability", "recognize"],
|
|
56
61
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
57
62
|
"torch": ["off", "on", "status", "toggle"],
|
|
63
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
58
64
|
"ui": ["alert", "snackbar"],
|
|
59
65
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
60
66
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -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"],
|
|
@@ -25,6 +26,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
25
26
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
27
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
27
28
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
29
|
+
"entity_extraction": ["availability", "extract"],
|
|
28
30
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
29
31
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
30
32
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -32,6 +34,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
32
34
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
33
35
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
34
36
|
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
37
|
+
"image_labeling": ["availability", "label"],
|
|
35
38
|
"keyboard": ["dismiss"],
|
|
36
39
|
"legacy_import": ["ack", "read"],
|
|
37
40
|
"live_activity": ["end", "start", "update"],
|
|
@@ -53,8 +56,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
56
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
54
57
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
55
58
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
59
|
+
"text_embedding": ["availability", "embed"],
|
|
60
|
+
"text_recognition": ["availability", "recognize"],
|
|
56
61
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
57
62
|
"torch": ["off", "on", "status", "toggle"],
|
|
63
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
58
64
|
"ui": ["alert", "snackbar"],
|
|
59
65
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
60
66
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -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"],
|
|
@@ -25,6 +26,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
25
26
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
27
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
27
28
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
29
|
+
"entity_extraction": ["availability", "extract"],
|
|
28
30
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
29
31
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
30
32
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -32,6 +34,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
32
34
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
33
35
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
34
36
|
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
37
|
+
"image_labeling": ["availability", "label"],
|
|
35
38
|
"keyboard": ["dismiss"],
|
|
36
39
|
"legacy_import": ["ack", "read"],
|
|
37
40
|
"live_activity": ["end", "start", "update"],
|
|
@@ -53,8 +56,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
56
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
54
57
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
55
58
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
59
|
+
"text_embedding": ["availability", "embed"],
|
|
60
|
+
"text_recognition": ["availability", "recognize"],
|
|
56
61
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
57
62
|
"torch": ["off", "on", "status", "toggle"],
|
|
63
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
58
64
|
"ui": ["alert", "snackbar"],
|
|
59
65
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
60
66
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -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"],
|
|
@@ -10,6 +11,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
10
11
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
11
12
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
12
13
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
14
|
+
"entity_extraction": ["availability", "extract"],
|
|
13
15
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
14
16
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
15
17
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -17,6 +19,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
17
19
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
18
20
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
19
21
|
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
22
|
+
"image_labeling": ["availability", "label"],
|
|
20
23
|
"keyboard": ["dismiss"],
|
|
21
24
|
"legacy_import": ["ack", "read"],
|
|
22
25
|
"live_activity": ["end", "start", "update"],
|
|
@@ -38,8 +41,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
38
41
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
39
42
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
40
43
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
44
|
+
"text_embedding": ["availability", "embed"],
|
|
45
|
+
"text_recognition": ["availability", "recognize"],
|
|
41
46
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
42
47
|
"torch": ["off", "on", "status", "toggle"],
|
|
48
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
43
49
|
"ui": ["alert", "snackbar"],
|
|
44
50
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
45
51
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -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"],
|
|
@@ -25,6 +26,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
25
26
|
"camera": ["capture", "pickDocument", "prepareImage", "scanQR"],
|
|
26
27
|
"clipboard": ["hasImage", "hasText", "readText", "writeImage", "writeText"],
|
|
27
28
|
"contacts": ["add", "getPermissionStatus", "pick", "presentNewContact", "requestPermission", "search"],
|
|
29
|
+
"entity_extraction": ["availability", "extract"],
|
|
28
30
|
"file_picker": ["pick", "pickDirectoryForExport"],
|
|
29
31
|
"files": ["download", "export", "list", "readText", "remove", "stat", "storageInfo", "write"],
|
|
30
32
|
"godot": ["loadPack", "release", "send"],
|
|
@@ -32,6 +34,7 @@ var CAPABILITY_REGISTRY = {
|
|
|
32
34
|
"health": ["availability", "getPermissionStatus", "query", "requestPermission", "saveWorkout"],
|
|
33
35
|
"himi_apps": ["canOpen", "current", "hostInfo", "open"],
|
|
34
36
|
"iap": ["appBinding", "consume", "entitlements", "finishTransaction", "getPaywallConfig", "getProducts", "getUnfinishedTransactions", "purchase", "purchaseForVerification", "restore", "storefront"],
|
|
37
|
+
"image_labeling": ["availability", "label"],
|
|
35
38
|
"keyboard": ["dismiss"],
|
|
36
39
|
"legacy_import": ["ack", "read"],
|
|
37
40
|
"live_activity": ["end", "start", "update"],
|
|
@@ -53,8 +56,11 @@ var CAPABILITY_REGISTRY = {
|
|
|
53
56
|
"speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
|
|
54
57
|
"system_intents": ["donate", "refreshShortcuts"],
|
|
55
58
|
"tasks": ["backend", "create", "getPermissionStatus", "list", "remove", "requestPermission", "setCompleted"],
|
|
59
|
+
"text_embedding": ["availability", "embed"],
|
|
60
|
+
"text_recognition": ["availability", "recognize"],
|
|
56
61
|
"theme": ["applyOverlay", "clearOverlay", "surfaces"],
|
|
57
62
|
"torch": ["off", "on", "status", "toggle"],
|
|
63
|
+
"translation": ["availability", "identifyLanguage", "prepare", "translate"],
|
|
58
64
|
"ui": ["alert", "snackbar"],
|
|
59
65
|
"wix_cashier": ["isAvailable", "proceedToPayment"],
|
|
60
66
|
"wix_chat": ["getRealtimeStatus", "subscribeRealtime", "unsubscribeRealtime"]
|
|
@@ -0,0 +1,76 @@
|
|
|
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-embedding/src/index.ts
|
|
17
|
+
var MAX_TEXTS_PER_CALL = 64;
|
|
18
|
+
async function availability(language) {
|
|
19
|
+
const r = await dispatch("capability.text_embedding.availability", language ? { language } : {});
|
|
20
|
+
return {
|
|
21
|
+
available: r?.available === true,
|
|
22
|
+
engine: r?.engine,
|
|
23
|
+
dimensions: typeof r?.dimensions === "number" ? r.dimensions : void 0,
|
|
24
|
+
reason: r?.reason
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
async function embed(texts, opts = {}) {
|
|
28
|
+
if (!Array.isArray(texts) || texts.length === 0) throw new Error("text-embedding.embed: at least one text is required");
|
|
29
|
+
if (texts.length > MAX_TEXTS_PER_CALL) {
|
|
30
|
+
throw new Error(`text-embedding.embed: at most ${MAX_TEXTS_PER_CALL} texts per call (got ${texts.length})`);
|
|
31
|
+
}
|
|
32
|
+
const r = await dispatch("capability.text_embedding.embed", {
|
|
33
|
+
texts: JSON.stringify(texts),
|
|
34
|
+
...opts.language ? { language: opts.language } : {}
|
|
35
|
+
});
|
|
36
|
+
const vectors = Array.isArray(r?.vectors) ? r.vectors : [];
|
|
37
|
+
return {
|
|
38
|
+
vectors,
|
|
39
|
+
dimensions: typeof r?.dimensions === "number" ? r.dimensions : vectors[0]?.length ?? 0,
|
|
40
|
+
engine: r?.engine ?? ""
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function cosineSimilarity(a, b) {
|
|
44
|
+
if (a.length === 0 || a.length !== b.length) return 0;
|
|
45
|
+
let dot = 0;
|
|
46
|
+
let na = 0;
|
|
47
|
+
let nb = 0;
|
|
48
|
+
for (let i = 0; i < a.length; i++) {
|
|
49
|
+
dot += a[i] * b[i];
|
|
50
|
+
na += a[i] * a[i];
|
|
51
|
+
nb += b[i] * b[i];
|
|
52
|
+
}
|
|
53
|
+
if (na === 0 || nb === 0) return 0;
|
|
54
|
+
return dot / Math.sqrt(na * nb);
|
|
55
|
+
}
|
|
56
|
+
async function rank(query, candidates, opts = {}) {
|
|
57
|
+
if (candidates.length === 0) return [];
|
|
58
|
+
const [q] = (await embed([query], opts)).vectors;
|
|
59
|
+
const scored = [];
|
|
60
|
+
for (let start = 0; start < candidates.length; start += MAX_TEXTS_PER_CALL) {
|
|
61
|
+
const batch = candidates.slice(start, start + MAX_TEXTS_PER_CALL);
|
|
62
|
+
const { vectors } = await embed(batch, opts);
|
|
63
|
+
batch.forEach((text, i) => scored.push({ text, index: start + i, score: cosineSimilarity(q ?? [], vectors[i] ?? []) }));
|
|
64
|
+
}
|
|
65
|
+
return scored.sort((x, y) => y.score - x.score);
|
|
66
|
+
}
|
|
67
|
+
var version = 1;
|
|
68
|
+
export {
|
|
69
|
+
MAX_TEXTS_PER_CALL,
|
|
70
|
+
availability,
|
|
71
|
+
cosineSimilarity,
|
|
72
|
+
embed,
|
|
73
|
+
rank,
|
|
74
|
+
version
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=text-embedding.mjs.map
|
|
@@ -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
|
|
@@ -0,0 +1,66 @@
|
|
|
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/translation/src/index.ts
|
|
17
|
+
function asStatus(s) {
|
|
18
|
+
return s === "installed" || s === "downloadable" ? s : "unsupported";
|
|
19
|
+
}
|
|
20
|
+
async function availability() {
|
|
21
|
+
const r = await dispatch("capability.translation.availability");
|
|
22
|
+
return { available: r?.available === true, engine: r?.engine, reason: r?.reason };
|
|
23
|
+
}
|
|
24
|
+
async function pairAvailability(source, target) {
|
|
25
|
+
const r = await dispatch("capability.translation.availability", { source, target });
|
|
26
|
+
return { available: r?.available === true, engine: r?.engine, reason: r?.reason, status: asStatus(r?.status) };
|
|
27
|
+
}
|
|
28
|
+
async function identifyLanguage(text) {
|
|
29
|
+
if (!text) throw new Error("translation.identifyLanguage: text is required");
|
|
30
|
+
const r = await dispatch("capability.translation.identifyLanguage", { text });
|
|
31
|
+
return {
|
|
32
|
+
language: r?.language || "und",
|
|
33
|
+
confidence: typeof r?.confidence === "number" ? r.confidence : 0,
|
|
34
|
+
candidates: Array.isArray(r?.candidates) ? r.candidates : [],
|
|
35
|
+
engine: r?.engine ?? ""
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async function prepare(source, target) {
|
|
39
|
+
const r = await dispatch("capability.translation.prepare", { source, target });
|
|
40
|
+
return { status: asStatus(r?.status), engine: r?.engine ?? "", reason: r?.reason };
|
|
41
|
+
}
|
|
42
|
+
async function translate(input) {
|
|
43
|
+
if (!input.text) throw new Error("translation.translate: text is required");
|
|
44
|
+
if (!input.target) throw new Error("translation.translate: target is required");
|
|
45
|
+
const r = await dispatch("capability.translation.translate", {
|
|
46
|
+
text: input.text,
|
|
47
|
+
target: input.target,
|
|
48
|
+
...input.source ? { source: input.source } : {}
|
|
49
|
+
});
|
|
50
|
+
return {
|
|
51
|
+
text: r?.text ?? "",
|
|
52
|
+
source: r?.source ?? input.source ?? "und",
|
|
53
|
+
target: r?.target ?? input.target,
|
|
54
|
+
engine: r?.engine ?? ""
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
var version = 1;
|
|
58
|
+
export {
|
|
59
|
+
availability,
|
|
60
|
+
identifyLanguage,
|
|
61
|
+
pairAvailability,
|
|
62
|
+
prepare,
|
|
63
|
+
translate,
|
|
64
|
+
version
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=translation.mjs.map
|
|
@@ -42,6 +42,10 @@
|
|
|
42
42
|
"types": "./dist/_types/stdlib/auth-providers/google/src/index.d.ts",
|
|
43
43
|
"import": "./dist/auth-google.mjs"
|
|
44
44
|
},
|
|
45
|
+
"./barcode-detection": {
|
|
46
|
+
"types": "./dist/_types/core/sdk/barcode-detection/src/index.d.ts",
|
|
47
|
+
"import": "./dist/barcode-detection.mjs"
|
|
48
|
+
},
|
|
45
49
|
"./base44": {
|
|
46
50
|
"types": "./dist/_types/core/sdk/base44/src/index.d.ts",
|
|
47
51
|
"import": "./dist/base44.mjs"
|
|
@@ -98,6 +102,10 @@
|
|
|
98
102
|
"types": "./dist/_types/core/sdk/dispatch/src/index.d.ts",
|
|
99
103
|
"import": "./dist/dispatch.mjs"
|
|
100
104
|
},
|
|
105
|
+
"./entity-extraction": {
|
|
106
|
+
"types": "./dist/_types/core/sdk/entity-extraction/src/index.d.ts",
|
|
107
|
+
"import": "./dist/entity-extraction.mjs"
|
|
108
|
+
},
|
|
101
109
|
"./file-picker": {
|
|
102
110
|
"types": "./dist/_types/core/sdk/file-picker/src/index.d.ts",
|
|
103
111
|
"import": "./dist/file-picker.mjs"
|
|
@@ -138,6 +146,10 @@
|
|
|
138
146
|
"types": "./dist/_types/stdlib/flows/iap-checkout/src/index.d.ts",
|
|
139
147
|
"import": "./dist/iap-checkout.mjs"
|
|
140
148
|
},
|
|
149
|
+
"./image-labeling": {
|
|
150
|
+
"types": "./dist/_types/core/sdk/image-labeling/src/index.d.ts",
|
|
151
|
+
"import": "./dist/image-labeling.mjs"
|
|
152
|
+
},
|
|
141
153
|
"./keyboard": {
|
|
142
154
|
"types": "./dist/_types/core/sdk/keyboard/src/index.d.ts",
|
|
143
155
|
"import": "./dist/keyboard.mjs"
|
|
@@ -254,6 +266,14 @@
|
|
|
254
266
|
"types": "./dist/_types/stdlib/telemetry/console/src/index.d.ts",
|
|
255
267
|
"import": "./dist/telemetry-console.mjs"
|
|
256
268
|
},
|
|
269
|
+
"./text-embedding": {
|
|
270
|
+
"types": "./dist/_types/core/sdk/text-embedding/src/index.d.ts",
|
|
271
|
+
"import": "./dist/text-embedding.mjs"
|
|
272
|
+
},
|
|
273
|
+
"./text-recognition": {
|
|
274
|
+
"types": "./dist/_types/core/sdk/text-recognition/src/index.d.ts",
|
|
275
|
+
"import": "./dist/text-recognition.mjs"
|
|
276
|
+
},
|
|
257
277
|
"./theme": {
|
|
258
278
|
"types": "./dist/_types/core/sdk/theme/src/index.d.ts",
|
|
259
279
|
"import": "./dist/theme.mjs"
|
|
@@ -266,6 +286,10 @@
|
|
|
266
286
|
"types": "./dist/_types/core/sdk/torch/src/index.d.ts",
|
|
267
287
|
"import": "./dist/torch.mjs"
|
|
268
288
|
},
|
|
289
|
+
"./translation": {
|
|
290
|
+
"types": "./dist/_types/core/sdk/translation/src/index.d.ts",
|
|
291
|
+
"import": "./dist/translation.mjs"
|
|
292
|
+
},
|
|
269
293
|
"./ui": {
|
|
270
294
|
"types": "./dist/_types/core/sdk/ui/src/index.d.ts",
|
|
271
295
|
"import": "./dist/ui.mjs"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"files": [
|
|
3
3
|
{
|
|
4
4
|
"name": "sw.js",
|
|
5
|
-
"bytes":
|
|
5
|
+
"bytes": 2547180
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"name": "host.html",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"bytes": 24256
|
|
22
22
|
},
|
|
23
23
|
{
|
|
24
|
-
"name": "preview-deferred/
|
|
24
|
+
"name": "preview-deferred/ad21c55bd7cec9a3951ff818f08792daab5d3698b7e54af1b1764499335604ea.bin",
|
|
25
25
|
"bytes": 488215
|
|
26
26
|
},
|
|
27
27
|
{
|
|
@@ -79,10 +79,10 @@
|
|
|
79
79
|
],
|
|
80
80
|
"deferred": [
|
|
81
81
|
{
|
|
82
|
-
"key": "assets/pdf-
|
|
82
|
+
"key": "assets/pdf-w0FiZ2_y.js",
|
|
83
83
|
"contentType": "application/javascript; charset=utf-8",
|
|
84
|
-
"sha256": "
|
|
85
|
-
"file": "preview-deferred/
|
|
84
|
+
"sha256": "ad21c55bd7cec9a3951ff818f08792daab5d3698b7e54af1b1764499335604ea",
|
|
85
|
+
"file": "preview-deferred/ad21c55bd7cec9a3951ff818f08792daab5d3698b7e54af1b1764499335604ea.bin"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"key": "assets/pdf.worker.min-BGnVRhRG.js",
|