file_path stringlengths 3 280 | file_language stringclasses 66
values | content stringlengths 1 1.04M | repo_name stringlengths 5 92 | repo_stars int64 0 154k | repo_description stringlengths 0 402 | repo_primary_language stringclasses 108
values | developer_username stringlengths 1 25 | developer_name stringlengths 0 30 | developer_company stringlengths 0 82 |
|---|---|---|---|---|---|---|---|---|---|
src/coffee/__about__.py | Python | # SPDX-FileCopyrightText: 2024-present Will McGugan <willmcgugan@gmail.com>
#
# SPDX-License-Identifier: MIT
__version__ = "0.0.1"
| willmcgugan/coffee | 22 | Coffee shop with Textual | Python | willmcgugan | Will McGugan | |
src/coffee/__init__.py | Python | # SPDX-FileCopyrightText: 2024-present Will McGugan <willmcgugan@gmail.com>
#
# SPDX-License-Identifier: MIT
| willmcgugan/coffee | 22 | Coffee shop with Textual | Python | willmcgugan | Will McGugan | |
src/coffee/__main__.py | Python | import asyncio
from dataclasses import dataclass
from decimal import Decimal
from textual import work
from textual.app import App, ComposeResult
from textual.containers import Container, Horizontal, Vertical, VerticalScroll, Center
from textual.events import Resize
from textual.widgets import (
Button,
Input,
... | willmcgugan/coffee | 22 | Coffee shop with Textual | Python | willmcgugan | Will McGugan | |
tests/__init__.py | Python | # SPDX-FileCopyrightText: 2024-present Will McGugan <willmcgugan@gmail.com>
#
# SPDX-License-Identifier: MIT
| willmcgugan/coffee | 22 | Coffee shop with Textual | Python | willmcgugan | Will McGugan | |
examples/color.py | Python | import declare
from declare import Declare
class Color:
"""A color object with RGB, and alpha components."""
red = declare.Int(0)
green = declare.Int(0)
blue = declare.Int(0)
alpha = declare.Float(1.0)
@red.validate
@green.validate
@blue.validate
def _validate_component(self, com... | willmcgugan/declare | 66 | Syntactical sugar for Python class attributes | Python | willmcgugan | Will McGugan | |
src/declare/__init__.py | Python | from __future__ import annotations
from ._declare import Declare as Declare
from ._declare import watch as watch
__all__ = [
"Declare",
"Int",
"Float",
"Bool",
"Str",
"Bytes",
"watch",
]
Int: type[Declare[int]] = Declare
Float: type[Declare[float]] = Declare
Bool: type[Declare[bool]] = De... | willmcgugan/declare | 66 | Syntactical sugar for Python class attributes | Python | willmcgugan | Will McGugan | |
src/declare/_declare.py | Python | from __future__ import annotations
from copy import copy
from typing import Any, TYPE_CHECKING, Generic, Type, TypeVar, cast, overload
if TYPE_CHECKING:
from collections.abc import Callable
from typing_extensions import TypeAlias
ObjectType = TypeVar("ObjectType")
ValueType = TypeVar("ValueType")
Validato... | willmcgugan/declare | 66 | Syntactical sugar for Python class attributes | Python | willmcgugan | Will McGugan | |
tests/test_declare.py | Python | from typing import List
import declare
from declare import Declare, watch
def test_predefined():
class Foo:
my_int = declare.Int(1)
my_float = declare.Float(3.14)
my_bool = declare.Bool(True)
my_str = declare.Str("Foo")
my_bytes = declare.Bytes(b"bar")
foo = Foo()
... | willmcgugan/declare | 66 | Syntactical sugar for Python class attributes | Python | willmcgugan | Will McGugan | |
src/faqtory/__main__.py | Python | from .cli import run
if __name__ == "__main__":
run()
| willmcgugan/faqtory | 232 | A tool to generate FAQ.md documents and automatically suggest answers to issues | Python | willmcgugan | Will McGugan | |
src/faqtory/cli.py | Python | from __future__ import annotations
from pathlib import Path
import sys
from rich.console import Console
from rich.panel import Panel
from rich.syntax import Syntax
from rich.traceback import install
from .models import Config
from .questions import read_questions
from . import templates
import click
from importlib.... | willmcgugan/faqtory | 232 | A tool to generate FAQ.md documents and automatically suggest answers to issues | Python | willmcgugan | Will McGugan | |
src/faqtory/models.py | Python | from __future__ import annotations
import string
from pathlib import Path
from typing import List
from thefuzz import fuzz
import frontmatter
from yaml import load, Loader
from pydantic import BaseModel
class Question(BaseModel):
title: str
body: str
alt_titles: List[str] = []
@property
def ... | willmcgugan/faqtory | 232 | A tool to generate FAQ.md documents and automatically suggest answers to issues | Python | willmcgugan | Will McGugan | |
src/faqtory/questions.py | Python | from __future__ import annotations
from pathlib import Path
from .models import Question
def read_questions(path: str) -> list[Question]:
questions: list[Question] = []
for question_path in Path(path).glob("*.question.md"):
question = Question.read(question_path)
questions.append(question)
... | willmcgugan/faqtory | 232 | A tool to generate FAQ.md documents and automatically suggest answers to issues | Python | willmcgugan | Will McGugan | |
src/faqtory/templates.py | Python | from __future__ import annotations
from jinja2 import Environment, FileSystemLoader, select_autoescape
def render_faq(templates_path: str, **template_args) -> str:
"""Render FAQ.md"""
env = Environment(
loader=FileSystemLoader(templates_path), autoescape=select_autoescape()
)
template = env... | willmcgugan/faqtory | 232 | A tool to generate FAQ.md documents and automatically suggest answers to issues | Python | willmcgugan | Will McGugan | |
lomond_accel/__init__.py | Python | from ._version import __version__
from ._mask import mask
from ._utf8validator import Utf8Validator
| willmcgugan/lomond-accel | 2 | Python | willmcgugan | Will McGugan | ||
lomond_accel/_mask.c | C | /* Generated by Cython 0.25.2 */
/* BEGIN: Cython Metadata
{
"distutils": {
"depends": []
},
"module_name": "lomond_accel._mask"
}
END: Cython Metadata */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install deve... | willmcgugan/lomond-accel | 2 | Python | willmcgugan | Will McGugan | ||
lomond_accel/_mask.pyx | Cython | # https://github.com/aio-libs/aiohttp
from cpython cimport PyBytes_AsString
#from cpython cimport PyByteArray_AsString # cython still not exports that
cdef extern from "Python.h":
char* PyByteArray_AsString(bytearray ba) except NULL
from libc.stdint cimport uint32_t, uint64_t, uintmax_t
def mask(bytes mask, by... | willmcgugan/lomond-accel | 2 | Python | willmcgugan | Will McGugan | ||
lomond_accel/_utf8validator.pyx | Cython | # coding=utf-8
###############################################################################
##
## Copyright 2011 Tavendo GmbH
##
## Note:
##
## This code is a Python implementation of the algorithm
##
## "Flexible and Economical UTF-8 Decoder"
##
## by Bjoern Hoehrmann
##
## bjoern@hoehrmann.de... | willmcgugan/lomond-accel | 2 | Python | willmcgugan | Will McGugan | ||
lomond_accel/dfa.h | C/C++ Header | static const char UTF8VALIDATOR_DFA[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 00..1f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 20..3f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 40..5f
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0... | willmcgugan/lomond-accel | 2 | Python | willmcgugan | Will McGugan | ||
lomond_accel/mask.c | C | /* Generated by Cython 0.25.2 */
/* BEGIN: Cython Metadata
{
"distutils": {
"depends": []
},
"module_name": "lomond_accel.mask"
}
END: Cython Metadata */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
#error Python headers needed to compile C extensions, please install devel... | willmcgugan/lomond-accel | 2 | Python | willmcgugan | Will McGugan | ||
setup.py | Python | from setuptools import Extension, setup, find_packages
from Cython.Build import cythonize
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Programming Language :: Python',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: ... | willmcgugan/lomond-accel | 2 | Python | willmcgugan | Will McGugan | ||
shuffileid.py | Python | from random import Random
from typing import List
class ShuffleID:
"""An algorithm to shuffle an unsigned integer.
Each integer in a range of 2**bit_size should map to exactly one other integer in the same range. The
operation can be efficiently reversed.
"""
def __init__(self, bit_size: int, ... | willmcgugan/shuffleid | 6 | Python | willmcgugan | Will McGugan | ||
tree.py | Python | # /// script
# dependencies = [
# "textual>=0.85.2",
# "rich>=13.9.4",
# ]
# ///
import asyncio
import grp
import itertools
import mimetypes
import pwd
import threading
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from stat import filemode
from rich import filesize
fro... | willmcgugan/terminal-tree | 183 | Python | willmcgugan | Will McGugan | ||
textual_markdown/__main__.py | Python | import sys
from .browser_app import BrowserApp
if __name__ == "__main__":
app = BrowserApp()
app.run()
| willmcgugan/textual-markdown | 504 | Python | willmcgugan | Will McGugan | ||
textual_markdown/browser_app.py | Python | from __future__ import annotations
import sys
from textual.app import App, ComposeResult
from textual.reactive import var
from textual.widget import Widget
from textual.widgets import Footer
from .widgets import MarkdownBrowser
class BrowserApp(App):
BINDINGS = [
("t", "toggle_toc", "TOC"),
("b... | willmcgugan/textual-markdown | 504 | Python | willmcgugan | Will McGugan | ||
textual_markdown/navigator.py | Python | from __future__ import annotations
from pathlib import Path
class Navigator:
"""Manages a stack of paths like a browser."""
def __init__(self) -> None:
self.stack: list[Path] = []
self.index = 0
@property
def location(self) -> Path:
"""The current location.
Returns:... | willmcgugan/textual-markdown | 504 | Python | willmcgugan | Will McGugan | ||
textual_markdown/widgets.py | Python | from __future__ import annotations
from pathlib import Path
from typing import Iterable, TypeAlias
from markdown_it import MarkdownIt
from rich.style import Style
from rich.syntax import Syntax
from rich.text import Text
from textual.app import ComposeResult
from textual.containers import Vertical
from textual.messag... | willmcgugan/textual-markdown | 504 | Python | willmcgugan | Will McGugan | ||
redirect.go | Go | // The redirect command redirects all HTTP requests to a target URL.
package main
import (
"log"
"net/http"
"net/url"
"os"
"strconv"
"strings"
)
func main() {
port := os.Getenv("PORT")
if port == "" {
port = "8080"
}
target, err := url.Parse(os.Getenv("TARGET"))
if err != nil {
log.Fatalf("error parsi... | willnorris/redirect | 0 | A simple redirecting web server | Go | willnorris | Will Norris | tailscale |
main.go | Go | package main
import (
"bytes"
"flag"
"fmt"
"io"
"log"
"net/http"
"net/netip"
"os"
"os/exec"
"strconv"
"sync"
"github.com/bwesterb/go-zonefile"
)
var origin = flag.String("origin", "", "Origin for the zone to update")
var fZone = flag.String("fzone", "", "Forward zone to use for the server")
var rZone = f... | willscott/pdns | 0 | Minimal dynamic dns API | Go | willscott | Will | |
app.py | Python | import os
import plotly
from io import BytesIO
from pathlib import Path
from typing import List
from openai import AsyncAssistantEventHandler, AsyncOpenAI, OpenAI
from literalai.helper import utc_now
import chainlit as cl
from chainlit.config import config
from chainlit.element import Element
from openai.types.beta.... | willydouhard/data-analyst | 13 | Python | willydouhard | Willy Douhard | Chainlit | |
create_assistant.py | Python | from dotenv import load_dotenv
load_dotenv()
import os
from openai import OpenAI
openai_client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
instructions = """You are an assistant running data analysis on CSV files.
You will use code interpreter to run the analysis.
However, instead of rendering the charts a... | willydouhard/data-analyst | 13 | Python | willydouhard | Willy Douhard | Chainlit | |
backend/build.py | Python | """Build script gets called on poetry/pip build."""
import os
import pathlib
import shutil
import subprocess
import sys
class BuildError(Exception):
"""Custom exception for build failures"""
pass
def run_subprocess(cmd: list[str], cwd: os.PathLike) -> None:
"""
Run a subprocess, allowing natural s... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/__init__.py | Python | import os
from dotenv import load_dotenv
env_found = load_dotenv(dotenv_path=os.path.join(os.getcwd(), ".env"))
from looplit.logger import logger
if env_found:
logger.info("Loaded .env file")
from looplit.decorators import stateful, tool
from looplit.state import State
__all__ = ["State", "stateful", "tool"]
| willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/canvas.py | Python | import json
import os
from looplit.context import get_context
from looplit.decorators import tool
from looplit.state import State
SYSTEM_PROMPT = """You are an AI assistant specialized in analyzing and debugging LLM agent outputs. Your purpose is to identify issues in agent reasoning and suggest improvements to preve... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/cli/__init__.py | Python | import asyncio
import nest_asyncio
nest_asyncio.apply()
import inspect
import os
import site
import sys
from contextlib import asynccontextmanager
from importlib import util
from typing import Any, TypedDict
import click
import socketio
import uvicorn
from fastapi import FastAPI
from fastapi.responses import FileRe... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/context.py | Python | import asyncio
from contextvars import ContextVar
from typing import Union
from lazify import LazyProxy
from looplit.session import Session
class LooplitContextException(Exception):
def __init__(self, msg="Looplit context not found", *args, **kwargs):
super().__init__(msg, *args, **kwargs)
class Loopl... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/decorators.py | Python | import functools
import inspect
import os
from asyncio import CancelledError
from datetime import datetime
from typing import Callable, TypedDict, TypeVar, Union, get_type_hints
from uuid import uuid4
from pydantic import create_model
from pydantic.fields import FieldInfo
from looplit.context import context
from loop... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/logger.py | Python | import logging
import sys
logging.basicConfig(
level=logging.INFO,
stream=sys.stdout,
format="%(asctime)s - %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)
logging.getLogger("socketio").setLevel(logging.ERROR)
logging.getLogger("engineio").setLevel(logging.ERROR)
logger = logging.getLogger("looplit")
| willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/session.py | Python | import asyncio
import uuid
from typing import Any, Awaitable, Callable, Dict, List, Literal, Optional, TypedDict
from pydantic import BaseModel
from looplit.state import State
def ensure_values_serializable(data):
"""
Recursively ensures that all values in the input (dict or list) are JSON serializable.
... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/state/__init__.py | Python | from typing import Any, List, Optional, TypedDict
from uuid import uuid4
from pydantic import BaseModel, Field
class StateMetadata(TypedDict, total=False):
start_time: Optional[str]
end_time: Optional[str]
duration_ms: Optional[float]
session_id: Optional[str]
user_id: Optional[str]
func_name... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/state/typing.py | Python | from typing import Dict, List, Literal, Optional, TypedDict, Union
class ChatCompletionContentPartTextParam(TypedDict, total=False):
text: str
"""The text content."""
type: Literal["text"]
"""The type of the content part."""
class ImageURL(TypedDict, total=False):
url: str
"""Either a URL o... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
backend/looplit/utils.py | Python | import asyncio
import sys
from typing import Any, Coroutine, TypeVar
from pydantic import BaseModel
T_Retval = TypeVar("T_Retval")
def run_sync(co: Coroutine[Any, Any, T_Retval]) -> T_Retval:
"""Run the coroutine synchronously."""
loop = asyncio.get_event_loop()
result = loop.run_until_complete(co)
... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
examples/anthropic_multi_agent/customer_support_agent.py | Python | import json
import litellm
import looplit as ll
@ll.tool
async def get_order_status(order_id: str) -> str:
"""Get the status for a given order id"""
return "Everything is on track!"
async def handle_tool_calls(state: ll.State, tool_calls):
for tool_call in tool_calls:
if tool_call.function.nam... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
examples/anthropic_multi_agent/router_agent.py | Python | import json
import litellm
from customer_support_agent import csa_initial_state, customer_support_agent
import looplit as ll
@ll.tool
async def get_weather(city: str) -> str:
"""Get the weather for a given city"""
return "10 degrees celsius"
@ll.tool
async def call_customer_support_agent(query: str) -> st... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
examples/hello/hello.py | Python | import json
import os
from openai import OpenAI
from openai.types.chat import ChatCompletionMessageToolCall
import looplit as ll
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
@ll.tool
def file_search(directory: str, pattern: str):
"""Searches for files matching pattern in given directory.Returns list of... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
examples/looplit_canvas/looplit_canvas.py | Python | import looplit as ll
import json
from looplit.canvas import canvas_agent, tool_defs, SYSTEM_PROMPT
flagged = {
"role": "assistant",
"content": None,
"tool_calls": [{
"id": "call_1",
"type": "function",
"function": {
"name": "update_recurring_task",
"arguments... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
examples/mistral_multi_agent/customer_support_agent.py | Python | import json
import os
from mistralai import Mistral
import looplit as ll
client = Mistral(api_key=os.getenv("MISTRAL_API_KEY"))
@ll.tool
async def get_order_status(order_id: str) -> str:
"""Get the status for a given order id"""
return "in transit"
async def handle_tool_calls(state: ll.State, tool_calls)... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
examples/mistral_multi_agent/router_agent.py | Python | import json
import os
from customer_support_agent import csa_initial_state, customer_support_agent
from mistralai import Mistral
import looplit as ll
client = Mistral(api_key=os.getenv("MISTRAL_API_KEY"))
@ll.tool
async def get_weather(city: str) -> str:
"""Get the weather for a given city"""
return "10 de... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
examples/openai_multi_agent/customer_support_agent.py | Python | import json
import os
from openai import OpenAI
from openai.types.chat import ChatCompletionMessageToolCall
import looplit as ll
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
@ll.tool
def get_order_status(order_id: str) -> str:
"""Get the status for a given order id"""
return "Everything is on track... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
examples/openai_multi_agent/router_agent.py | Python | import json
import os
from customer_support_agent import csa_initial_state, customer_support_agent
from openai import OpenAI
from openai.types.chat import ChatCompletionMessageToolCall
import looplit as ll
client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
@ll.tool
def get_weather(city: str) -> str:
"""Get t... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/eslint.config.js | JavaScript | import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.con... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/index.html | HTML | <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/looplit.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Looplit Studio</title>
</head>
<body>
<div id="root"></div>
<script type="module" sr... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/postcss.config.js | JavaScript | export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
| willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/App.tsx | TypeScript (TSX) | import MonacoTheme from './MonacoTheme';
import { router } from './Router';
import SocketConnection from './SocketConnection';
import CodeCanvas from './components/Canvas';
import { ThemeProvider } from './components/ThemeProvider';
import { functionsState, sessionState } from './state';
import ConnectingView from './v... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/MonacoTheme.tsx | TypeScript (TSX) | import { useMonaco } from '@monaco-editor/react';
import { useEffect } from 'react';
export default function MonacoTheme() {
const monaco = useMonaco();
useEffect(() => {
if (!monaco) return;
const white = '#ffffff';
const black = '#000000';
monaco.editor.defineTheme('looplit-light', {
bas... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/Router.tsx | TypeScript (TSX) | import HomeView from './views/home';
import RootFunctionView from './views/rootFunction';
import { createBrowserRouter } from 'react-router-dom';
export const router = createBrowserRouter(
[
{
path: '/',
element: <HomeView />
},
{
path: '/fn/:name',
element: <RootFunctionView />
... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/SocketConnection.tsx | TypeScript (TSX) | import { createYamlConflict } from './components/StateMergeEditor';
import {
IError,
IInterrupt,
ILooplitState,
canvasState,
errorState,
functionsState,
interruptState,
runningState,
sessionState,
stateHistoryByLineageState,
toolCallsToLineageIdsState
} from './state';
import { useCallback, useEff... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/AutoResizeTextarea.tsx | TypeScript (TSX) | import { Textarea } from '@/components/ui/textarea';
import { cn } from '@/lib/utils';
import { useCallback, useEffect, useRef } from 'react';
interface Props extends React.ComponentProps<'textarea'> {
maxHeight?: number;
onPasteImage?: (base64Url: string) => void;
}
const AutoResizeTextarea = ({
maxHeight,
o... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/CanvasFloatingInput.tsx | TypeScript (TSX) | import AutoResizeTextarea from '../AutoResizeTextarea';
import { Kbd } from '../Kbd';
import { Button } from '../ui/button';
import useCurrentState from '@/hooks/useCurrentState';
import useInteraction from '@/hooks/useInteraction';
import { canvasState } from '@/state';
import FunctionViewContext from '@/views/functio... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/Chat/AssistantMessage.tsx | TypeScript (TSX) | import { Logo } from '@/components/Logo';
import Markdown from '@/components/Markdown';
interface Props {
content: string;
}
export default function CanvasChatAssistantMessage({ content }: Props) {
return (
<div className="flex gap-4 items-start">
<Logo className="w-5 mt-1.5" />
<div>
<Mar... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/Chat/Body.tsx | TypeScript (TSX) | import CanvasChatAssistantMessage from './AssistantMessage';
import CanvasChatUserMessage from './UserMessage';
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';
import { canvasState } from '@/state';
import { AlertCircle } from 'lucide-react';
import { useRecoilValue } from 'recoil';
export... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/Chat/Header.tsx | TypeScript (TSX) | import { Loader } from '@/components/Loader';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
import { canvasState } from '@/state';
import { SquarePen } from 'lucide-react';
import { useRecoilState } from 'recoil';
import { v4 } from 'uuid';
export default function Canv... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/Chat/Input.tsx | TypeScript (TSX) | import AutoResizeTextarea from '@/components/AutoResizeTextarea';
import { Kbd } from '@/components/Kbd';
import { Button } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import { canvasState } from '@/state';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useRecoi... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/Chat/UserMessage.tsx | TypeScript (TSX) | import Markdown from '@/components/Markdown';
interface Props {
content: string;
}
export default function CanvasChatUserMessage({ content }: Props) {
return (
<div className="bg-accent px-4 py-1 ml-auto max-w-[80%] rounded-lg">
<Markdown>{content}</Markdown>
</div>
);
}
| willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/Chat/index.tsx | TypeScript (TSX) | import CanvasChatBody from './Body';
import CanvasChatHeader from './Header';
import CanvasChatInput from './Input';
import useInteraction from '@/hooks/useInteraction';
import { canvasState } from '@/state';
import { useRecoilState } from 'recoil';
export default function CanvasChat() {
const { callCanvasAgent } = ... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/Header.tsx | TypeScript (TSX) | import { Button } from '../ui/button';
import { ILooplitState, canvasState, editStateState } from '@/state';
import { load as yamlParse } from 'js-yaml';
import { ArrowRight, Check, X } from 'lucide-react';
import { useCallback } from 'react';
import { useRecoilState, useSetRecoilState } from 'recoil';
import { toast }... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Canvas/index.tsx | TypeScript (TSX) | import StateMergeEditor from '../StateMergeEditor';
import CanvasChat from './Chat';
import CanvasHeader from './Header';
import { canvasState } from '@/state';
import { AnimatePresence, motion } from 'motion/react';
import { useEffect } from 'react';
import { useRecoilValue } from 'recoil';
let [x, y] = [0, 0];
cons... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/CopyButton.tsx | TypeScript (TSX) | import { Button } from '@/components/ui/button';
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger
} from '@/components/ui/tooltip';
import { Check, Copy } from 'lucide-react';
import { useState } from 'react';
import { toast } from 'sonner';
interface Props {
content: unknown;
className?: ... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/EditorFormat.tsx | TypeScript (TSX) | import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue
} from '@/components/ui/select';
import useCurrentEditState from '@/hooks/useCurrentEditState';
import { editorFormatState } from '@/state';
import { useEffect } from 'react';
import { useRecoilState } from 'recoil';
const STORAGE_KEY = '... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ImageDialog.tsx | TypeScript (TSX) | import { Button } from '@/components/ui/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger
} from '@/components/ui/dialog';
import {
Form,
FormControl,
FormField,
FormItem,
FormLabel,
FormMessage
} from '@/components/ui/form';
imp... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ImageEditor.tsx | TypeScript (TSX) | import { ZoomableImage } from './ZoomableImage';
import { Button } from '@/components/ui/button';
import { Trash } from 'lucide-react';
interface Props {
url: string;
disabled?: boolean;
onDelete?: () => void;
readOnly?: boolean;
}
export default function ImageEditor({
url,
disabled,
onDelete,
readOnl... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/InlineText.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
interface Props {
children: React.ReactNode;
className?: string;
}
export default function InlineText({ children, className }: Props) {
return (
<code
className={cn(
'relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold',
c... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/JsonEditor.tsx | TypeScript (TSX) | import { useMonacoTheme } from './ThemeProvider';
import Editor from '@monaco-editor/react';
import type { editor } from 'monaco-editor';
import { useEffect, useRef, useState } from 'react';
import { toast } from 'sonner';
interface Props {
value: Record<string, unknown>;
height?: string;
fitContent?: boolean;
... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Kbd.tsx | TypeScript (TSX) | import { usePlatform } from '@/hooks/usePlatform';
import { cn } from '@/lib/utils';
import { Slot } from '@radix-ui/react-slot';
import { Command, CornerDownLeft } from 'lucide-react';
import { ForwardedRef, forwardRef } from 'react';
export type KbdProps = React.HTMLAttributes<HTMLElement> & {
asChild?: boolean;
}... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Loader.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import { LoaderIcon } from 'lucide-react';
interface LoaderProps {
className?: string;
}
const Loader = ({ className }: LoaderProps): JSX.Element => {
return (
<LoaderIcon
className={cn('h-4 w-4 animate-spin text-primary', className)}
/>
);
};
export { Loader };
| willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Logo.tsx | TypeScript (TSX) | import { useTheme } from './ThemeProvider';
import LogoDark from '@/assets/logo_dark.svg';
import LogoLight from '@/assets/logo_light.svg';
interface Props {
className: string;
}
export const Logo = ({ className }: Props) => {
const { theme } = useTheme();
const systemTheme = window.matchMedia('(prefers-color-... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Markdown.tsx | TypeScript (TSX) | import { useMonacoTheme } from './ThemeProvider';
import { AspectRatio } from './ui/aspect-ratio';
import { Card } from './ui/card';
import { Separator } from './ui/separator';
import {
Table,
TableBody,
TableCell,
TableHead,
TableHeader,
TableRow
} from './ui/table';
import Editor from '@monaco-editor/reac... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Message/Content.tsx | TypeScript (TSX) | import type { IMessageContent } from '.';
import AutoResizeTextarea from '../AutoResizeTextarea';
import ImageEditor from '../ImageEditor';
import { Button } from '../ui/button';
import { Trash2 } from 'lucide-react';
import { useCallback } from 'react';
interface Props {
content: IMessageContent;
onChange?: (cont... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Message/RoleSelect.tsx | TypeScript (TSX) | import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue
} from '@/components/ui/select';
const generationMessageRoleValues = ['system', 'assistant', 'user', 'tool'];
interface Props {
value: string;
disabled?: boolean;
onValueChange: (v: string) => void;
}
export default function RoleS... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/Message/index.tsx | TypeScript (TSX) | import ImageDialog from '../ImageDialog';
import { Button } from '../ui/button';
import { MessageContent } from './Content';
import RoleSelect from './RoleSelect';
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger
} from '@/components/ui/tooltip';
import { ListPlusIcon, Trash2 } from 'lucide-rea... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/MessageComposer/index.tsx | TypeScript (TSX) | import type { IMessage } from '../Message';
import Message from '../Message';
import { Kbd } from '@/components/Kbd';
import { Button } from '@/components/ui/button';
import useCurrentEditState from '@/hooks/useCurrentEditState';
import useCurrentState from '@/hooks/useCurrentState';
import useInteraction from '@/hooks... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/StateMergeEditor.tsx | TypeScript (TSX) | import { useMonacoTheme } from './ThemeProvider';
import { cn } from '@/lib/utils';
import { canvasState } from '@/state';
import Editor from '@monaco-editor/react';
import { Position, Range, editor } from 'monaco-editor';
import { useEffect, useMemo, useRef } from 'react';
import { useSetRecoilState } from 'recoil';
... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ThemeProvider.tsx | TypeScript (TSX) | import { createContext, useContext, useEffect, useState } from 'react';
type Theme = 'dark' | 'light' | 'system';
type ThemeProviderProps = {
children: React.ReactNode;
defaultTheme?: Theme;
storageKey?: string;
};
type ThemeProviderState = {
theme: Theme;
setTheme: (theme: Theme) => void;
};
const initia... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ThemeToggle.tsx | TypeScript (TSX) | import { useTheme } from './ThemeProvider';
import { Button } from '@/components/ui/button';
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger
} from '@/components/ui/dropdown-menu';
import { Moon, Sun } from 'lucide-react';
interface Props {
className?: string;
}
export func... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/YamlEditor.tsx | TypeScript (TSX) | import { useMonacoTheme } from './ThemeProvider';
import { cn } from '@/lib/utils';
import Editor from '@monaco-editor/react';
import { load as yamlParse, dump as yamlStringify } from 'js-yaml';
import { type editor } from 'monaco-editor';
import { useEffect, useRef, useState } from 'react';
import { toast } from 'sonn... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ZoomableImage.tsx | TypeScript (TSX) | import { Dialog, DialogContent, DialogTrigger } from '@/components/ui/dialog';
import { cn } from '@/lib/utils';
import { DetailedHTMLProps, ImgHTMLAttributes } from 'react';
export const ZoomableImage = ({
alt = '',
className,
src,
...other
}: DetailedHTMLProps<
ImgHTMLAttributes<HTMLImageElement>,
HTMLIm... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/alert-dialog.tsx | TypeScript (TSX) | import { buttonVariants } from '@/components/ui/button';
import { cn } from '@/lib/utils';
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
import * as React from 'react';
const AlertDialog = AlertDialogPrimitive.Root;
const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
const AlertDialogPor... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/alert.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import { type VariantProps, cva } from 'class-variance-authority';
import * as React from 'react';
const alertVariants = cva(
'relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/aspect-ratio.tsx | TypeScript (TSX) | import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
const AspectRatio = AspectRatioPrimitive.Root;
export { AspectRatio };
| willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/badge.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import { type VariantProps, cva } from 'class-variance-authority';
import * as React from 'react';
const badgeVariants = cva(
'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/button.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import { Slot } from '@radix-ui/react-slot';
import { type VariantProps, cva } from 'class-variance-authority';
import * as React from 'react';
const buttonVariants = cva(
'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colo... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/card.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import * as React from 'react';
const Card = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
'rounded-xl border bg-card text-card-foreground shadow',
className
)}
... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/dialog.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { X } from 'lucide-react';
import * as React from 'react';
const Dialog = DialogPrimitive.Root;
const DialogTrigger = DialogPrimitive.Trigger;
const DialogPortal = DialogPrimitive.Portal;
const DialogClose = DialogPr... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/dropdown-menu.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import { Check, ChevronRight, Circle } from 'lucide-react';
import * as React from 'react';
const DropdownMenu = DropdownMenuPrimitive.Root;
const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
const Dropd... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/form.tsx | TypeScript (TSX) | import { Label } from '@/components/ui/label';
import { cn } from '@/lib/utils';
import * as LabelPrimitive from '@radix-ui/react-label';
import { Slot } from '@radix-ui/react-slot';
import * as React from 'react';
import {
Controller,
ControllerProps,
FieldPath,
FieldValues,
FormProvider,
useFormContext
} ... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/input.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import * as React from 'react';
const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
'flex h-9 w-full rounded-md border border-input b... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/label.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import * as LabelPrimitive from '@radix-ui/react-label';
import { type VariantProps, cva } from 'class-variance-authority';
import * as React from 'react';
const labelVariants = cva(
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70'
);
con... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/popover.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import * as PopoverPrimitive from '@radix-ui/react-popover';
import * as React from 'react';
const Popover = PopoverPrimitive.Root;
const PopoverTrigger = PopoverPrimitive.Trigger;
const PopoverAnchor = PopoverPrimitive.Anchor;
const PopoverContent = React.forwardRef<
React.Eleme... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/resizable.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import { GripVertical } from 'lucide-react';
import * as ResizablePrimitive from 'react-resizable-panels';
const ResizablePanelGroup = ({
className,
...props
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
<ResizablePrimitive.PanelGroup
className={cn(
... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/select.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import * as SelectPrimitive from '@radix-ui/react-select';
import { Check, ChevronDown, ChevronUp, ChevronsUpDown } from 'lucide-react';
import * as React from 'react';
const Select = SelectPrimitive.Root;
const SelectGroup = SelectPrimitive.Group;
const SelectValue = SelectPrimitiv... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit | |
frontend/src/components/ui/separator.tsx | TypeScript (TSX) | import { cn } from '@/lib/utils';
import * as SeparatorPrimitive from '@radix-ui/react-separator';
import * as React from 'react';
const Separator = React.forwardRef<
React.ElementRef<typeof SeparatorPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
>(
(
{ className, orientation... | willydouhard/looplit | 13 | TypeScript | willydouhard | Willy Douhard | Chainlit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.