@adminide-stack/yantra-mobile 12.0.48 → 12.0.49-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/NavigationHeader/HeaderSheet.js +8 -2
- package/lib/components/NavigationHeader/HeaderSheet.js.map +1 -1
- package/lib/components/NavigationHeader/HeaderSkillsButton.js +42 -111
- package/lib/components/NavigationHeader/HeaderSkillsButton.js.map +1 -1
- package/lib/components/NavigationHeader/HeaderTasksButton.js +77 -50
- package/lib/components/NavigationHeader/HeaderTasksButton.js.map +1 -1
- package/lib/compute.js +55 -1
- package/lib/compute.js.map +1 -1
- package/lib/config/env-config.js +4 -0
- package/lib/config/env-config.js.map +1 -1
- package/lib/contexts/GatewayContext.js +1 -4
- package/lib/contexts/GatewayContext.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +11 -1
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/characters/nativeCharactersRegistry.js +7 -0
- package/lib/features/characters/nativeCharactersRegistry.js.map +1 -0
- package/lib/features/chat/ChatTranscript.js +10 -9
- package/lib/features/chat/ChatTranscript.js.map +1 -1
- package/lib/features/skills/SkillTemplatePicker.js +261 -0
- package/lib/features/skills/SkillTemplatePicker.js.map +1 -0
- package/lib/features/skills/skillTemplates.js +12 -0
- package/lib/features/skills/skillTemplates.js.map +1 -0
- package/lib/features/skills/useGatewaySkills.js +59 -0
- package/lib/features/skills/useGatewaySkills.js.map +1 -0
- package/lib/hooks/useChatApi.js +192 -18
- package/lib/hooks/useChatApi.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/routes.json +52 -0
- package/lib/screens/Characters/index.js +59 -0
- package/lib/screens/Characters/index.js.map +1 -0
- package/lib/screens/Home/components/ChatHistoryLanding.js +120 -15
- package/lib/screens/Home/components/ChatHistoryLanding.js.map +1 -1
- package/lib/services/agentSessionManager.js +9 -4
- package/lib/services/agentSessionManager.js.map +1 -1
- package/package.json +4 -4
package/lib/compute.js
CHANGED
|
@@ -242,6 +242,60 @@ const yantraMobilePageStore = [{
|
|
|
242
242
|
},
|
|
243
243
|
componentPath: "@adminide-stack/yantra-mobile/lib/screens/CanvasBoard/index.js",
|
|
244
244
|
hasComponent: true
|
|
245
|
+
}, {
|
|
246
|
+
key: "characters-native",
|
|
247
|
+
path: "/:orgName/c/characters-native",
|
|
248
|
+
name: "CharactersNative",
|
|
249
|
+
exact: true,
|
|
250
|
+
priority: 4,
|
|
251
|
+
hideInMenu: true,
|
|
252
|
+
auth: true,
|
|
253
|
+
menu_position: "side"
|
|
254
|
+
// Federated like canvas: opening it fetches characters_native/Experience
|
|
255
|
+
// from the character-surface origin at runtime.
|
|
256
|
+
,
|
|
257
|
+
|
|
258
|
+
importPaths: {
|
|
259
|
+
navigationHeader: "@adminide-stack/yantra-mobile/lib/components/NavigationHeader/NavigationHeader.js"
|
|
260
|
+
},
|
|
261
|
+
customHeader: {
|
|
262
|
+
name: "NavigationHeader",
|
|
263
|
+
component: "$.importPaths.navigationHeader",
|
|
264
|
+
props: {
|
|
265
|
+
showTitle: true,
|
|
266
|
+
showToggle: false,
|
|
267
|
+
showFilter: false,
|
|
268
|
+
isSearchBack: false,
|
|
269
|
+
showBack: true,
|
|
270
|
+
showGateway: false,
|
|
271
|
+
showHistory: false,
|
|
272
|
+
showNewChat: false
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
props: {
|
|
276
|
+
initialParams: {
|
|
277
|
+
orgName: null,
|
|
278
|
+
board: null
|
|
279
|
+
},
|
|
280
|
+
options: {
|
|
281
|
+
title: "Canvas",
|
|
282
|
+
headerTintColor: "black",
|
|
283
|
+
headerTitleStyle: {
|
|
284
|
+
fontWeight: "bold"
|
|
285
|
+
},
|
|
286
|
+
// Reachable via the Apps launcher tile - never list in the drawer.
|
|
287
|
+
drawerItemStyle: {
|
|
288
|
+
display: "none"
|
|
289
|
+
},
|
|
290
|
+
headerTitleAlign: "left",
|
|
291
|
+
gestureEnabled: false,
|
|
292
|
+
swipeEnabled: false,
|
|
293
|
+
animation: "fade",
|
|
294
|
+
animationTypeForReplace: "pop"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
componentPath: "@adminide-stack/yantra-mobile/lib/screens/Characters/index.js",
|
|
298
|
+
hasComponent: true
|
|
245
299
|
}, {
|
|
246
300
|
key: "webbuilder",
|
|
247
301
|
path: "/:orgName/c/:channelId/webbuilder",
|
|
@@ -296,6 +350,6 @@ const yantraMobilePageStore = [{
|
|
|
296
350
|
componentPath: "@adminide-stack/yantra-mobile/lib/screens/WebBuilder/index.js",
|
|
297
351
|
hasComponent: true
|
|
298
352
|
}];
|
|
299
|
-
const selectedRoutes = ["home", "chat", "chathistory", "apps", "webbuilder", "canvas-native"];
|
|
353
|
+
const selectedRoutes = ["home", "chat", "chathistory", "apps", "webbuilder", "canvas-native", "characters-native"];
|
|
300
354
|
const filteredRoutes = getFilteredRoutes(yantraMobilePageStore, selectedRoutes);
|
|
301
355
|
export { filteredRoutes, yantraMobilePageStore }; //# sourceMappingURL=compute.js.map
|
package/lib/compute.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nimport { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';\nimport type { IRouteModule } from '@common-stack/core';\n\nexport const yantraMobilePageStore: IRouteModule[] = [\n {\n key: 'home',\n path: '/:orgName/l/home',\n name: 'Home',\n exact: true,\n index: true,\n priority: 1,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n component: () => import('./screens/Home'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: true,\n showFilter: true,\n isSearchBack: false,\n showGateway: true,\n showApps: false,\n showHistory: false,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { initialSessionId: null, orgName: null },\n options: {\n title: 'Yantra',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerLabel: 'Chat',\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'chat',\n path: '/:orgName/chat/:channelId',\n name: 'Chat',\n exact: false,\n priority: 2,\n hideInMenu: true,\n auth: true,\n component: () => import('./screens/Chat'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: true,\n showApps: false,\n showHistory: false,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { channelId: null, orgName: null },\n options: {\n title: 'Yantra',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerLabel: 'Chat',\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'chathistory',\n path: '/:orgName/chathistory',\n name: 'ChatHistory',\n exact: false,\n priority: 3,\n hideInMenu: true,\n auth: true,\n component: () => import('./screens/ChatHistory'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showHistory: false,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { orgName: null },\n options: {\n title: 'Chat history',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'apps',\n path: '/:orgName/apps',\n name: 'Apps',\n exact: true,\n priority: 3,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n component: () => import('./screens/Apps'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showApps: false,\n showHistory: false,\n showNewChat: false,\n },\n },\n props: {\n initialParams: { orgName: null },\n options: {\n title: 'Apps',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerItemStyle: { display: 'none' },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'canvas-native',\n path: '/:orgName/c/canvas-native',\n name: 'CanvasNative',\n exact: true,\n priority: 4,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n // The screen renders the FEDERATED viewer: opening it triggers the\n // Module Federation fetch of canvas_native/Viewer from the surface\n // origin - the viewer's code is not in the app binary.\n component: () => import('./screens/CanvasBoard'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showHistory: false,\n showNewChat: false,\n },\n },\n props: {\n initialParams: { orgName: null, board: null },\n options: {\n title: 'Canvas',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n // Reachable via the Apps launcher tile - never list in the drawer.\n drawerItemStyle: { display: 'none' },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'webbuilder',\n path: '/:orgName/c/:channelId/webbuilder',\n name: 'WebBuilder',\n exact: true,\n priority: 4,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n component: () => import('./screens/WebBuilder'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showHistory: false,\n showNewChat: false,\n },\n },\n props: {\n initialParams: { orgName: null, url: null, channelId: null, projectId: null, message: null },\n options: {\n title: 'Web Builder',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n // Reachable only via Build-mode submit — never list in the drawer.\n drawerItemStyle: { display: 'none' },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n];\n\nconst selectedRoutes = ['home', 'chat', 'chathistory', 'apps', 'webbuilder', 'canvas-native'];\n\nconst filteredRoutes = getFilteredRoutes(yantraMobilePageStore, selectedRoutes);\n\nexport { filteredRoutes };\n"],"names":[],"mappings":"uFAGO,MAAM,wBAAwC,CAAC;AAAA,EACpD,GAAK,EAAA,MAAA;AAAA,EACL,IAAM,EAAA,kBAAA;AAAA,EACN,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,IAAA;AAAA,EACP,KAAO,EAAA,IAAA;AAAA,EACP,QAAU,EAAA,CAAA;AAAA,EACV,UAAY,EAAA,IAAA;AAAA,EACZ,IAAM,EAAA,IAAA;AAAA,EACN,aAAe,EAAA,MAAA;AAAA,EACf,SAAA,EAAW,MAAM,OAAO,yBAAgB,CAAA;AAAA,EACxC,WAAa,EAAA;AAAA,IACX,gBAAA,EAAkB,MAAM,OAAO,mDAAgD;AAAA,GACjF;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,kBA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AAAA;AACf,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,aAAe,EAAA;AAAA,MACb,OAAS,EAAA,IAAA;AAAA,MACT,GAAK,EAAA,IAAA;AAAA,MACL,SAAW,EAAA,IAAA;AAAA,MACX,SAAW,EAAA,IAAA;AAAA,MACX,OAAS,EAAA;AAAA,KACX;AAAA,IACA,OAAS,EAAA;AAAA,MACP,KAAO,EAAA,aAAA;AAAA,MACP,eAAiB,EAAA,OAAA;AAAA,MACjB,gBAAkB,EAAA;AAAA,QAChB,UAAY,EAAA;AAAA,OACd;AAAA;AAAA,MAEA,eAAiB,EAAA;AAAA,QACf,OAAS,EAAA;AAAA,OACX;AAAA,MACA,gBAAkB,EAAA,MAAA;AAAA,MAClB,cAAgB,EAAA,KAAA;AAAA,MAChB,YAAc,EAAA,KAAA;AAAA,MACd,SAAW,EAAA,MAAA;AAAA,MACX,uBAAyB,EAAA;AAAA;AAC3B;AAEJ,CAAC;AACD,MAAM,iBAAiB,CAAC,MAAA,EAAQ,QAAQ,aAAe,EAAA,MAAA,EAAQ,cAAc,eAAe,CAAA;AACtF,MAAA,cAAA,GAAiB,iBAAkB,CAAA,qBAAA,EAAuB,cAAc"}
|
|
1
|
+
{"version":3,"file":"compute.js","sources":["../src/compute.ts"],"sourcesContent":["/* eslint-disable import/no-extraneous-dependencies */\nimport { getFilteredRoutes } from '@common-stack/client-react/lib/utils/filteredRoutes.js';\nimport type { IRouteModule } from '@common-stack/core';\n\nexport const yantraMobilePageStore: IRouteModule[] = [\n {\n key: 'home',\n path: '/:orgName/l/home',\n name: 'Home',\n exact: true,\n index: true,\n priority: 1,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n component: () => import('./screens/Home'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: true,\n showFilter: true,\n isSearchBack: false,\n showGateway: true,\n showApps: false,\n showHistory: false,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { initialSessionId: null, orgName: null },\n options: {\n title: 'Yantra',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerLabel: 'Chat',\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'chat',\n path: '/:orgName/chat/:channelId',\n name: 'Chat',\n exact: false,\n priority: 2,\n hideInMenu: true,\n auth: true,\n component: () => import('./screens/Chat'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: true,\n showApps: false,\n showHistory: false,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { channelId: null, orgName: null },\n options: {\n title: 'Yantra',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerLabel: 'Chat',\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'chathistory',\n path: '/:orgName/chathistory',\n name: 'ChatHistory',\n exact: false,\n priority: 3,\n hideInMenu: true,\n auth: true,\n component: () => import('./screens/ChatHistory'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showHistory: false,\n showNewChat: true,\n },\n },\n props: {\n initialParams: { orgName: null },\n options: {\n title: 'Chat history',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'apps',\n path: '/:orgName/apps',\n name: 'Apps',\n exact: true,\n priority: 3,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n component: () => import('./screens/Apps'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showApps: false,\n showHistory: false,\n showNewChat: false,\n },\n },\n props: {\n initialParams: { orgName: null },\n options: {\n title: 'Apps',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n drawerItemStyle: { display: 'none' },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'canvas-native',\n path: '/:orgName/c/canvas-native',\n name: 'CanvasNative',\n exact: true,\n priority: 4,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n // The screen renders the FEDERATED viewer: opening it triggers the\n // Module Federation fetch of canvas_native/Viewer from the surface\n // origin - the viewer's code is not in the app binary.\n component: () => import('./screens/CanvasBoard'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showHistory: false,\n showNewChat: false,\n },\n },\n props: {\n initialParams: { orgName: null, board: null },\n options: {\n title: 'Canvas',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n // Reachable via the Apps launcher tile - never list in the drawer.\n drawerItemStyle: { display: 'none' },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'characters-native',\n path: '/:orgName/c/characters-native',\n name: 'CharactersNative',\n exact: true,\n priority: 4,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n // Federated like canvas: opening it fetches characters_native/Experience\n // from the character-surface origin at runtime.\n component: () => import('./screens/Characters'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showHistory: false,\n showNewChat: false,\n },\n },\n props: {\n initialParams: { orgName: null, board: null },\n options: {\n title: 'Canvas',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n // Reachable via the Apps launcher tile - never list in the drawer.\n drawerItemStyle: { display: 'none' },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n {\n key: 'webbuilder',\n path: '/:orgName/c/:channelId/webbuilder',\n name: 'WebBuilder',\n exact: true,\n priority: 4,\n hideInMenu: true,\n auth: true,\n menu_position: 'side',\n component: () => import('./screens/WebBuilder'),\n importPaths: {\n navigationHeader: () => import('./components/NavigationHeader/NavigationHeader'),\n },\n customHeader: {\n name: 'NavigationHeader',\n component: '$.importPaths.navigationHeader',\n props: {\n showTitle: true,\n showToggle: false,\n showFilter: false,\n isSearchBack: false,\n showBack: true,\n showGateway: false,\n showHistory: false,\n showNewChat: false,\n },\n },\n props: {\n initialParams: { orgName: null, url: null, channelId: null, projectId: null, message: null },\n options: {\n title: 'Web Builder',\n headerTintColor: 'black',\n headerTitleStyle: {\n fontWeight: 'bold',\n },\n // Reachable only via Build-mode submit — never list in the drawer.\n drawerItemStyle: { display: 'none' },\n headerTitleAlign: 'left',\n gestureEnabled: false,\n swipeEnabled: false,\n animation: 'fade',\n animationTypeForReplace: 'pop',\n },\n },\n },\n];\n\nconst selectedRoutes = ['home', 'chat', 'chathistory', 'apps', 'webbuilder', 'canvas-native', 'characters-native'];\n\nconst filteredRoutes = getFilteredRoutes(yantraMobilePageStore, selectedRoutes);\n\nexport { filteredRoutes };\n"],"names":[],"mappings":"uFAGO,MAAM,wBAAwC,CAAC;AAAA,EACpD,GAAK,EAAA,MAAA;AAAA,EACL,IAAM,EAAA,kBAAA;AAAA,EACN,IAAM,EAAA,MAAA;AAAA,EACN,KAAO,EAAA,IAAA;AAAA,EACP,KAAO,EAAA,IAAA;AAAA,EACP,QAAU,EAAA,CAAA;AAAA,EACV,UAAY,EAAA,IAAA;AAAA,EACZ,IAAM,EAAA,IAAA;AAAA,EACN,aAAe,EAAA,MAAA;AAAA,EACf,SAAA,EAAW,MAAM,OAAO,yBAAgB,CAAA;AAAA,EACxC,WAAa,EAAA;AAAA,IACX,gBAAA,EAAkB,MAAM,OAAO,mDAAgD;AAAA,GACjF;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,IAAM,EAAA,kBAAA;AAAA,IACN,SAAW,EAAA,gCAAA;AAAA,IACX,KAAO,EAAA;AAAA,MACL,SAAW,EAAA,IAAA;AAAA,MACX,UAAY,EAAA,IAAA;AAAA,MACZ,UAAY,EAAA,IAAA;AAAA,MACZ,YAAc,EAAA,KAAA;AAAA,MACd,WAAa,EAAA,IAAA;AAAA,MACb,QAAU,EAAA,KAAA;AAAA,MACV,WAAa,EAAA,KAAA;AAAA,MACb,WAAa,EAAA;AAAA;AACf,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACL,aAAe,EAAA;AAAA,MACb,gBAAkB,EAAA,IAAA;AAAA,MAClB,OAAS,EAAA;AAAA,KACX;AAAA,IACA,OAAS,EAAA;AAAA,MACP,KAAO,EAAA,QAAA;AAAA,MACP,eAAiB,EAAA,OAAA;AAAA,MACjB,gBAAkB,EAAA;AAAA,QAChB,UAAY,EAAA;AAAA,OACd;AAAA,MACA,WAAa,EAAA,MAAA;AAAA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ACD,MAAM,cAAA,GAAiB,CAAC,MAAQ,EAAA,MAAA,EAAQ,eAAe,MAAQ,EAAA,YAAA,EAAc,iBAAiB,mBAAmB,CAAA;AAC3G,MAAA,cAAA,GAAiB,iBAAkB,CAAA,qBAAA,EAAuB,cAAc"}
|
package/lib/config/env-config.js
CHANGED
|
@@ -54,6 +54,10 @@ const baseConfig = cleanEnv(env, {
|
|
|
54
54
|
SURFACE_URL_TEMPLATE: str({
|
|
55
55
|
default: "https://{slug}-surface.yantra-app-v1.cdebase.dev/"
|
|
56
56
|
}),
|
|
57
|
+
/** Characters gallery manifest, served next to the federated remote on the character surface. */
|
|
58
|
+
CHARACTERS_NATIVE_MANIFEST_URL: str({
|
|
59
|
+
default: "https://character-surface.yantra-app-v1.cdebase.dev/native/characters.json"
|
|
60
|
+
}),
|
|
57
61
|
APP_NAME: str({
|
|
58
62
|
default: "Yantra"
|
|
59
63
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":["import { str, cleanEnv, bool, num } from 'envalid';\n\nconst env = (process as { APP_ENV?: NodeJS.ProcessEnv; env?: NodeJS.ProcessEnv }).APP_ENV || process.env;\n\nconst baseConfig = cleanEnv(env, {\n GRAPHQL_URL: str({ default: 'http://localhost:8080/graphql' }),\n CLIENT_URL: str({ default: 'http://localhost:3000' }),\n /** Standalone Web Builder surface embedded in the mobile WebView shell. */\n WEB_BUILDER_URL: str({ default: 'http://localhost:5174/' }),\n /** Standalone Design surface — local vite is 5174/4174 next to canvas 5175. */\n DESIGN_SURFACE_URL: str({ default: 'http://localhost:5174/' }),\n /** Standalone Canvas surface embedded in the same WebView shell. */\n CANVAS_SURFACE_URL: str({ default: 'http://localhost:5175/' }),\n /**\n * GraphQL backend whose JWT keys the canvas index will verify.\n * Must stay in lockstep with canvas-surface `.env.development`\n * (`VITE_BACKEND_GRAPHQL_URL` / `VITE_SURFACE_INDEX_URL`). A locally\n * minted token 401s against `surface-index-backend.yantra-app-v1`.\n */\n CANVAS_BACKEND_GRAPHQL_URL: str({ default: 'https://ideback.yantra-app-v1.cdebase.dev/graphql' }),\n /**\n * Origin template for every other deployed surface: `{slug}` is the app's\n * `surfaceSlug`. One var instead of 20+ near-identical URLs, and it keeps the\n * environment (dev cluster / prod) in one place.\n */\n SURFACE_URL_TEMPLATE: str({ default: 'https://{slug}-surface.yantra-app-v1.cdebase.dev/' }),\n APP_NAME: str({ default: 'Yantra' }),\n GROQ_API_KEY: str({ default: '' }),\n CDECLI_AGENT_ENDPOINT: str({ default: 'https://cdecli-agent.cdebase.dev' }),\n CDECLI_AGENT_AUTH_TOKEN: str({ default: '' }),\n /** Seconds to wait for CDeCLI stream completion before timing out (then fallback chat API runs). Min 15, max 600. */\n /** Aligned with web `useCdecliChannel` (120s). Mobile hook uses the same constant inline. */\n CDECLI_CHAT_RESPONSE_TIMEOUT_SEC: num({ default: 120 }),\n BACKEND_URL: str({ default: '' }),\n USE_PROXY_STAGING_GATEWAY: bool({ default: false }),\n PROXY_STAGING_GATEWAY_URL: str({ default: '' }),\n});\n\nfunction resolveAgentGatewayGraphqlUrl(): string {\n if (baseConfig.USE_PROXY_STAGING_GATEWAY && baseConfig.PROXY_STAGING_GATEWAY_URL) {\n return baseConfig.PROXY_STAGING_GATEWAY_URL;\n }\n if (baseConfig.GRAPHQL_URL) return baseConfig.GRAPHQL_URL;\n if (baseConfig.BACKEND_URL) return `${baseConfig.BACKEND_URL.replace(/\\/$/, '')}/graphql`;\n return '/graphql';\n}\n\nfunction resolveBaseWsUrl(graphqlUrl: string): string {\n const base = graphqlUrl.replace(/\\/graphql$/, '');\n return base.replace(/^http/, 'ws');\n}\n\nfunction resolveAgentGatewayWsUrl(graphqlUrl: string): string {\n return `${resolveBaseWsUrl(graphqlUrl)}/ws/openclaw-chat`;\n}\n\nconst agentGatewayGraphqlUrl = resolveAgentGatewayGraphqlUrl();\n\nconst clampedCdecliTimeoutSec = Math.min(600, Math.max(15, Math.round(baseConfig.CDECLI_CHAT_RESPONSE_TIMEOUT_SEC)));\n\nexport const config = {\n ...baseConfig,\n CDECLI_CHAT_RESPONSE_TIMEOUT_SEC: clampedCdecliTimeoutSec,\n AGENT_GATEWAY_GRAPHQL_URL: agentGatewayGraphqlUrl,\n AGENT_GATEWAY_WS_URL: resolveAgentGatewayWsUrl(agentGatewayGraphqlUrl),\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AACA,MAAM,GAAA,GAAO,OAGV,CAAA,OAAA,IAAW,OAAQ,CAAA,GAAA;AACtB,MAAM,UAAA,GAAa,SAAS,GAAK,EAAA;AAAA,EAC/B,aAAa,GAAI,CAAA;AAAA,IACf,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EACD,YAAY,GAAI,CAAA;AAAA,IACd,OAAS,EAAA;AAAA,GACV,CAAA;AAAA;AAAA,EAED,iBAAiB,GAAI,CAAA;AAAA,IACnB,OAAS,EAAA;AAAA,GACV,CAAA;AAAA;AAAA,EAED,oBAAoB,GAAI,CAAA;AAAA,IACtB,OAAS,EAAA;AAAA,GACV,CAAA;AAAA;AAAA,EAED,oBAAoB,GAAI,CAAA;AAAA,IACtB,OAAS,EAAA;AAAA,GACV,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOD,4BAA4B,GAAI,CAAA;AAAA,IAC9B,OAAS,EAAA;AAAA,GACV,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMD,sBAAsB,GAAI,CAAA;AAAA,IACxB,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EACD,UAAU,GAAI,CAAA;AAAA,IACZ,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EACD,cAAc,GAAI,CAAA;AAAA,IAChB,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EACD,uBAAuB,GAAI,CAAA;AAAA,IACzB,OAAS,EAAA;AAAA,GACV,CAAA;AAAA,EACD,yBAAyB,GAAI,CAAA;AAA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,GAAS,iCACjB,UADiB,CAAA,EAAA;AAAA,EAEpB,gCAAkC,EAAA,uBAAA;AAAA,EAClC,yBAA2B,EAAA,sBAAA;AAAA,EAC3B,oBAAA,EAAsB,yBAAyB,sBAAsB;AACvE,CAAA"}
|
|
1
|
+
{"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":["import { str, cleanEnv, bool, num } from 'envalid';\n\nconst env = (process as { APP_ENV?: NodeJS.ProcessEnv; env?: NodeJS.ProcessEnv }).APP_ENV || process.env;\n\nconst baseConfig = cleanEnv(env, {\n GRAPHQL_URL: str({ default: 'http://localhost:8080/graphql' }),\n CLIENT_URL: str({ default: 'http://localhost:3000' }),\n /** Standalone Web Builder surface embedded in the mobile WebView shell. */\n WEB_BUILDER_URL: str({ default: 'http://localhost:5174/' }),\n /** Standalone Design surface — local vite is 5174/4174 next to canvas 5175. */\n DESIGN_SURFACE_URL: str({ default: 'http://localhost:5174/' }),\n /** Standalone Canvas surface embedded in the same WebView shell. */\n CANVAS_SURFACE_URL: str({ default: 'http://localhost:5175/' }),\n /**\n * GraphQL backend whose JWT keys the canvas index will verify.\n * Must stay in lockstep with canvas-surface `.env.development`\n * (`VITE_BACKEND_GRAPHQL_URL` / `VITE_SURFACE_INDEX_URL`). A locally\n * minted token 401s against `surface-index-backend.yantra-app-v1`.\n */\n CANVAS_BACKEND_GRAPHQL_URL: str({ default: 'https://ideback.yantra-app-v1.cdebase.dev/graphql' }),\n /**\n * Origin template for every other deployed surface: `{slug}` is the app's\n * `surfaceSlug`. One var instead of 20+ near-identical URLs, and it keeps the\n * environment (dev cluster / prod) in one place.\n */\n SURFACE_URL_TEMPLATE: str({ default: 'https://{slug}-surface.yantra-app-v1.cdebase.dev/' }),\n /** Characters gallery manifest, served next to the federated remote on the character surface. */\n CHARACTERS_NATIVE_MANIFEST_URL: str({\n default: 'https://character-surface.yantra-app-v1.cdebase.dev/native/characters.json',\n }),\n APP_NAME: str({ default: 'Yantra' }),\n GROQ_API_KEY: str({ default: '' }),\n CDECLI_AGENT_ENDPOINT: str({ default: 'https://cdecli-agent.cdebase.dev' }),\n CDECLI_AGENT_AUTH_TOKEN: str({ default: '' }),\n /** Seconds to wait for CDeCLI stream completion before timing out (then fallback chat API runs). Min 15, max 600. */\n /** Aligned with web `useCdecliChannel` (120s). Mobile hook uses the same constant inline. */\n CDECLI_CHAT_RESPONSE_TIMEOUT_SEC: num({ default: 120 }),\n BACKEND_URL: str({ default: '' }),\n USE_PROXY_STAGING_GATEWAY: bool({ default: false }),\n PROXY_STAGING_GATEWAY_URL: str({ default: '' }),\n});\n\nfunction resolveAgentGatewayGraphqlUrl(): string {\n if (baseConfig.USE_PROXY_STAGING_GATEWAY && baseConfig.PROXY_STAGING_GATEWAY_URL) {\n return baseConfig.PROXY_STAGING_GATEWAY_URL;\n }\n if (baseConfig.GRAPHQL_URL) return baseConfig.GRAPHQL_URL;\n if (baseConfig.BACKEND_URL) return `${baseConfig.BACKEND_URL.replace(/\\/$/, '')}/graphql`;\n return '/graphql';\n}\n\nfunction resolveBaseWsUrl(graphqlUrl: string): string {\n const base = graphqlUrl.replace(/\\/graphql$/, '');\n return base.replace(/^http/, 'ws');\n}\n\nfunction resolveAgentGatewayWsUrl(graphqlUrl: string): string {\n return `${resolveBaseWsUrl(graphqlUrl)}/ws/openclaw-chat`;\n}\n\nconst agentGatewayGraphqlUrl = resolveAgentGatewayGraphqlUrl();\n\nconst clampedCdecliTimeoutSec = Math.min(600, Math.max(15, Math.round(baseConfig.CDECLI_CHAT_RESPONSE_TIMEOUT_SEC)));\n\nexport const config = {\n ...baseConfig,\n CDECLI_CHAT_RESPONSE_TIMEOUT_SEC: clampedCdecliTimeoutSec,\n AGENT_GATEWAY_GRAPHQL_URL: agentGatewayGraphqlUrl,\n AGENT_GATEWAY_WS_URL: resolveAgentGatewayWsUrl(agentGatewayGraphqlUrl),\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AACA,MAAM,GAAA,GAAO,O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
|
79
79
|
if (!activeSkill) return [];
|
|
80
80
|
return activeSkill.split(",").map((s) => s.trim()).filter(Boolean);
|
|
81
|
-
}
|
|
82
|
-
function skillDisplayName(skillKey) {
|
|
83
|
-
return skillKey.split("/").pop() || skillKey;
|
|
84
|
-
}export{GatewayContextProvider,parseActiveSkills,skillDisplayName,useGatewayContext};//# sourceMappingURL=GatewayContext.js.map
|
|
81
|
+
}export{GatewayContextProvider,parseActiveSkills,useGatewayContext};//# sourceMappingURL=GatewayContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GatewayContext.js","sources":["../../src/contexts/GatewayContext.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport type { GatewayEntry, GatewayId } from '../config/constants';\nimport { useGatewayRegistry } from '../hooks/useGatewayRegistry';\nimport { GatewaySelectionStorage } from '../utils/gatewaySelectionStorage';\n\nexport interface GatewayContextValue {\n selectedGatewayId: GatewayId;\n selectedGateway: GatewayEntry;\n gateways: Record<string, GatewayEntry>;\n gatewayList: Array<{ id: string } & GatewayEntry>;\n setSelectedGateway: (gatewayId: GatewayId) => void;\n loading: boolean;\n activeSkill: string | null;\n setActiveSkill: (skill: string | null) => void;\n}\n\nconst GatewayContext = createContext<GatewayContextValue | null>(null);\nGatewayContext.displayName = 'GatewayContext';\n\nexport function GatewayContextProvider({ children }: { children: ReactNode }) {\n const { gateways, gatewayList, loading } = useGatewayRegistry();\n const safeGateways = gateways && typeof gateways === 'object' ? gateways : {};\n const safeGatewayList = Array.isArray(gatewayList) ? gatewayList : [];\n const hasGateway = (gatewayId: string) => Object.prototype.hasOwnProperty.call(safeGateways, gatewayId);\n\n const [selectedGatewayId, setGatewayId] = useState<GatewayId>('cdecli');\n const [activeSkill, setActiveSkill] = useState<string | null>(null);\n const [storageReady, setStorageReady] = useState(false);\n\n useEffect(() => {\n let cancelled = false;\n GatewaySelectionStorage.load().then((s) => {\n if (cancelled) return;\n if (s.selectedGatewayId) {\n setGatewayId(s.selectedGatewayId);\n }\n setStorageReady(true);\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => {\n if (!storageReady || loading) return;\n if (selectedGatewayId && hasGateway(selectedGatewayId)) return;\n const fallbackId = hasGateway('cdecli') ? 'cdecli' : safeGatewayList[0]?.id || '';\n if (fallbackId) {\n setGatewayId(fallbackId);\n GatewaySelectionStorage.save({ selectedGatewayId: fallbackId });\n }\n }, [storageReady, loading, safeGateways, safeGatewayList, selectedGatewayId]);\n\n const setSelectedGateway = useCallback(\n (gatewayId: GatewayId) => {\n if (!hasGateway(gatewayId)) return;\n setGatewayId(gatewayId);\n void GatewaySelectionStorage.save({ selectedGatewayId: gatewayId });\n setActiveSkill(null);\n },\n [safeGateways],\n );\n\n const selectedGateway: GatewayEntry = (selectedGatewayId && safeGateways[selectedGatewayId]) ||\n safeGatewayList[0] || {\n name: '',\n description: '',\n channelType: '',\n extensionId: '',\n icon: 'plug',\n isBuiltin: false,\n priority: 0,\n };\n\n const value = useMemo<GatewayContextValue>(\n () => ({\n selectedGatewayId,\n selectedGateway,\n gateways: safeGateways,\n gatewayList: safeGatewayList,\n setSelectedGateway,\n loading,\n activeSkill,\n setActiveSkill,\n }),\n [selectedGatewayId, selectedGateway, safeGateways, safeGatewayList, setSelectedGateway, loading, activeSkill],\n );\n\n return <GatewayContext.Provider value={value}>{children}</GatewayContext.Provider>;\n}\n\nexport function useGatewayContext(): GatewayContextValue {\n const context = useContext(GatewayContext);\n if (!context) {\n throw new Error('useGatewayContext must be used within GatewayContextProvider');\n }\n return context;\n}\n\n/** Split the comma-separated {@link GatewayContextValue.activeSkill} into its skill keys. */\nexport function parseActiveSkills(activeSkill: string | null | undefined): string[] {\n if (!activeSkill) return [];\n return activeSkill\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n}\n\n/** Last segment of a namespaced key (`Non-designer-skill/soft-skill` → `soft-skill`). */\nexport function skillDisplayName(skillK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,QAAU,EAAA,YAAA;AAAA,IACV,WAAa,EAAA,eAAA;AAAA,IACb,kBAAA;AAAA,IACA,OAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF,CAAA,EAAI,CAAC,iBAAmB,EAAA,eAAA,EAAiB,cAAc,eAAiB,EAAA,kBAAA,EAAoB,OAAS,EAAA,WAAW,CAAC,CAAA;AACjH,EAAA,uBAAQ,GAAA,CAAA,cAAA,CAAe,QAAf,EAAA,EAAwB,OAAe,QAAS,EAAA,CAAA;AAC1D;AACO,SAAS,iBAAyC,GAAA;AACvD,EAAM,MAAA,OAAA,GAAU,WAAW,cAAc,CAAA;AACzC,EAAA,IAAI,CAAC,OAAS,EAAA;AACZ,IAAM,MAAA,IAAI,MAAM,8DAA8D,CAAA;AAAA;AAEhF,EAAO,OAAA,OAAA;AACT;AAGO,SAAS,kBAAkB,WAAkD,EAAA;AAClF,EAAI,IAAA,CAAC,WAAa,EAAA,OAAO,EAAC;AAC1B,EAAO,OAAA,WAAA,CAAY,KAAM,CAAA,GAAG,CAAE,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,CAAE,IAAK,EAAC,CAAE,CAAA,MAAA,CAAO,OAAO,CAAA;AACjE
|
|
1
|
+
{"version":3,"file":"GatewayContext.js","sources":["../../src/contexts/GatewayContext.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport type { GatewayEntry, GatewayId } from '../config/constants';\nimport { useGatewayRegistry } from '../hooks/useGatewayRegistry';\nimport { GatewaySelectionStorage } from '../utils/gatewaySelectionStorage';\n\nexport interface GatewayContextValue {\n selectedGatewayId: GatewayId;\n selectedGateway: GatewayEntry;\n gateways: Record<string, GatewayEntry>;\n gatewayList: Array<{ id: string } & GatewayEntry>;\n setSelectedGateway: (gatewayId: GatewayId) => void;\n loading: boolean;\n activeSkill: string | null;\n setActiveSkill: (skill: string | null) => void;\n}\n\nconst GatewayContext = createContext<GatewayContextValue | null>(null);\nGatewayContext.displayName = 'GatewayContext';\n\nexport function GatewayContextProvider({ children }: { children: ReactNode }) {\n const { gateways, gatewayList, loading } = useGatewayRegistry();\n const safeGateways = gateways && typeof gateways === 'object' ? gateways : {};\n const safeGatewayList = Array.isArray(gatewayList) ? gatewayList : [];\n const hasGateway = (gatewayId: string) => Object.prototype.hasOwnProperty.call(safeGateways, gatewayId);\n\n const [selectedGatewayId, setGatewayId] = useState<GatewayId>('cdecli');\n const [activeSkill, setActiveSkill] = useState<string | null>(null);\n const [storageReady, setStorageReady] = useState(false);\n\n useEffect(() => {\n let cancelled = false;\n GatewaySelectionStorage.load().then((s) => {\n if (cancelled) return;\n if (s.selectedGatewayId) {\n setGatewayId(s.selectedGatewayId);\n }\n setStorageReady(true);\n });\n return () => {\n cancelled = true;\n };\n }, []);\n\n useEffect(() => {\n if (!storageReady || loading) return;\n if (selectedGatewayId && hasGateway(selectedGatewayId)) return;\n const fallbackId = hasGateway('cdecli') ? 'cdecli' : safeGatewayList[0]?.id || '';\n if (fallbackId) {\n setGatewayId(fallbackId);\n GatewaySelectionStorage.save({ selectedGatewayId: fallbackId });\n }\n }, [storageReady, loading, safeGateways, safeGatewayList, selectedGatewayId]);\n\n const setSelectedGateway = useCallback(\n (gatewayId: GatewayId) => {\n if (!hasGateway(gatewayId)) return;\n setGatewayId(gatewayId);\n void GatewaySelectionStorage.save({ selectedGatewayId: gatewayId });\n setActiveSkill(null);\n },\n [safeGateways],\n );\n\n const selectedGateway: GatewayEntry = (selectedGatewayId && safeGateways[selectedGatewayId]) ||\n safeGatewayList[0] || {\n name: '',\n description: '',\n channelType: '',\n extensionId: '',\n icon: 'plug',\n isBuiltin: false,\n priority: 0,\n };\n\n const value = useMemo<GatewayContextValue>(\n () => ({\n selectedGatewayId,\n selectedGateway,\n gateways: safeGateways,\n gatewayList: safeGatewayList,\n setSelectedGateway,\n loading,\n activeSkill,\n setActiveSkill,\n }),\n [selectedGatewayId, selectedGateway, safeGateways, safeGatewayList, setSelectedGateway, loading, activeSkill],\n );\n\n return <GatewayContext.Provider value={value}>{children}</GatewayContext.Provider>;\n}\n\nexport function useGatewayContext(): GatewayContextValue {\n const context = useContext(GatewayContext);\n if (!context) {\n throw new Error('useGatewayContext must be used within GatewayContextProvider');\n }\n return context;\n}\n\n/** Split the comma-separated {@link GatewayContextValue.activeSkill} into its skill keys. */\nexport function parseActiveSkills(activeSkill: string | null | undefined): string[] {\n if (!activeSkill) return [];\n return activeSkill\n .split(',')\n .map((s) => s.trim())\n .filter(Boolean);\n}\n\n/** Last segment of a namespaced key (`Non-designer-skill/soft-skill` → `soft-skill`). */\nexport function skillDisplayName(skillKey: string): string {\n return skillKey.split('/').pop() || skillKey;\n}\n"],"names":[],"mappings":"kQAiBA,MAAM,cAAA,GAAiB,cAA0C,IAAI,CAAA;AACrE,cAAA,CAAe,WAAc,GAAA,gBAAA;AACtB,SAAS,sBAAuB,CAAA;AAAA,EACrC;AACF,CAEG,EAAA;AACD,EAAM,MAAA;AAAA,IACJ,QAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,MACE,kBAAmB,EAAA;AACvB,EAAA,MAAM,eAAe,QAAY,IAAA,OAAO,QAAa,KAAA,QAAA,GAAW,WAAW,EAAC;AAC5E,EAAA,MAAM,kBAAkB,KAAM,CAAA,OAAA,CAAQ,WAAW,CAAA,GAAI,cAAc,EAAC;AACpE,EAAM,MAAA,UAAA,GAAa,CAAC,SAAsB,KAAA,MAAA,CAAO,UAAU,cAAe,CAAA,IAAA,CAAK,cAAc,SAAS,CAAA;AACtG,EAAA,MAAM,CAAC,iBAAA,EAAmB,YAAY,CAAA,GAAI,SAAoB,QAAQ,CAAA;AACtE,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAwB,IAAI,CAAA;AAClE,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,KAAK,CAAA;AACtD,EAAA,SAAA,CAAU,MAAM;AACd,IAAA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57
|
icon: "drama-masks",
|
|
58
58
|
group: "Create",
|
|
59
59
|
prompt: "Create a stoic philosophy mentor character I can chat with",
|
|
60
|
-
|
|
60
|
+
// Native federated experience (gallery -> detail -> chat); the web
|
|
61
|
+
// surface remains reachable through the surface lane if ever needed.
|
|
62
|
+
nativeRoute: "characters-native",
|
|
63
|
+
surfaceSlug: "character"
|
|
64
|
+
}, {
|
|
65
|
+
key: "characters-native",
|
|
66
|
+
label: "Characters Native",
|
|
67
|
+
icon: "account-star",
|
|
68
|
+
group: "Create",
|
|
69
|
+
prompt: "Show me characters I can chat with.",
|
|
70
|
+
nativeRoute: "characters-native",
|
|
61
71
|
surfaceSlug: "character"
|
|
62
72
|
}, {
|
|
63
73
|
key: "workflow",
|
|
@@ -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' | '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?: 'webbuilder' | 'canvas-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\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: '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 Native',\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: 'paper2poster',\n label: 'Paper 2 Poster',\n icon: 'presentation',\n group: 'Create',\n prompt: 'Turn this research paper into a conference poster I can edit.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'paper2poster',\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 nativeRoute: 'webbuilder',\n surfaceSlug: 'character',\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 },\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: '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: '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: '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: 'webbuilder',\n surfaceSlug: 'billing',\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: '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: '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: '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: '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\nexport const APP_GROUP_ORDER: readonly AppGroupId[] = ['Create', 'Automate', 'Sell', 'Money', 'Team', 'More'];\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\nexport function groupMobileApps(items: readonly MobileAppItem[], query: string) {\n const hits = 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"],"names":[],"mappings":"AAuCO,MAAM,qBAA+C,CAAC;AAAA,EAC3D,GAAK,EAAA,QAAA;AAAA,EACL,KAAO,EAAA,QAAA;AAAA,EACP,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA,QAAA;AAAA,EACP,MAAQ,EAAA,gEAAA;AAAA,EACR,WAAa,EAAA,YAAA;AAAA,EACb,aAAe,EAAA,oBAAA;AAAA,EACf,WAAa,EAAA;AACf,CAAG,EAAA;AAAA,EACD,GAAK,EAAA,QAAA;AAAA,EACL,KAAO,EAAA,QAAA;AAAA,EACP,IAAM,EAAA,mBAAA;AAAA,EACN,KAAO,EAAA,QAAA;AAAA,EACP,MAAQ,EAAA,gEAAA;AAAA,EACR,WAAa,EAAA,YAAA;AAAA,EACb,aAAe,EAAA,oBAAA;AAAA,EACf,WAAa,EAAA;AACf,CAAG,EAAA;AAAA,EACD,GAAK,EAAA,eAAA;AAAA,EACL,KAAO,EAAA,eAAA;AAAA,EACP,IAAM,EAAA,eAAA;AAAA,EACN,KAAO,EAAA,QAAA;AAAA,EACP,MAAQ,EAAA,gEAAA;AAAA;AAAA;AAAA;AAAA,EAIR,WAAa,EAAA;AACf,CAAG,EAAA;AAAA,EACD,GAAK,EAAA,YAAA;AAAA,EACL,KAAO,EAAA,aAAA;AAAA,EACP,IAAM,EAAA,qBAAA;AAAA,EACN,KAAO,EAAA,QAAA;AAAA,EACP,MAAQ,EAA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U,KAAA,MAAA;AAAA,IACnC,KAAA;AAAA,IACA,OAAO,IAAK,CAAA,MAAA,CAAO,CAAQ,IAAA,KAAA,IAAA,CAAK,UAAU,KAAK;AAAA,IAC/C,CAAE,CAAA,MAAA,CAAO,WAAS,KAAM,CAAA,KAAA,CAAM,SAAS,CAAC,CAAA;AAC5C"}
|
|
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' | '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?: 'webbuilder' | 'canvas-native' | 'characters-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\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: '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 Native',\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: 'paper2poster',\n label: 'Paper 2 Poster',\n icon: 'presentation',\n group: 'Create',\n prompt: 'Turn this research paper into a conference poster I can edit.',\n nativeRoute: 'webbuilder',\n surfaceSlug: 'paper2poster',\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 Native',\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 {\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 },\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: '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: '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: '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: 'webbuilder',\n surfaceSlug: 'billing',\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: '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: '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: '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: '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\nexport const APP_GROUP_ORDER: readonly AppGroupId[] = ['Create', 'Automate', 'Sell', 'Money', 'Team', 'More'];\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\nexport function groupMobileApps(items: readonly MobileAppItem[], query: string) {\n const hits = 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"],"names":[],"mappings":"AAuCO,MAAM,qBAA+C,CAAC;AAAA,EAC3D,GAAK,EAAA,QAAA;AAAA,EACL,KAAO,EAAA,QAAA;AAAA,EACP,IAAM,EAAA,iBAAA;AAAA,EACN,KAAO,EAAA,QAAA;AAAA,EACP,MAAQ,EAAA,gEAAA;AAAA,EACR,WAAa,EAAA,YAAA;AAAA,EACb,aAAe,EAAA,oBAAA;AAAA,EACf,WAAa,EAAA;AACf,CAAG,EAAA;AAAA,EACD,GAAK,EAAA,QAAA;AAAA,EACL,KAAO,EAAA,QAAA;AAAA,EACP,IAAM,EAAA,mBAAA;AAAA,EACN,KAAO,EAAA,QAAA;AAAA,EACP,MAAQ,EAAA,gEAAA;AAAA,EACR,WAAa,EAAA,YAAA;AAAA,EACb,aAAe,EAAA,oBAAA;AAAA,EACf,WAAa,EAAA;AACf,CAAG,EAAA;AAAA,EACD,GAAK,EAAA,eAAA;AAAA,EACL,KAAO,EAAA,eAAA;AAAA,EACP,IAAM,EAAA,eAAA;AAAA,EACN,KAAO,EAAA,QAAA;AAAA,EACP,MAAQ,EAAA,gEAAA;AAAA;AAAA;AAAA;AAAA,EAIR,WAAa,EAAA;AACf,CAAG,EAAA;AAAA,EACD,GAAK,EAAA,YAAA;AAAA,EACL,KAAO,EAAA,aAAA;AAAA,EACP,IAAM,EAAA,qBAAA;AAAA,EACN,KAAO,EAAA,QAAA;AAAA,EACP,MAAQ,EAAA,mEAAA;AAAA,EACR,WAAa,EAAA,YAAA;AAAA,EACb,aAAe,EAAA,iBAAA;AAAA,EACf,WAAa,EA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AAA,IAAA,GAAO,MAAM,MAAO,CAAA,CAAA,IAAA,KAAQ,gBAAgB,IAAK,CAAA,KAAA,EAAO,KAAK,CAAC,CAAA;AACpE,EAAO,OAAA,eAAA,CAAgB,IAAI,CAAU,KAAA,MAAA;AAAA,IACnC,KAAA;AAAA,IACA,OAAO,IAAK,CAAA,MAAA,CAAO,CAAQ,IAAA,KAAA,IAAA,CAAK,UAAU,KAAK;AAAA,IAC/C,CAAE,CAAA,MAAA,CAAO,WAAS,KAAM,CAAA,KAAA,CAAM,SAAS,CAAC,CAAA;AAC5C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
let current = null;
|
|
2
|
+
function registerNativeCharactersExperience(component) {
|
|
3
|
+
current = component;
|
|
4
|
+
}
|
|
5
|
+
function getNativeCharactersExperience() {
|
|
6
|
+
return current;
|
|
7
|
+
}export{getNativeCharactersExperience,registerNativeCharactersExperience};//# sourceMappingURL=nativeCharactersRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeCharactersRegistry.js","sources":["../../../src/features/characters/nativeCharactersRegistry.ts"],"sourcesContent":["/**\n * The characters viewer seam - same pattern as the canvas registry\n * ([[nativeViewerRegistry]]): the APP (the Module Federation host) registers\n * the federated experience component at startup; the Characters screen in\n * this package reads it. The package itself never names the remote, so\n * rollup's lib/ build stays free of `characters_native/...` specifiers.\n *\n * Exported from the package index ON PURPOSE: reachability from the entry is\n * what stops rollup tree-shaking the register function as internally-unused\n * and constant-folding readers to undefined (the exact failure ya#965 fixed\n * for canvas).\n */\nimport type * as React from 'react';\nimport type { NativeCharactersExperienceProps } from './NativeCharactersExperience';\n\ntype ExperienceComponent = React.ComponentType<NativeCharactersExperienceProps>;\n\nlet current: ExperienceComponent | null = null;\n\nexport function registerNativeCharactersExperience(component: ExperienceComponent): void {\n current = component;\n}\n\nexport function getNativeCharactersExperience(): ExperienceComponent | null {\n return current;\n}\n"],"names":[],"mappings":"AAeA,IAAI,OAAsC,GAAA,IAAA;AACnC,SAAS,mCAAmC,SAAsC,EAAA;AACvF,EAAU,OAAA,GAAA,SAAA;AACZ;AACO,SAAS,6BAA4D,GAAA;AAC1E,EAAO,OAAA,OAAA;AACT"}
|
|
@@ -42,29 +42,30 @@ function ChatTranscript({
|
|
|
42
42
|
streaming: true
|
|
43
43
|
}];
|
|
44
44
|
}, [historyRows, streamingContent]);
|
|
45
|
-
const invertedRows = useMemo(() => [...rows].reverse(), [rows]);
|
|
46
45
|
const scrollToLatest = useCallback((animated) => {
|
|
47
46
|
var _a;
|
|
47
|
+
if (rows.length === 0) return;
|
|
48
48
|
isProgrammaticScrollRef.current = true;
|
|
49
|
-
(_a = listRef.current) == null ? void 0 : _a.
|
|
50
|
-
offset: 0,
|
|
49
|
+
(_a = listRef.current) == null ? void 0 : _a.scrollToEnd({
|
|
51
50
|
animated
|
|
52
51
|
});
|
|
53
|
-
}, []);
|
|
52
|
+
}, [rows.length]);
|
|
54
53
|
useEffect(() => {
|
|
55
|
-
if (
|
|
54
|
+
if (rows.length === 0 || !stickToBottomRef.current) return void 0;
|
|
56
55
|
const t = setTimeout(() => scrollToLatest(false), 0);
|
|
57
56
|
return () => clearTimeout(t);
|
|
58
|
-
}, [
|
|
57
|
+
}, [rows.length, streamingContent == null ? void 0 : streamingContent.length, scrollToLatest]);
|
|
59
58
|
useEffect(() => {
|
|
60
59
|
if (!stickToBottomRef.current) return;
|
|
61
60
|
scrollToLatest(false);
|
|
62
61
|
}, [keyboardVisible, scrollToLatest]);
|
|
63
62
|
const handleScroll = useCallback((e) => {
|
|
64
63
|
const {
|
|
65
|
-
contentOffset
|
|
64
|
+
contentOffset,
|
|
65
|
+
contentSize,
|
|
66
|
+
layoutMeasurement
|
|
66
67
|
} = e.nativeEvent;
|
|
67
|
-
const nearLatest = contentOffset.y
|
|
68
|
+
const nearLatest = contentOffset.y + layoutMeasurement.height >= contentSize.height - 80;
|
|
68
69
|
if (!isProgrammaticScrollRef.current) {
|
|
69
70
|
stickToBottomRef.current = nearLatest;
|
|
70
71
|
} else if (nearLatest) {
|
|
@@ -78,7 +79,7 @@ function ChatTranscript({
|
|
|
78
79
|
const renderItem = useCallback(({
|
|
79
80
|
item
|
|
80
81
|
}) => /* @__PURE__ */ jsx(TranscriptRowView, { item, isDark, renderMessageActions: item.streaming ? void 0 : renderMessageActions }), [isDark, renderMessageActions]);
|
|
81
|
-
return /* @__PURE__ */ jsx(FlatList, { ref: listRef, data:
|
|
82
|
+
return /* @__PURE__ */ jsx(FlatList, { ref: listRef, data: rows, keyExtractor: (item) => item.id, renderItem, extraData: `${isDark}:${streamingContent != null ? streamingContent : ""}`, onScroll: handleScroll, onContentSizeChange: handleContentSizeChange, onLayout: () => {
|
|
82
83
|
if (stickToBottomRef.current) scrollToLatest(false);
|
|
83
84
|
}, scrollEventThrottle: 16, keyboardShouldPersistTaps: "always", keyboardDismissMode: "none", automaticallyAdjustKeyboardInsets: false, automaticallyAdjustContentInsets: false, contentInsetAdjustmentBehavior: "never", contentContainerStyle: [styles.listContent, listContentStyle], style: styles.list });
|
|
84
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatTranscript.js","sources":["../../../src/features/chat/ChatTranscript.tsx"],"sourcesContent":["/**\n * Chat thread list that can show attachment previews.\n *\n * `@messenger-box/platform-mobile` PlanModeView maps each row to GiftedChat\n * `{ text }` only, so an image send becomes the gateway caption\n * \"Attached: IMG_0005.jpg\" with no thumbnail. This list keeps streaming\n * markdown for the assistant and draws Manus-style previews on the user side.\n */\nimport React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';\nimport { FlatList, StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\nimport Markdown from 'react-native-markdown-display';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport { displayUserMessageText, shouldRenderUserTranscriptTurn } from '../attachments/displayUserMessageText';\nimport { MessageAttachmentPreviews } from '../attachments/MessageAttachmentPreviews';\n\nexport type TranscriptMessage = {\n id: string;\n role: string;\n content: string;\n attachments?: MessageAttachment[];\n};\n\ntype TranscriptRow = TranscriptMessage & { streaming?: boolean };\n\nconst USER_BUBBLE_BG = '#2563eb';\n\nexport function ChatTranscript({\n messages,\n streamingContent,\n renderMessageActions,\n listContentStyle,\n isDark = false,\n keyboardVisible = false,\n}: {\n messages: TranscriptMessage[];\n streamingContent?: string;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n listContentStyle?: StyleProp<ViewStyle>;\n isDark?: boolean;\n keyboardVisible?: boolean;\n}) {\n const listRef = useRef<FlatList<TranscriptRow>>(null);\n const stickToBottomRef = useRef(true);\n const isProgrammaticScrollRef = useRef(false);\n\n const historyRows = useMemo<TranscriptRow[]>(\n () =>\n messages\n .filter((msg) => msg.role !== 'user' || shouldRenderUserTranscriptTurn(msg.content, msg.attachments))\n .map((msg) => ({ ...msg, streaming: false })),\n [messages],\n );\n\n const rows = useMemo<TranscriptRow[]>(() => {\n const stream = streamingContent?.trim();\n if (!stream) return historyRows;\n return [\n ...historyRows,\n {\n id: '__streaming__',\n role: 'assistant',\n content: stream,\n streaming: true,\n },\n ];\n }, [historyRows, streamingContent]);\n\n /**\n * Newest-first so `inverted` pins the latest turn to the composer. An\n * uninverted list with `flexGrow` + `justifyContent: 'flex-end'` eats the\n * viewport when the keyboard opens and stops the list from scrolling.\n */\n const invertedRows = useMemo(() => [...rows].reverse(), [rows]);\n\n const scrollToLatest = useCallback((animated: boolean) => {\n isProgrammaticScrollRef.current = true;\n listRef.current?.scrollToOffset({ offset: 0, animated });\n }, []);\n\n useEffect(() => {\n if (invertedRows.length === 0 || !stickToBottomRef.current) return undefined;\n const t = setTimeout(() => scrollToLatest(false), 0);\n return () => clearTimeout(t);\n }, [invertedRows.length, streamingContent?.length, scrollToLatest]);\n\n useEffect(() => {\n if (!stickToBottomRef.current) return;\n scrollToLatest(false);\n }, [keyboardVisible, scrollToLatest]);\n\n const handleScroll = useCallback(\n (e: {\n nativeEvent: {\n contentOffset: { y: number };\n contentSize: { height: number };\n layoutMeasurement: { height: number };\n };\n }) => {\n const { contentOffset } = e.nativeEvent;\n const nearLatest = contentOffset.y <= 80;\n if (!isProgrammaticScrollRef.current) {\n stickToBottomRef.current = nearLatest;\n } else if (nearLatest) {\n isProgrammaticScrollRef.current = false;\n }\n },\n [],\n );\n\n const handleContentSizeChange = useCallback(() => {\n if (!stickToBottomRef.current) return;\n scrollToLatest(false);\n }, [scrollToLatest]);\n\n const renderItem = useCallback(\n ({ item }: { item: TranscriptRow }) => (\n <TranscriptRowView\n item={item}\n isDark={isDark}\n renderMessageActions={item.streaming ? undefined : renderMessageActions}\n />\n ),\n [isDark, renderMessageActions],\n );\n\n return (\n <FlatList\n ref={listRef}\n data={invertedRows}\n inverted\n keyExtractor={(item) => item.id}\n renderItem={renderItem}\n extraData={`${isDark}:${streamingContent ?? ''}`}\n onScroll={handleScroll}\n onContentSizeChange={handleContentSizeChange}\n onLayout={() => {\n if (stickToBottomRef.current) scrollToLatest(false);\n }}\n scrollEventThrottle={16}\n keyboardShouldPersistTaps=\"always\"\n keyboardDismissMode=\"none\"\n automaticallyAdjustKeyboardInsets={false}\n automaticallyAdjustContentInsets={false}\n contentInsetAdjustmentBehavior=\"never\"\n contentContainerStyle={[styles.listContent, listContentStyle]}\n style={styles.list}\n />\n );\n}\n\nconst TranscriptRowView = memo(function TranscriptRowView({\n item,\n isDark,\n renderMessageActions,\n}: {\n item: TranscriptRow;\n isDark: boolean;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n}) {\n const isUser = item.role === 'user';\n const attachments = item.attachments ?? [];\n const text = isUser ? displayUserMessageText(item.content, attachments) : item.content;\n\n if (isUser) {\n return (\n <View style={styles.userCol}>\n {attachments.length > 0 ? (\n <MessageAttachmentPreviews attachments={attachments} align=\"end\" isDark={isDark} />\n ) : null}\n {text ? (\n <View style={styles.userBubble}>\n <Text style={styles.userText}>{text}</Text>\n </View>\n ) : null}\n </View>\n );\n }\n\n const markdownColor = isDark ? '#e2e8f0' : '#111827';\n const codeBg = isDark ? '#1e293b' : '#f3f4f6';\n\n return (\n <View style={styles.assistantCol}>\n {attachments.length > 0 ? (\n <MessageAttachmentPreviews attachments={attachments} align=\"start\" isDark={isDark} />\n ) : null}\n {text ? (\n <Markdown\n style={{\n body: { color: markdownColor, fontSize: 15, lineHeight: 22 },\n heading1: {\n fontSize: 18,\n fontWeight: '700',\n marginTop: 12,\n marginBottom: 4,\n color: markdownColor,\n },\n heading2: {\n fontSize: 16,\n fontWeight: '700',\n marginTop: 10,\n marginBottom: 4,\n color: markdownColor,\n },\n heading3: {\n fontSize: 15,\n fontWeight: '600',\n marginTop: 8,\n marginBottom: 4,\n color: markdownColor,\n },\n strong: { fontWeight: '700' },\n paragraph: { marginTop: 4, marginBottom: 4 },\n list_item: { marginVertical: 2 },\n bullet_list: { marginVertical: 4 },\n ordered_list: { marginVertical: 4 },\n code_inline: {\n backgroundColor: codeBg,\n paddingHorizontal: 4,\n borderRadius: 4,\n fontSize: 14,\n color: markdownColor,\n },\n code_block: {\n backgroundColor: codeBg,\n padding: 12,\n borderRadius: 8,\n marginVertical: 8,\n fontSize: 14,\n color: markdownColor,\n },\n }}\n >\n {text}\n </Markdown>\n ) : null}\n {renderMessageActions\n ? renderMessageActions({ id: item.id, role: 'assistant', content: item.content })\n : null}\n </View>\n );\n});\n\nconst styles = StyleSheet.create({\n list: {\n flex: 1,\n },\n listContent: {\n paddingTop: 8,\n paddingBottom: 8,\n paddingHorizontal: 8,\n },\n userCol: {\n width: '100%',\n alignItems: 'flex-end',\n marginBottom: 8,\n paddingHorizontal: 4,\n },\n userBubble: {\n backgroundColor: USER_BUBBLE_BG,\n borderRadius: 16,\n padding: 12,\n maxWidth: '92%',\n },\n userText: {\n color: '#ffffff',\n fontSize: 15,\n lineHeight: 22,\n },\n assistantCol: {\n width: '100%',\n alignItems: 'flex-start',\n marginBottom: 8,\n paddingHorizontal: 4,\n },\n});\n"],"names":["Transcript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iB,gBACL,CAAc,GAAA,IAAA;AAAA,IACjB,uBAAuB,oBAAqB,CAAA;AAAA,MACnD,IAAI,IAAK,CAAA,EAAA;AAAA,MACT,IAAM,EAAA,WAAA;AAAA,MACN,SAAS,IAAK,CAAA;AAAA,KACf,CAAI,GAAA;AAAA,GACD,EAAA,CAAA;AACR,CAAC,CAAA;AACD,MAAM,MAAA,GAAS,WAAW,MAAO,CAAA;AAAA,EAC/B,IAAM,EAAA;AAAA,IACJ,IAAM,EAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,UAAY,EAAA,CAAA;AAAA,IACZ,aAAe,EAAA,CAAA;AAAA,IACf,iBAAmB,EAAA;AAAA,GACrB;AAAA,EACA,OAAS,EAAA;AAAA,IACP,KAAO,EAAA,MAAA;AAAA,IACP,UAAY,EAAA,UAAA;AAAA,IACZ,YAAc,EAAA,CAAA;AAAA,IACd,iBAAmB,EAAA;AAAA,GACrB;AAAA,EACA,UAAY,EAAA;AAAA,IACV,eAAiB,EAAA,cAAA;AAAA,IACjB,YAAc,EAAA,EAAA;AAAA,IACd,OAAS,EAAA,EAAA;AAAA,IACT,QAAU,EAAA;AAAA,GACZ;AAAA,EACA,QAAU,EAAA;AAAA,IACR,KAAO,EAAA,SAAA;AAAA,IACP,QAAU,EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,YAAc,EAAA;AAAA,IACZ,KAAO,EAAA,MAAA;AAAA,IACP,UAAY,EAAA,YAAA;AAAA,IACZ,YAAc,EAAA,CAAA;AAAA,IACd,iBAAmB,EAAA;AAAA;AAEvB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"ChatTranscript.js","sources":["../../../src/features/chat/ChatTranscript.tsx"],"sourcesContent":["/**\n * Chat thread list that can show attachment previews.\n *\n * `@messenger-box/platform-mobile` PlanModeView maps each row to GiftedChat\n * `{ text }` only, so an image send becomes the gateway caption\n * \"Attached: IMG_0005.jpg\" with no thumbnail. This list keeps streaming\n * markdown for the assistant and draws Manus-style previews on the user side.\n *\n * Rows stay oldest → newest (same as web). A previous `inverted` FlatList\n * reversed that order on device. The composer dock already lifts with the\n * keyboard; this list just fills the leftover space and pins to the latest\n * turn.\n */\nimport React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';\nimport { FlatList, StyleSheet, Text, View, type StyleProp, type ViewStyle } from 'react-native';\nimport Markdown from 'react-native-markdown-display';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport { displayUserMessageText, shouldRenderUserTranscriptTurn } from '../attachments/displayUserMessageText';\nimport { MessageAttachmentPreviews } from '../attachments/MessageAttachmentPreviews';\n\nexport type TranscriptMessage = {\n id: string;\n role: string;\n content: string;\n attachments?: MessageAttachment[];\n};\n\ntype TranscriptRow = TranscriptMessage & { streaming?: boolean };\n\nconst USER_BUBBLE_BG = '#2563eb';\n\nexport function ChatTranscript({\n messages,\n streamingContent,\n renderMessageActions,\n listContentStyle,\n isDark = false,\n keyboardVisible = false,\n}: {\n messages: TranscriptMessage[];\n streamingContent?: string;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n listContentStyle?: StyleProp<ViewStyle>;\n isDark?: boolean;\n keyboardVisible?: boolean;\n}) {\n const listRef = useRef<FlatList<TranscriptRow>>(null);\n const stickToBottomRef = useRef(true);\n const isProgrammaticScrollRef = useRef(false);\n\n const historyRows = useMemo<TranscriptRow[]>(\n () =>\n messages\n .filter((msg) => msg.role !== 'user' || shouldRenderUserTranscriptTurn(msg.content, msg.attachments))\n .map((msg) => ({ ...msg, streaming: false })),\n [messages],\n );\n\n const rows = useMemo<TranscriptRow[]>(() => {\n const stream = streamingContent?.trim();\n if (!stream) return historyRows;\n return [\n ...historyRows,\n {\n id: '__streaming__',\n role: 'assistant',\n content: stream,\n streaming: true,\n },\n ];\n }, [historyRows, streamingContent]);\n\n const scrollToLatest = useCallback(\n (animated: boolean) => {\n if (rows.length === 0) return;\n isProgrammaticScrollRef.current = true;\n listRef.current?.scrollToEnd({ animated });\n },\n [rows.length],\n );\n\n useEffect(() => {\n if (rows.length === 0 || !stickToBottomRef.current) return undefined;\n const t = setTimeout(() => scrollToLatest(false), 0);\n return () => clearTimeout(t);\n }, [rows.length, streamingContent?.length, scrollToLatest]);\n\n useEffect(() => {\n if (!stickToBottomRef.current) return;\n scrollToLatest(false);\n }, [keyboardVisible, scrollToLatest]);\n\n const handleScroll = useCallback(\n (e: {\n nativeEvent: {\n contentOffset: { y: number };\n contentSize: { height: number };\n layoutMeasurement: { height: number };\n };\n }) => {\n const { contentOffset, contentSize, layoutMeasurement } = e.nativeEvent;\n const nearLatest = contentOffset.y + layoutMeasurement.height >= contentSize.height - 80;\n if (!isProgrammaticScrollRef.current) {\n stickToBottomRef.current = nearLatest;\n } else if (nearLatest) {\n isProgrammaticScrollRef.current = false;\n }\n },\n [],\n );\n\n const handleContentSizeChange = useCallback(() => {\n if (!stickToBottomRef.current) return;\n scrollToLatest(false);\n }, [scrollToLatest]);\n\n const renderItem = useCallback(\n ({ item }: { item: TranscriptRow }) => (\n <TranscriptRowView\n item={item}\n isDark={isDark}\n renderMessageActions={item.streaming ? undefined : renderMessageActions}\n />\n ),\n [isDark, renderMessageActions],\n );\n\n return (\n <FlatList\n ref={listRef}\n data={rows}\n keyExtractor={(item) => item.id}\n renderItem={renderItem}\n extraData={`${isDark}:${streamingContent ?? ''}`}\n onScroll={handleScroll}\n onContentSizeChange={handleContentSizeChange}\n onLayout={() => {\n if (stickToBottomRef.current) scrollToLatest(false);\n }}\n scrollEventThrottle={16}\n keyboardShouldPersistTaps=\"always\"\n keyboardDismissMode=\"none\"\n automaticallyAdjustKeyboardInsets={false}\n automaticallyAdjustContentInsets={false}\n contentInsetAdjustmentBehavior=\"never\"\n contentContainerStyle={[styles.listContent, listContentStyle]}\n style={styles.list}\n />\n );\n}\n\nconst TranscriptRowView = memo(function TranscriptRowView({\n item,\n isDark,\n renderMessageActions,\n}: {\n item: TranscriptRow;\n isDark: boolean;\n renderMessageActions?: (message: { id: string; role: string; content: string }) => React.ReactNode;\n}) {\n const isUser = item.role === 'user';\n const attachments = item.attachments ?? [];\n const text = isUser ? displayUserMessageText(item.content, attachments) : item.content;\n\n if (isUser) {\n return (\n <View style={styles.userCol}>\n {attachments.length > 0 ? (\n <MessageAttachmentPreviews attachments={attachments} align=\"end\" isDark={isDark} />\n ) : null}\n {text ? (\n <View style={styles.userBubble}>\n <Text style={styles.userText}>{text}</Text>\n </View>\n ) : null}\n </View>\n );\n }\n\n const markdownColor = isDark ? '#e2e8f0' : '#111827';\n const codeBg = isDark ? '#1e293b' : '#f3f4f6';\n\n return (\n <View style={styles.assistantCol}>\n {attachments.length > 0 ? (\n <MessageAttachmentPreviews attachments={attachments} align=\"start\" isDark={isDark} />\n ) : null}\n {text ? (\n <Markdown\n style={{\n body: { color: markdownColor, fontSize: 15, lineHeight: 22 },\n heading1: {\n fontSize: 18,\n fontWeight: '700',\n marginTop: 12,\n marginBottom: 4,\n color: markdownColor,\n },\n heading2: {\n fontSize: 16,\n fontWeight: '700',\n marginTop: 10,\n marginBottom: 4,\n color: markdownColor,\n },\n heading3: {\n fontSize: 15,\n fontWeight: '600',\n marginTop: 8,\n marginBottom: 4,\n color: markdownColor,\n },\n strong: { fontWeight: '700' },\n paragraph: { marginTop: 4, marginBottom: 4 },\n list_item: { marginVertical: 2 },\n bullet_list: { marginVertical: 4 },\n ordered_list: { marginVertical: 4 },\n code_inline: {\n backgroundColor: codeBg,\n paddingHorizontal: 4,\n borderRadius: 4,\n fontSize: 14,\n color: markdownColor,\n },\n code_block: {\n backgroundColor: codeBg,\n padding: 12,\n borderRadius: 8,\n marginVertical: 8,\n fontSize: 14,\n color: markdownColor,\n },\n }}\n >\n {text}\n </Markdown>\n ) : null}\n {renderMessageActions\n ? renderMessageActions({ id: item.id, role: 'assistant', content: item.content })\n : null}\n </View>\n );\n});\n\nconst styles = StyleSheet.create({\n list: {\n flex: 1,\n },\n listContent: {\n paddingTop: 8,\n paddingBottom: 8,\n paddingHorizontal: 8,\n },\n userCol: {\n width: '100%',\n alignItems: 'flex-end',\n marginBottom: 8,\n paddingHorizontal: 4,\n },\n userBubble: {\n backgroundColor: USER_BUBBLE_BG,\n borderRadius: 16,\n padding: 12,\n maxWidth: '92%',\n },\n userText: {\n color: '#ffffff',\n fontSize: 15,\n lineHeight: 22,\n },\n assistantCol: {\n width: '100%',\n alignItems: 'flex-start',\n marginBottom: 8,\n paddingHorizontal: 4,\n },\n});\n"],"names":["TranscriptRowView"],"mappings":";;;;;;;;;;;;;;;;;;;AA4BA,MAAM,cAAiB,GAAA,SAAA;AAChB,SAAS,cAAe,CAAA;AAAA,EAC7B,QAAA;AAAA,EACA,gBAAA;AAAA,EACA,oBAAA;AAAA,EACA,gBAAA;AAAA,EACA,MAAS,GAAA,KAAA;AAAA,EACT,eAAkB,GAAA;AACpB,CAWG,EAAA;AACD,EAAM,MAAA,OAAA,GAAU,OAAgC,IAAI,CAAA;AACpD,EAAM,MAAA,gBAAA,GAAmB,OAAO,IAAI,CAAA;AACpC,EAAM,MAAA,uBAAA,GAA0B,OAAO,KAAK,CAAA;AAC5C,EAAA,MAAM,cAAc,OAAyB,CAAA,MAAM,SAAS,MAAO,CAAA,CAAA,GAAA,KAAO,IAAI,IAAS,KAAA,MAAA,IAAU,+BAA+B,GAAI,CAAA,OAAA,EAAS,IAAI,WAAW,CAAC,EAAE,GAAI,CAAA,CAAA,GAAA,KAAQ,iCACtK,GADsK,CAAA,EAAA;AAAA,IAEzK,SAAW,EAAA;AAAA,GACX,CAAA,CAAA,EAAG,CAAC,QAAQ,CAAC,CAAA;AACf,EAAM,MAAA,IAAA,GAAO,QAAyB,MAAM;AAC1C,IAAA,MAAM,SAAS,gBAAkB,IAAA,IAAA,GAAA,MAAA,GAAA,gBAAA,CAAA,IAAA,EAAA;AACjC,IAAI,IAAA,CAAC,QAAe,OAAA,WAAA;AACpB,IAAO,OAAA,CAAC,GAAG,WAAa,EAAA;AAAA,MACtB,EAAI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