@adminide-stack/yantra-mobile 12.0.172 → 12.0.174-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/compute.js +54 -1
- package/lib/compute.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +10 -0
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +8 -3
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/apps/nativeAppHandoff.js +4 -1
- package/lib/features/apps/nativeAppHandoff.js.map +1 -1
- package/lib/features/apps/nativeSurfaceTwin.js +2 -1
- package/lib/features/apps/nativeSurfaceTwin.js.map +1 -1
- package/lib/features/channels/ChannelIcon.js +13 -3
- package/lib/features/channels/ChannelIcon.js.map +1 -1
- package/lib/features/channels/ConnectAppsSheet.js +5 -5
- package/lib/features/channels/ConnectAppsSheet.js.map +1 -1
- package/lib/features/channels/HomeImessage.js +5 -3
- package/lib/features/channels/HomeImessage.js.map +1 -1
- package/lib/features/channels/channelLinks.js +13 -1
- package/lib/features/channels/channelLinks.js.map +1 -1
- package/lib/features/chat/NotionPageWidgetCard.js +98 -0
- package/lib/features/chat/NotionPageWidgetCard.js.map +1 -0
- package/lib/features/chat/hostTranscriptProtocol.js +5 -1
- package/lib/features/chat/hostTranscriptProtocol.js.map +1 -1
- package/lib/features/chat/notionPageWidget.js +34 -0
- package/lib/features/chat/notionPageWidget.js.map +1 -0
- package/lib/features/computer/ComputerAgentChatPane.js +45 -0
- package/lib/features/computer/ComputerAgentChatPane.js.map +1 -0
- package/lib/features/computer/ComputerDesktop.js +164 -0
- package/lib/features/computer/ComputerDesktop.js.map +1 -0
- package/lib/features/computer/ComputerExperience.js +79 -0
- package/lib/features/computer/ComputerExperience.js.map +1 -0
- package/lib/features/computer/ComputerHandoff.js +142 -0
- package/lib/features/computer/ComputerHandoff.js.map +1 -0
- package/lib/features/computer/FilesPane.js +179 -0
- package/lib/features/computer/FilesPane.js.map +1 -0
- package/lib/features/computer/LivePage.js +1093 -0
- package/lib/features/computer/LivePage.js.map +1 -0
- package/lib/features/computer/TerminalPane.js +139 -0
- package/lib/features/computer/TerminalPane.js.map +1 -0
- package/lib/features/computer/computerApi.js +819 -0
- package/lib/features/computer/computerApi.js.map +1 -0
- package/lib/features/computer/computerChat.js +42 -0
- package/lib/features/computer/computerChat.js.map +1 -0
- package/lib/features/computer/computerControls.js +227 -0
- package/lib/features/computer/computerControls.js.map +1 -0
- package/lib/features/computer/computerStyles.js +384 -0
- package/lib/features/computer/computerStyles.js.map +1 -0
- package/lib/features/computer/computerTheme.js +133 -0
- package/lib/features/computer/computerTheme.js.map +1 -0
- package/lib/features/computer/handoff.js +73 -0
- package/lib/features/computer/handoff.js.map +1 -0
- package/lib/features/computer/inputLane.js +171 -0
- package/lib/features/computer/inputLane.js.map +1 -0
- package/lib/features/computer/inputPump.js +77 -0
- package/lib/features/computer/inputPump.js.map +1 -0
- package/lib/features/computer/inputSocket.js +148 -0
- package/lib/features/computer/inputSocket.js.map +1 -0
- package/lib/features/computer/keyboardBridge.js +176 -0
- package/lib/features/computer/keyboardBridge.js.map +1 -0
- package/lib/features/computer/pageCoordinates.js +19 -0
- package/lib/features/computer/pageCoordinates.js.map +1 -0
- package/lib/features/computer/pageZoom.js +12 -0
- package/lib/features/computer/pageZoom.js.map +1 -0
- package/lib/features/computer/pictureGeometry.js +68 -0
- package/lib/features/computer/pictureGeometry.js.map +1 -0
- package/lib/features/computer/tabsState.js +7 -0
- package/lib/features/computer/tabsState.js.map +1 -0
- package/lib/features/computer/useComputerHooks.js +146 -0
- package/lib/features/computer/useComputerHooks.js.map +1 -0
- package/lib/features/games/cubeforge3D.js +11 -6
- package/lib/features/games/cubeforge3D.js.map +1 -1
- package/lib/features/games/vendored/core/cubeforge/items.js +2 -8
- package/lib/features/games/vendored/core/cubeforge/items.js.map +1 -1
- package/lib/features/games/vendored/core/cubeforge/recipes.js +1 -4
- package/lib/features/games/vendored/core/cubeforge/recipes.js.map +1 -1
- package/lib/features/games/vendored/core/cubeforge/skin.js +83 -0
- package/lib/features/games/vendored/core/cubeforge/skin.js.map +1 -0
- package/lib/features/games/vendored/core/cubeforge/worldgen.js +2 -38
- package/lib/features/games/vendored/core/cubeforge/worldgen.js.map +1 -1
- package/lib/features/games/vendored/core/engine/palette.js +2 -9
- package/lib/features/games/vendored/core/engine/palette.js.map +1 -1
- package/lib/features/games/vendored/core/lessons/lessons.js +2 -96
- package/lib/features/games/vendored/core/lessons/lessons.js.map +1 -1
- package/lib/features/games/vendored/ui/GamesRoot.js +87 -144
- package/lib/features/games/vendored/ui/GamesRoot.js.map +1 -1
- package/lib/features/games/vendored/ui/components/primitives.js +2 -50
- package/lib/features/games/vendored/ui/components/primitives.js.map +1 -1
- package/lib/features/games/vendored/ui/screens/Cubeforge3DHomeScreen.js +20 -3
- package/lib/features/games/vendored/ui/screens/Cubeforge3DHomeScreen.js.map +1 -1
- package/lib/features/games/vendored/ui/screens/SkinEditorScreen.js +169 -0
- package/lib/features/games/vendored/ui/screens/SkinEditorScreen.js.map +1 -0
- package/lib/features/games/vendored/ui/theme.js +1 -3
- package/lib/features/games/vendored/ui/theme.js.map +1 -1
- package/lib/features/links/openInApp.js +10 -1
- package/lib/features/links/openInApp.js.map +1 -1
- package/lib/features/notion/notionEditorModel.js +3 -1
- package/lib/features/notion/notionEditorModel.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +180 -44
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/buildFragments.js +16 -3
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/codezenHandoff.js +29 -1
- package/lib/features/webbuilder/codezenHandoff.js.map +1 -1
- package/lib/features/webbuilder/components/CodeView.js +69 -23
- package/lib/features/webbuilder/components/CodeView.js.map +1 -1
- package/lib/features/webbuilder/components/PreviewFrame.js +62 -2
- package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
- package/lib/features/webbuilder/components/PreviewScreen.js +37 -2
- package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +2 -1
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectSheets.js +147 -57
- package/lib/features/webbuilder/components/ProjectSheets.js.map +1 -1
- package/lib/features/webbuilder/components/PublishSheet.js +106 -2
- package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
- package/lib/features/webbuilder/components/ReferenceModeChoice.js +105 -0
- package/lib/features/webbuilder/components/ReferenceModeChoice.js.map +1 -0
- package/lib/features/webbuilder/components/RetentionBanner.js +17 -6
- package/lib/features/webbuilder/components/RetentionBanner.js.map +1 -1
- package/lib/features/webbuilder/components/SiteUploadSheet.js +327 -0
- package/lib/features/webbuilder/components/SiteUploadSheet.js.map +1 -0
- package/lib/features/webbuilder/components/StreamStallNote.js +38 -0
- package/lib/features/webbuilder/components/StreamStallNote.js.map +1 -0
- package/lib/features/webbuilder/components/StudioHome.js +18 -8
- package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
- package/lib/features/webbuilder/previewRoutes.js +30 -1
- package/lib/features/webbuilder/previewRoutes.js.map +1 -1
- package/lib/features/webbuilder/studioCatalog.js +9 -2
- package/lib/features/webbuilder/studioCatalog.js.map +1 -1
- package/lib/features/webbuilder/web/chat/referenceMode.js +11 -0
- package/lib/features/webbuilder/web/chat/referenceMode.js.map +1 -0
- package/lib/features/webbuilder/web/chat/siteCopy.js +5 -2
- package/lib/features/webbuilder/web/chat/siteCopy.js.map +1 -1
- package/lib/features/webbuilder/web/chat/streamStall.js +6 -0
- package/lib/features/webbuilder/web/chat/streamStall.js.map +1 -0
- package/lib/features/webbuilder/web/code/savedCode.js +7 -0
- package/lib/features/webbuilder/web/code/savedCode.js.map +1 -0
- package/lib/features/webbuilder/web/design/directions.js.map +1 -1
- package/lib/features/webbuilder/web/history/versions.js.map +1 -1
- package/lib/features/webbuilder/web/import/websiteImport.js +27 -0
- package/lib/features/webbuilder/web/import/websiteImport.js.map +1 -0
- package/lib/features/webbuilder/web/preview/setupPhase.js +31 -0
- package/lib/features/webbuilder/web/preview/setupPhase.js.map +1 -0
- package/lib/features/webbuilder/web/publish/siteInsights.js +23 -1
- package/lib/features/webbuilder/web/publish/siteInsights.js.map +1 -1
- package/lib/features/webbuilder/web/upload/sitePhotos.js +102 -0
- package/lib/features/webbuilder/web/upload/sitePhotos.js.map +1 -0
- package/lib/routes.json +54 -0
- package/lib/screens/ComputerNative/index.js +124 -0
- package/lib/screens/ComputerNative/index.js.map +1 -0
- package/lib/screens/ComputerNative/useComputerHostChat.js +83 -0
- package/lib/screens/ComputerNative/useComputerHostChat.js.map +1 -0
- package/lib/screens/GamesNative/index.js +1 -1
- package/lib/screens/Home/components/homeCatalog.js +4 -3
- package/lib/screens/Home/components/homeCatalog.js.map +1 -1
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +6 -2
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -1
- package/lib/screens/WebBuilderNative/index.js +15 -3
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +18 -3
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/lib/screens/WebBuilderNative/webbuilderTransport.js +16 -7
- package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
- package/package.json +4 -4
- package/lib/features/games/vendored/core/classroom/permissions.js +0 -76
- package/lib/features/games/vendored/core/classroom/permissions.js.map +0 -1
- package/lib/features/games/vendored/core/classroom/resourceLink.js +0 -101
- package/lib/features/games/vendored/core/classroom/resourceLink.js.map +0 -1
- package/lib/features/games/vendored/core/classroom/rules.js +0 -83
- package/lib/features/games/vendored/core/classroom/rules.js.map +0 -1
- package/lib/features/games/vendored/core/classroom/worldSettings.js +0 -49
- package/lib/features/games/vendored/core/classroom/worldSettings.js.map +0 -1
- package/lib/features/games/vendored/core/cubeforge/cycle.js +0 -15
- package/lib/features/games/vendored/core/cubeforge/cycle.js.map +0 -1
- package/lib/features/games/vendored/core/cubeforge/inventory.js +0 -75
- package/lib/features/games/vendored/core/cubeforge/inventory.js.map +0 -1
- package/lib/features/games/vendored/core/cubeforge/save.js +0 -92
- package/lib/features/games/vendored/core/cubeforge/save.js.map +0 -1
- package/lib/features/games/vendored/core/cubeforge/session.js +0 -154
- package/lib/features/games/vendored/core/cubeforge/session.js.map +0 -1
- package/lib/features/games/vendored/core/engine/iso.js +0 -41
- package/lib/features/games/vendored/core/engine/iso.js.map +0 -1
- package/lib/features/games/vendored/core/engine/world.js +0 -148
- package/lib/features/games/vendored/core/engine/world.js.map +0 -1
- package/lib/features/games/vendored/core/games/catalog.js +0 -34
- package/lib/features/games/vendored/core/games/catalog.js.map +0 -1
- package/lib/features/games/vendored/core/logging/events.js +0 -24
- package/lib/features/games/vendored/core/logging/events.js.map +0 -1
- package/lib/features/games/vendored/core/logging/logger.js +0 -54
- package/lib/features/games/vendored/core/logging/logger.js.map +0 -1
- package/lib/features/games/vendored/core/session/gameSession.js +0 -317
- package/lib/features/games/vendored/core/session/gameSession.js.map +0 -1
- package/lib/features/games/vendored/core/storage/worldRepository.js +0 -192
- package/lib/features/games/vendored/core/storage/worldRepository.js.map +0 -1
- package/lib/features/games/vendored/core/store/reactive.js +0 -78
- package/lib/features/games/vendored/core/store/reactive.js.map +0 -1
- package/lib/features/games/vendored/ui/components/BlockPalette.js +0 -64
- package/lib/features/games/vendored/ui/components/BlockPalette.js.map +0 -1
- package/lib/features/games/vendored/ui/components/IsoCanvas.js +0 -124
- package/lib/features/games/vendored/ui/components/IsoCanvas.js.map +0 -1
- package/lib/features/games/vendored/ui/hooks/useReactiveQuery.js +0 -3
- package/lib/features/games/vendored/ui/hooks/useReactiveQuery.js.map +0 -1
- package/lib/features/games/vendored/ui/screens/ActivityScreen.js +0 -68
- package/lib/features/games/vendored/ui/screens/ActivityScreen.js.map +0 -1
- package/lib/features/games/vendored/ui/screens/BuilderScreen.js +0 -227
- package/lib/features/games/vendored/ui/screens/BuilderScreen.js.map +0 -1
- package/lib/features/games/vendored/ui/screens/ClassroomScreen.js +0 -95
- package/lib/features/games/vendored/ui/screens/ClassroomScreen.js.map +0 -1
- package/lib/features/games/vendored/ui/screens/CubeforgeScreen.js +0 -342
- package/lib/features/games/vendored/ui/screens/CubeforgeScreen.js.map +0 -1
- package/lib/features/games/vendored/ui/screens/HubScreen.js +0 -131
- package/lib/features/games/vendored/ui/screens/HubScreen.js.map +0 -1
- package/lib/features/games/vendored/ui/screens/WorldListScreen.js +0 -134
- package/lib/features/games/vendored/ui/screens/WorldListScreen.js.map +0 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {memo,useCallback}from'react';import {View,StyleSheet,Pressable}from'react-native';import {useNavigation,useRoute,CommonActions}from'@react-navigation/native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {Text}from'@admin-layout/gluestack-ui-mobile';import {mobileColors}from'../../theme/mobileTokens.js';const NotionPageWidgetCard = memo(function NotionPageWidgetCard2({
|
|
2
|
+
page,
|
|
3
|
+
isDark
|
|
4
|
+
}) {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const navigation = useNavigation();
|
|
7
|
+
const route = useRoute();
|
|
8
|
+
const orgName = (_b = (_a = route.params) == null ? void 0 : _a.orgName) != null ? _b : null;
|
|
9
|
+
const colors = mobileColors(isDark);
|
|
10
|
+
const open = useCallback(() => {
|
|
11
|
+
navigation.dispatch(CommonActions.navigate({
|
|
12
|
+
name: "MainStack.NotionPage",
|
|
13
|
+
params: {
|
|
14
|
+
orgName,
|
|
15
|
+
blockId: page.pageId
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
}, [navigation, orgName, page.pageId]);
|
|
19
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.card, {
|
|
20
|
+
borderColor: colors.border,
|
|
21
|
+
backgroundColor: colors.surface
|
|
22
|
+
}], children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(View, { style: styles.page, children: [
|
|
24
|
+
/* @__PURE__ */ jsx(View, { style: [styles.icon, {
|
|
25
|
+
backgroundColor: colors.surfaceMuted
|
|
26
|
+
}], children: page.icon ? /* @__PURE__ */ jsx(Text, { style: styles.emoji, children: page.icon }) : /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "file-document-outline", size: 22, color: colors.text }) }),
|
|
27
|
+
/* @__PURE__ */ jsxs(View, { style: styles.body, children: [
|
|
28
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 2, style: [styles.title, {
|
|
29
|
+
color: colors.text
|
|
30
|
+
}], children: page.title }),
|
|
31
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.source, {
|
|
32
|
+
color: colors.textMuted
|
|
33
|
+
}], children: "Yantra Notion" })
|
|
34
|
+
] })
|
|
35
|
+
] }),
|
|
36
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: open, accessibilityRole: "button", accessibilityLabel: `Open ${page.title} in Notion`, style: ({
|
|
37
|
+
pressed
|
|
38
|
+
}) => [styles.open, {
|
|
39
|
+
backgroundColor: colors.text
|
|
40
|
+
}, pressed && styles.pressed], children: /* @__PURE__ */ jsx(Text, { style: [styles.openText, {
|
|
41
|
+
color: colors.bg
|
|
42
|
+
}], children: "Open in Notion" }) })
|
|
43
|
+
] });
|
|
44
|
+
});
|
|
45
|
+
const styles = StyleSheet.create({
|
|
46
|
+
card: {
|
|
47
|
+
width: "100%",
|
|
48
|
+
gap: 12,
|
|
49
|
+
padding: 12,
|
|
50
|
+
marginTop: 4,
|
|
51
|
+
marginBottom: 8,
|
|
52
|
+
borderWidth: 1,
|
|
53
|
+
borderRadius: 16
|
|
54
|
+
},
|
|
55
|
+
page: {
|
|
56
|
+
flexDirection: "row",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
gap: 12
|
|
59
|
+
},
|
|
60
|
+
icon: {
|
|
61
|
+
width: 40,
|
|
62
|
+
height: 40,
|
|
63
|
+
borderRadius: 10,
|
|
64
|
+
alignItems: "center",
|
|
65
|
+
justifyContent: "center"
|
|
66
|
+
},
|
|
67
|
+
emoji: {
|
|
68
|
+
fontSize: 20,
|
|
69
|
+
lineHeight: 26
|
|
70
|
+
},
|
|
71
|
+
body: {
|
|
72
|
+
flex: 1,
|
|
73
|
+
minWidth: 0
|
|
74
|
+
},
|
|
75
|
+
title: {
|
|
76
|
+
fontSize: 15,
|
|
77
|
+
fontWeight: "700",
|
|
78
|
+
lineHeight: 20
|
|
79
|
+
},
|
|
80
|
+
source: {
|
|
81
|
+
fontSize: 13,
|
|
82
|
+
lineHeight: 18,
|
|
83
|
+
marginTop: 1
|
|
84
|
+
},
|
|
85
|
+
open: {
|
|
86
|
+
height: 44,
|
|
87
|
+
borderRadius: 12,
|
|
88
|
+
alignItems: "center",
|
|
89
|
+
justifyContent: "center"
|
|
90
|
+
},
|
|
91
|
+
openText: {
|
|
92
|
+
fontSize: 14,
|
|
93
|
+
fontWeight: "600"
|
|
94
|
+
},
|
|
95
|
+
pressed: {
|
|
96
|
+
opacity: 0.75
|
|
97
|
+
}
|
|
98
|
+
});export{NotionPageWidgetCard};//# sourceMappingURL=NotionPageWidgetCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NotionPageWidgetCard.js","sources":["../../../src/features/chat/NotionPageWidgetCard.tsx"],"sourcesContent":["/**\n * A page the agent wrote in Yantra Notion, with the way to open it. Without this the reply only named\n * the page, and the person had to go and find it under All pages.\n */\nimport React, { memo, useCallback } from 'react';\nimport { Pressable, StyleSheet, View } from 'react-native';\nimport {\n CommonActions,\n useNavigation,\n useRoute,\n type NavigationProp,\n type ParamListBase,\n} from '@react-navigation/native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\nimport { Text } from '@admin-layout/gluestack-ui-mobile';\nimport { mobileColors } from '../../theme/mobileTokens';\nimport type { NotionPageAttachment } from './notionPageWidget';\n\nexport const NotionPageWidgetCard = memo(function NotionPageWidgetCard({\n page,\n isDark,\n}: {\n page: NotionPageAttachment;\n isDark: boolean;\n}) {\n const navigation = useNavigation<NavigationProp<ParamListBase>>();\n const route = useRoute();\n const orgName = (route.params as { orgName?: string | null } | undefined)?.orgName ?? null;\n const colors = mobileColors(isDark);\n\n const open = useCallback(() => {\n navigation.dispatch(\n CommonActions.navigate({ name: 'MainStack.NotionPage', params: { orgName, blockId: page.pageId } }),\n );\n }, [navigation, orgName, page.pageId]);\n\n return (\n <View style={[styles.card, { borderColor: colors.border, backgroundColor: colors.surface }]}>\n <View style={styles.page}>\n <View style={[styles.icon, { backgroundColor: colors.surfaceMuted }]}>\n {page.icon ? (\n <Text style={styles.emoji}>{page.icon}</Text>\n ) : (\n <MaterialCommunityIcons name=\"file-document-outline\" size={22} color={colors.text} />\n )}\n </View>\n <View style={styles.body}>\n <Text numberOfLines={2} style={[styles.title, { color: colors.text }]}>\n {page.title}\n </Text>\n <Text numberOfLines={1} style={[styles.source, { color: colors.textMuted }]}>\n Yantra Notion\n </Text>\n </View>\n </View>\n <Pressable\n onPress={open}\n accessibilityRole=\"button\"\n accessibilityLabel={`Open ${page.title} in Notion`}\n style={({ pressed }) => [styles.open, { backgroundColor: colors.text }, pressed && styles.pressed]}\n >\n <Text style={[styles.openText, { color: colors.bg }]}>Open in Notion</Text>\n </Pressable>\n </View>\n );\n});\n\nconst styles = StyleSheet.create({\n card: {\n width: '100%',\n gap: 12,\n padding: 12,\n marginTop: 4,\n marginBottom: 8,\n borderWidth: 1,\n borderRadius: 16,\n },\n page: { flexDirection: 'row', alignItems: 'center', gap: 12 },\n icon: { width: 40, height: 40, borderRadius: 10, alignItems: 'center', justifyContent: 'center' },\n emoji: { fontSize: 20, lineHeight: 26 },\n body: { flex: 1, minWidth: 0 },\n title: { fontSize: 15, fontWeight: '700', lineHeight: 20 },\n source: { fontSize: 13, lineHeight: 18, marginTop: 1 },\n open: { height: 44, borderRadius: 12, alignItems: 'center', justifyContent: 'center' },\n openText: { fontSize: 14, fontWeight: '600' },\n pressed: { opacity: 0.75 },\n});\n"],"names":["NotionPageWidgetCard"],"mappings":"mXAWa,MAAA,oBAAA,GAAuB,IAAK,CAAA,SAASA,qBAAqB,CAAA;AAAA,EACrE,IAAA;AAAA,EACA;AACF,CAGG,EAAA;AAjBH,EAAA,IAAA,EAAA,EAAA,EAAA;AAkBE,EAAA,MAAM,aAAa,aAA6C,EAAA;AAChE,EAAA,MAAM,QAAQ,QAAS,EAAA;AACvB,EAAA,MAAM,OAAW,GAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,KAAA,CAAM,MAAN,KAAA,IAAA,GAAA,MAAA,GAAA,EAAA,CAED,YAFC,IAEU,GAAA,EAAA,GAAA,IAAA;AAC3B,EAAM,MAAA,MAAA,GAAS,aAAa,MAAM,CAAA;AAClC,EAAM,MAAA,IAAA,GAAO,YAAY,MAAM;AAC7B,IAAW,UAAA,CAAA,QAAA,CAAS,cAAc,QAAS,CAAA;AAAA,MACzC,IAAM,EAAA,sBAAA;AAAA,MACN,MAAQ,EAAA;AAAA,QACN,OAAA;AAAA,QACA,SAAS,IAAK,CAAA;AAAA;AAChB,KACD,CAAC,CAAA;AAAA,KACD,CAAC,UAAA,EAAY,OAAS,EAAA,IAAA,CAAK,MAAM,CAAC,CAAA;AACrC,EAAA,uBAAQ,IAAA,CAAA,IAAA,EAAA,EAAK,KAAO,EAAA,CAAC,OAAO,IAAM,EAAA;AAAA,IAChC,aAAa,MAAO,CAAA,MAAA;AAAA,IACpB,iBAAiB,MAAO,CAAA;AAAA,GACzB,CACS,EAAA,QAAA,EAAA;AAAA,oBAAC,IAAA,CAAA,IAAA,EAAA,EAAK,KAAO,EAAA,MAAA,CAAO,IAChB,EAAA,QAAA,EAAA;AAAA,sBAAA,GAAA,CAAC,IAAK,EAAA,EAAA,KAAA,EAAO,CAAC,MAAA,CAAO,IAAM,EAAA;AAAA,QAC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EAAA,EAAA;AAAA,IACV,UAAY,EAAA;AAAA,GACd;AAAA,EACA,OAAS,EAAA;AAAA,IACP,OAAS,EAAA;AAAA;AAEb,CAAC,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {surfaceReplyDisplayText,TEMPLATES_WIDGET,parseTemplatesOpening,CANVAS_DESIGN_WIDGET,toCanvasDesignAttachment,splitTemplatesSurfaceLink,canvasDesignFromWidget}from'common';import {TemplatesWidgetCard,CanvasDesignWidgetCard}from'./TemplatesChatCards.js';import {registerTranscriptProtocol}from'./transcriptProtocol.js';var __defProp = Object.defineProperty;
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {surfaceReplyDisplayText,TEMPLATES_WIDGET,parseTemplatesOpening,CANVAS_DESIGN_WIDGET,toCanvasDesignAttachment,splitTemplatesSurfaceLink,canvasDesignFromWidget}from'common';import {NotionPageWidgetCard}from'./NotionPageWidgetCard.js';import {NOTION_PAGE_WIDGET,toNotionPageAttachment}from'./notionPageWidget.js';import {TemplatesWidgetCard,CanvasDesignWidgetCard}from'./TemplatesChatCards.js';import {registerTranscriptProtocol}from'./transcriptProtocol.js';var __defProp = Object.defineProperty;
|
|
2
2
|
var __defProps = Object.defineProperties;
|
|
3
3
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -73,6 +73,10 @@ const hostTranscriptProtocol = {
|
|
|
73
73
|
const design = toCanvasDesignAttachment(widget.attachment);
|
|
74
74
|
return design ? /* @__PURE__ */ jsx(CanvasDesignWidgetCard, { design, isDark }) : null;
|
|
75
75
|
}
|
|
76
|
+
if (widget.component === NOTION_PAGE_WIDGET) {
|
|
77
|
+
const page = toNotionPageAttachment(widget.attachment);
|
|
78
|
+
return page ? /* @__PURE__ */ jsx(NotionPageWidgetCard, { page, isDark }) : null;
|
|
79
|
+
}
|
|
76
80
|
return null;
|
|
77
81
|
},
|
|
78
82
|
userTurnText: surfaceReplyDisplayText
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hostTranscriptProtocol.js","sources":["../../../src/features/chat/hostTranscriptProtocol.tsx"],"sourcesContent":["/**\n * The host's half of transcriptProtocol: templates in a chat, read by common's\n * TEMPLATES_CHAT_PROTOCOL and drawn as TemplatesChatCards.\n *\n * Host-only: this module imports `common` and the in-app browser, which the federated surface\n * remotes must not bundle. A remote's transcript reaches it through the registered protocol. The\n * card is a host component; rendered inside the remote's tree it still reads the host's providers,\n * which wrap that tree (as the connect card does, useHostConnectorCard).\n */\nimport React from 'react';\nimport {\n CANVAS_DESIGN_WIDGET,\n canvasDesignFromWidget,\n parseTemplatesOpening,\n splitTemplatesSurfaceLink,\n surfaceReplyDisplayText,\n TEMPLATES_WIDGET,\n toCanvasDesignAttachment,\n} from 'common';\nimport type { ChatWidgetEnvelope } from './chatWidgets';\nimport { CanvasDesignWidgetCard, TemplatesWidgetCard } from './TemplatesChatCards';\nimport { registerTranscriptProtocol, type TranscriptProtocol } from './transcriptProtocol';\n\nfunction readWidget(envelope: ChatWidgetEnvelope) {\n // Templates to browse: every field optional, the opening sometimes flat in `contents`.\n if (envelope.propsComponent === TEMPLATES_WIDGET) {\n const contents = envelope.propsConfiguration?.contents as Record<string, unknown> | undefined;\n const opening = parseTemplatesOpening(contents?.attachment ?? envelope.attachment ?? contents ?? {});\n return opening ? { component: TEMPLATES_WIDGET, attachment: { ...opening } } : null;\n }\n // A design made from a template, only with the canvas artifact it is.\n if (envelope.propsComponent === CANVAS_DESIGN_WIDGET) {\n const design = canvasDesignFromWidget(envelope);\n return design ? { component: CANVAS_DESIGN_WIDGET, attachment: { ...design } } : null;\n }\n return undefined;\n}\n\nexport const hostTranscriptProtocol: TranscriptProtocol = {\n readWidget,\n settleWidgets({ text, widgets }) {\n // The gateway keeps the reply's LAST templates widget as the link's snapshot, so that one owns it.\n const templates = widgets.map((w) => w.component).lastIndexOf(TEMPLATES_WIDGET);\n if (templates < 0) return { text, widgets };\n const { text: rest, url } = splitTemplatesSurfaceLink(text);\n if (!url) return { text, widgets };\n const settled = [...widgets];\n settled[templates] = { ...settled[templates], link: url };\n return { text: rest, widgets: settled };\n },\n renderWidget(widget, isDark) {\n if (widget.component === TEMPLATES_WIDGET) {\n const opening = parseTemplatesOpening(widget.attachment);\n return opening ? <TemplatesWidgetCard opening={opening} link={widget.link} isDark={isDark} /> : null;\n }\n if (widget.component === CANVAS_DESIGN_WIDGET) {\n const design = toCanvasDesignAttachment(widget.attachment);\n return design ? <CanvasDesignWidgetCard design={design} isDark={isDark} /> : null;\n }\n return null;\n },\n userTurnText: surfaceReplyDisplayText,\n};\n\n/** Called once at startup, from this package's module (the host's, never a remote's). */\nexport function registerHostTranscriptProtocol(): () => void {\n return registerTranscriptProtocol(hostTranscriptProtocol);\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"hostTranscriptProtocol.js","sources":["../../../src/features/chat/hostTranscriptProtocol.tsx"],"sourcesContent":["/**\n * The host's half of transcriptProtocol: templates in a chat, read by common's\n * TEMPLATES_CHAT_PROTOCOL and drawn as TemplatesChatCards.\n *\n * Host-only: this module imports `common` and the in-app browser, which the federated surface\n * remotes must not bundle. A remote's transcript reaches it through the registered protocol. The\n * card is a host component; rendered inside the remote's tree it still reads the host's providers,\n * which wrap that tree (as the connect card does, useHostConnectorCard).\n */\nimport React from 'react';\nimport {\n CANVAS_DESIGN_WIDGET,\n canvasDesignFromWidget,\n parseTemplatesOpening,\n splitTemplatesSurfaceLink,\n surfaceReplyDisplayText,\n TEMPLATES_WIDGET,\n toCanvasDesignAttachment,\n} from 'common';\nimport type { ChatWidgetEnvelope } from './chatWidgets';\nimport { NotionPageWidgetCard } from './NotionPageWidgetCard';\nimport { NOTION_PAGE_WIDGET, toNotionPageAttachment } from './notionPageWidget';\nimport { CanvasDesignWidgetCard, TemplatesWidgetCard } from './TemplatesChatCards';\nimport { registerTranscriptProtocol, type TranscriptProtocol } from './transcriptProtocol';\n\nfunction readWidget(envelope: ChatWidgetEnvelope) {\n // Templates to browse: every field optional, the opening sometimes flat in `contents`.\n if (envelope.propsComponent === TEMPLATES_WIDGET) {\n const contents = envelope.propsConfiguration?.contents as Record<string, unknown> | undefined;\n const opening = parseTemplatesOpening(contents?.attachment ?? envelope.attachment ?? contents ?? {});\n return opening ? { component: TEMPLATES_WIDGET, attachment: { ...opening } } : null;\n }\n // A design made from a template, only with the canvas artifact it is.\n if (envelope.propsComponent === CANVAS_DESIGN_WIDGET) {\n const design = canvasDesignFromWidget(envelope);\n return design ? { component: CANVAS_DESIGN_WIDGET, attachment: { ...design } } : null;\n }\n return undefined;\n}\n\nexport const hostTranscriptProtocol: TranscriptProtocol = {\n readWidget,\n settleWidgets({ text, widgets }) {\n // The gateway keeps the reply's LAST templates widget as the link's snapshot, so that one owns it.\n const templates = widgets.map((w) => w.component).lastIndexOf(TEMPLATES_WIDGET);\n if (templates < 0) return { text, widgets };\n const { text: rest, url } = splitTemplatesSurfaceLink(text);\n if (!url) return { text, widgets };\n const settled = [...widgets];\n settled[templates] = { ...settled[templates], link: url };\n return { text: rest, widgets: settled };\n },\n renderWidget(widget, isDark) {\n if (widget.component === TEMPLATES_WIDGET) {\n const opening = parseTemplatesOpening(widget.attachment);\n return opening ? <TemplatesWidgetCard opening={opening} link={widget.link} isDark={isDark} /> : null;\n }\n if (widget.component === CANVAS_DESIGN_WIDGET) {\n const design = toCanvasDesignAttachment(widget.attachment);\n return design ? <CanvasDesignWidgetCard design={design} isDark={isDark} /> : null;\n }\n if (widget.component === NOTION_PAGE_WIDGET) {\n const page = toNotionPageAttachment(widget.attachment);\n return page ? <NotionPageWidgetCard page={page} isDark={isDark} /> : null;\n }\n return null;\n },\n userTurnText: surfaceReplyDisplayText,\n};\n\n/** Called once at startup, from this package's module (the host's, never a remote's). */\nexport function registerHostTranscriptProtocol(): () => void {\n return registerTranscriptProtocol(hostTranscri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CAAC,oBAAqB,EAAA,EAAA,IAAA,EAAY,QAAgB,CAAK,GAAA,IAAA;AAAA;AAEvE,IAAO,OAAA,IAAA;AAAA,GACT;AAAA,EACA,YAAc,EAAA;AAChB;AAGO,SAAS,8BAA6C,GAAA;AAC3D,EAAA,OAAO,2BAA2B,sBAAsB,CAAA;AAC1D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
const NOTION_PAGE_WIDGET = "notion-page";
|
|
18
|
+
function text(value) {
|
|
19
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
20
|
+
}
|
|
21
|
+
function toNotionPageAttachment(raw) {
|
|
22
|
+
var _a;
|
|
23
|
+
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
24
|
+
const a = raw;
|
|
25
|
+
const pageId = text(a.pageId);
|
|
26
|
+
if (!pageId) return null;
|
|
27
|
+
const icon = text(a.icon);
|
|
28
|
+
return __spreadValues({
|
|
29
|
+
pageId,
|
|
30
|
+
title: (_a = text(a.title)) != null ? _a : "Untitled"
|
|
31
|
+
}, icon ? {
|
|
32
|
+
icon
|
|
33
|
+
} : {});
|
|
34
|
+
}export{NOTION_PAGE_WIDGET,toNotionPageAttachment};//# sourceMappingURL=notionPageWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notionPageWidget.js","sources":["../../../src/features/chat/notionPageWidget.ts"],"sourcesContent":["/** The `propsComponent` the Yantra Notion skill ends a reply with, once a page exists. */\nexport const NOTION_PAGE_WIDGET = 'notion-page';\n\nexport interface NotionPageAttachment {\n pageId: string;\n title: string;\n icon?: string;\n}\n\nfunction text(value: unknown): string | undefined {\n return typeof value === 'string' && value.trim() ? value.trim() : undefined;\n}\n\n/** One attachment as a Yantra Notion page, or null without the page it opens. The web's reader, on the phone. */\nexport function toNotionPageAttachment(raw: unknown): NotionPageAttachment | null {\n if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;\n const a = raw as Record<string, unknown>;\n const pageId = text(a.pageId);\n if (!pageId) return null;\n const icon = text(a.icon);\n return { pageId, title: text(a.title) ?? 'Untitled', ...(icon ? { icon } : {}) };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACO,MAAM,kBAAqB,GAAA;AAMlC,SAAS,KAAK,KAAoC,EAAA;AAChD,EAAO,OAAA,OAAO,UAAU,QAAY,IAAA,KAAA,CAAM,MAAS,GAAA,KAAA,CAAM,MAAS,GAAA,MAAA;AACpE;AAGO,SAAS,uBAAuB,GAA2C,EAAA;AAZlF,EAAA,IAAA,EAAA;AAaE,EAAI,IAAA,CAAC,OAAO,OAAO,GAAA,KAAQ,YAAY,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA,EAAU,OAAA,IAAA;AAClE,EAAA,MAAM,CAAI,GAAA,GAAA;AACV,EAAM,MAAA,MAAA,GAAS,IAAK,CAAA,CAAA,CAAE,MAAM,CAAA;AAC5B,EAAI,IAAA,CAAC,QAAe,OAAA,IAAA;AACpB,EAAM,MAAA,IAAA,GAAO,IAAK,CAAA,CAAA,CAAE,IAAI,CAAA;AACxB,EAAO,OAAA,cAAA,CAAA;AAAA,IACL,MAAA;AAAA,IACA,KAAO,EAAA,CAAA,EAAA,GAAA,IAAA,CAAK,CAAE,CAAA,KAAK,MAAZ,IAAiB,GAAA,EAAA,GAAA;AAAA,GAAA,EACpB,IAAO,GAAA;AAAA,IACT;AAAA,MACE,EAAC,CAAA;AAET"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {NativeAgentChat}from'../agent-chat/NativeAgentChat.js';import {COMPUTER_SUGGESTIONS,COMPUTER_EMPTY_BODY,COMPUTER_EMPTY_TITLE,COMPUTER_PLACEHOLDER,composeComputerTurn}from'./computerChat.js';import {computerChatPalette,useComputerColors}from'./computerTheme.js';const NOT_CONNECTED = "Yantra is not connected yet. Check the connection in Home, then send again.";
|
|
2
|
+
function ComputerAgentChatPane({
|
|
3
|
+
visible,
|
|
4
|
+
onClose,
|
|
5
|
+
hostChat,
|
|
6
|
+
workspaceId,
|
|
7
|
+
seed,
|
|
8
|
+
belowHeader
|
|
9
|
+
}) {
|
|
10
|
+
var _a, _b, _c;
|
|
11
|
+
const P = computerChatPalette(useComputerColors());
|
|
12
|
+
const [localMessages, setLocalMessages] = useState([]);
|
|
13
|
+
const seeded = useRef(null);
|
|
14
|
+
const hostMessages = (_a = hostChat == null ? void 0 : hostChat.messages) != null ? _a : [];
|
|
15
|
+
const messages = hostMessages.length > 0 ? hostMessages : localMessages;
|
|
16
|
+
const send = (text, files) => {
|
|
17
|
+
const trimmed = text.trim();
|
|
18
|
+
if (!trimmed && !(files == null ? void 0 : files.length)) return;
|
|
19
|
+
if (!hostChat || !hostChat.connected) {
|
|
20
|
+
setLocalMessages((prev) => [...prev, {
|
|
21
|
+
id: `u-${Date.now()}`,
|
|
22
|
+
role: "user",
|
|
23
|
+
content: trimmed
|
|
24
|
+
}, {
|
|
25
|
+
id: `a-${Date.now()}`,
|
|
26
|
+
role: "assistant",
|
|
27
|
+
content: (hostChat == null ? void 0 : hostChat.error) || NOT_CONNECTED
|
|
28
|
+
}]);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
setLocalMessages([]);
|
|
32
|
+
hostChat.send(composeComputerTurn(trimmed, workspaceId), files);
|
|
33
|
+
};
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!visible || !seed || seeded.current === seed.id) return;
|
|
36
|
+
seeded.current = seed.id;
|
|
37
|
+
send(seed.text, seed.files);
|
|
38
|
+
}, [visible, seed]);
|
|
39
|
+
return /* @__PURE__ */ jsx(NativeAgentChat, { title: "Computer agent", visible, onClose, onSwipeLeft: onClose, messages, renderConnectorCard: hostChat == null ? void 0 : hostChat.renderConnectorCard, onSend: send, onClear: () => {
|
|
40
|
+
var _a2;
|
|
41
|
+
setLocalMessages([]);
|
|
42
|
+
seeded.current = null;
|
|
43
|
+
(_a2 = hostChat == null ? void 0 : hostChat.clear) == null ? void 0 : _a2.call(hostChat);
|
|
44
|
+
}, busy: Boolean(hostChat == null ? void 0 : hostChat.busy), steering: hostChat, streamingContent: (_b = hostChat == null ? void 0 : hostChat.streaming) != null ? _b : null, error: (_c = hostChat == null ? void 0 : hostChat.error) != null ? _c : null, placeholder: COMPUTER_PLACEHOLDER, emptyTitle: COMPUTER_EMPTY_TITLE, emptyBody: COMPUTER_EMPTY_BODY, suggestions: messages.length === 0 ? COMPUTER_SUGGESTIONS : [], belowHeader, enableAttachments: true, isDark: P.isDark, ink: P.ink, muted: P.muted, screen: P.screen, border: P.border, card: P.card });
|
|
45
|
+
}export{ComputerAgentChatPane};//# sourceMappingURL=ComputerAgentChatPane.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComputerAgentChatPane.js","sources":["../../../src/features/computer/ComputerAgentChatPane.tsx"],"sourcesContent":["/**\n * The Computer's agent - native twin of the web surface's ComputerChatPane in\n * its hosted mode (`HostChatPane` over the shell's session): the shared\n * NativeAgentChat over the host's gateway chat, so the conversation lives in\n * the app's history like any other.\n *\n * Every turn carries the computer's steering (computerChat.ts) so the agent\n * drives THIS workspace; the transcript shows the person's own words.\n */\nimport React, { useEffect, useRef, useState, type ReactNode } from 'react';\nimport { NativeAgentChat, type AgentChatMessage, type HostChatSteering } from '../agent-chat';\nimport type { MessageAttachment } from '../../hooks/useChatStream';\nimport {\n COMPUTER_EMPTY_BODY,\n COMPUTER_EMPTY_TITLE,\n COMPUTER_PLACEHOLDER,\n COMPUTER_SUGGESTIONS,\n composeComputerTurn,\n} from './computerChat';\nimport { computerChatPalette, useComputerColors } from './computerTheme';\n\n/** Host gateway chat - same contract as web `services.hostChat`. */\nexport interface ComputerHostChat extends HostChatSteering {\n messages: AgentChatMessage[];\n streaming?: string | null;\n busy?: boolean;\n error?: string | null;\n connected?: boolean;\n send: (text: string, attachments?: MessageAttachment[]) => void;\n clear?: () => void;\n /** The `[CONNECTOR_CONNECT]` card for the request waiting in this thread, built by the host. */\n renderConnectorCard?: (isDark: boolean) => ReactNode;\n}\n\nexport interface ComputerAgentSeed {\n id: string;\n text: string;\n files?: MessageAttachment[];\n}\n\nconst NOT_CONNECTED = 'Yantra is not connected yet. Check the connection in Home, then send again.';\n\nexport function ComputerAgentChatPane({\n visible,\n onClose,\n hostChat,\n workspaceId,\n seed,\n belowHeader,\n}: {\n visible: boolean;\n onClose: () => void;\n hostChat?: ComputerHostChat;\n /** The Computer the chat drives; empty until one exists. */\n workspaceId: string;\n /** A turn to send as the pane opens (a hand-off from Home or Chat). */\n seed: ComputerAgentSeed | null;\n /** The live page, small, so asking and watching are one place. */\n belowHeader?: ReactNode;\n}) {\n const P = computerChatPalette(useComputerColors());\n const [localMessages, setLocalMessages] = useState<AgentChatMessage[]>([]);\n const seeded = useRef<string | null>(null);\n const hostMessages = hostChat?.messages ?? [];\n const messages = hostMessages.length > 0 ? hostMessages : localMessages;\n\n const send = (text: string, files?: MessageAttachment[]) => {\n const trimmed = text.trim();\n if (!trimmed && !files?.length) return;\n if (!hostChat || !hostChat.connected) {\n setLocalMessages((prev) => [\n ...prev,\n { id: `u-${Date.now()}`, role: 'user', content: trimmed },\n { id: `a-${Date.now()}`, role: 'assistant', content: hostChat?.error || NOT_CONNECTED },\n ]);\n return;\n }\n setLocalMessages([]);\n hostChat.send(composeComputerTurn(trimmed, workspaceId), files);\n };\n\n useEffect(() => {\n if (!visible || !seed || seeded.current === seed.id) return;\n seeded.current = seed.id;\n send(seed.text, seed.files);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [visible, seed]);\n\n return (\n <NativeAgentChat\n title=\"Computer agent\"\n visible={visible}\n onClose={onClose}\n onSwipeLeft={onClose}\n messages={messages}\n renderConnectorCard={hostChat?.renderConnectorCard}\n onSend={send}\n onClear={() => {\n setLocalMessages([]);\n seeded.current = null;\n hostChat?.clear?.();\n }}\n busy={Boolean(hostChat?.busy)}\n steering={hostChat}\n streamingContent={hostChat?.streaming ?? null}\n error={hostChat?.error ?? null}\n placeholder={COMPUTER_PLACEHOLDER}\n emptyTitle={COMPUTER_EMPTY_TITLE}\n emptyBody={COMPUTER_EMPTY_BODY}\n suggestions={messages.length === 0 ? COMPUTER_SUGGESTIONS : []}\n belowHeader={belowHeader}\n enableAttachments\n isDark={P.isDark}\n ink={P.ink}\n muted={P.muted}\n screen={P.screen}\n border={P.border}\n card={P.card}\n />\n );\n}\n"],"names":["_a"],"mappings":"+VAgCA,MAAM,aAAgB,GAAA,6EAAA;AACf,SAAS,qBAAsB,CAAA;AAAA,EACpC,OAAA;AAAA,EACA,OAAA;AAAA,EACA,QAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA;AACF,CAUG,EAAA;AAlDH,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AAmDE,EAAM,MAAA,CAAA,GAAI,mBAAoB,CAAA,iBAAA,EAAmB,CAAA;AACjD,EAAA,MAAM,CAAC,aAAe,EAAA,gBAAgB,CAAI,GAAA,QAAA,CAA6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AAC,EAAA,MAAA,EAAQ,CAAE,CAAA,MAAA,EAAQ,GAAK,EAAA,CAAA,CAAE,KAAK,KAAO,EAAA,CAAA,CAAE,KAAO,EAAA,MAAA,EAAQ,CAAE,CAAA,MAAA,EAAQ,QAAQ,CAAE,CAAA,MAAA,EAAQ,IAAM,EAAA,CAAA,CAAE,IAAM,EAAA,CAAA;AACxb"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useState,useRef,useEffect,useCallback}from'react';import {View,Pressable,Text,ScrollView}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {openTab,closeTab,siteOf}from'./computerApi.js';import {Header,PhaseBadge,controlLine,KeyboardButton,ZoomControl,BigButton}from'./computerControls.js';import {makeComputerStyles}from'./computerStyles.js';import {useComputerColors,useThemedStyles}from'./computerTheme.js';import {FilesPane}from'./FilesPane.js';import {LivePage}from'./LivePage.js';import {OPENING_ZOOM_STEP,ZOOM_STEPS}from'./pageZoom.js';import {TerminalPane}from'./TerminalPane.js';import {useBrowserTabs}from'./useComputerHooks.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
const NOTICE_MS = 6e3;
|
|
21
|
+
function ComputerDesktop({
|
|
22
|
+
workspaceId,
|
|
23
|
+
bottomInset,
|
|
24
|
+
onExit,
|
|
25
|
+
onOpenAgent,
|
|
26
|
+
agentOpen
|
|
27
|
+
}) {
|
|
28
|
+
var _a, _b, _c, _d;
|
|
29
|
+
const C = useComputerColors();
|
|
30
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
31
|
+
const [app, setApp] = useState("browser");
|
|
32
|
+
const [controlling, setControlling] = useState(false);
|
|
33
|
+
const [zoomStep, setZoomStep] = useState(OPENING_ZOOM_STEP);
|
|
34
|
+
const [picked, setPicked] = useState(void 0);
|
|
35
|
+
const [freshTab, setFreshTab] = useState(null);
|
|
36
|
+
const [notice, setNotice] = useState(null);
|
|
37
|
+
const keyboardRef = useRef(null);
|
|
38
|
+
const [keyboardUp, setKeyboardUp] = useState(false);
|
|
39
|
+
const {
|
|
40
|
+
state: tabs,
|
|
41
|
+
refresh: refreshTabs,
|
|
42
|
+
adopt: adoptTabs
|
|
43
|
+
} = useBrowserTabs(workspaceId);
|
|
44
|
+
const multiWindow = tabs.status === "ready";
|
|
45
|
+
const list = multiWindow ? tabs.tabs : [];
|
|
46
|
+
const shown = (_c = (_b = (_a = list.find((tab) => tab.id === picked)) != null ? _a : list.find((tab) => tab.active)) != null ? _b : list[0]) != null ? _c : null;
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (!notice) return;
|
|
49
|
+
const timer = setTimeout(() => setNotice(null), NOTICE_MS);
|
|
50
|
+
return () => clearTimeout(timer);
|
|
51
|
+
}, [notice]);
|
|
52
|
+
useEffect(() => setControlling(false), [shown == null ? void 0 : shown.id, app]);
|
|
53
|
+
const newWindow = useCallback(async () => {
|
|
54
|
+
try {
|
|
55
|
+
const tab = await openTab(workspaceId);
|
|
56
|
+
const others = tabs.tabs.filter((row) => row.id !== tab.id).map((row) => __spreadProps(__spreadValues({}, row), {
|
|
57
|
+
active: false
|
|
58
|
+
}));
|
|
59
|
+
adoptTabs([...others, __spreadProps(__spreadValues({}, tab), {
|
|
60
|
+
active: true
|
|
61
|
+
})]);
|
|
62
|
+
setPicked(tab.id);
|
|
63
|
+
setFreshTab(tab.id);
|
|
64
|
+
setApp("browser");
|
|
65
|
+
} catch (error) {
|
|
66
|
+
setNotice(`Could not open a new window: ${error instanceof Error ? error.message : String(error)}`);
|
|
67
|
+
}
|
|
68
|
+
void refreshTabs();
|
|
69
|
+
}, [workspaceId, tabs.tabs, adoptTabs, refreshTabs]);
|
|
70
|
+
const closeWindow = useCallback(async (tab) => {
|
|
71
|
+
if (tabs.tabs.length <= 1) return;
|
|
72
|
+
adoptTabs(tabs.tabs.filter((row) => row.id !== tab.id));
|
|
73
|
+
if (picked === tab.id) setPicked(void 0);
|
|
74
|
+
try {
|
|
75
|
+
const left = await closeTab(workspaceId, tab.id);
|
|
76
|
+
if (left.length) adoptTabs(left);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
setNotice(`Could not close that window: ${error instanceof Error ? error.message : String(error)}`);
|
|
79
|
+
}
|
|
80
|
+
void refreshTabs();
|
|
81
|
+
}, [workspaceId, tabs.tabs, adoptTabs, refreshTabs, picked]);
|
|
82
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.fill, children: [
|
|
83
|
+
/* @__PURE__ */ jsx(
|
|
84
|
+
Header,
|
|
85
|
+
{
|
|
86
|
+
onExit,
|
|
87
|
+
badge: /* @__PURE__ */ jsx(PhaseBadge, { phase: "ready" }),
|
|
88
|
+
onOpenAgent
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsx(View, { style: styles.segments, accessibilityRole: "tablist", children: [["browser", "Browser", "google-chrome"], ["terminal", "Terminal", "console"], ["files", "Files", "folder-outline"]].map(([id, label, icon]) => {
|
|
92
|
+
const selected = app === id;
|
|
93
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress: () => setApp(id), accessibilityRole: "tab", accessibilityState: {
|
|
94
|
+
selected
|
|
95
|
+
}, style: [styles.segment, selected && styles.segmentOn], children: [
|
|
96
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 15, color: selected ? C.ink : C.muted }),
|
|
97
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.segmentText, selected && styles.segmentTextOn], children: label })
|
|
98
|
+
] }, id);
|
|
99
|
+
}) }),
|
|
100
|
+
app === "browser" && multiWindow && list.length > 0 ? /* @__PURE__ */ jsxs(ScrollView, { horizontal: true, showsHorizontalScrollIndicator: false, style: styles.chipsBar, contentContainerStyle: styles.chips, accessibilityLabel: "Windows on your Computer", children: [
|
|
101
|
+
list.length > 1 ? list.map((tab) => {
|
|
102
|
+
const selected = tab.id === (shown == null ? void 0 : shown.id);
|
|
103
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.chip, selected && styles.chipOn], children: [
|
|
104
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: () => setPicked(tab.id), accessibilityRole: "button", accessibilityState: {
|
|
105
|
+
selected
|
|
106
|
+
}, accessibilityLabel: `Window ${siteOf(tab.url) || tab.title || "New window"}`, style: styles.chipMain, children: [
|
|
107
|
+
tab.active ? /* @__PURE__ */ jsx(View, { style: [styles.dot, {
|
|
108
|
+
backgroundColor: C.live
|
|
109
|
+
}] }) : null,
|
|
110
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: [styles.chipText, selected && styles.chipTextOn], children: siteOf(tab.url) || "New window" })
|
|
111
|
+
] }),
|
|
112
|
+
selected ? /* @__PURE__ */ jsx(Pressable, { onPress: () => {
|
|
113
|
+
void closeWindow(tab);
|
|
114
|
+
}, accessibilityRole: "button", accessibilityLabel: "Close this window", hitSlop: 8, style: styles.chipClose, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "close", size: 14, color: C.muted }) }) : null
|
|
115
|
+
] }, tab.id);
|
|
116
|
+
}) : null,
|
|
117
|
+
/* @__PURE__ */ jsxs(Pressable, { onPress: () => {
|
|
118
|
+
void newWindow();
|
|
119
|
+
}, accessibilityRole: "button", accessibilityLabel: "New browser window", style: ({
|
|
120
|
+
pressed
|
|
121
|
+
}) => [styles.chip, styles.chipNew, pressed && styles.chipOn], children: [
|
|
122
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "plus", size: 15, color: C.muted }),
|
|
123
|
+
/* @__PURE__ */ jsx(Text, { style: styles.chipText, children: "New window" })
|
|
124
|
+
] })
|
|
125
|
+
] }) : null,
|
|
126
|
+
/* @__PURE__ */ jsxs(View, { style: styles.stage, children: [
|
|
127
|
+
app === "browser" && !agentOpen ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
128
|
+
/* @__PURE__ */ jsx(
|
|
129
|
+
LivePage,
|
|
130
|
+
{
|
|
131
|
+
workspaceId,
|
|
132
|
+
tab: shown == null ? void 0 : shown.id,
|
|
133
|
+
controlling,
|
|
134
|
+
zoom: ZOOM_STEPS[zoomStep],
|
|
135
|
+
chrome: true,
|
|
136
|
+
autoFocusAddress: !!shown && shown.id === freshTab,
|
|
137
|
+
keyboardRef,
|
|
138
|
+
onKeyboardChange: setKeyboardUp
|
|
139
|
+
},
|
|
140
|
+
(_d = shown == null ? void 0 : shown.id) != null ? _d : "active"
|
|
141
|
+
),
|
|
142
|
+
controlling ? /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles.controlRing }) : null
|
|
143
|
+
] }) : null,
|
|
144
|
+
app === "terminal" ? /* @__PURE__ */ jsx(TerminalPane, { workspaceId }) : null,
|
|
145
|
+
app === "files" ? /* @__PURE__ */ jsx(FilesPane, { workspaceId }) : null,
|
|
146
|
+
notice ? /* @__PURE__ */ jsx(View, { style: styles.notice, accessibilityLiveRegion: "polite", children: /* @__PURE__ */ jsx(Text, { numberOfLines: 2, style: styles.noticeText, children: notice }) }) : null
|
|
147
|
+
] }),
|
|
148
|
+
app === "browser" ? /* @__PURE__ */ jsxs(View, { style: [styles.footer, {
|
|
149
|
+
paddingBottom: Math.max(12, bottomInset)
|
|
150
|
+
}], children: [
|
|
151
|
+
/* @__PURE__ */ jsxs(View, { style: styles.footerRow, children: [
|
|
152
|
+
/* @__PURE__ */ jsx(Text, { numberOfLines: 1, style: styles.footerText, children: controlLine(controlling) }),
|
|
153
|
+
controlling ? /* @__PURE__ */ jsx(KeyboardButton, { up: keyboardUp, onOpen: () => {
|
|
154
|
+
var _a2;
|
|
155
|
+
return (_a2 = keyboardRef.current) == null ? void 0 : _a2.call(keyboardRef);
|
|
156
|
+
} }) : null,
|
|
157
|
+
/* @__PURE__ */ jsx(ZoomControl, { step: zoomStep, disabled: false, onChange: (next) => setZoomStep(Math.max(0, Math.min(ZOOM_STEPS.length - 1, next))) })
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsx(BigButton, { kind: controlling ? "secondary" : "primary", icon: controlling ? void 0 : "cursor-default-click-outline", label: controlling ? "Give back control" : "Take control", onPress: () => setControlling((held) => !held), pressed: controlling })
|
|
160
|
+
] }) : /* @__PURE__ */ jsx(View, { style: {
|
|
161
|
+
height: bottomInset
|
|
162
|
+
} })
|
|
163
|
+
] });
|
|
164
|
+
}export{ComputerDesktop};//# sourceMappingURL=ComputerDesktop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComputerDesktop.js","sources":["../../../src/features/computer/ComputerDesktop.tsx"],"sourcesContent":["/**\n * The Computer's desktop, phone-shaped - the web surface's PhoneView (one\n * page, full-bleed, a control bar under it) with the desktop's other apps, the\n * shell and the files, one tap away, and its window chips: the page shown is\n * the agent's until another is picked; \"New window\" opens a tab; closing a\n * window closes its tab, except the last.\n */\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { Pressable, ScrollView, Text, View } from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\n\nimport { closeTab, openTab, siteOf, type BrowserTab } from './computerApi';\nimport { BigButton, controlLine, Header, KeyboardButton, PhaseBadge, ZoomControl } from './computerControls';\nimport { makeComputerStyles } from './computerStyles';\nimport { useComputerColors, useThemedStyles } from './computerTheme';\nimport { FilesPane } from './FilesPane';\nimport { LivePage } from './LivePage';\nimport { OPENING_ZOOM_STEP, ZOOM_STEPS } from './pageZoom';\nimport { TerminalPane } from './TerminalPane';\nimport { useBrowserTabs } from './useComputerHooks';\n\ntype AppId = 'browser' | 'terminal' | 'files';\n\n/** How long a notice (\"could not open a window\") stays up. */\nconst NOTICE_MS = 6_000;\n\nexport function ComputerDesktop({\n workspaceId,\n bottomInset,\n onExit,\n onOpenAgent,\n agentOpen,\n}: {\n workspaceId: string;\n bottomInset: number;\n onExit: () => void;\n onOpenAgent: () => void;\n /** The agent pane covers the screen: the page under it holds no live session of its own. */\n agentOpen: boolean;\n}) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n const [app, setApp] = useState<AppId>('browser');\n const [controlling, setControlling] = useState(false);\n const [zoomStep, setZoomStep] = useState(OPENING_ZOOM_STEP);\n const [picked, setPicked] = useState<string | undefined>(undefined);\n const [freshTab, setFreshTab] = useState<string | null>(null);\n const [notice, setNotice] = useState<string | null>(null);\n const keyboardRef = useRef<(() => void) | null>(null);\n const [keyboardUp, setKeyboardUp] = useState(false);\n\n const { state: tabs, refresh: refreshTabs, adopt: adoptTabs } = useBrowserTabs(workspaceId);\n const multiWindow = tabs.status === 'ready';\n const list = multiWindow ? tabs.tabs : [];\n const shown: BrowserTab | null =\n list.find((tab) => tab.id === picked) ?? list.find((tab) => tab.active) ?? list[0] ?? null;\n\n useEffect(() => {\n if (!notice) return;\n const timer = setTimeout(() => setNotice(null), NOTICE_MS);\n return () => clearTimeout(timer);\n }, [notice]);\n\n // Control goes with the page: another window, or another app, starts by watching.\n useEffect(() => setControlling(false), [shown?.id, app]);\n\n const newWindow = useCallback(async () => {\n try {\n const tab = await openTab(workspaceId);\n const others = tabs.tabs.filter((row) => row.id !== tab.id).map((row) => ({ ...row, active: false }));\n adoptTabs([...others, { ...tab, active: true }]);\n setPicked(tab.id);\n setFreshTab(tab.id);\n setApp('browser');\n } catch (error) {\n setNotice(`Could not open a new window: ${error instanceof Error ? error.message : String(error)}`);\n }\n void refreshTabs();\n }, [workspaceId, tabs.tabs, adoptTabs, refreshTabs]);\n\n const closeWindow = useCallback(\n async (tab: BrowserTab) => {\n // The last window stays: closing its tab would only leave the browser a blank page.\n if (tabs.tabs.length <= 1) return;\n adoptTabs(tabs.tabs.filter((row) => row.id !== tab.id));\n if (picked === tab.id) setPicked(undefined);\n try {\n const left = await closeTab(workspaceId, tab.id);\n if (left.length) adoptTabs(left);\n } catch (error) {\n setNotice(`Could not close that window: ${error instanceof Error ? error.message : String(error)}`);\n }\n void refreshTabs();\n },\n [workspaceId, tabs.tabs, adoptTabs, refreshTabs, picked],\n );\n\n return (\n <View style={styles.fill}>\n <Header\n onExit={onExit}\n // The machine's state, as the web's menu bar says it (Running); whether the\n // picture is live is the browser's own status line, as in the web's window.\n badge={<PhaseBadge phase=\"ready\" />}\n onOpenAgent={onOpenAgent}\n />\n\n <View style={styles.segments} accessibilityRole=\"tablist\">\n {(\n [\n ['browser', 'Browser', 'google-chrome'],\n ['terminal', 'Terminal', 'console'],\n ['files', 'Files', 'folder-outline'],\n ] as const\n ).map(([id, label, icon]) => {\n const selected = app === id;\n return (\n <Pressable\n key={id}\n onPress={() => setApp(id)}\n accessibilityRole=\"tab\"\n accessibilityState={{ selected }}\n style={[styles.segment, selected && styles.segmentOn]}\n >\n <MaterialCommunityIcons name={icon} size={15} color={selected ? C.ink : C.muted} />\n <Text style={[styles.segmentText, selected && styles.segmentTextOn]}>{label}</Text>\n </Pressable>\n );\n })}\n </View>\n\n {app === 'browser' && multiWindow && list.length > 0 ? (\n <ScrollView\n horizontal\n showsHorizontalScrollIndicator={false}\n style={styles.chipsBar}\n contentContainerStyle={styles.chips}\n accessibilityLabel=\"Windows on your Computer\"\n >\n {list.length > 1\n ? list.map((tab) => {\n const selected = tab.id === shown?.id;\n return (\n <View key={tab.id} style={[styles.chip, selected && styles.chipOn]}>\n <Pressable\n onPress={() => setPicked(tab.id)}\n accessibilityRole=\"button\"\n accessibilityState={{ selected }}\n accessibilityLabel={`Window ${siteOf(tab.url) || tab.title || 'New window'}`}\n style={styles.chipMain}\n >\n {tab.active ? (\n <View style={[styles.dot, { backgroundColor: C.live }]} />\n ) : null}\n <Text\n numberOfLines={1}\n style={[styles.chipText, selected && styles.chipTextOn]}\n >\n {siteOf(tab.url) || 'New window'}\n </Text>\n </Pressable>\n {selected ? (\n <Pressable\n onPress={() => {\n void closeWindow(tab);\n }}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Close this window\"\n hitSlop={8}\n style={styles.chipClose}\n >\n <MaterialCommunityIcons name=\"close\" size={14} color={C.muted} />\n </Pressable>\n ) : null}\n </View>\n );\n })\n : null}\n <Pressable\n onPress={() => {\n void newWindow();\n }}\n accessibilityRole=\"button\"\n accessibilityLabel=\"New browser window\"\n style={({ pressed }) => [styles.chip, styles.chipNew, pressed && styles.chipOn]}\n >\n <MaterialCommunityIcons name=\"plus\" size={15} color={C.muted} />\n <Text style={styles.chipText}>New window</Text>\n </Pressable>\n </ScrollView>\n ) : null}\n\n <View style={styles.stage}>\n {app === 'browser' && !agentOpen ? (\n <>\n <LivePage\n key={shown?.id ?? 'active'}\n workspaceId={workspaceId}\n tab={shown?.id}\n controlling={controlling}\n zoom={ZOOM_STEPS[zoomStep]}\n // Control is taken only with the Take control button, as in the web's desktop\n // window: a tap on the page while watching only looks around.\n chrome\n autoFocusAddress={!!shown && shown.id === freshTab}\n keyboardRef={keyboardRef}\n onKeyboardChange={setKeyboardUp}\n />\n {controlling ? <View pointerEvents=\"none\" style={styles.controlRing} /> : null}\n </>\n ) : null}\n {app === 'terminal' ? <TerminalPane workspaceId={workspaceId} /> : null}\n {app === 'files' ? <FilesPane workspaceId={workspaceId} /> : null}\n {notice ? (\n <View style={styles.notice} accessibilityLiveRegion=\"polite\">\n <Text numberOfLines={2} style={styles.noticeText}>\n {notice}\n </Text>\n </View>\n ) : null}\n </View>\n\n {app === 'browser' ? (\n <View style={[styles.footer, { paddingBottom: Math.max(12, bottomInset) }]}>\n <View style={styles.footerRow}>\n <Text numberOfLines={1} style={styles.footerText}>\n {controlLine(controlling)}\n </Text>\n {controlling ? <KeyboardButton up={keyboardUp} onOpen={() => keyboardRef.current?.()} /> : null}\n <ZoomControl\n step={zoomStep}\n disabled={false}\n onChange={(next) => setZoomStep(Math.max(0, Math.min(ZOOM_STEPS.length - 1, next)))}\n />\n </View>\n <BigButton\n kind={controlling ? 'secondary' : 'primary'}\n icon={controlling ? undefined : 'cursor-default-click-outline'}\n label={controlling ? 'Give back control' : 'Take control'}\n onPress={() => setControlling((held) => !held)}\n pressed={controlling}\n />\n </View>\n ) : (\n <View style={{ height: bottomInset }} />\n )}\n </View>\n );\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,MAAM,SAAY,GAAA,GAAA;AACX,SAAS,eAAgB,CAAA;AAAA,EAC9B,WAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA,WAAA;AAAA,EACA;AACF,CAOG,EAAA;AApCH,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AAqCE,EAAA,MAAM,IAAI,iBAAkB,EAAA;AAC5B,EAAM,MAAA,MAAA,GAAS,gBAAgB,kBAAkB,CAAA;AACjD,EAAA,MAAM,CAAC,GAAA,EAAK,MAAM,CAAA,GAAI,SAAgB,SAAS,CAAA;AAC/C,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAS,KAAK,CAAA;AACpD,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,iBAAiB,CAAA;AAC1D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I,UAAW,CAAA,MAAA,GAAS,GAAG,IAAI,CAAC,CAAC,CAAG,EAAA;AAAA,OACrI,EAAA,CAAA;AAAA,sBACA,GAAA,CAAC,aAAU,IAAM,EAAA,WAAA,GAAc,cAAc,SAAW,EAAA,IAAA,EAAM,WAAc,GAAA,MAAA,GAAY,8BAAgC,EAAA,KAAA,EAAO,cAAc,mBAAsB,GAAA,cAAA,EAAgB,SAAS,MAAM,cAAA,CAAe,UAAQ,CAAC,IAAI,CAAG,EAAA,OAAA,EAAS,WAAa,EAAA;AAAA,KAC3P,EAAA,CAAA,mBAAW,GAAA,CAAA,IAAA,EAAA,EAAK,KAAO,EAAA;AAAA,MACjC,MAAQ,EAAA;AAAA,KACP,EAAA;AAAA,GACC,EAAA,CAAA;AACR"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import {jsx,jsxs,Fragment}from'react/jsx-runtime';import {useState,useLayoutEffect,useEffect,useCallback,useMemo}from'react';import {View,Pressable}from'react-native';import {useSafeAreaInsets}from'react-native-safe-area-context';import {provideExec,resolveWorkspace,createWorkspace}from'./computerApi.js';import {ComputerAgentChatPane}from'./ComputerAgentChatPane.js';import {Header,PhaseBadge,Splash}from'./computerControls.js';import {ComputerDesktop}from'./ComputerDesktop.js';import {ComputerHandoff}from'./ComputerHandoff.js';import {makeComputerStyles}from'./computerStyles.js';import {useThemedStyles}from'./computerTheme.js';import {LivePage}from'./LivePage.js';function ComputerExperience({
|
|
2
|
+
userId,
|
|
3
|
+
exec,
|
|
4
|
+
hostChat,
|
|
5
|
+
handoff,
|
|
6
|
+
handoffAnswer,
|
|
7
|
+
initialAgentSeed = null,
|
|
8
|
+
onExit,
|
|
9
|
+
onBackToChat
|
|
10
|
+
}) {
|
|
11
|
+
var _a, _b, _c;
|
|
12
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
13
|
+
const insets = useSafeAreaInsets();
|
|
14
|
+
const [workspace, setWorkspace] = useState(null);
|
|
15
|
+
const [phase, setPhase] = useState("resolving");
|
|
16
|
+
const [problem, setProblem] = useState(null);
|
|
17
|
+
const [attempt, setAttempt] = useState(0);
|
|
18
|
+
useLayoutEffect(() => exec ? provideExec(exec) : void 0, [exec]);
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (!userId || !exec) return;
|
|
21
|
+
let stopped = false;
|
|
22
|
+
setPhase("resolving");
|
|
23
|
+
setProblem(null);
|
|
24
|
+
void (async () => {
|
|
25
|
+
try {
|
|
26
|
+
const found = await resolveWorkspace(userId);
|
|
27
|
+
if (stopped) return;
|
|
28
|
+
setWorkspace(found);
|
|
29
|
+
setPhase(found.exists ? "ready" : "absent");
|
|
30
|
+
} catch (error) {
|
|
31
|
+
if (stopped) return;
|
|
32
|
+
setPhase("error");
|
|
33
|
+
setProblem(error instanceof Error ? error.message : String(error));
|
|
34
|
+
}
|
|
35
|
+
})();
|
|
36
|
+
return () => {
|
|
37
|
+
stopped = true;
|
|
38
|
+
};
|
|
39
|
+
}, [userId, exec, attempt]);
|
|
40
|
+
const start = useCallback(async () => {
|
|
41
|
+
if (!userId) return;
|
|
42
|
+
setPhase("starting");
|
|
43
|
+
setProblem(null);
|
|
44
|
+
try {
|
|
45
|
+
setWorkspace(await createWorkspace(userId));
|
|
46
|
+
setPhase("ready");
|
|
47
|
+
} catch (error) {
|
|
48
|
+
setPhase("absent");
|
|
49
|
+
setProblem(error instanceof Error ? error.message : String(error));
|
|
50
|
+
}
|
|
51
|
+
}, [userId]);
|
|
52
|
+
const workspaceId = phase === "ready" ? (_a = workspace == null ? void 0 : workspace.workspaceId) != null ? _a : null : null;
|
|
53
|
+
const [agentOpen, setAgentOpen] = useState(Boolean((initialAgentSeed == null ? void 0 : initialAgentSeed.text) || ((_b = initialAgentSeed == null ? void 0 : initialAgentSeed.files) == null ? void 0 : _b.length)));
|
|
54
|
+
const agentSeed = useMemo(() => {
|
|
55
|
+
var _a2;
|
|
56
|
+
return initialAgentSeed && (initialAgentSeed.text || ((_a2 = initialAgentSeed.files) == null ? void 0 : _a2.length)) ? {
|
|
57
|
+
id: `seed-${initialAgentSeed.text}`,
|
|
58
|
+
text: initialAgentSeed.text,
|
|
59
|
+
files: initialAgentSeed.files
|
|
60
|
+
} : null;
|
|
61
|
+
}, [initialAgentSeed]);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
if (agentSeed) setAgentOpen(true);
|
|
64
|
+
}, [agentSeed]);
|
|
65
|
+
if (handoff.active) {
|
|
66
|
+
return /* @__PURE__ */ jsx(ComputerHandoff, { request: handoff, workspace, phase, problem, answer: handoffAnswer, topInset: insets.top, bottomInset: insets.bottom, onExit, onBackToChat }, handoff.key);
|
|
67
|
+
}
|
|
68
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.screen, {
|
|
69
|
+
paddingTop: insets.top
|
|
70
|
+
}], children: [
|
|
71
|
+
workspaceId && workspace ? /* @__PURE__ */ jsx(ComputerDesktop, { workspaceId, bottomInset: insets.bottom, onExit, onOpenAgent: () => setAgentOpen(true), agentOpen }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
+
/* @__PURE__ */ jsx(Header, { onExit, badge: /* @__PURE__ */ jsx(PhaseBadge, { phase }), onOpenAgent: () => setAgentOpen(true) }),
|
|
73
|
+
/* @__PURE__ */ jsx(Splash, { phase, problem, hasUser: !!userId && !!exec, onStart: () => {
|
|
74
|
+
void start();
|
|
75
|
+
}, onRetry: () => setAttempt((n) => n + 1) })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ jsx(ComputerAgentChatPane, { visible: agentOpen, onClose: () => setAgentOpen(false), hostChat, workspaceId: (_c = workspace == null ? void 0 : workspace.workspaceId) != null ? _c : "", seed: agentSeed, belowHeader: agentOpen && workspaceId ? /* @__PURE__ */ jsx(Pressable, { onPress: () => setAgentOpen(false), accessibilityRole: "button", accessibilityLabel: "Show your Computer", style: styles.agentLive, children: /* @__PURE__ */ jsx(View, { pointerEvents: "none", style: styles.fill, children: /* @__PURE__ */ jsx(LivePage, { workspaceId, controlling: false, fit: "contain" }) }) }) : null })
|
|
78
|
+
] });
|
|
79
|
+
}export{ComputerExperience};//# sourceMappingURL=ComputerExperience.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComputerExperience.js","sources":["../../../src/features/computer/ComputerExperience.tsx"],"sourcesContent":["/**\n * The Computer, native - port of the web Computer surface\n * (yantra-surface/packages/computer, 0.13.0) for the phone.\n *\n * A workspace genuinely is a machine: a browser with its own logins, a shell,\n * and a filesystem that outlives the container. The web draws those as windows\n * on a desktop and, below 640 px, as one full-bleed page with a control bar\n * (PhoneView) - a dock and windows at phone width leave no room for the page.\n * This is that phone shape, with the desktop's other apps one tap away:\n *\n * - Browser: the live page, full-bleed (LivePage), opening at Fill. Watching,\n * a finger looks around and a tap takes control; in control, one finger\n * works the page and two look around. Several windows (the agent opens a\n * second site to compare) are chips above the page; the page shown is the\n * agent's until another is picked. \"New window\" opens a tab; closing a\n * window closes its tab, except the last.\n * - Terminal and Files: the desktop's shell and file windows.\n * - The agent: the Computer's own chat (the web's side pane), over the page.\n *\n * Opened as a handoff (`mode: 'handoff'`) it is not a desktop at all: the agent\n * handed the browser to the person for a step only they can do, and the\n * screen is that one job - the reason, the live page with control on, and\n * Done, checked before it is sent (HandoffView on the web).\n */ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';\nimport { Pressable, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { createWorkspace, provideExec, resolveWorkspace, type HostExec, type WorkspaceRef } from './computerApi';\nimport { ComputerAgentChatPane, type ComputerAgentSeed, type ComputerHostChat } from './ComputerAgentChatPane';\nimport { Header, PhaseBadge, Splash, type Phase } from './computerControls';\nimport { ComputerDesktop } from './ComputerDesktop';\nimport { ComputerHandoff, type HandoffAnswer } from './ComputerHandoff';\nimport { makeComputerStyles } from './computerStyles';\nimport { useThemedStyles } from './computerTheme';\nimport type { HandoffRequest } from './handoff';\nimport { LivePage } from './LivePage';\n\nexport type { HandoffAnswer };\n\nexport interface ComputerExperienceProps {\n /** The account the Computer is derived from (the agent token's subject); '' while unknown. */\n userId: string;\n /** The connector executor the screen lends: the agent's direct lane, as the agent's own identity. */\n exec: HostExec | null;\n hostChat?: ComputerHostChat;\n handoff: HandoffRequest;\n handoffAnswer: HandoffAnswer;\n /** A turn handed over from Home or Chat: the agent pane opens with it. */\n initialAgentSeed?: { text: string; files?: ComputerAgentSeed['files'] } | null;\n onExit: () => void;\n /** Leave a handoff for the chat it came from. */\n onBackToChat?: () => void;\n}\n\nexport function ComputerExperience({\n userId,\n exec,\n hostChat,\n handoff,\n handoffAnswer,\n initialAgentSeed = null,\n onExit,\n onBackToChat,\n}: ComputerExperienceProps) {\n const styles = useThemedStyles(makeComputerStyles);\n const insets = useSafeAreaInsets();\n const [workspace, setWorkspace] = useState<WorkspaceRef | null>(null);\n const [phase, setPhase] = useState<Phase>('resolving');\n const [problem, setProblem] = useState<string | null>(null);\n const [attempt, setAttempt] = useState(0);\n\n // Lent before any call goes out - the resolve below, and every pane's effects.\n useLayoutEffect(() => (exec ? provideExec(exec) : undefined), [exec]);\n\n useEffect(() => {\n if (!userId || !exec) return;\n let stopped = false;\n setPhase('resolving');\n setProblem(null);\n void (async () => {\n try {\n const found = await resolveWorkspace(userId);\n if (stopped) return;\n setWorkspace(found);\n setPhase(found.exists ? 'ready' : 'absent');\n } catch (error) {\n if (stopped) return;\n setPhase('error');\n setProblem(error instanceof Error ? error.message : String(error));\n }\n })();\n return () => {\n stopped = true;\n };\n }, [userId, exec, attempt]);\n\n const start = useCallback(async () => {\n if (!userId) return;\n setPhase('starting');\n setProblem(null);\n try {\n setWorkspace(await createWorkspace(userId));\n setPhase('ready');\n } catch (error) {\n setPhase('absent');\n setProblem(error instanceof Error ? error.message : String(error));\n }\n }, [userId]);\n\n const workspaceId = phase === 'ready' ? (workspace?.workspaceId ?? null) : null;\n\n // ── the agent pane ──────────────────────────────────────────────────────\n const [agentOpen, setAgentOpen] = useState(Boolean(initialAgentSeed?.text || initialAgentSeed?.files?.length));\n const agentSeed = useMemo<ComputerAgentSeed | null>(\n () =>\n initialAgentSeed && (initialAgentSeed.text || initialAgentSeed.files?.length)\n ? { id: `seed-${initialAgentSeed.text}`, text: initialAgentSeed.text, files: initialAgentSeed.files }\n : null,\n [initialAgentSeed],\n );\n useEffect(() => {\n if (agentSeed) setAgentOpen(true);\n }, [agentSeed]);\n\n if (handoff.active) {\n return (\n <ComputerHandoff\n key={handoff.key}\n request={handoff}\n workspace={workspace}\n phase={phase}\n problem={problem}\n answer={handoffAnswer}\n topInset={insets.top}\n bottomInset={insets.bottom}\n onExit={onExit}\n onBackToChat={onBackToChat}\n />\n );\n }\n\n return (\n <View style={[styles.screen, { paddingTop: insets.top }]}>\n {workspaceId && workspace ? (\n <ComputerDesktop\n workspaceId={workspaceId}\n bottomInset={insets.bottom}\n onExit={onExit}\n onOpenAgent={() => setAgentOpen(true)}\n agentOpen={agentOpen}\n />\n ) : (\n <>\n <Header\n onExit={onExit}\n badge={<PhaseBadge phase={phase} />}\n onOpenAgent={() => setAgentOpen(true)}\n />\n <Splash\n phase={phase}\n problem={problem}\n hasUser={!!userId && !!exec}\n onStart={() => {\n void start();\n }}\n onRetry={() => setAttempt((n) => n + 1)}\n />\n </>\n )}\n\n <ComputerAgentChatPane\n visible={agentOpen}\n onClose={() => setAgentOpen(false)}\n hostChat={hostChat}\n workspaceId={workspace?.workspaceId ?? ''}\n seed={agentSeed}\n belowHeader={\n agentOpen && workspaceId ? (\n <Pressable\n onPress={() => setAgentOpen(false)}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Show your Computer\"\n style={styles.agentLive}\n >\n <View pointerEvents=\"none\" style={styles.fill}>\n <LivePage workspaceId={workspaceId} controlling={false} fit=\"contain\" />\n </View>\n </Pressable>\n ) : null\n }\n />\n </View>\n );\n}\n"],"names":["_a"],"mappings":"+pBAqDO,SAAS,kBAAmB,CAAA;AAAA,EACjC,MAAA;AAAA,E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