xonecas.io
53129
Pa

PAT / commit 0d1a3cb

feat: drizzle orm and sql setup

xonecas2025-12-16 0d1a3cb949a78bf02f2b9fae2eea33b66a3e8f57 parent 4299a86

10 files changed

This diff is too big to show in full. The first 1000 lines are below, and every file is listed with its counts.

.gitignore+2−0
@@ -1,3 +1,5 @@
11 node_modules
22 .next
33 .env
4+data/
5+drizzle/
TODO.md+11−0
@@ -0,0 +1,11 @@
1+# TODO:
2+
3+## BUGS:
4+
5+- use the chat() function of the ollama library instead of generate, so we can send the history of messages.
6+- Improve websearch, currently not working at all. Use this as a template: https://github.com/meirm/ollama-tools/blob/main/sample_functions.py#L5
7+
8+## New features:
9+
10+- Text input, we should be able to press a button and record a prompt.
11+- Text to voice, we should have a button to have the models replies be read with text to voice.
_planning/TODO.md+0−20
@@ -1,20 +0,0 @@
1-# TODO:
2-
3-## BUGS:
4-
5-- use the chat() function of the ollama library instead of generate, so we can send the history of messages.
6-- Improve websearch, currently not working at all. Use this as a template: https://github.com/meirm/ollama-tools/blob/main/sample_functions.py#L5
7-
8-## Must haves:
9-
10-- The agent's reply UI needs to be as wide as it can in the browser window, and handle markdown and code snippets correctly
11-- When a message is sent to the agent, the text in the message box should be cleared.
12-- The up and down arrows when focused on the chatbox should bring up past sent messages in chronological order.
13-- The title at the top is not necessary.
14-- The UI closely resembles Google's material UI, let's make it more rounded and use a hotter color (instead of the blue seen on the buttons)
15-- The UI needs to support both dark and light modes.
16-
17-## New features:
18-
19-- Text input, we should be able to press a button and record a prompt.
20-- Text to voice, we should have a button to have the models replies be read with text to voice.
_planning/search-api-wrapper.md+0−214
@@ -1,214 +0,0 @@
1->>> Are there open source and free search apis already?
2-Thinking...
3-The user asks if there are open source and free search APIs. We should explain options: free tiers of APIs, open-source search engines
4-like Vespa, Meilisearch, ElasticSearch (open source but not free for cloud), open-source web crawling like Scrapy, or open-source
5-semantic search like Qdrant. Also mention free tier APIs like DuckDuckGo Instant Answer API, BGG, maybe search APIs that are open
6-source: Bing API is not open source. There are open-source search APIs like OpenSearch, Algolia free tier. Or mention using Google
7-Custom Search has free quota. The answer should provide a listc, pros/cons, links. Also mention how to integrate. Let's provide
8-suggestions:
9-
10-- DuckDuckGo Instant Answer API – free, no key.
11-- Google Custom Search JSON API – free for 100 queries/day.
12-- Bing Search API – free tier 1000 queries/day maybe? Not sure, but there's free tier.
13-- OpenSearch server from Amazon but you can host locally; not an API provider but you can run locally.
14-
15-- Open-source search backends: Meilisearch (full text search, simple API), Typesense, ElasticSearch (open source but licensing). These
16-are not "search APIs" for web content but for your own index.
17-
18-- There are open-source web crawling and indexing solutions: Scrapy + Whoosh, or Apache Nutch.
19-
20-- For semantic search: Qdrant.
21-
22-Also mention that some "search APIs" are not open source but have free tiers.
23-
24-We should respond with helpful explanation and references. Also ask if they want to search the web or internal indexing. Provide code
25-snippets. Let's craft answer.
26-...done thinking.
27-
28-### TL;DR
29-| What you want | Is it free? | Open‑source? | Quick‑start |
30-|---------------|-------------|--------------|-------------|
31-| **"Search the web" with a public API** | Yes (free tiers, but usually limited) | No | DuckDuckGo Instant Answer API, Google CSE (100/day), Bing (free quota), SerpAPI (free 10/day) |
32-| **"Run your own search engine" (index your own data)** | Yes (self‑hosted) | Yes | Meilisearch, Typesense, Elasticsearch (OSS), Qdrant, Vespa |
33-| **"Build a crawler + indexer"** | Yes (self‑hosted) | Yes | Scrapy + Whoosh, Apache Nutch, ElasticSearch + Logstash |
34-
35-Below I walk you through each category, give you concrete links, and show a tiny snippet that lets you plug the free service into the
36-same “search‑then‑prompt” pattern we discussed earlier.
37-
38----
39-
40-## 1️⃣ Search the Web with a Free Public API
41-
42-| Provider | Free Tier | Notes | Docs |
43-|----------|-----------|-------|------|
44-| **DuckDuckGo Instant Answer API** | Unlimited (no key) | Very lightweight; returns JSON with snippets for most queries. | <https://api.duckduckgo.com/api> |
45-| **Google Custom Search JSON API** | 100 queries/day (free) | Requires a "Custom Search Engine" (CSE) ID. | <https://developers.google.com/custom-search/v1/overview> |
46-| **Bing Search v7** | 1000 queries/day for a *trial* (Azure) | Requires Azure subscription; after the trial you pay. | <https://learn.microsoft.com/en-us/azure/cognitive-services/bing-web-search> |
47-| **SerpAPI** | 10 requests/day free | Supports Google, Bing, DuckDuckGo, etc. | <https://serpapi.com> |
48-
49-> **Tip:** DuckDuckGo is the easiest to get started with because it needs *no* API key.
50-
51-### Example: DuckDuckGo Wrapper (Python)
52-
53-```python
54-import os
55-import requests
56-
57-def duckduckgo_search(query: str, max_results: int = 5):
58- """Return a list of {'title', 'snippet', 'url'}."""
59- params = {
60- "q": query,
61- "format": "json",
62- "no_redirect": 1,
63- "no_html": 1,
64- "skip_disambig": 1,
65- }
66- r = requests.get("https://api.duckduckgo.com/", params=params, timeout=10)
67- r.raise_for_status()
68- data = r.json()
69-
70- results = []
71- for i, result in enumerate(data.get("RelatedTopics", [])[:max_results]):
72- if "Text" in result:
73- results.append({
74- "title": result.get("Text")[:70], # shorten title
75- "snippet": result.get("Text", ""),
76- "url": result.get("FirstURL", ""),
77- })
78- return results
79-```
80-
81-> *Feel free to swap this into the `bing_search()` wrapper from the previous message.*
82-
83----
84-
85-## 2️⃣ Run Your Own Search Engine (Self‑Hosted)
86-
87-If you want to index your own documents (PDFs, code, knowledge base, etc.) you can run an open‑source engine locally or in your own
88-cloud.
89-
90-| Engine | Language | API | Features | License |
91-|--------|----------|-----|----------|---------|
92-| **Meilisearch** | Rust (API in JSON) | Simple REST, WebSocket for re‑indexing | Full‑text, typo‑tolerance, facet filtering, zero‑config | MIT |
93-| **Typesense** | Rust | REST, gRPC | Near‑real‑time, typo‑tolerance, filtering, analytics | Apache 2.0 |
94-| **Elasticsearch OSS** | Java | REST, Elasticsearch DSL | Powerful full‑text, Kibana, aggregations, near‑real‑time | Apache 2.0 (OSS edition) |
95-| **Qdrant** | Rust | REST, gRPC | Vector search (semantic), filtering | Apache 2.0 |
96-| **Vespa** | Java | REST + Vespa‑QL | Big data search & analytics, scalable | Apache 2.0 |
97-
98-> **Quick‑setup** – Meilisearch is probably the easiest to spin up with Docker or directly from the binary.
99-
100-```bash
101-# Docker
102-docker run -it --rm -p 7700:7700 \
103- -e MEILI_MASTER_KEY=masterKey \
104- getmeili/meilisearch:v1.4
105-```
106-
107-Once it’s running you can query it exactly like any other search API:
108-
109-```python
110-def meilisearch_query(q, limit=10):
111- r = requests.get(
112- "http://localhost:7700/search",
113- params={"q": q, "limit": limit},
114- headers={"Authorization": "Bearer masterKey"},
115- timeout=10
116- )
117- return r.json() # contains hits[], total, etc.
118-```
119-
120-> **Use‑case:** Index your code base, knowledge base, or product docs; let your GPT‑style assistant read that index for “up‑to‑date”
121-answers *within your own data*.
122-
123----
124-
125-## 3️⃣ Build a Crawler + Indexer (Open Source)
126-
127-Sometimes you want *both* crawling the web and indexing it yourself. The community has a few great stacks:
128-
129-| Stack | What it does | How to get started | Link |
130-|-------|--------------|--------------------|------|
131-| **Scrapy + Whoosh** | Crawl pages → index in Whoosh | Python‑only, great for small sites | <https://scrapy.org>, <https://whoosh.readthedocs.io> |
132-| **Apache Nutch** | Handles large‑scale crawling & indexing | Apache Hadoop integration | <https://nutch.apache.org> |
133-| **Elastic + Logstash** | Crawl with Scrapy → Logstash → Elasticsearch | Full pipeline | <https://www.elastic.co/what-is/elastic-stack> |
134-
135-> If you need a quick prototype, just `pip install scrapy` and start a crawler; the output can feed into Meilisearch or Typesense.
136-
137----
138-
139-## 3️⃣ Which Path Should You Pick?
140-
141-| Scenario | Recommendation |
142-|----------|----------------|
143-| **You only need "answers from the public web"** | Start with DuckDuckGo. Add a simple wrapper and you're done. |
144-| **You need to respect a strict free‑quota policy** | Use Google CSE (100/day) or SerpAPI (10/day). If you hit the quota, consider DuckDuckGo + a local cache. |
145-| **You want to index internal docs** | Meilisearch (zero‑config, typo‑tolerance) is the quickest. |
146-| **You need enterprise‑grade analytics or distributed indexing** | ElasticSearch OSS + Kibana or Vespa. |
147-| **You want vector‑search / semantic search** | Qdrant or Typesense + custom embeddings. |
148-
149----
150-
151-## 4️⃣ Plugging a Free/OSS Search API into GPT‑Prompting
152-
153-Below is a *minimal* full‑stack example that works with **DuckDuckGo** (free, no key) and shows how to use it inside a prompt for a
154-GPT‑style assistant.
155-
156-```python
157-import json
158-import requests
159-
160-# 1️⃣ DuckDuckGo wrapper (you can also use the above `duckduckgo_search` function)
161-def search_web(query: str):
162- return duckduckgo_search(query, max_results=5)
163-
164-# 2️⃣ Build a prompt that includes results
165-def gpt_prompt_with_web_results(question: str):
166- results = search_web(question)
167- # format results as a simple string
168- results_text = "\n".join(
169- f"{i+1}. {r['title']}\n {r['snippet']}\n {r['url']}"
170- for i, r in enumerate(results)
171- )
172- prompt = f"""I need up‑to‑date information to answer the following question:
173-
174-**Question:** {question}
175-
176-**Web results** (first 5, if any):
177-{results_text}
178-
179-Please provide a concise, accurate answer."""
180-
181- # 3️⃣ Ask GPT (use the same wrapper you used before)
182- openai_response = client.chat.completions.create(
183- model="gpt-4o-mini",
184- messages=[{"role":"user","content":prompt}],
185- temperature=0.2,
186- )
187- return openai_response.choices[0].message.content.strip()
188-```
189-
190-> Just call `gpt_prompt_with_web_results("What is the latest on climate policy in the EU?")`.
191-
192----
193-
194-## 5️⃣ Staying Within the Free‑Tier Limits
195-
196-| What to Watch | How to Implement |
197-|---------------|-----------------|
198-| **Rate‑limit headers** | `requests` can read them (e.g., `X-Search-Quota-Remaining`). Implement exponential back‑off on 429 responses. |
199-| **Cache** | `functools.lru_cache` or a simple `dict` with expiry. Avoid hitting the API twice for the same query. |
200-| **Batching** | If you need several queries at once, queue them and use `asyncio.gather`. |
201-
202----
203-
204-## Bottom Line
205-
206-- **If you only need “search the web”**: DuckDuckGo is free and requires no key; Google CSE gives you a small free quota; Bing & SerpAPI
207-are alternatives with slightly higher limits but do need keys.
208-- **If you want full control**: Meilisearch or Typesense let you run a tiny, production‑ready search engine on a single laptop or a
209-private VM.
210-- **If you need deep crawling & indexing**: Scrapy + Whoosh or ElasticSearch + Logstash give you the classic “crawl‑index‑search”
211-pipeline.
212-
213-Pick the one that fits your *data source* (public web vs. your own documents) and *budget* (unlimited free key vs. limited free tier).
214-If you need help writing the exact wrapper for the service you choose, just tell me which one and I’ll add the code. Happy searching! 🚀
_planning/search.md+0−239
@@ -1,239 +0,0 @@
1->>> I'd like to give you web search capabilities, so you can always get the latest and greatest
2-Thinking...
3-The user wants to give web search capabilities. They want to be able to get latest info. They are asking how to do that. So we need to
4-explain that GPT can't browse by default; but we can integrate external search APIs or use a tool like SerpAPI, Bing Search API, or use
5-custom code to fetch results and feed to me. We should explain steps: choose a search API, write wrapper, feed results to me as context.
6-Also can use plugin or chain of tools approach: build a tool that takes query, returns results, then feed to the model. We need to
7-explain how to do it in different contexts: for example, in local deployment, you can create a wrapper that calls the search API, then
8-provide the results to the model. Also mention safety, privacy, cost. Provide example code in Python, maybe using LangChain, or just
9-plain request. Provide an example with OpenAI API call and a function. Provide also mention that the model can be used in a tool‑chain
10-environment. Also note that this is a separate step. Provide step-by-step instructions. Also mention that you can use search plugins.
11-Provide an example of a function call. Also ask for specifics: what platform? Are they using openai? Provide guidance.
12-
13-Let's produce a thorough answer.
14-...done thinking.
15-
16-### Quick answer
17-**You can’t give me “live‑web browsing” inside the model itself,** but you can let your application fetch the information you need (via
18-an API, a web‑scraper, or a search‑engine provider) and then feed that text into the model as part of the conversation.
19-
20-Below is a “tool‑chain” pattern that works with a locally‑hosted model (or the OpenAI API) and any search‑engine API you choose. It
21-covers everything you need:
22-
23-| Step | What you need | Example tools / code |
24-|------|---------------|----------------------|
25-| 1️⃣ | Choose a search source | • **Bing Search API** (Azure) <br>• **SerpAPI** <br>• **Google Custom Search JSON API** <br>• Your
26-own crawler (`requests`, `beautifulsoup`, `scrapy`) |
27-| 2️⃣ | Write a small wrapper that returns plain‑text or JSON | Python `requests` function |
28-| 3️⃣ | Feed the search results into the LLM as context | • Add to the prompt (`"Here are the latest results …"`) <br>• Or use a *tool*
29-that the model calls via function‑calling / LangChain |
30-| 4️⃣ | (Optional) Cache / dedupe results | Store a cache of queries & snippets to avoid repeated API calls |
31-| 5️⃣ | Handle privacy / usage limits | Keep API keys secret, monitor quota, obey TOS |
32-
33-Below is a **minimal end‑to‑end example** that uses:
34-
35-* Python 3.10+
36-* `requests` to call **Bing Search API** (you can swap the API later)
37-* The **OpenAI** Python SDK (or your own local model call)
38-* LangChain‑style tool‑calling (optional)
39-
40-> **NOTE:** If you’re running a local model (e.g., GPT‑4‑Base via `vllm`), just skip the OpenAI SDK part and call your local inference
41-function instead.
42-
43----
44-
45-## 1️⃣ Pick a Search API
46-
47-| API | Cost | Key features |
48-|-----|------|--------------|
49-| **Bing Search v7** (Azure) | Pay‑per‑request ($0.0015 / 10 queries) | Structured JSON, image, news, etc. |
50-| **SerpAPI** | $2.5–$5 / 100 queries | Google, Bing, DuckDuckGo, etc. |
51-| **Google Custom Search JSON API** | $5 / 100 queries | Google‑indexed content |
52-| **Custom crawler** | Free (your compute) | Full control, no quotas |
53-
54-> **Tip:** If you only need quick news headlines, Bing or SerpAPI are the simplest to set up.
55-
56----
57-
58-## 2️⃣ Wrapper to Get Search Results
59-
60-```python
61-import os
62-import json
63-import requests
64-from typing import List
65-
66-# ---- Configuration ----
67-BING_ENDPOINT = "https://api.bing.microsoft.com/v7.0/search"
68-BING_API_KEY = os.getenv("BING_API_KEY") # <-- set this
69-
70-def bing_search(query: str, count: int = 5, **kwargs) -> List[dict]:
71- """
72- Simple wrapper around Bing Search API.
73- Returns a list of dicts: {"title": ..., "snippet": ..., "url": ...}
74- """
75- params = {
76- "q": query,
77- "count": count,
78- "textDecorations": "false",
79- "textFormat": "raw",
80- **kwargs,
81- }
82- headers = {"Ocp-Apim-Subscription-Key": BING_API_KEY}
83- resp = requests.get(BING_ENDPOINT, headers=headers, params=params, timeout=10)
84- resp.raise_for_status()
85- data = resp.json()
86-
87- results = []
88- for item in data.get("webPages", {}).get("value", []):
89- results.append({
90- "title": item.get("name"),
91- "snippet": item.get("snippet"),
92- "url": item.get("url"),
93- })
94- return results
95-```
96-
97-*Replace `BING_API_KEY` with your own key (or the key for whatever API you choose).*
98-
99----
100-
101-## 3️⃣ Feed Into the LLM
102-
103-### Option A – Plain Prompt Augmentation
104-
105-```python
106-from openai import OpenAI
107-
108-client = OpenAI()
109-
110-def ask_with_web(query: str) -> str:
111- # 1. Get results
112- results = bing_search(query, count=3)
113-
114- # 2. Build a short context
115- context = "\n".join(
116- f"{i+1}. {r['title']}\n {r['snippet']}\n {r['url']}"
117- for i, r in enumerate(results)
118- )
119-
120- # 3. Create the prompt
121- prompt = (
122- "You are an assistant that can browse the web. "
123- "You will first look up recent information and then answer the user.\n\n"
124- f"Web search results for: {query}\n{context}\n\n"
125- f"Now answer the question: {query}"
126- )
127-
128- # 4. Call the model
129- response = client.chat.completions.create(
130- model="gpt-4o-mini", # or your local model name
131- messages=[{"role": "user", "content": prompt}],
132- temperature=0.2,
133- )
134- return response.choices[0].message.content.strip()
135-```
136-
137-### Option B – Function Calling (Tool)
138-
139-If you’re using OpenAI’s function calling or LangChain’s `Tool` abstraction, you can let the model *choose* when to call the search:
140-
141-```python
142-from openai import OpenAI
143-
144-client = OpenAI()
145-
146-def search_tool(query: str):
147- results = bing_search(query, count=3)
148- return json.dumps(results)
149-
150-functions = [
151- {
152- "name": "search_web",
153- "description": "Search the web for up‑to‑date info",
154- "parameters": {
155- "type": "object",
156- "properties": {
157- "query": {"type": "string", "description": "Search query"},
158- },
159- "required": ["query"],
160- },
161- }
162-]
163-
164-def chat_with_function_calling(query: str):
165- messages = [{"role": "user", "content": query}]
166-
167- while True:
168- response = client.chat.completions.create(
169- model="gpt-4o-mini",
170- messages=messages,
171- functions=functions,
172- function_call="auto",
173- temperature=0.2,
174- )
175- message = response.choices[0].message
176-
177- if message.get("function_call"):
178- # We have a function call: execute it
179- func_name = message["function_call"]["name"]
180- arguments = json.loads(message["function_call"]["arguments"])
181-
182- if func_name == "search_web":
183- # call our wrapper
184- tool_response = search_tool(arguments["query"])
185- # feed back to the model
186- messages.append(message) # function call
187- messages.append(
188- {"role": "tool", "name": func_name, "content": tool_response}
189- )
190- continue # let the model react to tool output
191- else:
192- # normal chat completion
193- return message.content
194-```
195-
196-*The `function_call="auto"` lets the model decide when to call `search_web`. The wrapper returns raw JSON, which we feed back to the
197-model as a tool response.*
198-
199----
200-
201-## 4️⃣ Caching (Optional but Recommended)
202-
203-If you’ll be re‑querying the same terms, use a simple LRU cache:
204-
205-```python
206-from functools import lru_cache
207-
208-@lru_cache(maxsize=128)
209-def cached_bing_search(query: str, count: int = 5) -> List[dict]:
210- return bing_search(query, count)
211-```
212-
213-Just replace calls to `bing_search` with `cached_bing_search`.
214-
215----
216-
217-## 5️⃣ Security & TOS
218-
219-| Concern | How to handle |
220-|---------|---------------|
221-| **API key exposure** | Store keys in `.env` or a secrets manager. Don’t commit to repo. |
222-| **Rate limits** | Monitor `X-RateLimit-Remaining` headers; implement back‑off. |
223-| **Privacy** | If you send sensitive queries to a third‑party API, consider data‑handling policy. |
224-| **License** | Each API has its own TOS; make sure you’re compliant with “embedding” usage. |
225-
226----
227-
228-## Recap
229-
230-1. **Choose** a web‑search provider (Bing, SerpAPI, etc.).
231-2. **Wrap** the provider’s API in a function that returns a clean list of results.
232-3. **Inject** those results into the prompt (or expose the function to the model via tool calling).
233-4. **Optionally cache** queries to avoid duplicate API calls.
234-5. **Protect** your keys and respect usage limits.
235-
236-You’re now ready to have the model answer *up‑to‑date* queries without hard‑coding the data! If you need help wiring this into a
237-particular framework (FastAPI, Streamlit, LangChain, or even a simple CLI), let me know and I can write a snippet that fits your stack.
238-Happy
239- building! 🚀
drizzle.config.ts+19−0
@@ -0,0 +1,19 @@
1+import type { Config } from "drizzle-kit";
2+import { existsSync, mkdirSync } from "fs";
3+import { join } from "path";
4+
5+// Ensure data directory exists
6+const dataDir = join(process.cwd(), "data");
7+if (!existsSync(dataDir)) {
8+ mkdirSync(dataDir, { recursive: true });
9+}
10+
11+export default {
12+ schema: "./src/lib/db/schema.ts",
13+ out: "./drizzle",
14+ dialect: "sqlite",
15+ dbCredentials: {
16+ url: "./data/database.db",
17+ },
18+} satisfies Config;
19+
package-lock.json+1477−26
@@ -9,6 +9,9 @@
99 "version": "0.1.0",
1010 "dependencies": {
1111 "autoprefixer": "^10.4.17",
12+ "better-sqlite3": "^12.5.0",
13+ "drizzle-kit": "^0.31.8",
14+ "drizzle-orm": "^0.45.1",
1215 "highlight.js": "^11.11.1",
1316 "next": "^16.0.10",
1417 "ollama": "^0.6.3",
@@ -22,6 +25,7 @@
2225 "typescript": "^5.4.2"
2326 },
2427 "devDependencies": {
28+ "@types/better-sqlite3": "^7.6.13",
2529 "@types/node": "^20.11.18",
2630 "@types/react": "^18.2.55",
2731 "@types/react-dom": "^18.2.19",
@@ -41,6 +45,12 @@
4145 "url": "https://github.com/sponsors/sindresorhus"
4246 }
4347 },
48+ "node_modules/@drizzle-team/brocli": {
49+ "version": "0.10.2",
50+ "resolved": "https://registry.npmjs.org/@drizzle-team/brocli/-/brocli-0.10.2.tgz",
51+ "integrity": "sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w==",
52+ "license": "Apache-2.0"
53+ },
4454 "node_modules/@emnapi/core": {
4555 "version": "1.7.1",
4656 "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.7.1.tgz",
@@ -48,30 +58,857 @@
4858 "dev": true,
4959 "license": "MIT",
5060 "optional": true,
51- "dependencies": {
52- "@emnapi/wasi-threads": "1.1.0",
53- "tslib": "^2.4.0"
61+ "dependencies": {
62+ "@emnapi/wasi-threads": "1.1.0",
63+ "tslib": "^2.4.0"
64+ }
65+ },
66+ "node_modules/@emnapi/runtime": {
67+ "version": "1.7.1",
68+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.7.1.tgz",
69+ "integrity": "sha512-PVtJr5CmLwYAU9PZDMITZoR5iAOShYREoR45EyyLrbntV50mdePTgUn4AmOw90Ifcj+x2kRjdzr1HP3RrNiHGA==",
70+ "license": "MIT",
71+ "optional": true,
72+ "dependencies": {
73+ "tslib": "^2.4.0"
74+ }
75+ },
76+ "node_modules/@emnapi/wasi-threads": {
77+ "version": "1.1.0",
78+ "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.1.0.tgz",
79+ "integrity": "sha512-WI0DdZ8xFSbgMjR1sFsKABJ/C5OnRrjT06JXbZKexJGrDuPTzZdDYfFlsgcCXCyf+suG5QU2e/y1Wo2V/OapLQ==",
80+ "dev": true,
81+ "license": "MIT",
82+ "optional": true,
83+ "dependencies": {
84+ "tslib": "^2.4.0"
85+ }
86+ },
87+ "node_modules/@esbuild-kit/core-utils": {
88+ "version": "3.3.2",
89+ "resolved": "https://registry.npmjs.org/@esbuild-kit/core-utils/-/core-utils-3.3.2.tgz",
90+ "integrity": "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ==",
91+ "deprecated": "Merged into tsx: https://tsx.is",
92+ "license": "MIT",
93+ "dependencies": {
94+ "esbuild": "~0.18.20",
95+ "source-map-support": "^0.5.21"
96+ }
97+ },
98+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm": {
99+ "version": "0.18.20",
100+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz",
101+ "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==",
102+ "cpu": [
103+ "arm"
104+ ],
105+ "license": "MIT",
106+ "optional": true,
107+ "os": [
108+ "android"
109+ ],
110+ "engines": {
111+ "node": ">=12"
112+ }
113+ },
114+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-arm64": {
115+ "version": "0.18.20",
116+ "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz",
117+ "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==",
118+ "cpu": [
119+ "arm64"
120+ ],
121+ "license": "MIT",
122+ "optional": true,
123+ "os": [
124+ "android"
125+ ],
126+ "engines": {
127+ "node": ">=12"
128+ }
129+ },
130+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/android-x64": {
131+ "version": "0.18.20",
132+ "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz",
133+ "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==",
134+ "cpu": [
135+ "x64"
136+ ],
137+ "license": "MIT",
138+ "optional": true,
139+ "os": [
140+ "android"
141+ ],
142+ "engines": {
143+ "node": ">=12"
144+ }
145+ },
146+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-arm64": {
147+ "version": "0.18.20",
148+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz",
149+ "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==",
150+ "cpu": [
151+ "arm64"
152+ ],
153+ "license": "MIT",
154+ "optional": true,
155+ "os": [
156+ "darwin"
157+ ],
158+ "engines": {
159+ "node": ">=12"
160+ }
161+ },
162+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/darwin-x64": {
163+ "version": "0.18.20",
164+ "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz",
165+ "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==",
166+ "cpu": [
167+ "x64"
168+ ],
169+ "license": "MIT",
170+ "optional": true,
171+ "os": [
172+ "darwin"
173+ ],
174+ "engines": {
175+ "node": ">=12"
176+ }
177+ },
178+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-arm64": {
179+ "version": "0.18.20",
180+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz",
181+ "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==",
182+ "cpu": [
183+ "arm64"
184+ ],
185+ "license": "MIT",
186+ "optional": true,
187+ "os": [
188+ "freebsd"
189+ ],
190+ "engines": {
191+ "node": ">=12"
192+ }
193+ },
194+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/freebsd-x64": {
195+ "version": "0.18.20",
196+ "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz",
197+ "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==",
198+ "cpu": [
199+ "x64"
200+ ],
201+ "license": "MIT",
202+ "optional": true,
203+ "os": [
204+ "freebsd"
205+ ],
206+ "engines": {
207+ "node": ">=12"
208+ }
209+ },
210+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm": {
211+ "version": "0.18.20",
212+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz",
213+ "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==",
214+ "cpu": [
215+ "arm"
216+ ],
217+ "license": "MIT",
218+ "optional": true,
219+ "os": [
220+ "linux"
221+ ],
222+ "engines": {
223+ "node": ">=12"
224+ }
225+ },
226+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-arm64": {
227+ "version": "0.18.20",
228+ "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz",
229+ "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==",
230+ "cpu": [
231+ "arm64"
232+ ],
233+ "license": "MIT",
234+ "optional": true,
235+ "os": [
236+ "linux"
237+ ],
238+ "engines": {
239+ "node": ">=12"
240+ }
241+ },
242+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ia32": {
243+ "version": "0.18.20",
244+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz",
245+ "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==",
246+ "cpu": [
247+ "ia32"
248+ ],
249+ "license": "MIT",
250+ "optional": true,
251+ "os": [
252+ "linux"
253+ ],
254+ "engines": {
255+ "node": ">=12"
256+ }
257+ },
258+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-loong64": {
259+ "version": "0.18.20",
260+ "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz",
261+ "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==",
262+ "cpu": [
263+ "loong64"
264+ ],
265+ "license": "MIT",
266+ "optional": true,
267+ "os": [
268+ "linux"
269+ ],
270+ "engines": {
271+ "node": ">=12"
272+ }
273+ },
274+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-mips64el": {
275+ "version": "0.18.20",
276+ "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz",
277+ "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==",
278+ "cpu": [
279+ "mips64el"
280+ ],
281+ "license": "MIT",
282+ "optional": true,
283+ "os": [
284+ "linux"
285+ ],
286+ "engines": {
287+ "node": ">=12"
288+ }
289+ },
290+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-ppc64": {
291+ "version": "0.18.20",
292+ "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz",
293+ "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==",
294+ "cpu": [
295+ "ppc64"
296+ ],
297+ "license": "MIT",
298+ "optional": true,
299+ "os": [
300+ "linux"
301+ ],
302+ "engines": {
303+ "node": ">=12"
304+ }
305+ },
306+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-riscv64": {
307+ "version": "0.18.20",
308+ "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz",
309+ "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==",
310+ "cpu": [
311+ "riscv64"
312+ ],
313+ "license": "MIT",
314+ "optional": true,
315+ "os": [
316+ "linux"
317+ ],
318+ "engines": {
319+ "node": ">=12"
320+ }
321+ },
322+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-s390x": {
323+ "version": "0.18.20",
324+ "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz",
325+ "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==",
326+ "cpu": [
327+ "s390x"
328+ ],
329+ "license": "MIT",
330+ "optional": true,
331+ "os": [
332+ "linux"
333+ ],
334+ "engines": {
335+ "node": ">=12"
336+ }
337+ },
338+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/linux-x64": {
339+ "version": "0.18.20",
340+ "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz",
341+ "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==",
342+ "cpu": [
343+ "x64"
344+ ],
345+ "license": "MIT",
346+ "optional": true,
347+ "os": [
348+ "linux"
349+ ],
350+ "engines": {
351+ "node": ">=12"
352+ }
353+ },
354+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/netbsd-x64": {
355+ "version": "0.18.20",
356+ "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz",
357+ "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==",
358+ "cpu": [
359+ "x64"
360+ ],
361+ "license": "MIT",
362+ "optional": true,
363+ "os": [
364+ "netbsd"
365+ ],
366+ "engines": {
367+ "node": ">=12"
368+ }
369+ },
370+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/openbsd-x64": {
371+ "version": "0.18.20",
372+ "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz",
373+ "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==",
374+ "cpu": [
375+ "x64"
376+ ],
377+ "license": "MIT",
378+ "optional": true,
379+ "os": [
380+ "openbsd"
381+ ],
382+ "engines": {
383+ "node": ">=12"
384+ }
385+ },
386+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/sunos-x64": {
387+ "version": "0.18.20",
388+ "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz",
389+ "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==",
390+ "cpu": [
391+ "x64"
392+ ],
393+ "license": "MIT",
394+ "optional": true,
395+ "os": [
396+ "sunos"
397+ ],
398+ "engines": {
399+ "node": ">=12"
400+ }
401+ },
402+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-arm64": {
403+ "version": "0.18.20",
404+ "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz",
405+ "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==",
406+ "cpu": [
407+ "arm64"
408+ ],
409+ "license": "MIT",
410+ "optional": true,
411+ "os": [
412+ "win32"
413+ ],
414+ "engines": {
415+ "node": ">=12"
416+ }
417+ },
418+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-ia32": {
419+ "version": "0.18.20",
420+ "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz",
421+ "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==",
422+ "cpu": [
423+ "ia32"
424+ ],
425+ "license": "MIT",
426+ "optional": true,
427+ "os": [
428+ "win32"
429+ ],
430+ "engines": {
431+ "node": ">=12"
432+ }
433+ },
434+ "node_modules/@esbuild-kit/core-utils/node_modules/@esbuild/win32-x64": {
435+ "version": "0.18.20",
436+ "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz",
437+ "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==",
438+ "cpu": [
439+ "x64"
440+ ],
441+ "license": "MIT",
442+ "optional": true,
443+ "os": [
444+ "win32"
445+ ],
446+ "engines": {
447+ "node": ">=12"
448+ }
449+ },
450+ "node_modules/@esbuild-kit/core-utils/node_modules/esbuild": {
451+ "version": "0.18.20",
452+ "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz",
453+ "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==",
454+ "hasInstallScript": true,
455+ "license": "MIT",
456+ "bin": {
457+ "esbuild": "bin/esbuild"
458+ },
459+ "engines": {
460+ "node": ">=12"
461+ },
462+ "optionalDependencies": {
463+ "@esbuild/android-arm": "0.18.20",
464+ "@esbuild/android-arm64": "0.18.20",
465+ "@esbuild/android-x64": "0.18.20",
466+ "@esbuild/darwin-arm64": "0.18.20",
467+ "@esbuild/darwin-x64": "0.18.20",
468+ "@esbuild/freebsd-arm64": "0.18.20",
469+ "@esbuild/freebsd-x64": "0.18.20",
470+ "@esbuild/linux-arm": "0.18.20",
471+ "@esbuild/linux-arm64": "0.18.20",
472+ "@esbuild/linux-ia32": "0.18.20",
473+ "@esbuild/linux-loong64": "0.18.20",
474+ "@esbuild/linux-mips64el": "0.18.20",
475+ "@esbuild/linux-ppc64": "0.18.20",
476+ "@esbuild/linux-riscv64": "0.18.20",
477+ "@esbuild/linux-s390x": "0.18.20",
478+ "@esbuild/linux-x64": "0.18.20",
479+ "@esbuild/netbsd-x64": "0.18.20",
480+ "@esbuild/openbsd-x64": "0.18.20",
481+ "@esbuild/sunos-x64": "0.18.20",
482+ "@esbuild/win32-arm64": "0.18.20",
483+ "@esbuild/win32-ia32": "0.18.20",
484+ "@esbuild/win32-x64": "0.18.20"
485+ }
486+ },
487+ "node_modules/@esbuild-kit/esm-loader": {
488+ "version": "2.6.5",
489+ "resolved": "https://registry.npmjs.org/@esbuild-kit/esm-loader/-/esm-loader-2.6.5.tgz",
490+ "integrity": "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA==",
491+ "deprecated": "Merged into tsx: https://tsx.is",
492+ "license": "MIT",
493+ "dependencies": {
494+ "@esbuild-kit/core-utils": "^3.3.2",
495+ "get-tsconfig": "^4.7.0"
496+ }
497+ },
498+ "node_modules/@esbuild/aix-ppc64": {
499+ "version": "0.25.12",
500+ "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
501+ "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==",
502+ "cpu": [
503+ "ppc64"
504+ ],
505+ "license": "MIT",
506+ "optional": true,
507+ "os": [
508+ "aix"
Cut short: this commit's diff is over 1000 lines.
package.json+8−1
Cut short: this commit's diff is over 1000 lines.
src/lib/db/index.ts+29−0
Cut short: this commit's diff is over 1000 lines.
src/lib/db/schema.ts+37−0
Cut short: this commit's diff is over 1000 lines.