diff --git a/content/docs/references/ai/devops-agent.mdx b/content/docs/references/ai/devops-agent.mdx index a34f52e5dc..0e8c614d8f 100644 --- a/content/docs/references/ai/devops-agent.mdx +++ b/content/docs/references/ai/devops-agent.mdx @@ -41,9 +41,9 @@ Use Cases: ```typescript -import { DevOpsAgent } from '@objectstack/spec/ai'; +import \{ DevOpsAgent \} from '@objectstack/spec/ai'; -const agent: DevOpsAgent = { +const agent: DevOpsAgent = \{ name: 'devops_automation_agent', @@ -53,47 +53,47 @@ role: 'Senior Full-Stack DevOps Engineer', instructions: '...', -developmentConfig: { +developmentConfig: \{ specificationSource: 'packages/spec', -codeGeneration: { +codeGeneration: \{ enabled: true, targets: ['frontend', 'backend', 'api'], -}, +\}, -}, +\}, -integrations: { +integrations: \{ -github: { +github: \{ connector: 'github_production', -repository: { +repository: \{ owner: 'objectstack-ai', name: 'app', -}, +\}, -}, +\}, -vercel: { +vercel: \{ connector: 'vercel_production', project: 'objectstack-app', -}, +\}, -}, +\}, -}; +\}; ``` diff --git a/content/docs/references/api/documentation.mdx b/content/docs/references/api/documentation.mdx index e37fb2e90f..968711c8ce 100644 --- a/content/docs/references/api/documentation.mdx +++ b/content/docs/references/api/documentation.mdx @@ -35,7 +35,7 @@ Architecture Alignment: ```typescript -const docConfig: ApiDocumentationConfig = { +const docConfig: ApiDocumentationConfig = \{ enabled: true, @@ -43,9 +43,9 @@ title: 'ObjectStack API', version: '1.0.0', -servers: [{ url: 'https://api.example.com', description: 'Production' }], +servers: [\{ url: 'https://api.example.com', description: 'Production' \}], -ui: { +ui: \{ type: 'swagger-ui', @@ -53,9 +53,9 @@ theme: 'light', enableTryItOut: true -} +\} -} +\} ``` diff --git a/content/docs/references/api/graphql.mdx b/content/docs/references/api/graphql.mdx index bba6707b2a..4e1351983f 100644 --- a/content/docs/references/api/graphql.mdx +++ b/content/docs/references/api/graphql.mdx @@ -61,9 +61,9 @@ GraphQL provides: ```graphql -query GetCustomer($id: ID!) { +query GetCustomer($id: ID!) \{ -customer(id: $id) { +customer(id: $id) \{ id @@ -71,29 +71,29 @@ name email -orders(limit: 10, status: "active") { +orders(limit: 10, status: "active") \{ id total -items { +items \{ -product { +product \{ name price -} +\} -} +\} -} +\} -} +\} -} +\} ``` @@ -101,9 +101,9 @@ price ```graphql -mutation CreateOrder($input: CreateOrderInput!) { +mutation CreateOrder($input: CreateOrderInput!) \{ -createOrder(input: $input) { +createOrder(input: $input) \{ id @@ -111,9 +111,9 @@ orderNumber status -} +\} -} +\} ``` diff --git a/content/docs/references/api/odata.mdx b/content/docs/references/api/odata.mdx index c01c7802a3..d5d1003815 100644 --- a/content/docs/references/api/odata.mdx +++ b/content/docs/references/api/odata.mdx @@ -83,7 +83,7 @@ $count=true ```typescript -const query: ODataQuery = { +const query: ODataQuery = \{ select: ['name', 'email'], @@ -99,7 +99,7 @@ expand: ['orders'], count: true -} +\} ``` diff --git a/content/docs/references/api/plugin-rest-api.mdx b/content/docs/references/api/plugin-rest-api.mdx index 82a3d89f29..84987ec333 100644 --- a/content/docs/references/api/plugin-rest-api.mdx +++ b/content/docs/references/api/plugin-rest-api.mdx @@ -43,7 +43,7 @@ Architecture Alignment: ```typescript -{ +\{ "name": "rest_api", @@ -51,11 +51,11 @@ Architecture Alignment: "type": "server", -"contributes": { +"contributes": \{ "routes": [ -{ +\{ "prefix": "/api/v1/discovery", @@ -65,13 +65,13 @@ Architecture Alignment: "middleware": [ -{ "name": "response_envelope", "type": "transformation", "enabled": true } +\{ "name": "response_envelope", "type": "transformation", "enabled": true \} ] -}, +\}, -{ +\{ "prefix": "/api/v1/meta", @@ -81,15 +81,15 @@ Architecture Alignment: "middleware": [ -{ "name": "auth", "type": "authentication", "enabled": true }, +\{ "name": "auth", "type": "authentication", "enabled": true \}, -{ "name": "request_validation", "type": "validation", "enabled": true } +\{ "name": "request_validation", "type": "validation", "enabled": true \} ] -}, +\}, -{ +\{ "prefix": "/api/v1/data", @@ -97,13 +97,13 @@ Architecture Alignment: "methods": ["findData", "getData", "createData", "updateData", "deleteData"] -} +\} ] -} +\} -} +\} ``` diff --git a/content/docs/references/api/registry.mdx b/content/docs/references/api/registry.mdx index 54fbc3c2e6..91a72d6c07 100644 --- a/content/docs/references/api/registry.mdx +++ b/content/docs/references/api/registry.mdx @@ -33,7 +33,7 @@ Architecture Alignment: ```typescript -const apiEntry: ApiRegistryEntry = { +const apiEntry: ApiRegistryEntry = \{ id: 'customer_crud', @@ -47,15 +47,15 @@ basePath: '/api/v1/data/customer', endpoints: [...], -metadata: { +metadata: \{ owner: 'sales_team', tags: ['customer', 'crm'] -} +\} -} +\} ``` diff --git a/content/docs/references/automation/etl.mdx b/content/docs/references/automation/etl.mdx index 204042767d..40c563fa6e 100644 --- a/content/docs/references/automation/etl.mdx +++ b/content/docs/references/automation/etl.mdx @@ -91,41 +91,41 @@ Supports complex operations: joins, aggregations, filtering, custom SQL. ```typescript -const salesforceToDB: ETLPipeline = { +const salesforceToDB: ETLPipeline = \{ name: 'salesforce_to_postgres', label: 'Salesforce Accounts to PostgreSQL', -source: { +source: \{ type: 'api', connector: 'salesforce', -config: { object: 'Account' } +config: \{ object: 'Account' \} -}, +\}, -destination: { +destination: \{ type: 'database', connector: 'postgres', -config: { table: 'accounts' } +config: \{ table: 'accounts' \} -}, +\}, transformations: [ -{ type: 'map', config: { 'Name': 'account_name' } } +\{ type: 'map', config: \{ 'Name': 'account_name' \} \} ], schedule: '0 2 * * *' // Daily at 2 AM -} +\} ``` diff --git a/content/docs/references/automation/sync.mdx b/content/docs/references/automation/sync.mdx index 0cacad7cb4..7c1f697274 100644 --- a/content/docs/references/automation/sync.mdx +++ b/content/docs/references/automation/sync.mdx @@ -93,27 +93,27 @@ For complex transformations (joins, aggregates, custom SQL), use ETL Pipeline (L ```typescript -const contactSync: DataSyncConfig = { +const contactSync: DataSyncConfig = \{ name: 'salesforce_contact_sync', label: 'Salesforce Contact Sync', -source: { +source: \{ object: 'contact', -filters: { status: 'active' } +filters: \{ status: 'active' \} -}, +\}, -destination: { +destination: \{ connector: 'salesforce', operation: 'upsert_contact', -mapping: { +mapping: \{ first_name: 'FirstName', @@ -121,15 +121,15 @@ last_name: 'LastName', email: 'Email' -} +\} -}, +\}, syncMode: 'incremental', schedule: '0 * * * *' // Hourly -} +\} ``` diff --git a/content/docs/references/automation/trigger-registry.mdx b/content/docs/references/automation/trigger-registry.mdx index 363432388f..d96cd679a8 100644 --- a/content/docs/references/automation/trigger-registry.mdx +++ b/content/docs/references/automation/trigger-registry.mdx @@ -71,7 +71,7 @@ Inspired by Zapier, n8n, and Workato connector architectures. ```typescript -const slackNotifier: Connector = { +const slackNotifier: Connector = \{ id: 'slack_notify', @@ -79,21 +79,21 @@ name: 'Slack Notification', category: 'communication', -authentication: { +authentication: \{ type: 'apiKey', -fields: [{ name: 'webhook_url', label: 'Webhook URL', type: 'url' }] +fields: [\{ name: 'webhook_url', label: 'Webhook URL', type: 'url' \}] -}, +\}, operations: [ -{ id: 'send_message', name: 'Send Message', type: 'action' } +\{ id: 'send_message', name: 'Send Message', type: 'action' \} ] -} +\} ``` diff --git a/content/docs/references/data/document.mdx b/content/docs/references/data/document.mdx index 700da06a65..41bd6a1ba7 100644 --- a/content/docs/references/data/document.mdx +++ b/content/docs/references/data/document.mdx @@ -13,7 +13,7 @@ Each version is immutable and maintains its own metadata and download URL. ```json -{ +\{ "versionNumber": 2, @@ -29,7 +29,7 @@ Each version is immutable and maintains its own metadata and download URL. "isLatest": true -} +\} ``` diff --git a/content/docs/references/data/external-lookup.mdx b/content/docs/references/data/external-lookup.mdx index 97471a0268..23139fc3c9 100644 --- a/content/docs/references/data/external-lookup.mdx +++ b/content/docs/references/data/external-lookup.mdx @@ -13,7 +13,7 @@ Similar to Salesforce External Objects for real-time data integration. ```json -{ +\{ "id": "salesforce-accounts", @@ -23,11 +23,11 @@ Similar to Salesforce External Objects for real-time data integration. "endpoint": "https://api.salesforce.com/services/data/v58.0", -"authentication": { +"authentication": \{ "type": "oauth2", -"config": { +"config": \{ "clientId": "...", @@ -35,11 +35,11 @@ Similar to Salesforce External Objects for real-time data integration. "tokenUrl": "https://login.salesforce.com/services/oauth2/token" -} +\} -} +\} -} +\} ``` diff --git a/content/docs/references/data/validation.mdx b/content/docs/references/data/validation.mdx index 08453a1733..f4a5d2ee39 100644 --- a/content/docs/references/data/validation.mdx +++ b/content/docs/references/data/validation.mdx @@ -55,7 +55,7 @@ Equivalent ObjectStack rule: ```typescript -{ +\{ type: 'script', @@ -67,7 +67,7 @@ message: 'Discount cannot exceed 40%', severity: 'error' -} +\} ``` diff --git a/content/docs/references/kernel/execution-context.mdx b/content/docs/references/kernel/execution-context.mdx index c8527402a0..5293d7e0a3 100644 --- a/content/docs/references/kernel/execution-context.mdx +++ b/content/docs/references/kernel/execution-context.mdx @@ -21,7 +21,7 @@ Design: Usage: -engine.find('account', { context: { userId: '...', tenantId: '...' } }) +engine.find('account', \{ context: \{ userId: '...', tenantId: '...' \} \}) **Source:** `packages/spec/src/kernel/execution-context.zod.ts` diff --git a/content/docs/references/security/rls.mdx b/content/docs/references/security/rls.mdx index 2029086bb2..fb0fe907e7 100644 --- a/content/docs/references/security/rls.mdx +++ b/content/docs/references/security/rls.mdx @@ -73,7 +73,7 @@ ObjectStack RLS Equivalent: ```typescript -{ +\{ name: 'tenant_isolation', @@ -83,7 +83,7 @@ operation: 'select', using: 'tenant_id = current_user.tenant_id' -} +\} ``` diff --git a/content/docs/references/shared/mapping.mdx b/content/docs/references/shared/mapping.mdx index f9cb4eb4ad..bcb87ee3ee 100644 --- a/content/docs/references/shared/mapping.mdx +++ b/content/docs/references/shared/mapping.mdx @@ -25,13 +25,13 @@ ObjectStack for data transformation and synchronization. ```typescript -const mapping: FieldMapping = { +const mapping: FieldMapping = \{ source: 'external_user_id', target: 'user_id', -}; +\}; ``` @@ -39,17 +39,17 @@ target: 'user_id', ```typescript -const mapping: FieldMapping = { +const mapping: FieldMapping = \{ source: 'user_name', target: 'name', -transform: { type: 'cast', targetType: 'string' }, +transform: \{ type: 'cast', targetType: 'string' \}, defaultValue: 'Unknown' -}; +\}; ``` diff --git a/content/docs/references/studio/plugin.mdx b/content/docs/references/studio/plugin.mdx index 65c2210ef3..b0d204d7c4 100644 --- a/content/docs/references/studio/plugin.mdx +++ b/content/docs/references/studio/plugin.mdx @@ -59,9 +59,9 @@ Like VS Code extensions, Studio plugins have two layers: ```typescript -import { StudioPluginManifestSchema } from '@objectstack/spec/studio'; +import \{ StudioPluginManifestSchema \} from '@objectstack/spec/studio'; -const manifest = StudioPluginManifestSchema.parse({ +const manifest = StudioPluginManifestSchema.parse(\{ id: 'objectstack.object-designer', @@ -69,9 +69,9 @@ name: 'Object Designer', version: '1.0.0', -contributes: { +contributes: \{ -metadataViewers: [{ +metadataViewers: [\{ id: 'object-explorer', @@ -83,11 +83,11 @@ priority: 100, modes: ['preview', 'design', 'data'], -}], +\}], -}, +\}, -}); +\}); ``` diff --git a/content/docs/references/system/notification.mdx b/content/docs/references/system/notification.mdx index 5b0f007169..6a254cdb19 100644 --- a/content/docs/references/system/notification.mdx +++ b/content/docs/references/system/notification.mdx @@ -13,13 +13,13 @@ Supports variables for personalization and file attachments. ```json -{ +\{ "id": "welcome-email", -"subject": "Welcome to {{company_name}}", +"subject": "Welcome to \{\{company_name\}\}", -"body": "

Welcome {{user_name}}!

", +"body": "

Welcome \{\{user_name\}\}!

", "bodyType": "html", @@ -27,17 +27,17 @@ Supports variables for personalization and file attachments. "attachments": [ -{ +\{ "name": "guide.pdf", "url": "https://example.com/guide.pdf" -} +\} ] -} +\} ``` diff --git a/content/docs/references/system/translation.mdx b/content/docs/references/system/translation.mdx index ce4d4f308d..fe2a89d28b 100644 --- a/content/docs/references/system/translation.mdx +++ b/content/docs/references/system/translation.mdx @@ -11,13 +11,13 @@ Example structure: ```json -{ +\{ -"en": { "objects": { "account": { "label": "Account" } } }, +"en": \{ "objects": \{ "account": \{ "label": "Account" \} \} \}, -"zh-CN": { "objects": { "account": { "label": "客户" } } } +"zh-CN": \{ "objects": \{ "account": \{ "label": "客户" \} \} \} -} +\} ``` diff --git a/content/docs/references/system/worker.mdx b/content/docs/references/system/worker.mdx index f67c3f5738..c9103e138d 100644 --- a/content/docs/references/system/worker.mdx +++ b/content/docs/references/system/worker.mdx @@ -33,19 +33,19 @@ Features: ```typescript -const task: Task = { +const task: Task = \{ id: 'task-123', type: 'send_email', -payload: { to: 'user@example.com', subject: 'Welcome' }, +payload: \{ to: 'user@example.com', subject: 'Welcome' \}, queue: 'notifications', priority: 5 -}; +\}; ``` diff --git a/content/docs/references/ui/widget.mdx b/content/docs/references/ui/widget.mdx index 6925c3da07..cb2fa9eff0 100644 --- a/content/docs/references/ui/widget.mdx +++ b/content/docs/references/ui/widget.mdx @@ -17,21 +17,21 @@ These hooks allow widgets to perform initialization, cleanup, and respond to cha ```typescript -const widget = { +const widget = \{ -lifecycle: { +lifecycle: \{ onMount: "console.log('Widget mounted')", -onUpdate: "if (prevProps.value !== props.value) { updateUI() }", +onUpdate: "if (prevProps.value !== props.value) \{ updateUI() \}", onUnmount: "cleanup()", onValidate: "return value.length > 0 ? null : 'Required field'" -} +\} -} +\} ``` diff --git a/packages/spec/scripts/build-docs.ts b/packages/spec/scripts/build-docs.ts index 7d254f9def..473acd5b3f 100644 --- a/packages/spec/scripts/build-docs.ts +++ b/packages/spec/scripts/build-docs.ts @@ -119,6 +119,7 @@ function getFileDescription(content: string): string { .replace(/\{@link\s+([^|]+?)\s*\|\s*([^}]+?)\s*\}/g, '[$2]($1)') // {@link url | text} -> [text](url) .replace(/\{@link\s+([^}]+?)\s*\}/g, '[$1]($1)') // {@link url} -> [url](url) .replace(/file:\/\//g, '') // Remove file:// protocol + .replace(/\{/g, '\\{').replace(/\}/g, '\\}') // Escape { } for MDX } return ''; }