@wix/himalaya-cli 0.849.0 → 0.851.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 (20) hide show
  1. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/local-db/src/index.d.ts +23 -0
  2. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/sdk-types/src/capabilities.generated.d.ts +2 -2
  3. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/sdk/secure-storage/src/index.d.ts +23 -0
  4. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/preview-surfaces.d.ts +63 -2
  5. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/audio-record.mjs +2 -2
  6. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calendar.mjs +2 -2
  7. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/calls.mjs +2 -2
  8. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/contacts.mjs +2 -2
  9. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/core.mjs +35 -3
  10. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/local-db.mjs +10 -0
  11. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/location.mjs +2 -2
  12. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/motion.mjs +2 -2
  13. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/photos.mjs +2 -2
  14. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/sdk-types.mjs +2 -2
  15. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/secure-storage.mjs +10 -0
  16. package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/tasks.mjs +2 -2
  17. package/dist/cli.mjs +3691 -3248
  18. package/guides/mobile-ux.md +45 -32
  19. package/guides/sdk-reference.json +12 -0
  20. package/package.json +2 -2
@@ -1,3 +1,26 @@
1
+ import type { Availability } from "@wix/himalaya/sdk-types";
2
+ /**
3
+ * Whether this host actually backs the local database — the probe #2502 asked for.
4
+ *
5
+ * Without it, every read on a host that does not serve the capability is
6
+ * INDISTINGUISHABLE from a successful read of an empty collection: `getAll` coalesces a
7
+ * missing answer to `[]` and `get` to `null` just below, so an author sees "0 rows" and
8
+ * cannot tell whether the store is empty or absent. That ambiguity cost three QA slots on
9
+ * one run; one of them shipped a whole in-memory fallback that turned out to be dead code.
10
+ *
11
+ * `full` on iOS / Android / web and in the headless `himi render` host; `degraded` where the
12
+ * store works but does not survive a reload (web without IndexedDB); `unavailable` when the
13
+ * host does not back it. Branch on this rather than inferring absence from an empty result.
14
+ *
15
+ * NEVER THROWS, like `@himalaya/pdf`'s `isAvailable`, and that is load-bearing rather than
16
+ * politeness: the hosts this probe exists to detect are exactly the ones that REJECT it.
17
+ * Both native dispatchers throw on an unregistered id (`ActionError.unknown`), so on any app
18
+ * binary shipped before this verb existed — or a shell that never calls
19
+ * `LocalDatabaseCapability.register` — a rejecting probe would put an unhandled rejection in
20
+ * the worker's `load()` of every author who wrote the documented
21
+ * `if (await availability() === "full")`. A refusal to answer IS the answer here.
22
+ */
23
+ export declare function availability(): Promise<Availability>;
1
24
  /** An entity row — a JSON object identified by a string `id`. */
