toolslist-project-files.tsx1 match
1import { listFiles } from "https://esm.town/v/std/utils@85-main/index.ts";
23export default async function(req: Request) {
4try {
5const files = await listFiles(import.meta.url);
blob_adminapp.tsx7 matches
10}
1112function Tooltip({ children, content }: TooltipProps) {
13const [isVisible, setIsVisible] = useState(false);
14const tooltipRef = useRef<HTMLDivElement>(null);
49}
5051function formatBytes(bytes: number, decimals = 2) {
52if (bytes === 0) return "0 Bytes";
53const k = 1024;
58}
5960function copyToClipboard(text: string) {
61navigator.clipboard.writeText(text).then(() => {
62console.log("Text copied to clipboard");
66}
6768function ActionMenu({ blob, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
69const [isOpen, setIsOpen] = useState(false);
70const menuRef = useRef(null);
7374useEffect(() => {
75function handleClickOutside(event) {
76if (menuRef.current && !menuRef.current.contains(event.target)) {
77event.stopPropagation();
155}
156157function BlobItem({ blob, onSelect, isSelected, onDownload, onRename, onDelete, onMoveToPublic, onMoveOutOfPublic }) {
158const [isLoading, setIsLoading] = useState(false);
159const decodedKey = decodeURIComponent(blob.key);
216}
217218function App({ initialEmail, initialProfile, sourceURL }) {
219const encodeKey = (key: string) => encodeURIComponent(key);
220const decodeKey = (key: string) => decodeURIComponent(key);
youta_servermain.tsx4 matches
5console.log("WebSocket server started on port 8080");
67wss.on("connection", function connection(ws) {
8console.log("Client connected!");
910ws.on("message", function incoming(message) {
11console.log("Received message from client: %s", message);
1215});
1617ws.on("close", function close() {
18console.log("Client disconnected.");
19});
2021ws.on("error", function error(err) {
22console.error("WebSocket error:", err);
23});
2import { email } from "https://esm.town/v/std/email";
34export default async function(req: Request) {
5const markdownContent = `
6# Don't forget
MCPChatInterface.tsx1 match
10}
1112export function ChatInterface({ messages, onSendMessage, isLoading, availableTools }: ChatInterfaceProps) {
13const [input, setInput] = useState('');
14const messagesEndRef = useRef<HTMLDivElement>(null);
MCPApiKeyInput.tsx1 match
7}
89export function ApiKeyInput({ apiKey, onApiKeyChange }: ApiKeyInputProps) {
10const [isVisible, setIsVisible] = useState(false);
11const [tempKey, setTempKey] = useState(apiKey);
22}
2324export function App() {
25const [apiKey, setApiKey] = useState<string>('');
26const [messages, setMessages] = useState<Message[]>([]);
MCPresources.ts7 matches
9import { MCPException, MCP_ERRORS } from "../../shared/utils.ts";
1011export async function listResources(): Promise<MCPResource[]> {
12const resources: MCPResource[] = [];
13
64}
6566export async function readResource(uri: string): Promise<{ contents: Array<{ uri: string; mimeType?: string; text?: string }> }> {
67const [scheme, path] = uri.split("://", 2);
68
81}
8283async function readBlobResource(key: string): Promise<{ contents: Array<{ uri: string; mimeType?: string; text?: string }> }> {
84try {
85const value = await blob.getJSON(key);
108}
109110async function readFileResource(path: string): Promise<{ contents: Array<{ uri: string; mimeType?: string; text?: string }> }> {
111try {
112const content = await readFile(path, import.meta.url);
123}
124125async function readSqliteResource(resource: string): Promise<{ contents: Array<{ uri: string; mimeType?: string; text?: string }> }> {
126if (resource === "schema") {
127try {
153}
154155async function readEnvResource(resource: string): Promise<{ contents: Array<{ uri: string; mimeType?: string; text?: string }> }> {
156if (resource === "info") {
157// Only return environment variable names for security
174}
175176function getMimeType(filename: string): string {
177const ext = filename.split('.').pop()?.toLowerCase();
178
19};
2021export async function handleMCPRequest(request: MCPRequest): Promise<MCPResponse> {
22try {
23// Validate JSON-RPC format
78}
7980async function handleInitialize(params: any): Promise<any> {
81return {
82protocolVersion: SERVER_INFO.protocolVersion,
89}
9091async function handleToolsList(): Promise<any> {
92return {
93tools: TOOLS
95}
9697async function handleToolsCall(params: any): Promise<any> {
98if (!params.name) {
99throw new MCPException(MCP_ERRORS.INVALID_PARAMS, "Missing tool name");
104}
105106async function handleResourcesList(): Promise<any> {
107const resources = await listResources();
108return { resources };
109}
110111async function handleResourcesRead(params: any): Promise<any> {
112if (!params.uri) {
113throw new MCPException(MCP_ERRORS.INVALID_PARAMS, "Missing resource URI");
117}
118119export function getServerInfo(): MCPServerInfo {
120return SERVER_INFO;
121}
141];
142143export async function executeTool(name: string, args: Record<string, any>): Promise<MCPToolResult> {
144try {
145switch (name) {
181}
182183async function handleBlobGet(args: any): Promise<MCPToolResult> {
184validateRequired(args, ["key"]);
185const key = sanitizeKey(args.key);
205}
206207async function handleBlobSet(args: any): Promise<MCPToolResult> {
208validateRequired(args, ["key", "value"]);
209const key = sanitizeKey(args.key);
224}
225226async function handleBlobList(args: any): Promise<MCPToolResult> {
227const prefix = args.prefix || "";
228const keys = await blob.list(prefix);
236}
237238async function handleBlobDelete(args: any): Promise<MCPToolResult> {
239validateRequired(args, ["key"]);
240const key = sanitizeKey(args.key);
250}
251252async function handleSqliteExecute(args: any): Promise<MCPToolResult> {
253validateRequired(args, ["query"]);
254const { query, params = [] } = args;
264}
265266async function handleEmailSend(args: any): Promise<MCPToolResult> {
267validateRequired(args, ["subject"]);
268
285}
286287async function handleOpenAIChat(args: any): Promise<MCPToolResult> {
288validateRequired(args, ["messages"]);
289
311}
312313async function handleFileRead(args: any): Promise<MCPToolResult> {
314validateRequired(args, ["path"]);
315
333}
334335async function handleFileList(args: any): Promise<MCPToolResult> {
336try {
337const files = await listFiles(import.meta.url);
353}
354355async function handleEnvGet(args: any): Promise<MCPToolResult> {
356validateRequired(args, ["key"]);
357