Public

Versions

  • v18

    17h ago
    Open: Version
    Changes from v17 to v18
    +5
    -1
    ⦚ 574 unchanged lines ⦚
    Parameters: ${JSON.stringify(toolRequest.parameters || {})}
    Instructions:
    ⦚ 237 unchanged lines ⦚
    1. Does this request require creating a new information tool?
    2. Can we use an existing tool?
    Format your thinking as JSON with this structure:
    {
    "actionType": "create_tool" | "use_tool" | "direct_response",
    "reasoning": "your reasoning here",
    "response": "your response to the user",
    ⦚ 226 unchanged lines ⦚
    ⦚ 574 unchanged lines ⦚
    Parameters: ${JSON.stringify(toolRequest.parameters || {})}

    Current Date and Time: ${new Date().toISOString()}
    Instructions:
    ⦚ 237 unchanged lines ⦚
    1. Does this request require creating a new information tool?
    2. Can we use an existing tool?

    Current Date and Time: ${new Date()}
    Format your thinking as JSON with this structure:
    {
    "actionType": "create_tool" | "use_tool",
    "reasoning": "your reasoning here",
    "response": "your response to the user",
    ⦚ 226 unchanged lines ⦚
  • v17

    21h ago
    Open: Version
    Changes from v16 to v17
    +3
    -3
    ⦚ 351 unchanged lines ⦚
    try {
    // Query the cache table
    const cacheResult: ResultSet = await sqlite.execute(
    `
    SELECT path, response, content_type, status, created_at, hits
    ⦚ 6 unchanged lines ⦚
    // If no cache entry found

    const cacheEntry = cacheResult[0];

    // Check if cache is expired (older than CACHE_TTL)
    const cacheDate = new Date(cacheEntry.created_at).getTime();
    const currentDate = new Date().getTime();
    if (currentDate - cacheDate > CACHE_TTL) {
    ⦚ 679 unchanged lines ⦚
    ⦚ 351 unchanged lines ⦚
    try {
    // Query the cache table
    const cacheResult = await sqlite.execute(
    `
    SELECT path, response, content_type, status, created_at, hits
    ⦚ 6 unchanged lines ⦚
    // If no cache entry found

    const cacheEntry = cacheResult.rows[0];

    // Check if cache is expired (older than CACHE_TTL)
    const cacheDate = new Date(cacheEntry["created_at"].toString()).getTime();
    const currentDate = new Date().getTime();
    if (currentDate - cacheDate > CACHE_TTL) {
    ⦚ 679 unchanged lines ⦚
  • v16

    21h ago
    Open: Version
    Changes from v15 to v16
    +1
    -1
    ⦚ 409 unchanged lines ⦚
    serverLog("ERROR", "Cache check failed", {
    path,
    error: error instanceof Error ? error.message : String(error),
    });
    return null;
    ⦚ 635 unchanged lines ⦚
    ⦚ 409 unchanged lines ⦚
    serverLog("ERROR", "Cache check failed", {
    path,
    error: error instanceof Error ? error.message + " " + error.stack : String(error),
    });
    return null;
    ⦚ 635 unchanged lines ⦚
  • v15

    22h ago
    Open: Version
    Changes from v14 to v15
    +2
    -2
    ⦚ 473 unchanged lines ⦚

    // If we have a similar request cached, use that
    if (existingRequests.rows.length > 0) {
    const responseData = JSON.parse(existingRequests[0].response);
    const responseBody = JSON.stringify(responseData);

    ⦚ 570 unchanged lines ⦚
    ⦚ 473 unchanged lines ⦚

    // If we have a similar request cached, use that
    if (existingRequests.rows && existingRequests.rows.length > 0) {
    const responseData = JSON.parse(existingRequests.rows[0].response);
    const responseBody = JSON.stringify(responseData);

    ⦚ 570 unchanged lines ⦚
  • v14

    22h ago
    Open: Version
    Changes from v13 to v14
    +1
    -1
    ⦚ 655 unchanged lines ⦚
    const errorResponse = JSON.stringify({
    error: "Failed to process this data endpoint",
    details: error instanceof Error ? error.message : String(error),
    });

    ⦚ 389 unchanged lines ⦚
    ⦚ 655 unchanged lines ⦚
    const errorResponse = JSON.stringify({
    error: "Failed to process this data endpoint",
    details: error instanceof Error ? error.message + " " + String(error.stack) : String(error),
    });

    ⦚ 389 unchanged lines ⦚
  • v13

    22h ago
    Open: Version
    Changes from v12 to v13
    +1
    -1
    ⦚ 750 unchanged lines ⦚
    JSON.stringify(toolRequest.parameters || {}),
    JSON.stringify(toolResponse.data),
    toolResponse.success ? null : toolResponse.error,
    ],
    );
    ⦚ 294 unchanged lines ⦚
    ⦚ 750 unchanged lines ⦚
    JSON.stringify(toolRequest.parameters || {}),
    JSON.stringify(toolResponse.data),
    JSON.stringify(toolResponse.success ? null : toolResponse.error),
    ],
    );
    ⦚ 294 unchanged lines ⦚
  • v12

    23h ago
    Open: Version
    Changes from v11 to v12
    +1
    -1
    ⦚ 696 unchanged lines ⦚
    JSON.stringify({
    success: true,
    data: JSON.parse(existingRequests.rows[0].response),
    }),
    {
    ⦚ 348 unchanged lines ⦚
    ⦚ 696 unchanged lines ⦚
    JSON.stringify({
    success: true,
    data: JSON.parse(existingRequests.rows[0].response.toString()),
    }),
    {
    ⦚ 348 unchanged lines ⦚
  • v11

    23h ago
    Open: Version
    Changes from v10 to v11
    +1
    -1
    ⦚ 696 unchanged lines ⦚
    JSON.stringify({
    success: true,
    data: JSON.parse(existingRequests[0].response),
    }),
    {
    ⦚ 348 unchanged lines ⦚
    ⦚ 696 unchanged lines ⦚
    JSON.stringify({
    success: true,
    data: JSON.parse(existingRequests.rows[0].response),
    }),
    {
    ⦚ 348 unchanged lines ⦚
  • v10

    23h ago
    Open: Version
    +1049
    -0

    /** @jsxImportSource https://esm.sh/react@18.2.0 */
    import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
    import React, { useEffect, useState } from "https://esm.sh/react@18.2.0";
    import { v4 as uuidv4 } from "https://esm.sh/uuid";

    // Define the types for our agent system
    type Schema = {
    name: string;
    description: string;
    fields: {
    name: string;
    type: string;
    description: string;
    }[];
    };

    type ToolRequest = {
    id?: string;
    schema: Schema;
    query: string;
    parameters?: Record<string, any>;
    };

    type ToolResponse = {
    success: boolean;
    data?: any;
    error?: string;
    };

    type ChatMessage = {
    role: "user" | "agent" | "system" | "tool";
    content: string;
    };

    type AgentResponse = {
    actionType: "create_tool" | "use_tool" | "direct_response";
data-base.web.val.run
Updated: March 12, 2025