@adminide-stack/yantra-mobile 12.0.182 → 12.0.183-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/contexts/ChatLiveStreamContext.js +2 -1
- package/lib/contexts/ChatLiveStreamContext.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +103 -29
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/MarketplaceGallery.js +494 -0
- package/lib/features/apps/MarketplaceGallery.js.map +1 -0
- package/lib/features/apps/connectorApps.js +75 -0
- package/lib/features/apps/connectorApps.js.map +1 -0
- package/lib/features/apps/galleryExtensions.js +35 -0
- package/lib/features/apps/galleryExtensions.js.map +1 -0
- package/lib/features/apps/mobileAppCatalog.js +5 -1
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/apps/resolveSurfaceUrl.js +5 -3
- package/lib/features/apps/resolveSurfaceUrl.js.map +1 -1
- package/lib/features/apps/useMarketplaceApps.js +176 -0
- package/lib/features/apps/useMarketplaceApps.js.map +1 -0
- package/lib/features/chat/promptText.js +7 -0
- package/lib/features/chat/promptText.js.map +1 -0
- package/lib/features/study/StudyExperience.js +11 -4
- package/lib/features/study/StudyExperience.js.map +1 -1
- package/lib/features/study/components/CellView.js +16 -2
- package/lib/features/study/components/CellView.js.map +1 -1
- package/lib/features/study/components/IntakeCard.js +60 -3
- package/lib/features/study/components/IntakeCard.js.map +1 -1
- package/lib/features/study/components/StudyAppCard.js +169 -0
- package/lib/features/study/components/StudyAppCard.js.map +1 -0
- package/lib/features/study/components/StudySheet.js +2 -1
- package/lib/features/study/components/StudySheet.js.map +1 -1
- package/lib/features/study/studyApps.js +137 -0
- package/lib/features/study/studyApps.js.map +1 -0
- package/lib/features/task-activity/TaskActivityRunner.js +147 -0
- package/lib/features/task-activity/TaskActivityRunner.js.map +1 -0
- package/lib/features/task-activity/taskActivityController.js +116 -0
- package/lib/features/task-activity/taskActivityController.js.map +1 -0
- package/lib/features/task-activity/taskActivityNative.js +13 -0
- package/lib/features/task-activity/taskActivityNative.js.map +1 -0
- package/lib/features/task-activity/taskActivityState.js +59 -0
- package/lib/features/task-activity/taskActivityState.js.map +1 -0
- package/lib/features/task-activity/taskActivitySwitch.js +65 -0
- package/lib/features/task-activity/taskActivitySwitch.js.map +1 -0
- package/lib/features/task-activity/taskLink.js +22 -0
- package/lib/features/task-activity/taskLink.js.map +1 -0
- package/lib/hooks/useChatApi.js +6 -13
- package/lib/hooks/useChatApi.js.map +1 -1
- package/lib/hooks/useChatStream.js +2 -0
- package/lib/hooks/useChatStream.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/screens/Account/index.js +9 -2
- package/lib/screens/Account/index.js.map +1 -1
- package/lib/screens/StudyNative/index.js +16 -2
- package/lib/screens/StudyNative/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connectorApps.js","sources":["../../../src/features/apps/connectorApps.ts"],"sourcesContent":["/**\n * Connector apps on the phone: the whole product surfaces (yantra-connector-apps) an org\n * adds from the marketplace gallery - Word Study, Gmail, Calendar, ...\n *\n * Nothing about them is known at build time. Each one is a marketplace extension that\n * contributes `marketplace.surfaces.<slug>` with `kind: 'connector-app'`, and the settings\n * resolver serves that contribution only to orgs where the extension is enabled - so an\n * app is on this phone exactly when someone added it from the gallery, here or on the web.\n * This is the web shell's `collectSurfaces` (`browser/src/pages/_registry/surfaceContributions`)\n * narrowed to connector apps.\n *\n * On the web an app mounts as a Module Federation remote beside the chat. The phone has no\n * web MF runtime, so it opens the app's standalone page - the same surface origin that serves\n * `remoteEntry.js` also serves the app on its own - in the shared WebView shell, which signs\n * it in with the user's token (`screens/WebBuilder`).\n *\n * Pure: no React, no navigation, so it runs under jest.\n */\nimport type { MobileAppItem } from './mobileAppCatalog';\n\n/** An app this org added from the marketplace, ready to open on the phone. */\nexport interface ConnectorApp {\n /** `marketplace.surfaces` key, e.g. `word-study`. */\n slug: string;\n displayName: string;\n /** One line, shown under the name. */\n description?: string;\n /** Image URL - usually an inline SVG data URI, the manifest travels as-is. */\n icon?: string;\n /** First listing category (`Education`). */\n category?: string;\n /** cdecli connector the app runs on (`yantra-notebook`). */\n connector: string;\n /** The standalone page the WebView opens: the directory `remoteEntry.js` is served from. */\n url: string;\n /**\n * Other screens the listing asks to show the app in (`showIn` in its marketplace.json):\n * `study` puts it in Study. Empty for an app that lives in Apps only.\n */\n showIn: string[];\n}\n\nconst str = (v: unknown): string | undefined => (typeof v === 'string' && v.trim() ? v.trim() : undefined);\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v);\n\n/**\n * The standalone page beside a `remoteEntry.js`: `https://word-study-surface.yantra.app/remoteEntry.js`\n * -> `https://word-study-surface.yantra.app/`. Only http(s): the WebView would hand any other\n * scheme to the OS. Query and hash are dropped - they belong to the entry file, not the page.\n */\nexport function standalonePageOf(remoteEntry: string): string | undefined {\n const match = remoteEntry.trim().match(/^(https?:\\/\\/[^/?#\\s]+)(\\/[^?#\\s]*)?/i);\n if (!match) return undefined;\n const path = (match[2] ?? '/').replace(/[^/]*$/, '');\n return `${match[1]}${path || '/'}`;\n}\n\n/**\n * Unwrap what `useSettings` hands back for `configKey: 'marketplace.surfaces'`: the subtree\n * itself, or the whole settings object around it when the server already returned the\n * subtree as `settings` (see `useMarketplaceTemplateGroups`).\n */\nexport function unwrapSurfacesPayload(payload: unknown): Record<string, unknown> {\n if (!isRecord(payload)) return {};\n const marketplace = payload.marketplace;\n if (isRecord(marketplace) && isRecord(marketplace.surfaces)) return marketplace.surfaces;\n if (isRecord(payload['marketplace.surfaces'])) return payload['marketplace.surfaces'] as Record<string, unknown>;\n if (isRecord(payload.surfaces)) return payload.surfaces;\n return payload;\n}\n\nfunction readConnectorApp(slug: string, info: Record<string, unknown>): ConnectorApp | undefined {\n if (info.kind !== 'connector-app' || info.enabled === false || info.enabled === 'false') return undefined;\n // An app with no connector has nothing to run on, and one with no page cannot open.\n const connector = str(info.connector);\n const remoteEntry = str(info.remoteEntry);\n const url = remoteEntry ? standalonePageOf(remoteEntry) : undefined;\n if (!connector || !url) return undefined;\n const showIn = Array.isArray(info.showIn) ? [...new Set(info.showIn.map(str).filter((s): s is string => !!s))] : [];\n return {\n slug,\n displayName: str(info.displayName) ?? slug,\n description: str(info.description),\n icon: str(info.icon),\n category: str(info.category),\n connector,\n url,\n showIn,\n };\n}\n\n/**\n * Collect the connector apps out of a `marketplace.surfaces` map, sorted by name. Tolerates a\n * flat `{ slug: info }` and one nesting level `{ group: { slug: info } }`, like the web loader.\n */\nexport function collectConnectorApps(payload: unknown): ConnectorApp[] {\n const map = unwrapSurfacesPayload(payload);\n const out = new Map<string, ConnectorApp>();\n const take = (slug: string, info: unknown) => {\n if (!isRecord(info) || typeof info.remoteEntry !== 'string') return false;\n const app = readConnectorApp(slug, info);\n if (app) out.set(slug, app);\n return true;\n };\n for (const [key, value] of Object.entries(map)) {\n if (take(key, value) || !isRecord(value)) continue;\n for (const [childKey, childValue] of Object.entries(value)) take(childKey, childValue);\n }\n return [...out.values()].sort((a, b) => a.displayName.localeCompare(b.displayName));\n}\n\n/** Launcher keys for connector apps live in their own namespace so they never meet a built-in tile. */\nexport const CONNECTOR_APP_KEY_PREFIX = 'connector-app:';\n\n/** A connector app as a launcher tile: opens its standalone page in the WebView shell. */\nexport function connectorAppTile(app: ConnectorApp): MobileAppItem {\n return {\n key: `${CONNECTOR_APP_KEY_PREFIX}${app.slug}`,\n label: app.displayName,\n icon: 'puzzle-outline',\n group: 'Added',\n caption: app.category,\n iconUri: app.icon,\n // Never sent: a tile with a page opens it, the prompt is only the no-page fallback.\n prompt: `Open ${app.displayName}`,\n nativeRoute: 'webbuilder',\n surfaceUrl: app.url,\n };\n}\n\n/**\n * The gallery listing of a connector app is `yantra-app/yantra-<slug>-app`\n * (`extensionName` in yantra-connector-apps `scripts/build-extensions.mjs`).\n */\nconst CONNECTOR_APP_EXTENSION = /^yantra-app\\/yantra-(.+)-app$/;\n\n/**\n * The added app a gallery listing put on the phone, if any: by the publish name first, then\n * by display name for a listing published under another name.\n */\nexport function connectorAppForExtension(\n extension: { extensionSlug?: string | null; displayName?: string | null },\n apps: readonly ConnectorApp[],\n): ConnectorApp | undefined {\n const slug = extension.extensionSlug?.trim().match(CONNECTOR_APP_EXTENSION)?.[1];\n const bySlug = slug ? apps.find((app) => app.slug === slug) : undefined;\n if (bySlug) return bySlug;\n const name = extension.displayName?.trim().toLowerCase();\n return name ? apps.find((app) => app.displayName.toLowerCase() === name) : undefined;\n}\n"],"names":[],"mappings":"AAyCA,MAAM,GAAA,GAAM,CAAC,CAAA,KAAmC,OAAO,CAAA,KAAM,QAAY,IAAA,CAAA,CAAE,IAAK,EAAA,GAAI,CAAE,CAAA,IAAA,EAAS,GAAA,MAAA;AAC/F,MAAM,QAAW,GAAA,CAAC,CAA6C,KAAA,CAAC,CAAC,CAAA,IAAK,OAAO,CAAA,KAAM,QAAY,IAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAOxG,SAAS,iBAAiB,WAAyC,EAAA;AAjD1E,EAAA,IAAA,EAAA;AAkDE,EAAA,MAAM,KAAQ,GAAA,WAAA,CAAY,IAAK,EAAA,CAAE,MAAM,uCAAuC,CAAA;AAC9E,EAAI,IAAA,CAAC,OAAc,OAAA,MAAA;AACnB,EAAM,MAAA,IAAA,GAAA,CAAA,CAAQ,WAAM,CAAC,CAAA,KAAP,YAAY,GAAK,EAAA,OAAA,CAAQ,UAAU,EAAE,CAAA;AACnD,EAAA,OAAO,GAAG,KAAM,CAAA,CAAC,CAAC,CAAA,EAAG,QAAQ,GAAG,CAAA,CAAA;AAClC;AAOO,SAAS,sBAAsB,OAA2C,EAAA;AAC/E,EAAA,IAAI,CAAC,QAAA,CAAS,OAAO,CAAA,SAAU,EAAC;AAChC,EAAA,MAAM,cAAc,OAAQ,CAAA,WAAA;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? void 0 : orgName.trim();
|
|
3
|
+
if (!org) return void 0;
|
|
4
|
+
return {
|
|
5
|
+
scheme: "cdecode",
|
|
6
|
+
authority: "default",
|
|
7
|
+
path: `/${org}`,
|
|
8
|
+
fragment: "settings"
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
const extensionSettingKey = (extensionSlug) => `extensions.${extensionSlug}`;
|
|
12
|
+
const isRecord = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
13
|
+
function unwrapExtensionSettings(payload) {
|
|
14
|
+
if (!isRecord(payload)) return {};
|
|
15
|
+
if (isRecord(payload.extensions)) return payload.extensions;
|
|
16
|
+
if (isRecord(payload.settings)) return unwrapExtensionSettings(payload.settings);
|
|
17
|
+
return payload;
|
|
18
|
+
}
|
|
19
|
+
function isExtensionEnabledForOrg(setting, defaults) {
|
|
20
|
+
if (setting !== void 0 && setting !== null) return setting === true || setting === "true";
|
|
21
|
+
return Boolean((defaults == null ? void 0 : defaults.isBuiltIn) || (defaults == null ? void 0 : defaults.autoEnable));
|
|
22
|
+
}
|
|
23
|
+
function galleryIconUri(...candidates) {
|
|
24
|
+
for (const raw of candidates) {
|
|
25
|
+
const value = raw == null ? void 0 : raw.trim();
|
|
26
|
+
if (value && /^(https?:\/\/|data:image\/)/i.test(value)) return value;
|
|
27
|
+
}
|
|
28
|
+
return void 0;
|
|
29
|
+
}
|
|
30
|
+
function formatInstallCount(count) {
|
|
31
|
+
if (typeof count !== "number" || !Number.isFinite(count) || count <= 0) return void 0;
|
|
32
|
+
if (count < 1e3) return String(Math.round(count));
|
|
33
|
+
if (count < 1e6) return `${(count / 1e3).toFixed(count < 1e4 ? 1 : 0).replace(/\.0$/, "")}K`;
|
|
34
|
+
return `${(count / 1e6).toFixed(1).replace(/\.0$/, "")}M`;
|
|
35
|
+
}export{extensionSettingKey,formatInstallCount,galleryIconUri,isExtensionEnabledForOrg,orgExtensionSettingsUri,unwrapExtensionSettings};//# sourceMappingURL=galleryExtensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"galleryExtensions.js","sources":["../../../src/features/apps/galleryExtensions.ts"],"sourcesContent":["/**\n * The marketplace gallery on the phone - the same listings and the same per-org switch as\n * the web gallery (`@adminide-stack/marketplace-module-browser` GalleryExtensionsContainer),\n * so an app added on the phone is added on the web and the other way round.\n *\n * Adding is a settings write, not an install: the org's `extensions.<publisher/name>` flag\n * at its organization resource. The settings resolver then serves the extension's\n * contributions (for a connector app, its `marketplace.surfaces` entry) to that org.\n *\n * Pure: no React, so it runs under jest.\n */\nimport type { SettingsUriInput } from '../../utils/cdecodeUri';\n\n/**\n * The org's settings resource, exactly as the web gallery builds it\n * (`generateCdecodeUri('default', { organization }, {}, 'settings')`): `/<org>` with no\n * trailing slash, so both write the same document.\n */\nexport function orgExtensionSettingsUri(orgName: string | null | undefined): SettingsUriInput | undefined {\n const org = orgName?.trim();\n if (!org) return undefined;\n return { scheme: 'cdecode', authority: 'default', path: `/${org}`, fragment: 'settings' };\n}\n\n/** The settings key that turns one gallery extension on or off for an org. */\nexport const extensionSettingKey = (extensionSlug: string): string => `extensions.${extensionSlug}`;\n\nconst isRecord = (v: unknown): v is Record<string, unknown> => !!v && typeof v === 'object' && !Array.isArray(v);\n\n/**\n * The `extensions` map out of what `useSettings({ configKey: 'extensions' })` returns: the\n * subtree itself, or the settings object around it. Keys are `publisher/name`, which is why\n * this never goes through a dotted-path lookup.\n */\nexport function unwrapExtensionSettings(payload: unknown): Record<string, unknown> {\n if (!isRecord(payload)) return {};\n if (isRecord(payload.extensions)) return payload.extensions;\n if (isRecord(payload.settings)) return unwrapExtensionSettings(payload.settings);\n return payload;\n}\n\n/** The flags that turn an extension on for an org that never set it either way. */\nexport interface ExtensionEnablementDefaults {\n isBuiltIn?: boolean | null;\n autoEnable?: boolean | null;\n}\n\n/**\n * Whether an org has a gallery extension on - the web's `isExtensionEnabledForOrg`. The\n * org's own setting decides when there is one; otherwise only built-in and auto-enabled\n * extensions are on. An extension the org never added is OFF.\n */\nexport function isExtensionEnabledForOrg(setting: unknown, defaults?: ExtensionEnablementDefaults | null): boolean {\n if (setting !== undefined && setting !== null) return setting === true || setting === 'true';\n return Boolean(defaults?.isBuiltIn || defaults?.autoEnable);\n}\n\n/**\n * A listing's icon as something an image can show: an http(s) or data URI. Gallery icons\n * are sometimes a bare file name from the package (`icon.png`), which the phone cannot load.\n */\nexport function galleryIconUri(...candidates: Array<string | null | undefined>): string | undefined {\n for (const raw of candidates) {\n const value = raw?.trim();\n if (value && /^(https?:\\/\\/|data:image\\/)/i.test(value)) return value;\n }\n return undefined;\n}\n\n/** Install count as the gallery card shows it: 1234 -> 1.2K. */\nexport function formatInstallCount(count: number | null | undefined): string | undefined {\n if (typeof count !== 'number' || !Number.isFinite(count) || count <= 0) return undefined;\n if (count < 1000) return String(Math.round(count));\n if (count < 1_000_000) return `${(count / 1000).toFixed(count < 10_000 ? 1 : 0).replace(/\\.0$/, '')}K`;\n return `${(count / 1_000_000).toFixed(1).replace(/\\.0$/, '')}M`;\n}\n"],"names":[],"mappings":"AAkBO,SAAS,wBAAwB,OAAkE,EAAA;AACxG,EAAA,MAAM,MAAM,OAAS,IAAA,IAAA,GAAA,MAAA,GAAA,OAAA,CAAA,IAAA,EAAA;AACrB,EAAI,IAAA,CAAC,KAAY,OAAA,MAAA;AACjB,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA,SAAA;AAAA,IACR,SAAW,EAAA,SAAA;AAAA,IACX,IAAA,EAAM,IAAI,GAAG,CAAA,CAAA;AAAA,IACb,QAAU,EAAA;AAAA,GACZ;AACF;AAGO,MAAM,mBAAsB,GAAA,CAAC,aAAkC,KAAA,CAAA,WAAA,EAAc,aAAa,CAAA;AACjG,MAAM,QAAW,GAAA,CAAC,CAA6C,KAAA,CAAC,CAAC,CAAA,IAAK,OAAO,CAAA,KAAM,QAAY,IAAA,CAAC,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAOxG,SAAS,wBAAwB,OA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,GAAA,GAAS,IAAI,CAAC,CAAA,CAAE,OAAQ,CAAA,MAAA,EAAQ,EAAE,CAAC,CAAA,CAAA,CAAA;AACnG,EAAO,OAAA,CAAA,EAAA,CAAI,QAAQ,GAAW,EAAA,OAAA,CAAQ,CAAC,CAAE,CAAA,OAAA,CAAQ,MAAQ,EAAA,EAAE,CAAC,CAAA,CAAA,CAAA;AAC9D"}
|
|
@@ -508,7 +508,7 @@ const MOBILE_APP_CATALOG = [
|
|
|
508
508
|
surfaceSlug: "fitness"
|
|
509
509
|
}
|
|
510
510
|
];
|
|
511
|
-
const APP_GROUP_ORDER = ["Create", "Office", "Automate", "Sell", "Money", "Team", "More"];
|
|
511
|
+
const APP_GROUP_ORDER = ["Added", "Create", "Office", "Automate", "Sell", "Money", "Team", "More"];
|
|
512
512
|
const APP_GROUP_ART = {
|
|
513
513
|
Create: {
|
|
514
514
|
base: "#4f46e5",
|
|
@@ -537,6 +537,10 @@ const APP_GROUP_ART = {
|
|
|
537
537
|
More: {
|
|
538
538
|
base: "#be185d",
|
|
539
539
|
glow: "#fbcfe8"
|
|
540
|
+
},
|
|
541
|
+
Added: {
|
|
542
|
+
base: "#0f766e",
|
|
543
|
+
glow: "#99f6e4"
|
|
540
544
|
}
|
|
541
545
|
};
|
|
542
546
|
function matchesAppQuery(label, query) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobileAppCatalog.js","sources":["../../../src/features/apps/mobileAppCatalog.ts"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport type { MaterialCommunityIcons } from '@expo/vector-icons';\n\ntype IconName = ComponentProps<typeof MaterialCommunityIcons>['name'];\n\nexport type AppGroupId = 'Create' | 'Office' | 'Automate' | 'Sell' | 'Money' | 'Team' | 'More';\n\nexport type MobileAppItem = {\n key: string;\n label: string;\n icon: IconName;\n group: AppGroupId;\n /** Prompt sent as the first chat turn when the app has no native screen. */\n prompt: string;\n /**\n * Which surface host opens this app, if it has one. `webbuilder` is the\n * historical name of the shared WebView surface shell (`screens/WebBuilder`),\n * which is not web-builder-specific: it takes a `url` route param, mints the\n * system token, injects the bridge + cdecli token, stamps `embed=mobile` and\n * owns the timeout/retry UI. Anything with a deployed surface SPA can use it.\n */\n nativeRoute?:\n | 'webbuilder'\n | 'canvas-native'\n | 'characters-native'\n | 'chat-native'\n | 'billing-native'\n | 'shopping-native'\n | 'travel-native'\n | 'job-search-native'\n | 'resume-native'\n | 'inbox-native'\n | 'study-native'\n | 'local-services-native'\n | 'movies-native'\n | 'expenses-native'\n | 'dictate-native'\n | 'webbuilder-native'\n | 'design-native'\n | 'games-native'\n | 'computer-native';\n /**\n * Deployed surface SPA for this app, as the `<slug>-surface` name. Resolved\n * against SURFACE_URL_TEMPLATE so one env var covers every surface and stays\n * per-environment, instead of 20+ near-identical URLs in eas.json.\n *\n * The slug is the SURFACE's name, which is not always the tile key\n * (issue-ticket -> issues, shop -> shopping, notebook -> notebooklm).\n */\n surfaceSlug?: string;\n /**\n * Explicit env override, for the surfaces people actually run locally\n * (design 5174, canvas 5175, webbuilder). Wins over `surfaceSlug`.\n */\n surfaceUrlKey?: 'WEB_BUILDER_URL' | 'CANVAS_SURFACE_URL' | 'DESIGN_SURFACE_URL';\n /**\n * Key of the web tile this native tile replaces in every launcher list.\n * The web entry stays in the catalog (deep links, tests, the WebView\n * lane) but users see one tile per app, the native one, under the\n * shared name. Also the key of a retired tile this one took over from\n * (Posters for Paper 2 Poster). Either way a favorite pinned under the\n * old key carries over to this tile.\n */\n supersedes?: string;\n /**\n * Account chrome, not a product app. Stays in the catalog so drawer /\n * deep-link routing still knows the native host, but never appears as\n * a tile in Apps or the Apps menu.\n */\n hideInLauncher?: boolean;\n};\n\n/**\n * Mobile Apps launcher. Labels, groups, and prompts stay in lockstep with the\n * browser ChatTopBar Apps menu (`packages-modules/account/browser`).\n */\nexport const MOBILE_APP_CATALOG: readonly MobileAppItem[] = [\n {\n key: 'design',\n label: 'Design',\n icon: 'palette-outline',\n group: 'Create',\n prompt: 'Design a 10-slide pitch deck for a coffee subscription startup',\n nativeRoute: 'webbuilder',\n surfaceUrlKey: 'DESIGN_SURFACE_URL',\n surfaceSlug: 'design',\n },\n {\n key: 'design-native',\n label: 'Design',\n supersedes: 'design',\n icon: 'palette-outline',\n group: 'Create',\n prompt: 'Design a 10-slide pitch deck for a coffee subscription startup',\n // The native design studio (features/design): templates, saved designs and the\n // editor, drawn natively over the same designs as the web Design Studio. No WebView.\n nativeRoute: 'design-native',\n },\n {\n key: 'canvas',\n label: 'Canvas',\n icon: 'view-grid-outline',\n group: 'Create',\n prompt: 'Open a canvas and help me lay out the assets for this project.',\n nativeRoute: 'webbuilder',\n surfaceUrlKey: 'CANVAS_SURFACE_URL',\n surfaceSlug: 'canvas',\n },\n {\n key: 'canvas-native',\n label: 'Canvas',\n supersedes: 'canvas',\n icon: 'vector-square',\n group: 'Create',\n prompt: 'Open a canvas and help me lay out the assets for this project.',\n // Renders through Module Federation: the viewer downloads from the\n // canvas-surface origin on open. First native surface; the classic\n // Canvas tile keeps the full web editor in the WebView host.\n nativeRoute: 'canvas-native',\n },\n {\n key: 'webbuilder',\n label: 'Web Builder',\n icon: 'application-outline',\n group: 'Create',\n prompt: 'Build a landing page for my bakery with a menu and a contact form',\n nativeRoute: 'webbuilder',\n surfaceUrlKey: 'WEB_BUILDER_URL',\n surfaceSlug: 'webbuilder',\n },\n {\n key: 'webbuilder-native',\n label: 'Web Builder',\n supersedes: 'webbuilder',\n icon: 'application-outline',\n group: 'Create',\n prompt: 'Build a landing page for my bakery with a menu and a contact form',\n // Native web builder over the same projects as the web surface: your sites,\n // build and edit with the agent, live preview, versions, publish.\n nativeRoute: 'webbuilder-native',\n },\n {\n key: 'codezen',\n label: 'Codezen',\n icon: 'code-braces',\n group: 'Create',\n prompt: 'Clone my repository and fix the failing test',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'codezen',\n },\n {\n key: 'character',\n label: 'Characters',\n icon: 'drama-masks',\n group: 'Create',\n prompt: 'Create a stoic philosophy mentor character I can chat with',\n // Native federated experience (gallery -> detail -> chat); the web\n // surface remains reachable through the surface lane if ever needed.\n nativeRoute: 'characters-native',\n surfaceSlug: 'character',\n },\n {\n key: 'characters-native',\n label: 'Characters',\n supersedes: 'character',\n icon: 'account-star',\n group: 'Create',\n prompt: 'Show me characters I can chat with.',\n nativeRoute: 'characters-native',\n surfaceSlug: 'character',\n },\n // Word, Excel, PowerPoint and PDF files, pictures, interface designs, research posters and animations,\n // each in its own browser editor (yantra-office).\n {\n key: 'word',\n label: 'Documents',\n icon: 'file-document-outline',\n group: 'Office',\n prompt: 'Write a one-page project proposal as a Word document',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'word',\n },\n {\n key: 'excel',\n label: 'Spreadsheets',\n icon: 'file-table-outline',\n group: 'Office',\n prompt: 'Make a monthly budget spreadsheet with totals and a chart',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'excel',\n },\n {\n key: 'presentation',\n label: 'Presentations',\n icon: 'presentation',\n group: 'Office',\n prompt: 'Turn my notes into a six-slide project update deck',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'presentation',\n },\n {\n key: 'pdf',\n label: 'PDFs',\n icon: 'file-pdf-box',\n group: 'Office',\n prompt: 'Make a one-page PDF checklist for moving house',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'pdf',\n },\n {\n key: 'photo',\n label: 'Photos',\n icon: 'image-edit-outline',\n group: 'Office',\n prompt: 'Make an Instagram post from a template with our spring sale headline',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'photo',\n },\n {\n key: 'figdesign',\n label: 'FigDesign',\n // The pen tool, not Design's palette or Canvas's vector-square: Design is AI web-design\n // boards and Canvas is media, this is the interface design editor.\n icon: 'fountain-pen-tip',\n group: 'Office',\n prompt: 'Start a mobile app design for my bakery in our brand green, with Light and Dark modes',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'figdesign',\n },\n {\n key: 'poster',\n label: 'Posters',\n // A printed sheet with a headline over its text, as on the web launcher, not\n // Presentations' easel: a poster is one big page, not a deck.\n icon: 'post-outline',\n group: 'Office',\n prompt: 'Turn this research paper into a 48 x 36 inch conference poster I can edit and print.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'poster',\n // Posters replaced Paper 2 Poster: a tile pinned under the old key stays pinned.\n supersedes: 'paper2poster',\n },\n {\n key: 'motion',\n label: 'Motion',\n // Frames playing in sequence, not Clips' or Remix's film: an animation, not a video library.\n icon: 'animation-play-outline',\n group: 'Office',\n prompt: 'Make an animated title card that says Summer Sale and render it as an MP4',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'motion',\n },\n {\n key: 'chat-native',\n label: 'Chats',\n icon: 'message-text-outline',\n group: 'Team',\n prompt: 'Show me my conversations.',\n // Person-to-person messaging, federated like canvas: the whole UI\n // downloads from the chat-native surface on open. Not the AI chat -\n // that is the Home tab.\n nativeRoute: 'chat-native',\n },\n {\n key: 'workflow',\n label: 'Workflow',\n icon: 'sitemap',\n group: 'Automate',\n prompt: 'Build a workflow that runs every morning and sends me a summary of what changed.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'workflow',\n },\n {\n key: 'computer',\n label: 'Computer',\n icon: 'monitor',\n group: 'Automate',\n prompt: 'Open a browser and compare the top 5 CRM tools with screenshots',\n // The person's cloud workspace, native: its live browser (watch, take\n // control), shell, files and the agent that drives them. Without this the\n // tile fell through to the chat shim and only sent its prompt to a chat.\n nativeRoute: 'computer-native',\n surfaceSlug: 'computer',\n },\n {\n key: 'crm',\n label: 'CRM',\n icon: 'account-group-outline',\n group: 'Sell',\n prompt: 'Look at my pipeline and tell me which deals are going cold and what I should send them.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'crm',\n },\n {\n key: 'salesiq',\n label: 'SalesIQ',\n icon: 'radar',\n group: 'Sell',\n prompt: 'Show me who is on my website right now',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'salesiq',\n },\n {\n key: 'inbox',\n label: 'Inbox',\n icon: 'inbox-outline',\n group: 'Sell',\n prompt: 'Go through my inbox, tell me what actually needs a reply, and draft those replies.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'inbox',\n },\n {\n key: 'inbox-native',\n label: 'Inbox',\n supersedes: 'inbox',\n icon: 'inbox-outline',\n group: 'Sell',\n prompt: 'Go through my inbox, tell me what actually needs a reply, and draft those replies.',\n // Native mail client over the same yantra-mailer store as the web Inbox.\n nativeRoute: 'inbox-native',\n },\n {\n key: 'mailcampaign',\n label: 'Mail Campaigns',\n icon: 'bullhorn-outline',\n group: 'Sell',\n prompt: 'Draft an email campaign announcing what we shipped this month.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'mailcampaign',\n },\n {\n key: 'smscampaign',\n label: 'SMS Campaigns',\n icon: 'message-text-outline',\n group: 'Sell',\n prompt: \"Text my customers a short reminder about this week's offer.\",\n nativeRoute: 'webbuilder',\n surfaceSlug: 'smscampaign',\n },\n {\n key: 'social-post',\n label: 'Social Posts',\n icon: 'send-outline',\n group: 'Sell',\n prompt: 'Draft a launch post for X and LinkedIn and schedule it for Tuesday morning.',\n nativeRoute: 'webbuilder',\n // The deployed surface is `posts-surface`, not `social-post-surface`.\n surfaceSlug: 'posts',\n },\n {\n key: 'invoices',\n label: 'Invoices',\n icon: 'cash-check',\n group: 'Money',\n prompt: 'Show me which invoices are still unpaid.',\n // The served Invoices surface (yantra-surface packages/invoices) in the shared WebView.\n nativeRoute: 'webbuilder',\n surfaceSlug: 'invoices',\n },\n {\n key: 'expenses',\n label: 'Expenses',\n icon: 'receipt',\n group: 'Money',\n prompt: 'Summarise my spend this month and flag anything unusual.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'expenses',\n },\n {\n key: 'expenses-native',\n label: 'Expenses',\n supersedes: 'expenses',\n icon: 'receipt',\n group: 'Money',\n prompt: 'Summarise my spend this month and flag anything unusual.',\n // Native expenses over the same expenses subgraph as the web app: scan receipts,\n // approvals, budgets, recurring payments, accounts.\n nativeRoute: 'expenses-native',\n },\n {\n key: 'dictate-native',\n label: 'Dictate',\n icon: 'microphone-outline',\n group: 'Office',\n prompt: 'Turn what I say into notes: a class, a meeting, an idea or a patient visit.',\n // Anyone speaks - a class, a meeting, an idea, a story, a visit - and gets the notes that fit it.\n nativeRoute: 'dictate-native',\n },\n {\n key: 'games-native',\n label: 'Games',\n icon: 'cube-outline',\n group: 'Create',\n prompt: 'Open Cubeforge - gather, craft and build to survive in a 3D world.',\n // Yantra Games is Cubeforge in 3D: the native engine, in-binary (a local world, no backend).\n nativeRoute: 'games-native',\n },\n {\n key: 'cards-wallet',\n label: 'Cards & Wallet',\n icon: 'credit-card-outline',\n group: 'Money',\n prompt: 'Issue a $200 virtual card for monthly ad spend',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'cards-wallet',\n },\n {\n key: 'billing',\n label: 'Billing',\n icon: 'currency-usd',\n group: 'Money',\n prompt: 'Create an invoice for a $2,400 consulting project',\n nativeRoute: 'billing-native',\n surfaceSlug: 'billing',\n // Plan / subscription for this account — already in the drawer.\n hideInLauncher: true,\n },\n {\n key: 'kpi-motivation',\n label: 'KPI Motivation',\n icon: 'trophy-outline',\n group: 'Team',\n prompt: 'Set up a weekly sales KPI scoreboard for my team',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'kpi-motivation',\n },\n {\n key: 'issue-ticket',\n label: 'Issue Ticket',\n icon: 'bug-outline',\n group: 'Team',\n prompt: 'Create a bug board and triage my open issues',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'issues',\n },\n {\n key: 'notebook',\n label: 'Study',\n icon: 'school-outline',\n group: 'Team',\n prompt: 'Make a study guide from my lecture notes',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'notebooklm',\n },\n {\n key: 'study-native',\n label: 'Study',\n supersedes: 'notebook',\n icon: 'school-outline',\n group: 'Team',\n prompt: 'Make a study guide from my lecture notes',\n // Native study notebooks over the same yantra-notebook store as the web Study.\n nativeRoute: 'study-native',\n },\n {\n key: 'resume',\n label: 'Resume',\n icon: 'file-account-outline',\n group: 'Team',\n prompt: 'Draft a resume for a senior product designer with 8 years of experience',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'resume',\n },\n {\n key: 'resume-native',\n label: 'Resume',\n supersedes: 'resume',\n icon: 'file-account-outline',\n group: 'Team',\n prompt: 'Draft a resume for a senior product designer with 8 years of experience',\n nativeRoute: 'resume-native',\n },\n {\n key: 'job-search',\n label: 'Job Search',\n icon: 'briefcase-outline',\n group: 'Team',\n prompt: 'Find remote senior backend engineer roles and tailor my resume for one',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'job-search',\n },\n {\n key: 'job-search-native',\n label: 'Job Search',\n supersedes: 'job-search',\n icon: 'briefcase-search-outline',\n group: 'Team',\n prompt: 'Find remote senior backend engineer roles and tailor my resume for one',\n nativeRoute: 'job-search-native',\n },\n {\n key: 'shop',\n label: 'Shop',\n icon: 'cart-outline',\n group: 'More',\n prompt: 'Compare the best options for what I need and show me the tradeoffs.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'shopping',\n },\n {\n key: 'shopping-native',\n label: 'Shop',\n supersedes: 'shop',\n icon: 'storefront-outline',\n group: 'More',\n prompt: 'Compare the best options for what I need and show me the tradeoffs.',\n // Federated storefront: search + cart download from shopping_native/Shop.\n // The classic Shop tile keeps the web surface in the WebView host.\n nativeRoute: 'shopping-native',\n },\n {\n key: 'travel-native',\n label: 'Travel',\n supersedes: 'travel',\n icon: 'airplane-takeoff',\n group: 'More',\n prompt: 'Plan a 4-day trip for me: flights, somewhere to stay, and what to do each day.',\n nativeRoute: 'travel-native',\n },\n {\n key: 'travel',\n label: 'Travel',\n icon: 'airplane',\n group: 'More',\n prompt: 'Plan a 4-day trip for me: flights, somewhere to stay, and what to do each day.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'travel',\n },\n {\n key: 'social-events',\n label: 'yantra.live',\n icon: 'ticket-outline',\n group: 'More',\n prompt: 'What concerts are happening nearby this weekend?',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'social-events',\n },\n {\n key: 'movies',\n label: 'Movies',\n icon: 'popcorn',\n group: 'More',\n prompt: 'What movies are playing near me tonight?',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'movies',\n },\n {\n key: 'movies-native',\n label: 'Movies',\n supersedes: 'movies',\n icon: 'popcorn',\n group: 'More',\n prompt: 'What movies are playing near me tonight?',\n // Native cinema app over the yantra-movies connector: discover, trailers, showtimes, watchlist.\n nativeRoute: 'movies-native',\n },\n {\n key: 'local-services',\n label: 'Local Services',\n icon: 'wrench',\n group: 'More',\n prompt: 'Find an electrician near me',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'local-services',\n },\n {\n key: 'local-services-native',\n label: 'Local Services',\n supersedes: 'local-services',\n icon: 'wrench',\n group: 'More',\n prompt: 'Find an electrician near me',\n // Native search, details and saved pros over the same yantra-local-services\n // connector as the web Local Services surface.\n nativeRoute: 'local-services-native',\n },\n {\n key: 'fitness',\n label: 'Fitness',\n icon: 'dumbbell',\n group: 'More',\n prompt: 'Build me a workout plan for this week',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'fitness',\n },\n];\n\nexport const APP_GROUP_ORDER: readonly AppGroupId[] = ['Create', 'Office', 'Automate', 'Sell', 'Money', 'Team', 'More'];\n\nexport type AppsTab = 'all' | 'favorites';\n\n/**\n * Poster colors per group - the tile artwork. Deliberately the same in light\n * and dark themes: artwork is content, the card chrome is what adapts.\n */\nexport const APP_GROUP_ART: Record<AppGroupId, { base: string; glow: string }> = {\n Create: { base: '#4f46e5', glow: '#c4b5fd' },\n Office: { base: '#334155', glow: '#cbd5e1' },\n Automate: { base: '#0f766e', glow: '#99f6e4' },\n Sell: { base: '#c2410c', glow: '#fed7aa' },\n Money: { base: '#15803d', glow: '#bbf7d0' },\n Team: { base: '#0369a1', glow: '#bae6fd' },\n More: { base: '#be185d', glow: '#fbcfe8' },\n};\n\nexport function matchesAppQuery(label: string, query: string): boolean {\n const q = query.toLowerCase().replace(/[^a-z0-9]/g, '');\n if (!q) return true;\n return label\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '')\n .includes(q);\n}\n\n/**\n * Favorites keyed by a web tile that a native tile now replaces, carried over to\n * the native tile, so pinning \"Inbox\" before it went native still pins it after.\n */\nexport function carryOverSupersededFavorites(\n favorites: ReadonlySet<string>,\n items: readonly MobileAppItem[] = MOBILE_APP_CATALOG,\n): Set<string> {\n const replacement = new Map<string, string>();\n for (const item of items) if (item.supersedes) replacement.set(item.supersedes, item.key);\n const out = new Set<string>();\n for (const key of favorites) out.add(replacement.get(key) ?? key);\n return out;\n}\n\n/** One tile per app: a web tile disappears when its native replacement is in the list. */\nexport function visibleMobileApps(items: readonly MobileAppItem[]): MobileAppItem[] {\n const replaced = new Set(items.map((item) => item.supersedes).filter(Boolean));\n return items.filter((item) => !item.hideInLauncher && !replaced.has(item.key));\n}\n\nexport function groupMobileApps(items: readonly MobileAppItem[], query: string) {\n const hits = visibleMobileApps(items).filter((item) => matchesAppQuery(item.label, query));\n return APP_GROUP_ORDER.map((label) => ({\n label,\n items: hits.filter((item) => item.group === label),\n })).filter((group) => group.items.length > 0);\n}\n\n/**\n * One flat grid (Manus/game-launcher style) instead of grouped sections: rows\n * stay dense and the group reads from each card's caption. Catalog order is\n * kept inside a group; groups follow APP_GROUP_ORDER.\n */\nexport function filterMobileApps(\n items: readonly MobileAppItem[],\n query: string,\n tab: AppsTab,\n favorites: ReadonlySet<string>,\n): MobileAppItem[] {\n const rank = new Map(APP_GROUP_ORDER.map((group, index) => [group, index]));\n return visibleMobileApps(items)\n .filter((item) => matchesAppQuery(item.label, query))\n .filter((item) => tab !== 'favorites' || favorites.has(item.key))\n .sort((a, b) => (rank.get(a.group) ?? APP_GROUP_ORDER.length) - (rank.get(b.group) ?? APP_GROUP_ORDER.length));\n}\n"],"names":[],"mappings":"AAsDO,MAAM,kBAA+C,GAAA;AAAA,EAAC;AAAA,IAC3D,GAAK,EAAA,QAAA;AAAA,IACL,KAAO,EAAA,QAAA;AAAA,IACP,IAA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CAAM,MAAO,CAAA,CAAA,IAAA,KAAQ,CAAC,IAAA,CAAK,cAAkB,IAAA,CAAC,QAAS,CAAA,GAAA,CAAI,IAAK,CAAA,GAAG,CAAC,CAAA;AAC7E;AAcO,SAAS,gBAAiB,CAAA,KAAA,EAAiC,KAAe,EAAA,GAAA,EAAc,SAAiD,EAAA;AAC9I,EAAA,MAAM,IAAO,GAAA,IAAI,GAAI,CAAA,eAAA,CAAgB,GAAI,CAAA,CAAC,KAAO,EAAA,KAAA,KAAU,CAAC,KAAA,EAAO,KAAK,CAAC,CAAC,CAAA;AAC1E,EAAO,OAAA,iBAAA,CAAkB,KAAK,CAAA,CAAE,MAAO,CAAA,CAAA,IAAA,KAAQ,gBAAgB,IAAK,CAAA,KAAA,EAAO,KAAK,CAAC,CAAE,CAAA,MAAA,CAAO,UAAQ,GAAQ,KAAA,WAAA,IAAe,SAAU,CAAA,GAAA,CAAI,IAAK,CAAA,GAAG,CAAC,CAAE,CAAA,IAAA,CAAK,CAAC,CAAA,EAAG,CAAG,KAAA;AA9kBhK,IAAA,IAAA,EAAA,EAAA,EAAA;AA8kBoK,IAAA,OAAA,CAAA,CAAA,EAAA,GAAA,IAAA,CAAK,GAAI,CAAA,CAAA,CAAE,KAAK,CAAA,KAAhB,IAAqB,GAAA,EAAA,GAAA,eAAA,CAAgB,MAAW,KAAA,CAAA,EAAA,GAAA,IAAA,CAAK,GAAI,CAAA,CAAA,CAAE,KAAK,CAAA,KAAhB,YAAqB,eAAgB,CAAA,MAAA,CAAA;AAAA,GAAO,CAAA;AAChQ"}
|
|
1
|
+
{"version":3,"file":"mobileAppCatalog.js","sources":["../../../src/features/apps/mobileAppCatalog.ts"],"sourcesContent":["import type { ComponentProps } from 'react';\nimport type { MaterialCommunityIcons } from '@expo/vector-icons';\n\ntype IconName = ComponentProps<typeof MaterialCommunityIcons>['name'];\n\n/** `Added` holds the apps this org added from the marketplace (see ./connectorApps). */\nexport type AppGroupId = 'Added' | 'Create' | 'Office' | 'Automate' | 'Sell' | 'Money' | 'Team' | 'More';\n\nexport type MobileAppItem = {\n key: string;\n label: string;\n icon: IconName;\n group: AppGroupId;\n /** Prompt sent as the first chat turn when the app has no native screen. */\n prompt: string;\n /**\n * Which surface host opens this app, if it has one. `webbuilder` is the\n * historical name of the shared WebView surface shell (`screens/WebBuilder`),\n * which is not web-builder-specific: it takes a `url` route param, mints the\n * system token, injects the bridge + cdecli token, stamps `embed=mobile` and\n * owns the timeout/retry UI. Anything with a deployed surface SPA can use it.\n */\n nativeRoute?:\n | 'webbuilder'\n | 'canvas-native'\n | 'characters-native'\n | 'chat-native'\n | 'billing-native'\n | 'shopping-native'\n | 'travel-native'\n | 'job-search-native'\n | 'resume-native'\n | 'inbox-native'\n | 'study-native'\n | 'local-services-native'\n | 'movies-native'\n | 'expenses-native'\n | 'dictate-native'\n | 'webbuilder-native'\n | 'design-native'\n | 'games-native'\n | 'computer-native';\n /**\n * Deployed surface SPA for this app, as the `<slug>-surface` name. Resolved\n * against SURFACE_URL_TEMPLATE so one env var covers every surface and stays\n * per-environment, instead of 20+ near-identical URLs in eas.json.\n *\n * The slug is the SURFACE's name, which is not always the tile key\n * (issue-ticket -> issues, shop -> shopping, notebook -> notebooklm).\n */\n surfaceSlug?: string;\n /**\n * Explicit env override, for the surfaces people actually run locally\n * (design 5174, canvas 5175, webbuilder). Wins over `surfaceSlug`.\n */\n surfaceUrlKey?: 'WEB_BUILDER_URL' | 'CANVAS_SURFACE_URL' | 'DESIGN_SURFACE_URL';\n /**\n * The page itself, for a tile that is not in this catalog: an app added from the\n * marketplace carries its own surface origin. Wins over `surfaceUrlKey` and `surfaceSlug`.\n */\n surfaceUrl?: string;\n /** Tile artwork from a URL (a marketplace app's own icon), drawn over the group poster. */\n iconUri?: string;\n /** Caption under the name instead of the group (a marketplace app's category). */\n caption?: string;\n /**\n * Key of the web tile this native tile replaces in every launcher list.\n * The web entry stays in the catalog (deep links, tests, the WebView\n * lane) but users see one tile per app, the native one, under the\n * shared name. Also the key of a retired tile this one took over from\n * (Posters for Paper 2 Poster). Either way a favorite pinned under the\n * old key carries over to this tile.\n */\n supersedes?: string;\n /**\n * Account chrome, not a product app. Stays in the catalog so drawer /\n * deep-link routing still knows the native host, but never appears as\n * a tile in Apps or the Apps menu.\n */\n hideInLauncher?: boolean;\n};\n\n/**\n * Mobile Apps launcher. Labels, groups, and prompts stay in lockstep with the\n * browser ChatTopBar Apps menu (`packages-modules/account/browser`).\n */\nexport const MOBILE_APP_CATALOG: readonly MobileAppItem[] = [\n {\n key: 'design',\n label: 'Design',\n icon: 'palette-outline',\n group: 'Create',\n prompt: 'Design a 10-slide pitch deck for a coffee subscription startup',\n nativeRoute: 'webbuilder',\n surfaceUrlKey: 'DESIGN_SURFACE_URL',\n surfaceSlug: 'design',\n },\n {\n key: 'design-native',\n label: 'Design',\n supersedes: 'design',\n icon: 'palette-outline',\n group: 'Create',\n prompt: 'Design a 10-slide pitch deck for a coffee subscription startup',\n // The native design studio (features/design): templates, saved designs and the\n // editor, drawn natively over the same designs as the web Design Studio. No WebView.\n nativeRoute: 'design-native',\n },\n {\n key: 'canvas',\n label: 'Canvas',\n icon: 'view-grid-outline',\n group: 'Create',\n prompt: 'Open a canvas and help me lay out the assets for this project.',\n nativeRoute: 'webbuilder',\n surfaceUrlKey: 'CANVAS_SURFACE_URL',\n surfaceSlug: 'canvas',\n },\n {\n key: 'canvas-native',\n label: 'Canvas',\n supersedes: 'canvas',\n icon: 'vector-square',\n group: 'Create',\n prompt: 'Open a canvas and help me lay out the assets for this project.',\n // Renders through Module Federation: the viewer downloads from the\n // canvas-surface origin on open. First native surface; the classic\n // Canvas tile keeps the full web editor in the WebView host.\n nativeRoute: 'canvas-native',\n },\n {\n key: 'webbuilder',\n label: 'Web Builder',\n icon: 'application-outline',\n group: 'Create',\n prompt: 'Build a landing page for my bakery with a menu and a contact form',\n nativeRoute: 'webbuilder',\n surfaceUrlKey: 'WEB_BUILDER_URL',\n surfaceSlug: 'webbuilder',\n },\n {\n key: 'webbuilder-native',\n label: 'Web Builder',\n supersedes: 'webbuilder',\n icon: 'application-outline',\n group: 'Create',\n prompt: 'Build a landing page for my bakery with a menu and a contact form',\n // Native web builder over the same projects as the web surface: your sites,\n // build and edit with the agent, live preview, versions, publish.\n nativeRoute: 'webbuilder-native',\n },\n {\n key: 'codezen',\n label: 'Codezen',\n icon: 'code-braces',\n group: 'Create',\n prompt: 'Clone my repository and fix the failing test',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'codezen',\n },\n {\n key: 'character',\n label: 'Characters',\n icon: 'drama-masks',\n group: 'Create',\n prompt: 'Create a stoic philosophy mentor character I can chat with',\n // Native federated experience (gallery -> detail -> chat); the web\n // surface remains reachable through the surface lane if ever needed.\n nativeRoute: 'characters-native',\n surfaceSlug: 'character',\n },\n {\n key: 'characters-native',\n label: 'Characters',\n supersedes: 'character',\n icon: 'account-star',\n group: 'Create',\n prompt: 'Show me characters I can chat with.',\n nativeRoute: 'characters-native',\n surfaceSlug: 'character',\n },\n // Word, Excel, PowerPoint and PDF files, pictures, interface designs, research posters and animations,\n // each in its own browser editor (yantra-office).\n {\n key: 'word',\n label: 'Documents',\n icon: 'file-document-outline',\n group: 'Office',\n prompt: 'Write a one-page project proposal as a Word document',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'word',\n },\n {\n key: 'excel',\n label: 'Spreadsheets',\n icon: 'file-table-outline',\n group: 'Office',\n prompt: 'Make a monthly budget spreadsheet with totals and a chart',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'excel',\n },\n {\n key: 'presentation',\n label: 'Presentations',\n icon: 'presentation',\n group: 'Office',\n prompt: 'Turn my notes into a six-slide project update deck',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'presentation',\n },\n {\n key: 'pdf',\n label: 'PDFs',\n icon: 'file-pdf-box',\n group: 'Office',\n prompt: 'Make a one-page PDF checklist for moving house',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'pdf',\n },\n {\n key: 'photo',\n label: 'Photos',\n icon: 'image-edit-outline',\n group: 'Office',\n prompt: 'Make an Instagram post from a template with our spring sale headline',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'photo',\n },\n {\n key: 'figdesign',\n label: 'FigDesign',\n // The pen tool, not Design's palette or Canvas's vector-square: Design is AI web-design\n // boards and Canvas is media, this is the interface design editor.\n icon: 'fountain-pen-tip',\n group: 'Office',\n prompt: 'Start a mobile app design for my bakery in our brand green, with Light and Dark modes',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'figdesign',\n },\n {\n key: 'poster',\n label: 'Posters',\n // A printed sheet with a headline over its text, as on the web launcher, not\n // Presentations' easel: a poster is one big page, not a deck.\n icon: 'post-outline',\n group: 'Office',\n prompt: 'Turn this research paper into a 48 x 36 inch conference poster I can edit and print.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'poster',\n // Posters replaced Paper 2 Poster: a tile pinned under the old key stays pinned.\n supersedes: 'paper2poster',\n },\n {\n key: 'motion',\n label: 'Motion',\n // Frames playing in sequence, not Clips' or Remix's film: an animation, not a video library.\n icon: 'animation-play-outline',\n group: 'Office',\n prompt: 'Make an animated title card that says Summer Sale and render it as an MP4',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'motion',\n },\n {\n key: 'chat-native',\n label: 'Chats',\n icon: 'message-text-outline',\n group: 'Team',\n prompt: 'Show me my conversations.',\n // Person-to-person messaging, federated like canvas: the whole UI\n // downloads from the chat-native surface on open. Not the AI chat -\n // that is the Home tab.\n nativeRoute: 'chat-native',\n },\n {\n key: 'workflow',\n label: 'Workflow',\n icon: 'sitemap',\n group: 'Automate',\n prompt: 'Build a workflow that runs every morning and sends me a summary of what changed.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'workflow',\n },\n {\n key: 'computer',\n label: 'Computer',\n icon: 'monitor',\n group: 'Automate',\n prompt: 'Open a browser and compare the top 5 CRM tools with screenshots',\n // The person's cloud workspace, native: its live browser (watch, take\n // control), shell, files and the agent that drives them. Without this the\n // tile fell through to the chat shim and only sent its prompt to a chat.\n nativeRoute: 'computer-native',\n surfaceSlug: 'computer',\n },\n {\n key: 'crm',\n label: 'CRM',\n icon: 'account-group-outline',\n group: 'Sell',\n prompt: 'Look at my pipeline and tell me which deals are going cold and what I should send them.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'crm',\n },\n {\n key: 'salesiq',\n label: 'SalesIQ',\n icon: 'radar',\n group: 'Sell',\n prompt: 'Show me who is on my website right now',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'salesiq',\n },\n {\n key: 'inbox',\n label: 'Inbox',\n icon: 'inbox-outline',\n group: 'Sell',\n prompt: 'Go through my inbox, tell me what actually needs a reply, and draft those replies.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'inbox',\n },\n {\n key: 'inbox-native',\n label: 'Inbox',\n supersedes: 'inbox',\n icon: 'inbox-outline',\n group: 'Sell',\n prompt: 'Go through my inbox, tell me what actually needs a reply, and draft those replies.',\n // Native mail client over the same yantra-mailer store as the web Inbox.\n nativeRoute: 'inbox-native',\n },\n {\n key: 'mailcampaign',\n label: 'Mail Campaigns',\n icon: 'bullhorn-outline',\n group: 'Sell',\n prompt: 'Draft an email campaign announcing what we shipped this month.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'mailcampaign',\n },\n {\n key: 'smscampaign',\n label: 'SMS Campaigns',\n icon: 'message-text-outline',\n group: 'Sell',\n prompt: \"Text my customers a short reminder about this week's offer.\",\n nativeRoute: 'webbuilder',\n surfaceSlug: 'smscampaign',\n },\n {\n key: 'social-post',\n label: 'Social Posts',\n icon: 'send-outline',\n group: 'Sell',\n prompt: 'Draft a launch post for X and LinkedIn and schedule it for Tuesday morning.',\n nativeRoute: 'webbuilder',\n // The deployed surface is `posts-surface`, not `social-post-surface`.\n surfaceSlug: 'posts',\n },\n {\n key: 'invoices',\n label: 'Invoices',\n icon: 'cash-check',\n group: 'Money',\n prompt: 'Show me which invoices are still unpaid.',\n // The served Invoices surface (yantra-surface packages/invoices) in the shared WebView.\n nativeRoute: 'webbuilder',\n surfaceSlug: 'invoices',\n },\n {\n key: 'expenses',\n label: 'Expenses',\n icon: 'receipt',\n group: 'Money',\n prompt: 'Summarise my spend this month and flag anything unusual.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'expenses',\n },\n {\n key: 'expenses-native',\n label: 'Expenses',\n supersedes: 'expenses',\n icon: 'receipt',\n group: 'Money',\n prompt: 'Summarise my spend this month and flag anything unusual.',\n // Native expenses over the same expenses subgraph as the web app: scan receipts,\n // approvals, budgets, recurring payments, accounts.\n nativeRoute: 'expenses-native',\n },\n {\n key: 'dictate-native',\n label: 'Dictate',\n icon: 'microphone-outline',\n group: 'Office',\n prompt: 'Turn what I say into notes: a class, a meeting, an idea or a patient visit.',\n // Anyone speaks - a class, a meeting, an idea, a story, a visit - and gets the notes that fit it.\n nativeRoute: 'dictate-native',\n },\n {\n key: 'games-native',\n label: 'Games',\n icon: 'cube-outline',\n group: 'Create',\n prompt: 'Open Cubeforge - gather, craft and build to survive in a 3D world.',\n // Yantra Games is Cubeforge in 3D: the native engine, in-binary (a local world, no backend).\n nativeRoute: 'games-native',\n },\n {\n key: 'cards-wallet',\n label: 'Cards & Wallet',\n icon: 'credit-card-outline',\n group: 'Money',\n prompt: 'Issue a $200 virtual card for monthly ad spend',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'cards-wallet',\n },\n {\n key: 'billing',\n label: 'Billing',\n icon: 'currency-usd',\n group: 'Money',\n prompt: 'Create an invoice for a $2,400 consulting project',\n nativeRoute: 'billing-native',\n surfaceSlug: 'billing',\n // Plan / subscription for this account — already in the drawer.\n hideInLauncher: true,\n },\n {\n key: 'kpi-motivation',\n label: 'KPI Motivation',\n icon: 'trophy-outline',\n group: 'Team',\n prompt: 'Set up a weekly sales KPI scoreboard for my team',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'kpi-motivation',\n },\n {\n key: 'issue-ticket',\n label: 'Issue Ticket',\n icon: 'bug-outline',\n group: 'Team',\n prompt: 'Create a bug board and triage my open issues',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'issues',\n },\n {\n key: 'notebook',\n label: 'Study',\n icon: 'school-outline',\n group: 'Team',\n prompt: 'Make a study guide from my lecture notes',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'notebooklm',\n },\n {\n key: 'study-native',\n label: 'Study',\n supersedes: 'notebook',\n icon: 'school-outline',\n group: 'Team',\n prompt: 'Make a study guide from my lecture notes',\n // Native study notebooks over the same yantra-notebook store as the web Study.\n nativeRoute: 'study-native',\n },\n {\n key: 'resume',\n label: 'Resume',\n icon: 'file-account-outline',\n group: 'Team',\n prompt: 'Draft a resume for a senior product designer with 8 years of experience',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'resume',\n },\n {\n key: 'resume-native',\n label: 'Resume',\n supersedes: 'resume',\n icon: 'file-account-outline',\n group: 'Team',\n prompt: 'Draft a resume for a senior product designer with 8 years of experience',\n nativeRoute: 'resume-native',\n },\n {\n key: 'job-search',\n label: 'Job Search',\n icon: 'briefcase-outline',\n group: 'Team',\n prompt: 'Find remote senior backend engineer roles and tailor my resume for one',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'job-search',\n },\n {\n key: 'job-search-native',\n label: 'Job Search',\n supersedes: 'job-search',\n icon: 'briefcase-search-outline',\n group: 'Team',\n prompt: 'Find remote senior backend engineer roles and tailor my resume for one',\n nativeRoute: 'job-search-native',\n },\n {\n key: 'shop',\n label: 'Shop',\n icon: 'cart-outline',\n group: 'More',\n prompt: 'Compare the best options for what I need and show me the tradeoffs.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'shopping',\n },\n {\n key: 'shopping-native',\n label: 'Shop',\n supersedes: 'shop',\n icon: 'storefront-outline',\n group: 'More',\n prompt: 'Compare the best options for what I need and show me the tradeoffs.',\n // Federated storefront: search + cart download from shopping_native/Shop.\n // The classic Shop tile keeps the web surface in the WebView host.\n nativeRoute: 'shopping-native',\n },\n {\n key: 'travel-native',\n label: 'Travel',\n supersedes: 'travel',\n icon: 'airplane-takeoff',\n group: 'More',\n prompt: 'Plan a 4-day trip for me: flights, somewhere to stay, and what to do each day.',\n nativeRoute: 'travel-native',\n },\n {\n key: 'travel',\n label: 'Travel',\n icon: 'airplane',\n group: 'More',\n prompt: 'Plan a 4-day trip for me: flights, somewhere to stay, and what to do each day.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'travel',\n },\n {\n key: 'social-events',\n label: 'yantra.live',\n icon: 'ticket-outline',\n group: 'More',\n prompt: 'What concerts are happening nearby this weekend?',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'social-events',\n },\n {\n key: 'movies',\n label: 'Movies',\n icon: 'popcorn',\n group: 'More',\n prompt: 'What movies are playing near me tonight?',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'movies',\n },\n {\n key: 'movies-native',\n label: 'Movies',\n supersedes: 'movies',\n icon: 'popcorn',\n group: 'More',\n prompt: 'What movies are playing near me tonight?',\n // Native cinema app over the yantra-movies connector: discover, trailers, showtimes, watchlist.\n nativeRoute: 'movies-native',\n },\n {\n key: 'local-services',\n label: 'Local Services',\n icon: 'wrench',\n group: 'More',\n prompt: 'Find an electrician near me',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'local-services',\n },\n {\n key: 'local-services-native',\n label: 'Local Services',\n supersedes: 'local-services',\n icon: 'wrench',\n group: 'More',\n prompt: 'Find an electrician near me',\n // Native search, details and saved pros over the same yantra-local-services\n // connector as the web Local Services surface.\n nativeRoute: 'local-services-native',\n },\n {\n key: 'fitness',\n label: 'Fitness',\n icon: 'dumbbell',\n group: 'More',\n prompt: 'Build me a workout plan for this week',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'fitness',\n },\n];\n\n/** Added apps lead: someone who just added one from the marketplace looks for it first. */\nexport const APP_GROUP_ORDER: readonly AppGroupId[] = [\n 'Added',\n 'Create',\n 'Office',\n 'Automate',\n 'Sell',\n 'Money',\n 'Team',\n 'More',\n];\n\n/** `marketplace` is the gallery, where apps are added; the other two list what is already here. */\nexport type AppsTab = 'all' | 'favorites' | 'marketplace';\n\n/**\n * Poster colors per group - the tile artwork. Deliberately the same in light\n * and dark themes: artwork is content, the card chrome is what adapts.\n */\nexport const APP_GROUP_ART: Record<AppGroupId, { base: string; glow: string }> = {\n Create: { base: '#4f46e5', glow: '#c4b5fd' },\n Office: { base: '#334155', glow: '#cbd5e1' },\n Automate: { base: '#0f766e', glow: '#99f6e4' },\n Sell: { base: '#c2410c', glow: '#fed7aa' },\n Money: { base: '#15803d', glow: '#bbf7d0' },\n Team: { base: '#0369a1', glow: '#bae6fd' },\n More: { base: '#be185d', glow: '#fbcfe8' },\n Added: { base: '#0f766e', glow: '#99f6e4' },\n};\n\nexport function matchesAppQuery(label: string, query: string): boolean {\n const q = query.toLowerCase().replace(/[^a-z0-9]/g, '');\n if (!q) return true;\n return label\n .toLowerCase()\n .replace(/[^a-z0-9]/g, '')\n .includes(q);\n}\n\n/**\n * Favorites keyed by a web tile that a native tile now replaces, carried over to\n * the native tile, so pinning \"Inbox\" before it went native still pins it after.\n */\nexport function carryOverSupersededFavorites(\n favorites: ReadonlySet<string>,\n items: readonly MobileAppItem[] = MOBILE_APP_CATALOG,\n): Set<string> {\n const replacement = new Map<string, string>();\n for (const item of items) if (item.supersedes) replacement.set(item.supersedes, item.key);\n const out = new Set<string>();\n for (const key of favorites) out.add(replacement.get(key) ?? key);\n return out;\n}\n\n/** One tile per app: a web tile disappears when its native replacement is in the list. */\nexport function visibleMobileApps(items: readonly MobileAppItem[]): MobileAppItem[] {\n const replaced = new Set(items.map((item) => item.supersedes).filter(Boolean));\n return items.filter((item) => !item.hideInLauncher && !replaced.has(item.key));\n}\n\nexport function groupMobileApps(items: readonly MobileAppItem[], query: string) {\n const hits = visibleMobileApps(items).filter((item) => matchesAppQuery(item.label, query));\n return APP_GROUP_ORDER.map((label) => ({\n label,\n items: hits.filter((item) => item.group === label),\n })).filter((group) => group.items.length > 0);\n}\n\n/**\n * One flat grid (Manus/game-launcher style) instead of grouped sections: rows\n * stay dense and the group reads from each card's caption. Catalog order is\n * kept inside a group; groups follow APP_GROUP_ORDER.\n */\nexport function filterMobileApps(\n items: readonly MobileAppItem[],\n query: string,\n tab: AppsTab,\n favorites: ReadonlySet<string>,\n): MobileAppItem[] {\n const rank = new Map(APP_GROUP_ORDER.map((group, index) => [group, index]));\n return visibleMobileApps(items)\n .filter((item) => matchesAppQuery(item.label, query))\n .filter((item) => tab !== 'favorites' || favorites.has(item.key))\n .sort((a, b) => (rank.get(a.group) ?? APP_GROUP_ORDER.length) - (rank.get(b.group) ?? APP_GROUP_ORDER.length));\n}\n"],"names":[],"mappings":"AAiEO,MAAM,kBAA+C,GAAA;AAAA,EAAC;AAAA,IAC3D,GAAK,EAAA,QAAA;AAAA,IACL,KAAO,EAAA,QAAA;AAAA,IACP,IAAM,EAAA,iBAAA;AAAA,IACN,KAAO,EAAA,QAAA;AAAA,IACP,MAAQ,EAAA,gEAAA;AAAA,IACR,WAAa,EAAA,YAAA;AAAA,IACb,aAAe,EAAA,oBAAA;AAAA,IACf,WAAa,EAAA;AAAA,GACf;AAAA,EAAG;AAAA,IACD,GAAK,EAAA,eAAA;AAAA,IACL,KAAO,EAAA,QAAA;AAAA,IACP,UAAY,EAAA,QAAA;AAAA,IACZ,IAAM,EAAA,iBAAA;AAAA,IACN,KAAO,EAAA,QAAA;AAAA,IACP,MAAQ,EAAA,gEAAA;AAAA;AAAA;AAAA,IAGR,WAAa,EAAA;AAAA,GACf;AAAA,EAAG;AAAA,IACD,GAAK,EAAA,QAAA;AAAA,IACL,KAAO,EAAA,QAAA;AAAA,IACP,IAAM,EAAA,mBAAA;AAAA,IACN,KAAO,EAAA,QAAA;AAAA,IACP,MAAQ,EAAA,gEAAA;AAAA,IACR,WAAa,EAAA,YAAA;AAAA,IACb,aAAe,EAAA,oBAAA;AAAA,IACf,WAAa,EAAA;AAAA,GACf;AAAA,EAAG;AAAA,IACD,GAAK,EAAA,eAAA;AAAA,I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IAAA,CAAK,CAAC,CAAA,EAAG,CAAG,KAAA;AAjmBhK,IAAA,IAAA,EAAA,EAAA,EAAA;AAimBoK,IAAA,OAAA,CAAA,CAAA,EAAA,GAAA,IAAA,CAAK,GAAI,CAAA,CAAA,CAAE,KAAK,CAAA,KAAhB,IAAqB,GAAA,EAAA,GAAA,eAAA,CAAgB,MAAW,KAAA,CAAA,EAAA,GAAA,IAAA,CAAK,GAAI,CAAA,CAAA,CAAE,KAAK,CAAA,KAAhB,YAAqB,eAAgB,CAAA,MAAA,CAAA;AAAA,GAAO,CAAA;AAChQ"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {MOBILE_APP_CATALOG}from'./mobileAppCatalog.js';function resolveSurfaceUrl(app, config) {
|
|
2
|
-
var _a, _b;
|
|
2
|
+
var _a, _b, _c;
|
|
3
3
|
if (app.nativeRoute !== "webbuilder") return void 0;
|
|
4
|
+
const own = (_a = app.surfaceUrl) == null ? void 0 : _a.trim();
|
|
5
|
+
if (own) return own;
|
|
4
6
|
if (app.surfaceUrlKey) {
|
|
5
|
-
const explicit = (
|
|
7
|
+
const explicit = (_b = config[app.surfaceUrlKey]) == null ? void 0 : _b.trim();
|
|
6
8
|
if (explicit) return explicit;
|
|
7
9
|
}
|
|
8
|
-
const template = (
|
|
10
|
+
const template = (_c = config.SURFACE_URL_TEMPLATE) == null ? void 0 : _c.trim();
|
|
9
11
|
if (!template || !app.surfaceSlug) return void 0;
|
|
10
12
|
if (!template.includes("{slug}")) return void 0;
|
|
11
13
|
return template.replace(/\{slug\}/g, app.surfaceSlug);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveSurfaceUrl.js","sources":["../../../src/features/apps/resolveSurfaceUrl.ts"],"sourcesContent":["/**\n * Which URL the shared WebView surface shell should open for a launcher tile.\n *\n * Explicit env key wins (the surfaces with a dedicated var, which are the\n * ones run locally), then the `{slug}` template that covers every deployed\n * surface. Returning undefined means \"no surface\" — the caller falls back to\n * seeding the tile's chat prompt, which is what every tile did before.\n */\nimport type { MobileAppItem } from './mobileAppCatalog';\nimport { MOBILE_APP_CATALOG } from './mobileAppCatalog';\n\nexport interface SurfaceUrlConfig {\n WEB_BUILDER_URL?: string;\n CANVAS_SURFACE_URL?: string;\n DESIGN_SURFACE_URL?: string;\n SURFACE_URL_TEMPLATE?: string;\n}\n\nexport function resolveSurfaceUrl(app: MobileAppItem, config: SurfaceUrlConfig): string | undefined {\n // Only the shared WebView shell needs a URL - a tile with its own native\n // screen (nativeRoute 'canvas-native') resolves nothing by design.\n if (app.nativeRoute !== 'webbuilder') return undefined;\n\n if (app.surfaceUrlKey) {\n const explicit = config[app.surfaceUrlKey]?.trim();\n\n if (explicit) return explicit;\n }\n\n const template = config.SURFACE_URL_TEMPLATE?.trim();\n\n if (!template || !app.surfaceSlug) return undefined;\n // A template without the placeholder would silently point every surface at\n // the same origin, which is worse than opening none.\n if (!template.includes('{slug}')) return undefined;\n\n return template.replace(/\\{slug\\}/g, app.surfaceSlug);\n}\n\nfunction originKey(url: string): string | null {\n try {\n const parsed = new URL(url);\n return `${parsed.protocol}//${parsed.host}`.toLowerCase();\n } catch {\n const trimmed = url.trim().replace(/\\/+$/, '');\n return trimmed ? trimmed.toLowerCase() : null;\n }\n}\n\n/**\n * Header title for the shared WebView shell. Matches the launcher tile whose\n * surface URL is this origin (Canvas, Design, …) instead of always \"Web Builder\".\n */\nexport function resolveAppTitleFromSurfaceUrl(url: string | null | undefined, config: SurfaceUrlConfig): string | null {\n if (typeof url !== 'string' || !url.trim()) return null;\n const needle = originKey(url);\n if (!needle) return null;\n\n for (const app of MOBILE_APP_CATALOG) {\n const surface = resolveSurfaceUrl(app, config);\n if (surface && originKey(surface) === needle) return app.label;\n }\n return null;\n}\n"],"names":[],"mappings":"uDAgBgB,SAAA,iBAAA,CAAkB,KAAoB,MAA8C,EAAA;AAhBpG,EAAA,IAAA,EAAA,EAAA,EAAA;AAmBE,EAAI,IAAA,GAAA,CAAI,WAAgB,KAAA,YAAA,EAAqB,OAAA,MAAA;
|
|
1
|
+
{"version":3,"file":"resolveSurfaceUrl.js","sources":["../../../src/features/apps/resolveSurfaceUrl.ts"],"sourcesContent":["/**\n * Which URL the shared WebView surface shell should open for a launcher tile.\n *\n * Explicit env key wins (the surfaces with a dedicated var, which are the\n * ones run locally), then the `{slug}` template that covers every deployed\n * surface. Returning undefined means \"no surface\" — the caller falls back to\n * seeding the tile's chat prompt, which is what every tile did before.\n */\nimport type { MobileAppItem } from './mobileAppCatalog';\nimport { MOBILE_APP_CATALOG } from './mobileAppCatalog';\n\nexport interface SurfaceUrlConfig {\n WEB_BUILDER_URL?: string;\n CANVAS_SURFACE_URL?: string;\n DESIGN_SURFACE_URL?: string;\n SURFACE_URL_TEMPLATE?: string;\n}\n\nexport function resolveSurfaceUrl(app: MobileAppItem, config: SurfaceUrlConfig): string | undefined {\n // Only the shared WebView shell needs a URL - a tile with its own native\n // screen (nativeRoute 'canvas-native') resolves nothing by design.\n if (app.nativeRoute !== 'webbuilder') return undefined;\n\n // A marketplace app carries its own page: it is not in the catalog, so no env names it.\n const own = app.surfaceUrl?.trim();\n if (own) return own;\n\n if (app.surfaceUrlKey) {\n const explicit = config[app.surfaceUrlKey]?.trim();\n\n if (explicit) return explicit;\n }\n\n const template = config.SURFACE_URL_TEMPLATE?.trim();\n\n if (!template || !app.surfaceSlug) return undefined;\n // A template without the placeholder would silently point every surface at\n // the same origin, which is worse than opening none.\n if (!template.includes('{slug}')) return undefined;\n\n return template.replace(/\\{slug\\}/g, app.surfaceSlug);\n}\n\nfunction originKey(url: string): string | null {\n try {\n const parsed = new URL(url);\n return `${parsed.protocol}//${parsed.host}`.toLowerCase();\n } catch {\n const trimmed = url.trim().replace(/\\/+$/, '');\n return trimmed ? trimmed.toLowerCase() : null;\n }\n}\n\n/**\n * Header title for the shared WebView shell. Matches the launcher tile whose\n * surface URL is this origin (Canvas, Design, …) instead of always \"Web Builder\".\n */\nexport function resolveAppTitleFromSurfaceUrl(url: string | null | undefined, config: SurfaceUrlConfig): string | null {\n if (typeof url !== 'string' || !url.trim()) return null;\n const needle = originKey(url);\n if (!needle) return null;\n\n for (const app of MOBILE_APP_CATALOG) {\n const surface = resolveSurfaceUrl(app, config);\n if (surface && originKey(surface) === needle) return app.label;\n }\n return null;\n}\n"],"names":[],"mappings":"uDAgBgB,SAAA,iBAAA,CAAkB,KAAoB,MAA8C,EAAA;AAhBpG,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AAmBE,EAAI,IAAA,GAAA,CAAI,WAAgB,KAAA,YAAA,EAAqB,OAAA,MAAA;AAG7C,EAAM,MAAA,GAAA,GAAA,CAAM,EAAI,GAAA,GAAA,CAAA,UAAA,KAAJ,IAAgB,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,EAAA;AAC5B,EAAA,IAAI,KAAY,OAAA,GAAA;AAChB,EAAA,IAAI,IAAI,aAAe,EAAA;AACrB,IAAA,MAAM,QAAW,GAAA,CAAA,EAAA,GAAA,MAAA,CAAO,GAAI,CAAA,aAAa,MAAxB,IAA2B,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,EAAA;AAC5C,IAAA,IAAI,UAAiB,OAAA,QAAA;AAAA;AAEvB,EAAM,MAAA,QAAA,GAAA,CAAW,EAAO,GAAA,MAAA,CAAA,oBAAA,KAAP,IAA6B,GAAA,MAAA,GAAA,EAAA,CAAA,IAAA,EAAA;AAC9C,EAAA,IAAI,CAAC,QAAA,IAAY,CAAC,GAAA,CAAI,aAAoB,OAAA,MAAA;AAG1C,EAAA,IAAI,CAAC,QAAA,CAAS,QAAS,CAAA,QAAQ,GAAU,OAAA,MAAA;AACzC,EAAA,OAAO,QAAS,CAAA,OAAA,CAAQ,WAAa,EAAA,GAAA,CAAI,WAAW,CAAA;AACtD;AACA,SAAS,UAAU,GAA4B,EAAA;AAC7C,EAAI,IAAA;AACF,IAAM,MAAA,MAAA,GAAS,IAAI,GAAA,CAAI,GAAG,CAAA;AAC1B,IAAA,OAAO,GAAG,MAAO,CAAA,QAAQ,KAAK,MAAO,CAAA,IAAI,GAAG,WAAY,EAAA;AAAA,GAClD,CAAA,OAAA,CAAA,EAAA;AACN,IAAA,MAAM,UAAU,GAAI,CAAA,IAAA,EAAO,CAAA,OAAA,CAAQ,QAAQ,EAAE,CAAA;AAC7C,IAAO,OAAA,OAAA,GAAU,OAAQ,CAAA,WAAA,EAAgB,GAAA,IAAA;AAAA;AAE7C;AAMgB,SAAA,6BAAA,CAA8B,KAAgC,MAAyC,EAAA;AACrH,EAAA,IAAI,OAAO,GAAQ,KAAA,QAAA,IAAY,CAAC,GAAI,CAAA,IAAA,IAAe,OAAA,IAAA;AACnD,EAAM,MAAA,MAAA,GAAS,UAAU,GAAG,CAAA;AAC5B,EAAI,IAAA,CAAC,QAAe,OAAA,IAAA;AACpB,EAAA,KAAA,MAAW,OAAO,kBAAoB,EAAA;AACpC,IAAM,MAAA,OAAA,GAAU,iBAAkB,CAAA,GAAA,EAAK,MAAM,CAAA;AAC7C,IAAA,IAAI,WAAW,SAAU,CAAA,OAAO,CAAM,KAAA,MAAA,SAAe,GAAI,CAAA,KAAA;AAAA;AAE3D,EAAO,OAAA,IAAA;AACT"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import {useMemo,useCallback,useState,useEffect}from'react';import {useGetPageSettingsQuery,useGalleryExtensionsListQuery,useWriteSettingsMutation}from'common/graphql';import {ConfigurationTarget,ContributionSchemaId,SortOrder,GalleryExtensionSortBy}from'common';import {useTemplatesResourceUri}from'../../hooks/useTemplatesResourceUri.js';import {collectConnectorApps}from'./connectorApps.js';import {orgExtensionSettingsUri,unwrapExtensionSettings,isExtensionEnabledForOrg,extensionSettingKey,formatInstallCount,galleryIconUri}from'./galleryExtensions.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
function useConnectorApps(orgName, enabled = true) {
|
|
21
|
+
var _a;
|
|
22
|
+
const resourceUri = useTemplatesResourceUri(orgName, enabled);
|
|
23
|
+
const {
|
|
24
|
+
data,
|
|
25
|
+
loading,
|
|
26
|
+
refetch
|
|
27
|
+
} = useGetPageSettingsQuery({
|
|
28
|
+
variables: {
|
|
29
|
+
resourceUri,
|
|
30
|
+
options: {
|
|
31
|
+
schemaId: ContributionSchemaId.UiLayout,
|
|
32
|
+
configKey: "marketplace.surfaces",
|
|
33
|
+
includeMarketplace: true,
|
|
34
|
+
target: ConfigurationTarget.ORGANIZATION
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
skip: !resourceUri,
|
|
38
|
+
fetchPolicy: "cache-and-network",
|
|
39
|
+
nextFetchPolicy: "cache-first"
|
|
40
|
+
});
|
|
41
|
+
const settings = (_a = data == null ? void 0 : data.pageSettings) == null ? void 0 : _a.settings;
|
|
42
|
+
const apps = useMemo(() => collectConnectorApps(settings), [settings]);
|
|
43
|
+
const refetchApps = useCallback(() => resourceUri ? refetch() : Promise.resolve(void 0), [refetch, resourceUri]);
|
|
44
|
+
return {
|
|
45
|
+
apps,
|
|
46
|
+
loading: Boolean(resourceUri) && loading && apps.length === 0,
|
|
47
|
+
refetch: refetchApps
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const text = (v) => v && v.trim() ? v.trim() : void 0;
|
|
51
|
+
function toGalleryListing(node) {
|
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
53
|
+
const extensionSlug = text(node == null ? void 0 : node.extensionSlug);
|
|
54
|
+
if (!node || !extensionSlug) return null;
|
|
55
|
+
return {
|
|
56
|
+
extensionSlug,
|
|
57
|
+
displayName: (_b = (_a = text(node.displayName)) != null ? _a : text(node.name)) != null ? _b : extensionSlug,
|
|
58
|
+
summary: text(node.summary),
|
|
59
|
+
description: text(node.description),
|
|
60
|
+
publisher: (_e = text((_c = node.publisher) == null ? void 0 : _c.displayName)) != null ? _e : text((_d = node.publisher) == null ? void 0 : _d.name),
|
|
61
|
+
verified: ((_f = node.publisher) == null ? void 0 : _f.verified) === true,
|
|
62
|
+
icon: galleryIconUri(node.icon, (_g = node.publisher) == null ? void 0 : _g.logoUrl),
|
|
63
|
+
categories: ((_h = node.categories) != null ? _h : []).map((c) => text(c)).filter((c) => !!c),
|
|
64
|
+
installs: formatInstallCount((_k = (_i = node.stats) == null ? void 0 : _i.installCount) != null ? _k : (_j = node.stats) == null ? void 0 : _j.downloadCount),
|
|
65
|
+
version: text(node.version),
|
|
66
|
+
isBuiltIn: node.isBuiltIn === true,
|
|
67
|
+
autoEnable: node.autoEnable === true
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
const GALLERY_PAGE_SIZE = 20;
|
|
71
|
+
function useGalleryListings({
|
|
72
|
+
search,
|
|
73
|
+
limit
|
|
74
|
+
}) {
|
|
75
|
+
var _a, _b;
|
|
76
|
+
const {
|
|
77
|
+
data,
|
|
78
|
+
previousData,
|
|
79
|
+
loading,
|
|
80
|
+
error,
|
|
81
|
+
refetch
|
|
82
|
+
} = useGalleryExtensionsListQuery({
|
|
83
|
+
variables: {
|
|
84
|
+
filter: {
|
|
85
|
+
search: search.trim() || void 0,
|
|
86
|
+
sortBy: GalleryExtensionSortBy.InstallCount,
|
|
87
|
+
sortOrder: SortOrder.Desc,
|
|
88
|
+
limit,
|
|
89
|
+
offset: 0
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
fetchPolicy: "cache-and-network",
|
|
93
|
+
notifyOnNetworkStatusChange: true
|
|
94
|
+
});
|
|
95
|
+
const page = (_a = data != null ? data : previousData) == null ? void 0 : _a.galleryExtensionsList;
|
|
96
|
+
const listings = useMemo(() => {
|
|
97
|
+
var _a2;
|
|
98
|
+
return ((_a2 = page == null ? void 0 : page.nodes) != null ? _a2 : []).map(toGalleryListing).filter((listing) => !!listing);
|
|
99
|
+
}, [page == null ? void 0 : page.nodes]);
|
|
100
|
+
return {
|
|
101
|
+
listings,
|
|
102
|
+
total: (_b = page == null ? void 0 : page.totalCount) != null ? _b : listings.length,
|
|
103
|
+
loading,
|
|
104
|
+
error,
|
|
105
|
+
refetch
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function useOrgExtensions(orgName, onChanged) {
|
|
109
|
+
var _a;
|
|
110
|
+
const editingUri = useMemo(() => orgExtensionSettingsUri(orgName), [orgName]);
|
|
111
|
+
const {
|
|
112
|
+
data,
|
|
113
|
+
refetch
|
|
114
|
+
} = useGetPageSettingsQuery({
|
|
115
|
+
variables: {
|
|
116
|
+
resourceUri: editingUri,
|
|
117
|
+
options: {
|
|
118
|
+
schemaId: ContributionSchemaId.Configuration,
|
|
119
|
+
configKey: "extensions"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
skip: !editingUri,
|
|
123
|
+
fetchPolicy: "cache-and-network",
|
|
124
|
+
nextFetchPolicy: "cache-first"
|
|
125
|
+
});
|
|
126
|
+
const [writeSettings] = useWriteSettingsMutation();
|
|
127
|
+
const [overrides, setOverrides] = useState({});
|
|
128
|
+
const [pending, setPending] = useState(/* @__PURE__ */ new Set());
|
|
129
|
+
useEffect(() => setOverrides({}), [editingUri == null ? void 0 : editingUri.path]);
|
|
130
|
+
const saved = useMemo(() => {
|
|
131
|
+
var _a2;
|
|
132
|
+
return unwrapExtensionSettings((_a2 = data == null ? void 0 : data.pageSettings) == null ? void 0 : _a2.settings);
|
|
133
|
+
}, [(_a = data == null ? void 0 : data.pageSettings) == null ? void 0 : _a.settings]);
|
|
134
|
+
const isEnabled = useCallback((listing) => {
|
|
135
|
+
var _a2;
|
|
136
|
+
return isExtensionEnabledForOrg((_a2 = overrides[listing.extensionSlug]) != null ? _a2 : saved[listing.extensionSlug], listing);
|
|
137
|
+
}, [overrides, saved]);
|
|
138
|
+
const setEnabled = useCallback(async (extensionSlug, enabled) => {
|
|
139
|
+
if (!editingUri) throw new Error("Pick a workspace first - apps are added to a workspace.");
|
|
140
|
+
setOverrides((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
141
|
+
[extensionSlug]: enabled
|
|
142
|
+
}));
|
|
143
|
+
setPending((prev) => new Set(prev).add(extensionSlug));
|
|
144
|
+
try {
|
|
145
|
+
await writeSettings({
|
|
146
|
+
variables: {
|
|
147
|
+
editingUri,
|
|
148
|
+
settings: {
|
|
149
|
+
[extensionSettingKey(extensionSlug)]: enabled
|
|
150
|
+
},
|
|
151
|
+
target: ConfigurationTarget.ORGANIZATION_RESOURCE,
|
|
152
|
+
schemaId: ContributionSchemaId.Configuration
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
await refetch().catch(() => void 0);
|
|
156
|
+
onChanged == null ? void 0 : onChanged();
|
|
157
|
+
} catch (error) {
|
|
158
|
+
setOverrides((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
159
|
+
[extensionSlug]: !enabled
|
|
160
|
+
}));
|
|
161
|
+
throw error;
|
|
162
|
+
} finally {
|
|
163
|
+
setPending((prev) => {
|
|
164
|
+
const next = new Set(prev);
|
|
165
|
+
next.delete(extensionSlug);
|
|
166
|
+
return next;
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
}, [editingUri, onChanged, refetch, writeSettings]);
|
|
170
|
+
return {
|
|
171
|
+
isEnabled,
|
|
172
|
+
setEnabled,
|
|
173
|
+
pending,
|
|
174
|
+
canWrite: Boolean(editingUri)
|
|
175
|
+
};
|
|
176
|
+
}export{GALLERY_PAGE_SIZE,toGalleryListing,useConnectorApps,useGalleryListings,useOrgExtensions};//# sourceMappingURL=useMarketplaceApps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMarketplaceApps.js","sources":["../../../src/features/apps/useMarketplaceApps.ts"],"sourcesContent":["/**\n * The marketplace on the phone: what the gallery lists, which of it this org has added,\n * and the connector apps those additions put in the launcher.\n *\n * The reads go straight to `pageSettings` rather than through `useSettings`, which keeps\n * `refetch` to itself: after an Add the launcher has to re-read at once, and an app added\n * on the web has to show up the next time Apps opens, not after a cold start.\n */\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useGalleryExtensionsListQuery, useGetPageSettingsQuery, useWriteSettingsMutation } from 'common/graphql';\nimport { ConfigurationTarget, ContributionSchemaId, GalleryExtensionSortBy, SortOrder } from 'common';\nimport { useTemplatesResourceUri } from '../../hooks/useTemplatesResourceUri';\nimport { collectConnectorApps, type ConnectorApp } from './connectorApps';\nimport {\n extensionSettingKey,\n formatInstallCount,\n galleryIconUri,\n isExtensionEnabledForOrg,\n orgExtensionSettingsUri,\n unwrapExtensionSettings,\n} from './galleryExtensions';\n\n/** The connector apps this org has added, sorted by name. Empty until someone adds one. */\nexport function useConnectorApps(\n orgName?: string | null,\n /** False holds the read back - a sheet that is mounted but not open. */\n enabled = true,\n): {\n apps: ConnectorApp[];\n loading: boolean;\n refetch: () => Promise<unknown>;\n} {\n // The signed-in context's resource, as the web shell reads `marketplace.surfaces`.\n const resourceUri = useTemplatesResourceUri(orgName, enabled);\n const { data, loading, refetch } = useGetPageSettingsQuery({\n variables: {\n resourceUri: resourceUri as never,\n options: {\n schemaId: ContributionSchemaId.UiLayout,\n configKey: 'marketplace.surfaces',\n includeMarketplace: true,\n target: ConfigurationTarget.ORGANIZATION,\n },\n },\n skip: !resourceUri,\n fetchPolicy: 'cache-and-network',\n nextFetchPolicy: 'cache-first',\n });\n const settings = data?.pageSettings?.settings;\n const apps = useMemo(() => collectConnectorApps(settings), [settings]);\n const refetchApps = useCallback(\n () => (resourceUri ? refetch() : Promise.resolve(undefined)),\n [refetch, resourceUri],\n );\n return { apps, loading: Boolean(resourceUri) && loading && apps.length === 0, refetch: refetchApps };\n}\n\n/** One gallery card, flattened from the `GalleryExtensionMetadata` fragment. */\nexport interface GalleryListing {\n /** `publisher/name` - the key of the org's on/off switch. */\n extensionSlug: string;\n displayName: string;\n summary?: string;\n description?: string;\n publisher?: string;\n verified: boolean;\n icon?: string;\n categories: string[];\n /** Already formatted: `1.2K`. */\n installs?: string;\n version?: string;\n isBuiltIn: boolean;\n autoEnable: boolean;\n}\n\ntype GalleryNode = {\n extensionSlug?: string | null;\n name?: string | null;\n displayName?: string | null;\n summary?: string | null;\n description?: string | null;\n version?: string | null;\n icon?: string | null;\n categories?: Array<string | null> | null;\n isBuiltIn?: boolean | null;\n autoEnable?: boolean | null;\n stats?: { installCount?: number | null; downloadCount?: number | null } | null;\n publisher?: {\n displayName?: string | null;\n name?: string | null;\n verified?: boolean | null;\n logoUrl?: string | null;\n } | null;\n};\n\nconst text = (v: string | null | undefined): string | undefined => (v && v.trim() ? v.trim() : undefined);\n\nexport function toGalleryListing(node: GalleryNode | null | undefined): GalleryListing | null {\n const extensionSlug = text(node?.extensionSlug);\n if (!node || !extensionSlug) return null;\n return {\n extensionSlug,\n displayName: text(node.displayName) ?? text(node.name) ?? extensionSlug,\n summary: text(node.summary),\n description: text(node.description),\n publisher: text(node.publisher?.displayName) ?? text(node.publisher?.name),\n verified: node.publisher?.verified === true,\n icon: galleryIconUri(node.icon, node.publisher?.logoUrl),\n categories: (node.categories ?? []).map((c) => text(c)).filter((c): c is string => !!c),\n installs: formatInstallCount(node.stats?.installCount ?? node.stats?.downloadCount),\n version: text(node.version),\n isBuiltIn: node.isBuiltIn === true,\n autoEnable: node.autoEnable === true,\n };\n}\n\nexport const GALLERY_PAGE_SIZE = 20;\n\n/** The gallery's listings for a search, most installed first; `limit` grows with \"Show more\". */\nexport function useGalleryListings({ search, limit }: { search: string; limit: number }) {\n const { data, previousData, loading, error, refetch } = useGalleryExtensionsListQuery({\n variables: {\n filter: {\n search: search.trim() || undefined,\n sortBy: GalleryExtensionSortBy.InstallCount,\n sortOrder: SortOrder.Desc,\n limit,\n offset: 0,\n },\n },\n fetchPolicy: 'cache-and-network',\n notifyOnNetworkStatusChange: true,\n });\n // New variables (a longer page, a new search) clear `data` until they answer: keep the\n // last page on screen meanwhile instead of flashing an empty list.\n const page = (data ?? previousData)?.galleryExtensionsList;\n const listings = useMemo(\n () =>\n ((page?.nodes ?? []) as GalleryNode[])\n .map(toGalleryListing)\n .filter((listing): listing is GalleryListing => !!listing),\n [page?.nodes],\n );\n return { listings, total: page?.totalCount ?? listings.length, loading, error, refetch };\n}\n\n/**\n * Which gallery extensions this org has on, and the switch for them - the same\n * `extensions.<publisher/name>` write the web gallery makes. The switch moves the moment\n * it is pressed and moves back if the write fails; a read that still answers with the\n * pre-write value (cached resolves) does not snap it back.\n */\nexport function useOrgExtensions(orgName: string | null | undefined, onChanged?: () => void) {\n const editingUri = useMemo(() => orgExtensionSettingsUri(orgName), [orgName]);\n const { data, refetch } = useGetPageSettingsQuery({\n variables: {\n resourceUri: editingUri as never,\n options: { schemaId: ContributionSchemaId.Configuration, configKey: 'extensions' },\n },\n skip: !editingUri,\n fetchPolicy: 'cache-and-network',\n nextFetchPolicy: 'cache-first',\n });\n const [writeSettings] = useWriteSettingsMutation();\n const [overrides, setOverrides] = useState<Record<string, boolean>>({});\n const [pending, setPending] = useState<ReadonlySet<string>>(new Set());\n\n // A new org is a new switchboard.\n useEffect(() => setOverrides({}), [editingUri?.path]);\n\n const saved = useMemo(() => unwrapExtensionSettings(data?.pageSettings?.settings), [data?.pageSettings?.settings]);\n\n const isEnabled = useCallback(\n (listing: Pick<GalleryListing, 'extensionSlug' | 'isBuiltIn' | 'autoEnable'>) =>\n isExtensionEnabledForOrg(overrides[listing.extensionSlug] ?? saved[listing.extensionSlug], listing),\n [overrides, saved],\n );\n\n const setEnabled = useCallback(\n async (extensionSlug: string, enabled: boolean): Promise<void> => {\n if (!editingUri) throw new Error('Pick a workspace first - apps are added to a workspace.');\n setOverrides((prev) => ({ ...prev, [extensionSlug]: enabled }));\n setPending((prev) => new Set(prev).add(extensionSlug));\n try {\n await writeSettings({\n variables: {\n editingUri: editingUri as never,\n settings: { [extensionSettingKey(extensionSlug)]: enabled },\n target: ConfigurationTarget.ORGANIZATION_RESOURCE,\n schemaId: ContributionSchemaId.Configuration,\n },\n });\n await refetch().catch(() => undefined);\n onChanged?.();\n } catch (error) {\n setOverrides((prev) => ({ ...prev, [extensionSlug]: !enabled }));\n throw error;\n } finally {\n setPending((prev) => {\n const next = new Set(prev);\n next.delete(extensionSlug);\n return next;\n });\n }\n },\n [editingUri, onChanged, refetch, writeSettings],\n );\n\n return { isEnabled, setEnabled, pending, canWrite: Boolean(editingUri) };\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;AAgBgB,SAAA,gBAAA,CAAiB,OACjC,EAAA,OAAA,GAAU,IAIR,EAAA;AArBF,EAAA,IAAA,EAAA;AAuBE,EAAM,MAAA,WAAA,GAAc,uBAAwB,CAAA,OAAA,EAAS,OAAO,CAAA;AAC5D,EAAM,MAAA;AAAA,IACJ,IAAA;AAAA,IACA,OAAA;AAAA,IACA;AAAA,MACE,uBAAwB,CAAA;AAAA,IAC1B,SAAW,EAAA;AAAA,MACT,WAAA;AAAA,MACA,OAAS,EAAA;AAAA,QACP,UAAU,oBAAqB,CAAA,QAAA;AAAA,QAC/B,SAAW,E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AC,GAAG;AAAA,WACxC;AAAA,UACA,QAAQ,mBAAoB,CAAA,qBAAA;AAAA,UAC5B,UAAU,oBAAqB,CAAA;AAAA;AACjC,OACD,CAAA;AACD,MAAA,MAAM,OAAQ,EAAA,CAAE,KAAM,CAAA,MAAM,KAAS,CAAA,CAAA;AACrC,MAAA,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,EAAA;AAAA,aACO,KAAO,EAAA;AACd,MAAa,YAAA,CAAA,CAAA,IAAA,KAAS,iCACjB,IADiB,CAAA,EAAA;AAAA,QAEpB,CAAC,aAAa,GAAG,CAAC;AAAA,OAClB,CAAA,CAAA;AACF,MAAM,MAAA,KAAA;AAAA,KACN,SAAA;AACA,MAAA,UAAA,CAAW,CAAQ,IAAA,KAAA;AACjB,QAAM,MAAA,IAAA,GAAO,IAAI,GAAA,CAAI,IAAI,CAAA;AACzB,QAAA,IAAA,CAAK,OAAO,aAAa,CAAA;AACzB,QAAO,OAAA,IAAA;AAAA,OACR,CAAA;AAAA;AACH,KACC,CAAC,UAAA,EAAY,SAAW,EAAA,OAAA,EAAS,aAAa,CAAC,CAAA;AAClD,EAAO,OAAA;AAAA,IACL,SAAA;AAAA,IACA,UAAA;AAAA,IACA,OAAA;AAAA,IACA,QAAA,EAAU,QAAQ,UAAU;AAAA,GAC9B;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {surfaceReplyDisplayText}from'common';const ACTIVE_CONNECTORS_PREFIX_RE = /^\s*\[Active connectors:[^\]]*\]\s*/i;
|
|
2
|
+
const SURFACE_CONTEXT_HEADER_RE = /^\s*\[[a-z][a-z ]{0,40} context:[^\]\n]*\]\s*/i;
|
|
3
|
+
function cleanPromptText(raw) {
|
|
4
|
+
const choice = surfaceReplyDisplayText(raw);
|
|
5
|
+
if (choice) return choice;
|
|
6
|
+
return raw.replace(SURFACE_CONTEXT_HEADER_RE, "").replace(ACTIVE_CONNECTORS_PREFIX_RE, "").replace(/\s+/g, " ").trim();
|
|
7
|
+
}export{cleanPromptText};//# sourceMappingURL=promptText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptText.js","sources":["../../../src/features/chat/promptText.ts"],"sourcesContent":["/**\n * What a person typed, as the person reads it: a chat turn's text without the\n * agent-only framing the app puts in front of it. Chat history titles and the\n * task Live Activity both show it.\n */\nimport { surfaceReplyDisplayText } from 'common';\n\n/** `[Active connectors: …]` routing prefix on persisted gateway user posts. */\nconst ACTIVE_CONNECTORS_PREFIX_RE = /^\\s*\\[Active connectors:[^\\]]*\\]\\s*/i;\n\n/**\n * The agent-only header a native surface puts in front of a turn\n * (`[expenses context: surface=expenses; ...]`, and the same for movies, study,\n * inbox and local services). Each surface strips its own in its transcript; the\n * history list reads every surface's chats, so it strips the shape.\n */\nconst SURFACE_CONTEXT_HEADER_RE = /^\\s*\\[[a-z][a-z ]{0,40} context:[^\\]\\n]*\\]\\s*/i;\n\nexport function cleanPromptText(raw: string): string {\n // A template pick's control line reads as the person's words for it.\n const choice = surfaceReplyDisplayText(raw);\n if (choice) return choice;\n return raw\n .replace(SURFACE_CONTEXT_HEADER_RE, '')\n .replace(ACTIVE_CONNECTORS_PREFIX_RE, '')\n .replace(/\\s+/g, ' ')\n .trim();\n}\n"],"names":[],"mappings":"6CAQA,MAAM,2BAA8B,GAAA,sCAAA;AAQpC,MAAM,yBAA4B,GAAA,gDAAA;AAC3B,SAAS,gBAAgB,GAAqB,EAAA;AAEnD,EAAM,MAAA,MAAA,GAAS,wBAAwB,GAAG,CAAA;AAC1C,EAAA,IAAI,QAAe,OAAA,MAAA;AACnB,EAAA,OAAO,GAAI,CAAA,OAAA,CAAQ,yBAA2B,EAAA,EAAE,CAAE,CAAA,OAAA,CAAQ,2BAA6B,EAAA,EAAE,CAAE,CAAA,OAAA,CAAQ,MAAQ,EAAA,GAAG,EAAE,IAAK,EAAA;AACvH"}
|