mcp-registrymain.tsx2 matches
266<script>
267{`
268function showServerDetails(serverId, serverName) {
269alert(\`Server: \${serverName}\\nID: \${serverId}\\n\\nDetailed view coming soon!\`);
270}
496let maxPageReached = 1;
497498function getPageFromCursor(cursor: string | null): number {
499if (!cursor) return 1;
500// Find the page number for this cursor
2import { parseAIP } from "./parse.ts";
34export default async function (req: Request): Promise<Response> {
5const data = await getAirportsIndex();
6
Letterboxd_Blueskymain.ts3 matches
18};
1920export default async function main() {
21// 1) Get credentials from env
22const handle = Deno.env.get("BLUESKY_HANDLE");
88// Try to reduce typical Letterboxd RSS titles to just the film title.
89// Example input: "vonrunte watched Inception (2010) ★★★★"
90function cleanFeedTitle(raw: string): string {
91const watchedIdx = raw.toLowerCase().indexOf("watched ");
92let s = watchedIdx >= 0 ? raw.slice(watchedIdx + "watched ".length) : raw;
104105// Ensure we don't exceed Bluesky's 300-char limit
106function trimToLimit(text: string, limit: number): string {
107if (text.length <= limit) return text;
108// Keep the link intact if present
euro-aipairports.ts7 matches
6import { Cycle } from "npm:airac-cc";
78function getCurrentCycle() {
9return Cycle.fromDate(new Date());
10}
1112function getEffectiveDate(cycle): string {
13return cycle.effectiveStart.toISOString().slice(0, 10);
14}
1516function getAirportsNATS(cycleStart: string): string {
17const path = new URL(
18`https://www.aurora.nats.co.uk/htmlAIP/Publications/${cycleStart}-AIRAC/html/eAIP/EG-AD-0.1-en-GB.html`,
21}
2223async function getAirportsAvinor(cycleStart: string): string {
24const response = await fetch("https://aim-prod.avinor.no/no/AIP/");
25const path = new URL(
30}
3132function getIdentifierFromLink(link: string): string | null {
33if (!link) {
34return null;
42}
4344async function getAirports(aip) {
45const respose = await fetch(aip);
46const html = await respose.text();
59}
6061export async function getAirportsIndex() {
62const cycle = getCurrentCycle();
63const effective = getEffectiveDate(cycle);
9293window.counter = 0;
94function loadImage(){
95window.counter++;
96if(window.counter > 6 ){
105if (file) {
106const reader = new FileReader();
107reader.onload = function(e) {
108preview.src = e.target.result; // 设置 img 的 src
109}
112});
113114function updateTime() {
115const now = new Date();
116const year = now.getFullYear();
Parse-my-PDFmain.tsx4 matches
3* Returns a response to the user's query
4*/
5async function getResponse(req: Query, send: SendEventFn) {
6send("meta", { content_type: "text/markdown" });
7const lastMessage = req.query.at(-1);
26* Returns your bot's settings
27*/
28async function getBotSettings(): Promise<BotSettings> {
29return {
30allow_attachments: true,
89) => void;
9091function encodeEvent(event: string, data: any = {}) {
92return new TextEncoder().encode(
93`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`,
95}
9697export default async function (req: Request): Promise<Response> {
98const reqBody = await req.json().catch((e) => {
99console.error("body parse error", e);
croneinteractionRouter.ts1 match
13* Route the Discord interaction to the appropriate handler
14*/
15export async function handleInteraction(c: Context) {
16const req = await c.req.json();
17
GLM-4-5-Omnimain.tsx15 matches
295}
296297function isShortInput(
298messages: Array<{ role: string; content: string }>,
299): boolean {
302}
303304function isMediumInput(
305messages: Array<{ role: string; content: string }>,
306): boolean {
309}
310311function isGreeting(message: string): boolean {
312if (!message) return false;
313334}
335336function getStandardResponse(message: string): string | null {
337const cleanMsg = message.toLowerCase().trim().replace(/[.!?]+$/, "");
338343"I'm an omni-capable AI assistant powered by multiple advanced language models including DeepSeek, Llama-4, and others.",
344"how are you":
345"I'm functioning optimally and ready to help with your questions and file processing needs.",
346"what can you do":
347"I can analyze text, images, videos, and documents. I can also engage in conversations, answer questions, write code, and help with various tasks.",
357}
358359async function processAttachments(
360attachments: FileAttachment[],
361): Promise<string> {
381}
382383async function createVisionMessage(
384content: string,
385attachments: FileAttachment[],
416}
417418async function makeRequest(
419config: ModelConfig,
420messages: any[],
454}
455456async function processStreamOptimized(
457response: Response,
458send: SendEventFn,
498}
499500async function requestWithTimeout(
501promise: Promise<Response>,
502timeoutMs: number = 8000,
509}
510511function calculateCosts(
512query: any[],
513): { inputCost: number; estimatedOutputCost: number } {
543}
544545async function getResponse(req: Query, send: SendEventFn) {
546send("meta", { content_type: "text/markdown" });
547640}
641642async function getBotSettings(): Promise<BotSettings> {
643const rateCard = "| Type | Price |\n" +
644"|------|------|\n" +
706) => void;
707708function encodeEvent(event: string, data: any = {}) {
709return new TextEncoder().encode(
710`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`,
712}
713714export default async function (req: Request): Promise<Response> {
715const reqBody = await req.json().catch((e) => {
716console.error("Body parse error:", e);
untitled-7197main.ts1 match
1export default async function (req: Request): Promise<Response> {
2// Ensure the request is a POST
3if (req.method !== "POST") {
openai-usagemain.ts1 match
28* Fetch organization costs for a given time period
29*/
30export async function fetchOrganizationCosts(
31startTime: number,
32days: number,