Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
name = "sync_service2"
main = "build/worker/shim.mjs"
compatibility_date = "2025-03-05"
[build]
command = "cargo install -q [email protected] --locked --force && worker-build --profile sync-service-release"
[observability.logs]
enabled = true
[observability.traces]
enabled = true
head_sampling_rate = 1
persist = true
# DEFAULT ENV -- Used in Local Development & Debugging Remote
[[d1_databases]]
binding = "USER_PEER_MAPPING"
migrations_dir = "./database/user-peer-mapping/migrations/"
database_name = "user-peer-mapping"
database_id = "85b0ffef-e625-4b67-8b3b-77f33fd38fd3"
[durable_objects]
bindings = [
{ name = "DOCUMENT_SYNC_SESSION", class_name = "DocumentSyncSession" },
]
[[r2_buckets]]
binding = "DOCUMENT_SNAPSHOT_BUCKET"
bucket_name = "document-snapshot-bucket-dev"
[vars]
INTERNAL_API_SECRET_KEY = "LOCAL_API_KEY"
SPS_URL = "http://localhost:8092"
DSS_URL = "http://localhost:8086"
DSS_INTERNAL_AUTH_KEY = "local"
LEXICAL_SERVICE_URL = "http://localhost:8096"
LEXICAL_SERVICE_AUTH_KEY = "local"
# Tags exported spans with deployment.environment=local, matching the
# Datadog agent's DD_ENV so the env:local trace/log views include them.
ENVIRONMENT = "local"
# Local jaeger/datadog-agent OTLP receiver (docker port-mapped to the host).
# Unset in deployed envs = trace and log export disabled.
OTEL_EXPORTER_OTLP_ENDPOINT = "http://localhost:4318"
[[kv_namespaces]]
binding = "DOCUMENT_VERSIONING_KV"
id = "3548ca6265c745e38cd504194aa6e887"
[[kv_namespaces]]
binding = "SNAPSHOT_STORE_KV"
id = "9beead2b7891492f82153d2354e64e92"
[[migrations]]
tag = "v1"
new_sqlite_classes = ["DocumentSyncSession"]
# PLAYGROUND ENV - Shared playground on real Cloudflare infrastructure
[env.playground]
name = "sync-service-playground"
[env.playground.vars]
INTERNAL_API_SECRET_KEY = "SYNC_SERVICE_KEY_PLAYGROUND"
DOCUMENT_PERMISSIONS_SECRET = "local"
ENVIRONMENT = "development"
SPS_URL = "https://dev-gateway.macro.com/search-processing"
DSS_URL = "https://dev-gateway.macro.com/dss"
LEXICAL_SERVICE_URL = "https://dev-gateway.macro.com/lexical"
[env.playground.durable_objects]
bindings = [
{ name = "DOCUMENT_SYNC_SESSION", class_name = "DocumentSyncSession" },
]
[[env.playground.r2_buckets]]
binding = "DOCUMENT_SNAPSHOT_BUCKET"
bucket_name = "document-snapshot-bucket-playground"
[[env.playground.d1_databases]]
binding = "USER_PEER_MAPPING"
migrations_dir = "./database/user-peer-mapping/migrations/"
database_name = "user-peer-mapping-playground"
database_id = "af92b95f-9687-4a6b-89aa-9cf38945ed1c"
[[env.playground.kv_namespaces]]
binding = "DOCUMENT_VERSIONING_KV"
id = "bac2723a3bcd436481b8a2b1baa24c8a"
[[env.playground.kv_namespaces]]
binding = "SNAPSHOT_STORE_KV"
id = "d107d66e62a942e8a90acdba8b04bd38"
[[env.playground.migrations]]
tag = "v1"
new_sqlite_classes = ["DocumentSyncSession"]
# DEVELOPMENT ENV - Used in development environment
[env.dev]
name = "sync-service-dev3"
[env.dev.vars]
INTERNAL_API_SECRET_KEY = "SYNC_SERVICE_KEY_DEV"
ENVIRONMENT = "development"
# The proxy injects the Datadog key; the exporter appends the signal path.
OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-dev.macroverse.workers.dev/i/otlp"
SPS_URL = "https://dev-gateway.macro.com/search-processing"
DSS_URL = "https://dev-gateway.macro.com/dss"
LEXICAL_SERVICE_URL = "https://dev-gateway.macro.com/lexical"
[env.dev.durable_objects]
bindings = [
{ name = "DOCUMENT_SYNC_SESSION", class_name = "DocumentSyncSession" },
]
[[env.dev.r2_buckets]]
binding = "DOCUMENT_SNAPSHOT_BUCKET"
bucket_name = "document-snapshot-bucket-dev"
[[env.dev.d1_databases]]
binding = "USER_PEER_MAPPING"
migrations_dir = "./database/user-peer-mapping/migrations/"
database_name = "user-peer-mapping-dev"
database_id = "687d123e-611e-4921-be72-a20913a068ff"
[[env.dev.kv_namespaces]]
binding = "DOCUMENT_VERSIONING_KV"
id = "3548ca6265c745e38cd504194aa6e887"
[[env.dev.kv_namespaces]]
binding = "SNAPSHOT_STORE_KV"
id = "9beead2b7891492f82153d2354e64e92"
[[env.dev.migrations]]
tag = "v1"
new_sqlite_classes = ["DocumentSyncSession"]
# PRODUDCTION ENV - Used in production environment
[env.prod]
name = "sync-service-prod2"
[env.prod.vars]
INTERNAL_API_SECRET_KEY = "SYNC_SERVICE_KEY_PROD"
ENVIRONMENT = "production"
# The proxy injects the Datadog key; the exporter appends the signal path.
OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-prod.macroverse.workers.dev/i/otlp"
SPS_URL = "https://gateway.macro.com/search-processing"
DSS_URL = "https://gateway.macro.com/dss"
LEXICAL_SERVICE_URL = "https://gateway.macro.com/lexical"
[env.prod.durable_objects]
bindings = [
{ name = "DOCUMENT_SYNC_SESSION", class_name = "DocumentSyncSession" },
]
[[env.prod.r2_buckets]]
binding = "DOCUMENT_SNAPSHOT_BUCKET"
bucket_name = "document-snapshot-bucket-prod"
[[env.prod.d1_databases]]
binding = "USER_PEER_MAPPING"
migrations_dir = "./database/user-peer-mapping/migrations/"
database_name = "user-peer-mapping-prod"
database_id = "cbe1e7d9-90bc-450a-a1fb-ade93f0b1074"
[[env.prod.migrations]]
tag = "v1"
new_sqlite_classes = ["DocumentSyncSession"]
[[env.prod.kv_namespaces]]
binding = "DOCUMENT_VERSIONING_KV"
id = "1e4c79d4265e40f08f9bfcb4c985c6d0"
[[env.prod.kv_namespaces]]
binding = "SNAPSHOT_STORE_KV"
id = "50a128e2f8aa4357938fdb0ed0d629c5"