luciaMagicLinkStartermagic-links.ts4 matches
78// Hash a token using sha256
9function hashToken(token: string): string {
10return encodeHexLowerCase(sha256(new TextEncoder().encode(token)));
11}
1213// Create a magic link token for the given email
14export async function createMagicLinkToken(userEmail: string): Promise<string> {
15const token = generateSessionToken();
16const tokenHash = hashToken(token);
2728// Send a magic link email
29export async function sendMagicLinkEmail(url: string, userEmail: string, token: string): Promise<boolean> {
30try {
31const magicLink = `${url}/auth/magic-link/${token}`;
5556// Validate a magic link token and create a session
57export async function validateMagicLinkToken(token: string): Promise<{ valid: boolean; userId?: number }> {
58const now = Math.floor(Date.now() / 1000);
59const tokenHash = hashToken(token);
luciaMagicLinkStarterApp.tsx1 match
16}
1718export function App({ initialData }: { initialData: InitialData }) {
19const [user, setUser] = useState<User | null>(initialData.user);
20const [error, setError] = useState<string | null>(initialData.error);
untitled-7683README.md1 match
1# untitled-7683// Full A-to-Z structure of a basic MuCute-style Minecraft PE client (simplified) // This mock is for learning purposes and replicates core client relay functions // You must have native MuCuteRelay library ready (compiled from: https://github.com/OpenMITM/MuCuteRelay)
23// Directory structure: // - app // - src/main/java/com/example/mucuteclient/MainActivity.java // - src/main/jniLibs/armeabi-v7a/libmucuterelay.so // - res/layout/activity_main.xml // - AndroidManifest.xml // - build.gradle
105* @returns Dashboard HTML string
106*/
107function generateDashboardHTML(data: {
108todos: any[];
109metrics: any;
447* @returns Log entry page HTML string
448*/
449function generateLogPageHTML(date: string) {
450return html`
451<!DOCTYPE html>
737* @returns HTML string for pipeline stages
738*/
739function generatePipelineStages(leadsPipeline: any[]) {
740// Define the stages in order
741const stageOrder = [
770* @returns Formatted priority string
771*/
772function renderPriority(priority: number): string {
773switch (priority) {
774case 1: return "🔥 CRITICAL";
nameSeeingServermain.tsx3 matches
9mostRecentName: z.optional(z.string().nullable()),
10});
11function handleGet(req: ExpressRequest, res: ExpressResponse) {
12const response = zGetResponse.parse({ namesPreviouslySeen: namesPreviouslySeen.size, mostRecentName });
13res.send(response);
19force: z.optional(z.boolean()),
20});
21function handlePost(req: ExpressRequest, res: ExpressResponse) {
22const body = zPostBody.safeParse(req.body);
23if (!body.success) {
70send: (json: any) => void;
71}
72export default async function(req: Request): Promise<Response> {
73let resStatus = 200;
74
12* Creates database tables and initial data
13*/
14export async function initializeSystem() {
15try {
16console.log("Starting system initialization...");
CareerCoach20Dayqueries.ts19 matches
56/**
7* Database helper functions for the Career Coach application
8* These functions handle all database interactions for the application
9*/
1014* Store a new interaction between the user and coach
15*/
16export async function storeInteraction(userInput: string, coachResponse: string, modelUsed: string) {
17const timestamp = new Date().toISOString()
18await sqlite.execute(`
27* Get recent interactions, limited by count
28*/
29export async function getRecentInteractions(limit: number = 5) {
30const result = await sqlite.execute(`
31SELECT * FROM ${KEY}_interactions
42* Create a new todo item
43*/
44export async function createTodo(todo: {
45description: string
46category: string
64* Get all todos, optionally filtered by status
65*/
66export async function getTodos(status?: string) {
67let query = `SELECT * FROM ${KEY}_todos`
68let params: any[] = []
82* Update a todo item
83*/
84export async function updateTodo(id: number, updates: {
85description?: string
86category?: string
121* Get recently completed todos
122*/
123export async function getRecentCompletedTasks(limit: number = 5) {
124const result = await sqlite.execute(`
125SELECT * FROM ${KEY}_todos
137* Store a new daily log
138*/
139export async function storeDailyLog(log: {
140log_date: string
141achievements: string
175* Get recent daily logs
176*/
177export async function getRecentLogs(limit: number = 5) {
178const result = await sqlite.execute(`
179SELECT * FROM ${KEY}_daily_logs
190* Update progress metrics for a specific date
191*/
192export async function updateProgressMetrics(metrics: {
193metric_date: string
194leads_contacted?: number
246* Get the latest progress metrics
247*/
248export async function getProgressMetrics() {
249const result = await sqlite.execute(`
250SELECT * FROM ${KEY}_progress_metrics
269* Get cumulative progress metrics
270*/
271export async function getCumulativeMetrics() {
272const result = await sqlite.execute(`
273SELECT
287* Store a new coach analysis
288*/
289export async function storeAnalysis(analysis: {
290analysis_date: string
291analysis_type: string
327* Get the latest analysis
328*/
329export async function getLatestAnalysis() {
330const result = await sqlite.execute(`
331SELECT * FROM ${KEY}_coach_analysis
351* Add a new lead
352*/
353export async function addLead(lead: {
354name: string
355company?: string
385* Get all leads, optionally filtered by status
386*/
387export async function getLeads(status?: string) {
388let query = `SELECT * FROM ${KEY}_leads`
389let params: any[] = []
403* Get the current lead pipeline summary
404*/
405export async function getLeadsPipeline() {
406const result = await sqlite.execute(`
407SELECT status, COUNT(*) as count
428* Update a lead's status and other information
429*/
430export async function updateLead(id: number, updates: {
431name?: string
432company?: string
nameSeeingServermain.tsx3 matches
44});
4546function handleGet(req: ExpressRequest, res: ExpressResponse) {
47res.send({ namesPreviouslySeen: namesPreviouslySeen.size, mostRecentName });
48}
69const zPostErrorResponse403 = z.object({error: z.string(), correctPrefix: z.number()});
7071function handlePost(req: ExpressRequest, res: ExpressResponse) {
72const body = zPostBody.safeParse(req.body);
73if (!body.success) {
111send: (json: any) => void;
112}
113export default async function(req: Request): Promise<Response> {
114let resStatus = 200;
115
5* Creates all required tables if they don't already exist
6*/
7export async function initializeDatabase() {
8// Generate a unique key based on this file's path to avoid collisions
9const KEY = 'careerCoach'
5import Wiki from "npm:wikijs";
67function parseNightbotHeader(headerValue: string): Record<string, string> | null {
8if (!headerValue) return null;
9return headerValue.split("&").reduce((acc, param) => {
14}
1516// map of built-in handler functions (e.g. weather)
17const commands: Record<
18string,
201};
202203export default async function server(request: Request): Promise<Response> {
204console.log("incoming request:", request.url);
205if (request.method !== "GET") {