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 = "ai-editing-worker"
main = "src/index.ts"
compatibility_date = "2025-07-22"
compatibility_flags = ["nodejs_compat", "enable_request_signal", "global_fetch_strictly_public"]
[alias]
"loro-crdt" = "loro-crdt/bundler"
"@observability/logger" = "./src/logger-shim.ts"
"@macro-inc/lexical-core" = "../../packages/lexical-core"
[[rules]]
type = "Text"
globs = ["**/*.md"]
fallthrough = true
[[rules]]
type = "CompiledWasm"
globs = ["**/*.wasm"]
fallthrough = true
[observability]
enabled = true
[[d1_databases]]
binding = "TRACES_DB"
database_name = "ai-editing-traces"
database_id = "16d34e99-3bc6-44e4-a287-1ea65183bd28"
[browser]
binding = "BROWSER"
[vars]
CANVAS_RENDER_URL = "https://macro.com/app/canvas-render.html"
CANVAS_BROWSER_URL = ""
# Tags exported spans with deployment.environment, matching the Datadog
# agent's DD_ENV so the env-scoped trace views include them.
ENVIRONMENT = "local"
# Local jaeger/datadog-agent OTLP receiver (docker port-mapped to the host).
# Unset in deployed envs = trace export disabled.
OTEL_EXPORTER_OTLP_ENDPOINT = "http://localhost:4318/v1/traces"
SYNC_WS_BASE = "wss://sync-service-prod2.macroverse.workers.dev"
DSS_BASE = "https://gateway.macro.com/dss"
SEARCH_SERVICE_BASE = "https://gateway.macro.com/dss"
CONTACTS_SERVICE_BASE = "https://gateway.macro.com/contacts"
AUTH_SERVICE_BASE = "https://gateway.macro.com/auth"
[dev]
port = 8933
[env.local.vars]
CANVAS_RENDER_URL = "https://localhost:8090/canvas-render.html"
CANVAS_BROWSER_URL = ""
ENVIRONMENT = "local"
OTEL_EXPORTER_OTLP_ENDPOINT = "http://otel-collector:4318/v1/traces"
SYNC_WS_BASE = "ws://sync-service:8787"
DSS_BASE = "http://document-storage-service:8080"
SEARCH_SERVICE_BASE = "http://search-processing-service:8080"
CONTACTS_SERVICE_BASE = "http://contacts-service:8080"
AUTH_SERVICE_BASE = "http://connection-gateway:8080"
# Local dev uses an on-disk SQLite shard, so the id is only a reference.
[[env.local.d1_databases]]
binding = "TRACES_DB"
database_name = "ai-editing-traces"
database_id = "16d34e99-3bc6-44e4-a287-1ea65183bd28"
[env.dev.browser]
binding = "BROWSER"
[env.dev.vars]
CANVAS_RENDER_URL = "https://dev.macro.com/app/canvas-render.html"
CANVAS_BROWSER_URL = ""
ENVIRONMENT = "development"
OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-dev.macroverse.workers.dev/i/otlp/v1/traces"
SYNC_WS_BASE = "wss://sync-service-dev3.macroverse.workers.dev"
DSS_BASE = "https://dev-gateway.macro.com/dss"
SEARCH_SERVICE_BASE = "https://dev-gateway.macro.com/dss"
CONTACTS_SERVICE_BASE = "https://dev-gateway.macro.com/contacts"
AUTH_SERVICE_BASE = "https://dev-gateway.macro.com/auth"
[[env.dev.d1_databases]]
binding = "TRACES_DB"
database_name = "ai-editing-traces"
database_id = "16d34e99-3bc6-44e4-a287-1ea65183bd28"
[env.playground]
name = "ai-editing-worker-playground"
[env.playground.browser]
binding = "BROWSER"
[env.playground.vars]
CANVAS_RENDER_URL = "https://dev.macro.com/app/canvas-render.html"
CANVAS_BROWSER_URL = ""
ENVIRONMENT = "development"
OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-dev.macroverse.workers.dev/i/otlp/v1/traces"
SYNC_WS_BASE = "wss://sync-service-dev3.macroverse.workers.dev"
DSS_BASE = "https://dev-gateway.macro.com/dss"
SEARCH_SERVICE_BASE = "https://dev-gateway.macro.com/dss"
CONTACTS_SERVICE_BASE = "https://dev-gateway.macro.com/contacts"
AUTH_SERVICE_BASE = "https://dev-gateway.macro.com/auth"
[[env.playground.d1_databases]]
binding = "TRACES_DB"
database_name = "ai-editing-traces-playground"
database_id = "28cdeacb-6468-449b-a1c7-a193b220501e"
[env.prod]
name = "ai-editing-worker"
[env.prod.browser]
binding = "BROWSER"
[env.prod.vars]
CANVAS_RENDER_URL = "https://macro.com/app/canvas-render.html"
CANVAS_BROWSER_URL = ""
ENVIRONMENT = "production"
OTEL_EXPORTER_OTLP_ENDPOINT = "https://macro-prox-prod.macroverse.workers.dev/i/otlp/v1/traces"
SYNC_WS_BASE = "wss://sync-service-prod2.macroverse.workers.dev"
DSS_BASE = "https://gateway.macro.com/dss"
SEARCH_SERVICE_BASE = "https://gateway.macro.com/dss"
CONTACTS_SERVICE_BASE = "https://gateway.macro.com/contacts"
AUTH_SERVICE_BASE = "https://gateway.macro.com/auth"
[[env.prod.d1_databases]]
binding = "TRACES_DB"
database_name = "ai-editing-traces-prod"
database_id = "2af569f1-2edb-4e6a-99a2-f2f9ee82c0d1"