This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| from textual.widgets import Static | |
| from textual.containers import Vertical | |
| from textual.timer import Timer | |
| class TuiOsHome(Vertical): | |
| DEFAULT_CSS = """ | |
| TuiOsHome { | |
| height: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print("You has been haxxored!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Vector database module: SQLite-backed store with OpenAI-compatible embeddings. | |
| Provides: | |
| - VectorDB, SQLite-backed store with embeddings from an OpenAI-compatible embedding API | |
| - source_files table, Tracks each file path and mtime so unchanged files skip re-embedding entirely | |
| - embedding_to_blob / blob_to_embedding, Pack/unpack float32 vectors to/from SQLite BLOBs | |
| - cosine_similarity, Computes similarity between two vectors | |
| - SearchResult, NamedTuple for search hits (id, text, score, source) | |
| - SearchResults, Iterable container with ``.threshold(min_score)`` and ``.with_file_contents()`` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| A simplified AI agent with tool calling and automatic schema generation. | |
| """ | |
| import openai | |
| import inspect | |
| import json | |
| from typing import Annotated, get_origin, get_args, Any, Callable | |
| from dataclasses import dataclass, field |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::collections::{HashMap, BTreeSet}; | |
| use std::fs::File; | |
| use std::io::{Read, Write}; | |
| use std::path::PathBuf; | |
| use std::sync::{RwLock, Arc}; | |
| use std::collections::HashMap as StdHashMap; | |
| use serde::{Deserialize, Serialize}; | |
| use thiserror::Error; | |
| #[derive(Error, Debug)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![feature(likely_unlikely)] | |
| use crate::entity_type::Entity; | |
| mod static_data { | |
| /* | |
| This represents a global blackboard of data. | |
| All state that can be represented is stored here. | |
| Entities are pointers into this data. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::io::Read; | |
| use std::marker::PhantomData; | |
| pub use token::{Token, tokenize}; | |
| pub use ast::{Expr, BinOp, EvalError}; | |
| pub use parser::{ParseError, parse_tokens}; | |
| struct Runic<State = Ready>(PhantomData<State>); | |
| struct Ready; | |
| struct Tokenized; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class_name HTTPServer | |
| extends Node | |
| var server := TCPServer.new() | |
| var port := 8080 | |
| var clients := [] | |
| var router := Router.new() | |
| func add_route(method: String, path: String, handler: Callable): | |
| router.add_route(method, path, handler) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class_name RingBuffer | |
| extends RefCounted | |
| var buffer: Array | |
| var size: int | |
| var head: int = 0 | |
| var tail: int = 0 | |
| var mutex: Mutex = Mutex.new() | |
| var buffer_not_empty: Semaphore = Semaphore.new() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @tool | |
| class_name Grumble | |
| class DecodeResult: | |
| var string: String | |
| var idx: int | |
| func _init(input_string: String): | |
| string = input_string | |
| idx = 0 |
NewerOlder