linkInBioTemplatemain.tsx1 match
2import { renderToString } from "npm:react-dom/server";
34export default async function(req: Request) {
5return new Response(
6renderToString(
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);
mandateworkflowEngine.ts4 matches
23}
2425// New recursive function to resolve any kind of input structure
26private resolveInputStructure(
27structure: any,
31contextInputKey?: string, // Optional: for more detailed logging
32): any {
33const log = this.logger.createLogFunction(
34contextStepId ? `M-UnknownStep-${contextStepId}` : `M-UnknownWorkflow`, // Placeholder mandateId for this internal log
35"WorkflowEngine:InputResolver",
135): Promise<WorkflowResult<FinalPayload>> {
136const mandateId = `M-${Date.now()}-${definition.id}`;
137const log = this.logger.createLogFunction(mandateId, "WorkflowEngine");
138const stepResults = new Map<string, AgentOutput<any>>();
139const completedSteps = new Set<string>();
234mandateId,
235taskId,
236log: this.logger.createLogFunction(mandateId, `Agent:${step.agent}`), // Simplified logger for agent
237config: step.config,
238};
1// ui.tsx
23export function generateHtmlShellV2(): string {
4return `<!DOCTYPE html>
5<html>
26<form id="demoForm">
27<label for="userText">Enter text for summarization (Required):</label>
28<textarea id="userText" name="userText" required>The quick brown fox jumps over the lazy dog. This is a longer sentence to ensure the summarizer has enough text to work with and demonstrate its functionality properly. This workflow will summarize this text and optionally fetch data from jsonplaceholder based on the checkbox below. The final step combines the results.</textarea>
29<label class="checkbox-label">
30<input type="checkbox" id="enableFetch" name="enableExternalFetch" value="true" checked>
mandateagent_ecosystem.ts17 matches
1011// Your provided summarizerAgent
12export async function summarizerAgent(
13input: AgentInput<{ textToSummarize: string }>,
14context: AgentContext,
5758// Your provided fetchAgent (Note: "Workspaceing" seems like a typo, changed to "Fetching")
59export async function fetchAgent(
60input: AgentInput<{ url_from_input?: string; maxHeadlines?: number }>,
61context: AgentContext,
199200// Your provided combinerAgent (not directly used in the 12-step orchestrator, but kept for reference)
201export async function combinerAgent(
202// ... (combinerAgent code as you provided, also updating its OpenAI call) ...
203input: AgentInput<{
329330// 1. ConfigurationAgent
331export async function configurationAgent(
332input: AgentInput<{ userQuery: string }>,
333context: AgentContext,
393394// 2. SourceValidationAgent (was SourceSuggestionAgent - focuses on validating/using config's suggestions)
395export async function sourceValidationAgent(
396input: AgentInput<{ config: AnalysisConfig }>,
397context: AgentContext,
407408// 3. ParallelFetchAgent (This agent will call the user-provided fetchAgent for each feed)
409export async function parallelFetchAgent(
410input: AgentInput<{ feedsToFetch: { name: string; url: string }[]; maxHeadlinesPerFeed: number }>,
411context: AgentContext, // This context will be passed to the individual fetchAgent calls
460461// 4. ArticleCleaningAgent
462export async function articleCleaningAgent(
463input: AgentInput<{ articles: FetchedArticle[] }>,
464context: AgentContext,
477478// 5. RelevanceAssessmentAgent
479export async function relevanceAssessmentAgent(
480input: AgentInput<{ articles: FetchedArticle[]; topic: string; keywords: string[] }>,
481context: AgentContext,
535536// 6. ContentExtractionAgent (Simplified: mainly uses cleaned summary, conceptual for full text)
537export async function contentExtractionAgent(
538input: AgentInput<{ articles: FetchedArticle[]; analysisDepth: "cursory" | "standard" | "deep" }>,
539context: AgentContext,
554555// 7. SentimentAnalysisAgent
556export async function sentimentAnalysisAgent(
557input: AgentInput<{ articles: FetchedArticle[] }>,
558context: AgentContext,
602603// 8. KeyThemeExtractionAgent
604export async function keyThemeExtractionAgent(
605input: AgentInput<{ articles: FetchedArticle[]; topic: string }>,
606context: AgentContext,
647648// 9. TrendAndAnomalyDetectionAgent
649export async function trendAndAnomalyDetectionAgent(
650input: AgentInput<{ articlesWithThemes: FetchedArticle[]; topic: string; historicalContextSummary?: string }>, // historicalContext is optional
651context: AgentContext,
718719// 10. InsightGenerationAgent
720export async function insightGenerationAgent(
721input: AgentInput<{ trendReport: any; anomalyReport: any; config: AnalysisConfig; articlesCount: number }>,
722context: AgentContext,
825826// 11. ReportCompilationAgent
827export async function reportCompilationAgent(
828input: AgentInput<ReportCompilationAgentPayload>, // Use the new flat payload type
829context: AgentContext,
902// Ensure the insightGenerationAgent is also consistent with its input expectations
903// The insightGenerationAgent seems fine as it destructures its expected inputs directly from input.payload.
904// export async function insightGenerationAgent(
905// Â input: AgentInput<{ trendReport: any, anomalyReport: any, config: AnalysisConfig, articlesCount: number }>,
906// ...)
907// 12. AlertFormattingAgent
908export async function alertFormattingAgent(
909input: AgentInput<{ anomalyReport: any; insights: string[]; config: AnalysisConfig }>,
910context: AgentContext,
947948// --- Orchestrator Agent ---
949export async function analysisWorkflowOrchestrator(
950initialUserQuery: string,
951baseContext?: Partial<AgentContext>, // Allow passing a base context, e.g., for top-level config/secrets
mandateinterfaces.ts4 matches
20mandateId: string;
21taskId: string;
22log: LogFunction;
23config?: Record<string, any>;
24}
2526/** Defines the function signature for any agent. */
27export type AgentFunction<InputPayload = any, OutputPayload = any> = (
28input: AgentInput<InputPayload>,
29context: AgentContext,
6768// --- Logging Types ---
69export type LogFunction = (level: LogLevel, component: string, message: string, details?: any) => void;
70export type LogLevel = "DEBUG" | "INFO" | "WARN" | "ERROR" | "SUCCESS";
71
ValTown-Package-Trackerschema.ts5 matches
67// Initialize database schema
8export async function initializeDatabase() {
9// Create locations table
10await sqlite.execute(`
4546// Save location data from ChirpStack payload
47export async function saveLocationData(payload: any) {
48console.log("[DB] Starting to save location data");
49
188189// Get all location data for a device
190export async function getLocationHistory(deviceId?: string) {
191let query = `
192SELECT
218219// Get a specific location by ID with its gateway data
220export async function getLocationById(id: number) {
221const location = await sqlite.execute(
222`SELECT * FROM ${LOCATIONS_TABLE} WHERE id = ?`,
240241// Get list of all devices
242export async function getDevices() {
243return await sqlite.execute(
244`SELECT DISTINCT device_id, device_name FROM ${LOCATIONS_TABLE}`
jsDelivr-as-iifemain.ts1 match
1export default async function (req: Request): Promise<Response> {
2return Response.json({ ok: true })
3}
getGoogleCalendarEventsmain.tsx3 matches
4const accountId = "apn_Dph5j3E"; // frome pipedream integrations app id
56export async function getCalendars(accountId: string) {
7const calendarAPI = await pipeDreamGoogle("calendar", accountId);
8const calendars = await calendarAPI.calendarList.list();
11}
1213async function printCalendars(accountId: string) {
14const calendars = await getCalendars(accountId);
15for (let i = 0; i < calendars.data.items.length; i++) {
2223// list out the events on a calendar
24// export async function getEvents(accountId: string, calendarId: string) {
25// const calendar = await pipeDreamGoogle("calendar", accountId);
26
stevennstestDailyBrief.ts1 match
4import { DateTime } from "https://esm.sh/luxon@3.4.4";
56export async function testDailyBrief() {
7try {
8const testChatId = Deno.env.get("TEST_TELEGRAM_CHAT_ID");