2
25
  export interface DbEntity {
3
26
  id: string;
@@ -17,7 +17,7 @@ export declare const CAPABILITY_REGISTRY: {
17
17
  readonly iap: readonly ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"];
18
18
  readonly keyboard: readonly ["dismiss"];
19
19
  readonly live_activity: readonly ["end", "start", "update"];
20
- readonly local_database: readonly ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"];
20
+ readonly local_database: readonly ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"];
21
21
  readonly location: readonly ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"];
22
22
  readonly media_playback: readonly ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"];
23
23
  readonly motion: readonly ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"];
@@ -28,7 +28,7 @@ export declare const CAPABILITY_REGISTRY: {
28
28
  readonly presigned_upload: readonly ["put", "putFile"];
29
29
  readonly push: readonly ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"];
30
30
  readonly release_control: readonly ["active", "available", "list", "select"];
31
- readonly secure_storage: readonly ["read", "remove", "write"];
31
+ readonly secure_storage: readonly ["availability", "read", "remove", "write"];
32
32
  readonly share: readonly ["availability", "share"];
33
33
  readonly speaker_diarization: readonly ["analyzeFile", "availability"];
34
34
  readonly speech: readonly ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"];
@@ -1,3 +1,26 @@
1
+ import type { Availability } from "@wix/himalaya/sdk-types";
2
+ /**
3
+ * Whether this host actually backs secure storage — the probe #2502 asked for.
4
+ *
5
+ * Without it, `read` on a host that does not serve the capability is INDISTINGUISHABLE
6
+ * from a key that was never written: both answer `null` (see `read` below, which coalesces
7
+ * a missing answer). An author cannot tell "unsupported here" from "genuinely empty", which
8
+ * is exactly what made a silent no-op look like a working-but-empty keychain.
9
+ *
10
+ * `full` on iOS (Keychain) / Android (Keystore-AES) / web and in the headless
11
+ * `himi render` host; `unavailable` when the host does not back it — which on web includes
12
+ * a context with no IndexedDB (a sandboxed iframe, a storage-blocked third-party frame),
13
+ * where every `read`/`write` would reject.
14
+ *
15
+ * NEVER THROWS, like `@himalaya/pdf`'s `isAvailable`, and that is load-bearing rather than
16
+ * politeness: the hosts this probe exists to detect are exactly the ones that REJECT it.
17
+ * Both native dispatchers throw on an unregistered id (`ActionError.unknown`), so on any app
18
+ * binary shipped before this verb existed — or a shell that never calls
19
+ * `SecureStorageCapability.register` — a rejecting probe would put an unhandled rejection in
20
+ * the worker's `load()` of every author who wrote the documented
21
+ * `if (await availability() === "full")`. A refusal to answer IS the answer here.
22
+ */
23
+ export declare function availability(): Promise<Availability>;
1
24
  export type AccessControl =
2
25
  /** Reads only on a device that's been unlocked at least once. */
3
26
  "after_first_unlock"
@@ -253,6 +253,34 @@ export declare function surfaceById(id: string): PreviewSurface | undefined;
253
253
  * claim a family allowlist and then be served live bindings.
254
254
  */
255
255
  export type SurfaceRenderMode = "frozen" | "interactive";
256
+ /**
257
+ * The widget family a FROZEN surface publishes under, for DISPLAY — or undefined for
258
+ * an interactive app shell.
259
+ *
260
+ * Both gate kinds that mean "frozen" carry a family: `family` because it IS the
261
+ * allowlist key, `projection` because the car still ships its tree under one
262
+ * (`car_list`). That makes this the right thing to name a surface by in a message, and
263
+ * the WRONG thing to branch on — a car and a widget are authored through different
264
+ * doors. Decisions use `isWidgetFamilySurface` below.
265
+ */
266
+ export declare function surfaceFrozenFamily(surface: PreviewSurface): string | undefined;
267
+ /**
268
+ * Is this surface an OS widget — the `defineWidget` population, as distinct from the
269
+ * car, which is frozen too?
270
+ *
271
+ * Named and shared rather than spelled `gate.kind === "family"` at each call site,
272
+ * because the two places that ask (`surfacesForApp`'s produced verdict, and
273
+ * `himi render --device`'s refusal) must give the same answer or #2499 comes back
274
+ * halfway: a surface one of them classes as a widget and the other does not is either
275
+ * advertised as supported while unrenderable, or refused with advice pointing at a
276
+ * door it was not authored through.
277
+ *
278
+ * The car is excluded deliberately, not incidentally. It is authored with
279
+ * `defineView({ surface: "car" })`, gated by a real `androidauto` key (so it never
280
+ * over-claimed), and its viewport exists for the preview — so `defineWidget` advice and
281
+ * a `/v1/widget/<id>` pointer would both be dead ends for it.
282
+ */
283
+ export declare function isWidgetFamilySurface(surface: PreviewSurface): boolean;
256
284
  export declare function surfaceRenderMode(surface: PreviewSurface): SurfaceRenderMode;
257
285
  /**
258
286
  * Ladder rungs that are not themselves surfaces — the shared fallbacks a view can
@@ -316,15 +344,48 @@ export declare function isTargeted(surface: PreviewSurface, platforms: Platforms
316
344
  export interface SurfaceAvailability {
317
345
  readonly surface: PreviewSurface;
318
346
  readonly targeted: boolean;
319
- /** When not targeted, the exact opt-in to add. Drives the picker's tooltip. */
347
+ /** When not targeted because of the BINARY envelope, the exact platforms.json
348
+ * opt-in to add. Drives the picker's tooltip. Absent for a widget family that
349
+ * is untargeted for lack of a widget — no platforms.json key opts that in. */
320
350
  readonly optIn?: string;
351
+ /**
352
+ * For a WIDGET FAMILY (`isWidgetFamilySurface`) — does this app actually PRODUCE a
353
+ * snapshot for it? Only present when the caller supplied the produced set;
354
+ * `undefined` means "not measured", which is not the same as `false` and must not be
355
+ * rendered as one.
356
+ *
357
+ * Widget families and NOTHING else, the car included — it is frozen too, but it is
358
+ * gated by a real `androidauto` key (so it never over-claimed) and is authored with
359
+ * `defineView({ surface: "car" })`, so a `defineWidget`-shaped verdict would be the
360
+ * wrong answer rather than a missing one. An app shell has nothing to produce at all.
361
+ */
362
+ readonly produced?: boolean;
363
+ /** When a widget family is untargeted because nothing produces it, what to author. */
364
+ readonly needs?: string;
321
365
  }
322
366
  /**
323
367
  * The full catalog with a targeted flag — NOT a filtered list. The picker shows
324
368
  * every surface and dims the untargeted ones, so authors discover what their app
325
369
  * could also be, instead of only seeing what it already is.
370
+ *
371
+ * `producedFamilies` — the widget families this app actually produces a snapshot for
372
+ * (`GET /v1/widgets`, or a scan of its built bundles). Supply it and a frozen surface
373
+ * reports the truth; omit it and the answer is the binary envelope alone, as before.
374
+ *
375
+ * Why it exists (#2499): the four native widget families carry `platformKey: null`
376
+ * (`web_card` and `watch_complication` are the exceptions — they ride `web`/`watchos`),
377
+ * so for those four `isTargeted` short-circuits to `true` and `himi surfaces` reported
378
+ * `widget:ios_home`, `widget:ios_lock`, `widget:android_home` and
379
+ * `widget:ios_live_activity` as targeted for EVERY app — declared widgets or not.
380
+ * A tester read that as support, found
381
+ * `/v1/widgets` empty, and summarized it as "everything advertises the capability
382
+ * except the capability". The envelope answer was not wrong so much as answering a
383
+ * different question: iOS and Android are implicit, so the binary CAN host a widget;
384
+ * whether this app HAS one is a fact about its bundles, and only the produced set
385
+ * carries it. `isTargeted` is deliberately left alone — `resolveSurfaceEnvelope` asks
386
+ * the binary question and must keep getting the binary answer.
326
387
  */
327
- export declare function surfacesForApp(platforms: PlatformsJson): readonly SurfaceAvailability[];
388
+ export declare function surfacesForApp(platforms: PlatformsJson, producedFamilies?: Iterable<string>): readonly SurfaceAvailability[];
328
389
  export interface SurfaceEnvelopeResolution {
329
390
  /** Surfaces this app actually runs, in catalog order. */
330
391
  readonly enabled: readonly string[];
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -9232,6 +9232,13 @@ var PREVIEW_SURFACES = [
9232
9232
  function surfaceById(id) {
9233
9233
  return PREVIEW_SURFACES.find((s) => s.id === id);
9234
9234
  }
9235
+ function surfaceFrozenFamily(surface) {
9236
+ const gate = surface.gate;
9237
+ return gate.kind === "family" || gate.kind === "projection" ? gate.family : void 0;
9238
+ }
9239
+ function isWidgetFamilySurface(surface) {
9240
+ return surface.gate.kind === "family";
9241
+ }
9235
9242
  function surfaceRenderMode(surface) {
9236
9243
  const { kind } = surface.gate;
9237
9244
  return kind === "family" || kind === "projection" ? "frozen" : "interactive";
@@ -9295,10 +9302,33 @@ function isTargeted(surface, platforms) {
9295
9302
  if (surface.platformKey === "macos") return platforms.macos !== false;
9296
9303
  return platforms[surface.platformKey] === true;
9297
9304
  }
9298
- function surfacesForApp(platforms) {
9305
+ function surfacesForApp(platforms, producedFamilies) {
9306
+ const produced = producedFamilies === void 0 ? void 0 : producedFamilies instanceof Set ? producedFamilies : new Set(producedFamilies);
9299
9307
  return PREVIEW_SURFACES.map((surface) => {
9300
- const targeted = isTargeted(surface, platforms);
9301
- return targeted ? { surface, targeted } : { surface, targeted, optIn: `"${surface.platformKey}": true` };
9308
+ const inEnvelope = isTargeted(surface, platforms);
9309
+ const family = isWidgetFamilySurface(surface) ? surfaceFrozenFamily(surface) : void 0;
9310
+ if (produced && family !== void 0) {
9311
+ const isProduced = produced.has(family);
9312
+ return inEnvelope && isProduced ? { surface, targeted: true, produced: true } : {
9313
+ surface,
9314
+ targeted: false,
9315
+ produced: isProduced,
9316
+ // The four native families carry no platform key, so there is nothing to
9317
+ // offer; `web_card` and `watch_complication` DO have one, and when that is
9318
+ // the half that is missing it is still the right advice. Hence the guard —
9319
+ // it is load-bearing for two families, not defensive padding.
9320
+ ...inEnvelope ? {} : surface.platformKey ? { optIn: `"${surface.platformKey}": true` } : {},
9321
+ ...isProduced ? {} : {
9322
+ // The rebuild half is not padding: the produced set is read off BUILT
9323
+ // bundles, so an author who has just written the registration and not
9324
+ // rebuilt lands here too, and "write defineWidget" alone would be advice
9325
+ // to write the code they are looking at.
9326
+ needs: `defineWidget({ family: "${family}", \u2026 }) in a Tier-5 bundle \u2014 and a rebuild, if you just added it`
9327
+ }
9328
+ };
9329
+ }
9330
+ if (inEnvelope) return { surface, targeted: true };
9331
+ return surface.platformKey ? { surface, targeted: false, optIn: `"${surface.platformKey}": true` } : { surface, targeted: false };
9302
9332
  });
9303
9333
  }
9304
9334
  function resolveSurfaceEnvelope(platforms, requested) {
@@ -12814,6 +12844,7 @@ export {
12814
12844
  isValidAppId,
12815
12845
  isValidStreamPolicy,
12816
12846
  isViewTarget,
12847
+ isWidgetFamilySurface,
12817
12848
  layoutDirection,
12818
12849
  parseNumeric,
12819
12850
  primarySubtag,
@@ -12834,6 +12865,7 @@ export {
12834
12865
  stripOriginParams,
12835
12866
  summarize,
12836
12867
  surfaceById,
12868
+ surfaceFrozenFamily,
12837
12869
  surfaceRenderMode,
12838
12870
  surfacesForApp,
12839
12871
  validate,
@@ -14,6 +14,15 @@ function dispatch(handlerId, params, _options) {
14
14
  }
15
15
 
16
16
  // ../../core/sdk/local-db/src/index.ts
17
+ async function availability() {
18
+ try {
19
+ const r = await dispatch("capability.local_database.availability");
20
+ const a = r?.availability;
21
+ return a === "full" || a === "degraded" ? a : "unavailable";
22
+ } catch {
23
+ return "unavailable";
24
+ }
25
+ }
17
26
  async function getAll(entity) {
18
27
  if (!entity) throw new Error("local-db.getAll: entity is required");
19
28
  const r = await dispatch("capability.local_database.getAll", { entity });
@@ -61,6 +70,7 @@ async function drainQueue() {
61
70
  }
62
71
  var version = 2;
63
72
  export {
73
+ availability,
64
74
  count,
65
75
  drainQueue,
66
76
  enqueue,
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -17,7 +17,7 @@ var CAPABILITY_REGISTRY = {
17
17
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
18
18
  "keyboard": ["dismiss"],
19
19
  "live_activity": ["end", "start", "update"],
20
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
20
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
21
21
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
22
22
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
23
23
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -28,7 +28,7 @@ var CAPABILITY_REGISTRY = {
28
28
  "presigned_upload": ["put", "putFile"],
29
29
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
30
30
  "release_control": ["active", "available", "list", "select"],
31
- "secure_storage": ["read", "remove", "write"],
31
+ "secure_storage": ["availability", "read", "remove", "write"],
32
32
  "share": ["availability", "share"],
33
33
  "speaker_diarization": ["analyzeFile", "availability"],
34
34
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],
@@ -14,6 +14,15 @@ function dispatch(handlerId, params, _options) {
14
14
  }
15
15
 
16
16
  // ../../core/sdk/secure-storage/src/index.ts
17
+ async function availability() {
18
+ try {
19
+ const r = await dispatch("capability.secure_storage.availability");
20
+ const a = r?.availability;
21
+ return a === "full" || a === "degraded" ? a : "unavailable";
22
+ } catch {
23
+ return "unavailable";
24
+ }
25
+ }
17
26
  async function read(key) {
18
27
  if (!key) throw new Error("secure-storage.read: key is required");
19
28
  const result = await dispatch("capability.secure_storage.read", { key });
@@ -33,6 +42,7 @@ async function remove(key) {
33
42
  }
34
43
  var version = 1;
35
44
  export {
45
+ availability,
36
46
  read,
37
47
  remove,
38
48
  version,
@@ -32,7 +32,7 @@ var CAPABILITY_REGISTRY = {
32
32
  "iap": ["consume", "entitlements", "getPaywallConfig", "getProducts", "purchase", "restore"],
33
33
  "keyboard": ["dismiss"],
34
34
  "live_activity": ["end", "start", "update"],
35
- "local_database": ["count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
35
+ "local_database": ["availability", "count", "get", "getAll", "purge", "query", "queueDepth", "queueDrain", "queueEnqueue", "remove", "upsert"],
36
36
  "location": ["backgroundStart", "backgroundStop", "getCurrent", "getPermissionStatus", "regionAdd", "regionClear", "regionList", "regionNext", "regionRemove", "regionSupport", "requestPermission", "watchNext", "watchStart", "watchStop"],
37
37
  "media_playback": ["download", "getCapabilities", "getState", "next", "pause", "pictureInPicture", "play", "presentFullscreen", "previous", "release", "removeDownload", "seek", "seekTo", "setMuted", "setQueue", "setRate", "skip", "status", "stop", "subscribeStatus", "unsubscribeStatus"],
38
38
  "motion": ["availability", "getAltitude", "getHeading", "getPermissionStatus", "getStepCount", "requestPermission", "watchNext", "watchStart", "watchStop"],
@@ -43,7 +43,7 @@ var CAPABILITY_REGISTRY = {
43
43
  "presigned_upload": ["put", "putFile"],
44
44
  "push": ["cancelAllLocal", "cancelLocal", "clearDelivered", "getDeviceToken", "getPermissionStatus", "listDelivered", "requestPermission", "scheduleLocal", "setBadge"],
45
45
  "release_control": ["active", "available", "list", "select"],
46
- "secure_storage": ["read", "remove", "write"],
46
+ "secure_storage": ["availability", "read", "remove", "write"],
47
47
  "share": ["availability", "share"],
48
48
  "speaker_diarization": ["analyzeFile", "availability"],
49
49
  "speech": ["availability", "recognizeOnce", "speak", "stop", "streamNext", "streamStart", "streamStop", "transcribeFile"],