Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 50 additions & 50 deletions .zed/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,58 @@
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"lsp": {
"deno": {
"settings": {
"lsp": {
"deno": {
"enable": true,
"settings": {
"deno": {
"enable": true
}
}
},
},
"json-language-server": {
"settings": {
"json": {
"schemas": [
{
"fileMatch": ["deno.json", "deno.jsonc"],
"url": "https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/schemas/config-file.v1.json"
},
{
"fileMatch": ["package.json"],
"url": "https://www.schemastore.org/package"
}
]
}
}
}
},
"json-language-server": {
"settings": {
"json": {
"schemas": [
{
"fileMatch": ["deno.json", "deno.jsonc"],
"url": "https://raw.githubusercontent.com/denoland/deno/refs/heads/main/cli/schemas/config-file.v1.json",
},
{
"fileMatch": ["package.json"],
"url": "https://www.schemastore.org/package",
},
],
"languages": {
"JavaScript": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint"
],
"formatter": "language_server"
},
},
},
},
"languages": {
"JavaScript": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint",
],
"formatter": "language_server",
},
"TypeScript": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint",
],
"formatter": "language_server",
},
"TSX": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint",
],
"formatter": "language_server",
},
},
"TypeScript": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint"
],
"formatter": "language_server"
},
"TSX": {
"language_servers": [
"deno",
"!typescript-language-server",
"!vtsls",
"!eslint"
],
"formatter": "language_server"
}
}
}
5 changes: 5 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# AGENTS.md

Deno-first monorepo with:

- root app (`main.ts`, `lib/`, `scripts/`)
- widget app (`widget/`, Svelte 5 + Vite)

## Root Commands (run from repo root)

- Typecheck: `deno check --allow-import main.ts`
- Lint: `deno lint`
- Format check: `deno fmt --check`
Expand All @@ -17,6 +19,7 @@ Deno-first monorepo with:
- Build widget assets: `scripts/build-widget.bash`

## Widget Commands (run from `widget/`)

- Dev server: `deno task dev` (long-running)
- Typecheck: `deno task check`
- Lint: `deno task lint`
Expand All @@ -26,12 +29,14 @@ Deno-first monorepo with:
- Preview: `deno task preview` (long-running)

## Verification Order

1. Typecheck
2. Lint
3. Tests
4. Build (if relevant)

Minimum gates:

- Root-only: `deno check --allow-import main.ts` + `deno lint` + `AI_TOKEN="test" deno test -A`
- Widget-only: `deno task check` + `deno task lint` + `deno task build`

Expand Down
13 changes: 11 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
# Don't be a Dick Code of Conduct

## Introduction

In the interest of simplifying the typical process of determining what a proper Code of Conduct should consist of, I've come up with the simplest, clearest, and most concise Code of Conduct ever. It is licensed under the "Do What The Fuck You Want To" Public License.

## Full Text of the Code of Conduct

The full text of the Don't be a Dick Code of Conduct is as follows:

> If at anytime you choose to do something that a rational person of average intelligence could reasonably consider your actions as "Being a dick", you are in violation of this code of conduct.

## Potential Questions and Concerns

### Is this a joke?

No.

### This doesn't codify the differences between proper and improper conduct
Yes it does. Let's face it, people that harass others know they're being dicks. Everyone in modern society has heard of the Golden Rule. There's a version of the Golden Rule in every major religion and therefore exists as common knowledge in every modern society in the World. *People know what dickish behavior is* even if they don't want to admit it.

Yes it does. Let's face it, people that harass others know they're being dicks. Everyone in modern society has heard of the Golden Rule. There's a version of the Golden Rule in every major religion and therefore exists as common knowledge in every modern society in the World. _People know what dickish behavior is_ even if they don't want to admit it.

### I think you're making light of codes of conduct
Absolutely not. But I guess I am making light of the bikeshedding that takes place when considering codes of conduct. Instead of arguing over and over about what should or should not exist in a Code of Conduct, we should trust that people understand when they're being a dick or not. If someone violates the Code of Conduct, boot them without prejudice. Boot them with zero tolerance. Boot them from your conference/ project/ workplace/ whatever and move on.

