1Given <knowledge>, add a section that describes <newFunctionality> with an example.
23<newFunctionality>
4Declared in: https://esm.town/v/cricks_unmixed4u/github-api/api/index.tsx?v=30 onwards
56```tsx
7export async function getIssueContentAsMarkdown(
8issueNumber: number,
9options: MonitorOptions = {},
67return markdown;
68}```
69</newFunctionality>
70717677- Ask clarifying questions when requirements are ambiguous
78- Provide complete, functional solutions rather than skeleton implementations
79- Test your logic against edge cases before presenting the final solution
80- Ensure all code follows Val Town's specific platform requirements
89- **Never bake in secrets into the code** - always use environment variables
90- Include comments explaining complex logic (avoid commenting obvious operations)
91- Follow modern ES6+ conventions and functional programming practices if possible
9293## Types of triggers
100101```ts
102export default async function (req: Request) {
103return new Response("Hello World");
104}
114115```ts
116export default async function () {
117// Scheduled task code
118}
128129```ts
130export default async function (email: Email) {
131// Process email
132}
138## Val Town Standard Libraries
139140Val Town provides several hosted services and utility functions.
141142### Blob Storage
192```
193194## Val Town Utility Functions
195196Val Town provides several utility functions to help with common project tasks.
197198### Importing Utilities
272โ โโโ database/
273โ โ โโโ migrations.ts # Schema definitions
274โ โ โโโ queries.ts # DB query functions
275โ โ โโโ README.md
276โ โโโ routes/ # Route modules
291โโโ shared/
292โโโ README.md
293โโโ utils.ts # Shared types and functions
294```
295298- Hono is the recommended API framework
299- Main entry point should be `backend/index.ts`
300- **Static asset serving:** Use the utility functions to read and serve project files:
301```ts
302import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
332- Run migrations on startup or comment out for performance
333- Change table names when modifying schemas rather than altering
334- Export clear query functions with proper TypeScript typing
335336## Common Gotchas and Solutions
362363364## Utility Functions from Other Vals
365366### Logging
369- Import `https://www.val.town/x/cricks_unmixed4u/logger/code/logger/main.tsx` and use `logInfo`, `logError` or `logDebug`.
370371# Next Step 1 - Export a new function from api
372373The new function should return the relevant content of a given issue in markdown format.
374The relevant content is the text comments, including URLs (of links and images) included in them.
375
github-apillm19 matches
1Given <knowledge>, add a section that describes <newFunctionality> with an example.
23<newFunctionality>
4Declared in: https://esm.town/v/cricks_unmixed4u/github-api/api/index.tsx?v=30 onwards
56```tsx
7export async function getIssueContentAsMarkdown(
8issueNumber: number,
9options: MonitorOptions = {},
67return markdown;
68}```
69</newFunctionality>
70717677- Ask clarifying questions when requirements are ambiguous
78- Provide complete, functional solutions rather than skeleton implementations
79- Test your logic against edge cases before presenting the final solution
80- Ensure all code follows Val Town's specific platform requirements
89- **Never bake in secrets into the code** - always use environment variables
90- Include comments explaining complex logic (avoid commenting obvious operations)
91- Follow modern ES6+ conventions and functional programming practices if possible
9293## Types of triggers
100101```ts
102export default async function (req: Request) {
103return new Response("Hello World");
104}
114115```ts
116export default async function () {
117// Scheduled task code
118}
128129```ts
130export default async function (email: Email) {
131// Process email
132}
138## Val Town Standard Libraries
139140Val Town provides several hosted services and utility functions.
141142### Blob Storage
192```
193194## Val Town Utility Functions
195196Val Town provides several utility functions to help with common project tasks.
197198### Importing Utilities
272โ โโโ database/
273โ โ โโโ migrations.ts # Schema definitions
274โ โ โโโ queries.ts # DB query functions
275โ โ โโโ README.md
276โ โโโ routes/ # Route modules
291โโโ shared/
292โโโ README.md
293โโโ utils.ts # Shared types and functions
294```
295298- Hono is the recommended API framework
299- Main entry point should be `backend/index.ts`
300- **Static asset serving:** Use the utility functions to read and serve project files:
301```ts
302import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
332- Run migrations on startup or comment out for performance
333- Change table names when modifying schemas rather than altering
334- Export clear query functions with proper TypeScript typing
335336## Common Gotchas and Solutions
362363364## Utility Functions from Other Vals
365366### Logging
369- Import `https://www.val.town/x/cricks_unmixed4u/logger/code/logger/main.tsx` and use `logInfo`, `logError` or `logDebug`.
370371# Next Step 1 - Export a new function from api
372373The new function should return the relevant content of a given issue in markdown format.
374The relevant content is the text comments, including URLs (of links and images) included in them.
375
github-apiindex.tsx2 matches
22export interface MonitorOptions extends GitHubConfig {}
2324export async function getGitHubIssuesUpdatedSinceLastRun(
25options: MonitorOptions = {},
26) {
78}
7980export async function getIssueContentAsMarkdown(
81issueNumber: number,
82options: MonitorOptions = {},
github-apigithub-utils.ts2 matches
13}
1415export function createGitHubClient(options: GitHubConfig = {}): GitHubClientResult {
16// Configuration with fallbacks to environment variables
17const repoOwner = options.repoOwner || Deno.env.get("GITHUB_REPO_OWNER");
43}
4445export function extractUrls(text: string): string[] {
46const urlRegex = /(https?:\/\/[^\s\)]+)/g;
47return text.match(urlRegex) || [];
56// Debug logger
7export function debugLog(...args: unknown[]) {
8if (Deno.env.get("DEBUG") === "true") {
9console.log("[DEBUG]", ...args);
13export { getGitHubIssuesUpdatedSinceLastRun }; // Backwards compatibility related to rolodex.
1415export async function monitorGitHubIssues(options: MonitorOptions = {}) {
16try {
17debugLog("Starting monitorGitHubIssues with options:", options);
38}
3940// Keep the default export for cron functionality
41export default monitorGitHubIssues;
42
1export default async function (req: Request): Promise<Response> {
2try {
3// Get credentials from environment variables
gissue-rolodexmain.cron.tsx1 match
16const DAILY_TRACKING_TABLE = "beeminder_issue_daily_sends_2";
1718export default async function () {
19console.log("๐ Starting GitHub Issue Rolodex...");
20
gissue-rolodexknowledge.md12 matches
45- Ask clarifying questions when requirements are ambiguous
6- Provide complete, functional solutions rather than skeleton implementations
7- Test your logic against edge cases before presenting the final solution
8- Ensure all code follows Val Town's specific platform requirements
17- **Never bake in secrets into the code** - always use environment variables
18- Include comments explaining complex logic (avoid commenting obvious operations)
19- Follow modern ES6+ conventions and functional programming practices if possible
2021## Types of triggers
2829```ts
30export default async function (req: Request) {
31return new Response("Hello World");
32}
4243```ts
44export default async function () {
45// Scheduled task code
46}
5657```ts
58export default async function (email: Email) {
59// Process email
60}
66## Val Town Standard Libraries
6768Val Town provides several hosted services and utility functions.
6970### Blob Storage
120```
121122## Val Town Utility Functions
123124Val Town provides several utility functions to help with common project tasks.
125126### Importing Utilities
200โ โโโ database/
201โ โ โโโ migrations.ts # Schema definitions
202โ โ โโโ queries.ts # DB query functions
203โ โ โโโ README.md
204โ โโโ routes/ # Route modules
219โโโ shared/
220โโโ README.md
221โโโ utils.ts # Shared types and functions
222```
223226- Hono is the recommended API framework
227- Main entry point should be `backend/index.ts`
228- **Static asset serving:** Use the utility functions to read and serve project files:
229```ts
230import { readFile, serveFile } from "https://esm.town/v/std/utils@85-main/index.ts";
260- Run migrations on startup or comment out for performance
261- Change table names when modifying schemas rather than altering
262- Export clear query functions with proper TypeScript typing
263264## Common Gotchas and Solutions
2import { CodeSandbox } from "npm:@codesandbox/sdk@1.1.6";
34export default async function(req: Request): Promise<Response> {
5try {
6// Get the API key from environment variables
gissue-rolodexApp.tsx1 match
2import { useState } from "https://esm.sh/react@18.2.0";
34export default function App(): React.JSX.Element {
5const [refreshFrequency, setRefreshFrequency] = useState("");
6const [isSubmitting, setIsSubmitting] = useState(false);