name = "arcrun-cypher-executor"
main = "src/index.ts"
compatibility_date = "2025-02-19"
compatibility_flags = ["nodejs_compat"]

# 測試環境不啟用 Service Binding（Miniflare 無法解析外部服務）

# 2026-06-04：移除 WASM_BUCKET R2 mock。R2 wasm 路徑已 dead，不再需要測試 mock。

# KV mock（BUILD-006）
[[kv_namespaces]]
binding = "EXEC_CONTEXT"
id = "test-exec-context"

[[kv_namespaces]]
binding = "WEBHOOKS"
id = "test-webhooks"

[[kv_namespaces]]
binding = "CREDENTIALS_KV"
id = "test-credentials-kv"

[[kv_namespaces]]
binding = "RECIPES"
id = "test-recipes"

# credential-store-migration T8/T9 測試用 D1 mock（Miniflare 本地 SQLite，非真實 leo21c D1；
# schema 由 tests/setup.ts 在測試啟動時建表，不用 migrations_dir——0002_credentials.sql 就一張表，
# 直接 exec 比接 migrations 機制簡單）
[[d1_databases]]
binding = "CREDENTIALS_DB"
database_name = "test-credentials-db"
database_id = "test-credentials-db-id"

[vars]
ENVIRONMENT = "test"
ENCRYPTION_KEY = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