Absolutely not. But I guess I am making light of the bikeshedding that takes place when considering codes of conduct. Instead of arguing over and over about what should or should not exist in a Code of Conduct, we should trust that people understand when they're being a dick or not. If someone violates the Code of Conduct, boot them without prejudice. Boot them with zero tolerance. Boot them from your conference/ project/ workplace/ whatever and move on.

### How do I enforce this Code of Conduct?

Have some guts and do it. Verify the complaint. Determine if you think the accused person has been a dick. Then, confront the person, tell them they're a dick and that they need to go away.

### I don't believe in Codes of Conduct. They're for wimps and whiners

Then you're a dick.

## How to Use This CoC in Your Project

If you'd like to use the "Don't Be a Dick" Code of Conduct in your own project, you can do so by copying the contents of [the Code of Conduct](https://github.com/karlgroves/dontbeadick?tab=readme-ov-file#full-text-of-the-code-of-conduct) into a `CODE_OF_CONDUCT.md` file in the root of your repository. You may also link back to this repository as the source.

## Contributor Guidelines

All contributors are expected to adhere to the [Don't Be a Dick Code of Conduct](https://github.com/karlgroves/dontbeadick?tab=readme-ov-file#full-text-of-the-code-of-conduct). Please read it before participating in discussions, opening issues, or submitting pull requests.
106 changes: 53 additions & 53 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
{
"compilerOptions": {
"strict": true
},
"lint": {
"include": [
"*.ts",
"lib/"
],
"rules": {
"tags": [
"recommended"
]
"compilerOptions": {
"strict": true
},
"lint": {
"include": [
"*.ts",
"lib/"
],
"rules": {
"tags": [
"recommended"
]
}
},
"fmt": {
"include": [
"*.ts",
"lib/"
],
"useTabs": false,
"lineWidth": 80,
"indentWidth": 4,
"semiColons": true,
"singleQuote": true,
"proseWrap": "preserve"
},
"nodeModulesDir": "auto",
"imports": {
"@google/genai": "npm:@google/genai@^1.44.0",
"@opentelemetry/auto-instrumentations-node": "npm:@opentelemetry/auto-instrumentations-node@^0.71.0",
"@opentelemetry/sdk-node": "npm:@opentelemetry/sdk-node@^0.213.0",
"@std/assert": "jsr:@std/assert@^1.0.19",
"@std/encoding": "jsr:@std/encoding@^1.0.10",
"@std/fs": "jsr:@std/fs@^1.0.23",
"ai": "npm:ai@^6.0.116",
"@ai-sdk/google": "npm:@ai-sdk/google@^3.0.43",
"@ai-sdk/openai-compatible": "npm:@ai-sdk/openai-compatible@^2.0.35",
"@libsql/client": "npm:@libsql/client@^0.17.0",
"@deno-library/logger": "jsr:@deno-library/logger@^1.2.0",
"drizzle-kit": "npm:drizzle-kit@^0.31.9",
"drizzle-orm": "npm:drizzle-orm@^0.45.1",
"grammy": "https://deno.land/x/grammy@v1.38.2/mod.ts",
"@grammyjs/runner": "https://deno.land/x/grammy_runner@v2.0.3/mod.ts",
"grammy_types": "https://deno.land/x/grammy_types@v3.21.0/mod.ts",
"isomorphic-dompurify": "npm:isomorphic-dompurify@^3.0.0",
"ky": "npm:ky@^1.14.3",
"grammy_ratelimiter": "https://deno.land/x/grammy_ratelimiter@v1.2.1/mod.ts",
"@grammyjs/i18n": "https://deno.land/x/grammy_i18n@v1.1.0/mod.ts",
"langfuse-vercel": "npm:langfuse-vercel@^3.38.6",
"remark-html": "npm:remark-html@^16.0.1",
"remark-parse": "npm:remark-parse@^11.0.0",
"unified": "npm:unified@^11.0.5",
"zod": "npm:zod@^4.3.6"
}
},
"fmt": {
"include": [
"*.ts",
"lib/"
],
"useTabs": false,
"lineWidth": 80,
"indentWidth": 4,
"semiColons": true,
"singleQuote": true,
"proseWrap": "preserve"
},
"nodeModulesDir": "auto",
"imports": {
"@google/genai": "npm:@google/genai@^1.44.0",
"@opentelemetry/auto-instrumentations-node": "npm:@opentelemetry/auto-instrumentations-node@^0.71.0",
"@opentelemetry/sdk-node": "npm:@opentelemetry/sdk-node@^0.213.0",
"@std/assert": "jsr:@std/assert@^1.0.19",
"@std/encoding": "jsr:@std/encoding@^1.0.10",
"@std/fs": "jsr:@std/fs@^1.0.23",
"ai": "npm:ai@^6.0.116",
"@ai-sdk/google": "npm:@ai-sdk/google@^3.0.43",
"@ai-sdk/openai-compatible": "npm:@ai-sdk/openai-compatible@^2.0.35",
"@libsql/client": "npm:@libsql/client@^0.17.0",
"@deno-library/logger": "jsr:@deno-library/logger@^1.2.0",
"drizzle-kit": "npm:drizzle-kit@^0.31.9",
"drizzle-orm": "npm:drizzle-orm@^0.45.1",
"grammy": "https://deno.land/x/grammy@v1.38.2/mod.ts",
"@grammyjs/runner": "https://deno.land/x/grammy_runner@v2.0.3/mod.ts",
"grammy_types": "https://deno.land/x/grammy_types@v3.21.0/mod.ts",
"isomorphic-dompurify": "npm:isomorphic-dompurify@^3.0.0",
"ky": "npm:ky@^1.14.3",
"grammy_ratelimiter": "https://deno.land/x/grammy_ratelimiter@v1.2.1/mod.ts",
"@grammyjs/i18n": "https://deno.land/x/grammy_i18n@v1.1.0/mod.ts",
"langfuse-vercel": "npm:langfuse-vercel@^3.38.6",
"remark-html": "npm:remark-html@^16.0.1",
"remark-parse": "npm:remark-parse@^11.0.0",
"unified": "npm:unified@^11.0.5",
"zod": "npm:zod@^4.3.6"
}
}
27 changes: 27 additions & 0 deletions drizzle/0005_history_v3_threads.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ALTER TABLE `chat_messages` ADD `thread_id` text;
--> statement-breakpoint
ALTER TABLE `chat_messages` ADD `thread_root_message_id` integer;
--> statement-breakpoint
ALTER TABLE `chat_messages` ADD `thread_parent_message_id` integer;
--> statement-breakpoint
ALTER TABLE `chat_messages` ADD `thread_source` text;
--> statement-breakpoint
UPDATE `chat_messages`
SET
`thread_parent_message_id` = `reply_to_id`,
`thread_root_message_id` = CASE
WHEN `reply_to_id` IS NOT NULL THEN `reply_to_id`
ELSE `message_id`
END,
`thread_id` = 'legacy:' || CAST(CASE
WHEN `reply_to_id` IS NOT NULL THEN `reply_to_id`
ELSE `message_id`
END AS text),
`thread_source` = CASE
WHEN `reply_to_id` IS NOT NULL THEN 'legacy_reply'
ELSE 'legacy_single'
END
WHERE `thread_id` IS NULL;
--> statement-breakpoint
CREATE INDEX `chat_messages_chat_id_thread_id_message_id_idx`
ON `chat_messages` (`chat_id`, `thread_id`, `message_id`);
7 changes: 7 additions & 0 deletions drizzle/meta/_journal.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
"when": 1772809200000,
"tag": "0004_fix_messages_to_pass",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1772895600000,
"tag": "0005_history_v3_threads",
"breakpoints": true
}
]
}
Loading