@glassly/engine 0.3.4-dev.704 → 0.3.5-dev.706

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 (47) hide show
  1. package/build/generated/releaseMetadata.js +4 -4
  2. package/build/generated/releaseMetadata.js.map +1 -1
  3. package/build/index.d.ts +1 -1
  4. package/build/index.d.ts.map +1 -1
  5. package/build/index.js +1 -1
  6. package/build/index.js.map +1 -1
  7. package/build/services/AppRegistry.d.ts +3 -1
  8. package/build/services/AppRegistry.d.ts.map +1 -1
  9. package/build/services/AppRegistry.js +5 -2
  10. package/build/services/AppRegistry.js.map +1 -1
  11. package/build/services/LocalMiniappRuntime.d.ts +32 -0
  12. package/build/services/LocalMiniappRuntime.d.ts.map +1 -1
  13. package/build/services/LocalMiniappRuntime.js +332 -1
  14. package/build/services/LocalMiniappRuntime.js.map +1 -1
  15. package/build/services/MiniappLauncher.d.ts.map +1 -1
  16. package/build/services/MiniappLauncher.js +2 -0
  17. package/build/services/MiniappLauncher.js.map +1 -1
  18. package/build/services/MiniappWidgetMode.d.ts +24 -0
  19. package/build/services/MiniappWidgetMode.d.ts.map +1 -0
  20. package/build/services/MiniappWidgetMode.js +58 -0
  21. package/build/services/MiniappWidgetMode.js.map +1 -0
  22. package/build/services/manifestActions.d.ts +8 -1
  23. package/build/services/manifestActions.d.ts.map +1 -1
  24. package/build/services/manifestActions.js +29 -0
  25. package/build/services/manifestActions.js.map +1 -1
  26. package/build/services/widgetPlacements.d.ts +43 -0
  27. package/build/services/widgetPlacements.d.ts.map +1 -0
  28. package/build/services/widgetPlacements.js +83 -0
  29. package/build/services/widgetPlacements.js.map +1 -0
  30. package/build/stores/apps.d.ts +3 -1
  31. package/build/stores/apps.d.ts.map +1 -1
  32. package/build/stores/apps.js +37 -11
  33. package/build/stores/apps.js.map +1 -1
  34. package/build/types/applet.d.ts +16 -0
  35. package/build/types/applet.d.ts.map +1 -1
  36. package/build/types/applet.js.map +1 -1
  37. package/package.json +7 -7
  38. package/src/generated/releaseMetadata.ts +4 -4
  39. package/src/index.ts +1 -0
  40. package/src/services/AppRegistry.ts +8 -2
  41. package/src/services/LocalMiniappRuntime.ts +362 -2
  42. package/src/services/MiniappLauncher.ts +3 -0
  43. package/src/services/MiniappWidgetMode.ts +62 -0
  44. package/src/services/manifestActions.ts +29 -1
  45. package/src/services/widgetPlacements.ts +121 -0
  46. package/src/stores/apps.ts +45 -11
  47. package/src/types/applet.ts +18 -0
