Files
paseo/plugin-examples/inline-thinking/thinking.client.tsx
Mohamed Boudra e34aea206e feat(plugins): add live timeline rows and client slash commands
Plugins can transform live timeline source items at render time, append durable plugin rows from daemon handlers, and register client-only slash commands in the composer.

Related to #3940 and #3952.
2026-09-02 13:12:09 +02:00

22 lines
733 B
TypeScript

import type { PluginTimelineItemProps } from "@getpaseo/plugin";
import { useRevealedText } from "@getpaseo/plugin/react-native";
import { useMemo } from "react";
import { Text } from "react-native";
import { z } from "zod";
export const inlineThinkingSchema = z.object({
text: z.string(),
phase: z.enum(["streaming", "complete"]),
});
type InlineThinkingData = z.output<typeof inlineThinkingSchema>;
export function InlineThinking({ item, theme }: PluginTimelineItemProps<InlineThinkingData>) {
const text = useRevealedText(item.data.text, item.data.phase);
const style = useMemo(
() => ({ color: theme.colors.foregroundMuted }),
[theme.colors.foregroundMuted],
);
return <Text style={style}>{text}</Text>;
}