name = "arcrun-kbdb" main = "src/index.ts" compatibility_date = "2025-02-19" workers_dev = true compatibility_flags = ["nodejs_compat"] # KBDB Base — atomic universal table (SDD .agents/specs/arcrun/kbdb-base). # Base needs D1 ONLY (free, no credit card). embed module adds Vectorize+AI bindings # (optional, self-host opens it themselves). triplet is a separate repo. [[d1_databases]] binding = "DB" database_name = "arcrun-kbdb" database_id = "0c580910-e00b-4f8e-9c57-ac54ea52242f" # 官方 prod D1(arcrun-kbdb);self-hosted deploy.ts 會注入用戶自己的 id 覆蓋 [vars] ENVIRONMENT = "production" # ── Optional embed module (issue #7 / SDD T2.4) ──────────────────────────────── # Base 預設不開(free-tier 友善)。self-host 開語義查詢時,deploy.ts 偵測 config kbdb_embed:true # → 取消下面兩段註解(注入 active binding)並 `wrangler vectorize create arcrun-kbdb-embed # --dimensions=768 --metric=cosine`(bge-base-en-v1.5 = 768 維)。官方帳號同理由 deploy 注入。 # 沒有這兩個 binding 時,kbdb/src/embed.ts 的 embedEnabled() 回 false → 維持 LIKE keyword、API 不變。 # # [[vectorize]] # binding = "VECTORIZE" # index_name = "arcrun-kbdb-embed" # # [ai] # binding = "AI"