Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: MCP apps render and run inline in threads #16236

Mergedjuliusmarmingemerged 26 commits intomain fromrefs/pull/16236/headmerged by juliusmarminge View on GitHub

Showing 83 changed files with 168 additions and 0 deletions (loading 82).

x
0 of 83 viewed, 83 left
168 additions and 0 deletionsapps/mobile/src/features/threads/McpAppFullscreenScreen.tsxAdded
View file
@@ -0,0 +1,168 @@
+import { useIsFocused, useNavigation, type StaticScreenProps } from "@react-navigation/native";
+import { EnvironmentId, ThreadId, TurnItemId } from "@t3tools/contracts";
+import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";
+import { turnItemDetailRevision } from "@t3tools/client-runtime/work-log/item-detail";
+import { mcpAppFromToolItem } from "@t3tools/shared/toolOutput";
+import { useCallback, useEffect, useMemo, useState } from "react";
+import { Pressable, View } from "react-native";
+import { useSafeAreaInsets } from "react-native-safe-area-context";
+​
+import { AppText as Text } from "../../components/AppText";
+import { SymbolView } from "../../components/AppSymbol";
+import { orchestrationEnvironment } from "../../state/orchestration";
+import { scopeThreadRef } from "@t3tools/client-runtime/environment";
+import { useThreadShell, useThreadShells } from "../../state/entities";
+import { useEnvironmentQuery } from "../../state/query";
+import { ThreadMcpApp } from "./McpAppWebView";
+​
+type McpAppFullscreenScreenProps = StaticScreenProps<{
+ readonly environmentId: string;
+ readonly threadId: string;
+ readonly conversationThreadId?: string;
+ readonly itemId: string;
+ readonly revision?: string;
+}>;
+​
+/**
+ * The thread an app's messages go to. A link only names it, so it counts only
+ * when it is the app's own thread or a fork of it; anything else falls back to
+ * the app's thread.
+ */