Discord-to-Linearmain.tsx3 matches
1import { blob } from "https://esm.town/v/std/blob";
2import { CONFIG } from "./backend/config.tsx";
3import { DiscordAPI } from "./backend/discord.tsx";
4import { LinearSDK } from "./backend/linear.tsx";
52425// Initialize services
26const discord = new DiscordAPI();
27const linear = new LinearSDK();
2845*/
46async function processChannelReactions(
47discord: DiscordAPI,
48linear: LinearSDK,
49serverId: string,
Discord-to-Linearlinear.tsx1 match
67constructor() {
8this.client = new LinearClient({ apiKey: Deno.env.get("LINEAR_API_KEY")! });
9}
10
PlaywrightDemomain.ts3 matches
3import { Browser } from "npm:playwright-core";
4import { valTownChromium } from "./valTownChromium.ts";
5import { STEEL_API_KEY } from "./consts.ts";
6import { hackerNewsDemo } from "./hackerNewsDemo.ts";
78const client = new Steel({
9steelAPIKey: STEEL_API_KEY,
10});
111920browser = await valTownChromium.connectOverCDP(
21`wss://connect.steel.dev?apiKey=${STEEL_API_KEY}&sessionId=${session.id}`,
22{ slowMo: 0 },
23);
PlaywrightDemoconsts.ts1 match
1export const STEEL_API_KEY = Deno.env.get("STEEL_API_KEY");
2
weatherWeatherMap.tsx13 matches
17export default function WeatherMap({ onLocationSelect, selectedLocation }: WeatherMapProps) {
18const mapRef = useRef<HTMLDivElement>(null);
19const mapInstanceRef = useRef<any>(null);
20const markersRef = useRef<any[]>([]);
21const selectedMarkerRef = useRef<any>(null);
29// Create map centered on UK
30const map = window.L.map(mapRef.current).setView([54.5, -2], 3);
31mapInstanceRef.current = map;
3233// Add OpenStreetMap tiles
4647return () => {
48if (mapInstanceRef.current) {
49mapInstanceRef.current.remove();
50mapInstanceRef.current = null;
51}
52if (selectedMarkerRef.current) {
58// Zoom to selected location when it changes
59useEffect(() => {
60if (!mapInstanceRef.current || !selectedLocation) return;
6162const { latitude, longitude } = selectedLocation;
64// Remove previous selected location marker
65if (selectedMarkerRef.current) {
66mapInstanceRef.current.removeLayer(selectedMarkerRef.current);
67selectedMarkerRef.current = null;
68}
6970// Zoom to the selected location with a nice animation
71mapInstanceRef.current.setView([latitude, longitude], 12, {
72animate: true,
73duration: 1.0
102icon: selectedIcon,
103zIndexOffset: 1000 // Ensure it appears above other markers
104}).addTo(mapInstanceRef.current);
105106}, [selectedLocation]);
108// Update markers when weather data changes
109useEffect(() => {
110if (!mapInstanceRef.current || !window.L) return;
111112// Clear existing markers
113markersRef.current.forEach(marker => {
114mapInstanceRef.current.removeLayer(marker);
115});
116markersRef.current = [];
147const marker = window.L.marker([point.latitude, point.longitude], {
148icon: customIcon
149}).addTo(mapInstanceRef.current);
150151// Add popup with detailed info
192try {
193setLoading(true);
194const response = await fetch('/api/weather/map');
195if (response.ok) {
196const data = await response.json();
linearStandupmain.tsx9 matches
5758export async function exec(interval: Interval) {
59const apiKey = Deno.env.get("LINEAR_API_KEY");
60if (!apiKey) {
61console.error("LINEAR_API_KEY not found in environment variables");
62Deno.exit(1);
63}
65const { startDate, endDate } = getYesterdayDateRange();
6667const response = await fetch("https://api.linear.app/graphql", {
68method: "POST",
69headers: {
70"Content-Type": "application/json",
71Authorization: apiKey,
72},
73body: JSON.stringify({
8081if (data.errors) {
82console.error("Error fetching data from Linear API:", data.errors);
83Deno.exit(1);
84}
94}
9596const historyResponse = await fetch("https://api.linear.app/graphql", {
97method: "POST",
98headers: {
99"Content-Type": "application/json",
100Authorization: apiKey,
101},
102body: JSON.stringify({
190}
191192const slackResponse = await fetch("https://slack.com/api/chat.postMessage", {
193method: "POST",
194headers: {
autonomous-valtools.tsx4 matches
77}),
78execute: async ({ query }) => {
79const apiKey = Deno.env.get("EXA_API_KEY");
80const exa = new Exa(apiKey);
81const result = await exa.searchAndContents(query, {
82text: true,
100}),
101execute: async ({ url }) => {
102const apiKey = Deno.env.get("EXA_API_KEY");
103const exa = new Exa(apiKey);
104const result = await exa.getContents([url], { text: true });
105return {
autonomous-valREADME.md9 matches
1# Autonomous Val
2This project demonstrates how to build autonomous agents on Val Town that can be triggered by API calls, cron jobs, etc.
34
89Configure the following variables in your environment:
10- `AGENT_API_KEY` (This is a secure token that you choose to secure the agent.tsx POST endpoint)
11- `OPENAI_API_KEY` (An OpenAI API Key)
12- `EXA_API_KEY` (Optional, though needed if you use the web search tool)
1314## Usage
15Use `demo.tsx` to send objectives to your agent.
1617### API Usage
18To use the API from another client, you can POST authenticated requests to the agent.tsx endpoint:
1920```javascript
30headers: {
31"Content-Type": "application/json",
32"Authorization": `Bearer ${Deno.env.get("AGENT_API_KEY")}`,
33},
34body: JSON.stringify(requestBody),
3738### Streaming Chat
39The API will also work with streaming chat front ends based on the Vercel AI SDK's useChat hook.
4041You just need to pass `streamResults: true` in your API POST request.
4243## Using Other Models
autonomous-valdiagram.tsx1 match
5linkStyle default stroke:#aaaaaa,stroke-width:1.5px
6
7API[API] <--> Agent
8
9subgraph "Agent Runtime"
autonomous-valdemo.tsx5 matches
22objective = formData.get("objective")?.toString() || objective;
2324// Continue with API call using the submitted objective
25} else {
26return new Response("Unsupported content type", { status: 415 });
27}
2829// Make API call with the objective from the form
30const requestBody = {
31messages: [
40headers: {
41"Content-Type": "application/json",
42"Authorization": `Bearer ${Deno.env.get("AGENT_API_KEY")}`,
43},
44body: JSON.stringify(requestBody),
50}
5152// Get the API response data
53const responseData = await response.json();
54console.log("API Response:", responseData);
5556// Return HTML with the results