refactor(core): migrate to Bun and converge acquisition policies and Agent boundaries

This commit is contained in:
root committed 2026-10-13 14:37:03 +08:00
1 parent 3f1c6d02f6
commit 27c0f27434
268 files changed
+7468 -7852

No files matched your search

+2 -2
View File
@@ -3,7 +3,7 @@ import { fileURLToPath } from "node:url";
import { type Kysely, sql } from "kysely";
// 从已迁移的数据库反射出 src/types.ts:列类型 + CHECK (col in (...)) 枚举字面量联合。
// 迁移是唯一事实来源;改表后运行 `deno task gen:types`,测试会校验两者无漂移。
// 迁移是唯一事实来源;改表后运行 `bun run gen:types`,测试会校验两者无漂移。
interface ColumnInfo {
table_name: string;
@@ -77,7 +77,7 @@ export async function generateTypesSource(db: Kysely<any>): Promise<string> {
const out: string[] = [
"// 本文件由 scripts/gen-types.ts 从迁移后的数据库反射生成,请勿手改。",
"// 改表:新增迁移 → deno task db:migrate → deno task gen:types。",
"// 改表:新增迁移 → bun run db:migrate → bun run gen:types。",
"",
'import type { ColumnType, Generated, Insertable, Selectable, Updateable } from "kysely";',
"",
+1 -1
View File
@@ -1,4 +1,4 @@
// 用法:deno task gen:types —— 对 DATABASE_URL 的当前 schema 反射并重写 src/types.ts
// 用法:bun run gen:types —— 对 DATABASE_URL 的当前 schema 反射并重写 src/types.ts
import { writeFileSync } from "node:fs";
import { createDb } from "../src/index.ts";
import { formatWithBiome, generateTypesSource, TYPES_FILE } from "./gen-types-lib.ts";
+1 -1
View File
@@ -1,4 +1,4 @@
// 用法:deno task db:migrate / db:reset(= deno run -A --env-file=.env packages/db/scripts/migrate.ts latest|reset)
// 用法:bun run db:migrate / db:reset(= bun --env-file=.env packages/db/scripts/migrate.ts latest|reset)
import { createDb, migrateToLatest, resetSchema } from "../src/index.ts";
const cmd = process.argv[2] ?? "latest";