@adminide-stack/yantra-mobile 12.0.175-alpha.0 → 12.0.175-alpha.2
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/features/apps/mobileAppCatalog.js +11 -1
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/games/cubeforge3D.js +2 -12
- package/lib/features/games/cubeforge3D.js.map +1 -1
- package/lib/features/games/cubeforgeHelper.js +22 -1
- package/lib/features/games/cubeforgeHelper.js.map +1 -1
- package/lib/screens/Home/components/homeCatalog.js +10 -0
- package/lib/screens/Home/components/homeCatalog.js.map +1 -1
- package/package.json +4 -4
|
@@ -93,7 +93,7 @@ const MOBILE_APP_CATALOG = [
|
|
|
93
93
|
nativeRoute: "characters-native",
|
|
94
94
|
surfaceSlug: "character"
|
|
95
95
|
},
|
|
96
|
-
// Word, Excel, PowerPoint and PDF files, pictures, interface designs
|
|
96
|
+
// Word, Excel, PowerPoint and PDF files, pictures, interface designs, research posters and animations,
|
|
97
97
|
// each in its own browser editor (yantra-office).
|
|
98
98
|
{
|
|
99
99
|
key: "word",
|
|
@@ -164,6 +164,16 @@ const MOBILE_APP_CATALOG = [
|
|
|
164
164
|
// Posters replaced Paper 2 Poster: a tile pinned under the old key stays pinned.
|
|
165
165
|
supersedes: "paper2poster"
|
|
166
166
|
},
|
|
167
|
+
{
|
|
168
|
+
key: "motion",
|
|
169
|
+
label: "Motion",
|
|
170
|
+
// Frames playing in sequence, not Clips' or Remix's film: an animation, not a video library.
|
|
171
|
+
icon: "animation-play-outline",
|
|
172
|
+
group: "Office",
|
|
173
|
+
prompt: "Make an animated title card that says Summer Sale and render it as an MP4",
|
|
174
|
+
nativeRoute: "webbuilder",
|
|
175
|
+
surfaceSlug: "motion"
|
|
176
|
+
},
|
|
167
177
|
{
|
|
168
178
|
key: "chat-native",
|
|
169
179
|
label: "Chats",
|
|
@@ -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 and research posters,\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: '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_GRO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A,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;AArkBhK,IAAA,IAAA,EAAA,EAAA,EAAA;AAqkBoK,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\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;AAA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AA,CAAK,UAAU,CAAA,CAAE,MAAO,CAAA,OAAO,CAAC,CAAA;AAC3E,EAAO,OAAA,KAAA,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,4 +1,4 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import*as React from'react';import {StyleSheet,Platform,Modal,KeyboardAvoidingView,Pressable,Text,View,TextInput}from'react-native';import {requireNativeViewManager,requireOptionalNativeModule}from'expo-modules-core';import {SafeAreaView}from'react-native-safe-area-context';import AsyncStorage from'@react-native-async-storage/async-storage';import {helperConsentGiven,rememberHelperConsent}from'./cubeforgeHelper.js';const MAX_CHAT_CHARS = 200;
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import*as React from'react';import {StyleSheet,Platform,Modal,KeyboardAvoidingView,Pressable,Text,View,TextInput}from'react-native';import {requireNativeViewManager,requireOptionalNativeModule}from'expo-modules-core';import {SafeAreaView}from'react-native-safe-area-context';import AsyncStorage from'@react-native-async-storage/async-storage';import {helperConsentGiven,askAndPreview,rememberHelperConsent}from'./cubeforgeHelper.js';const MAX_CHAT_CHARS = 200;
|
|
2
2
|
const SUPPORTED_PLATFORMS = /* @__PURE__ */ new Set(["ios", "android"]);
|
|
3
3
|
function nativeModule() {
|
|
4
4
|
if (!SUPPORTED_PLATFORMS.has(Platform.OS)) return null;
|
|
@@ -81,17 +81,7 @@ function cubeforge3DComponent() {
|
|
|
81
81
|
else setAskingConsent(true);
|
|
82
82
|
};
|
|
83
83
|
const askHelper = async (message) => {
|
|
84
|
-
|
|
85
|
-
if (!handle || !helper) return;
|
|
86
|
-
const snapshot = await handle.helperSnapshot();
|
|
87
|
-
if (!snapshot) return;
|
|
88
|
-
await handle.helperSay("Let me take a look...");
|
|
89
|
-
const answer = await helper.ask(message, snapshot);
|
|
90
|
-
if (answer.reply) await handle.helperSay(answer.reply);
|
|
91
|
-
if (answer.plan) {
|
|
92
|
-
const blocks = await handle.helperPropose(JSON.stringify(answer.plan));
|
|
93
|
-
if (blocks <= 0) await handle.helperSay("I could not find a good spot for that here.");
|
|
94
|
-
}
|
|
84
|
+
if (engine.current && helper) await askAndPreview(engine.current, helper, message);
|
|
95
85
|
};
|
|
96
86
|
return /* @__PURE__ */ jsxs(SafeAreaView, { edges: ["bottom", "left", "right"], style: styles.fill, children: [
|
|
97
87
|
/* @__PURE__ */ jsx(NativeCubeforge, { ref: engine, style: styles.fill, seed, worldKey, room, skin, onExit: (event) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cubeforge3D.js","sources":["../../../src/features/games/cubeforge3D.tsx"],"sourcesContent":["/**\n * Cubeforge 3D: the native Rust engine (portable-devices/mobile/modules/\n * yantra-cubeforge, Metal on iOS, Vulkan or GL on Android) as the `cubeforge3D`\n * component Yantra Games shows behind \"Play in 3D\".\n *\n * Optional on purpose: an over-the-air JS update can reach a binary built\n * before the module existed, and 32-bit Android phones have no engine. Both\n * read as \"no module\", and Yantra Games then simply hides \"Play in 3D\".\n */\nimport * as React from 'react';\nimport {\n KeyboardAvoidingView,\n Modal,\n Platform,\n Pressable,\n StyleSheet,\n Text,\n TextInput,\n View,\n type ViewProps,\n} from 'react-native';\nimport { requireNativeViewManager, requireOptionalNativeModule } from 'expo-modules-core';\nimport { SafeAreaView } from 'react-native-safe-area-context';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport { helperConsentGiven, rememberHelperConsent } from './cubeforgeHelper';\nimport type { Cubeforge3DProps } from './vendored';\n\ninterface NativeCubeforgeProps extends ViewProps {\n seed: number;\n worldKey: string;\n room?: Cubeforge3DProps['room'];\n skin?: string;\n onExit: (event: { nativeEvent?: { summary?: string } }) => void;\n onOpenChat: () => void;\n onOpenHelper: () => void;\n helperEnabled: boolean;\n onRoomClosed: () => void;\n onTokenExpired: () => void;\n}\n\ninterface NativeCubeforgeHandle {\n sendChat: (text: string) => Promise<boolean>;\n helperSnapshot: () => Promise<string | null>;\n helperPropose: (plan: string) => Promise<number>;\n helperSay: (text: string) => Promise<boolean>;\n}\n\ntype NativeCubeforgeView = React.ComponentType<NativeCubeforgeProps & React.RefAttributes<NativeCubeforgeHandle>>;\n\ninterface NativeCubeforgeModule {\n deleteWorld?: (worldKey: string) => void;\n /** Address of the world's saved picture; absent on older binaries. */\n picturePath?: (worldKey: string) => string | null;\n /** Android only: false on a CPU the engine is not built for. */\n engineAvailable?: boolean;\n}\n\nconst MAX_CHAT_CHARS = 200;\n\nconst SUPPORTED_PLATFORMS = new Set(['ios', 'android']);\n\nfunction nativeModule(): NativeCubeforgeModule | null {\n if (!SUPPORTED_PLATFORMS.has(Platform.OS)) return null;\n const module = requireOptionalNativeModule<NativeCubeforgeModule>('YantraCubeforge');\n return module?.engineAvailable === false ? null : module;\n}\n\n/** Whether this binary's engine can join shared worlds. Older ones cannot. */\nexport function cubeforgeFriendsSupported(): boolean {\n return typeof nativeModule()?.deleteWorld === 'function';\n}\n\n/** Remove a 3D world's save from this device. */\nexport function deleteCubeforgeSave(worldKey: string): void {\n nativeModule()?.deleteWorld?.(worldKey);\n}\n\n/** Address of a 3D world's saved picture, or null when it has none. */\nexport function cubeforgePicture(worldKey: string): string | null {\n return nativeModule()?.picturePath?.(worldKey) ?? null;\n}\n\nconst BEAUTIFY_MESSAGE = 'Make what I built look better';\n\nfunction HelperConsent({ onAgree, onClose }: { onAgree: () => void; onClose: () => void }) {\n return (\n <Modal transparent visible animationType=\"fade\" onRequestClose={onClose}>\n <View style={styles.consentBackdrop}>\n <View style={styles.consentCard}>\n <Text style={styles.consentTitle}>Your build helper</Text>\n <Text style={styles.consentBody}>\n To suggest ideas, your helper sends Yantra's AI the blocks around you and what you type.\n Your name, your friends and your chats are not sent.\n </Text>\n <View style={styles.consentRow}>\n <Pressable accessibilityRole=\"button\" onPress={onClose} style={styles.consentSecondary}>\n <Text style={styles.consentSecondaryLabel}>Not now</Text>\n </Pressable>\n <Pressable accessibilityRole=\"button\" onPress={onAgree} style={styles.chatSend}>\n <Text style={styles.chatSendLabel}>OK</Text>\n </Pressable>\n </View>\n </View>\n </View>\n </Modal>\n );\n}\n\nfunction ChatBar({\n onSend,\n onClose,\n placeholder = 'Message everyone here',\n quickAsk,\n}: {\n onSend: (text: string) => void;\n onClose: () => void;\n placeholder?: string;\n quickAsk?: { label: string; message: string };\n}) {\n const [draft, setDraft] = React.useState('');\n const send = () => {\n const text = draft.trim();\n if (text) onSend(text);\n onClose();\n };\n return (\n <Modal transparent visible animationType=\"fade\" onRequestClose={onClose}>\n <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : undefined} style={styles.fillClear}>\n <Pressable accessibilityLabel=\"Close chat\" style={styles.fillClear} onPress={onClose} />\n {quickAsk ? (\n <Pressable\n accessibilityRole=\"button\"\n onPress={() => {\n onSend(quickAsk.message);\n onClose();\n }}\n style={styles.quickAsk}\n >\n <Text style={styles.chatSendLabel}>{quickAsk.label}</Text>\n </Pressable>\n ) : null}\n <View style={styles.chatBar}>\n <TextInput\n autoFocus\n value={draft}\n onChangeText={setDraft}\n onSubmitEditing={send}\n maxLength={MAX_CHAT_CHARS}\n placeholder={placeholder}\n placeholderTextColor=\"#94a3b8\"\n returnKeyType=\"send\"\n style={styles.chatInput}\n />\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Send\"\n onPress={send}\n style={styles.chatSend}\n >\n <Text style={styles.chatSendLabel}>Send</Text>\n </Pressable>\n </View>\n </KeyboardAvoidingView>\n </Modal>\n );\n}\n\nlet cached: React.ComponentType<Cubeforge3DProps> | null | undefined;\n\n/** The 3D component when this binary ships the engine, otherwise null. */\nexport function cubeforge3DComponent(): React.ComponentType<Cubeforge3DProps> | null {\n if (cached !== undefined) return cached;\n cached = null;\n try {\n if (!nativeModule()) return cached;\n const NativeCubeforge = requireNativeViewManager<NativeCubeforgeProps>(\n 'YantraCubeforge',\n ) as unknown as NativeCubeforgeView;\n cached = function Cubeforge3D({\n seed,\n worldKey,\n room,\n skin,\n onExit,\n onRoomClosed,\n onTokenExpired,\n helper,\n }: Cubeforge3DProps) {\n const engine = React.useRef<NativeCubeforgeHandle>(null);\n const [chatting, setChatting] = React.useState(false);\n const [asking, setAsking] = React.useState(false);\n const [askingConsent, setAskingConsent] = React.useState(false);\n\n const openHelper = async () => {\n if (await helperConsentGiven(AsyncStorage)) setAsking(true);\n else setAskingConsent(true);\n };\n\n const askHelper = async (message: string) => {\n const handle = engine.current;\n if (!handle || !helper) return;\n const snapshot = await handle.helperSnapshot();\n if (!snapshot) return;\n await handle.helperSay('Let me take a look...');\n const answer = await helper.ask(message, snapshot);\n if (answer.reply) await handle.helperSay(answer.reply);\n if (answer.plan) {\n const blocks = await handle.helperPropose(JSON.stringify(answer.plan));\n if (blocks <= 0) await handle.helperSay('I could not find a good spot for that here.');\n }\n };\n\n // The engine draws edge to edge; keep its HUD clear of the home indicator.\n return (\n <SafeAreaView edges={['bottom', 'left', 'right']} style={styles.fill}>\n <NativeCubeforge\n ref={engine}\n style={styles.fill}\n seed={seed}\n worldKey={worldKey}\n room={room}\n skin={skin}\n onExit={(event) => onExit(event.nativeEvent?.summary || undefined)}\n helperEnabled={Boolean(helper)}\n onOpenHelper={() => void openHelper().catch(() => undefined)}\n onOpenChat={() => setChatting(true)}\n onRoomClosed={() => onRoomClosed?.()}\n onTokenExpired={() => onTokenExpired?.()}\n />\n {chatting ? (\n <ChatBar\n onSend={(text) => {\n engine.current?.sendChat(text).catch(() => undefined);\n }}\n onClose={() => setChatting(false)}\n />\n ) : null}\n {asking ? (\n <ChatBar\n placeholder=\"Ask your helper\"\n quickAsk={{ label: 'Beautify what I built', message: BEAUTIFY_MESSAGE }}\n onSend={(text) => void askHelper(text).catch(() => undefined)}\n onClose={() => setAsking(false)}\n />\n ) : null}\n {askingConsent ? (\n <HelperConsent\n onClose={() => setAskingConsent(false)}\n onAgree={() => {\n setAskingConsent(false);\n setAsking(true);\n void rememberHelperConsent(AsyncStorage).catch(() => undefined);\n }}\n />\n ) : null}\n </SafeAreaView>\n );\n };\n } catch {\n cached = null;\n }\n return cached;\n}\n\nconst styles = StyleSheet.create({\n fill: { flex: 1, backgroundColor: '#000' },\n fillClear: { flex: 1 },\n chatBar: { flexDirection: 'row', alignItems: 'center', gap: 8, padding: 10, backgroundColor: '#12161b' },\n chatInput: {\n flex: 1,\n minHeight: 44,\n borderRadius: 10,\n paddingHorizontal: 12,\n color: '#f1f5f9',\n backgroundColor: '#242b33',\n fontSize: 16,\n },\n chatSend: {\n minHeight: 44,\n minWidth: 64,\n borderRadius: 10,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#3f7fbf',\n },\n chatSendLabel: { color: '#ffffff', fontSize: 15, fontWeight: '600' },\n quickAsk: {\n alignSelf: 'flex-start',\n marginLeft: 10,\n marginBottom: 8,\n minHeight: 40,\n paddingHorizontal: 14,\n borderRadius: 20,\n justifyContent: 'center',\n backgroundColor: '#3f7fbf',\n },\n consentBackdrop: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: 24, backgroundColor: 'rgba(0,0,0,0.55)' },\n consentCard: { maxWidth: 420, width: '100%', gap: 12, padding: 20, borderRadius: 14, backgroundColor: '#12161b' },\n consentTitle: { color: '#f1f5f9', fontSize: 18, fontWeight: '700' },\n consentBody: { color: '#cbd5e1', fontSize: 15, lineHeight: 21 },\n consentRow: { flexDirection: 'row', justifyContent: 'flex-end', gap: 8 },\n consentSecondary: { minHeight: 44, minWidth: 80, alignItems: 'center', justifyContent: 'center' },\n consentSecondaryLabel: { color: '#cbd5e1', fontSize: 15, fontWeight: '600' },\n});\n"],"names":[],"mappings":"4cA8CA,MAAM,cAAiB,GAAA,GAAA;AACvB,MAAM,sCAA0B,IAAA,GAAA,CAAI,CAAC,KAAA,EAAO,SAAS,CAAC,CAAA;AACtD,SAAS,YAA6C,GAAA;AACpD,EAAA,IAAI,CAAC,mBAAoB,CAAA,GAAA,CAAI,QAAS,CAAA,EAAE,GAAU,OAAA,IAAA;AAClD,EAAM,MAAA,MAAA,GAAS,4BAAmD,iBAAiB,CAAA;AACnF,EAAO,OAAA,CAAA,MAAA,IAAA,IAAA,GAAA,MAAA,GAAA,MAAA,CAAQ,eAAoB,MAAA,KAAA,GAAQ,IAAO,GAAA,MAAA;AACpD;AAGO,SAAS,yBAAqC,GAAA;AAvDrD,EAAA,IAAA,EAAA;AAwDE,EAAA,OAAO,QAAO,CAAA,EAAA,GAAA,YAAA,EAAA,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAAgB,WAAgB,CA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AAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,WAAa,EAAA;AAAA,IACX,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,UAAY,EAAA;AAAA,IACV,aAAe,EAAA,KAAA;AAAA,IACf,cAAgB,EAAA,UAAA;AAAA,IAChB,GAAK,EAAA;AAAA,GACP;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,SAAW,EAAA,EAAA;AAAA,IACX,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,qBAAuB,EAAA;AAAA,IACrB,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"cubeforge3D.js","sources":["../../../src/features/games/cubeforge3D.tsx"],"sourcesContent":["/**\n * Cubeforge 3D: the native Rust engine (portable-devices/mobile/modules/\n * yantra-cubeforge, Metal on iOS, Vulkan or GL on Android) as the `cubeforge3D`\n * component Yantra Games shows behind \"Play in 3D\".\n *\n * Optional on purpose: an over-the-air JS update can reach a binary built\n * before the module existed, and 32-bit Android phones have no engine. Both\n * read as \"no module\", and Yantra Games then simply hides \"Play in 3D\".\n */\nimport * as React from 'react';\nimport {\n KeyboardAvoidingView,\n Modal,\n Platform,\n Pressable,\n StyleSheet,\n Text,\n TextInput,\n View,\n type ViewProps,\n} from 'react-native';\nimport { requireNativeViewManager, requireOptionalNativeModule } from 'expo-modules-core';\nimport { SafeAreaView } from 'react-native-safe-area-context';\nimport AsyncStorage from '@react-native-async-storage/async-storage';\nimport { askAndPreview, helperConsentGiven, rememberHelperConsent } from './cubeforgeHelper';\nimport type { Cubeforge3DProps } from './vendored';\n\ninterface NativeCubeforgeProps extends ViewProps {\n seed: number;\n worldKey: string;\n room?: Cubeforge3DProps['room'];\n skin?: string;\n onExit: (event: { nativeEvent?: { summary?: string } }) => void;\n onOpenChat: () => void;\n onOpenHelper: () => void;\n helperEnabled: boolean;\n onRoomClosed: () => void;\n onTokenExpired: () => void;\n}\n\ninterface NativeCubeforgeHandle {\n sendChat: (text: string) => Promise<boolean>;\n helperSnapshot: () => Promise<string | null>;\n helperPropose: (plan: string) => Promise<number>;\n helperSay: (text: string) => Promise<boolean>;\n}\n\ntype NativeCubeforgeView = React.ComponentType<NativeCubeforgeProps & React.RefAttributes<NativeCubeforgeHandle>>;\n\ninterface NativeCubeforgeModule {\n deleteWorld?: (worldKey: string) => void;\n /** Address of the world's saved picture; absent on older binaries. */\n picturePath?: (worldKey: string) => string | null;\n /** Android only: false on a CPU the engine is not built for. */\n engineAvailable?: boolean;\n}\n\nconst MAX_CHAT_CHARS = 200;\n\nconst SUPPORTED_PLATFORMS = new Set(['ios', 'android']);\n\nfunction nativeModule(): NativeCubeforgeModule | null {\n if (!SUPPORTED_PLATFORMS.has(Platform.OS)) return null;\n const module = requireOptionalNativeModule<NativeCubeforgeModule>('YantraCubeforge');\n return module?.engineAvailable === false ? null : module;\n}\n\n/** Whether this binary's engine can join shared worlds. Older ones cannot. */\nexport function cubeforgeFriendsSupported(): boolean {\n return typeof nativeModule()?.deleteWorld === 'function';\n}\n\n/** Remove a 3D world's save from this device. */\nexport function deleteCubeforgeSave(worldKey: string): void {\n nativeModule()?.deleteWorld?.(worldKey);\n}\n\n/** Address of a 3D world's saved picture, or null when it has none. */\nexport function cubeforgePicture(worldKey: string): string | null {\n return nativeModule()?.picturePath?.(worldKey) ?? null;\n}\n\nconst BEAUTIFY_MESSAGE = 'Make what I built look better';\n\nfunction HelperConsent({ onAgree, onClose }: { onAgree: () => void; onClose: () => void }) {\n return (\n <Modal transparent visible animationType=\"fade\" onRequestClose={onClose}>\n <View style={styles.consentBackdrop}>\n <View style={styles.consentCard}>\n <Text style={styles.consentTitle}>Your build helper</Text>\n <Text style={styles.consentBody}>\n To suggest ideas, your helper sends Yantra's AI the blocks around you and what you type.\n Your name, your friends and your chats are not sent.\n </Text>\n <View style={styles.consentRow}>\n <Pressable accessibilityRole=\"button\" onPress={onClose} style={styles.consentSecondary}>\n <Text style={styles.consentSecondaryLabel}>Not now</Text>\n </Pressable>\n <Pressable accessibilityRole=\"button\" onPress={onAgree} style={styles.chatSend}>\n <Text style={styles.chatSendLabel}>OK</Text>\n </Pressable>\n </View>\n </View>\n </View>\n </Modal>\n );\n}\n\nfunction ChatBar({\n onSend,\n onClose,\n placeholder = 'Message everyone here',\n quickAsk,\n}: {\n onSend: (text: string) => void;\n onClose: () => void;\n placeholder?: string;\n quickAsk?: { label: string; message: string };\n}) {\n const [draft, setDraft] = React.useState('');\n const send = () => {\n const text = draft.trim();\n if (text) onSend(text);\n onClose();\n };\n return (\n <Modal transparent visible animationType=\"fade\" onRequestClose={onClose}>\n <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : undefined} style={styles.fillClear}>\n <Pressable accessibilityLabel=\"Close chat\" style={styles.fillClear} onPress={onClose} />\n {quickAsk ? (\n <Pressable\n accessibilityRole=\"button\"\n onPress={() => {\n onSend(quickAsk.message);\n onClose();\n }}\n style={styles.quickAsk}\n >\n <Text style={styles.chatSendLabel}>{quickAsk.label}</Text>\n </Pressable>\n ) : null}\n <View style={styles.chatBar}>\n <TextInput\n autoFocus\n value={draft}\n onChangeText={setDraft}\n onSubmitEditing={send}\n maxLength={MAX_CHAT_CHARS}\n placeholder={placeholder}\n placeholderTextColor=\"#94a3b8\"\n returnKeyType=\"send\"\n style={styles.chatInput}\n />\n <Pressable\n accessibilityRole=\"button\"\n accessibilityLabel=\"Send\"\n onPress={send}\n style={styles.chatSend}\n >\n <Text style={styles.chatSendLabel}>Send</Text>\n </Pressable>\n </View>\n </KeyboardAvoidingView>\n </Modal>\n );\n}\n\nlet cached: React.ComponentType<Cubeforge3DProps> | null | undefined;\n\n/** The 3D component when this binary ships the engine, otherwise null. */\nexport function cubeforge3DComponent(): React.ComponentType<Cubeforge3DProps> | null {\n if (cached !== undefined) return cached;\n cached = null;\n try {\n if (!nativeModule()) return cached;\n const NativeCubeforge = requireNativeViewManager<NativeCubeforgeProps>(\n 'YantraCubeforge',\n ) as unknown as NativeCubeforgeView;\n cached = function Cubeforge3D({\n seed,\n worldKey,\n room,\n skin,\n onExit,\n onRoomClosed,\n onTokenExpired,\n helper,\n }: Cubeforge3DProps) {\n const engine = React.useRef<NativeCubeforgeHandle>(null);\n const [chatting, setChatting] = React.useState(false);\n const [asking, setAsking] = React.useState(false);\n const [askingConsent, setAskingConsent] = React.useState(false);\n\n const openHelper = async () => {\n if (await helperConsentGiven(AsyncStorage)) setAsking(true);\n else setAskingConsent(true);\n };\n\n const askHelper = async (message: string) => {\n if (engine.current && helper) await askAndPreview(engine.current, helper, message);\n };\n\n // The engine draws edge to edge; keep its HUD clear of the home indicator.\n return (\n <SafeAreaView edges={['bottom', 'left', 'right']} style={styles.fill}>\n <NativeCubeforge\n ref={engine}\n style={styles.fill}\n seed={seed}\n worldKey={worldKey}\n room={room}\n skin={skin}\n onExit={(event) => onExit(event.nativeEvent?.summary || undefined)}\n helperEnabled={Boolean(helper)}\n onOpenHelper={() => void openHelper().catch(() => undefined)}\n onOpenChat={() => setChatting(true)}\n onRoomClosed={() => onRoomClosed?.()}\n onTokenExpired={() => onTokenExpired?.()}\n />\n {chatting ? (\n <ChatBar\n onSend={(text) => {\n engine.current?.sendChat(text).catch(() => undefined);\n }}\n onClose={() => setChatting(false)}\n />\n ) : null}\n {asking ? (\n <ChatBar\n placeholder=\"Ask your helper\"\n quickAsk={{ label: 'Beautify what I built', message: BEAUTIFY_MESSAGE }}\n onSend={(text) => void askHelper(text).catch(() => undefined)}\n onClose={() => setAsking(false)}\n />\n ) : null}\n {askingConsent ? (\n <HelperConsent\n onClose={() => setAskingConsent(false)}\n onAgree={() => {\n setAskingConsent(false);\n setAsking(true);\n void rememberHelperConsent(AsyncStorage).catch(() => undefined);\n }}\n />\n ) : null}\n </SafeAreaView>\n );\n };\n } catch {\n cached = null;\n }\n return cached;\n}\n\nconst styles = StyleSheet.create({\n fill: { flex: 1, backgroundColor: '#000' },\n fillClear: { flex: 1 },\n chatBar: { flexDirection: 'row', alignItems: 'center', gap: 8, padding: 10, backgroundColor: '#12161b' },\n chatInput: {\n flex: 1,\n minHeight: 44,\n borderRadius: 10,\n paddingHorizontal: 12,\n color: '#f1f5f9',\n backgroundColor: '#242b33',\n fontSize: 16,\n },\n chatSend: {\n minHeight: 44,\n minWidth: 64,\n borderRadius: 10,\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#3f7fbf',\n },\n chatSendLabel: { color: '#ffffff', fontSize: 15, fontWeight: '600' },\n quickAsk: {\n alignSelf: 'flex-start',\n marginLeft: 10,\n marginBottom: 8,\n minHeight: 40,\n paddingHorizontal: 14,\n borderRadius: 20,\n justifyContent: 'center',\n backgroundColor: '#3f7fbf',\n },\n consentBackdrop: { flex: 1, alignItems: 'center', justifyContent: 'center', padding: 24, backgroundColor: 'rgba(0,0,0,0.55)' },\n consentCard: { maxWidth: 420, width: '100%', gap: 12, padding: 20, borderRadius: 14, backgroundColor: '#12161b' },\n consentTitle: { color: '#f1f5f9', fontSize: 18, fontWeight: '700' },\n consentBody: { color: '#cbd5e1', fontSize: 15, lineHeight: 21 },\n consentRow: { flexDirection: 'row', justifyContent: 'flex-end', gap: 8 },\n consentSecondary: { minHeight: 44, minWidth: 80, alignItems: 'center', justifyContent: 'center' },\n consentSecondaryLabel: { color: '#cbd5e1', fontSize: 15, fontWeight: '600' },\n});\n"],"names":[],"mappings":"0dA8CA,MAAM,cAAiB,GAAA,GAAA;AACvB,MAAM,sCAA0B,IAAA,GAAA,CAAI,CAAC,KAAA,EAAO,SAAS,CAAC,CAAA;AACtD,SAAS,YAA6C,GAAA;AACpD,EAAA,IAAI,CAAC,mBAAoB,CAAA,GAAA,CAAI,QAAS,CAAA,EAAE,GAAU,OA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A,IACV,aAAe,EAAA,KAAA;AAAA,IACf,cAAgB,EAAA,UAAA;AAAA,IAChB,GAAK,EAAA;AAAA,GACP;AAAA,EACA,gBAAkB,EAAA;AAAA,IAChB,SAAW,EAAA,EAAA;AAAA,IACX,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA,QAAA;AAAA,IACZ,cAAgB,EAAA;AAAA,GAClB;AAAA,EACA,qBAAuB,EAAA;AAAA,IACrB,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA;AAEhB,CAAC,CAAA"}
|
|
@@ -6,6 +6,8 @@ const DAILY_HELPER_LIMIT = 20;
|
|
|
6
6
|
const MAX_NAME_CHARS = 24;
|
|
7
7
|
const LIMIT_REPLY = "That is all the help I can give today. Come back tomorrow!";
|
|
8
8
|
const UNAVAILABLE_REPLY = "I cannot reach my workshop right now. Please try again soon.";
|
|
9
|
+
const TOO_TIGHT_REPLY = "This spot is too tight. Walk somewhere more open and tap ASK again.";
|
|
10
|
+
const DID_NOT_FIT = "Your last plan did not fit, so use only cells marked with a dot.";
|
|
9
11
|
const CONSENT_KEY = "yantra.cubeforge.helperConsent.v1";
|
|
10
12
|
const USAGE_KEY = "yantra.cubeforge.helperUsage.v1";
|
|
11
13
|
function asRecord(value) {
|
|
@@ -42,6 +44,25 @@ async function helperConsentGiven(storage) {
|
|
|
42
44
|
async function rememberHelperConsent(storage) {
|
|
43
45
|
await storage.setItem(CONSENT_KEY, "1");
|
|
44
46
|
}
|
|
47
|
+
async function askAndPreview(game, helper, message) {
|
|
48
|
+
const snapshot = await game.helperSnapshot();
|
|
49
|
+
if (!snapshot) return;
|
|
50
|
+
await game.helperSay("Let me take a look...");
|
|
51
|
+
const shown = async (answer2) => answer2.plan !== null && await game.helperPropose(JSON.stringify(answer2.plan)) > 0;
|
|
52
|
+
let answer = await helper.ask(message, snapshot);
|
|
53
|
+
if (answer.plan !== null && !await shown(answer)) {
|
|
54
|
+
const fresh = await game.helperSnapshot();
|
|
55
|
+
answer = fresh ? await helper.ask(`${DID_NOT_FIT} ${message}`, fresh) : {
|
|
56
|
+
reply: "",
|
|
57
|
+
plan: null
|
|
58
|
+
};
|
|
59
|
+
if (!await shown(answer)) {
|
|
60
|
+
await game.helperSay(TOO_TIGHT_REPLY);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (answer.reply) await game.helperSay(answer.reply);
|
|
65
|
+
}
|
|
45
66
|
function createCubeforgeHelper(deps) {
|
|
46
67
|
var _a;
|
|
47
68
|
const {
|
|
@@ -102,4 +123,4 @@ function createCubeforgeHelper(deps) {
|
|
|
102
123
|
}
|
|
103
124
|
}
|
|
104
125
|
};
|
|
105
|
-
}export{DAILY_HELPER_LIMIT,HELPER_ACTION,HELPER_CONNECTOR,LIMIT_REPLY,UNAVAILABLE_REPLY,createCubeforgeHelper,helperConsentGiven,rememberHelperConsent};//# sourceMappingURL=cubeforgeHelper.js.map
|
|
126
|
+
}export{DAILY_HELPER_LIMIT,HELPER_ACTION,HELPER_CONNECTOR,LIMIT_REPLY,TOO_TIGHT_REPLY,UNAVAILABLE_REPLY,askAndPreview,createCubeforgeHelper,helperConsentGiven,rememberHelperConsent};//# sourceMappingURL=cubeforgeHelper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cubeforgeHelper.js","sources":["../../../src/features/games/cubeforgeHelper.ts"],"sourcesContent":["/**\n * The game's build helper, reached through a connector the way Dictate reaches\n * its AI. What goes out is the blocks around the player and what they typed; no\n * name, chat or friend is ever part of it.\n */\nimport type { RemoteConnectorExec } from '../canvas/videoEditor/remoteMediaClient';\nimport type { CubeforgeHelper, HelperAnswer } from './vendored';\n\nexport const HELPER_CONNECTOR = 'yantra-games';\nexport const HELPER_ACTION = 'YANTRA_GAMES_HELPER';\nconst HELPER_TIMEOUT_MS = 90_000;\nconst NAME_TIMEOUT_MS = 30_000;\n/** A day's worth of asking, kept on this device. */\nexport const DAILY_HELPER_LIMIT = 20;\nconst MAX_NAME_CHARS = 24;\n\nexport const LIMIT_REPLY = 'That is all the help I can give today. Come back tomorrow!';\nexport const UNAVAILABLE_REPLY = 'I cannot reach my workshop right now. Please try again soon.';\n\nconst CONSENT_KEY = 'yantra.cubeforge.helperConsent.v1';\nconst USAGE_KEY = 'yantra.cubeforge.helperUsage.v1';\n\nexport interface HelperStorage {\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n}\n\ntype Json = Record<string, unknown>;\n\nfunction asRecord(value: unknown): Json | null {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as Json) : null;\n}\n\n/** The first layer of the reply (itself, its `data`, its `result`...) holding `key`. */\nfunction findLayer(raw: unknown, key: string): Json | null {\n let layer = asRecord(raw);\n for (let depth = 0; layer && depth < 6; depth += 1) {\n if (key in layer) return layer;\n layer = asRecord(layer.data) ?? asRecord(layer.result);\n }\n return null;\n}\n\nfunction dayOf(now: number): string {\n return new Date(now).toISOString().slice(0, 10);\n}\n\nasync function usedToday(storage: HelperStorage, now: number): Promise<number> {\n try {\n const saved = JSON.parse((await storage.getItem(USAGE_KEY)) ?? '{}') as { day?: string; used?: number };\n return saved.day === dayOf(now) ? Number(saved.used) || 0 : 0;\n } catch {\n return 0;\n }\n}\n\nexport async function helperConsentGiven(storage: HelperStorage): Promise<boolean> {\n try {\n return (await storage.getItem(CONSENT_KEY)) === '1';\n } catch {\n return false;\n }\n}\n\nexport async function rememberHelperConsent(storage: HelperStorage): Promise<void> {\n await storage.setItem(CONSENT_KEY, '1');\n}\n\nexport function createCubeforgeHelper(deps: {\n exec: RemoteConnectorExec;\n storage: HelperStorage;\n now?: () => number;\n}): CubeforgeHelper {\n const { exec, storage } = deps;\n const now = deps.now ?? Date.now;\n return {\n ask: async (message, snapshot): Promise<HelperAnswer> => {\n const today = await usedToday(storage, now());\n if (today >= DAILY_HELPER_LIMIT) return { reply: LIMIT_REPLY, plan: null };\n try {\n const raw = await exec(\n HELPER_CONNECTOR,\n HELPER_ACTION,\n { mode: 'build', message, snapshot: JSON.parse(snapshot) as unknown },\n { timeoutMs: HELPER_TIMEOUT_MS },\n );\n const layer = findLayer(raw, 'reply');\n if (!layer) return { reply: UNAVAILABLE_REPLY, plan: null };\n await storage\n .setItem(USAGE_KEY, JSON.stringify({ day: dayOf(now()), used: today + 1 }))\n .catch(() => undefined);\n return { reply: typeof layer.reply === 'string' ? layer.reply : '', plan: layer.plan ?? null };\n } catch {\n return { reply: UNAVAILABLE_REPLY, plan: null };\n }\n },\n nameWorld: async (summary) => {\n try {\n const raw = await exec(\n HELPER_CONNECTOR,\n HELPER_ACTION,\n { mode: 'name', summary: JSON.parse(summary) as unknown },\n { timeoutMs: NAME_TIMEOUT_MS },\n );\n const name = findLayer(raw, 'name')?.name;\n const clean = typeof name === 'string' ? name.trim().slice(0, MAX_NAME_CHARS) : '';\n return clean || null;\n } catch {\n return null;\n }\n },\n };\n}\n"],"names":["_a"],"mappings":"AAOO,MAAM,gBAAmB,GAAA;AACzB,MAAM,aAAgB,GAAA;AAC7B,MAAM,iBAAoB,GAAA,GAAA;AAC1B,MAAM,eAAkB,GAAA,GAAA;AAEjB,MAAM,kBAAqB,GAAA;AAClC,MAAM,cAAiB,GAAA,EAAA;AAChB,MAAM,WAAc,GAAA;AACpB,MAAM,iBAAoB,GAAA;AACjC,MAAM,WAAc,GAAA,mCAAA;AACpB,MAAM,SAAY,GAAA,iCAAA;AAMlB,SAAS,SAAS,KAA6B,EAAA;AAC7C,EAAO,OAAA,KAAA,IAAS,OAAO,KAAU,KAAA,QAAA,IAAY,CAAC,KAAM,CAAA,OAAA,CAAQ,KAAK,CAAA,GAAI,KAAgB,GAAA,IAAA;AACvF;AAGA,SAAS,SAAA,CAAU,KAAc,GAA0B,EAAA;AA5B3D,EAAA,IAAA,EAAA;AA6BE,EAAI,IAAA,KAAA,GAAQ,SAAS,GAAG,CAAA;AACxB,EAAA,KAAA,IAAS,QAAQ,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KAAM,CAAA,IAAA,KAAN,OAAAA,GAAc,GAAA;AAAA,SACtB;AAAA,OACM,CAAA,OAAA,CAAA,EAAA;AACN,QAAO,OAAA;AAAA,UACL,KAAO,EAAA,iBAAA;AAAA,UACP,IAAM,EAAA;AAAA,SACR;AAAA;AACF,KACF;AAAA,IACA,SAAA,EAAW,OAAM,OAAW,KAAA;AAzGhC,MAAAA,IAAAA,GAAAA;AA0GM,MAAI,IAAA;AACF,QAAA,MAAM,GAAM,GAAA,MAAM,IAAK,CAAA,gBAAA,EAAkB,aAAe,EAAA;AAAA,UACtD,IAAM,EAAA,MAAA;AAAA,UACN,OAAA,EAAS,IAAK,CAAA,KAAA,CAAM,OAAO;AAAA,SAC1B,EAAA;AAAA,UACD,SAAW,EAAA;AAAA,SACZ,CAAA;AACD,QAAA,MAAM,QAAOA,GAAA,GAAA,SAAA,CAAU,KAAK,MAAM,CAAA,KAArB,gBAAAA,GAAwB,CAAA,IAAA;AACrC,QAAM,MAAA,KAAA,GAAQ,OAAO,IAAA,KAAS,QAAW,GAAA,IAAA,CAAK,MAAO,CAAA,KAAA,CAAM,CAAG,EAAA,cAAc,CAAI,GAAA,EAAA;AAChF,QAAA,OAAO,KAAS,IAAA,IAAA;AAAA,OACV,CAAA,OAAA,CAAA,EAAA;AACN,QAAO,OAAA,IAAA;AAAA;AACT;AACF,GACF;AACF"}
|
|
1
|
+
{"version":3,"file":"cubeforgeHelper.js","sources":["../../../src/features/games/cubeforgeHelper.ts"],"sourcesContent":["/**\n * The game's build helper, reached through a connector the way Dictate reaches\n * its AI. What goes out is the blocks around the player and what they typed; no\n * name, chat or friend is ever part of it.\n */\nimport type { RemoteConnectorExec } from '../canvas/videoEditor/remoteMediaClient';\nimport type { CubeforgeHelper, HelperAnswer } from './vendored';\n\nexport const HELPER_CONNECTOR = 'yantra-games';\nexport const HELPER_ACTION = 'YANTRA_GAMES_HELPER';\nconst HELPER_TIMEOUT_MS = 90_000;\nconst NAME_TIMEOUT_MS = 30_000;\n/** A day's worth of asking, kept on this device. */\nexport const DAILY_HELPER_LIMIT = 20;\nconst MAX_NAME_CHARS = 24;\n\nexport const LIMIT_REPLY = 'That is all the help I can give today. Come back tomorrow!';\nexport const UNAVAILABLE_REPLY = 'I cannot reach my workshop right now. Please try again soon.';\n\nexport const TOO_TIGHT_REPLY = 'This spot is too tight. Walk somewhere more open and tap ASK again.';\n/** Goes first, because the connector keeps only so much of a message. */\nconst DID_NOT_FIT = 'Your last plan did not fit, so use only cells marked with a dot.';\n\nconst CONSENT_KEY = 'yantra.cubeforge.helperConsent.v1';\nconst USAGE_KEY = 'yantra.cubeforge.helperUsage.v1';\n\nexport interface HelperStorage {\n getItem(key: string): Promise<string | null>;\n setItem(key: string, value: string): Promise<void>;\n}\n\ntype Json = Record<string, unknown>;\n\nfunction asRecord(value: unknown): Json | null {\n return value && typeof value === 'object' && !Array.isArray(value) ? (value as Json) : null;\n}\n\n/** The first layer of the reply (itself, its `data`, its `result`...) holding `key`. */\nfunction findLayer(raw: unknown, key: string): Json | null {\n let layer = asRecord(raw);\n for (let depth = 0; layer && depth < 6; depth += 1) {\n if (key in layer) return layer;\n layer = asRecord(layer.data) ?? asRecord(layer.result);\n }\n return null;\n}\n\nfunction dayOf(now: number): string {\n return new Date(now).toISOString().slice(0, 10);\n}\n\nasync function usedToday(storage: HelperStorage, now: number): Promise<number> {\n try {\n const saved = JSON.parse((await storage.getItem(USAGE_KEY)) ?? '{}') as { day?: string; used?: number };\n return saved.day === dayOf(now) ? Number(saved.used) || 0 : 0;\n } catch {\n return 0;\n }\n}\n\nexport async function helperConsentGiven(storage: HelperStorage): Promise<boolean> {\n try {\n return (await storage.getItem(CONSENT_KEY)) === '1';\n } catch {\n return false;\n }\n}\n\nexport async function rememberHelperConsent(storage: HelperStorage): Promise<void> {\n await storage.setItem(CONSENT_KEY, '1');\n}\n\n/** What the helper needs from the running game. */\nexport interface HelperGame {\n helperSnapshot(): Promise<string | null>;\n helperPropose(plan: string): Promise<number>;\n helperSay(text: string): Promise<boolean>;\n}\n\n/**\n * One request from the player, start to finish. A plan that does not fit gets\n * one more try before the player hears anything, and a reply is only shown once\n * what it describes is really on screen.\n */\nexport async function askAndPreview(game: HelperGame, helper: CubeforgeHelper, message: string): Promise<void> {\n const snapshot = await game.helperSnapshot();\n if (!snapshot) return;\n await game.helperSay('Let me take a look...');\n const shown = async (answer: HelperAnswer) =>\n answer.plan !== null && (await game.helperPropose(JSON.stringify(answer.plan))) > 0;\n\n let answer = await helper.ask(message, snapshot);\n if (answer.plan !== null && !(await shown(answer))) {\n const fresh = await game.helperSnapshot();\n answer = fresh ? await helper.ask(`${DID_NOT_FIT} ${message}`, fresh) : { reply: '', plan: null };\n if (!(await shown(answer))) {\n await game.helperSay(TOO_TIGHT_REPLY);\n return;\n }\n }\n if (answer.reply) await game.helperSay(answer.reply);\n}\n\nexport function createCubeforgeHelper(deps: {\n exec: RemoteConnectorExec;\n storage: HelperStorage;\n now?: () => number;\n}): CubeforgeHelper {\n const { exec, storage } = deps;\n const now = deps.now ?? Date.now;\n return {\n ask: async (message, snapshot): Promise<HelperAnswer> => {\n const today = await usedToday(storage, now());\n if (today >= DAILY_HELPER_LIMIT) return { reply: LIMIT_REPLY, plan: null };\n try {\n const raw = await exec(\n HELPER_CONNECTOR,\n HELPER_ACTION,\n { mode: 'build', message, snapshot: JSON.parse(snapshot) as unknown },\n { timeoutMs: HELPER_TIMEOUT_MS },\n );\n const layer = findLayer(raw, 'reply');\n if (!layer) return { reply: UNAVAILABLE_REPLY, plan: null };\n await storage\n .setItem(USAGE_KEY, JSON.stringify({ day: dayOf(now()), used: today + 1 }))\n .catch(() => undefined);\n return { reply: typeof layer.reply === 'string' ? layer.reply : '', plan: layer.plan ?? null };\n } catch {\n return { reply: UNAVAILABLE_REPLY, plan: null };\n }\n },\n nameWorld: async (summary) => {\n try {\n const raw = await exec(\n HELPER_CONNECTOR,\n HELPER_ACTION,\n { mode: 'name', summary: JSON.parse(summary) as unknown },\n { timeoutMs: NAME_TIMEOUT_MS },\n );\n const name = findLayer(raw, 'name')?.name;\n const clean = typeof name === 'string' ? name.trim().slice(0, MAX_NAME_CHARS) : '';\n return clean || null;\n } catch {\n return null;\n }\n },\n };\n}\n"],"names":["answer","_a"],"mappings":"AAOO,MAAM,gBAAmB,GAAA;AACzB,MAAM,aAAgB,GAAA;AAC7B,MAAM,iBAAoB,GAAA,GAAA;AAC1B,MAAM,eAAkB,GAAA,GAAA;AAEjB,MAAM,kBAAqB,GAAA;AAClC,MAAM,cAAiB,GAAA,EAAA;AAChB,MAAM,WAAc,GAAA;AACpB,MAAM,iBAAoB,GAAA;AAC1B,MAAM,eAAkB,GAAA;AAE/B,MAAM,WAAc,GAAA,kEAAA;AACpB,MAAM,WAAc,GAAA,mCAAA;AACpB,MAAM,SAAY,GAAA,iCAAA;AAMlB,SAAS,SAAS,KAA6B,EAAA;AAC7C,EAAO,OAAA,KAAA,IAAS,OAAO,KAAU,KAAA,QAAA,IAAY,CAAC,KAAM,CAAA,OAAA,CAAQ,KAAK,CAAA,GAAI,KAAgB,GAAA,IAAA;AACvF;AAGA,SAAS,SAAA,CAAU,KAAc,GAA0B,EAAA;AA/B3D,EAAA,IAAA,EAAA;AAgCE,EAAI,IAAA,KAAA,GAAQ,SAAS,GAAG,CAAA;AACxB,EAAA,KAAA,IAAS,QAAQ,CAAG,EAAA,KAAA,IAAS,KAAQ,GAAA,CAAA,EAAG,SAAS,CAAG,EAAA;AAClD,IAAI,IAAA,GAAA,IAAO,OAAc,OAAA,KAAA;AACzB,IAAA,KAAA,GAAA,CAAQ,cAAS,KAAM,CAAA,IAAI,MAAnB,IAAwB,GAAA,EAAA,GAAA,QAAA,CAAS,MAAM,MAAM,CAAA;AAAA;AAEvD,EAAO,OAAA,IAAA;AACT;AACA,SAAS,MAAM,GAAqB,EAAA;AAClC,EAAO,OAAA,IAAI,KAAK,GAAG,CAAA,CAAE,aAAc,CAAA,KAAA,CAAM,GAAG,EAAE,CAAA;AAChD;A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AAAA,GAAwB,CAAA,IAAA;AACrC,QAAM,MAAA,KAAA,GAAQ,OAAO,IAAA,KAAS,QAAW,GAAA,IAAA,CAAK,MAAO,CAAA,KAAA,CAAM,CAAG,EAAA,cAAc,CAAI,GAAA,EAAA;AAChF,QAAA,OAAO,KAAS,IAAA,IAAA;AAAA,OACV,CAAA,OAAA,CAAA,EAAA;AACN,QAAO,OAAA,IAAA;AAAA;AACT;AACF,GACF;AACF"}
|
|
@@ -26,6 +26,16 @@ const HOME_SUGGESTIONS = [{
|
|
|
26
26
|
ask: "Paste the arXiv link or paper title"
|
|
27
27
|
}],
|
|
28
28
|
app: "poster"
|
|
29
|
+
}, {
|
|
30
|
+
id: "motion",
|
|
31
|
+
icon: "animation-play-outline",
|
|
32
|
+
label: "Animate a title",
|
|
33
|
+
hint: "Your words or logo \u2192 an editable animation, rendered to video",
|
|
34
|
+
prompt: "Make an animated title card that says [your headline] and render it as an MP4.",
|
|
35
|
+
blanks: [{
|
|
36
|
+
ask: "What should the title say?"
|
|
37
|
+
}],
|
|
38
|
+
app: "motion"
|
|
29
39
|
}, {
|
|
30
40
|
id: "canvas",
|
|
31
41
|
icon: "view-grid-outline",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"homeCatalog.js","sources":["../../../../src/screens/Home/components/homeCatalog.ts"],"sourcesContent":["/**\n * The chat home's pure parts, kept apart from the components so they run under jest: the\n * \"Start something\" catalogue and draw (the web's YANTRA_SUGGESTIONS / useHomeSuggestions) and\n * the greeting (the web's HomeHero `greetingFor`).\n */\nimport type { ComponentProps } from 'react';\nimport type { MaterialCommunityIcons } from '@expo/vector-icons';\nimport type { BlankGuide } from '../../../features/chat/promptBlanks';\nimport type { RoutingMode } from '../types';\n\ntype IconName = ComponentProps<typeof MaterialCommunityIcons>['name'];\n\nexport type HomeSuggestion = {\n id: string;\n label: string;\n /** What the row is for, on the line under its label. */\n hint: string;\n icon: IconName;\n prompt: string;\n mode?: RoutingMode;\n /** Navigate here instead of injecting the prompt, when the host wires navigation. */\n nativeRoute?: string;\n /**\n * The app this shortcut is for: a registry intent id, the one the brain answers with\n * (the web's `panel`). Chat opens it when the brain names no other app for the send.\n */\n app?: string;\n /** For each `[blank]` in the prompt, in order: what to ask, and answers one tap away. */\n blanks?: readonly BlankGuide[];\n};\n\n/** The web's YANTRA_SUGGESTIONS, in its order. */\nexport const HOME_SUGGESTIONS: readonly HomeSuggestion[] = [\n {\n id: 'design',\n icon: 'palette-outline',\n label: 'Design a landing page',\n hint: 'Chat-driven design canvas — iterate on a real page, not a mockup',\n prompt: 'Design a landing page for [your product]. Start with the hero and the pricing section.',\n blanks: [\n {\n ask: \"What's the product?\",\n suggestions: ['a dog-walking app', 'a coffee subscription', 'a yoga studio'],\n },\n ],\n app: 'design',\n },\n {\n id: 'webbuilder',\n icon: 'web',\n label: 'Build a working web app',\n hint: 'Scaffold and edit a real app from a prompt',\n prompt: 'Build me a small web app with a form that stores submissions and a page that lists them.',\n app: 'webbuilder',\n },\n {\n id: 'poster',\n icon: 'post-outline',\n label: 'Turn a paper into a poster',\n hint: 'A paper PDF or arXiv link → an editable, print-ready conference poster',\n prompt: 'Turn [arXiv link or paper title] into a 48 x 36 inch conference poster I can edit and print.',\n blanks: [{ ask: 'Paste the arXiv link or paper title' }],\n app: 'poster',\n },\n {\n id: 'canvas',\n icon: 'view-grid-outline',\n label: 'Open a canvas',\n hint: 'Spread images, video and audio out and work on them together',\n prompt: 'Open a canvas and help me lay out the assets for this project.',\n nativeRoute: 'MainStack.CanvasNative',\n },\n {\n id: 'workflow',\n icon: 'sitemap-outline',\n label: 'Automate something repetitive',\n hint: 'A visual workflow across 1,000+ connectors',\n prompt: 'Build a workflow that runs every morning and sends me a summary of [what to keep an eye on].',\n blanks: [\n {\n ask: 'What should it summarize?',\n suggestions: ['new support emails', 'overnight sales', \"today's calendar\"],\n },\n ],\n app: 'workflow-studio',\n },\n {\n id: 'computer',\n icon: 'monitor',\n label: 'Drive my browser',\n hint: 'The CLI runs your OS and browser for you',\n prompt: 'Open my browser, find the pricing pages of [3 competitors], and put them side by side.',\n blanks: [{ ask: 'Which 3 competitors?' }],\n app: 'computer',\n },\n {\n id: 'connect-apps',\n icon: 'puzzle-outline',\n label: 'Connect your apps',\n hint: 'Link a tool once, then just @-mention it in any chat',\n prompt: 'Show me which apps I can connect, and help me connect the ones I use daily.',\n },\n {\n id: 'research',\n icon: 'magnify',\n label: 'Research a market',\n hint: 'Deep multi-source research, written up',\n prompt: 'Research the market for [your idea] - who the players are, how they price, and where the gaps are.',\n blanks: [\n {\n ask: \"What's the idea?\",\n suggestions: ['a dog-walking app', 'an AI tutor for kids', 'a meal-prep service'],\n },\n ],\n mode: 'deep-search',\n },\n {\n id: 'notion',\n icon: 'notebook-outline',\n label: 'Write it up in Notion',\n hint: 'Findings land as a page in Yantra Notion',\n prompt: 'Research [a topic] and write the findings up as a page in Yantra Notion with sources.',\n blanks: [\n {\n ask: 'What topic?',\n suggestions: ['the four-day work week', 'onboarding remote teams', 'home solar payback'],\n },\n ],\n app: 'notion',\n },\n {\n id: 'shopping',\n icon: 'shopping-outline',\n label: 'Compare products',\n hint: 'Search across sources and line them up',\n prompt: 'Compare the best [product] options and show me the tradeoffs.',\n blanks: [\n {\n ask: 'What are you shopping for?',\n suggestions: ['noise-cancelling headphones', 'robot vacuums', 'carry-on luggage'],\n },\n ],\n app: 'shopping',\n },\n {\n id: 'travel',\n icon: 'airplane',\n label: 'Plan a trip',\n hint: 'Flights, hotels and a day-by-day plan',\n prompt: 'Plan a 4-day trip to [destination] for me - flights, somewhere to stay, and what to do each day.',\n blanks: [{ ask: 'Where to?', suggestions: ['Lisbon', 'Tokyo', 'Mexico City', 'Reykjavik'] }],\n app: 'travel',\n },\n {\n id: 'meetings',\n icon: 'microphone-outline',\n label: 'Send a notetaker to a meeting',\n hint: 'Records, transcribes, and writes the notes up',\n prompt: 'Send the notetaker to my next meeting and write up the notes and action items afterwards.',\n app: 'meetings',\n },\n {\n id: 'inbox',\n icon: 'inbox-outline',\n label: 'Get to inbox zero',\n hint: 'Triage the inbox and draft the replies',\n prompt: 'Go through my inbox, tell me what actually needs a reply, and draft those replies.',\n app: 'inbox',\n },\n {\n id: 'crm',\n icon: 'account-group-outline',\n label: 'Chase my pipeline',\n hint: 'See what is stalling and what to do next',\n prompt: 'Look at my pipeline and tell me which deals are going cold and what I should send them.',\n app: 'crm',\n },\n {\n id: 'invoices',\n icon: 'file-document-outline',\n label: 'Get paid',\n hint: 'Invoice a customer and see what is still owed',\n prompt: 'Show me which invoices are unpaid, and send a reminder for the overdue ones.',\n app: 'invoices',\n },\n {\n id: 'expenses',\n icon: 'receipt',\n label: 'Sort out expenses',\n hint: 'Claims, budgets, and card spend in one place',\n prompt: 'Summarise my spend this month and flag anything unusual.',\n app: 'expenses',\n },\n {\n id: 'mailcampaign',\n icon: 'bullhorn-outline',\n label: 'Send a campaign',\n hint: 'Write it, segment it, send it',\n prompt: 'Draft an email campaign announcing [what you shipped or launched].',\n blanks: [\n { ask: 'What did you launch?', suggestions: ['our new mobile app', 'a spring sale', 'a new pricing plan'] },\n ],\n app: 'mailcampaign',\n },\n {\n id: 'smscampaign',\n icon: 'message-text-outline',\n label: 'Text your customers',\n hint: 'SMS campaigns with replies',\n prompt: \"Write a short text reminding my customers about [this week's offer], then send it to my VIP list.\",\n blanks: [\n {\n ask: \"What's the offer?\",\n suggestions: ['20% off this weekend', 'free shipping until Sunday', 'buy one, get one free'],\n },\n ],\n app: 'smscampaign',\n },\n];\n\n/** `count` distinct entries, drawn at random (the web's draw, without its welcome-answer weights). */\nexport function drawSuggestions(\n count: number,\n pool: readonly HomeSuggestion[] = HOME_SUGGESTIONS,\n random: () => number = Math.random,\n): HomeSuggestion[] {\n const remaining = [...pool];\n const picked: HomeSuggestion[] = [];\n while (picked.length < count && remaining.length > 0) {\n picked.push(remaining.splice(Math.floor(random() * remaining.length), 1)[0]);\n }\n return picked;\n}\n\n/** Same boundaries as the web's `greetingFor`; anything past ten at night reads as late. */\nexport function greetingFor(hour: number): string {\n if (hour >= 5 && hour < 12) return 'Good morning';\n if (hour >= 12 && hour < 17) return 'Good afternoon';\n if (hour >= 17 && hour < 22) return 'Good evening';\n return 'Working late';\n}\n"],"names":[],"mappings":"AA8BO,MAAM,mBAA8C,CAAC;AAAA,EAC1D,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA,uBAAA;AAAA,EACP,IAAM,EAAA,uEAAA;AAAA,EACN,MAAQ,EAAA,wFAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA,qBAAA;AAAA,IACL,WAAa,EAAA,CAAC,mBAAqB,EAAA,uBAAA,EAAyB,eAAe;AAAA,GAC5E,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,YAAA;AAAA,EACJ,IAAM,EAAA,KAAA;AAAA,EACN,KAAO,EAAA,yBAAA;AAAA,EACP,IAAM,EAAA,4CAAA;AAAA,EACN,MAAQ,EAAA,0FAAA;AAAA,EACR,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,cAAA;AAAA,EACN,KAAO,EAAA,4BAAA;AAAA,EACP,IAAM,EAAA,6EAAA;AAAA,EACN,MAAQ,EAAA,8FAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA;AAAA,GACN,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,mBAAA;AAAA,EACN,KAAO,EAAA,eAAA;AAAA,EACP,IAAM,EAAA,8DAAA;AAAA,EACN,MAAQ,EAAA,gEAAA;AAAA,EACR,WAAa,EAAA;AACf,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,UAAA;AAAA,EACJ,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA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AAA,GAAY,CAAC,GAAG,IAAI,CAAA;AAC1B,EAAA,MAAM,SAA2B,EAAC;AAClC,EAAA,OAAO,MAAO,CAAA,MAAA,GAAS,KAAS,IAAA,SAAA,CAAU,SAAS,CAAG,EAAA;AACpD,IAAA,MAAA,CAAO,IAAK,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,KAAM,CAAA,MAAA,EAAW,GAAA,SAAA,CAAU,MAAM,CAAA,EAAG,CAAC,CAAA,CAAE,CAAC,CAAC,CAAA;AAAA;AAE7E,EAAO,OAAA,MAAA;AACT;AAGO,SAAS,YAAY,IAAsB,EAAA;AAChD,EAAA,IAAI,IAAQ,IAAA,CAAA,IAAK,IAAO,GAAA,EAAA,EAAW,OAAA,cAAA;AACnC,EAAA,IAAI,IAAQ,IAAA,EAAA,IAAM,IAAO,GAAA,EAAA,EAAW,OAAA,gBAAA;AACpC,EAAA,IAAI,IAAQ,IAAA,EAAA,IAAM,IAAO,GAAA,EAAA,EAAW,OAAA,cAAA;AACpC,EAAO,OAAA,cAAA;AACT"}
|
|
1
|
+
{"version":3,"file":"homeCatalog.js","sources":["../../../../src/screens/Home/components/homeCatalog.ts"],"sourcesContent":["/**\n * The chat home's pure parts, kept apart from the components so they run under jest: the\n * \"Start something\" catalogue and draw (the web's YANTRA_SUGGESTIONS / useHomeSuggestions) and\n * the greeting (the web's HomeHero `greetingFor`).\n */\nimport type { ComponentProps } from 'react';\nimport type { MaterialCommunityIcons } from '@expo/vector-icons';\nimport type { BlankGuide } from '../../../features/chat/promptBlanks';\nimport type { RoutingMode } from '../types';\n\ntype IconName = ComponentProps<typeof MaterialCommunityIcons>['name'];\n\nexport type HomeSuggestion = {\n id: string;\n label: string;\n /** What the row is for, on the line under its label. */\n hint: string;\n icon: IconName;\n prompt: string;\n mode?: RoutingMode;\n /** Navigate here instead of injecting the prompt, when the host wires navigation. */\n nativeRoute?: string;\n /**\n * The app this shortcut is for: a registry intent id, the one the brain answers with\n * (the web's `panel`). Chat opens it when the brain names no other app for the send.\n */\n app?: string;\n /** For each `[blank]` in the prompt, in order: what to ask, and answers one tap away. */\n blanks?: readonly BlankGuide[];\n};\n\n/** The web's YANTRA_SUGGESTIONS, in its order. */\nexport const HOME_SUGGESTIONS: readonly HomeSuggestion[] = [\n {\n id: 'design',\n icon: 'palette-outline',\n label: 'Design a landing page',\n hint: 'Chat-driven design canvas — iterate on a real page, not a mockup',\n prompt: 'Design a landing page for [your product]. Start with the hero and the pricing section.',\n blanks: [\n {\n ask: \"What's the product?\",\n suggestions: ['a dog-walking app', 'a coffee subscription', 'a yoga studio'],\n },\n ],\n app: 'design',\n },\n {\n id: 'webbuilder',\n icon: 'web',\n label: 'Build a working web app',\n hint: 'Scaffold and edit a real app from a prompt',\n prompt: 'Build me a small web app with a form that stores submissions and a page that lists them.',\n app: 'webbuilder',\n },\n {\n id: 'poster',\n icon: 'post-outline',\n label: 'Turn a paper into a poster',\n hint: 'A paper PDF or arXiv link → an editable, print-ready conference poster',\n prompt: 'Turn [arXiv link or paper title] into a 48 x 36 inch conference poster I can edit and print.',\n blanks: [{ ask: 'Paste the arXiv link or paper title' }],\n app: 'poster',\n },\n {\n id: 'motion',\n icon: 'animation-play-outline',\n label: 'Animate a title',\n hint: 'Your words or logo → an editable animation, rendered to video',\n prompt: 'Make an animated title card that says [your headline] and render it as an MP4.',\n blanks: [{ ask: 'What should the title say?' }],\n app: 'motion',\n },\n {\n id: 'canvas',\n icon: 'view-grid-outline',\n label: 'Open a canvas',\n hint: 'Spread images, video and audio out and work on them together',\n prompt: 'Open a canvas and help me lay out the assets for this project.',\n nativeRoute: 'MainStack.CanvasNative',\n },\n {\n id: 'workflow',\n icon: 'sitemap-outline',\n label: 'Automate something repetitive',\n hint: 'A visual workflow across 1,000+ connectors',\n prompt: 'Build a workflow that runs every morning and sends me a summary of [what to keep an eye on].',\n blanks: [\n {\n ask: 'What should it summarize?',\n suggestions: ['new support emails', 'overnight sales', \"today's calendar\"],\n },\n ],\n app: 'workflow-studio',\n },\n {\n id: 'computer',\n icon: 'monitor',\n label: 'Drive my browser',\n hint: 'The CLI runs your OS and browser for you',\n prompt: 'Open my browser, find the pricing pages of [3 competitors], and put them side by side.',\n blanks: [{ ask: 'Which 3 competitors?' }],\n app: 'computer',\n },\n {\n id: 'connect-apps',\n icon: 'puzzle-outline',\n label: 'Connect your apps',\n hint: 'Link a tool once, then just @-mention it in any chat',\n prompt: 'Show me which apps I can connect, and help me connect the ones I use daily.',\n },\n {\n id: 'research',\n icon: 'magnify',\n label: 'Research a market',\n hint: 'Deep multi-source research, written up',\n prompt: 'Research the market for [your idea] - who the players are, how they price, and where the gaps are.',\n blanks: [\n {\n ask: \"What's the idea?\",\n suggestions: ['a dog-walking app', 'an AI tutor for kids', 'a meal-prep service'],\n },\n ],\n mode: 'deep-search',\n },\n {\n id: 'notion',\n icon: 'notebook-outline',\n label: 'Write it up in Notion',\n hint: 'Findings land as a page in Yantra Notion',\n prompt: 'Research [a topic] and write the findings up as a page in Yantra Notion with sources.',\n blanks: [\n {\n ask: 'What topic?',\n suggestions: ['the four-day work week', 'onboarding remote teams', 'home solar payback'],\n },\n ],\n app: 'notion',\n },\n {\n id: 'shopping',\n icon: 'shopping-outline',\n label: 'Compare products',\n hint: 'Search across sources and line them up',\n prompt: 'Compare the best [product] options and show me the tradeoffs.',\n blanks: [\n {\n ask: 'What are you shopping for?',\n suggestions: ['noise-cancelling headphones', 'robot vacuums', 'carry-on luggage'],\n },\n ],\n app: 'shopping',\n },\n {\n id: 'travel',\n icon: 'airplane',\n label: 'Plan a trip',\n hint: 'Flights, hotels and a day-by-day plan',\n prompt: 'Plan a 4-day trip to [destination] for me - flights, somewhere to stay, and what to do each day.',\n blanks: [{ ask: 'Where to?', suggestions: ['Lisbon', 'Tokyo', 'Mexico City', 'Reykjavik'] }],\n app: 'travel',\n },\n {\n id: 'meetings',\n icon: 'microphone-outline',\n label: 'Send a notetaker to a meeting',\n hint: 'Records, transcribes, and writes the notes up',\n prompt: 'Send the notetaker to my next meeting and write up the notes and action items afterwards.',\n app: 'meetings',\n },\n {\n id: 'inbox',\n icon: 'inbox-outline',\n label: 'Get to inbox zero',\n hint: 'Triage the inbox and draft the replies',\n prompt: 'Go through my inbox, tell me what actually needs a reply, and draft those replies.',\n app: 'inbox',\n },\n {\n id: 'crm',\n icon: 'account-group-outline',\n label: 'Chase my pipeline',\n hint: 'See what is stalling and what to do next',\n prompt: 'Look at my pipeline and tell me which deals are going cold and what I should send them.',\n app: 'crm',\n },\n {\n id: 'invoices',\n icon: 'file-document-outline',\n label: 'Get paid',\n hint: 'Invoice a customer and see what is still owed',\n prompt: 'Show me which invoices are unpaid, and send a reminder for the overdue ones.',\n app: 'invoices',\n },\n {\n id: 'expenses',\n icon: 'receipt',\n label: 'Sort out expenses',\n hint: 'Claims, budgets, and card spend in one place',\n prompt: 'Summarise my spend this month and flag anything unusual.',\n app: 'expenses',\n },\n {\n id: 'mailcampaign',\n icon: 'bullhorn-outline',\n label: 'Send a campaign',\n hint: 'Write it, segment it, send it',\n prompt: 'Draft an email campaign announcing [what you shipped or launched].',\n blanks: [\n { ask: 'What did you launch?', suggestions: ['our new mobile app', 'a spring sale', 'a new pricing plan'] },\n ],\n app: 'mailcampaign',\n },\n {\n id: 'smscampaign',\n icon: 'message-text-outline',\n label: 'Text your customers',\n hint: 'SMS campaigns with replies',\n prompt: \"Write a short text reminding my customers about [this week's offer], then send it to my VIP list.\",\n blanks: [\n {\n ask: \"What's the offer?\",\n suggestions: ['20% off this weekend', 'free shipping until Sunday', 'buy one, get one free'],\n },\n ],\n app: 'smscampaign',\n },\n];\n\n/** `count` distinct entries, drawn at random (the web's draw, without its welcome-answer weights). */\nexport function drawSuggestions(\n count: number,\n pool: readonly HomeSuggestion[] = HOME_SUGGESTIONS,\n random: () => number = Math.random,\n): HomeSuggestion[] {\n const remaining = [...pool];\n const picked: HomeSuggestion[] = [];\n while (picked.length < count && remaining.length > 0) {\n picked.push(remaining.splice(Math.floor(random() * remaining.length), 1)[0]);\n }\n return picked;\n}\n\n/** Same boundaries as the web's `greetingFor`; anything past ten at night reads as late. */\nexport function greetingFor(hour: number): string {\n if (hour >= 5 && hour < 12) return 'Good morning';\n if (hour >= 12 && hour < 17) return 'Good afternoon';\n if (hour >= 17 && hour < 22) return 'Good evening';\n return 'Working late';\n}\n"],"names":[],"mappings":"AA8BO,MAAM,mBAA8C,CAAC;AAAA,EAC1D,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA,uBAAA;AAAA,EACP,IAAM,EAAA,uEAAA;AAAA,EACN,MAAQ,EAAA,wFAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA,qBAAA;AAAA,IACL,WAAa,EAAA,CAAC,mBAAqB,EAAA,uBAAA,EAAyB,eAAe;AAAA,GAC5E,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,YAAA;AAAA,EACJ,IAAM,EAAA,KAAA;AAAA,EACN,KAAO,EAAA,yBAAA;AAAA,EACP,IAAM,EAAA,4CAAA;AAAA,EACN,MAAQ,EAAA,0FAAA;AAAA,EACR,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,cAAA;AAAA,EACN,KAAO,EAAA,4BAAA;AAAA,EACP,IAAM,EAAA,6EAAA;AAAA,EACN,MAAQ,EAAA,8FAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA;AAAA,GACN,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAG,EAAA;AAAA,EACD,EAAI,EAAA,QAAA;AAAA,EACJ,IAAM,EAAA,wBAAA;AAAA,EACN,KAAO,EAAA,iBAAA;AAAA,EACP,IAAM,EAAA,oEAAA;AAAA,EACN,MAAQ,EAAA,gFAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA;AAAA,GACN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;AAAA,EACN,MAAQ,EAAA,mGAAA;AAAA,EACR,QAAQ,CAAC;AAAA,IACP,GAAK,EAAA,mBAAA;AAAA,IACL,WAAa,EAAA,CAAC,sBAAwB,EAAA,4BAAA,EAA8B,uBAAuB;AAAA,GAC5F,CAAA;AAAA,EACD,GAAK,EAAA;AACP,CAAC;AAGM,SAAS,gBAAgB,KAAe,EAAA,IAAA,GAAkC,gBAAkB,EAAA,MAAA,GAAuB,KAAK,MAA0B,EAAA;AACvJ,EAAM,MAAA,SAAA,GAAY,CAAC,GAAG,IAAI,CAAA;AAC1B,EAAA,MAAM,SAA2B,EAAC;AAClC,EAAA,OAAO,MAAO,CAAA,MAAA,GAAS,KAAS,IAAA,SAAA,CAAU,SAAS,CAAG,EAAA;AACpD,IAAA,MAAA,CAAO,IAAK,CAAA,SAAA,CAAU,MAAO,CAAA,IAAA,CAAK,KAAM,CAAA,MAAA,EAAW,GAAA,SAAA,CAAU,MAAM,CAAA,EAAG,CAAC,CAAA,CAAE,CAAC,CAAC,CAAA;AAAA;AAE7E,EAAO,OAAA,MAAA;AACT;AAGO,SAAS,YAAY,IAAsB,EAAA;AAChD,EAAA,IAAI,IAAQ,IAAA,CAAA,IAAK,IAAO,GAAA,EAAA,EAAW,OAAA,cAAA;AACnC,EAAA,IAAI,IAAQ,IAAA,EAAA,IAAM,IAAO,GAAA,EAAA,EAAW,OAAA,gBAAA;AACpC,EAAA,IAAI,IAAQ,IAAA,EAAA,IAAM,IAAO,GAAA,EAAA,EAAW,OAAA,cAAA;AACpC,EAAO,OAAA,cAAA;AACT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminide-stack/yantra-mobile",
|
|
3
|
-
"version": "12.0.175-alpha.
|
|
3
|
+
"version": "12.0.175-alpha.2",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"uuid": "^9.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"common": "12.0.175-alpha.
|
|
30
|
+
"common": "12.0.175-alpha.1",
|
|
31
31
|
"libphonenumber-js": "^1.13.3"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@messenger-box/platform-mobile": "*",
|
|
46
46
|
"@react-native-async-storage/async-storage": "*",
|
|
47
47
|
"@react-navigation/native": "*",
|
|
48
|
-
"common": "12.0.
|
|
48
|
+
"common": "12.0.175-alpha.1",
|
|
49
49
|
"expo-background-task": "*",
|
|
50
50
|
"expo-camera": "*",
|
|
51
51
|
"expo-constants": "*",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"typescript": {
|
|
69
69
|
"definition": "lib/index.d.ts"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "227c18692c8bec0e38c4780f1caca75339503cf3"
|
|
72
72
|
}
|