@@ -1 +1 @@
1
- {"version":3,"file":"MiniappLauncher.d.ts","sourceRoot":"","sources":["../../src/services/MiniappLauncher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AASH,OAA4B,EAAC,KAAK,wBAAwB,EAAC,MAAM,uBAAuB,CAAA;AACxF,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAA;AACzD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAA;AAExC,UAAU,YAAY;IACpB,oEAAoE;IACpE,MAAM,EAAE,QAAQ,CAAA;CACjB;AAED,6EAA6E;AAC7E,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+DAA+D;IAC/D,YAAY,CAAC,EAAE,mBAAmB,CAAA;CACnC;AAED,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,mBAAmB,EAAE,MAAM,EAAE,CAAA;IAC7B,iBAAiB,CAAC,EAAE,wBAAwB,CAAA;IAC5C,yEAAyE;IACzE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB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AE,WAAW,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAiH7F;;;;;;;;;;OAUG;IACG,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAwBpF,iFAAiF;YACnE,KAAK;IAkCnB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACG,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IAsC7C;;;;OAIG;IACG,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,gBAAgB,SAAS,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAKzG,mDAAmD;IAC7C,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9C,OAAO,CAAC,YAAY;IAKpB,4EAA4E;IAC5E,OAAO,CAAC,cAAc;CASvB;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAA"}
@@ -93,6 +93,7 @@ class MiniappLauncher {
93
93
  permissions: manifest.permissions,
94
94
  hardwareRequirements: manifest.hardwareRequirements,
95
95
  actions: manifest.actions,
96
+ widgets: manifest.widgets,
96
97
  };
97
98
  let bgSource;
98
99
  try {
@@ -137,6 +138,7 @@ class MiniappLauncher {
137
138
  permissions: manifest.permissions,
138
139
  hardwareRequirements: manifest.hardwareRequirements,
139
140
  actions: manifest.actions,
141
+ widgets: manifest.widgets,
140
142
  }
141
143
  : undefined;
142
144
  let bgSource;
@@ -1 +1 @@
1
- {"version":3,"file":"MiniappLauncher.js","sourceRoot":"","sources":["../../src/services/MiniappLauncher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAErC,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAA;AAC9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AAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;IACxC,CAAC;IAED,4EAA4E;IACpE,cAAc,CAAC,WAA+B,EAAE,WAAmB;QACzE,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,CAAC,GAAG,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;YACnC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAAE,OAAO,CAAC,CAAA;QAClC,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAS,GAAG,WAAW,WAAW,CAAC,CAAA;QAC9D,IAAI,MAAM,CAAC,KAAK,EAAE;YAAE,OAAO,MAAM,CAAC,KAAK,CAAA;QACvC,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA","sourcesContent":["/**\n * MiniappLauncher — headless launch/teardown of a local miniapp's background\n * JS context.\n *\n * This is the one piece of \"run a miniapp\" that used to live inside the\n * `LocalMiniappView` React component (resolve the bundle → read the manifest →\n * `spawnAndRegister`), triggered only when the Compositor mounted that\n * component on foreground. Pulling it into the runtime means:\n *\n * - `start()` can actually spawn an app even when nothing foregrounds it\n * (e.g. a system app launching another miniapp via `session.miniapps`).\n * - the action broker can wake a stopped target headlessly — no UI at all.\n * - the dev hot-reload respawn path and the WebView mount path share one\n * resolve+spawn recipe instead of three copies.\n *\n * The launcher is **headless**: no React, no RN components. The engine-owned\n * MiniappEngine hands it the {@link JSRouter} instance once during\n * engine construction. OEMs embedding the runtime drive miniapp lifecycle\n * through the engine facade and stores, not a separate launcher configure API.\n *\n * Boundary: the launcher owns the **background** context. WebView *rendering*\n * (the UI layer) stays with the host — the launcher just hands back the\n * resolved UI entry so the host can mount its `<WebView>`.\n */\n\nimport {File} from \"expo-file-system\"\n\nimport {permissions} from \"../facades/permissions\"\nimport {decideDevLaunchRoute} from \"../utils/devMiniappLaunch\"\nimport {storage} from \"../utils/storage/storage\"\nimport appRegistry from \"./AppRegistry\"\nimport devServerBridge from \"./DevServerBridge\"\nimport localMiniappRuntime, {type InstalledMiniappManifest} from \"./LocalMiniappRuntime\"\nimport type {MiniappLaunchSource} from \"@glassly/miniapp\"\nimport type {JSRouter} from \"./JSRouter\"\n\ninterface LauncherDeps {\n /** The host-constructed router (needs the native Crust binding). */\n router: JSRouter\n}\n\n/** Hints the host may pass from a view's props to avoid re-deriving them. */\nexport interface LaunchHints {\n devUrl?: string\n version?: string\n devPort?: string\n /** Who started the app; reported to the miniapp on connect. */\n launchSource?: MiniappLaunchSource\n}\n\n/** Everything the launcher resolved for a package — bg source + UI entry. */\nexport interface ResolvedBundle {\n bgSource: string\n uiUri: string | null\n uiBaseDir: string | null\n declaredPermissions: string[]\n installedManifest?: InstalledMiniappManifest\n /** Set for dev miniapps (HTTP off the dev server); null for released. */\n devUrl: string | null\n devPort: number | null\n}\n\n/** What the host needs back to render the UI layer. */\nexport interface LaunchResult {\n uiUri: string | null\n uiBaseDir: string | null\n}\n\nclass MiniappLauncher {\n private deps: LauncherDeps | null = null\n\n /**\n * In-flight launches keyed by packageName. Both apps.ts start() and the\n * WebView mount call ensureRunning() before the first spawnAndRegister\n * resolves — without this, neither sees the package in registeredPackages()\n * yet and both spawn the same context (a clobber/double-spawn). Concurrent\n * callers share the same promise.\n */\n private readonly inFlight = new Map<string, Promise<LaunchResult>>()\n\n /** Wire the router in. Called once from MiniappEngine construction. */\n configure(deps: LauncherDeps): void {\n this.deps = deps\n }\n\n private requireRouter(): JSRouter {\n if (!this.deps) {\n throw new Error(\"MiniappLauncher not configured — ensureMiniappEngine() has not run\")\n }\n return this.deps.router\n }\n\n /** True iff the package's background JS context is currently spawned. */\n isRunning(packageName: string): boolean {\n return this.deps?.router.registeredPackages().includes(packageName) ?? false\n }\n\n /**\n * Resolve the background JS source + UI entry + declared permissions for a\n * package. Handles both dev (HTTP off the running dev server) and released\n * (file:// from the installed snapshot). Reads disk/network/storage; does\n * NOT spawn. Returns null when the bundle can't be resolved (dev server\n * unreachable, missing entry, no installed version).\n */\n async resolveBundle(packageName: string, hints?: LaunchHints): Promise<ResolvedBundle | null> {\n const devUrl = hints?.devUrl ?? this.storedDevUrl(packageName)\n\n // --- Dev: load directly off the local dev server over HTTP. ---\n if (devUrl) {\n const route = await decideDevLaunchRoute(packageName, devUrl)\n if (route.decision === \"offline\" || !route.manifest) return null\n const manifest = route.manifest\n const entry = manifest.entry as {background?: string; ui?: string} | undefined\n if (!entry?.background) return null\n\n // Use the host that actually answered — may differ from the stored IP\n // after a laptop Wi-Fi change (mDNS / Metro failover inside decideDevLaunchRoute).\n const base = route.resolvedUrl.replace(/\\/$/, \"\")\n // entry.* are bundle-root paths (dist/ stripped); the dev server serves\n // files relative to cwd, so prepend dist/.\n const bgUrl = `${base}/dist/${entry.background.replace(/^\\.?\\/+/, \"\")}`\n const uiUri = entry.ui ? `${base}/dist/${entry.ui.replace(/^\\.?\\/+/, \"\")}` : null\n\n const perms = manifest.permissions as Array<{type?: string} | string> | undefined\n const declaredPermissions = (perms ?? [])\n .map((p) => (typeof p === \"string\" ? p : p?.type))\n .filter((t): t is string => typeof t === \"string\")\n const installedManifest: InstalledMiniappManifest = {\n packageName: typeof manifest.packageName === \"string\" ? manifest.packageName : packageName,\n name: manifest.name,\n version: typeof manifest.version === \"string\" ? manifest.version : undefined,\n sdkVersion: typeof manifest.sdkVersion === \"string\" ? manifest.sdkVersion : undefined,\n minHostVersion: typeof manifest.minHostVersion === \"string\" ? manifest.minHostVersion : undefined,\n type: typeof manifest.type === \"string\" ? manifest.type : undefined,\n entry: manifest.entry as InstalledMiniappManifest[\"entry\"],\n permissions: manifest.permissions as InstalledMiniappManifest[\"permissions\"],\n hardwareRequirements: manifest.hardwareRequirements as InstalledMiniappManifest[\"hardwareRequirements\"],\n actions: manifest.actions as InstalledMiniappManifest[\"actions\"],\n }\n\n let bgSource: string\n try {\n const res = await fetch(bgUrl)\n if (!res.ok) return null\n bgSource = await res.text()\n } catch {\n return null\n }\n\n return {\n bgSource,\n uiUri,\n uiBaseDir: uiUri ? uiUri.replace(/\\/[^/]+$/, \"/\") : null,\n declaredPermissions,\n installedManifest,\n devUrl: route.resolvedUrl,\n devPort: this.resolveDevPort(hints?.devPort, packageName),\n }\n }\n\n // --- Released: resolve from the installed file:// snapshot. ---\n const version = hints?.version ?? (await appRegistry.getActiveVersion(packageName))\n if (!version) return null\n const entryPaths = appRegistry.getMiniappEntryPaths(packageName, version)\n if (!entryPaths?.background) return null\n\n const manifest = appRegistry.getMiniappManifest(packageName, version) as {\n packageName?: string\n name?: string\n version?: string\n sdkVersion?: string\n minHostVersion?: string\n type?: string\n entry?: {background?: string; ui?: string}\n permissions?: Array<{type: string; required?: boolean; description?: string}>\n hardwareRequirements?: Array<{type: string; level: string; description?: string}>\n actions?: Array<{id?: unknown; description?: unknown; parameters?: unknown; outputSchema?: unknown}>\n } | null\n const declaredPermissions = (manifest?.permissions ?? [])\n .map((p) => p.type)\n .filter((t): t is string => typeof t === \"string\")\n const installedManifest: InstalledMiniappManifest | undefined = manifest\n ? {\n packageName: manifest.packageName ?? packageName,\n name: manifest.name,\n version: manifest.version ?? version,\n sdkVersion: manifest.sdkVersion,\n minHostVersion: manifest.minHostVersion,\n type: manifest.type,\n entry: manifest.entry,\n permissions: manifest.permissions,\n hardwareRequirements: manifest.hardwareRequirements,\n actions: manifest.actions,\n }\n : undefined\n\n let bgSource: string\n try {\n bgSource = new File(entryPaths.background).textSync()\n } catch {\n return null\n }\n\n return {\n bgSource,\n uiUri: entryPaths.ui ?? null,\n uiBaseDir: entryPaths.ui ? entryPaths.ui.replace(/\\/[^/]+$/, \"/\") : null,\n declaredPermissions,\n installedManifest,\n devUrl: null,\n devPort: null,\n }\n }\n\n /**\n * Ensure a miniapp's background JS context is spawned. Idempotent — if the\n * context is already alive this is a no-op spawn-wise (it still resolves the\n * UI entry so a re-mounting host gets its `<WebView>` source back).\n *\n * Resolves once the context is SPAWNED. It does NOT block on the context's\n * CONNECT handshake — the host's WebView mount shouldn't wait on background\n * JS. Callers that need the context to be connected and ready to receive\n * messages (the action broker) follow up with\n * {@link LocalMiniappRuntime.waitForConnect}.\n */\n async ensureRunning(packageName: string, hints?: LaunchHints): Promise<LaunchResult> {\n const router = this.requireRouter()\n\n // Already spawned: best-effort resolve for the UI entry, never throw —\n // a headless caller that doesn't need UI gets {null, null} fast even if\n // the dev server has since dropped.\n if (router.registeredPackages().includes(packageName)) {\n const existing = await this.resolveBundle(packageName, hints).catch(() => null)\n return {uiUri: existing?.uiUri ?? null, uiBaseDir: existing?.uiBaseDir ?? null}\n }\n\n // Coalesce concurrent launches of the same package onto one promise.\n const pending = this.inFlight.get(packageName)\n if (pending) return pending\n\n const launch = this.spawn(packageName, hints)\n this.inFlight.set(packageName, launch)\n try {\n return await launch\n } finally {\n this.inFlight.delete(packageName)\n }\n }\n\n /** Resolve the bundle and spawn the context. Serialized via {@link inFlight}. */\n private async spawn(packageName: string, hints?: LaunchHints): Promise<LaunchResult> {\n const router = this.requireRouter()\n const resolved = await this.resolveBundle(packageName, hints)\n if (!resolved) {\n throw new Error(`MiniappLauncher: cannot resolve bundle for ${packageName}`)\n }\n\n // Re-check after the async resolve: a different path may have spawned it\n // while we were fetching/reading the bundle.\n if (!router.registeredPackages().includes(packageName)) {\n const ok = await router.spawnAndRegister(packageName, resolved.bgSource, {\n permissions: resolved.declaredPermissions,\n installedManifest: resolved.installedManifest,\n launchSource: hints?.launchSource,\n })\n if (!ok) {\n throw new Error(`MiniappLauncher: spawn failed for ${packageName}`)\n }\n\n // Dev: wire the hot-reload + log-forwarding sidecar. No-op in prod\n // (devServerBridge silently drops when no sidecar is up).\n if (resolved.devUrl && resolved.devPort != null) {\n devServerBridge.connect(packageName, resolved.devUrl, resolved.devPort)\n } else if (resolved.devUrl) {\n // Dev miniapp with no resolvable port — it still launches, but hot\n // reload + log forwarding won't connect. Surface it instead of failing\n // silently (the old inline path hard-failed with \"no dev port\").\n console.warn(`MiniappLauncher: ${packageName} has no dev port — hot reload + log forwarding disabled`)\n }\n }\n\n return {uiUri: resolved.uiUri, uiBaseDir: resolved.uiBaseDir}\n }\n\n /**\n * Start the Always On local miniapps at boot.\n *\n * Miniapps run in the phone's own JS engine, so a host-process kill tears\n * down their JSContext. Only Always On apps come back: whatever else was\n * running when the app was killed stays stopped until the wearer opens it\n * again. The spawn is headless (no foreground, no navigation) and registers\n * the package so the home tray/switcher project it as running, exactly as a\n * normal start would. The WebView, if any, re-attaches lazily when the user\n * opens the app.\n *\n * One dashboard runs at a time: a dashboard already running keeps its place,\n * else the first Always On dashboard by package name starts and the rest\n * stay stopped. The flag is exclusive after any user action (setAlwaysOn\n * clears it on the other dashboards), so this only arbitrates manifests\n * that both claim it.\n *\n * Idempotent and best-effort: skips already-spawned contexts, and skips apps\n * missing required OS permissions without prompting or clearing their Always\n * On choice. Not compatibility-gated: an Always On app shouldn't be dropped\n * just because glasses are momentarily disconnected at boot — it resumes\n * when they reconnect, same as mid-session.\n */\n async autostartLocalMiniapps(): Promise<void> {\n const apps = await appRegistry.getInstalledMiniapps()\n const dashboards = apps.filter((app) => app.type === \"dashboard\")\n const dashboard =\n dashboards.find((app) => this.isRunning(app.packageName))?.packageName ??\n dashboards\n .filter((app) => app.alwaysOn)\n .map((app) => app.packageName)\n .sort()[0] ??\n null\n for (const app of apps) {\n // Only phone-hosted miniapps have a JSContext to spawn. Offline\n // built-ins (`local:false, offline:true`) have no bundle to launch.\n if (!app.local || !app.alwaysOn) continue\n if (app.type === \"dashboard\" && app.packageName !== dashboard) continue\n if (this.isRunning(app.packageName)) continue\n try {\n const missing = await permissions.missingRequired(app.permissions ?? [])\n if (missing.length > 0) {\n console.info(\n `MiniappLauncher: skipping autostart for ${app.packageName} — missing required permissions: ${missing.join(\n \", \",\n )}`,\n )\n continue\n }\n } catch (e) {\n console.warn(`MiniappLauncher: skipping autostart for ${app.packageName} — permission check failed`, e)\n continue\n }\n try {\n await this.ensureRunning(app.packageName)\n } catch (e) {\n console.warn(`MiniappLauncher: autostart failed for ${app.packageName}`, e)\n }\n }\n }\n\n /**\n * Ensure the context is running AND has completed its CONNECT handshake.\n * Used by the action broker, which must not deliver to a context that hasn't\n * come up yet. Throws on spawn failure or connect timeout.\n */\n async ensureConnected(packageName: string, connectTimeoutMs = 10_000, hints?: LaunchHints): Promise<void> {\n await this.ensureRunning(packageName, hints)\n await localMiniappRuntime.waitForConnect(packageName, connectTimeoutMs)\n }\n\n /** Tear down a miniapp's background JS context. */\n async stop(packageName: string): Promise<void> {\n // If a launch is in flight, let it finish first. Otherwise unregister()\n // no-ops on the not-yet-registered package and the pending spawn then\n // re-registers the context — leaving it running despite the stop.\n const pending = this.inFlight.get(packageName)\n if (pending) {\n try {\n await pending\n } catch {\n // Launch failed — nothing got registered, so nothing to tear down.\n }\n }\n await this.deps?.router.unregister(packageName)\n }\n\n // --- internals -----------------------------------------------------------\n\n private storedDevUrl(packageName: string): string | undefined {\n const r = storage.load<string>(`${packageName}_dev_url`)\n return r.is_ok() ? r.value : undefined\n }\n\n /** resolveDevPort — moved verbatim from the old LocalMiniappView helper. */\n private resolveDevPort(searchParam: string | undefined, packageName: string): number | null {\n if (searchParam) {\n const n = parseInt(searchParam, 10)\n if (Number.isFinite(n)) return n\n }\n const stored = storage.load<number>(`${packageName}_dev_port`)\n if (stored.is_ok()) return stored.value\n return null\n }\n}\n\nexport const miniappLauncher = new MiniappLauncher()\n"]}
1
+ {"version":3,"file":"MiniappLauncher.js","sourceRoot":"","sources":["../../src/services/MiniappLauncher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,kBAAkB,CAAA;AAErC,OAAO,EAAC,WAAW,EAAC,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAA;AAC9D,OAAO,EAAC,OAAO,EAAC,MAAM,0BAA0B,CAAA;AAChD,OAAO,W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AAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAA;IACxC,CAAC;IAED,4EAA4E;IACpE,cAAc,CAAC,WAA+B,EAAE,WAAmB;QACzE,IAAI,WAAW,EAAE,CAAC;YAChB,MAAM,CAAC,GAAG,QAAQ,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;YACnC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;gBAAE,OAAO,CAAC,CAAA;QAClC,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAS,GAAG,WAAW,WAAW,CAAC,CAAA;QAC9D,IAAI,MAAM,CAAC,KAAK,EAAE;YAAE,OAAO,MAAM,CAAC,KAAK,CAAA;QACvC,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAA","sourcesContent":["/**\n * MiniappLauncher — headless launch/teardown of a local miniapp's background\n * JS context.\n *\n * This is the one piece of \"run a miniapp\" that used to live inside the\n * `LocalMiniappView` React component (resolve the bundle → read the manifest →\n * `spawnAndRegister`), triggered only when the Compositor mounted that\n * component on foreground. Pulling it into the runtime means:\n *\n * - `start()` can actually spawn an app even when nothing foregrounds it\n * (e.g. a system app launching another miniapp via `session.miniapps`).\n * - the action broker can wake a stopped target headlessly — no UI at all.\n * - the dev hot-reload respawn path and the WebView mount path share one\n * resolve+spawn recipe instead of three copies.\n *\n * The launcher is **headless**: no React, no RN components. The engine-owned\n * MiniappEngine hands it the {@link JSRouter} instance once during\n * engine construction. OEMs embedding the runtime drive miniapp lifecycle\n * through the engine facade and stores, not a separate launcher configure API.\n *\n * Boundary: the launcher owns the **background** context. WebView *rendering*\n * (the UI layer) stays with the host — the launcher just hands back the\n * resolved UI entry so the host can mount its `<WebView>`.\n */\n\nimport {File} from \"expo-file-system\"\n\nimport {permissions} from \"../facades/permissions\"\nimport {decideDevLaunchRoute} from \"../utils/devMiniappLaunch\"\nimport {storage} from \"../utils/storage/storage\"\nimport appRegistry from \"./AppRegistry\"\nimport devServerBridge from \"./DevServerBridge\"\nimport localMiniappRuntime, {type InstalledMiniappManifest} from \"./LocalMiniappRuntime\"\nimport type {MiniappLaunchSource} from \"@glassly/miniapp\"\nimport type {JSRouter} from \"./JSRouter\"\n\ninterface LauncherDeps {\n /** The host-constructed router (needs the native Crust binding). */\n router: JSRouter\n}\n\n/** Hints the host may pass from a view's props to avoid re-deriving them. */\nexport interface LaunchHints {\n devUrl?: string\n version?: string\n devPort?: string\n /** Who started the app; reported to the miniapp on connect. */\n launchSource?: MiniappLaunchSource\n}\n\n/** Everything the launcher resolved for a package — bg source + UI entry. */\nexport interface ResolvedBundle {\n bgSource: string\n uiUri: string | null\n uiBaseDir: string | null\n declaredPermissions: string[]\n installedManifest?: InstalledMiniappManifest\n /** Set for dev miniapps (HTTP off the dev server); null for released. */\n devUrl: string | null\n devPort: number | null\n}\n\n/** What the host needs back to render the UI layer. */\nexport interface LaunchResult {\n uiUri: string | null\n uiBaseDir: string | null\n}\n\nclass MiniappLauncher {\n private deps: LauncherDeps | null = null\n\n /**\n * In-flight launches keyed by packageName. Both apps.ts start() and the\n * WebView mount call ensureRunning() before the first spawnAndRegister\n * resolves — without this, neither sees the package in registeredPackages()\n * yet and both spawn the same context (a clobber/double-spawn). Concurrent\n * callers share the same promise.\n */\n private readonly inFlight = new Map<string, Promise<LaunchResult>>()\n\n /** Wire the router in. Called once from MiniappEngine construction. */\n configure(deps: LauncherDeps): void {\n this.deps = deps\n }\n\n private requireRouter(): JSRouter {\n if (!this.deps) {\n throw new Error(\"MiniappLauncher not configured — ensureMiniappEngine() has not run\")\n }\n return this.deps.router\n }\n\n /** True iff the package's background JS context is currently spawned. */\n isRunning(packageName: string): boolean {\n return this.deps?.router.registeredPackages().includes(packageName) ?? false\n }\n\n /**\n * Resolve the background JS source + UI entry + declared permissions for a\n * package. Handles both dev (HTTP off the running dev server) and released\n * (file:// from the installed snapshot). Reads disk/network/storage; does\n * NOT spawn. Returns null when the bundle can't be resolved (dev server\n * unreachable, missing entry, no installed version).\n */\n async resolveBundle(packageName: string, hints?: LaunchHints): Promise<ResolvedBundle | null> {\n const devUrl = hints?.devUrl ?? this.storedDevUrl(packageName)\n\n // --- Dev: load directly off the local dev server over HTTP. ---\n if (devUrl) {\n const route = await decideDevLaunchRoute(packageName, devUrl)\n if (route.decision === \"offline\" || !route.manifest) return null\n const manifest = route.manifest\n const entry = manifest.entry as {background?: string; ui?: string} | undefined\n if (!entry?.background) return null\n\n // Use the host that actually answered — may differ from the stored IP\n // after a laptop Wi-Fi change (mDNS / Metro failover inside decideDevLaunchRoute).\n const base = route.resolvedUrl.replace(/\\/$/, \"\")\n // entry.* are bundle-root paths (dist/ stripped); the dev server serves\n // files relative to cwd, so prepend dist/.\n const bgUrl = `${base}/dist/${entry.background.replace(/^\\.?\\/+/, \"\")}`\n const uiUri = entry.ui ? `${base}/dist/${entry.ui.replace(/^\\.?\\/+/, \"\")}` : null\n\n const perms = manifest.permissions as Array<{type?: string} | string> | undefined\n const declaredPermissions = (perms ?? [])\n .map((p) => (typeof p === \"string\" ? p : p?.type))\n .filter((t): t is string => typeof t === \"string\")\n const installedManifest: InstalledMiniappManifest = {\n packageName: typeof manifest.packageName === \"string\" ? manifest.packageName : packageName,\n name: manifest.name,\n version: typeof manifest.version === \"string\" ? manifest.version : undefined,\n sdkVersion: typeof manifest.sdkVersion === \"string\" ? manifest.sdkVersion : undefined,\n minHostVersion: typeof manifest.minHostVersion === \"string\" ? manifest.minHostVersion : undefined,\n type: typeof manifest.type === \"string\" ? manifest.type : undefined,\n entry: manifest.entry as InstalledMiniappManifest[\"entry\"],\n permissions: manifest.permissions as InstalledMiniappManifest[\"permissions\"],\n hardwareRequirements: manifest.hardwareRequirements as InstalledMiniappManifest[\"hardwareRequirements\"],\n actions: manifest.actions as InstalledMiniappManifest[\"actions\"],\n widgets: manifest.widgets,\n }\n\n let bgSource: string\n try {\n const res = await fetch(bgUrl)\n if (!res.ok) return null\n bgSource = await res.text()\n } catch {\n return null\n }\n\n return {\n bgSource,\n uiUri,\n uiBaseDir: uiUri ? uiUri.replace(/\\/[^/]+$/, \"/\") : null,\n declaredPermissions,\n installedManifest,\n devUrl: route.resolvedUrl,\n devPort: this.resolveDevPort(hints?.devPort, packageName),\n }\n }\n\n // --- Released: resolve from the installed file:// snapshot. ---\n const version = hints?.version ?? (await appRegistry.getActiveVersion(packageName))\n if (!version) return null\n const entryPaths = appRegistry.getMiniappEntryPaths(packageName, version)\n if (!entryPaths?.background) return null\n\n const manifest = appRegistry.getMiniappManifest(packageName, version) as {\n packageName?: string\n name?: string\n version?: string\n sdkVersion?: string\n minHostVersion?: string\n type?: string\n entry?: {background?: string; ui?: string}\n permissions?: Array<{type: string; required?: boolean; description?: string}>\n hardwareRequirements?: Array<{type: string; level: string; description?: string}>\n actions?: Array<{id?: unknown; description?: unknown; parameters?: unknown; outputSchema?: unknown}>\n widgets?: unknown\n } | null\n const declaredPermissions = (manifest?.permissions ?? [])\n .map((p) => p.type)\n .filter((t): t is string => typeof t === \"string\")\n const installedManifest: InstalledMiniappManifest | undefined = manifest\n ? {\n packageName: manifest.packageName ?? packageName,\n name: manifest.name,\n version: manifest.version ?? version,\n sdkVersion: manifest.sdkVersion,\n minHostVersion: manifest.minHostVersion,\n type: manifest.type,\n entry: manifest.entry,\n permissions: manifest.permissions,\n hardwareRequirements: manifest.hardwareRequirements,\n actions: manifest.actions,\n widgets: manifest.widgets,\n }\n : undefined\n\n let bgSource: string\n try {\n bgSource = new File(entryPaths.background).textSync()\n } catch {\n return null\n }\n\n return {\n bgSource,\n uiUri: entryPaths.ui ?? null,\n uiBaseDir: entryPaths.ui ? entryPaths.ui.replace(/\\/[^/]+$/, \"/\") : null,\n declaredPermissions,\n installedManifest,\n devUrl: null,\n devPort: null,\n }\n }\n\n /**\n * Ensure a miniapp's background JS context is spawned. Idempotent — if the\n * context is already alive this is a no-op spawn-wise (it still resolves the\n * UI entry so a re-mounting host gets its `<WebView>` source back).\n *\n * Resolves once the context is SPAWNED. It does NOT block on the context's\n * CONNECT handshake — the host's WebView mount shouldn't wait on background\n * JS. Callers that need the context to be connected and ready to receive\n * messages (the action broker) follow up with\n * {@link LocalMiniappRuntime.waitForConnect}.\n */\n async ensureRunning(packageName: string, hints?: LaunchHints): Promise<LaunchResult> {\n const router = this.requireRouter()\n\n // Already spawned: best-effort resolve for the UI entry, never throw —\n // a headless caller that doesn't need UI gets {null, null} fast even if\n // the dev server has since dropped.\n if (router.registeredPackages().includes(packageName)) {\n const existing = await this.resolveBundle(packageName, hints).catch(() => null)\n return {uiUri: existing?.uiUri ?? null, uiBaseDir: existing?.uiBaseDir ?? null}\n }\n\n // Coalesce concurrent launches of the same package onto one promise.\n const pending = this.inFlight.get(packageName)\n if (pending) return pending\n\n const launch = this.spawn(packageName, hints)\n this.inFlight.set(packageName, launch)\n try {\n return await launch\n } finally {\n this.inFlight.delete(packageName)\n }\n }\n\n /** Resolve the bundle and spawn the context. Serialized via {@link inFlight}. */\n private async spawn(packageName: string, hints?: LaunchHints): Promise<LaunchResult> {\n const router = this.requireRouter()\n const resolved = await this.resolveBundle(packageName, hints)\n if (!resolved) {\n throw new Error(`MiniappLauncher: cannot resolve bundle for ${packageName}`)\n }\n\n // Re-check after the async resolve: a different path may have spawned it\n // while we were fetching/reading the bundle.\n if (!router.registeredPackages().includes(packageName)) {\n const ok = await router.spawnAndRegister(packageName, resolved.bgSource, {\n permissions: resolved.declaredPermissions,\n installedManifest: resolved.installedManifest,\n launchSource: hints?.launchSource,\n })\n if (!ok) {\n throw new Error(`MiniappLauncher: spawn failed for ${packageName}`)\n }\n\n // Dev: wire the hot-reload + log-forwarding sidecar. No-op in prod\n // (devServerBridge silently drops when no sidecar is up).\n if (resolved.devUrl && resolved.devPort != null) {\n devServerBridge.connect(packageName, resolved.devUrl, resolved.devPort)\n } else if (resolved.devUrl) {\n // Dev miniapp with no resolvable port — it still launches, but hot\n // reload + log forwarding won't connect. Surface it instead of failing\n // silently (the old inline path hard-failed with \"no dev port\").\n console.warn(`MiniappLauncher: ${packageName} has no dev port — hot reload + log forwarding disabled`)\n }\n }\n\n return {uiUri: resolved.uiUri, uiBaseDir: resolved.uiBaseDir}\n }\n\n /**\n * Start the Always On local miniapps at boot.\n *\n * Miniapps run in the phone's own JS engine, so a host-process kill tears\n * down their JSContext. Only Always On apps come back: whatever else was\n * running when the app was killed stays stopped until the wearer opens it\n * again. The spawn is headless (no foreground, no navigation) and registers\n * the package so the home tray/switcher project it as running, exactly as a\n * normal start would. The WebView, if any, re-attaches lazily when the user\n * opens the app.\n *\n * One dashboard runs at a time: a dashboard already running keeps its place,\n * else the first Always On dashboard by package name starts and the rest\n * stay stopped. The flag is exclusive after any user action (setAlwaysOn\n * clears it on the other dashboards), so this only arbitrates manifests\n * that both claim it.\n *\n * Idempotent and best-effort: skips already-spawned contexts, and skips apps\n * missing required OS permissions without prompting or clearing their Always\n * On choice. Not compatibility-gated: an Always On app shouldn't be dropped\n * just because glasses are momentarily disconnected at boot — it resumes\n * when they reconnect, same as mid-session.\n */\n async autostartLocalMiniapps(): Promise<void> {\n const apps = await appRegistry.getInstalledMiniapps()\n const dashboards = apps.filter((app) => app.type === \"dashboard\")\n const dashboard =\n dashboards.find((app) => this.isRunning(app.packageName))?.packageName ??\n dashboards\n .filter((app) => app.alwaysOn)\n .map((app) => app.packageName)\n .sort()[0] ??\n null\n for (const app of apps) {\n // Only phone-hosted miniapps have a JSContext to spawn. Offline\n // built-ins (`local:false, offline:true`) have no bundle to launch.\n if (!app.local || !app.alwaysOn) continue\n if (app.type === \"dashboard\" && app.packageName !== dashboard) continue\n if (this.isRunning(app.packageName)) continue\n try {\n const missing = await permissions.missingRequired(app.permissions ?? [])\n if (missing.length > 0) {\n console.info(\n `MiniappLauncher: skipping autostart for ${app.packageName} — missing required permissions: ${missing.join(\n \", \",\n )}`,\n )\n continue\n }\n } catch (e) {\n console.warn(`MiniappLauncher: skipping autostart for ${app.packageName} — permission check failed`, e)\n continue\n }\n try {\n await this.ensureRunning(app.packageName)\n } catch (e) {\n console.warn(`MiniappLauncher: autostart failed for ${app.packageName}`, e)\n }\n }\n }\n\n /**\n * Ensure the context is running AND has completed its CONNECT handshake.\n * Used by the action broker, which must not deliver to a context that hasn't\n * come up yet. Throws on spawn failure or connect timeout.\n */\n async ensureConnected(packageName: string, connectTimeoutMs = 10_000, hints?: LaunchHints): Promise<void> {\n await this.ensureRunning(packageName, hints)\n await localMiniappRuntime.waitForConnect(packageName, connectTimeoutMs)\n }\n\n /** Tear down a miniapp's background JS context. */\n async stop(packageName: string): Promise<void> {\n // If a launch is in flight, let it finish first. Otherwise unregister()\n // no-ops on the not-yet-registered package and the pending spawn then\n // re-registers the context — leaving it running despite the stop.\n const pending = this.inFlight.get(packageName)\n if (pending) {\n try {\n await pending\n } catch {\n // Launch failed — nothing got registered, so nothing to tear down.\n }\n }\n await this.deps?.router.unregister(packageName)\n }\n\n // --- internals -----------------------------------------------------------\n\n private storedDevUrl(packageName: string): string | undefined {\n const r = storage.load<string>(`${packageName}_dev_url`)\n return r.is_ok() ? r.value : undefined\n }\n\n /** resolveDevPort — moved verbatim from the old LocalMiniappView helper. */\n private resolveDevPort(searchParam: string | undefined, packageName: string): number | null {\n if (searchParam) {\n const n = parseInt(searchParam, 10)\n if (Number.isFinite(n)) return n\n }\n const stored = storage.load<number>(`${packageName}_dev_port`)\n if (stored.is_ok()) return stored.value\n return null\n }\n}\n\nexport const miniappLauncher = new MiniappLauncher()\n"]}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Widget mode: a miniapp whose background context runs only because a host
3
+ * (the dashboard) placed one of its widgets. It is running, but it has no
4
+ * card in the app switcher, draws nothing of its own on the glasses and
5
+ * hears no touch input; the Widgets pill lists it. Opening the app from the
6
+ * home screen promotes it to a normal run; closing a placed app from the
7
+ * tray demotes it back here instead of stopping it.
8
+ *
9
+ * The runtime is the writer (placements come and go through it); the apps
10
+ * store projects `widgetOnly` from here beside `running`.
11
+ */
12
+ type Listener = () => void;
13
+ export declare const miniappWidgetMode: {
14
+ /** Mark (or clear) widget mode. Clearing promotes: the app keeps running as a normal app. */
15
+ setWidgetOnly(packageName: string, on: boolean): void;
16
+ isWidgetOnly(packageName: string): boolean;
17
+ /** Record whether any host has a widget of this provider placed. */
18
+ setPlaced(packageName: string, on: boolean): void;
19
+ isPlaced(packageName: string): boolean;
20
+ getAll(): string[];
21
+ subscribe(fn: Listener): () => void;
22
+ };
23
+ export {};
24
+ //# sourceMappingURL=MiniappWidgetMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MiniappWidgetMode.d.ts","sourceRoot":"","sources":["../../src/services/MiniappWidgetMode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAA;AAiB1B,eAAO,MAAM,iBAAiB;IAC5B,6FAA6F;+BAClE,MAAM,MAAM,OAAO,GAAG,IAAI;8BAM3B,MAAM,GAAG,OAAO;IAI1C,oEAAoE;2BAC7C,MAAM,MAAM,OAAO,GAAG,IAAI;0BAK3B,MAAM,GAAG,OAAO;cAI5B,MAAM,EAAE;kBAIJ,QAAQ,GAAG,MAAM,IAAI;CAMpC,CAAA"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Widget mode: a miniapp whose background context runs only because a host
3
+ * (the dashboard) placed one of its widgets. It is running, but it has no
4
+ * card in the app switcher, draws nothing of its own on the glasses and
5
+ * hears no touch input; the Widgets pill lists it. Opening the app from the
6
+ * home screen promotes it to a normal run; closing a placed app from the
7
+ * tray demotes it back here instead of stopping it.
8
+ *
9
+ * The runtime is the writer (placements come and go through it); the apps
10
+ * store projects `widgetOnly` from here beside `running`.
11
+ */
12
+ const widgetOnly = new Set();
13
+ /** Providers with at least one widget placed by some host. */
14
+ const placed = new Set();
15
+ const listeners = new Set();
16
+ function notify() {
17
+ for (const fn of listeners) {
18
+ try {
19
+ fn();
20
+ }
21
+ catch (e) {
22
+ console.warn("MiniappWidgetMode: listener threw", e);
23
+ }
24
+ }
25
+ }
26
+ export const miniappWidgetMode = {
27
+ /** Mark (or clear) widget mode. Clearing promotes: the app keeps running as a normal app. */
28
+ setWidgetOnly(packageName, on) {
29
+ const changed = on ? !widgetOnly.has(packageName) : widgetOnly.delete(packageName);
30
+ if (on)
31
+ widgetOnly.add(packageName);
32
+ if (changed)
33
+ notify();
34
+ },
35
+ isWidgetOnly(packageName) {
36
+ return widgetOnly.has(packageName);
37
+ },
38
+ /** Record whether any host has a widget of this provider placed. */
39
+ setPlaced(packageName, on) {
40
+ if (on)
41
+ placed.add(packageName);
42
+ else
43
+ placed.delete(packageName);
44
+ },
45
+ isPlaced(packageName) {
46
+ return placed.has(packageName);
47
+ },
48
+ getAll() {
49
+ return Array.from(widgetOnly);
50
+ },
51
+ subscribe(fn) {
52
+ listeners.add(fn);
53
+ return () => {
54
+ listeners.delete(fn);
55
+ };
56
+ },
57
+ };
58
+ //# sourceMappingURL=MiniappWidgetMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MiniappWidgetMode.js","sourceRoot":"","sources":["../../src/services/MiniappWidgetMode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAA;AACpC,8DAA8D;AAC9D,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;AAChC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAY,CAAA;AAErC,SAAS,MAAM;IACb,KAAK,MAAM,EAAE,IAAI,SAAS,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,EAAE,EAAE,CAAA;QACN,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,IAAI,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAA;QACtD,CAAC;IACH,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,6FAA6F;IAC7F,aAAa,CAAC,WAAmB,EAAE,EAAW;QAC5C,MAAM,OAAO,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QAClF,IAAI,EAAE;YAAE,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QACnC,IAAI,OAAO;YAAE,MAAM,EAAE,CAAA;IACvB,CAAC;IAED,YAAY,CAAC,WAAmB;QAC9B,OAAO,UAAU,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IACpC,CAAC;IAED,oEAAoE;IACpE,SAAS,CAAC,WAAmB,EAAE,EAAW;QACxC,IAAI,EAAE;YAAE,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;;YAC1B,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;IACjC,CAAC;IAED,QAAQ,CAAC,WAAmB;QAC1B,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;IAChC,CAAC;IAED,MAAM;QACJ,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAC/B,CAAC;IAED,SAAS,CAAC,EAAY;QACpB,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,GAAG,EAAE;YACV,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,CAAC,CAAA;IACH,CAAC;CACF,CAAA","sourcesContent":["/**\n * Widget mode: a miniapp whose background context runs only because a host\n * (the dashboard) placed one of its widgets. It is running, but it has no\n * card in the app switcher, draws nothing of its own on the glasses and\n * hears no touch input; the Widgets pill lists it. Opening the app from the\n * home screen promotes it to a normal run; closing a placed app from the\n * tray demotes it back here instead of stopping it.\n *\n * The runtime is the writer (placements come and go through it); the apps\n * store projects `widgetOnly` from here beside `running`.\n */\n\ntype Listener = () => void\n\nconst widgetOnly = new Set<string>()\n/** Providers with at least one widget placed by some host. */\nconst placed = new Set<string>()\nconst listeners = new Set<Listener>()\n\nfunction notify(): void {\n for (const fn of listeners) {\n try {\n fn()\n } catch (e) {\n console.warn(\"MiniappWidgetMode: listener threw\", e)\n }\n }\n}\n\nexport const miniappWidgetMode = {\n /** Mark (or clear) widget mode. Clearing promotes: the app keeps running as a normal app. */\n setWidgetOnly(packageName: string, on: boolean): void {\n const changed = on ? !widgetOnly.has(packageName) : widgetOnly.delete(packageName)\n if (on) widgetOnly.add(packageName)\n if (changed) notify()\n },\n\n isWidgetOnly(packageName: string): boolean {\n return widgetOnly.has(packageName)\n },\n\n /** Record whether any host has a widget of this provider placed. */\n setPlaced(packageName: string, on: boolean): void {\n if (on) placed.add(packageName)\n else placed.delete(packageName)\n },\n\n isPlaced(packageName: string): boolean {\n return placed.has(packageName)\n },\n\n getAll(): string[] {\n return Array.from(widgetOnly)\n },\n\n subscribe(fn: Listener): () => void {\n listeners.add(fn)\n return () => {\n listeners.delete(fn)\n }\n },\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { DeclaredAction } from "../types/applet";
1
+ import type { DeclaredAction, DeclaredWidget } from "../types/applet";
2
2
  /** The subset of ClientApp that action-listing needs (structural, no cycle on applet types). */
3
3
  export interface ActionListApp {
4
4
  packageName: string;
@@ -28,4 +28,11 @@ export declare function visibleActionRows(apps: ActionListApp[], callerPackageNa
28
28
  * bundles. Input and output schemas are passed through as opaque JSON Schema.
29
29
  */
30
30
  export declare function normalizeManifestActions(raw: unknown): DeclaredAction[];
31
+ /**
32
+ * Normalize manifest widgets for installed and dev-sideloaded bundles: an
33
+ * entry without an id, a name or a usable size is dropped, repeats of a
34
+ * size are folded, and a default size the widget does not offer becomes
35
+ * its first size.
36
+ */
37
+ export declare function normalizeManifestWidgets(raw: unknown): DeclaredWidget[];
31
38
  //# sourceMappingURL=manifestActions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifestActions.d.ts","sourceRoot":"","sources":["../../src/services/manifestActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,iBAAiB,CAAA;AAEnD,gGAAgG;AAChG,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,aAAa,CAAC,EAAE;QAAC,YAAY,EAAE,OAAO,CAAA;KAAC,CAAA;CACxC;AAED,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACvC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,EAAE,EACrB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,OAAO,GACtB,aAAa,EAAE,CAkBjB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,EAAE,CA0BvE"}
1
+ {"version":3,"file":"manifestActions.d.ts","sourceRoot":"","sources":["../../src/services/manifestActions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAE,cAAc,EAAqB,MAAM,iBAAiB,CAAA;AAEvF,gGAAgG;AAChG,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,cAAc,EAAE,CAAA;IAC1B,aAAa,CAAC,EAAE;QAAC,YAAY,EAAE,OAAO,CAAA;KAAC,CAAA;CACxC;AAED,8EAA8E;AAC9E,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,EAAE,EAAE,MAAM,CAAA;IACV,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACvC;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,EAAE,EACrB,iBAAiB,EAAE,MAAM,EACzB,cAAc,EAAE,OAAO,GACtB,aAAa,EAAE,CAkBjB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,EAAE,CA0BvE;AAKD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,OAAO,GAAG,cAAc,EAAE,CAiBvE"}
@@ -51,4 +51,33 @@ export function normalizeManifestActions(raw) {
51
51
  }
52
52
  return out;
53
53
  }
54
+ const WIDGET_SIZES = ["XS", "SM", "MD", "LG"];
55
+ const isWidgetSize = (value) => WIDGET_SIZES.includes(value);
56
+ /**
57
+ * Normalize manifest widgets for installed and dev-sideloaded bundles: an
58
+ * entry without an id, a name or a usable size is dropped, repeats of a
59
+ * size are folded, and a default size the widget does not offer becomes
60
+ * its first size.
61
+ */
62
+ export function normalizeManifestWidgets(raw) {
63
+ if (!Array.isArray(raw))
64
+ return [];
65
+ const out = [];
66
+ const seen = new Set();
67
+ for (const w of raw) {
68
+ if (!w || typeof w.id !== "string" || !w.id || typeof w.name !== "string" || !w.name || seen.has(w.id))
69
+ continue;
70
+ const sizes = Array.isArray(w.sizes) ? Array.from(new Set(w.sizes.filter(isWidgetSize))) : [];
71
+ if (sizes.length === 0)
72
+ continue;
73
+ seen.add(w.id);
74
+ out.push({
75
+ id: w.id,
76
+ name: w.name,
77
+ sizes,
78
+ defaultSize: isWidgetSize(w.defaultSize) && sizes.includes(w.defaultSize) ? w.defaultSize : sizes[0],
79
+ });
80
+ }
81
+ return out;
82
+ }
54
83
  //# sourceMappingURL=manifestActions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifestActions.js","sourceRoot":"","sources":["../../src/services/manifestActions.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAqB,EACrB,iBAAyB,EACzB,cAAuB;IAEvB,MAAM,IAAI,GAAoB,EAAE,CAAA;IAChC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,WAAW,KAAK,iBAAiB,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,SAAQ;QAC7G,IAAI,GAAG,CAAC,aAAa,EAAE,YAAY,KAAK,KAAK;YAAE,SAAQ;QACvD,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;YACvC,IAAI,MAAM,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,cAAc;gBAAE,SAAQ;YAC/D,IAAI,CAAC,IAAI,CAAC;gBACR,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,OAAO,EAAE,GAAG,CAAC,IAAI;gBACjB,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAC,UAAU,EAAE,MAAM,CAAC,UAAU,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAC,YAAY,EAAE,MAAM,CAAC,YAAY,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aACpE,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAY;IACnD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAA;IAClC,MAAM,GAAG,GAAqB,EAAE,CAAA;IAChC,KAAK,MAAM,CAAC,IAAI,GAMd,EAAE,CAAC;QACH,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,EAAE,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,WAAW,KAAK,QAAQ,EAAE,CAAC;YACvE,GAAG,CAAC,IAAI,CAAC;gBACP,EAAE,EAAE,CAAC,CAAC,EAAE;gBACR,WAAW,EAAE,CAAC,CAAC,WAAW;gBAC1B,GAAG,CAAC,CAAC,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC;oBAClF,CAAC,CAAC,EAAC,UAAU,EAAE,CAAC,CAAC,UAAqC,EAAC;oBACvD,CAAC,CAAC,EAAE,CAAC;gBACP,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,OAAO,CAAC,CAAC,YAAY,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;oBACxF,CAAC,CAAC,EAAC,YAAY,EAAE,CAAC,CAAC,YAAuC,EAAC;oBAC3D,CAAC,CAAC,EAAE,CAAC;gBACP,yEAAyE;gBACzE,GAAG,CAAC,CAAC,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,CAAC,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAC,UAAU,EAAE,CAAC,CAAC,UAAU,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aAC9F,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import type {DeclaredAction} from \"../types/applet\"\n\n/** The subset of ClientApp that action-listing needs (structural, no cycle on applet types). */\nexport interface ActionListApp {\n packageName: string\n name: string\n actions?: DeclaredAction[]\n compatibility?: {isCompatible: boolean}\n}\n\n/** One row of `session.actions.list` — a flat, MCP-tool-shaped descriptor. */\nexport interface ActionListRow {\n packageName: string\n appName: string\n id: string\n description: string\n parameters?: Record<string, unknown>\n outputSchema?: Record<string, unknown>\n}\n\n/**\n * Project the installed-app set into the caller's invokable-action rows:\n * excludes the caller's own actions, incompatible apps, and placeholder\n * packages; `visibility: \"system\"` actions only surface for system callers.\n */\nexport function visibleActionRows(\n apps: ActionListApp[],\n callerPackageName: string,\n callerIsSystem: boolean,\n): ActionListRow[] {\n const rows: ActionListRow[] = []\n for (const app of apps) {\n if (!app.packageName || app.packageName === callerPackageName || app.packageName.includes(\"@empty\")) continue\n if (app.compatibility?.isCompatible === false) continue\n for (const action of app.actions ?? []) {\n if (action.visibility === \"system\" && !callerIsSystem) continue\n rows.push({\n packageName: app.packageName,\n appName: app.name,\n id: action.id,\n description: action.description,\n ...(action.parameters ? {parameters: action.parameters} : {}),\n ...(action.outputSchema ? {outputSchema: action.outputSchema} : {}),\n })\n }\n }\n return rows\n}\n\n/**\n * Normalize manifest actions defensively for installed and dev-sideloaded\n * bundles. Input and output schemas are passed through as opaque JSON Schema.\n */\nexport function normalizeManifestActions(raw: unknown): DeclaredAction[] {\n if (!Array.isArray(raw)) return []\n const out: DeclaredAction[] = []\n for (const a of raw as Array<{\n id?: unknown\n description?: unknown\n parameters?: unknown\n outputSchema?: unknown\n visibility?: unknown\n }>) {\n if (a && typeof a.id === \"string\" && typeof a.description === \"string\") {\n out.push({\n id: a.id,\n description: a.description,\n ...(a.parameters && typeof a.parameters === \"object\" && !Array.isArray(a.parameters)\n ? {parameters: a.parameters as Record<string, unknown>}\n : {}),\n ...(a.outputSchema && typeof a.outputSchema === \"object\" && !Array.isArray(a.outputSchema)\n ? {outputSchema: a.outputSchema as Record<string, unknown>}\n : {}),\n // Unknown/absent values fall back to the default (\"public\") by omission.\n ...(a.visibility === \"system\" || a.visibility === \"public\" ? {visibility: a.visibility} : {}),\n })\n }\n }\n return out\n}\n"]}
1
+ {"version":3,"file":"manifestActions.js","sourceRoot":"","sources":["../../src/services/manifestActions.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,IAAqB,EACrB,iBAAyB,EACzB,cAAuB;IAEvB,MAAM,IAAI,GAAoB,EAAE,CAAA;IAChC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,WAAW,KAAK,iBAAiB,IAAI,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC;YAAE,SAAQ;QAC7G,IAAI,GAAG,CAAC,aAAa,EAAE,YAAY,KAAK,KAAK;YAAE,SAAQ;QACvD,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;YACvC,IAAI,MAAM,CAAC,UAAU,KAAK,QAAQ,IAAI,CAAC,cAAc;gBAAE,SAAQ;YAC/D,IAAI,CAAC,IAAI,CAAC;gBACR,WAAW,EAAE,GAAG,CAAC,WAAW;gBAC5B,OAAO,EAAE,GAAG,CAAC,IAAI;gBACjB,EAAE,EAAE,MAAM,CAAC,EAAE;gBACb,WAAW,EAAE,MAAM,CAAC,WAAW;gBAC/B,GAAG,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAC,UAAU,EAAE,MAAM,CAAC,UAAU,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC7D,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,EAAC,YAAY,EAAE,MAAM,CAAC,YAAY,EAAC,CAAC,CAAC,CAAC,EAAE,CAAC;aACpE,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,GA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C,CAAA;IACJ,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import type {DeclaredAction, DeclaredWidget, DeclaredWidgetSize} from \"../types/applet\"\n\n/** The subset of ClientApp that action-listing needs (structural, no cycle on applet types). */\nexport interface ActionListApp {\n packageName: string\n name: string\n actions?: DeclaredAction[]\n compatibility?: {isCompatible: boolean}\n}\n\n/** One row of `session.actions.list` — a flat, MCP-tool-shaped descriptor. */\nexport interface ActionListRow {\n packageName: string\n appName: string\n id: string\n description: string\n parameters?: Record<string, unknown>\n outputSchema?: Record<string, unknown>\n}\n\n/**\n * Project the installed-app set into the caller's invokable-action rows:\n * excludes the caller's own actions, incompatible apps, and placeholder\n * packages; `visibility: \"system\"` actions only surface for system callers.\n */\nexport function visibleActionRows(\n apps: ActionListApp[],\n callerPackageName: string,\n callerIsSystem: boolean,\n): ActionListRow[] {\n const rows: ActionListRow[] = []\n for (const app of apps) {\n if (!app.packageName || app.packageName === callerPackageName || app.packageName.includes(\"@empty\")) continue\n if (app.compatibility?.isCompatible === false) continue\n for (const action of app.actions ?? []) {\n if (action.visibility === \"system\" && !callerIsSystem) continue\n rows.push({\n packageName: app.packageName,\n appName: app.name,\n id: action.id,\n description: action.description,\n ...(action.parameters ? {parameters: action.parameters} : {}),\n ...(action.outputSchema ? {outputSchema: action.outputSchema} : {}),\n })\n }\n }\n return rows\n}\n\n/**\n * Normalize manifest actions defensively for installed and dev-sideloaded\n * bundles. Input and output schemas are passed through as opaque JSON Schema.\n */\nexport function normalizeManifestActions(raw: unknown): DeclaredAction[] {\n if (!Array.isArray(raw)) return []\n const out: DeclaredAction[] = []\n for (const a of raw as Array<{\n id?: unknown\n description?: unknown\n parameters?: unknown\n outputSchema?: unknown\n visibility?: unknown\n }>) {\n if (a && typeof a.id === \"string\" && typeof a.description === \"string\") {\n out.push({\n id: a.id,\n description: a.description,\n ...(a.parameters && typeof a.parameters === \"object\" && !Array.isArray(a.parameters)\n ? {parameters: a.parameters as Record<string, unknown>}\n : {}),\n ...(a.outputSchema && typeof a.outputSchema === \"object\" && !Array.isArray(a.outputSchema)\n ? {outputSchema: a.outputSchema as Record<string, unknown>}\n : {}),\n // Unknown/absent values fall back to the default (\"public\") by omission.\n ...(a.visibility === \"system\" || a.visibility === \"public\" ? {visibility: a.visibility} : {}),\n })\n }\n }\n return out\n}\n\nconst WIDGET_SIZES: readonly DeclaredWidgetSize[] = [\"XS\", \"SM\", \"MD\", \"LG\"]\nconst isWidgetSize = (value: unknown): value is DeclaredWidgetSize => (WIDGET_SIZES as readonly unknown[]).includes(value)\n\n/**\n * Normalize manifest widgets for installed and dev-sideloaded bundles: an\n * entry without an id, a name or a usable size is dropped, repeats of a\n * size are folded, and a default size the widget does not offer becomes\n * its first size.\n */\nexport function normalizeManifestWidgets(raw: unknown): DeclaredWidget[] {\n if (!Array.isArray(raw)) return []\n const out: DeclaredWidget[] = []\n const seen = new Set<string>()\n for (const w of raw as Array<{id?: unknown; name?: unknown; sizes?: unknown; defaultSize?: unknown}>) {\n if (!w || typeof w.id !== \"string\" || !w.id || typeof w.name !== \"string\" || !w.name || seen.has(w.id)) continue\n const sizes = Array.isArray(w.sizes) ? Array.from(new Set(w.sizes.filter(isWidgetSize))) : []\n if (sizes.length === 0) continue\n seen.add(w.id)\n out.push({\n id: w.id,\n name: w.name,\n sizes,\n defaultSize: isWidgetSize(w.defaultSize) && sizes.includes(w.defaultSize) ? w.defaultSize : sizes[0],\n })\n }\n return out\n}\n"]}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Who placed which widget where: the pure bookkeeping behind the runtime's
3
+ * widget routing. A placement is one host's box for one provider widget;
4
+ * a provider is placed while any host holds one of its widgets. Frames are
5
+ * kept per widget so a host that places one again gets the last frame
6
+ * at once.
7
+ */
8
+ export interface WidgetBox {
9
+ size: "XS" | "SM" | "MD" | "LG";
10
+ width: number;
11
+ height: number;
12
+ }
13
+ export interface Placement {
14
+ hostPackageName: string;
15
+ providerPackageName: string;
16
+ widgetId: string;
17
+ box: WidgetBox;
18
+ }
19
+ export interface WidgetPlacements {
20
+ /** Keyed by `${host}|${provider}/${widgetId}`. */
21
+ placements: ReadonlyMap<string, Placement>;
22
+ /** The latest frame per `${provider}/${widgetId}`. */
23
+ frames: ReadonlyMap<string, unknown[]>;
24
+ }
25
+ export declare const widgetKey: (providerPackageName: string, widgetId: string) => string;
26
+ export declare function emptyWidgetPlacements(): WidgetPlacements;
27
+ export declare function placeWidget(state: WidgetPlacements, placement: Placement): WidgetPlacements;
28
+ export declare function unplaceWidget(state: WidgetPlacements, hostPackageName: string, providerPackageName: string, widgetId: string): WidgetPlacements;
29
+ /** A host went away: drop everything it placed. */
30
+ export declare function dropHost(state: WidgetPlacements, hostPackageName: string): WidgetPlacements;
31
+ /** A provider went away: drop its placements, keep its frames for the placeholder. */
32
+ export declare function dropProvider(state: WidgetPlacements, providerPackageName: string): WidgetPlacements;
33
+ export declare function setFrame(state: WidgetPlacements, providerPackageName: string, widgetId: string, elements: unknown[]): WidgetPlacements;
34
+ export declare function frameOf(state: WidgetPlacements, providerPackageName: string, widgetId: string): unknown[] | null;
35
+ export declare function placementOf(state: WidgetPlacements, hostPackageName: string, providerPackageName: string, widgetId: string): Placement | null;
36
+ /** Hosts holding this widget, each once. */
37
+ export declare function hostsOf(state: WidgetPlacements, providerPackageName: string, widgetId: string): string[];
38
+ /** Providers with at least one widget placed. */
39
+ export declare function placedProviders(state: WidgetPlacements): Set<string>;
40
+ export declare function isProviderPlaced(state: WidgetPlacements, providerPackageName: string): boolean;
41
+ /** The placements a host holds on a provider, for re-delivering boxes. */
42
+ export declare function placementsBy(state: WidgetPlacements, hostPackageName: string): Placement[];
43
+ //# sourceMappingURL=widgetPlacements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widgetPlacements.d.ts","sourceRoot":"","sources":["../../src/services/widgetPlacements.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,I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mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,EAAE,GAAG,IAAI,CAEhH;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,gBAAgB,EACvB,eAAe,EAAE,MAAM,EACvB,mBAAmB,EAAE,MAAM,EAC3B,QAAQ,EAAE,MAAM,GACf,SAAS,GAAG,IAAI,CAElB;AAED,4CAA4C;AAC5C,wBAAgB,OAAO,CAAC,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAQxG;AAED,iDAAiD;AACjD,wBAAgB,eAAe,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,CAIpE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,GAAG,OAAO,CAK9F;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,GAAG,SAAS,EAAE,CAE1F"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Who placed which widget where: the pure bookkeeping behind the runtime's
3
+ * widget routing. A placement is one host's box for one provider widget;
4
+ * a provider is placed while any host holds one of its widgets. Frames are
5
+ * kept per widget so a host that places one again gets the last frame
6
+ * at once.
7
+ */
8
+ export const widgetKey = (providerPackageName, widgetId) => `${providerPackageName}/${widgetId}`;
9
+ const placementKey = (hostPackageName, providerPackageName, widgetId) => `${hostPackageName}|${widgetKey(providerPackageName, widgetId)}`;
10
+ export function emptyWidgetPlacements() {
11
+ return { placements: new Map(), frames: new Map() };
12
+ }
13
+ export function placeWidget(state, placement) {
14
+ const placements = new Map(state.placements);
15
+ placements.set(placementKey(placement.hostPackageName, placement.providerPackageName, placement.widgetId), placement);
16
+ return { ...state, placements };
17
+ }
18
+ export function unplaceWidget(state, hostPackageName, providerPackageName, widgetId) {
19
+ const key = placementKey(hostPackageName, providerPackageName, widgetId);
20
+ if (!state.placements.has(key))
21
+ return state;
22
+ const placements = new Map(state.placements);
23
+ placements.delete(key);
24
+ return { ...state, placements };
25
+ }
26
+ /** A host went away: drop everything it placed. */
27
+ export function dropHost(state, hostPackageName) {
28
+ const placements = new Map(state.placements);
29
+ for (const [key, placement] of state.placements) {
30
+ if (placement.hostPackageName === hostPackageName)
31
+ placements.delete(key);
32
+ }
33
+ return placements.size === state.placements.size ? state : { ...state, placements };
34
+ }
35
+ /** A provider went away: drop its placements, keep its frames for the placeholder. */
36
+ export function dropProvider(state, providerPackageName) {
37
+ const placements = new Map(state.placements);
38
+ for (const [key, placement] of state.placements) {
39
+ if (placement.providerPackageName === providerPackageName)
40
+ placements.delete(key);
41
+ }
42
+ return placements.size === state.placements.size ? state : { ...state, placements };
43
+ }
44
+ export function setFrame(state, providerPackageName, widgetId, elements) {
45
+ const frames = new Map(state.frames);
46
+ frames.set(widgetKey(providerPackageName, widgetId), elements);
47
+ return { ...state, frames };
48
+ }
49
+ export function frameOf(state, providerPackageName, widgetId) {
50
+ return state.frames.get(widgetKey(providerPackageName, widgetId)) ?? null;
51
+ }
52
+ export function placementOf(state, hostPackageName, providerPackageName, widgetId) {
53
+ return state.placements.get(placementKey(hostPackageName, providerPackageName, widgetId)) ?? null;
54
+ }
55
+ /** Hosts holding this widget, each once. */
56
+ export function hostsOf(state, providerPackageName, widgetId) {
57
+ const hosts = new Set();
58
+ for (const placement of state.placements.values()) {
59
+ if (placement.providerPackageName === providerPackageName && placement.widgetId === widgetId) {
60
+ hosts.add(placement.hostPackageName);
61
+ }
62
+ }
63
+ return Array.from(hosts);
64
+ }
65
+ /** Providers with at least one widget placed. */
66
+ export function placedProviders(state) {
67
+ const providers = new Set();
68
+ for (const placement of state.placements.values())
69
+ providers.add(placement.providerPackageName);
70
+ return providers;
71
+ }
72
+ export function isProviderPlaced(state, providerPackageName) {
73
+ for (const placement of state.placements.values()) {
74
+ if (placement.providerPackageName === providerPackageName)
75
+ return true;
76
+ }
77
+ return false;
78
+ }
79
+ /** The placements a host holds on a provider, for re-delivering boxes. */
80
+ export function placementsBy(state, hostPackageName) {
81
+ return Array.from(state.placements.values()).filter((placement) => placement.hostPackageName === hostPackageName);
82
+ }
83
+ //# sourceMappingURL=widgetPlacements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widgetPlacements.js","sourceRoot":"","sources":["../../src/services/widgetPlacements.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAsBH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,mBAA2B,EAAE,QAAgB,EAAU,EAAE,CAAC,GAAG,mBAAmB,IAAI,QAAQ,EAAE,CAAA;AACxH,MAAM,YAAY,GAAG,CAAC,eAAuB,EAAE,mBAA2B,EAAE,QAAgB,EAAU,EAAE,CACtG,GAAG,eAAe,IAAI,SAAS,CAAC,mBAAmB,EAAE,QAAQ,CAAC,EAAE,CAAA;AAElE,MAAM,UAAU,qBAAqB;IACnC,OAAO,EAAC,UAAU,EAAE,IAAI,GAAG,EAAE,EAAE,MAAM,EAAE,IAAI,GAAG,EAAE,EAAC,CAAA;AACnD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAuB,EAAE,SAAoB;IACvE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;IAC5C,UAAU,CAAC,GAAG,CAAC,YAAY,CAAC,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,mBAAmB,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,CAAA;IACrH,OAAO,EAAC,GAAG,KAAK,EAAE,UAAU,EAAC,CAAA;AAC/B,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,KAAuB,EACvB,eAAuB,EACvB,mBAA2B,EAC3B,QAAgB;IAEhB,MAAM,GAAG,GAAG,YAAY,CAAC,eAAe,EAAE,mBAAmB,EAAE,QAAQ,CAAC,CAAA;IACxE,IAAI,CAAC,KAAK,C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D,MAAM,SAAS,GAAG,IAAI,GAAG,EAAU,CAAA;IACnC,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE;QAAE,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAA;IAC/F,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAuB,EAAE,mBAA2B;IACnF,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC;QAClD,IAAI,SAAS,CAAC,mBAAmB,KAAK,mBAAmB;YAAE,OAAO,IAAI,CAAA;IACxE,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,YAAY,CAAC,KAAuB,EAAE,eAAuB;IAC3E,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,eAAe,KAAK,eAAe,CAAC,CAAA;AACnH,CAAC","sourcesContent":["/**\n * Who placed which widget where: the pure bookkeeping behind the runtime's\n * widget routing. A placement is one host's box for one provider widget;\n * a provider is placed while any host holds one of its widgets. Frames are\n * kept per widget so a host that places one again gets the last frame\n * at once.\n */\n\nexport interface WidgetBox {\n size: \"XS\" | \"SM\" | \"MD\" | \"LG\"\n width: number\n height: number\n}\n\nexport interface Placement {\n hostPackageName: string\n providerPackageName: string\n widgetId: string\n box: WidgetBox\n}\n\nexport interface WidgetPlacements {\n /** Keyed by `${host}|${provider}/${widgetId}`. */\n placements: ReadonlyMap<string, Placement>\n /** The latest frame per `${provider}/${widgetId}`. */\n frames: ReadonlyMap<string, unknown[]>\n}\n\nexport const widgetKey = (providerPackageName: string, widgetId: string): string => `${providerPackageName}/${widgetId}`\nconst placementKey = (hostPackageName: string, providerPackageName: string, widgetId: string): string =>\n `${hostPackageName}|${widgetKey(providerPackageName, widgetId)}`\n\nexport function emptyWidgetPlacements(): WidgetPlacements {\n return {placements: new Map(), frames: new Map()}\n}\n\nexport function placeWidget(state: WidgetPlacements, placement: Placement): WidgetPlacements {\n const placements = new Map(state.placements)\n placements.set(placementKey(placement.hostPackageName, placement.providerPackageName, placement.widgetId), placement)\n return {...state, placements}\n}\n\nexport function unplaceWidget(\n state: WidgetPlacements,\n hostPackageName: string,\n providerPackageName: string,\n widgetId: string,\n): WidgetPlacements {\n const key = placementKey(hostPackageName, providerPackageName, widgetId)\n if (!state.placements.has(key)) return state\n const placements = new Map(state.placements)\n placements.delete(key)\n return {...state, placements}\n}\n\n/** A host went away: drop everything it placed. */\nexport function dropHost(state: WidgetPlacements, hostPackageName: string): WidgetPlacements {\n const placements = new Map(state.placements)\n for (const [key, placement] of state.placements) {\n if (placement.hostPackageName === hostPackageName) placements.delete(key)\n }\n return placements.size === state.placements.size ? state : {...state, placements}\n}\n\n/** A provider went away: drop its placements, keep its frames for the placeholder. */\nexport function dropProvider(state: WidgetPlacements, providerPackageName: string): WidgetPlacements {\n const placements = new Map(state.placements)\n for (const [key, placement] of state.placements) {\n if (placement.providerPackageName === providerPackageName) placements.delete(key)\n }\n return placements.size === state.placements.size ? state : {...state, placements}\n}\n\nexport function setFrame(state: WidgetPlacements, providerPackageName: string, widgetId: string, elements: unknown[]): WidgetPlacements {\n const frames = new Map(state.frames)\n frames.set(widgetKey(providerPackageName, widgetId), elements)\n return {...state, frames}\n}\n\nexport function frameOf(state: WidgetPlacements, providerPackageName: string, widgetId: string): unknown[] | null {\n return state.frames.get(widgetKey(providerPackageName, widgetId)) ?? null\n}\n\nexport function placementOf(\n state: WidgetPlacements,\n hostPackageName: string,\n providerPackageName: string,\n widgetId: string,\n): Placement | null {\n return state.placements.get(placementKey(hostPackageName, providerPackageName, widgetId)) ?? null\n}\n\n/** Hosts holding this widget, each once. */\nexport function hostsOf(state: WidgetPlacements, providerPackageName: string, widgetId: string): string[] {\n const hosts = new Set<string>()\n for (const placement of state.placements.values()) {\n if (placement.providerPackageName === providerPackageName && placement.widgetId === widgetId) {\n hosts.add(placement.hostPackageName)\n }\n }\n return Array.from(hosts)\n}\n\n/** Providers with at least one widget placed. */\nexport function placedProviders(state: WidgetPlacements): Set<string> {\n const providers = new Set<string>()\n for (const placement of state.placements.values()) providers.add(placement.providerPackageName)\n return providers\n}\n\nexport function isProviderPlaced(state: WidgetPlacements, providerPackageName: string): boolean {\n for (const placement of state.placements.values()) {\n if (placement.providerPackageName === providerPackageName) return true\n }\n return false\n}\n\n/** The placements a host holds on a provider, for re-delivering boxes. */\nexport function placementsBy(state: WidgetPlacements, hostPackageName: string): Placement[] {\n return Array.from(state.placements.values()).filter((placement) => placement.hostPackageName === hostPackageName)\n}\n"]}
@@ -95,8 +95,10 @@ export declare const useInstall: () => (url: string, opts?: {
95
95
  versionOverride?: string;
96
96
  }) => AsyncResult<void, Error>;
97
97
  export declare const useUninstall: () => (packageName: string, version?: string) => AsyncResult<void, Error>;
98
- /** Every running app; each one has a card in the app switcher tray. */
98
+ /** Every running app with a card in the app switcher tray: widget-only apps have none. */
99
99
  export declare const useActiveApps: () => ClientApp[];
100
+ /** Apps running only for a widget the dashboard placed; the switcher's Widgets pill lists them. */
101
+ export declare const useWidgetApps: () => ClientApp[];
100
102
  /** Always On apps whose background task is running, card or no card. */
101
103
  export declare const useRunningAlwaysOnApps: () => ClientApp[];
102
104
  export declare const useActiveBackgroundApps: () => ClientApp[];
@@ -1 +1 @@
1
- {"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../src/stores/apps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAC,WAAW,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAG9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAA;AAe9C,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,kBAAkB,CAAA;AAMzD,MAAM,WAAW,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