reflect-writersummarizeInput.ts4 matches
4import { dedent } from "npm:ts-dedent";
56import * as ReflectApi from "./reflectApi.ts";
78const jsonSchema = ReflectApi.endpointJsonSchema("appendToDailyNote");
910export async function summarizeInputForDailyNote(
11text: string,
12): Promise<ReflectApi.EndpointInput<"appendToDailyNote">> {
13const openai = new OpenAI();
1426console.log("OpenAI response:", response);
2728return JSON.parse(response) as ReflectApi.EndpointInput<"appendToDailyNote">;
29}
30
reflect-writerhttpHandler.ts2 matches
2import z from "npm:zod";
34import * as ReflectApi from "./reflectApi.ts";
5import { summarizeInputForDailyNote } from "./summarizeInput.ts";
626try {
27const summary = await summarizeInputForDailyNote(input);
28const result = await ReflectApi.call("appendToDailyNote", summary);
29if (!result.success) {
30return c.json(result, 500);
reflect-writerreflectApi.ts4 matches
2import { toJSONSchema } from "npm:zod";
34type ReflectApiEndpoint = {
5path: string;
6method: "PUT" | "POST";
8};
910const API_BASE_URL = "https://reflect.app/api/";
1112export const endpoints = {
43}),
44},
45} as const satisfies Record<string, ReflectApiEndpoint>;
4647export function endpointJsonSchema(
8990const response = await fetch(
91`${API_BASE_URL}/graphs/${graphId}/${endpoint.path}`,
92{
93method: endpoint.method,
cognitoCallbackCLAUDE.md10 matches
13- Generate code in TypeScript or TSX
14- Add appropriate TypeScript types and interfaces for all data structures
15- Prefer official SDKs or libraries than writing API calls directly
16- Ask the user to supply API or library documentation if you are at all unsure about it
17- **Never bake in secrets into the code** - always use environment variables
18- Include comments explaining complex logic (avoid commenting obvious operations)
23### 1. HTTP Trigger
2425- Create web APIs and endpoints
26- Handle HTTP requests and responses
27- Example structure:
167However, it's *extremely importing* to note that `parseProject` and other Standard Library utilities ONLY RUN ON THE SERVER.
168If you need access to this data on the client, run it in the server and pass it to the client by splicing it into the HTML page
169or by making an API request for it.
170171## Val Town Platform Specifics
175- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
176- **Storage:** DO NOT use the Deno KV module for storage
177- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
178- **Weather Data:** Use open-meteo for weather data (doesn't require API keys) unless otherwise specified
179- **View Source:** Add a view source link by importing & using `import.meta.url.replace("ems.sh", "val.town)"` (or passing this data to the client) and include `target="_top"` attribute
180- **Error Debugging:** Add `<script src="https://esm.town/v/std/catch"></script>` to HTML to capture client-side errors
181- **Error Handling:** Only use try...catch when there's a clear local resolution; Avoid catches that merely log or return 500s. Let errors bubble up with full context
182- **Environment Variables:** Use `Deno.env.get('keyname')` when you need to, but generally prefer APIs that don't require keys
183- **Imports:** Use `https://esm.sh` for npm and Deno dependencies to ensure compatibility on server and browser
184- **Storage Strategy:** Only use backend storage if explicitly required; prefer simple static client-side sites
218### Backend (Hono) Best Practices
219220- Hono is the recommended API framework
221- Main entry point should be `backend/index.ts`
222- **Static asset serving:** Use the utility functions to read and serve project files:
242});
243```
244- Create RESTful API routes for CRUD operations
245- Always include this snippet at the top-level Hono app to re-throwing errors to see full stack traces:
246```ts
279- For files in the project, use `readFile` helpers
2802815. **API Design:**
282- `fetch` handler is the entry point for HTTP vals
283- Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
cognitoCallbackindex.ts2 matches
12app.get("/frontend/**/*", c => serveFile(c.req.path, import.meta.url));
1314// Add your API routes here
15// app.get("/api/data", c => c.json({ hello: "world" }));
1617// Unwrap and rethrow Hono errors as the original error
2324capturePostHogEvent(
25Deno.env.get("phProjectAPIKey"),
26webhookPayload.sender.login,
27"GitHub Star",
23<title>Oratio Elaborator</title>
24<style>
25@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600&display=swap');
26:root {
27--background-color: #12121c;
123124<script>
125const API_URL = '${sourceUrl}';
126const submitButton = document.getElementById('submitButton');
127const inputText = document.getElementById('inputText');
140141try {
142const response = await fetch(API_URL, {
143method: 'POST',
144headers: { 'Content-Type': 'application/json' },
MindfulMiles7-domingo.ts1 match
11`;
1213const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
1415fetch(url, {
MindfulMiles6-sabado.ts1 match
11`;
1213const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
1415fetch(url, {
MindfulMiles5-viernes.ts1 match
10`;
1112const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
1314fetch(url, {