@objectstack/spec 12.4.0 → 12.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1712) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cloud/index.js +2 -1
  3. package/dist/cloud/index.js.map +1 -1
  4. package/dist/cloud/index.mjs +2 -1
  5. package/dist/cloud/index.mjs.map +1 -1
  6. package/dist/contracts/index.d.mts +2 -2
  7. package/dist/contracts/index.d.ts +2 -2
  8. package/dist/data/index.d.mts +2 -1
  9. package/dist/data/index.d.ts +2 -1
  10. package/dist/data/index.js +15 -1
  11. package/dist/data/index.js.map +1 -1
  12. package/dist/data/index.mjs +15 -1
  13. package/dist/data/index.mjs.map +1 -1
  14. package/dist/index.js +2 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +2 -1
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/kernel/index.d.mts +1 -1
  19. package/dist/kernel/index.d.ts +1 -1
  20. package/dist/kernel/index.js +15 -1
  21. package/dist/kernel/index.js.map +1 -1
  22. package/dist/kernel/index.mjs +15 -1
  23. package/dist/kernel/index.mjs.map +1 -1
  24. package/dist/{manifest.zod-C50Vrey_.d.mts → manifest.zod-jxZ65lQK.d.mts} +1 -0
  25. package/dist/{manifest.zod-C50Vrey_.d.ts → manifest.zod-jxZ65lQK.d.ts} +1 -0
  26. package/dist/{subscription.zod-ChkvMmQP.d.ts → subscription.zod-Co-_rVhS.d.ts} +47 -0
  27. package/dist/{subscription.zod-BD8dqooM.d.mts → subscription.zod-kCIcA6Zt.d.mts} +47 -0
  28. package/dist/system/index.js +15 -1
  29. package/dist/system/index.js.map +1 -1
  30. package/dist/system/index.mjs +15 -1
  31. package/dist/system/index.mjs.map +1 -1
  32. package/json-schema/ai/AIKnowledge.json +2 -2
  33. package/json-schema/ai/AIModelConfig.json +2 -2
  34. package/json-schema/ai/AITool.json +2 -2
  35. package/json-schema/ai/AIUsageRecord.json +2 -2
  36. package/json-schema/ai/Agent.json +2 -2
  37. package/json-schema/ai/BlueprintApp.json +2 -2
  38. package/json-schema/ai/BlueprintDashboard.json +2 -2
  39. package/json-schema/ai/BlueprintField.json +2 -2
  40. package/json-schema/ai/BlueprintNavItem.json +2 -2
  41. package/json-schema/ai/BlueprintObject.json +2 -2
  42. package/json-schema/ai/BlueprintSeed.json +2 -2
  43. package/json-schema/ai/BlueprintView.json +2 -2
  44. package/json-schema/ai/BlueprintWidgetCondition.json +2 -2
  45. package/json-schema/ai/CodeContent.json +2 -2
  46. package/json-schema/ai/ConversationAnalytics.json +2 -2
  47. package/json-schema/ai/ConversationContext.json +2 -2
  48. package/json-schema/ai/ConversationMessage.json +2 -2
  49. package/json-schema/ai/ConversationSession.json +2 -2
  50. package/json-schema/ai/ConversationSummary.json +2 -2
  51. package/json-schema/ai/EmbeddingModel.json +2 -2
  52. package/json-schema/ai/FileContent.json +2 -2
  53. package/json-schema/ai/FileKnowledgeSource.json +2 -2
  54. package/json-schema/ai/FunctionCall.json +2 -2
  55. package/json-schema/ai/HttpKnowledgeSource.json +2 -2
  56. package/json-schema/ai/ImageContent.json +2 -2
  57. package/json-schema/ai/KnowledgeChunk.json +2 -2
  58. package/json-schema/ai/KnowledgeDocument.json +2 -2
  59. package/json-schema/ai/KnowledgeHit.json +2 -2
  60. package/json-schema/ai/KnowledgeRefreshPolicy.json +2 -2
  61. package/json-schema/ai/KnowledgeSource.json +2 -2
  62. package/json-schema/ai/KnowledgeSourceKind.json +2 -2
  63. package/json-schema/ai/MCPApprovalPolicy.json +2 -2
  64. package/json-schema/ai/MCPServerRef.json +2 -2
  65. package/json-schema/ai/MCPToolBinding.json +2 -2
  66. package/json-schema/ai/MCPTransport.json +2 -2
  67. package/json-schema/ai/MessageContent.json +2 -2
  68. package/json-schema/ai/MessageContentType.json +2 -2
  69. package/json-schema/ai/MessagePruningEvent.json +2 -2
  70. package/json-schema/ai/MessageRole.json +2 -2
  71. package/json-schema/ai/ModelCapability.json +2 -2
  72. package/json-schema/ai/ModelConfig.json +2 -2
  73. package/json-schema/ai/ModelLimits.json +2 -2
  74. package/json-schema/ai/ModelPricing.json +2 -2
  75. package/json-schema/ai/ModelProvider.json +2 -2
  76. package/json-schema/ai/ModelRegistryEntry.json +2 -2
  77. package/json-schema/ai/ModelSelectionCriteria.json +2 -2
  78. package/json-schema/ai/ObjectKnowledgeSource.json +2 -2
  79. package/json-schema/ai/PromptVariable.json +2 -2
  80. package/json-schema/ai/Skill.json +2 -2
  81. package/json-schema/ai/SkillTriggerCondition.json +2 -2
  82. package/json-schema/ai/SolutionBlueprint.json +2 -2
  83. package/json-schema/ai/SolutionBlueprintStrict.json +2 -2
  84. package/json-schema/ai/StructuredOutputConfig.json +2 -2
  85. package/json-schema/ai/StructuredOutputFormat.json +2 -2
  86. package/json-schema/ai/TextContent.json +2 -2
  87. package/json-schema/ai/TokenBudgetConfig.json +2 -2
  88. package/json-schema/ai/TokenBudgetStrategy.json +2 -2
  89. package/json-schema/ai/TokenUsage.json +2 -2
  90. package/json-schema/ai/TokenUsageStats.json +2 -2
  91. package/json-schema/ai/Tool.json +2 -2
  92. package/json-schema/ai/ToolCall.json +2 -2
  93. package/json-schema/ai/ToolCategory.json +2 -2
  94. package/json-schema/ai/TransformPipelineStep.json +2 -2
  95. package/json-schema/ai/VectorStore.json +2 -2
  96. package/json-schema/ai/VectorStoreProvider.json +2 -2
  97. package/json-schema/api/AckMessage.json +2 -2
  98. package/json-schema/api/AddReactionRequest.json +2 -2
  99. package/json-schema/api/AddReactionResponse.json +2 -2
  100. package/json-schema/api/AiInsightsRequest.json +2 -2
  101. package/json-schema/api/AiInsightsResponse.json +2 -2
  102. package/json-schema/api/AiNlqRequest.json +2 -2
  103. package/json-schema/api/AiNlqResponse.json +2 -2
  104. package/json-schema/api/AiSuggestRequest.json +2 -2
  105. package/json-schema/api/AiSuggestResponse.json +2 -2
  106. package/json-schema/api/AnalyticsEndpoint.json +2 -2
  107. package/json-schema/api/AnalyticsMetadataResponse.json +2 -2
  108. package/json-schema/api/AnalyticsQueryRequest.json +2 -2
  109. package/json-schema/api/AnalyticsResultResponse.json +2 -2
  110. package/json-schema/api/AnalyticsSqlResponse.json +2 -2
  111. package/json-schema/api/ApiChangelogEntry.json +2 -2
  112. package/json-schema/api/ApiDiscoveryQuery.json +2 -2
  113. package/json-schema/api/ApiDiscoveryResponse.json +2 -2
  114. package/json-schema/api/ApiDocumentationConfig.json +2 -2
  115. package/json-schema/api/ApiEndpoint.json +2 -2
  116. package/json-schema/api/ApiEndpointRegistration.json +2 -2
  117. package/json-schema/api/ApiError.json +2 -2
  118. package/json-schema/api/ApiMapping.json +2 -2
  119. package/json-schema/api/ApiMetadata.json +2 -2
  120. package/json-schema/api/ApiParameter.json +2 -2
  121. package/json-schema/api/ApiProtocolType.json +2 -2
  122. package/json-schema/api/ApiRegistry.json +2 -2
  123. package/json-schema/api/ApiRegistryEntry.json +2 -2
  124. package/json-schema/api/ApiResponse.json +2 -2
  125. package/json-schema/api/ApiRoutes.json +2 -2
  126. package/json-schema/api/ApiTestCollection.json +2 -2
  127. package/json-schema/api/ApiTestRequest.json +2 -2
  128. package/json-schema/api/ApiTestingUiConfig.json +2 -2
  129. package/json-schema/api/ApiTestingUiType.json +2 -2
  130. package/json-schema/api/AuthEndpoint.json +2 -2
  131. package/json-schema/api/AuthFeaturesConfig.json +2 -2
  132. package/json-schema/api/AuthProvider.json +2 -2
  133. package/json-schema/api/AuthProviderInfo.json +2 -2
  134. package/json-schema/api/AutomationActionsResponse.json +2 -2
  135. package/json-schema/api/AutomationApiErrorCode.json +2 -2
  136. package/json-schema/api/AutomationFlowPathParams.json +2 -2
  137. package/json-schema/api/AutomationRunPathParams.json +2 -2
  138. package/json-schema/api/AutomationTriggerRequest.json +2 -2
  139. package/json-schema/api/AutomationTriggerResponse.json +2 -2
  140. package/json-schema/api/BasePresence.json +2 -2
  141. package/json-schema/api/BaseResponse.json +2 -2
  142. package/json-schema/api/BatchConfig.json +2 -2
  143. package/json-schema/api/BatchDataRequest.json +2 -2
  144. package/json-schema/api/BatchDataResponse.json +2 -2
  145. package/json-schema/api/BatchEndpointsConfig.json +2 -2
  146. package/json-schema/api/BatchLoadingStrategy.json +2 -2
  147. package/json-schema/api/BatchOperationResult.json +2 -2
  148. package/json-schema/api/BatchOperationType.json +2 -2
  149. package/json-schema/api/BatchOptions.json +2 -2
  150. package/json-schema/api/BatchRecord.json +2 -2
  151. package/json-schema/api/BatchUpdateRequest.json +2 -2
  152. package/json-schema/api/BatchUpdateResponse.json +2 -2
  153. package/json-schema/api/BulkRequest.json +2 -2
  154. package/json-schema/api/BulkResponse.json +2 -2
  155. package/json-schema/api/CacheControl.json +2 -2
  156. package/json-schema/api/CacheDirective.json +2 -2
  157. package/json-schema/api/CacheInvalidationRequest.json +2 -2
  158. package/json-schema/api/CacheInvalidationResponse.json +2 -2
  159. package/json-schema/api/CacheInvalidationTarget.json +2 -2
  160. package/json-schema/api/Callback.json +2 -2
  161. package/json-schema/api/ChangelogEntry.json +2 -2
  162. package/json-schema/api/CheckPermissionRequest.json +2 -2
  163. package/json-schema/api/CheckPermissionResponse.json +2 -2
  164. package/json-schema/api/CodeGenerationTemplate.json +2 -2
  165. package/json-schema/api/CompleteChunkedUploadRequest.json +2 -2
  166. package/json-schema/api/CompleteChunkedUploadResponse.json +2 -2
  167. package/json-schema/api/CompleteUploadRequest.json +2 -2
  168. package/json-schema/api/ConceptListResponse.json +2 -2
  169. package/json-schema/api/ConflictResolutionStrategy.json +2 -2
  170. package/json-schema/api/CreateDataRequest.json +2 -2
  171. package/json-schema/api/CreateDataResponse.json +2 -2
  172. package/json-schema/api/CreateExportJobRequest.json +2 -2
  173. package/json-schema/api/CreateExportJobResponse.json +2 -2
  174. package/json-schema/api/CreateFeedItemRequest.json +2 -2
  175. package/json-schema/api/CreateFeedItemResponse.json +2 -2
  176. package/json-schema/api/CreateImportJobRequest.json +2 -2
  177. package/json-schema/api/CreateImportJobResponse.json +2 -2
  178. package/json-schema/api/CreateManyDataRequest.json +2 -2
  179. package/json-schema/api/CreateManyDataResponse.json +2 -2
  180. package/json-schema/api/CreateRequest.json +2 -2
  181. package/json-schema/api/CrudEndpointPattern.json +2 -2
  182. package/json-schema/api/CrudEndpointsConfig.json +2 -2
  183. package/json-schema/api/CrudOperation.json +2 -2
  184. package/json-schema/api/CursorMessage.json +2 -2
  185. package/json-schema/api/CursorPosition.json +2 -2
  186. package/json-schema/api/DataEvent.json +2 -2
  187. package/json-schema/api/DataEventType.json +2 -2
  188. package/json-schema/api/DataLoaderConfig.json +2 -2
  189. package/json-schema/api/DeduplicationStrategy.json +2 -2
  190. package/json-schema/api/DeleteDataRequest.json +2 -2
  191. package/json-schema/api/DeleteDataResponse.json +2 -2
  192. package/json-schema/api/DeleteFeedItemRequest.json +2 -2
  193. package/json-schema/api/DeleteFeedItemResponse.json +2 -2
  194. package/json-schema/api/DeleteFlowRequest.json +2 -2
  195. package/json-schema/api/DeleteFlowResponse.json +2 -2
  196. package/json-schema/api/DeleteManyDataRequest.json +2 -2
  197. package/json-schema/api/DeleteManyDataResponse.json +2 -2
  198. package/json-schema/api/DeleteManyRequest.json +2 -2
  199. package/json-schema/api/DeleteMetaItemRequest.json +2 -2
  200. package/json-schema/api/DeleteMetaItemResponse.json +2 -2
  201. package/json-schema/api/DeleteResponse.json +2 -2
  202. package/json-schema/api/DeleteViewRequest.json +2 -2
  203. package/json-schema/api/DeleteViewResponse.json +2 -2
  204. package/json-schema/api/DeviceRequestResponse.json +2 -2
  205. package/json-schema/api/DeviceTokenResponse.json +2 -2
  206. package/json-schema/api/DisablePackageRequest.json +2 -2
  207. package/json-schema/api/Discovery.json +2 -2
  208. package/json-schema/api/DispatcherConfig.json +2 -2
  209. package/json-schema/api/DispatcherErrorCode.json +2 -2
  210. package/json-schema/api/DispatcherErrorResponse.json +2 -2
  211. package/json-schema/api/DispatcherRoute.json +2 -2
  212. package/json-schema/api/DocumentState.json +2 -2
  213. package/json-schema/api/ETag.json +2 -2
  214. package/json-schema/api/EditMessage.json +2 -2
  215. package/json-schema/api/EditOperation.json +2 -2
  216. package/json-schema/api/EditOperationType.json +2 -2
  217. package/json-schema/api/EmailPasswordConfigPublic.json +2 -2
  218. package/json-schema/api/EnablePackageRequest.json +2 -2
  219. package/json-schema/api/EndpointRegistry.json +2 -2
  220. package/json-schema/api/EnhancedApiError.json +2 -2
  221. package/json-schema/api/ErrorCategory.json +2 -2
  222. package/json-schema/api/ErrorHandlingConfig.json +2 -2
  223. package/json-schema/api/ErrorMessage.json +2 -2
  224. package/json-schema/api/ErrorResponse.json +2 -2
  225. package/json-schema/api/EventFilter.json +2 -2
  226. package/json-schema/api/EventFilterCondition.json +2 -2
  227. package/json-schema/api/EventMessage.json +2 -2
  228. package/json-schema/api/EventPattern.json +2 -2
  229. package/json-schema/api/EventSubscription.json +2 -2
  230. package/json-schema/api/ExportFormat.json +2 -2
  231. package/json-schema/api/ExportImportTemplate.json +2 -2
  232. package/json-schema/api/ExportJobProgress.json +2 -2
  233. package/json-schema/api/ExportJobStatus.json +2 -2
  234. package/json-schema/api/ExportJobSummary.json +2 -2
  235. package/json-schema/api/ExportRequest.json +2 -2
  236. package/json-schema/api/FederationEntity.json +2 -2
  237. package/json-schema/api/FederationEntityKey.json +2 -2
  238. package/json-schema/api/FederationExternalField.json +2 -2
  239. package/json-schema/api/FederationGateway.json +2 -2
  240. package/json-schema/api/FederationProvides.json +2 -2
  241. package/json-schema/api/FederationRequires.json +2 -2
  242. package/json-schema/api/FeedApiErrorCode.json +2 -2
  243. package/json-schema/api/FeedItemPathParams.json +2 -2
  244. package/json-schema/api/FeedListFilterType.json +2 -2
  245. package/json-schema/api/FeedPathParams.json +2 -2
  246. package/json-schema/api/FeedUnsubscribeRequest.json +2 -2
  247. package/json-schema/api/FieldError.json +2 -2
  248. package/json-schema/api/FieldMappingEntry.json +2 -2
  249. package/json-schema/api/FileTypeValidation.json +2 -2
  250. package/json-schema/api/FileUploadResponse.json +2 -2
  251. package/json-schema/api/FilterOperator.json +2 -2
  252. package/json-schema/api/FindDataRequest.json +2 -2
  253. package/json-schema/api/FindDataResponse.json +2 -2
  254. package/json-schema/api/FlowSummary.json +2 -2
  255. package/json-schema/api/GeneratedApiDocumentation.json +2 -2
  256. package/json-schema/api/GeneratedEndpoint.json +2 -2
  257. package/json-schema/api/GetAnalyticsMetaRequest.json +2 -2
  258. package/json-schema/api/GetAuthConfigResponse.json +2 -2
  259. package/json-schema/api/GetChangelogRequest.json +2 -2
  260. package/json-schema/api/GetChangelogResponse.json +2 -2
  261. package/json-schema/api/GetDataRequest.json +2 -2
  262. package/json-schema/api/GetDataResponse.json +2 -2
  263. package/json-schema/api/GetDiscoveryRequest.json +2 -2
  264. package/json-schema/api/GetDiscoveryResponse.json +2 -2
  265. package/json-schema/api/GetEffectivePermissionsRequest.json +2 -2
  266. package/json-schema/api/GetEffectivePermissionsResponse.json +2 -2
  267. package/json-schema/api/GetExportJobDownloadRequest.json +2 -2
  268. package/json-schema/api/GetExportJobDownloadResponse.json +2 -2
  269. package/json-schema/api/GetFeedRequest.json +2 -2
  270. package/json-schema/api/GetFeedResponse.json +2 -2
  271. package/json-schema/api/GetFieldLabelsRequest.json +2 -2
  272. package/json-schema/api/GetFieldLabelsResponse.json +2 -2
  273. package/json-schema/api/GetFlowRequest.json +2 -2
  274. package/json-schema/api/GetInstalledPackageRequest.json +2 -2
  275. package/json-schema/api/GetLocalesRequest.json +2 -2
  276. package/json-schema/api/GetLocalesResponse.json +2 -2
  277. package/json-schema/api/GetMetaItemCachedRequest.json +2 -2
  278. package/json-schema/api/GetMetaItemCachedResponse.json +2 -2
  279. package/json-schema/api/GetMetaItemRequest.json +2 -2
  280. package/json-schema/api/GetMetaItemResponse.json +2 -2
  281. package/json-schema/api/GetMetaItemsRequest.json +2 -2
  282. package/json-schema/api/GetMetaItemsResponse.json +2 -2
  283. package/json-schema/api/GetMetaTypesRequest.json +2 -2
  284. package/json-schema/api/GetMetaTypesResponse.json +2 -2
  285. package/json-schema/api/GetNotificationPreferencesRequest.json +2 -2
  286. package/json-schema/api/GetNotificationPreferencesResponse.json +2 -2
  287. package/json-schema/api/GetObjectPermissionsRequest.json +2 -2
  288. package/json-schema/api/GetObjectPermissionsResponse.json +2 -2
  289. package/json-schema/api/GetPackageRequest.json +2 -2
  290. package/json-schema/api/GetPresenceRequest.json +2 -2
  291. package/json-schema/api/GetPresenceResponse.json +2 -2
  292. package/json-schema/api/GetPresignedUrlRequest.json +2 -2
  293. package/json-schema/api/GetRunRequest.json +2 -2
  294. package/json-schema/api/GetRunResponse.json +2 -2
  295. package/json-schema/api/GetTranslationsRequest.json +2 -2
  296. package/json-schema/api/GetTranslationsResponse.json +2 -2
  297. package/json-schema/api/GetUiViewRequest.json +2 -2
  298. package/json-schema/api/GetViewRequest.json +2 -2
  299. package/json-schema/api/GetWorkflowConfigRequest.json +2 -2
  300. package/json-schema/api/GetWorkflowConfigResponse.json +2 -2
  301. package/json-schema/api/GetWorkflowStateRequest.json +2 -2
  302. package/json-schema/api/GetWorkflowStateResponse.json +2 -2
  303. package/json-schema/api/GraphQLDataLoaderConfig.json +2 -2
  304. package/json-schema/api/GraphQLDirectiveConfig.json +2 -2
  305. package/json-schema/api/GraphQLDirectiveLocation.json +2 -2
  306. package/json-schema/api/GraphQLMutationConfig.json +2 -2
  307. package/json-schema/api/GraphQLPersistedQuery.json +2 -2
  308. package/json-schema/api/GraphQLQueryAdapter.json +2 -2
  309. package/json-schema/api/GraphQLQueryComplexity.json +2 -2
  310. package/json-schema/api/GraphQLQueryDepthLimit.json +2 -2
  311. package/json-schema/api/GraphQLRateLimit.json +2 -2
  312. package/json-schema/api/GraphQLScalarType.json +2 -2
  313. package/json-schema/api/GraphQLSubscriptionConfig.json +2 -2
  314. package/json-schema/api/GraphQLTypeConfig.json +2 -2
  315. package/json-schema/api/HandlerStatus.json +2 -2
  316. package/json-schema/api/HttpFindQueryParams.json +2 -2
  317. package/json-schema/api/HttpMethod.json +2 -2
  318. package/json-schema/api/HttpStatusCode.json +2 -2
  319. package/json-schema/api/IdRequest.json +2 -2
  320. package/json-schema/api/ImportJobProgress.json +2 -2
  321. package/json-schema/api/ImportJobResults.json +2 -2
  322. package/json-schema/api/ImportJobStatus.json +2 -2
  323. package/json-schema/api/ImportJobSummary.json +2 -2
  324. package/json-schema/api/ImportMapping.json +2 -2
  325. package/json-schema/api/ImportRequest.json +2 -2
  326. package/json-schema/api/ImportResponse.json +2 -2
  327. package/json-schema/api/ImportRowResult.json +2 -2
  328. package/json-schema/api/ImportValidationConfig.json +2 -2
  329. package/json-schema/api/ImportValidationMode.json +2 -2
  330. package/json-schema/api/ImportValidationResult.json +2 -2
  331. package/json-schema/api/ImportWriteMode.json +2 -2
  332. package/json-schema/api/InitiateChunkedUploadRequest.json +2 -2
  333. package/json-schema/api/InitiateChunkedUploadResponse.json +2 -2
  334. package/json-schema/api/ListExportJobsRequest.json +2 -2
  335. package/json-schema/api/ListExportJobsResponse.json +2 -2
  336. package/json-schema/api/ListFlowsRequest.json +2 -2
  337. package/json-schema/api/ListFlowsResponse.json +2 -2
  338. package/json-schema/api/ListImportJobsRequest.json +2 -2
  339. package/json-schema/api/ListImportJobsResponse.json +2 -2
  340. package/json-schema/api/ListInstalledPackagesRequest.json +2 -2
  341. package/json-schema/api/ListNotificationsRequest.json +2 -2
  342. package/json-schema/api/ListNotificationsResponse.json +2 -2
  343. package/json-schema/api/ListPackagesRequest.json +2 -2
  344. package/json-schema/api/ListRecordResponse.json +2 -2
  345. package/json-schema/api/ListRunsRequest.json +2 -2
  346. package/json-schema/api/ListRunsResponse.json +2 -2
  347. package/json-schema/api/ListViewsRequest.json +2 -2
  348. package/json-schema/api/LoginRequest.json +2 -2
  349. package/json-schema/api/LoginType.json +2 -2
  350. package/json-schema/api/MarkAllNotificationsReadRequest.json +2 -2
  351. package/json-schema/api/MarkAllNotificationsReadResponse.json +2 -2
  352. package/json-schema/api/MarkNotificationsReadRequest.json +2 -2
  353. package/json-schema/api/MarkNotificationsReadResponse.json +2 -2
  354. package/json-schema/api/MetadataBulkRegisterRequest.json +2 -2
  355. package/json-schema/api/MetadataBulkResponse.json +2 -2
  356. package/json-schema/api/MetadataBulkUnregisterRequest.json +2 -2
  357. package/json-schema/api/MetadataCacheRequest.json +2 -2
  358. package/json-schema/api/MetadataCacheResponse.json +2 -2
  359. package/json-schema/api/MetadataDeleteResponse.json +2 -2
  360. package/json-schema/api/MetadataDependenciesResponse.json +2 -2
  361. package/json-schema/api/MetadataDependentsResponse.json +2 -2
  362. package/json-schema/api/MetadataEffectiveResponse.json +2 -2
  363. package/json-schema/api/MetadataEndpointsConfig.json +2 -2
  364. package/json-schema/api/MetadataEvent.json +2 -2
  365. package/json-schema/api/MetadataEventType.json +2 -2
  366. package/json-schema/api/MetadataExistsResponse.json +2 -2
  367. package/json-schema/api/MetadataExportRequest.json +2 -2
  368. package/json-schema/api/MetadataExportResponse.json +2 -2
  369. package/json-schema/api/MetadataImportRequest.json +2 -2
  370. package/json-schema/api/MetadataImportResponse.json +2 -2
  371. package/json-schema/api/MetadataItemResponse.json +2 -2
  372. package/json-schema/api/MetadataListResponse.json +2 -2
  373. package/json-schema/api/MetadataNamesResponse.json +2 -2
  374. package/json-schema/api/MetadataOverlayResponse.json +2 -2
  375. package/json-schema/api/MetadataOverlaySaveRequest.json +2 -2
  376. package/json-schema/api/MetadataQueryRequest.json +2 -2
  377. package/json-schema/api/MetadataQueryResponse.json +2 -2
  378. package/json-schema/api/MetadataRegisterRequest.json +2 -2
  379. package/json-schema/api/MetadataTypesResponse.json +2 -2
  380. package/json-schema/api/MetadataValidateRequest.json +2 -2
  381. package/json-schema/api/MetadataValidateResponse.json +2 -2
  382. package/json-schema/api/ModificationResult.json +2 -2
  383. package/json-schema/api/Notification.json +2 -2
  384. package/json-schema/api/NotificationPreferences.json +2 -2
  385. package/json-schema/api/ODataConfig.json +2 -2
  386. package/json-schema/api/ODataError.json +2 -2
  387. package/json-schema/api/ODataFilterFunction.json +2 -2
  388. package/json-schema/api/ODataFilterOperator.json +2 -2
  389. package/json-schema/api/ODataMetadata.json +2 -2
  390. package/json-schema/api/ODataQuery.json +2 -2
  391. package/json-schema/api/ODataQueryAdapter.json +2 -2
  392. package/json-schema/api/ODataResponse.json +2 -2
  393. package/json-schema/api/ObjectQLReference.json +2 -2
  394. package/json-schema/api/OpenApi31Extensions.json +2 -2
  395. package/json-schema/api/OpenApiGenerationConfig.json +2 -2
  396. package/json-schema/api/OpenApiSecurityScheme.json +2 -2
  397. package/json-schema/api/OpenApiServer.json +2 -2
  398. package/json-schema/api/OpenApiSpec.json +2 -2
  399. package/json-schema/api/OperatorMapping.json +2 -2
  400. package/json-schema/api/PackageApiErrorCode.json +2 -2
  401. package/json-schema/api/PackagePathParams.json +2 -2
  402. package/json-schema/api/PackageRollbackRequest.json +2 -2
  403. package/json-schema/api/PackageRollbackResponse.json +2 -2
  404. package/json-schema/api/PackageUpgradeResponse.json +2 -2
  405. package/json-schema/api/PinFeedItemRequest.json +2 -2
  406. package/json-schema/api/PinFeedItemResponse.json +2 -2
  407. package/json-schema/api/PingMessage.json +2 -2
  408. package/json-schema/api/PongMessage.json +2 -2
  409. package/json-schema/api/PresenceMessage.json +2 -2
  410. package/json-schema/api/PresenceState.json +2 -2
  411. package/json-schema/api/PresenceStatus.json +2 -2
  412. package/json-schema/api/PresenceUpdate.json +2 -2
  413. package/json-schema/api/PresignedUrlResponse.json +2 -2
  414. package/json-schema/api/QueryAdapterConfig.json +2 -2
  415. package/json-schema/api/QueryAdapterTarget.json +2 -2
  416. package/json-schema/api/QueryOptimizationConfig.json +2 -2
  417. package/json-schema/api/RealtimeConfig.json +2 -2
  418. package/json-schema/api/RealtimeConnectRequest.json +2 -2
  419. package/json-schema/api/RealtimeConnectResponse.json +2 -2
  420. package/json-schema/api/RealtimeDisconnectRequest.json +2 -2
  421. package/json-schema/api/RealtimeDisconnectResponse.json +2 -2
  422. package/json-schema/api/RealtimeEvent.json +2 -2
  423. package/json-schema/api/RealtimeEventType.json +2 -2
  424. package/json-schema/api/RealtimePresence.json +2 -2
  425. package/json-schema/api/RealtimeRecordAction.json +2 -2
  426. package/json-schema/api/RealtimeSubscribeRequest.json +2 -2
  427. package/json-schema/api/RealtimeSubscribeResponse.json +2 -2
  428. package/json-schema/api/RealtimeUnsubscribeRequest.json +2 -2
  429. package/json-schema/api/RealtimeUnsubscribeResponse.json +2 -2
  430. package/json-schema/api/RecordData.json +2 -2
  431. package/json-schema/api/RefreshTokenRequest.json +2 -2
  432. package/json-schema/api/RegisterDeviceRequest.json +2 -2
  433. package/json-schema/api/RegisterDeviceResponse.json +2 -2
  434. package/json-schema/api/RegisterRequest.json +2 -2
  435. package/json-schema/api/RemoveReactionRequest.json +2 -2
  436. package/json-schema/api/RemoveReactionResponse.json +2 -2
  437. package/json-schema/api/RequestValidationConfig.json +2 -2
  438. package/json-schema/api/ResolveDependenciesResponse.json +2 -2
  439. package/json-schema/api/ResponseEnvelopeConfig.json +2 -2
  440. package/json-schema/api/RestApiConfig.json +2 -2
  441. package/json-schema/api/RestApiEndpoint.json +2 -2
  442. package/json-schema/api/RestApiPluginConfig.json +2 -2
  443. package/json-schema/api/RestApiRouteCategory.json +2 -2
  444. package/json-schema/api/RestApiRouteRegistration.json +2 -2
  445. package/json-schema/api/RestQueryAdapter.json +2 -2
  446. package/json-schema/api/RestServerConfig.json +2 -2
  447. package/json-schema/api/RetryStrategy.json +2 -2
  448. package/json-schema/api/RouteCategory.json +2 -2
  449. package/json-schema/api/RouteCoverageEntry.json +2 -2
  450. package/json-schema/api/RouteCoverageReport.json +2 -2
  451. package/json-schema/api/RouteDefinition.json +2 -2
  452. package/json-schema/api/RouteGenerationConfig.json +2 -2
  453. package/json-schema/api/RouteHealthEntry.json +2 -2
  454. package/json-schema/api/RouteHealthReport.json +2 -2
  455. package/json-schema/api/RouterConfig.json +2 -2
  456. package/json-schema/api/SaveMetaItemRequest.json +2 -2
  457. package/json-schema/api/SaveMetaItemResponse.json +2 -2
  458. package/json-schema/api/ScheduleExportResponse.json +2 -2
  459. package/json-schema/api/SchemaDefinition.json +2 -2
  460. package/json-schema/api/SearchFeedRequest.json +2 -2
  461. package/json-schema/api/SearchFeedResponse.json +2 -2
  462. package/json-schema/api/ServiceInfo.json +2 -2
  463. package/json-schema/api/ServiceStatus.json +2 -2
  464. package/json-schema/api/Session.json +2 -2
  465. package/json-schema/api/SessionResponse.json +2 -2
  466. package/json-schema/api/SessionUser.json +2 -2
  467. package/json-schema/api/SetPresenceRequest.json +2 -2
  468. package/json-schema/api/SetPresenceResponse.json +2 -2
  469. package/json-schema/api/SimpleCursorPosition.json +2 -2
  470. package/json-schema/api/SimplePresenceState.json +2 -2
  471. package/json-schema/api/SingleRecordResponse.json +2 -2
  472. package/json-schema/api/StandardErrorCode.json +2 -2
  473. package/json-schema/api/StarFeedItemRequest.json +2 -2
  474. package/json-schema/api/StarFeedItemResponse.json +2 -2
  475. package/json-schema/api/SubgraphConfig.json +2 -2
  476. package/json-schema/api/SubscribeMessage.json +2 -2
  477. package/json-schema/api/SubscribeRequest.json +2 -2
  478. package/json-schema/api/SubscribeResponse.json +2 -2
  479. package/json-schema/api/Subscription.json +2 -2
  480. package/json-schema/api/SubscriptionEvent.json +2 -2
  481. package/json-schema/api/ToggleFlowRequest.json +2 -2
  482. package/json-schema/api/ToggleFlowResponse.json +2 -2
  483. package/json-schema/api/TransportProtocol.json +2 -2
  484. package/json-schema/api/TriggerFlowRequest.json +2 -2
  485. package/json-schema/api/TriggerFlowResponse.json +2 -2
  486. package/json-schema/api/UndoImportJobResponse.json +2 -2
  487. package/json-schema/api/UninstallPackageApiRequest.json +2 -2
  488. package/json-schema/api/UninstallPackageApiResponse.json +2 -2
  489. package/json-schema/api/UninstallPackageRequest.json +2 -2
  490. package/json-schema/api/UninstallPackageResponse.json +2 -2
  491. package/json-schema/api/UnpinFeedItemRequest.json +2 -2
  492. package/json-schema/api/UnpinFeedItemResponse.json +2 -2
  493. package/json-schema/api/UnregisterDeviceRequest.json +2 -2
  494. package/json-schema/api/UnregisterDeviceResponse.json +2 -2
  495. package/json-schema/api/UnstarFeedItemRequest.json +2 -2
  496. package/json-schema/api/UnstarFeedItemResponse.json +2 -2
  497. package/json-schema/api/UnsubscribeMessage.json +2 -2
  498. package/json-schema/api/UnsubscribeRequest.json +2 -2
  499. package/json-schema/api/UnsubscribeResponse.json +2 -2
  500. package/json-schema/api/UpdateDataRequest.json +2 -2
  501. package/json-schema/api/UpdateDataResponse.json +2 -2
  502. package/json-schema/api/UpdateFeedItemRequest.json +2 -2
  503. package/json-schema/api/UpdateFeedItemResponse.json +2 -2
  504. package/json-schema/api/UpdateManyDataRequest.json +2 -2
  505. package/json-schema/api/UpdateManyDataResponse.json +2 -2
  506. package/json-schema/api/UpdateManyRequest.json +2 -2
  507. package/json-schema/api/UpdateNotificationPreferencesRequest.json +2 -2
  508. package/json-schema/api/UpdateNotificationPreferencesResponse.json +2 -2
  509. package/json-schema/api/UpdateRequest.json +2 -2
  510. package/json-schema/api/UploadArtifactRequest.json +2 -2
  511. package/json-schema/api/UploadArtifactResponse.json +2 -2
  512. package/json-schema/api/UploadChunkRequest.json +2 -2
  513. package/json-schema/api/UploadChunkResponse.json +2 -2
  514. package/json-schema/api/UploadProgress.json +2 -2
  515. package/json-schema/api/UserProfileResponse.json +2 -2
  516. package/json-schema/api/ValidationMode.json +2 -2
  517. package/json-schema/api/VersionDefinition.json +2 -2
  518. package/json-schema/api/VersionNegotiationResponse.json +2 -2
  519. package/json-schema/api/VersionStatus.json +2 -2
  520. package/json-schema/api/VersioningConfig.json +2 -2
  521. package/json-schema/api/VersioningStrategy.json +2 -2
  522. package/json-schema/api/WebSocketConfig.json +2 -2
  523. package/json-schema/api/WebSocketEvent.json +2 -2
  524. package/json-schema/api/WebSocketMessage.json +2 -2
  525. package/json-schema/api/WebSocketMessageType.json +2 -2
  526. package/json-schema/api/WebSocketPresenceStatus.json +2 -2
  527. package/json-schema/api/WebSocketServerConfig.json +2 -2
  528. package/json-schema/api/WebhookConfig.json +2 -2
  529. package/json-schema/api/WebhookEvent.json +2 -2
  530. package/json-schema/api/WellKnownCapabilities.json +2 -2
  531. package/json-schema/api/WorkflowState.json +2 -2
  532. package/json-schema/api/WorkflowTransitionRequest.json +2 -2
  533. package/json-schema/api/WorkflowTransitionResponse.json +2 -2
  534. package/json-schema/automation/ActionCategory.json +2 -2
  535. package/json-schema/automation/ActionDescriptor.json +2 -2
  536. package/json-schema/automation/ActionParadigm.json +2 -2
  537. package/json-schema/automation/ActionRef.json +2 -2
  538. package/json-schema/automation/ApprovalDecision.json +2 -2
  539. package/json-schema/automation/ApprovalEscalation.json +2 -2
  540. package/json-schema/automation/ApprovalNodeApprover.json +2 -2
  541. package/json-schema/automation/ApprovalNodeConfig.json +2 -2
  542. package/json-schema/automation/ApproverType.json +2 -2
  543. package/json-schema/automation/AuthField.json +2 -2
  544. package/json-schema/automation/Authentication.json +2 -2
  545. package/json-schema/automation/AuthenticationType.json +2 -2
  546. package/json-schema/automation/BpmnDiagnostic.json +2 -2
  547. package/json-schema/automation/BpmnElementMapping.json +2 -2
  548. package/json-schema/automation/BpmnExportOptions.json +2 -2
  549. package/json-schema/automation/BpmnImportOptions.json +2 -2
  550. package/json-schema/automation/BpmnInteropResult.json +2 -2
  551. package/json-schema/automation/BpmnUnmappedStrategy.json +2 -2
  552. package/json-schema/automation/BpmnVersion.json +2 -2
  553. package/json-schema/automation/Checkpoint.json +2 -2
  554. package/json-schema/automation/ConcurrencyPolicy.json +2 -2
  555. package/json-schema/automation/ConflictResolution.json +2 -2
  556. package/json-schema/automation/Connector.json +2 -2
  557. package/json-schema/automation/ConnectorCategory.json +2 -2
  558. package/json-schema/automation/ConnectorInstance.json +2 -2
  559. package/json-schema/automation/ConnectorOperation.json +2 -2
  560. package/json-schema/automation/ConnectorTrigger.json +2 -2
  561. package/json-schema/automation/DataSourceConfig.json +2 -2
  562. package/json-schema/automation/ETLDestination.json +2 -2
  563. package/json-schema/automation/ETLEndpointType.json +2 -2
  564. package/json-schema/automation/ETLPipelineRun.json +2 -2
  565. package/json-schema/automation/ETLRunStatus.json +2 -2
  566. package/json-schema/automation/ETLSource.json +2 -2
  567. package/json-schema/automation/ETLSyncMode.json +2 -2
  568. package/json-schema/automation/ETLTransformation.json +2 -2
  569. package/json-schema/automation/ETLTransformationType.json +2 -2
  570. package/json-schema/automation/Event.json +2 -2
  571. package/json-schema/automation/ExecutionError.json +2 -2
  572. package/json-schema/automation/ExecutionErrorSeverity.json +2 -2
  573. package/json-schema/automation/ExecutionLog.json +2 -2
  574. package/json-schema/automation/ExecutionStatus.json +2 -2
  575. package/json-schema/automation/ExecutionStepLog.json +2 -2
  576. package/json-schema/automation/FlowNode.json +2 -2
  577. package/json-schema/automation/FlowNodeAction.json +2 -2
  578. package/json-schema/automation/FlowVariable.json +2 -2
  579. package/json-schema/automation/GuardRef.json +2 -2
  580. package/json-schema/automation/NodeExecutorDescriptor.json +2 -2
  581. package/json-schema/automation/OAuth2Config.json +2 -2
  582. package/json-schema/automation/OperationParameter.json +2 -2
  583. package/json-schema/automation/OperationType.json +2 -2
  584. package/json-schema/automation/RetryPolicy.json +2 -2
  585. package/json-schema/automation/StateMachine.json +2 -2
  586. package/json-schema/automation/StateNode.json +2 -2
  587. package/json-schema/automation/SyncDirection.json +2 -2
  588. package/json-schema/automation/SyncExecutionResult.json +2 -2
  589. package/json-schema/automation/SyncExecutionStatus.json +2 -2
  590. package/json-schema/automation/SyncMode.json +2 -2
  591. package/json-schema/automation/Transition.json +2 -2
  592. package/json-schema/automation/WaitEventType.json +2 -2
  593. package/json-schema/automation/WaitExecutorConfig.json +2 -2
  594. package/json-schema/automation/WaitResumePayload.json +2 -2
  595. package/json-schema/automation/WaitTimeoutBehavior.json +2 -2
  596. package/json-schema/automation/Webhook.json +2 -2
  597. package/json-schema/automation/WebhookReceiver.json +2 -2
  598. package/json-schema/automation/WebhookTriggerType.json +2 -2
  599. package/json-schema/cloud/AnalyticsTimeRange.json +2 -2
  600. package/json-schema/cloud/AppDiscoveryRequest.json +2 -2
  601. package/json-schema/cloud/AppDiscoveryResponse.json +2 -2
  602. package/json-schema/cloud/AppSubscription.json +2 -2
  603. package/json-schema/cloud/ArtifactDownloadResponse.json +2 -2
  604. package/json-schema/cloud/ArtifactReference.json +2 -2
  605. package/json-schema/cloud/CreateListingRequest.json +2 -2
  606. package/json-schema/cloud/CreatePackageRequest.json +2 -2
  607. package/json-schema/cloud/CreatePackageVersionRequest.json +2 -2
  608. package/json-schema/cloud/CuratedCollection.json +2 -2
  609. package/json-schema/cloud/Environment.json +2 -2
  610. package/json-schema/cloud/EnvironmentCredential.json +2 -2
  611. package/json-schema/cloud/EnvironmentCredentialStatus.json +2 -2
  612. package/json-schema/cloud/EnvironmentDriver.json +2 -2
  613. package/json-schema/cloud/EnvironmentMember.json +2 -2
  614. package/json-schema/cloud/EnvironmentPackageInstallation.json +2 -2
  615. package/json-schema/cloud/EnvironmentPackageStatus.json +2 -2
  616. package/json-schema/cloud/EnvironmentRole.json +2 -2
  617. package/json-schema/cloud/EnvironmentStatus.json +2 -2
  618. package/json-schema/cloud/EnvironmentType.json +2 -2
  619. package/json-schema/cloud/EnvironmentVisibility.json +2 -2
  620. package/json-schema/cloud/FeaturedListing.json +2 -2
  621. package/json-schema/cloud/InstallPackageToEnvironmentRequest.json +2 -2
  622. package/json-schema/cloud/InstalledAppSummary.json +2 -2
  623. package/json-schema/cloud/ListEnvironmentPackagesResponse.json +2 -2
  624. package/json-schema/cloud/ListInstalledAppsRequest.json +2 -2
  625. package/json-schema/cloud/ListInstalledAppsResponse.json +2 -2
  626. package/json-schema/cloud/ListReviewsRequest.json +2 -2
  627. package/json-schema/cloud/ListReviewsResponse.json +2 -2
  628. package/json-schema/cloud/ListingActionRequest.json +2 -2
  629. package/json-schema/cloud/ListingStatus.json +2 -2
  630. package/json-schema/cloud/MarketplaceCategory.json +2 -2
  631. package/json-schema/cloud/MarketplaceHealthMetrics.json +2 -2
  632. package/json-schema/cloud/MarketplaceInstallRequest.json +2 -2
  633. package/json-schema/cloud/MarketplaceInstallResponse.json +2 -2
  634. package/json-schema/cloud/MarketplaceListing.json +2 -2
  635. package/json-schema/cloud/MarketplaceSearchRequest.json +2 -2
  636. package/json-schema/cloud/MarketplaceSearchResponse.json +2 -2
  637. package/json-schema/cloud/Package.json +2 -2
  638. package/json-schema/cloud/PackageCategory.json +2 -2
  639. package/json-schema/cloud/PackageDependency.json +2 -2
  640. package/json-schema/cloud/PackageInstallation.json +2 -2
  641. package/json-schema/cloud/PackageInstallationStatus.json +2 -2
  642. package/json-schema/cloud/PackageLocale.json +2 -2
  643. package/json-schema/cloud/PackageManifest.json +2 -2
  644. package/json-schema/cloud/PackagePublisher.json +2 -2
  645. package/json-schema/cloud/PackageSubmission.json +2 -2
  646. package/json-schema/cloud/PackageTranslation.json +2 -2
  647. package/json-schema/cloud/PackageTranslations.json +2 -2
  648. package/json-schema/cloud/PackageVersion.json +2 -2
  649. package/json-schema/cloud/PackageVersionStatus.json +2 -2
  650. package/json-schema/cloud/PackageVisibility.json +2 -2
  651. package/json-schema/cloud/PolicyAction.json +2 -2
  652. package/json-schema/cloud/PolicyViolationType.json +2 -2
  653. package/json-schema/cloud/PricingModel.json +2 -2
  654. package/json-schema/cloud/ProvisionEnvironmentRequest.json +2 -2
  655. package/json-schema/cloud/ProvisionEnvironmentResponse.json +2 -2
  656. package/json-schema/cloud/ProvisionOrganizationRequest.json +2 -2
  657. package/json-schema/cloud/ProvisionOrganizationResponse.json +2 -2
  658. package/json-schema/cloud/ProvisionTenantRequest.json +2 -2
  659. package/json-schema/cloud/ProvisionTenantResponse.json +2 -2
  660. package/json-schema/cloud/PublishPackageVersionRequest.json +2 -2
  661. package/json-schema/cloud/Publisher.json +2 -2
  662. package/json-schema/cloud/PublisherProfile.json +2 -2
  663. package/json-schema/cloud/PublisherVerification.json +2 -2
  664. package/json-schema/cloud/PublishingAnalyticsRequest.json +2 -2
  665. package/json-schema/cloud/PublishingAnalyticsResponse.json +2 -2
  666. package/json-schema/cloud/RecommendationReason.json +2 -2
  667. package/json-schema/cloud/RecommendedApp.json +2 -2
  668. package/json-schema/cloud/RejectionReason.json +2 -2
  669. package/json-schema/cloud/ReleaseChannel.json +2 -2
  670. package/json-schema/cloud/ReviewCriterion.json +2 -2
  671. package/json-schema/cloud/ReviewDecision.json +2 -2
  672. package/json-schema/cloud/ReviewModerationStatus.json +2 -2
  673. package/json-schema/cloud/RollbackEnvironmentPackageRequest.json +2 -2
  674. package/json-schema/cloud/Sha256Digest.json +2 -2
  675. package/json-schema/cloud/SubmissionReview.json +2 -2
  676. package/json-schema/cloud/SubmitReviewRequest.json +2 -2
  677. package/json-schema/cloud/SubscriptionStatus.json +2 -2
  678. package/json-schema/cloud/TemplateManifest.json +2 -2
  679. package/json-schema/cloud/TenantContext.json +2 -2
  680. package/json-schema/cloud/TenantDatabase.json +2 -2
  681. package/json-schema/cloud/TenantDatabaseStatus.json +2 -2
  682. package/json-schema/cloud/TenantIdentificationSource.json +2 -2
  683. package/json-schema/cloud/TenantPlan.json +2 -2
  684. package/json-schema/cloud/TenantRoutingConfig.json +2 -2
  685. package/json-schema/cloud/TimeSeriesPoint.json +2 -2
  686. package/json-schema/cloud/TrendingListing.json +2 -2
  687. package/json-schema/cloud/UpdateListingRequest.json +2 -2
  688. package/json-schema/cloud/UpdatePackageRequest.json +2 -2
  689. package/json-schema/cloud/UpdatePackageVersionRequest.json +2 -2
  690. package/json-schema/cloud/UpgradeEnvironmentPackageRequest.json +2 -2
  691. package/json-schema/cloud/UserReview.json +2 -2
  692. package/json-schema/cloud/VersionRelease.json +2 -2
  693. package/json-schema/data/Address.json +2 -2
  694. package/json-schema/data/AggregationFunction.json +2 -2
  695. package/json-schema/data/AggregationMetricType.json +2 -2
  696. package/json-schema/data/AggregationNode.json +2 -2
  697. package/json-schema/data/AggregationPipeline.json +2 -2
  698. package/json-schema/data/AggregationStage.json +2 -2
  699. package/json-schema/data/AnalyticsQuery.json +2 -2
  700. package/json-schema/data/ApiMethod.json +2 -2
  701. package/json-schema/data/BaseEngineOptions.json +5 -2
  702. package/json-schema/data/ComputedFieldCache.json +2 -2
  703. package/json-schema/data/ConsistencyLevel.json +2 -2
  704. package/json-schema/data/Cube.json +2 -2
  705. package/json-schema/data/CubeJoin.json +2 -2
  706. package/json-schema/data/CurrencyConfig.json +2 -2
  707. package/json-schema/data/CurrencyValue.json +2 -2
  708. package/json-schema/data/DataEngineAggregateOptions.json +5 -2
  709. package/json-schema/data/DataEngineAggregateRequest.json +5 -2
  710. package/json-schema/data/DataEngineBatchRequest.json +23 -2
  711. package/json-schema/data/DataEngineCountOptions.json +5 -2
  712. package/json-schema/data/DataEngineCountRequest.json +5 -2
  713. package/json-schema/data/DataEngineDeleteOptions.json +5 -2
  714. package/json-schema/data/DataEngineDeleteRequest.json +5 -2
  715. package/json-schema/data/DataEngineExecuteRequest.json +2 -2
  716. package/json-schema/data/DataEngineFilter.json +2 -2
  717. package/json-schema/data/DataEngineFindOneRequest.json +5 -2
  718. package/json-schema/data/DataEngineFindRequest.json +5 -2
  719. package/json-schema/data/DataEngineInsertOptions.json +5 -2
  720. package/json-schema/data/DataEngineInsertRequest.json +5 -2
  721. package/json-schema/data/DataEngineQueryOptions.json +5 -2
  722. package/json-schema/data/DataEngineRequest.json +44 -2
  723. package/json-schema/data/DataEngineSort.json +2 -2
  724. package/json-schema/data/DataEngineUpdateOptions.json +5 -2
  725. package/json-schema/data/DataEngineUpdateRequest.json +5 -2
  726. package/json-schema/data/DataEngineVectorFindRequest.json +2 -2
  727. package/json-schema/data/DataQualityRules.json +2 -2
  728. package/json-schema/data/DataTypeMapping.json +2 -2
  729. package/json-schema/data/Datasource.json +2 -2
  730. package/json-schema/data/DatasourceCapabilities.json +2 -2
  731. package/json-schema/data/DateGranularity.json +2 -2
  732. package/json-schema/data/DateMacroPlaceholder.json +2 -2
  733. package/json-schema/data/DateMacroToken.json +2 -2
  734. package/json-schema/data/Dimension.json +2 -2
  735. package/json-schema/data/DimensionType.json +2 -2
  736. package/json-schema/data/Document.json +2 -2
  737. package/json-schema/data/DocumentTemplate.json +2 -2
  738. package/json-schema/data/DocumentValidationSchema.json +2 -2
  739. package/json-schema/data/DocumentVersion.json +2 -2
  740. package/json-schema/data/DriverCapabilities.json +2 -2
  741. package/json-schema/data/DriverConfig.json +2 -2
  742. package/json-schema/data/DriverDefinition.json +2 -2
  743. package/json-schema/data/DriverOptions.json +2 -2
  744. package/json-schema/data/DriverType.json +2 -2
  745. package/json-schema/data/ESignatureConfig.json +2 -2
  746. package/json-schema/data/EngineAggregateOptions.json +5 -2
  747. package/json-schema/data/EngineCountOptions.json +5 -2
  748. package/json-schema/data/EngineDeleteOptions.json +5 -2
  749. package/json-schema/data/EngineQueryOptions.json +5 -2
  750. package/json-schema/data/EngineUpdateOptions.json +5 -2
  751. package/json-schema/data/EqualityOperator.json +2 -2
  752. package/json-schema/data/ExpressionBody.json +2 -2
  753. package/json-schema/data/ExternalCatalog.json +2 -2
  754. package/json-schema/data/ExternalColumn.json +2 -2
  755. package/json-schema/data/ExternalDataSource.json +2 -2
  756. package/json-schema/data/ExternalDatasourceSettings.json +2 -2
  757. package/json-schema/data/ExternalTable.json +2 -2
  758. package/json-schema/data/FeedActor.json +2 -2
  759. package/json-schema/data/FeedFilterMode.json +2 -2
  760. package/json-schema/data/FeedItem.json +2 -2
  761. package/json-schema/data/FeedItemType.json +2 -2
  762. package/json-schema/data/FeedVisibility.json +2 -2
  763. package/json-schema/data/FieldChangeEntry.json +2 -2
  764. package/json-schema/data/FieldMapping.json +2 -2
  765. package/json-schema/data/FieldNode.json +2 -2
  766. package/json-schema/data/FieldReference.json +2 -2
  767. package/json-schema/data/FieldType.json +2 -2
  768. package/json-schema/data/FileAttachmentConfig.json +2 -2
  769. package/json-schema/data/FilterCondition.json +2 -2
  770. package/json-schema/data/FormatValidation.json +2 -2
  771. package/json-schema/data/FullTextSearch.json +2 -2
  772. package/json-schema/data/GroupByNode.json +2 -2
  773. package/json-schema/data/HookBody.json +2 -2
  774. package/json-schema/data/HookBodyCapability.json +2 -2
  775. package/json-schema/data/HookContext.json +6 -2
  776. package/json-schema/data/HookEvent.json +2 -2
  777. package/json-schema/data/Index.json +2 -2
  778. package/json-schema/data/JSONValidation.json +2 -2
  779. package/json-schema/data/JoinNode.json +2 -2
  780. package/json-schema/data/JoinStrategy.json +2 -2
  781. package/json-schema/data/JoinType.json +2 -2
  782. package/json-schema/data/LocationCoordinates.json +2 -2
  783. package/json-schema/data/Mapping.json +2 -2
  784. package/json-schema/data/Mention.json +2 -2
  785. package/json-schema/data/Metric.json +2 -2
  786. package/json-schema/data/ModeSchema.json +2 -2
  787. package/json-schema/data/NoSQLDataTypeMapping.json +2 -2
  788. package/json-schema/data/NoSQLDatabaseType.json +2 -2
  789. package/json-schema/data/NoSQLDriverConfig.json +2 -2
  790. package/json-schema/data/NoSQLIndex.json +2 -2
  791. package/json-schema/data/NoSQLIndexType.json +2 -2
  792. package/json-schema/data/NoSQLOperationType.json +2 -2
  793. package/json-schema/data/NoSQLQueryOptions.json +2 -2
  794. package/json-schema/data/NoSQLTransactionOptions.json +2 -2
  795. package/json-schema/data/NotificationChannel.json +2 -2
  796. package/json-schema/data/ObjectAccessConfig.json +2 -2
  797. package/json-schema/data/ObjectCapabilities.json +2 -2
  798. package/json-schema/data/ObjectDependencyGraph.json +2 -2
  799. package/json-schema/data/ObjectDependencyNode.json +2 -2
  800. package/json-schema/data/ObjectExternalBinding.json +2 -2
  801. package/json-schema/data/ObjectFieldGroup.json +2 -2
  802. package/json-schema/data/ObjectOwnershipEnum.json +2 -2
  803. package/json-schema/data/PoolConfig.json +2 -2
  804. package/json-schema/data/Query.json +2 -2
  805. package/json-schema/data/QueryFilter.json +2 -2
  806. package/json-schema/data/Reaction.json +2 -2
  807. package/json-schema/data/RecordSubscription.json +2 -2
  808. package/json-schema/data/ReferenceResolution.json +2 -2
  809. package/json-schema/data/ReferenceResolutionError.json +2 -2
  810. package/json-schema/data/ReplicationConfig.json +2 -2
  811. package/json-schema/data/SQLDialect.json +2 -2
  812. package/json-schema/data/SQLDriverConfig.json +2 -2
  813. package/json-schema/data/SSLConfig.json +2 -2
  814. package/json-schema/data/ScriptBody.json +2 -2
  815. package/json-schema/data/SearchConfig.json +2 -2
  816. package/json-schema/data/Seed.json +2 -2
  817. package/json-schema/data/SeedIdentity.json +2 -2
  818. package/json-schema/data/SeedLoadResult.json +2 -2
  819. package/json-schema/data/SeedLoaderConfig.json +2 -2
  820. package/json-schema/data/SeedLoaderRequest.json +2 -2
  821. package/json-schema/data/SeedLoaderResult.json +2 -2
  822. package/json-schema/data/SeedMode.json +2 -2
  823. package/json-schema/data/SetOperator.json +2 -2
  824. package/json-schema/data/ShardingConfig.json +2 -2
  825. package/json-schema/data/SoftDeleteConfig.json +2 -2
  826. package/json-schema/data/SortNode.json +2 -2
  827. package/json-schema/data/SpecialOperator.json +2 -2
  828. package/json-schema/data/StateMachineValidation.json +2 -2
  829. package/json-schema/data/StringOperator.json +2 -2
  830. package/json-schema/data/SubscriptionEventType.json +2 -2
  831. package/json-schema/data/TenancyConfig.json +2 -2
  832. package/json-schema/data/TimeUpdateInterval.json +2 -2
  833. package/json-schema/data/TransformType.json +2 -2
  834. package/json-schema/data/VectorConfig.json +2 -2
  835. package/json-schema/data/VersioningConfig.json +2 -2
  836. package/json-schema/data/WindowFunction.json +2 -2
  837. package/json-schema/data/WindowFunctionNode.json +2 -2
  838. package/json-schema/data/WindowSpec.json +2 -2
  839. package/json-schema/identity/Account.json +2 -2
  840. package/json-schema/identity/ApiKey.json +2 -2
  841. package/json-schema/identity/EvalUser.json +2 -2
  842. package/json-schema/identity/Invitation.json +2 -2
  843. package/json-schema/identity/InvitationStatus.json +2 -2
  844. package/json-schema/identity/Member.json +2 -2
  845. package/json-schema/identity/Organization.json +2 -2
  846. package/json-schema/identity/Role.json +2 -2
  847. package/json-schema/identity/SCIMAddress.json +2 -2
  848. package/json-schema/identity/SCIMBulkOperation.json +2 -2
  849. package/json-schema/identity/SCIMBulkRequest.json +2 -2
  850. package/json-schema/identity/SCIMBulkResponse.json +2 -2
  851. package/json-schema/identity/SCIMBulkResponseOperation.json +2 -2
  852. package/json-schema/identity/SCIMEmail.json +2 -2
  853. package/json-schema/identity/SCIMEnterpriseUser.json +2 -2
  854. package/json-schema/identity/SCIMError.json +2 -2
  855. package/json-schema/identity/SCIMGroup.json +2 -2
  856. package/json-schema/identity/SCIMGroupReference.json +2 -2
  857. package/json-schema/identity/SCIMListResponse.json +2 -2
  858. package/json-schema/identity/SCIMMemberReference.json +2 -2
  859. package/json-schema/identity/SCIMMeta.json +2 -2
  860. package/json-schema/identity/SCIMName.json +2 -2
  861. package/json-schema/identity/SCIMPatchOperation.json +2 -2
  862. package/json-schema/identity/SCIMPatchRequest.json +2 -2
  863. package/json-schema/identity/SCIMPhoneNumber.json +2 -2
  864. package/json-schema/identity/SCIMUser.json +2 -2
  865. package/json-schema/identity/Session.json +2 -2
  866. package/json-schema/identity/User.json +2 -2
  867. package/json-schema/identity/VerificationToken.json +2 -2
  868. package/json-schema/integration/AckMode.json +2 -2
  869. package/json-schema/integration/ApiVersionConfig.json +2 -2
  870. package/json-schema/integration/BuildConfig.json +2 -2
  871. package/json-schema/integration/CdcConfig.json +2 -2
  872. package/json-schema/integration/CircuitBreakerConfig.json +2 -2
  873. package/json-schema/integration/ConflictResolution.json +2 -2
  874. package/json-schema/integration/ConnectorAction.json +2 -2
  875. package/json-schema/integration/ConnectorHealth.json +2 -2
  876. package/json-schema/integration/ConnectorStatus.json +2 -2
  877. package/json-schema/integration/ConnectorTrigger.json +2 -2
  878. package/json-schema/integration/ConnectorType.json +2 -2
  879. package/json-schema/integration/ConsumerConfig.json +2 -2
  880. package/json-schema/integration/DatabasePoolConfig.json +2 -2
  881. package/json-schema/integration/DatabaseProvider.json +2 -2
  882. package/json-schema/integration/DeliveryGuarantee.json +2 -2
  883. package/json-schema/integration/DeploymentConfig.json +2 -2
  884. package/json-schema/integration/DlqConfig.json +2 -2
  885. package/json-schema/integration/DomainConfig.json +2 -2
  886. package/json-schema/integration/EdgeFunctionConfig.json +2 -2
  887. package/json-schema/integration/EnvironmentVariables.json +2 -2
  888. package/json-schema/integration/ErrorCategory.json +2 -2
  889. package/json-schema/integration/ErrorMappingConfig.json +2 -2
  890. package/json-schema/integration/ErrorMappingRule.json +2 -2
  891. package/json-schema/integration/FileAccessPattern.json +2 -2
  892. package/json-schema/integration/FileFilterConfig.json +2 -2
  893. package/json-schema/integration/FileMetadataConfig.json +2 -2
  894. package/json-schema/integration/FileStorageProvider.json +2 -2
  895. package/json-schema/integration/FileVersioningConfig.json +2 -2
  896. package/json-schema/integration/GitHubActionsWorkflow.json +2 -2
  897. package/json-schema/integration/GitHubCommitConfig.json +2 -2
  898. package/json-schema/integration/GitHubIssueTracking.json +2 -2
  899. package/json-schema/integration/GitHubProvider.json +2 -2
  900. package/json-schema/integration/GitHubReleaseConfig.json +2 -2
  901. package/json-schema/integration/GitHubRepository.json +2 -2
  902. package/json-schema/integration/GitRepositoryConfig.json +2 -2
  903. package/json-schema/integration/HealthCheckConfig.json +2 -2
  904. package/json-schema/integration/MessageFormat.json +2 -2
  905. package/json-schema/integration/MessageQueueProvider.json +2 -2
  906. package/json-schema/integration/MultipartUploadConfig.json +2 -2
  907. package/json-schema/integration/ProducerConfig.json +2 -2
  908. package/json-schema/integration/RateLimitConfig.json +2 -2
  909. package/json-schema/integration/RateLimitStrategy.json +2 -2
  910. package/json-schema/integration/RetryConfig.json +2 -2
  911. package/json-schema/integration/RetryStrategy.json +2 -2
  912. package/json-schema/integration/SaasProvider.json +2 -2
  913. package/json-schema/integration/SslConfig.json +2 -2
  914. package/json-schema/integration/StorageBucket.json +2 -2
  915. package/json-schema/integration/SyncStrategy.json +2 -2
  916. package/json-schema/integration/TopicQueue.json +2 -2
  917. package/json-schema/integration/VercelFramework.json +2 -2
  918. package/json-schema/integration/VercelMonitoring.json +2 -2
  919. package/json-schema/integration/VercelProject.json +2 -2
  920. package/json-schema/integration/VercelProvider.json +2 -2
  921. package/json-schema/integration/VercelTeam.json +2 -2
  922. package/json-schema/integration/WebhookConfig.json +2 -2
  923. package/json-schema/integration/WebhookEvent.json +2 -2
  924. package/json-schema/integration/WebhookSignatureAlgorithm.json +2 -2
  925. package/json-schema/kernel/ActivationEvent.json +2 -2
  926. package/json-schema/kernel/AdvancedPluginLifecycleConfig.json +2 -2
  927. package/json-schema/kernel/ArtifactChecksum.json +2 -2
  928. package/json-schema/kernel/ArtifactFileEntry.json +2 -2
  929. package/json-schema/kernel/ArtifactSignature.json +2 -2
  930. package/json-schema/kernel/BreakingChange.json +2 -2
  931. package/json-schema/kernel/CLICommandContribution.json +2 -2
  932. package/json-schema/kernel/CapabilityConformanceLevel.json +2 -2
  933. package/json-schema/kernel/ClusterCapabilityConfig.json +2 -2
  934. package/json-schema/kernel/ClusterDriver.json +2 -2
  935. package/json-schema/kernel/ClusterTenantIsolation.json +2 -2
  936. package/json-schema/kernel/CompatibilityLevel.json +2 -2
  937. package/json-schema/kernel/CompatibilityMatrixEntry.json +2 -2
  938. package/json-schema/kernel/CustomizationOrigin.json +2 -2
  939. package/json-schema/kernel/CustomizationPolicy.json +2 -2
  940. package/json-schema/kernel/DeadLetterQueueEntry.json +2 -2
  941. package/json-schema/kernel/DependencyConflict.json +2 -2
  942. package/json-schema/kernel/DependencyGraph.json +2 -2
  943. package/json-schema/kernel/DependencyGraphNode.json +2 -2
  944. package/json-schema/kernel/DependencyResolutionResult.json +2 -2
  945. package/json-schema/kernel/DependencyStatusEnum.json +2 -2
  946. package/json-schema/kernel/DeprecationNotice.json +2 -2
  947. package/json-schema/kernel/DevFixtureConfig.json +2 -2
  948. package/json-schema/kernel/DevPluginConfig.json +2 -2
  949. package/json-schema/kernel/DevPluginPreset.json +2 -2
  950. package/json-schema/kernel/DevServiceOverride.json +2 -2
  951. package/json-schema/kernel/DevToolsConfig.json +2 -2
  952. package/json-schema/kernel/DisablePackageRequest.json +2 -2
  953. package/json-schema/kernel/DistributedStateConfig.json +2 -2
  954. package/json-schema/kernel/DynamicLoadRequest.json +2 -2
  955. package/json-schema/kernel/DynamicLoadingConfig.json +2 -2
  956. package/json-schema/kernel/DynamicPluginOperation.json +2 -2
  957. package/json-schema/kernel/DynamicPluginResult.json +2 -2
  958. package/json-schema/kernel/DynamicUnloadRequest.json +2 -2
  959. package/json-schema/kernel/EnablePackageRequest.json +2 -2
  960. package/json-schema/kernel/Event.json +2 -2
  961. package/json-schema/kernel/EventBusConfig.json +2 -2
  962. package/json-schema/kernel/EventClusterOptions.json +2 -2
  963. package/json-schema/kernel/EventDeliverySemantics.json +2 -2
  964. package/json-schema/kernel/EventHandler.json +2 -2
  965. package/json-schema/kernel/EventLogEntry.json +2 -2
  966. package/json-schema/kernel/EventMessageQueueConfig.json +2 -2
  967. package/json-schema/kernel/EventMetadata.json +2 -2
  968. package/json-schema/kernel/EventPersistence.json +2 -2
  969. package/json-schema/kernel/EventPhase.json +2 -2
  970. package/json-schema/kernel/EventPriority.json +2 -2
  971. package/json-schema/kernel/EventQueueConfig.json +2 -2
  972. package/json-schema/kernel/EventReplayConfig.json +2 -2
  973. package/json-schema/kernel/EventRoute.json +2 -2
  974. package/json-schema/kernel/EventScope.json +2 -2
  975. package/json-schema/kernel/EventSourcingConfig.json +2 -2
  976. package/json-schema/kernel/EventTypeDefinition.json +2 -2
  977. package/json-schema/kernel/EventWebhookConfig.json +2 -2
  978. package/json-schema/kernel/ExecutionContext.json +5 -2
  979. package/json-schema/kernel/ExtensionPoint.json +2 -2
  980. package/json-schema/kernel/FeatureStrategy.json +2 -2
  981. package/json-schema/kernel/FieldChange.json +2 -2
  982. package/json-schema/kernel/GetPackageRequest.json +2 -2
  983. package/json-schema/kernel/GracefulDegradation.json +2 -2
  984. package/json-schema/kernel/HealthStatus.json +2 -2
  985. package/json-schema/kernel/HookRegisteredEvent.json +2 -2
  986. package/json-schema/kernel/HookTriggeredEvent.json +2 -2
  987. package/json-schema/kernel/HotReloadConfig.json +2 -2
  988. package/json-schema/kernel/KernelContext.json +2 -2
  989. package/json-schema/kernel/KernelEventBase.json +2 -2
  990. package/json-schema/kernel/KernelReadyEvent.json +2 -2
  991. package/json-schema/kernel/KernelSecurityPolicy.json +2 -2
  992. package/json-schema/kernel/KernelSecurityScanResult.json +2 -2
  993. package/json-schema/kernel/KernelSecurityVulnerability.json +2 -2
  994. package/json-schema/kernel/KernelShutdownEvent.json +2 -2
  995. package/json-schema/kernel/ListPackagesRequest.json +2 -2
  996. package/json-schema/kernel/ManifestPermissions.json +2 -2
  997. package/json-schema/kernel/MergeConflict.json +2 -2
  998. package/json-schema/kernel/MergeResult.json +2 -2
  999. package/json-schema/kernel/MergeStrategyConfig.json +2 -2
  1000. package/json-schema/kernel/MetadataBulkRegisterRequest.json +2 -2
  1001. package/json-schema/kernel/MetadataBulkResult.json +2 -2
  1002. package/json-schema/kernel/MetadataCategoryEnum.json +2 -2
  1003. package/json-schema/kernel/MetadataChangeOperation.json +2 -2
  1004. package/json-schema/kernel/MetadataChangeType.json +2 -2
  1005. package/json-schema/kernel/MetadataCollectionInfo.json +2 -2
  1006. package/json-schema/kernel/MetadataDependency.json +2 -2
  1007. package/json-schema/kernel/MetadataDiffItem.json +2 -2
  1008. package/json-schema/kernel/MetadataEvent.json +2 -2
  1009. package/json-schema/kernel/MetadataFallbackStrategy.json +2 -2
  1010. package/json-schema/kernel/MetadataFormat.json +2 -2
  1011. package/json-schema/kernel/MetadataImportOptions.json +2 -2
  1012. package/json-schema/kernel/MetadataLoadResult.json +2 -2
  1013. package/json-schema/kernel/MetadataLoaderContract.json +2 -2
  1014. package/json-schema/kernel/MetadataLock.json +2 -2
  1015. package/json-schema/kernel/MetadataLockSource.json +2 -2
  1016. package/json-schema/kernel/MetadataManagerConfig.json +2 -2
  1017. package/json-schema/kernel/MetadataOverlay.json +2 -2
  1018. package/json-schema/kernel/MetadataProvenance.json +2 -2
  1019. package/json-schema/kernel/MetadataQuery.json +2 -2
  1020. package/json-schema/kernel/MetadataQueryResult.json +2 -2
  1021. package/json-schema/kernel/MetadataSaveOptions.json +2 -2
  1022. package/json-schema/kernel/MetadataSaveResult.json +2 -2
  1023. package/json-schema/kernel/MetadataStats.json +2 -2
  1024. package/json-schema/kernel/MetadataType.json +2 -2
  1025. package/json-schema/kernel/MetadataValidationResult.json +2 -2
  1026. package/json-schema/kernel/MetadataWatchEvent.json +2 -2
  1027. package/json-schema/kernel/NamespaceConflictError.json +2 -2
  1028. package/json-schema/kernel/NamespaceRegistryEntry.json +2 -2
  1029. package/json-schema/kernel/OclifPluginConfig.json +2 -2
  1030. package/json-schema/kernel/OpsDomainModule.json +2 -2
  1031. package/json-schema/kernel/OpsFilePath.json +2 -2
  1032. package/json-schema/kernel/OpsPluginStructure.json +2 -2
  1033. package/json-schema/kernel/PackageArtifact.json +2 -2
  1034. package/json-schema/kernel/PackageDependency.json +2 -2
  1035. package/json-schema/kernel/PackageDependencyConflict.json +2 -2
  1036. package/json-schema/kernel/PackageDependencyResolutionResult.json +2 -2
  1037. package/json-schema/kernel/PackageStatusEnum.json +2 -2
  1038. package/json-schema/kernel/PermissionAction.json +2 -2
  1039. package/json-schema/kernel/PermissionScope.json +2 -2
  1040. package/json-schema/kernel/PluginCaching.json +2 -2
  1041. package/json-schema/kernel/PluginCapability.json +2 -2
  1042. package/json-schema/kernel/PluginCapabilityManifest.json +2 -2
  1043. package/json-schema/kernel/PluginCodeSplitting.json +2 -2
  1044. package/json-schema/kernel/PluginCompatibilityMatrix.json +2 -2
  1045. package/json-schema/kernel/PluginDependency.json +2 -2
  1046. package/json-schema/kernel/PluginDependencyResolution.json +2 -2
  1047. package/json-schema/kernel/PluginDependencyResolutionResult.json +2 -2
  1048. package/json-schema/kernel/PluginDiscoveryConfig.json +2 -2
  1049. package/json-schema/kernel/PluginDiscoverySource.json +2 -2
  1050. package/json-schema/kernel/PluginDynamicImport.json +2 -2
  1051. package/json-schema/kernel/PluginEngines.json +2 -2
  1052. package/json-schema/kernel/PluginErrorEvent.json +2 -2
  1053. package/json-schema/kernel/PluginEventBase.json +2 -2
  1054. package/json-schema/kernel/PluginHealthCheck.json +2 -2
  1055. package/json-schema/kernel/PluginHealthReport.json +2 -2
  1056. package/json-schema/kernel/PluginHealthStatus.json +2 -2
  1057. package/json-schema/kernel/PluginHotReload.json +2 -2
  1058. package/json-schema/kernel/PluginInitialization.json +2 -2
  1059. package/json-schema/kernel/PluginInstallConfig.json +2 -2
  1060. package/json-schema/kernel/PluginIntegrity.json +2 -2
  1061. package/json-schema/kernel/PluginInterface.json +2 -2
  1062. package/json-schema/kernel/PluginLifecycleEventType.json +2 -2
  1063. package/json-schema/kernel/PluginLifecyclePhaseEvent.json +2 -2
  1064. package/json-schema/kernel/PluginLoadingConfig.json +2 -2
  1065. package/json-schema/kernel/PluginLoadingEvent.json +2 -2
  1066. package/json-schema/kernel/PluginLoadingState.json +2 -2
  1067. package/json-schema/kernel/PluginLoadingStrategy.json +2 -2
  1068. package/json-schema/kernel/PluginMetadata.json +2 -2
  1069. package/json-schema/kernel/PluginPackaging.json +2 -2
  1070. package/json-schema/kernel/PluginPerformanceMonitoring.json +2 -2
  1071. package/json-schema/kernel/PluginPermissions.json +2 -2
  1072. package/json-schema/kernel/PluginPreloadConfig.json +2 -2
  1073. package/json-schema/kernel/PluginProvenance.json +2 -2
  1074. package/json-schema/kernel/PluginQualityMetrics.json +2 -2
  1075. package/json-schema/kernel/PluginRegisteredEvent.json +2 -2
  1076. package/json-schema/kernel/PluginRegistryEntry.json +2 -2
  1077. package/json-schema/kernel/PluginRuntime.json +2 -2
  1078. package/json-schema/kernel/PluginSandboxing.json +2 -2
  1079. package/json-schema/kernel/PluginSearchFilters.json +2 -2
  1080. package/json-schema/kernel/PluginSource.json +2 -2
  1081. package/json-schema/kernel/PluginStartupResult.json +2 -2
  1082. package/json-schema/kernel/PluginStateSnapshot.json +2 -2
  1083. package/json-schema/kernel/PluginStatistics.json +2 -2
  1084. package/json-schema/kernel/PluginTrustLevel.json +2 -2
  1085. package/json-schema/kernel/PluginTrustScore.json +2 -2
  1086. package/json-schema/kernel/PluginUpdateStrategy.json +2 -2
  1087. package/json-schema/kernel/PluginVendor.json +2 -2
  1088. package/json-schema/kernel/PluginVersionMetadata.json +2 -2
  1089. package/json-schema/kernel/PreviewModeConfig.json +2 -2
  1090. package/json-schema/kernel/ProtocolFeature.json +2 -2
  1091. package/json-schema/kernel/ProtocolReference.json +2 -2
  1092. package/json-schema/kernel/ProtocolVersion.json +2 -2
  1093. package/json-schema/kernel/RealTimeNotificationConfig.json +2 -2
  1094. package/json-schema/kernel/RequiredAction.json +2 -2
  1095. package/json-schema/kernel/ResolvedDependency.json +2 -2
  1096. package/json-schema/kernel/ResourceType.json +2 -2
  1097. package/json-schema/kernel/RollbackPackageRequest.json +2 -2
  1098. package/json-schema/kernel/RollbackPackageResponse.json +2 -2
  1099. package/json-schema/kernel/RuntimeConfig.json +2 -2
  1100. package/json-schema/kernel/RuntimeMode.json +2 -2
  1101. package/json-schema/kernel/SBOM.json +2 -2
  1102. package/json-schema/kernel/SBOMEntry.json +2 -2
  1103. package/json-schema/kernel/SandboxConfig.json +2 -2
  1104. package/json-schema/kernel/ScopeConfig.json +2 -2
  1105. package/json-schema/kernel/ScopeInfo.json +2 -2
  1106. package/json-schema/kernel/SecurityPolicy.json +2 -2
  1107. package/json-schema/kernel/SecurityScanResult.json +2 -2
  1108. package/json-schema/kernel/SecurityVulnerability.json +2 -2
  1109. package/json-schema/kernel/SemanticVersion.json +2 -2
  1110. package/json-schema/kernel/ServiceClusterAnnotations.json +2 -2
  1111. package/json-schema/kernel/ServiceClusterScope.json +2 -2
  1112. package/json-schema/kernel/ServiceFactoryRegistration.json +2 -2
  1113. package/json-schema/kernel/ServiceLeaderStrategy.json +2 -2
  1114. package/json-schema/kernel/ServiceMetadata.json +2 -2
  1115. package/json-schema/kernel/ServiceRegisteredEvent.json +2 -2
  1116. package/json-schema/kernel/ServiceRegistryConfig.json +2 -2
  1117. package/json-schema/kernel/ServiceScopeType.json +2 -2
  1118. package/json-schema/kernel/ServiceUnregisteredEvent.json +2 -2
  1119. package/json-schema/kernel/StartupOptions.json +2 -2
  1120. package/json-schema/kernel/StartupOrchestrationResult.json +2 -2
  1121. package/json-schema/kernel/TenantRuntimeContext.json +2 -2
  1122. package/json-schema/kernel/UninstallPackageRequest.json +2 -2
  1123. package/json-schema/kernel/UninstallPackageResponse.json +2 -2
  1124. package/json-schema/kernel/UpgradeContext.json +2 -2
  1125. package/json-schema/kernel/UpgradeImpactLevel.json +2 -2
  1126. package/json-schema/kernel/UpgradePackageResponse.json +2 -2
  1127. package/json-schema/kernel/UpgradePhase.json +2 -2
  1128. package/json-schema/kernel/UpgradePlan.json +2 -2
  1129. package/json-schema/kernel/ValidationError.json +2 -2
  1130. package/json-schema/kernel/ValidationResult.json +2 -2
  1131. package/json-schema/kernel/ValidationWarning.json +2 -2
  1132. package/json-schema/kernel/VersionConstraint.json +2 -2
  1133. package/json-schema/kernel/VulnerabilitySeverity.json +2 -2
  1134. package/json-schema/objectstack.json +3482 -3355
  1135. package/json-schema/openapi.json +1 -1
  1136. package/json-schema/qa/TestAction.json +2 -2
  1137. package/json-schema/qa/TestActionType.json +2 -2
  1138. package/json-schema/qa/TestAssertion.json +2 -2
  1139. package/json-schema/qa/TestAssertionType.json +2 -2
  1140. package/json-schema/qa/TestContext.json +2 -2
  1141. package/json-schema/qa/TestScenario.json +2 -2
  1142. package/json-schema/qa/TestStep.json +2 -2
  1143. package/json-schema/qa/TestSuite.json +2 -2
  1144. package/json-schema/security/FieldPermission.json +2 -2
  1145. package/json-schema/security/OWDModel.json +2 -2
  1146. package/json-schema/security/ObjectAccessScope.json +2 -2
  1147. package/json-schema/security/ObjectPermission.json +2 -2
  1148. package/json-schema/security/OwnerSharingRule.json +2 -2
  1149. package/json-schema/security/PermissionSet.json +2 -2
  1150. package/json-schema/security/RLSAuditConfig.json +2 -2
  1151. package/json-schema/security/RLSAuditEvent.json +2 -2
  1152. package/json-schema/security/RLSConfig.json +2 -2
  1153. package/json-schema/security/RLSEvaluationResult.json +2 -2
  1154. package/json-schema/security/RLSOperation.json +2 -2
  1155. package/json-schema/security/RLSUserContext.json +2 -2
  1156. package/json-schema/security/RowLevelSecurityPolicy.json +2 -2
  1157. package/json-schema/security/ShareRecipientType.json +2 -2
  1158. package/json-schema/security/SharingLevel.json +2 -2
  1159. package/json-schema/security/SharingRuleType.json +2 -2
  1160. package/json-schema/security/Territory.json +2 -2
  1161. package/json-schema/security/TerritoryModel.json +2 -2
  1162. package/json-schema/security/TerritoryType.json +2 -2
  1163. package/json-schema/shared/AggregationFunctionEnum.json +2 -2
  1164. package/json-schema/shared/AppName.json +2 -2
  1165. package/json-schema/shared/BaseMetadataRecord.json +2 -2
  1166. package/json-schema/shared/CacheStrategyEnum.json +2 -2
  1167. package/json-schema/shared/CorsConfig.json +2 -2
  1168. package/json-schema/shared/EventName.json +2 -2
  1169. package/json-schema/shared/Expression.json +2 -2
  1170. package/json-schema/shared/ExpressionDialect.json +2 -2
  1171. package/json-schema/shared/ExpressionMeta.json +2 -2
  1172. package/json-schema/shared/FieldName.json +2 -2
  1173. package/json-schema/shared/FlowName.json +2 -2
  1174. package/json-schema/shared/HttpMethod.json +2 -2
  1175. package/json-schema/shared/HttpRequest.json +2 -2
  1176. package/json-schema/shared/IsolationLevelEnum.json +2 -2
  1177. package/json-schema/shared/MetadataFormat.json +2 -2
  1178. package/json-schema/shared/MutationEventEnum.json +2 -2
  1179. package/json-schema/shared/ObjectName.json +2 -2
  1180. package/json-schema/shared/Predicate.json +2 -2
  1181. package/json-schema/shared/Protection.json +2 -2
  1182. package/json-schema/shared/RateLimitConfig.json +2 -2
  1183. package/json-schema/shared/RoleName.json +2 -2
  1184. package/json-schema/shared/SnakeCaseIdentifier.json +2 -2
  1185. package/json-schema/shared/SortDirectionEnum.json +2 -2
  1186. package/json-schema/shared/SortItem.json +2 -2
  1187. package/json-schema/shared/StaticMount.json +2 -2
  1188. package/json-schema/shared/SystemIdentifier.json +2 -2
  1189. package/json-schema/shared/ViewName.json +2 -2
  1190. package/json-schema/studio/ActionContribution.json +2 -2
  1191. package/json-schema/studio/ActionLocation.json +2 -2
  1192. package/json-schema/studio/ActivationEvent.json +2 -2
  1193. package/json-schema/studio/CommandContribution.json +2 -2
  1194. package/json-schema/studio/ERDiagramConfig.json +2 -2
  1195. package/json-schema/studio/ERLayoutAlgorithm.json +2 -2
  1196. package/json-schema/studio/ERNodeDisplay.json +2 -2
  1197. package/json-schema/studio/FieldEditorConfig.json +2 -2
  1198. package/json-schema/studio/FieldGroup.json +2 -2
  1199. package/json-schema/studio/FieldPropertySection.json +2 -2
  1200. package/json-schema/studio/FlowBuilderConfig.json +2 -2
  1201. package/json-schema/studio/FlowCanvasEdge.json +2 -2
  1202. package/json-schema/studio/FlowCanvasEdgeStyle.json +2 -2
  1203. package/json-schema/studio/FlowCanvasNode.json +2 -2
  1204. package/json-schema/studio/FlowLayoutAlgorithm.json +2 -2
  1205. package/json-schema/studio/FlowLayoutDirection.json +2 -2
  1206. package/json-schema/studio/FlowNodeRenderDescriptor.json +2 -2
  1207. package/json-schema/studio/FlowNodeShape.json +2 -2
  1208. package/json-schema/studio/MetadataIconContribution.json +2 -2
  1209. package/json-schema/studio/MetadataViewerContribution.json +2 -2
  1210. package/json-schema/studio/ObjectDesignerConfig.json +2 -2
  1211. package/json-schema/studio/ObjectDesignerDefaultView.json +2 -2
  1212. package/json-schema/studio/ObjectFilter.json +2 -2
  1213. package/json-schema/studio/ObjectListDisplayMode.json +2 -2
  1214. package/json-schema/studio/ObjectManagerConfig.json +2 -2
  1215. package/json-schema/studio/ObjectPreviewConfig.json +2 -2
  1216. package/json-schema/studio/ObjectPreviewTab.json +2 -2
  1217. package/json-schema/studio/ObjectSortField.json +2 -2
  1218. package/json-schema/studio/PanelContribution.json +2 -2
  1219. package/json-schema/studio/PanelLocation.json +2 -2
  1220. package/json-schema/studio/RelationshipDisplay.json +2 -2
  1221. package/json-schema/studio/RelationshipMapperConfig.json +2 -2
  1222. package/json-schema/studio/SidebarGroupContribution.json +2 -2
  1223. package/json-schema/studio/StudioPluginContributions.json +2 -2
  1224. package/json-schema/studio/StudioPluginManifest.json +2 -2
  1225. package/json-schema/studio/ViewMode.json +2 -2
  1226. package/json-schema/system/AccessControlConfig.json +2 -2
  1227. package/json-schema/system/AdvancedAuthConfig.json +2 -2
  1228. package/json-schema/system/AnalyzerConfig.json +2 -2
  1229. package/json-schema/system/AppCompatibilityCheck.json +2 -2
  1230. package/json-schema/system/AppInstallRequest.json +2 -2
  1231. package/json-schema/system/AppInstallResult.json +2 -2
  1232. package/json-schema/system/AppManifest.json +2 -2
  1233. package/json-schema/system/AppTranslationBundle.json +2 -2
  1234. package/json-schema/system/AuditEvent.json +2 -2
  1235. package/json-schema/system/AuditEventActor.json +2 -2
  1236. package/json-schema/system/AuditEventChange.json +2 -2
  1237. package/json-schema/system/AuditEventFilter.json +2 -2
  1238. package/json-schema/system/AuditEventSeverity.json +2 -2
  1239. package/json-schema/system/AuditEventTarget.json +2 -2
  1240. package/json-schema/system/AuditEventType.json +2 -2
  1241. package/json-schema/system/AuditFinding.json +2 -2
  1242. package/json-schema/system/AuditFindingSeverity.json +2 -2
  1243. package/json-schema/system/AuditFindingStatus.json +2 -2
  1244. package/json-schema/system/AuditLogConfig.json +2 -2
  1245. package/json-schema/system/AuditRetentionPolicy.json +2 -2
  1246. package/json-schema/system/AuditSchedule.json +2 -2
  1247. package/json-schema/system/AuditStorageConfig.json +2 -2
  1248. package/json-schema/system/AuthConfig.json +2 -2
  1249. package/json-schema/system/AuthPluginConfig.json +2 -2
  1250. package/json-schema/system/AuthProviderConfig.json +2 -2
  1251. package/json-schema/system/AwarenessEvent.json +2 -2
  1252. package/json-schema/system/AwarenessSession.json +2 -2
  1253. package/json-schema/system/AwarenessUpdate.json +2 -2
  1254. package/json-schema/system/AwarenessUserState.json +2 -2
  1255. package/json-schema/system/BackupRetention.json +2 -2
  1256. package/json-schema/system/BackupStrategy.json +2 -2
  1257. package/json-schema/system/BatchProgress.json +2 -2
  1258. package/json-schema/system/Book.json +2 -2
  1259. package/json-schema/system/BookAudience.json +2 -2
  1260. package/json-schema/system/BookGroup.json +2 -2
  1261. package/json-schema/system/BookInclude.json +2 -2
  1262. package/json-schema/system/BookNode.json +2 -2
  1263. package/json-schema/system/BucketConfig.json +2 -2
  1264. package/json-schema/system/CRDTMergeResult.json +2 -2
  1265. package/json-schema/system/CRDTState.json +2 -2
  1266. package/json-schema/system/CRDTType.json +2 -2
  1267. package/json-schema/system/CacheAvalanchePrevention.json +2 -2
  1268. package/json-schema/system/CacheConfig.json +2 -2
  1269. package/json-schema/system/CacheConsistency.json +2 -2
  1270. package/json-schema/system/CacheInvalidation.json +2 -2
  1271. package/json-schema/system/CacheStrategy.json +2 -2
  1272. package/json-schema/system/CacheTier.json +2 -2
  1273. package/json-schema/system/ChangeImpact.json +2 -2
  1274. package/json-schema/system/ChangePriority.json +2 -2
  1275. package/json-schema/system/ChangeRequest.json +2 -2
  1276. package/json-schema/system/ChangeSchema.json +2 -2
  1277. package/json-schema/system/ChangeStatus.json +2 -2
  1278. package/json-schema/system/ChangeType.json +2 -2
  1279. package/json-schema/system/CollaborationMode.json +2 -2
  1280. package/json-schema/system/CollaborationSession.json +2 -2
  1281. package/json-schema/system/CollaborationSessionConfig.json +2 -2
  1282. package/json-schema/system/CollaborativeCursor.json +2 -2
  1283. package/json-schema/system/ComplianceAuditRequirement.json +2 -2
  1284. package/json-schema/system/ComplianceConfig.json +2 -2
  1285. package/json-schema/system/ComplianceEncryptionRequirement.json +2 -2
  1286. package/json-schema/system/ComplianceFramework.json +2 -2
  1287. package/json-schema/system/ConsoleDestinationConfig.json +2 -2
  1288. package/json-schema/system/ConsumerConfig.json +2 -2
  1289. package/json-schema/system/CoreServiceName.json +2 -2
  1290. package/json-schema/system/CounterOperation.json +2 -2
  1291. package/json-schema/system/CoverageBreakdownEntry.json +2 -2
  1292. package/json-schema/system/CursorColorPreset.json +2 -2
  1293. package/json-schema/system/CursorSelection.json +2 -2
  1294. package/json-schema/system/CursorStyle.json +2 -2
  1295. package/json-schema/system/CursorUpdate.json +2 -2
  1296. package/json-schema/system/DataClassification.json +2 -2
  1297. package/json-schema/system/DataClassificationPolicy.json +2 -2
  1298. package/json-schema/system/DatabaseLevelIsolationStrategy.json +2 -2
  1299. package/json-schema/system/DatabaseProvider.json +2 -2
  1300. package/json-schema/system/DeadLetterQueue.json +2 -2
  1301. package/json-schema/system/DeleteObjectOperation.json +2 -2
  1302. package/json-schema/system/DeployBundle.json +2 -2
  1303. package/json-schema/system/DeployDiff.json +2 -2
  1304. package/json-schema/system/DeployManifest.json +2 -2
  1305. package/json-schema/system/DeployStatusEnum.json +2 -2
  1306. package/json-schema/system/DeployValidationIssue.json +2 -2
  1307. package/json-schema/system/DeployValidationResult.json +2 -2
  1308. package/json-schema/system/Doc.json +2 -2
  1309. package/json-schema/system/EmailAddressConfig.json +2 -2
  1310. package/json-schema/system/EmailAndPasswordConfig.json +2 -2
  1311. package/json-schema/system/EmailProvider.json +2 -2
  1312. package/json-schema/system/EmailServiceConfig.json +2 -2
  1313. package/json-schema/system/EmailTemplateDefinition.json +2 -2
  1314. package/json-schema/system/EmailTemplateDefinitionCategory.json +2 -2
  1315. package/json-schema/system/EmailTemplateDefinitionVariable.json +2 -2
  1316. package/json-schema/system/EmailVerificationConfig.json +2 -2
  1317. package/json-schema/system/EncryptionAlgorithm.json +2 -2
  1318. package/json-schema/system/EncryptionConfig.json +2 -2
  1319. package/json-schema/system/EnvironmentArtifact.json +2 -2
  1320. package/json-schema/system/EnvironmentArtifactChecksum.json +2 -2
  1321. package/json-schema/system/EnvironmentArtifactFunction.json +2 -2
  1322. package/json-schema/system/EnvironmentArtifactFunctionLanguageEnum.json +2 -2
  1323. package/json-schema/system/EnvironmentArtifactHashAlgorithmEnum.json +2 -2
  1324. package/json-schema/system/EnvironmentArtifactManifest.json +2 -2
  1325. package/json-schema/system/EnvironmentArtifactMetadata.json +2 -2
  1326. package/json-schema/system/EnvironmentArtifactPayloadRef.json +2 -2
  1327. package/json-schema/system/EnvironmentArtifactRequirement.json +2 -2
  1328. package/json-schema/system/ExecuteSqlOperation.json +2 -2
  1329. package/json-schema/system/ExtendedLogLevel.json +2 -2
  1330. package/json-schema/system/ExternalServiceDestinationConfig.json +2 -2
  1331. package/json-schema/system/FacetConfig.json +2 -2
  1332. package/json-schema/system/FailoverConfig.json +2 -2
  1333. package/json-schema/system/FailoverMode.json +2 -2
  1334. package/json-schema/system/Feature.json +2 -2
  1335. package/json-schema/system/FieldEncryption.json +2 -2
  1336. package/json-schema/system/FieldTranslation.json +2 -2
  1337. package/json-schema/system/FileDestinationConfig.json +2 -2
  1338. package/json-schema/system/FileMetadata.json +2 -2
  1339. package/json-schema/system/GCounter.json +2 -2
  1340. package/json-schema/system/GDPRConfig.json +2 -2
  1341. package/json-schema/system/HIPAAConfig.json +2 -2
  1342. package/json-schema/system/HistogramBucketConfig.json +2 -2
  1343. package/json-schema/system/HttpDestinationConfig.json +2 -2
  1344. package/json-schema/system/HttpServerConfig.json +2 -2
  1345. package/json-schema/system/Incident.json +2 -2
  1346. package/json-schema/system/IncidentCategory.json +2 -2
  1347. package/json-schema/system/IncidentNotificationMatrix.json +2 -2
  1348. package/json-schema/system/IncidentNotificationRule.json +2 -2
  1349. package/json-schema/system/IncidentResponsePhase.json +2 -2
  1350. package/json-schema/system/IncidentResponsePolicy.json +2 -2
  1351. package/json-schema/system/IncidentSeverity.json +2 -2
  1352. package/json-schema/system/IncidentStatus.json +2 -2
  1353. package/json-schema/system/IntervalSchedule.json +2 -2
  1354. package/json-schema/system/JobExecution.json +2 -2
  1355. package/json-schema/system/JobExecutionStatus.json +2 -2
  1356. package/json-schema/system/KernelServiceMap.json +2 -2
  1357. package/json-schema/system/KeyManagementProvider.json +2 -2
  1358. package/json-schema/system/KeyRotationPolicy.json +2 -2
  1359. package/json-schema/system/LWWRegister.json +2 -2
  1360. package/json-schema/system/LevelIsolationStrategySchema.json +2 -2
  1361. package/json-schema/system/License.json +2 -2
  1362. package/json-schema/system/LicenseMetricType.json +2 -2
  1363. package/json-schema/system/LifecycleAction.json +2 -2
  1364. package/json-schema/system/LifecyclePolicyConfig.json +2 -2
  1365. package/json-schema/system/LifecyclePolicyRule.json +2 -2
  1366. package/json-schema/system/Locale.json +2 -2
  1367. package/json-schema/system/LogDestination.json +2 -2
  1368. package/json-schema/system/LogDestinationType.json +2 -2
  1369. package/json-schema/system/LogEnrichmentConfig.json +2 -2
  1370. package/json-schema/system/LogEntry.json +2 -2
  1371. package/json-schema/system/LogFormat.json +2 -2
  1372. package/json-schema/system/LogLevel.json +2 -2
  1373. package/json-schema/system/LoggerConfig.json +2 -2
  1374. package/json-schema/system/LoggingConfig.json +2 -2
  1375. package/json-schema/system/MaskingConfig.json +2 -2
  1376. package/json-schema/system/MaskingRule.json +2 -2
  1377. package/json-schema/system/MaskingStrategy.json +2 -2
  1378. package/json-schema/system/MaskingVisibilityRule.json +2 -2
  1379. package/json-schema/system/MessageFormat.json +2 -2
  1380. package/json-schema/system/MessageQueueConfig.json +2 -2
  1381. package/json-schema/system/MessageQueueProvider.json +2 -2
  1382. package/json-schema/system/MetadataCollectionInfo.json +2 -2
  1383. package/json-schema/system/MetadataDiffResult.json +2 -2
  1384. package/json-schema/system/MetadataExportOptions.json +2 -2
  1385. package/json-schema/system/MetadataFallbackStrategy.json +2 -2
  1386. package/json-schema/system/MetadataFormat.json +2 -2
  1387. package/json-schema/system/MetadataHistoryQueryOptions.json +2 -2
  1388. package/json-schema/system/MetadataHistoryQueryResult.json +2 -2
  1389. package/json-schema/system/MetadataHistoryRecord.json +2 -2
  1390. package/json-schema/system/MetadataHistoryRetentionPolicy.json +2 -2
  1391. package/json-schema/system/MetadataImportOptions.json +2 -2
  1392. package/json-schema/system/MetadataLoadOptions.json +2 -2
  1393. package/json-schema/system/MetadataLoadResult.json +2 -2
  1394. package/json-schema/system/MetadataLoaderContract.json +2 -2
  1395. package/json-schema/system/MetadataManagerConfig.json +2 -2
  1396. package/json-schema/system/MetadataRecord.json +2 -2
  1397. package/json-schema/system/MetadataSaveOptions.json +2 -2
  1398. package/json-schema/system/MetadataSaveResult.json +2 -2
  1399. package/json-schema/system/MetadataScope.json +2 -2
  1400. package/json-schema/system/MetadataSource.json +2 -2
  1401. package/json-schema/system/MetadataState.json +2 -2
  1402. package/json-schema/system/MetadataStats.json +2 -2
  1403. package/json-schema/system/MetadataWatchEvent.json +2 -2
  1404. package/json-schema/system/MetricAggregationConfig.json +2 -2
  1405. package/json-schema/system/MetricAggregationType.json +2 -2
  1406. package/json-schema/system/MetricDataPoint.json +2 -2
  1407. package/json-schema/system/MetricDefinition.json +2 -2
  1408. package/json-schema/system/MetricExportConfig.json +2 -2
  1409. package/json-schema/system/MetricLabels.json +2 -2
  1410. package/json-schema/system/MetricType.json +2 -2
  1411. package/json-schema/system/MetricUnit.json +2 -2
  1412. package/json-schema/system/MiddlewareConfig.json +2 -2
  1413. package/json-schema/system/MiddlewareType.json +2 -2
  1414. package/json-schema/system/MigrationDependency.json +2 -2
  1415. package/json-schema/system/MigrationPlan.json +2 -2
  1416. package/json-schema/system/MigrationStatement.json +2 -2
  1417. package/json-schema/system/ModifyFieldOperation.json +2 -2
  1418. package/json-schema/system/MultipartUploadConfig.json +2 -2
  1419. package/json-schema/system/MutualTLSConfig.json +2 -2
  1420. package/json-schema/system/NotificationChannel.json +2 -2
  1421. package/json-schema/system/ORSet.json +2 -2
  1422. package/json-schema/system/ORSetElement.json +2 -2
  1423. package/json-schema/system/OTComponent.json +2 -2
  1424. package/json-schema/system/OTOperation.json +2 -2
  1425. package/json-schema/system/OTOperationType.json +2 -2
  1426. package/json-schema/system/OTTransformResult.json +2 -2
  1427. package/json-schema/system/ObjectMetadata.json +2 -2
  1428. package/json-schema/system/ObjectStorageConfig.json +2 -2
  1429. package/json-schema/system/ObjectTranslationData.json +2 -2
  1430. package/json-schema/system/ObjectTranslationNode.json +2 -2
  1431. package/json-schema/system/OidcProviderConfig.json +2 -2
  1432. package/json-schema/system/OidcProvidersConfig.json +2 -2
  1433. package/json-schema/system/OnceSchedule.json +2 -2
  1434. package/json-schema/system/OpenTelemetryCompatibility.json +2 -2
  1435. package/json-schema/system/OtelExporterType.json +2 -2
  1436. package/json-schema/system/PCIDSSConfig.json +2 -2
  1437. package/json-schema/system/PNCounter.json +2 -2
  1438. package/json-schema/system/PackagePublishResult.json +2 -2
  1439. package/json-schema/system/Plan.json +2 -2
  1440. package/json-schema/system/PresignedUrlConfig.json +2 -2
  1441. package/json-schema/system/ProvisioningStep.json +2 -2
  1442. package/json-schema/system/QueueConfig.json +2 -2
  1443. package/json-schema/system/QuotaEnforcementResult.json +2 -2
  1444. package/json-schema/system/RPO.json +2 -2
  1445. package/json-schema/system/RTO.json +2 -2
  1446. package/json-schema/system/RegistryConfig.json +2 -2
  1447. package/json-schema/system/RegistrySyncPolicy.json +2 -2
  1448. package/json-schema/system/RegistryUpstream.json +2 -2
  1449. package/json-schema/system/RemoveFieldOperation.json +2 -2
  1450. package/json-schema/system/RenameObjectOperation.json +2 -2
  1451. package/json-schema/system/ResolvedSettingValue.json +2 -2
  1452. package/json-schema/system/RetryPolicy.json +2 -2
  1453. package/json-schema/system/RollbackPlan.json +2 -2
  1454. package/json-schema/system/RouteHandlerMetadata.json +2 -2
  1455. package/json-schema/system/RowLevelIsolationStrategy.json +2 -2
  1456. package/json-schema/system/SamplingDecision.json +2 -2
  1457. package/json-schema/system/SamplingStrategyType.json +2 -2
  1458. package/json-schema/system/SearchConfig.json +2 -2
  1459. package/json-schema/system/SearchIndexConfig.json +2 -2
  1460. package/json-schema/system/SearchProvider.json +2 -2
  1461. package/json-schema/system/SecurityContextConfig.json +2 -2
  1462. package/json-schema/system/SecurityEventCorrelation.json +2 -2
  1463. package/json-schema/system/ServerCapabilities.json +2 -2
  1464. package/json-schema/system/ServerEvent.json +2 -2
  1465. package/json-schema/system/ServerEventType.json +2 -2
  1466. package/json-schema/system/ServerStatus.json +2 -2
  1467. package/json-schema/system/ServiceConfig.json +2 -2
  1468. package/json-schema/system/ServiceCriticality.json +2 -2
  1469. package/json-schema/system/ServiceLevelObjective.json +2 -2
  1470. package/json-schema/system/ServiceStatus.json +2 -2
  1471. package/json-schema/system/SettingsActionResult.json +2 -2
  1472. package/json-schema/system/SettingsChangeEvent.json +2 -2
  1473. package/json-schema/system/SocialProviderConfig.json +2 -2
  1474. package/json-schema/system/Span.json +2 -2
  1475. package/json-schema/system/SpanAttributeValue.json +2 -2
  1476. package/json-schema/system/SpanAttributes.json +2 -2
  1477. package/json-schema/system/SpanEvent.json +2 -2
  1478. package/json-schema/system/SpanKind.json +2 -2
  1479. package/json-schema/system/SpanLink.json +2 -2
  1480. package/json-schema/system/SpanStatus.json +2 -2
  1481. package/json-schema/system/SpecifierHandler.json +2 -2
  1482. package/json-schema/system/SpecifierOption.json +2 -2
  1483. package/json-schema/system/SpecifierScope.json +2 -2
  1484. package/json-schema/system/SpecifierType.json +2 -2
  1485. package/json-schema/system/StorageAcl.json +2 -2
  1486. package/json-schema/system/StorageClass.json +2 -2
  1487. package/json-schema/system/StorageConnection.json +2 -2
  1488. package/json-schema/system/StorageProvider.json +2 -2
  1489. package/json-schema/system/StorageScope.json +2 -2
  1490. package/json-schema/system/StructuredLogEntry.json +2 -2
  1491. package/json-schema/system/SupplierAssessmentStatus.json +2 -2
  1492. package/json-schema/system/SupplierRiskLevel.json +2 -2
  1493. package/json-schema/system/SupplierSecurityAssessment.json +2 -2
  1494. package/json-schema/system/SupplierSecurityPolicy.json +2 -2
  1495. package/json-schema/system/SupplierSecurityRequirement.json +2 -2
  1496. package/json-schema/system/Task.json +2 -2
  1497. package/json-schema/system/TaskExecutionResult.json +2 -2
  1498. package/json-schema/system/TaskPriority.json +2 -2
  1499. package/json-schema/system/TaskRetryPolicy.json +2 -2
  1500. package/json-schema/system/TaskStatus.json +2 -2
  1501. package/json-schema/system/Tenant.json +2 -2
  1502. package/json-schema/system/TenantConnectionConfig.json +2 -2
  1503. package/json-schema/system/TenantIsolationConfig.json +2 -2
  1504. package/json-schema/system/TenantIsolationLevel.json +2 -2
  1505. package/json-schema/system/TenantPlan.json +2 -2
  1506. package/json-schema/system/TenantProvisioningRequest.json +2 -2
  1507. package/json-schema/system/TenantProvisioningResult.json +2 -2
  1508. package/json-schema/system/TenantProvisioningStatusEnum.json +2 -2
  1509. package/json-schema/system/TenantQuota.json +2 -2
  1510. package/json-schema/system/TenantRegion.json +2 -2
  1511. package/json-schema/system/TenantSecurityPolicy.json +2 -2
  1512. package/json-schema/system/TenantUsage.json +2 -2
  1513. package/json-schema/system/TextCRDTOperation.json +2 -2
  1514. package/json-schema/system/TextCRDTState.json +2 -2
  1515. package/json-schema/system/TimeSeries.json +2 -2
  1516. package/json-schema/system/TimeSeriesDataPoint.json +2 -2
  1517. package/json-schema/system/TopicConfig.json +2 -2
  1518. package/json-schema/system/TraceContext.json +2 -2
  1519. package/json-schema/system/TraceContextPropagation.json +2 -2
  1520. package/json-schema/system/TraceFlags.json +2 -2
  1521. package/json-schema/system/TracePropagationFormat.json +2 -2
  1522. package/json-schema/system/TraceState.json +2 -2
  1523. package/json-schema/system/TrainingCategory.json +2 -2
  1524. package/json-schema/system/TrainingCompletionStatus.json +2 -2
  1525. package/json-schema/system/TrainingCourse.json +2 -2
  1526. package/json-schema/system/TrainingPlan.json +2 -2
  1527. package/json-schema/system/TrainingRecord.json +2 -2
  1528. package/json-schema/system/TranslationBundle.json +2 -2
  1529. package/json-schema/system/TranslationConfig.json +2 -2
  1530. package/json-schema/system/TranslationCoverageResult.json +2 -2
  1531. package/json-schema/system/TranslationData.json +2 -2
  1532. package/json-schema/system/TranslationDiffItem.json +2 -2
  1533. package/json-schema/system/TranslationDiffStatus.json +2 -2
  1534. package/json-schema/system/TranslationFileOrganization.json +2 -2
  1535. package/json-schema/system/UserActivityStatus.json +2 -2
  1536. package/json-schema/system/VectorClock.json +2 -2
  1537. package/json-schema/system/WorkerStats.json +2 -2
  1538. package/json-schema/ui/AIChatWindowProps.json +2 -2
  1539. package/json-schema/ui/ActionAi.json +2 -2
  1540. package/json-schema/ui/ActionLocation.json +2 -2
  1541. package/json-schema/ui/ActionParam.json +2 -2
  1542. package/json-schema/ui/ActionType.json +2 -2
  1543. package/json-schema/ui/AddRecordConfig.json +2 -2
  1544. package/json-schema/ui/Animation.json +2 -2
  1545. package/json-schema/ui/AnimationTrigger.json +2 -2
  1546. package/json-schema/ui/AppBranding.json +2 -2
  1547. package/json-schema/ui/AppContextSelector.json +2 -2
  1548. package/json-schema/ui/AppearanceConfig.json +2 -2
  1549. package/json-schema/ui/AriaProps.json +2 -2
  1550. package/json-schema/ui/BorderRadius.json +2 -2
  1551. package/json-schema/ui/BreakpointColumnMap.json +2 -2
  1552. package/json-schema/ui/BreakpointName.json +2 -2
  1553. package/json-schema/ui/BreakpointOrderMap.json +2 -2
  1554. package/json-schema/ui/Breakpoints.json +2 -2
  1555. package/json-schema/ui/CalendarConfig.json +2 -2
  1556. package/json-schema/ui/ChartAnnotation.json +2 -2
  1557. package/json-schema/ui/ChartAxis.json +2 -2
  1558. package/json-schema/ui/ChartConfig.json +2 -2
  1559. package/json-schema/ui/ChartInteraction.json +2 -2
  1560. package/json-schema/ui/ChartSeries.json +2 -2
  1561. package/json-schema/ui/ChartType.json +2 -2
  1562. package/json-schema/ui/ColorPalette.json +2 -2
  1563. package/json-schema/ui/ColumnSummary.json +2 -2
  1564. package/json-schema/ui/ComponentAnimation.json +2 -2
  1565. package/json-schema/ui/ConflictResolution.json +2 -2
  1566. package/json-schema/ui/Dashboard.json +2 -2
  1567. package/json-schema/ui/DashboardHeader.json +2 -2
  1568. package/json-schema/ui/DashboardHeaderAction.json +2 -2
  1569. package/json-schema/ui/DashboardWidget.json +2 -2
  1570. package/json-schema/ui/Dataset.json +2 -2
  1571. package/json-schema/ui/DatasetDimension.json +2 -2
  1572. package/json-schema/ui/DatasetMeasure.json +2 -2
  1573. package/json-schema/ui/DateFormat.json +2 -2
  1574. package/json-schema/ui/DensityMode.json +2 -2
  1575. package/json-schema/ui/DerivedMeasureOp.json +2 -2
  1576. package/json-schema/ui/DndConfig.json +2 -2
  1577. package/json-schema/ui/DragConstraint.json +2 -2
  1578. package/json-schema/ui/DragHandle.json +2 -2
  1579. package/json-schema/ui/DragItem.json +2 -2
  1580. package/json-schema/ui/DropEffect.json +2 -2
  1581. package/json-schema/ui/DropZone.json +2 -2
  1582. package/json-schema/ui/EasingFunction.json +2 -2
  1583. package/json-schema/ui/ElementButtonProps.json +2 -2
  1584. package/json-schema/ui/ElementDataSource.json +2 -2
  1585. package/json-schema/ui/ElementFilterProps.json +2 -2
  1586. package/json-schema/ui/ElementImageProps.json +2 -2
  1587. package/json-schema/ui/ElementMetadataViewerProps.json +2 -2
  1588. package/json-schema/ui/ElementNumberProps.json +2 -2
  1589. package/json-schema/ui/ElementRecordPickerProps.json +2 -2
  1590. package/json-schema/ui/ElementTextInputProps.json +2 -2
  1591. package/json-schema/ui/ElementTextProps.json +2 -2
  1592. package/json-schema/ui/EmbedConfig.json +2 -2
  1593. package/json-schema/ui/EvictionPolicy.json +2 -2
  1594. package/json-schema/ui/FocusManagement.json +2 -2
  1595. package/json-schema/ui/FocusTrapConfig.json +2 -2
  1596. package/json-schema/ui/GalleryConfig.json +2 -2
  1597. package/json-schema/ui/GanttConfig.json +2 -2
  1598. package/json-schema/ui/GanttQuickFilter.json +2 -2
  1599. package/json-schema/ui/GestureConfig.json +2 -2
  1600. package/json-schema/ui/GestureType.json +2 -2
  1601. package/json-schema/ui/GlobalFilter.json +2 -2
  1602. package/json-schema/ui/GlobalFilterOptionsFrom.json +2 -2
  1603. package/json-schema/ui/GroupingConfig.json +2 -2
  1604. package/json-schema/ui/GroupingField.json +2 -2
  1605. package/json-schema/ui/HttpMethod.json +2 -2
  1606. package/json-schema/ui/HttpRequest.json +2 -2
  1607. package/json-schema/ui/I18nLabel.json +2 -2
  1608. package/json-schema/ui/I18nObject.json +2 -2
  1609. package/json-schema/ui/InterfacePageConfig.json +2 -2
  1610. package/json-schema/ui/JoinedReportBlock.json +2 -2
  1611. package/json-schema/ui/KanbanConfig.json +2 -2
  1612. package/json-schema/ui/KeyboardNavigationConfig.json +2 -2
  1613. package/json-schema/ui/KeyboardShortcut.json +2 -2
  1614. package/json-schema/ui/ListChartConfig.json +2 -2
  1615. package/json-schema/ui/ListColumn.json +2 -2
  1616. package/json-schema/ui/LocaleConfig.json +2 -2
  1617. package/json-schema/ui/LongPressGestureConfig.json +2 -2
  1618. package/json-schema/ui/MotionConfig.json +2 -2
  1619. package/json-schema/ui/NavigationConfig.json +2 -2
  1620. package/json-schema/ui/NavigationMode.json +2 -2
  1621. package/json-schema/ui/Notification.json +2 -2
  1622. package/json-schema/ui/NotificationAction.json +2 -2
  1623. package/json-schema/ui/NotificationConfig.json +2 -2
  1624. package/json-schema/ui/NotificationPosition.json +2 -2
  1625. package/json-schema/ui/NotificationSeverity.json +2 -2
  1626. package/json-schema/ui/NotificationType.json +2 -2
  1627. package/json-schema/ui/NumberFormat.json +2 -2
  1628. package/json-schema/ui/OfflineCacheConfig.json +2 -2
  1629. package/json-schema/ui/OfflineConfig.json +2 -2
  1630. package/json-schema/ui/OfflineStrategy.json +2 -2
  1631. package/json-schema/ui/PageAccordionProps.json +2 -2
  1632. package/json-schema/ui/PageCardProps.json +2 -2
  1633. package/json-schema/ui/PageComponentType.json +2 -2
  1634. package/json-schema/ui/PageHeaderProps.json +2 -2
  1635. package/json-schema/ui/PageTabsProps.json +2 -2
  1636. package/json-schema/ui/PageTransition.json +2 -2
  1637. package/json-schema/ui/PageType.json +2 -2
  1638. package/json-schema/ui/PageVariable.json +2 -2
  1639. package/json-schema/ui/PaginationConfig.json +2 -2
  1640. package/json-schema/ui/PerformanceConfig.json +2 -2
  1641. package/json-schema/ui/PersistStorage.json +2 -2
  1642. package/json-schema/ui/PinchGestureConfig.json +2 -2
  1643. package/json-schema/ui/PluralRule.json +2 -2
  1644. package/json-schema/ui/Portal.json +2 -2
  1645. package/json-schema/ui/PortalActionNavItem.json +2 -2
  1646. package/json-schema/ui/PortalAnonymousEntry.json +2 -2
  1647. package/json-schema/ui/PortalAnonymousRoute.json +2 -2
  1648. package/json-schema/ui/PortalAuthMode.json +2 -2
  1649. package/json-schema/ui/PortalDashboardNavItem.json +2 -2
  1650. package/json-schema/ui/PortalLayout.json +2 -2
  1651. package/json-schema/ui/PortalNavItem.json +2 -2
  1652. package/json-schema/ui/PortalRateLimit.json +2 -2
  1653. package/json-schema/ui/PortalSeo.json +2 -2
  1654. package/json-schema/ui/PortalTheme.json +2 -2
  1655. package/json-schema/ui/PortalUrlNavItem.json +2 -2
  1656. package/json-schema/ui/PortalViewNavItem.json +2 -2
  1657. package/json-schema/ui/RecordActivityProps.json +2 -2
  1658. package/json-schema/ui/RecordChatterProps.json +2 -2
  1659. package/json-schema/ui/RecordDetailsProps.json +2 -2
  1660. package/json-schema/ui/RecordHighlightsField.json +2 -2
  1661. package/json-schema/ui/RecordHighlightsProps.json +2 -2
  1662. package/json-schema/ui/RecordPathProps.json +2 -2
  1663. package/json-schema/ui/RecordRelatedListProps.json +2 -2
  1664. package/json-schema/ui/Report.json +2 -2
  1665. package/json-schema/ui/ReportChart.json +2 -2
  1666. package/json-schema/ui/ReportColumn.json +2 -2
  1667. package/json-schema/ui/ReportGrouping.json +2 -2
  1668. package/json-schema/ui/ReportType.json +2 -2
  1669. package/json-schema/ui/ResponsiveConfig.json +2 -2
  1670. package/json-schema/ui/ResponsiveStyles.json +2 -2
  1671. package/json-schema/ui/RowColorConfig.json +2 -2
  1672. package/json-schema/ui/RowHeight.json +2 -2
  1673. package/json-schema/ui/SelectionConfig.json +2 -2
  1674. package/json-schema/ui/Shadow.json +2 -2
  1675. package/json-schema/ui/SharingConfig.json +2 -2
  1676. package/json-schema/ui/Spacing.json +2 -2
  1677. package/json-schema/ui/StyleMap.json +2 -2
  1678. package/json-schema/ui/SwipeDirection.json +2 -2
  1679. package/json-schema/ui/SwipeGestureConfig.json +2 -2
  1680. package/json-schema/ui/SyncConfig.json +2 -2
  1681. package/json-schema/ui/Theme.json +2 -2
  1682. package/json-schema/ui/ThemeMode.json +2 -2
  1683. package/json-schema/ui/TimelineConfig.json +2 -2
  1684. package/json-schema/ui/TouchInteraction.json +2 -2
  1685. package/json-schema/ui/TouchTargetConfig.json +2 -2
  1686. package/json-schema/ui/TransitionConfig.json +2 -2
  1687. package/json-schema/ui/TransitionPreset.json +2 -2
  1688. package/json-schema/ui/TreeConfig.json +2 -2
  1689. package/json-schema/ui/Typography.json +2 -2
  1690. package/json-schema/ui/UserActionsConfig.json +2 -2
  1691. package/json-schema/ui/UserFilterField.json +2 -2
  1692. package/json-schema/ui/UserFilters.json +2 -2
  1693. package/json-schema/ui/ViewData.json +2 -2
  1694. package/json-schema/ui/ViewFilterRule.json +2 -2
  1695. package/json-schema/ui/ViewItemName.json +2 -2
  1696. package/json-schema/ui/ViewKind.json +2 -2
  1697. package/json-schema/ui/ViewScope.json +2 -2
  1698. package/json-schema/ui/ViewSharing.json +2 -2
  1699. package/json-schema/ui/ViewTab.json +2 -2
  1700. package/json-schema/ui/VisualizationType.json +2 -2
  1701. package/json-schema/ui/WcagContrastLevel.json +2 -2
  1702. package/json-schema/ui/WidgetActionType.json +2 -2
  1703. package/json-schema/ui/WidgetColorVariant.json +2 -2
  1704. package/json-schema/ui/WidgetEvent.json +2 -2
  1705. package/json-schema/ui/WidgetLifecycle.json +2 -2
  1706. package/json-schema/ui/WidgetManifest.json +2 -2
  1707. package/json-schema/ui/WidgetProperty.json +2 -2
  1708. package/json-schema/ui/WidgetSource.json +2 -2
  1709. package/json-schema/ui/ZIndex.json +2 -2
  1710. package/package.json +1 -1
  1711. package/src/data/hook.zod.ts +1 -0
  1712. package/src/kernel/execution-context.zod.ts +15 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/lazy-schema.ts","../../src/data/filter.zod.ts","../../src/data/query.zod.ts","../../src/data/date-macros.zod.ts","../../src/shared/identifiers.zod.ts","../../src/shared/expression.zod.ts","../../src/data/field.zod.ts","../../src/data/validation.zod.ts","../../src/ui/i18n.zod.ts","../../src/data/hook-body.zod.ts","../../src/ui/action.zod.ts","../../src/kernel/metadata-protection.zod.ts","../../src/shared/protection.zod.ts","../../src/ui/sharing.zod.ts","../../src/ui/responsive.zod.ts","../../src/shared/http.zod.ts","../../src/ui/view.zod.ts","../../src/data/object.zod.ts","../../src/data/autonumber-format.ts","../../src/data/hook.zod.ts","../../src/data/mapping.zod.ts","../../src/kernel/execution-context.zod.ts","../../src/data/data-engine.zod.ts","../../src/shared/enums.zod.ts","../../src/data/driver.zod.ts","../../src/data/driver-sql.zod.ts","../../src/data/driver-nosql.zod.ts","../../src/data/seed.zod.ts","../../src/data/object.form.ts","../../src/data/field.form.ts","../../src/data/hook.form.ts","../../src/data/seed-loader.zod.ts","../../src/data/document.zod.ts","../../src/shared/mapping.zod.ts","../../src/data/external-lookup.zod.ts","../../src/data/datasource.zod.ts","../../src/data/type-compat.ts","../../src/data/external-catalog.zod.ts","../../src/data/analytics.zod.ts","../../src/data/aggregation-policy.ts","../../src/data/display-name.ts","../../src/data/field-group-layout.ts","../../src/data/record-surface.ts","../../src/data/feed.zod.ts","../../src/data/subscription.zod.ts"],"names":["z","FieldMappingSchema"],"mappings":";;;;;AAoBO,SAAS,WAAmC,OAAA,EAAqB;AACtE,EAAA,IAAI,OAAO,OAAA,KAAY,WAAA,IAAe,OAAA,CAAQ,GAAA,EAAK,qBAAqB,GAAA,EAAK;AAC3E,IAAA,OAAO,OAAA,EAAQ;AAAA,EACjB;AAEA,EAAA,IAAI,MAAA;AACJ,EAAA,MAAM,UAAU,MAAS;AACvB,IAAA,IAAI,MAAA,KAAW,MAAA,EAAW,MAAA,GAAS,OAAA,EAAQ;AAC3C,IAAA,OAAO,MAAA;AAAA,EACT,CAAA;AAEA,E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I,CAAA,CAAE,SAAS,oCAAoC,CAAA;AAAA;AAAA,EAG/E,WAAWA,CAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,iCAAiC;AAC7E,CAAC,CAAC","file":"index.mjs","sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { z } from 'zod';\n\n/**\n * Wrap a Zod schema constructor so its body is only evaluated on first use.\n *\n * Why: building Zod schemas at module-load creates millions of closures that\n * dominate dev-server RSS even though most schemas are never parsed in a\n * given session. Wrapping the constructor in a Proxy defers allocation until\n * the first property access (`.parse`, `.shape`, `._def`, etc.) and reuses\n * a single cached instance thereafter.\n *\n * Type system: the returned Proxy is structurally indistinguishable from the\n * underlying ZodType, so `z.infer<typeof X>` and `.parse()` callers do not\n * need to change.\n *\n * Emergency rollback: set `OS_EAGER_SCHEMAS=1` to evaluate the\n * factory immediately and bypass the Proxy entirely.\n */\nexport function lazySchema<T extends z.ZodTypeAny>(factory: () => T): T {\n if (typeof process !== 'undefined' && process.env?.OS_EAGER_SCHEMAS === '1') {\n return factory();\n }\n\n let cached: T | undefined;\n const resolve = (): T => {\n if (cached === undefined) cached = factory();\n return cached;\n };\n\n const target = function lazyZod() {} as unknown as T;\n\n const proxy = new Proxy(target as object, {\n get(_t, prop) {\n const real = resolve() as unknown as Record<PropertyKey, unknown>;\n const value = real[prop];\n if (typeof value === 'function') {\n return (value as (...a: unknown[]) => unknown).bind(real);\n }\n return value;\n },\n set(_t, prop, value) {\n const real = resolve() as unknown as Record<PropertyKey, unknown>;\n real[prop] = value;\n return true;\n },\n has(_t, prop) {\n return prop in (resolve() as object);\n },\n ownKeys() {\n return Reflect.ownKeys(resolve() as object);\n },\n getOwnPropertyDescriptor(_t, prop) {\n return Reflect.getOwnPropertyDescriptor(resolve() as object, prop);\n },\n getPrototypeOf() {\n return Reflect.getPrototypeOf(resolve() as object);\n },\n });\n\n return proxy as T;\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Unified Query DSL Specification\n * \n * Based on industry best practices from:\n * - Prisma ORM\n * - Strapi CMS\n * - TypeORM\n * - LoopBack Framework\n * \n * Version: 1.0.0\n * Status: Draft\n * \n * Objective: Define a JSON-based, database-agnostic query syntax standard\n * for data filtering interactions between frontend and backend APIs.\n * \n * Design Principles:\n * 1. Declarative: Frontend describes \"what data to get\", not \"how to query\"\n * 2. Database Agnostic: Syntax contains no database-specific directives\n * 3. Type Safe: Structure can be statically inferred by TypeScript\n * 4. Convention over Configuration: Implicit syntax for common queries\n */\n\n/**\n * Field Reference\n * Represents a reference to another field/column instead of a literal value.\n * Used for joins (ON clause) and cross-field comparisons.\n * \n * @example\n * // user.id = order.owner_id\n * { \"$eq\": { \"$field\": \"order.owner_id\" } }\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const FieldReferenceSchema = lazySchema(() => z.object({\n $field: z.string().describe('Field Reference/Column Name')\n}));\n\nexport type FieldReference = z.infer<typeof FieldReferenceSchema>;\n\n// ============================================================================\n// 3.1 Comparison Operators\n// ============================================================================\n\n/**\n * Comparison operators for equality and inequality checks.\n * Supported data types: Any\n */\nexport const EqualityOperatorSchema = lazySchema(() => z.object({\n /** Equal to (default) - SQL: = | MongoDB: $eq */\n $eq: z.any().optional(),\n \n /** Not equal to - SQL: <> or != | MongoDB: $ne */\n $ne: z.any().optional(),\n}));\n\n/**\n * Comparison operators for numeric and date comparisons.\n * Supported data types: Number, Date\n */\nexport const ComparisonOperatorSchema = lazySchema(() => z.object({\n /** Greater than - SQL: > | MongoDB: $gt */\n $gt: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n \n /** Greater than or equal to - SQL: >= | MongoDB: $gte */\n $gte: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n \n /** Less than - SQL: < | MongoDB: $lt */\n $lt: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n \n /** Less than or equal to - SQL: <= | MongoDB: $lte */\n $lte: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n}));\n\n// ============================================================================\n// 3.2 Set & Range Operators\n// ============================================================================\n\n/**\n * Set operators for membership checks.\n */\nexport const SetOperatorSchema = lazySchema(() => z.object({\n /** In list - SQL: IN (?, ?, ?) | MongoDB: $in */\n $in: z.array(z.any()).optional(),\n \n /** Not in list - SQL: NOT IN (...) | MongoDB: $nin */\n $nin: z.array(z.any()).optional(),\n}));\n\n/**\n * Range operator for interval checks (closed interval).\n * SQL: BETWEEN ? AND ? | MongoDB: $gte AND $lte\n */\nexport const RangeOperatorSchema = lazySchema(() => z.object({\n /** Between (inclusive) - takes [min, max] array */\n $between: z.tuple([\n z.union([z.number(), z.date(), FieldReferenceSchema]),\n z.union([z.number(), z.date(), FieldReferenceSchema])\n ]).optional(),\n}));\n\n// ============================================================================\n// 3.3 String-Specific Operators\n// ============================================================================\n\n/**\n * String pattern matching operators.\n * Note: Case sensitivity should be handled at backend level.\n */\nexport const StringOperatorSchema = lazySchema(() => z.object({\n /** Contains substring - SQL: LIKE %?% | MongoDB: $regex */\n $contains: z.string().optional(),\n \n /** Does not contain substring - SQL: NOT LIKE %?% | MongoDB: $not: $regex */\n $notContains: z.string().optional(),\n \n /** Starts with prefix - SQL: LIKE ?% | MongoDB: $regex */\n $startsWith: z.string().optional(),\n \n /** Ends with suffix - SQL: LIKE %? | MongoDB: $regex */\n $endsWith: z.string().optional(),\n}));\n\n// ============================================================================\n// 3.5 Special Operators\n// ============================================================================\n\n/**\n * Special check operators for null and existence.\n */\nexport const SpecialOperatorSchema = lazySchema(() => z.object({\n /** Is null check - SQL: IS NULL (true) / IS NOT NULL (false) | MongoDB: field: null */\n $null: z.boolean().optional(),\n \n /** Field exists check (primarily for NoSQL) - MongoDB: $exists */\n $exists: z.boolean().optional(),\n}));\n\n// ============================================================================\n// Combined Field Operators\n// ============================================================================\n\n/**\n * All field-level operators combined.\n * These can be applied to individual fields in a filter.\n */\nexport const FieldOperatorsSchema = lazySchema(() => z.object({\n // Equality\n $eq: z.any().optional(),\n $ne: z.any().optional(),\n \n // Comparison (numeric/date)\n $gt: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n $gte: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n $lt: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n $lte: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n \n // Set & Range\n $in: z.array(z.any()).optional(),\n $nin: z.array(z.any()).optional(),\n $between: z.tuple([\n z.union([z.number(), z.date(), FieldReferenceSchema]),\n z.union([z.number(), z.date(), FieldReferenceSchema])\n ]).optional(),\n \n // String-specific\n $contains: z.string().optional(),\n $notContains: z.string().optional(),\n $startsWith: z.string().optional(),\n $endsWith: z.string().optional(),\n \n // Special\n $null: z.boolean().optional(),\n $exists: z.boolean().optional(),\n}));\n\n// ============================================================================\n// 3.4 Logical Operators & Recursive Filter Structure\n// ============================================================================\n\n/**\n * Recursive filter type that supports:\n * 1. Implicit equality: { field: value }\n * 2. Explicit operators: { field: { $op: value } }\n * 3. Logical combinations: { $and: [...], $or: [...], $not: {...} }\n * 4. Nested relations: { relation: { field: value } }\n */\nexport type FilterCondition = {\n [key: string]: \n | any // Implicit equality: key: value\n | z.infer<typeof FieldOperatorsSchema> // Explicit operators: key: { $op: value }\n | FilterCondition; // Nested relation: key: { nested: ... }\n} & {\n /** Logical AND - combines all conditions that must be true */\n $and?: FilterCondition[];\n \n /** Logical OR - at least one condition must be true */\n $or?: FilterCondition[];\n \n /** Logical NOT - negates the condition */\n $not?: FilterCondition;\n};\n\n/**\n * Zod schema for recursive filter validation.\n * Uses z.lazy() to handle recursive structure.\n */\nexport const FilterConditionSchema: z.ZodType<FilterCondition> = z.lazy(() =>\n z.record(z.string(), z.unknown()).and(\n z.object({\n $and: z.array(FilterConditionSchema).optional(),\n $or: z.array(FilterConditionSchema).optional(),\n $not: FilterConditionSchema.optional(),\n })\n )\n);\n\n// ============================================================================\n// Query Filter Wrapper\n// ============================================================================\n\n/**\n * Top-level query filter wrapper.\n * This is typically used as the \"where\" clause in a query.\n * \n * @example\n * ```typescript\n * const filter: QueryFilter = {\n * where: {\n * status: \"active\", // Implicit equality\n * age: { $gte: 18 }, // Explicit operator\n * $or: [ // Logical combination\n * { role: \"admin\" },\n * { email: { $contains: \"@company.com\" } }\n * ],\n * profile: { // Nested relation\n * verified: true\n * }\n * }\n * }\n * ```\n */\nexport const QueryFilterSchema = lazySchema(() => z.object({\n where: FilterConditionSchema.optional(),\n}));\n\n// ============================================================================\n// TypeScript Type Exports\n// ============================================================================\n\n/**\n * Type-safe filter operators for use in TypeScript.\n * \n * @example\n * ```typescript\n * type UserFilter = Filter<User>;\n * \n * const filter: UserFilter = {\n * age: { $gte: 18 },\n * email: { $contains: \"@example.com\" }\n * };\n * ```\n */\nexport type Filter<T = any> = {\n [K in keyof T]?: \n | T[K] // Implicit equality\n | {\n $eq?: T[K];\n $ne?: T[K];\n $gt?: T[K] extends number | Date ? T[K] : never;\n $gte?: T[K] extends number | Date ? T[K] : never;\n $lt?: T[K] extends number | Date ? T[K] : never;\n $lte?: T[K] extends number | Date ? T[K] : never;\n $in?: T[K][];\n $nin?: T[K][];\n $between?: T[K] extends number | Date ? [T[K], T[K]] : never;\n $contains?: T[K] extends string ? string : never;\n $notContains?: T[K] extends string ? string : never;\n $startsWith?: T[K] extends string ? string : never;\n $endsWith?: T[K] extends string ? string : never;\n $null?: boolean;\n $exists?: boolean;\n }\n | (T[K] extends object ? Filter<T[K]> : never); // Nested relation\n} & {\n $and?: Filter<T>[];\n $or?: Filter<T>[];\n $not?: Filter<T>;\n};\n\n/**\n * Scalar types supported by the filter system.\n */\nexport type Scalar = string | number | boolean | Date | null;\n\n// Export inferred types\nexport type FieldOperators = z.infer<typeof FieldOperatorsSchema>;\nexport type QueryFilter = z.infer<typeof QueryFilterSchema>;\n\n// ============================================================================\n// Normalization Utilities (Internal Representation)\n// ============================================================================\n\n/**\n * Normalized filter AST structure.\n * This is the internal representation after converting all syntactic sugar\n * to explicit operators.\n * \n * Stage 1: Normalization Pass\n * Input: { age: 18, role: \"admin\" }\n * Output: { $and: [{ age: { $eq: 18 } }, { role: { $eq: \"admin\" } }] }\n * \n * This simplifies adapter implementation by providing a consistent structure.\n */\nexport const NormalizedFilterSchema: z.ZodType<any> = z.lazy(() => \n z.object({\n $and: z.array(\n z.union([\n // Field condition: { field: { $op: value } }\n z.record(z.string(), FieldOperatorsSchema),\n // Nested logical group\n NormalizedFilterSchema,\n ])\n ).optional(),\n \n $or: z.array(\n z.union([\n z.record(z.string(), FieldOperatorsSchema),\n NormalizedFilterSchema,\n ])\n ).optional(),\n \n $not: z.union([\n z.record(z.string(), FieldOperatorsSchema),\n NormalizedFilterSchema,\n ]).optional(),\n })\n);\n\nexport type NormalizedFilter = z.infer<typeof NormalizedFilterSchema>;\n\n// ============================================================================\n// AST Array Format Detection & Validation\n// ============================================================================\n\n/**\n * Set of valid AST comparison operators (case-insensitive).\n * Used by `isFilterAST()` to validate AST structure beyond `Array.isArray`.\n */\nexport const VALID_AST_OPERATORS = new Set([\n '=', '==', '!=', '<>', '>', '>=', '<', '<=',\n 'in', 'nin', 'not_in',\n 'contains', 'notcontains', 'not_contains', 'like',\n 'startswith', 'starts_with',\n 'endswith', 'ends_with',\n 'between',\n 'is_null', 'is_not_null',\n]);\n\n/**\n * Detect whether a value is a valid Filter AST array structure.\n *\n * A valid AST is one of:\n * - Comparison node: `[field: string, operator: string, value: unknown]` where operator is a known operator\n * - Logical node: `[\"and\" | \"or\", ...children]` where children are valid AST nodes\n * - Legacy flat array: `[[cond], [cond], ...]` where all elements are sub-arrays (each a valid AST node)\n *\n * This replaces the naïve `Array.isArray(filter)` check, preventing accidental\n * misidentification of arbitrary arrays as filter ASTs.\n *\n * @example\n * isFilterAST([\"status\", \"=\", \"active\"]) // true\n * isFilterAST([\"and\", [\"a\", \"=\", 1], [\"b\", \">\", 2]]) // true\n * isFilterAST([[\"a\", \"=\", 1], [\"b\", \"=\", 2]]) // true (legacy)\n * isFilterAST([1, 2, 3]) // false\n * isFilterAST(\"not an array\") // false\n * isFilterAST({ status: \"active\" }) // false\n */\nexport function isFilterAST(filter: unknown): boolean {\n if (!Array.isArray(filter) || filter.length === 0) return false;\n\n const first = filter[0];\n\n // Logical node: [\"and\", ...] or [\"or\", ...]\n if (typeof first === 'string') {\n const lower = first.toLowerCase();\n if (lower === 'and' || lower === 'or') {\n return filter.length >= 2 && filter.slice(1).every((child: unknown) => isFilterAST(child));\n }\n\n // Comparison node: [field, operator, value]\n if (filter.length >= 2 && typeof filter[1] === 'string') {\n return VALID_AST_OPERATORS.has(filter[1].toLowerCase());\n }\n }\n\n // Legacy flat array: [[cond], [cond], ...]\n if (filter.every((item: unknown) => isFilterAST(item))) {\n return filter.length > 0;\n }\n\n return false;\n}\n\n// ============================================================================\n// AST Array → FilterCondition Conversion\n// ============================================================================\n\n/**\n * Operator mapping from AST infix operators to FilterCondition `$`-prefixed operators.\n */\nconst AST_OPERATOR_MAP: Record<string, string> = {\n '=': '$eq',\n '==': '$eq',\n '!=': '$ne',\n '<>': '$ne',\n '>': '$gt',\n '>=': '$gte',\n '<': '$lt',\n '<=': '$lte',\n 'in': '$in',\n 'nin': '$nin',\n 'not_in': '$nin',\n 'contains': '$contains',\n 'notcontains': '$notContains',\n 'not_contains': '$notContains',\n 'like': '$contains',\n 'startswith': '$startsWith',\n 'starts_with': '$startsWith',\n 'endswith': '$endsWith',\n 'ends_with': '$endsWith',\n 'between': '$between',\n 'is_null': '$null',\n 'is_not_null': '$null',\n};\n\n/**\n * Convert a single AST comparison node `[field, operator, value]` to a FilterCondition object.\n */\nfunction convertComparison(node: [string, string, unknown]): FilterCondition {\n const [field, operator, value] = node;\n const op = operator.toLowerCase();\n\n // Special case: equality shorthand\n if (op === '=' || op === '==') {\n return { [field]: value } as FilterCondition;\n }\n\n // Null check operators\n if (op === 'is_null') {\n return { [field]: { $null: true } } as FilterCondition;\n }\n if (op === 'is_not_null') {\n return { [field]: { $null: false } } as FilterCondition;\n }\n\n const mapped = AST_OPERATOR_MAP[op];\n if (mapped) {\n return { [field]: { [mapped]: value } } as FilterCondition;\n }\n\n // Fallback: use the operator as-is with $ prefix\n return { [field]: { [`$${op}`]: value } } as FilterCondition;\n}\n\n/**\n * Parse a filter from AST array format to FilterCondition object format.\n *\n * The AST array format is used by the ObjectUI client and the `FilterBuilder`:\n * - Comparison: `[field, operator, value]` → `{ field: value }` or `{ field: { $op: value } }`\n * - Logical AND: `[\"and\", cond1, cond2, ...]` → `{ $and: [...] }`\n * - Logical OR: `[\"or\", cond1, cond2, ...]` → `{ $or: [...] }`\n *\n * If the input is already a FilterCondition object (not an array), it is returned as-is.\n * If the input is `null` or `undefined`, it is returned as-is.\n *\n * @example\n * // Simple condition\n * parseFilterAST([\"status\", \"=\", \"active\"])\n * // → { status: \"active\" }\n *\n * @example\n * // Compound AND\n * parseFilterAST([\"and\", [\"priority\", \"=\", \"high\"], [\"status\", \"=\", \"active\"]])\n * // → { $and: [{ priority: \"high\" }, { status: \"active\" }] }\n *\n * @example\n * // Object passthrough\n * parseFilterAST({ status: \"active\" })\n * // → { status: \"active\" }\n */\nexport function parseFilterAST(filter: unknown): FilterCondition | undefined {\n if (filter == null) return undefined;\n if (!Array.isArray(filter)) return filter as FilterCondition;\n if (filter.length === 0) return undefined;\n\n const first = filter[0];\n\n // Logical node: [\"and\", cond1, cond2, ...] or [\"or\", cond1, cond2, ...]\n if (typeof first === 'string' && (first.toLowerCase() === 'and' || first.toLowerCase() === 'or')) {\n const logicOp = `$${first.toLowerCase()}` as '$and' | '$or';\n const children = filter.slice(1).map((child: unknown) => parseFilterAST(child)).filter(Boolean) as FilterCondition[];\n if (children.length === 0) return undefined;\n if (children.length === 1) return children[0];\n return { [logicOp]: children } as FilterCondition;\n }\n\n // Comparison node: [field, operator, value]\n if (filter.length >= 2 && typeof first === 'string') {\n return convertComparison(filter as [string, string, unknown]);\n }\n\n // Legacy flat array: [[field, op, val], [field, op, val], ...]\n // All elements are sub-arrays → treat as implicit AND\n if (filter.every((item: unknown) => Array.isArray(item))) {\n const children = filter.map((child: unknown) => parseFilterAST(child)).filter(Boolean) as FilterCondition[];\n if (children.length === 0) return undefined;\n if (children.length === 1) return children[0];\n return { $and: children } as FilterCondition;\n }\n\n return undefined;\n}\n\n// ============================================================================\n// Constants & Metadata\n// ============================================================================\n\n/**\n * All supported operator keys.\n * Useful for validation and parsing.\n */\nexport const FILTER_OPERATORS = [\n // Equality\n '$eq', '$ne',\n // Comparison\n '$gt', '$gte', '$lt', '$lte',\n // Set & Range\n '$in', '$nin', '$between',\n // String\n '$contains', '$notContains', '$startsWith', '$endsWith',\n // Special\n '$null', '$exists',\n] as const;\n\n/**\n * Logical operator keys.\n */\nexport const LOGICAL_OPERATORS = ['$and', '$or', '$not'] as const;\n\n/**\n * All operator keys (field + logical).\n */\nexport const ALL_OPERATORS = [...FILTER_OPERATORS, ...LOGICAL_OPERATORS] as const;\n\nexport type FilterOperatorKey = typeof FILTER_OPERATORS[number];\nexport type LogicalOperatorKey = typeof LOGICAL_OPERATORS[number];\nexport type OperatorKey = typeof ALL_OPERATORS[number];\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FilterConditionSchema } from './filter.zod';\n\n/**\n * Sort Node\n * Represents \"Order By\".\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SortNodeSchema = lazySchema(() => z.object({\n field: z.string(),\n order: z.enum(['asc', 'desc']).default('asc')\n}));\n\n/**\n * Aggregation Function Enum\n * Standard aggregation functions for data analysis.\n * \n * Supported Functions:\n * - **count**: Count rows (SQL: COUNT(*) or COUNT(field))\n * - **sum**: Sum numeric values (SQL: SUM(field))\n * - **avg**: Average numeric values (SQL: AVG(field))\n * - **min**: Minimum value (SQL: MIN(field))\n * - **max**: Maximum value (SQL: MAX(field))\n * - **count_distinct**: Count unique values (SQL: COUNT(DISTINCT field))\n * - **array_agg**: Aggregate values into array (SQL: ARRAY_AGG(field))\n * - **string_agg**: Concatenate values (SQL: STRING_AGG(field, delimiter))\n * \n * Performance Considerations:\n * - COUNT(*) is typically faster than COUNT(field) as it doesn't check for nulls\n * - COUNT DISTINCT may require additional memory for tracking unique values\n * - Window aggregates (with OVER clause) can be more efficient than subqueries\n * - Large GROUP BY operations benefit from proper indexing on grouped fields\n * \n * @example\n * // SQL: SELECT region, SUM(amount) FROM sales GROUP BY region\n * {\n * object: 'sales',\n * fields: ['region'],\n * aggregations: [\n * { function: 'sum', field: 'amount', alias: 'total_sales' }\n * ],\n * groupBy: ['region']\n * }\n * \n * @example\n * // Salesforce SOQL: SELECT COUNT(Id) FROM Account\n * {\n * object: 'account',\n * aggregations: [\n * { function: 'count', alias: 'total_accounts' }\n * ]\n * }\n */\nexport const AggregationFunction = z.enum([\n 'count', 'sum', 'avg', 'min', 'max',\n 'count_distinct', 'array_agg', 'string_agg'\n]);\n\n/**\n * Date Granularity Enum\n * Used to bucket date/timestamp fields into uniform periods during GROUP BY.\n *\n * Backends MAY emit `DATE_TRUNC` (PostgreSQL), `DATE_FORMAT` (MySQL),\n * `$dateTrunc` (MongoDB), or any other equivalent. When a driver does not\n * support server-side truncation the engine falls back to an in-memory bucket\n * using ISO-8601 conventions (weeks start Monday).\n */\nexport const DateGranularity = z.enum(['day', 'week', 'month', 'quarter', 'year']);\n\n/**\n * GroupBy Node\n *\n * A grouping target — either a bare field name (string) for plain grouping,\n * or a structured object that adds `dateGranularity` for time-bucketed\n * grouping. The string form remains the canonical short-hand:\n *\n * ```ts\n * groupBy: ['region', { field: 'closed_at', dateGranularity: 'quarter' }]\n * ```\n *\n * This is backward-compatible: every existing `groupBy: ['region']` payload\n * continues to validate.\n */\nexport const GroupByNodeSchema = lazySchema(() => z.union([\n z.string(),\n z.object({\n field: z.string().describe('Field to group by'),\n dateGranularity: DateGranularity.optional().describe('Bucket date values into uniform periods (day/week/month/quarter/year)'),\n /** Optional alias for the projected group value (defaults to `field`). */\n alias: z.string().optional().describe('Alias for the projected group value'),\n }),\n]));\n\n/**\n * Aggregation Node\n * Represents an aggregated field with function.\n * \n * Aggregations summarize data across groups of rows (GROUP BY).\n * Used with `groupBy` to create analytical queries.\n * \n * @example\n * // SQL: SELECT customer_id, COUNT(*), SUM(amount) FROM orders GROUP BY customer_id\n * {\n * object: 'order',\n * fields: ['customer_id'],\n * aggregations: [\n * { function: 'count', alias: 'order_count' },\n * { function: 'sum', field: 'amount', alias: 'total_amount' }\n * ],\n * groupBy: ['customer_id']\n * }\n * \n * @example\n * // Salesforce SOQL: SELECT LeadSource, COUNT(Id) FROM Lead GROUP BY LeadSource\n * {\n * object: 'lead',\n * fields: ['lead_source'],\n * aggregations: [\n * { function: 'count', alias: 'lead_count' }\n * ],\n * groupBy: ['lead_source']\n * }\n */\nexport const AggregationNodeSchema = lazySchema(() => z.object({\n function: AggregationFunction.describe('Aggregation function'),\n field: z.string().optional().describe('Field to aggregate (optional for COUNT(*))'),\n alias: z.string().describe('Result column alias'),\n distinct: z.boolean().optional().describe('Apply DISTINCT before aggregation'),\n filter: FilterConditionSchema.optional().describe('Filter/Condition to apply to the aggregation (FILTER WHERE clause)'),\n}));\n\n/**\n * Join Type Enum\n * Standard SQL join types for combining tables.\n * \n * Join Types:\n * - **inner**: Returns only matching rows from both tables (SQL: INNER JOIN)\n * - **left**: Returns all rows from left table, matching rows from right (SQL: LEFT JOIN)\n * - **right**: Returns all rows from right table, matching rows from left (SQL: RIGHT JOIN)\n * - **full**: Returns all rows from both tables (SQL: FULL OUTER JOIN)\n * \n * @example\n * // SQL: SELECT * FROM orders INNER JOIN customers ON orders.customer_id = customers.id\n * {\n * object: 'order',\n * joins: [\n * {\n * type: 'inner',\n * object: 'customer',\n * on: ['order.customer_id', '=', 'customer.id']\n * }\n * ]\n * }\n * \n * @example\n * // Salesforce SOQL-style: Find all customers and their orders (if any)\n * {\n * object: 'customer',\n * joins: [\n * {\n * type: 'left',\n * object: 'order',\n * on: ['customer.id', '=', 'order.customer_id']\n * }\n * ]\n * }\n */\nexport const JoinType = z.enum(['inner', 'left', 'right', 'full']);\n\n/**\n * Join Execution Strategy\n * Hints to the query engine on how to execute the join.\n * \n * Strategies:\n * - **auto**: Engine decides best strategy (Default).\n * - **database**: Push down join to the database (Requires same datasource).\n * - **hash**: Load both sets into memory and hash join (Cross-datasource, memory intensive).\n * - **loop**: Nested loop lookup (N+1 safe version). (Good for small right-side lookups).\n */\nexport const JoinStrategy = z.enum(['auto', 'database', 'hash', 'loop']);\n\n/**\n * Join Node\n * Represents table joins for combining data from multiple objects.\n * \n * Joins connect related data across multiple tables using ON conditions.\n * Supports both direct object joins and subquery joins.\n * \n * @example\n * // SQL: SELECT o.*, c.name FROM orders o INNER JOIN customers c ON o.customer_id = c.id\n * {\n * object: 'order',\n * fields: ['id', 'amount'],\n * joins: [\n * {\n * type: 'inner',\n * object: 'customer',\n * alias: 'c',\n * on: ['order.customer_id', '=', 'c.id']\n * }\n * ]\n * }\n * \n * @example\n * // SQL: Multi-table join\n * // SELECT * FROM orders o\n * // INNER JOIN customers c ON o.customer_id = c.id\n * // LEFT JOIN shipments s ON o.id = s.order_id\n * {\n * object: 'order',\n * joins: [\n * {\n * type: 'inner',\n * object: 'customer',\n * alias: 'c',\n * on: ['order.customer_id', '=', 'c.id']\n * },\n * {\n * type: 'left',\n * object: 'shipment',\n * alias: 's',\n * on: ['order.id', '=', 's.order_id']\n * }\n * ]\n * }\n * \n * @example\n * // Salesforce SOQL: SELECT Name, (SELECT LastName FROM Contacts) FROM Account\n * {\n * object: 'account',\n * fields: ['name'],\n * joins: [\n * {\n * type: 'left',\n * object: 'contact',\n * on: ['account.id', '=', 'contact.account_id']\n * }\n * ]\n * }\n * \n * @example\n * // Subquery Join: Join with a filtered/aggregated dataset\n * {\n * object: 'customer',\n * joins: [\n * {\n * type: 'left',\n * object: 'order',\n * alias: 'high_value_orders',\n * on: ['customer.id', '=', 'high_value_orders.customer_id'],\n * subquery: {\n * object: 'order',\n * fields: ['customer_id', 'total'],\n * filters: ['total', '>', 1000]\n * }\n * }\n * ]\n * }\n */\nexport const JoinNodeSchema: z.ZodType<any> = z.lazy(() => \n z.object({\n type: JoinType.describe('Join type'),\n strategy: JoinStrategy.optional().describe('Execution strategy hint'),\n object: z.string().describe('Object/table to join'),\n alias: z.string().optional().describe('Table alias'),\n on: FilterConditionSchema.describe('Join condition'),\n subquery: z.lazy(() => QuerySchema).optional().describe('Subquery instead of object'),\n })\n);\n\n/**\n * Window Function Enum\n * Advanced analytical functions for row-based calculations.\n * \n * Window Functions:\n * - **row_number**: Sequential number within partition (SQL: ROW_NUMBER() OVER (...))\n * - **rank**: Rank with gaps for ties (SQL: RANK() OVER (...))\n * - **dense_rank**: Rank without gaps (SQL: DENSE_RANK() OVER (...))\n * - **percent_rank**: Relative rank as percentage (SQL: PERCENT_RANK() OVER (...))\n * - **lag**: Access previous row value (SQL: LAG(field) OVER (...))\n * - **lead**: Access next row value (SQL: LEAD(field) OVER (...))\n * - **first_value**: First value in window (SQL: FIRST_VALUE(field) OVER (...))\n * - **last_value**: Last value in window (SQL: LAST_VALUE(field) OVER (...))\n * - **sum/avg/count/min/max**: Aggregates over window (SQL: SUM(field) OVER (...))\n * \n * @example\n * // SQL: SELECT *, ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY amount DESC) as rank\n * // FROM orders\n * {\n * object: 'order',\n * fields: ['id', 'customer_id', 'amount'],\n * windowFunctions: [\n * {\n * function: 'row_number',\n * alias: 'rank',\n * over: {\n * partitionBy: ['customer_id'],\n * orderBy: [{ field: 'amount', order: 'desc' }]\n * }\n * }\n * ]\n * }\n * \n * @example\n * // SQL: Running total with SUM() OVER (...)\n * {\n * object: 'transaction',\n * fields: ['date', 'amount'],\n * windowFunctions: [\n * {\n * function: 'sum',\n * field: 'amount',\n * alias: 'running_total',\n * over: {\n * orderBy: [{ field: 'date', order: 'asc' }],\n * frame: {\n * type: 'rows',\n * start: 'UNBOUNDED PRECEDING',\n * end: 'CURRENT ROW'\n * }\n * }\n * }\n * ]\n * }\n */\nexport const WindowFunction = z.enum([\n 'row_number', 'rank', 'dense_rank', 'percent_rank',\n 'lag', 'lead', 'first_value', 'last_value',\n 'sum', 'avg', 'count', 'min', 'max'\n]);\n\n/**\n * Window Specification\n * Defines PARTITION BY and ORDER BY for window functions.\n * \n * Window specifications control how window functions compute values:\n * - **partitionBy**: Divide rows into groups (like GROUP BY but without collapsing rows)\n * - **orderBy**: Define order for ranking and offset functions\n * - **frame**: Specify which rows to include in aggregate calculations\n * \n * @example\n * // Partition by department, order by salary\n * {\n * partitionBy: ['department'],\n * orderBy: [{ field: 'salary', order: 'desc' }]\n * }\n * \n * @example\n * // Moving average with frame specification\n * {\n * orderBy: [{ field: 'date', order: 'asc' }],\n * frame: {\n * type: 'rows',\n * start: '6 PRECEDING',\n * end: 'CURRENT ROW'\n * }\n * }\n */\nexport const WindowSpecSchema = lazySchema(() => z.object({\n partitionBy: z.array(z.string()).optional().describe('PARTITION BY fields'),\n orderBy: z.array(SortNodeSchema).optional().describe('ORDER BY specification'),\n frame: z.object({\n type: z.enum(['rows', 'range']).optional(),\n start: z.string().optional().describe('Frame start (e.g., \"UNBOUNDED PRECEDING\", \"1 PRECEDING\")'),\n end: z.string().optional().describe('Frame end (e.g., \"CURRENT ROW\", \"1 FOLLOWING\")'),\n }).optional().describe('Window frame specification'),\n}));\n\n/**\n * Window Function Node\n * Represents window function with OVER clause.\n * \n * Window functions perform calculations across a set of rows related to the current row,\n * without collapsing the result set (unlike GROUP BY aggregations).\n * \n * @example\n * // SQL: Top 3 products per category\n * // SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY sales DESC) as rank\n * // FROM products\n * {\n * object: 'product',\n * fields: ['name', 'category', 'sales'],\n * windowFunctions: [\n * {\n * function: 'row_number',\n * alias: 'category_rank',\n * over: {\n * partitionBy: ['category'],\n * orderBy: [{ field: 'sales', order: 'desc' }]\n * }\n * }\n * ]\n * }\n * \n * @example\n * // SQL: Year-over-year comparison with LAG\n * {\n * object: 'monthly_sales',\n * fields: ['month', 'revenue'],\n * windowFunctions: [\n * {\n * function: 'lag',\n * field: 'revenue',\n * alias: 'prev_year_revenue',\n * over: {\n * orderBy: [{ field: 'month', order: 'asc' }]\n * }\n * }\n * ]\n * }\n */\nexport const WindowFunctionNodeSchema = lazySchema(() => z.object({\n function: WindowFunction.describe('Window function name'),\n field: z.string().optional().describe('Field to operate on (for aggregate window functions)'),\n alias: z.string().describe('Result column alias'),\n over: WindowSpecSchema.describe('Window specification (OVER clause)'),\n}));\n\n/**\n * Field Selection Node\n * Represents \"Select\" attributes, including joins.\n */\nexport const FieldNodeSchema: z.ZodType<any> = z.lazy(() => \n z.union([\n z.string(), // Primitive field: \"name\"\n z.object({\n field: z.string(), // Relationship field: \"owner\"\n fields: z.array(FieldNodeSchema).optional(), // Nested select: [\"name\", \"email\"]\n alias: z.string().optional()\n })\n ])\n);\n\n/**\n * Full-Text Search Configuration\n * Defines full-text search parameters for text queries.\n * \n * Supports:\n * - Multi-field search\n * - Relevance scoring\n * - Fuzzy matching\n * - Language-specific analyzers\n * \n * @example\n * {\n * query: \"John Smith\",\n * fields: [\"name\", \"email\", \"description\"],\n * fuzzy: true,\n * boost: { \"name\": 2.0, \"email\": 1.5 }\n * }\n */\nexport const FullTextSearchSchema = lazySchema(() => z.object({\n query: z.string().describe('Search query text'),\n fields: z.array(z.string()).optional().describe('Fields to search in (if not specified, searches all text fields)'),\n fuzzy: z.boolean().optional().default(false).describe('Enable fuzzy matching (tolerates typos)'),\n operator: z.enum(['and', 'or']).optional().default('or').describe('Logical operator between terms'),\n boost: z.record(z.string(), z.number()).optional().describe('Field-specific relevance boosting (field name -> boost factor)'),\n minScore: z.number().optional().describe('Minimum relevance score threshold'),\n language: z.string().optional().describe('Language for text analysis (e.g., \"en\", \"zh\", \"es\")'),\n highlight: z.boolean().optional().default(false).describe('Enable search result highlighting'),\n}));\n\nexport type FullTextSearch = z.infer<typeof FullTextSearchSchema>;\n\n/**\n * Query AST Schema\n * The universal data retrieval contract defined in `ast-structure.mdx`.\n * \n * This schema represents ObjectQL - a universal query language that abstracts\n * SQL, NoSQL, and SaaS APIs into a single unified interface.\n * \n * Updates (v2):\n * - Aligned with modern ORM standards (Prisma/TypeORM)\n * - Added `cursor` based pagination support\n * - Renamed `top`/`skip` to `limit`/`offset`\n * - Unified filtering syntax with `FilterConditionSchema`\n * \n * Updates (v3):\n * - Added `search` parameter for full-text search (P2 requirement)\n * \n * @example\n * // Simple query: SELECT name, email FROM account WHERE status = 'active'\n * {\n * object: 'account',\n * fields: ['name', 'email'],\n * where: { status: 'active' }\n * }\n * \n * @example\n * // Pagination with Limit/Offset\n * {\n * object: 'post',\n * where: { published: true },\n * orderBy: [{ field: 'created_at', order: 'desc' }],\n * limit: 20,\n * offset: 40\n * }\n * \n * @example\n * // Full-text search\n * {\n * object: 'article',\n * search: {\n * query: \"machine learning\",\n * fields: [\"title\", \"content\"],\n * fuzzy: true,\n * boost: { \"title\": 2.0 }\n * },\n * limit: 10\n * }\n */\nconst BaseQuerySchema = z.object({\n /** Target Entity */\n object: z.string().describe('Object name (e.g. account)'),\n \n /** Select Clause */\n fields: z.array(FieldNodeSchema).optional().describe('Fields to retrieve'),\n \n /** Where Clause (Filtering) */\n where: FilterConditionSchema.optional().describe('Filtering criteria (WHERE)'),\n \n /** Full-Text Search */\n search: FullTextSearchSchema.optional().describe('Full-text search configuration ($search parameter)'),\n \n /** Order By Clause (Sorting) */\n orderBy: z.array(SortNodeSchema).optional().describe('Sorting instructions (ORDER BY)'),\n \n /** Pagination */\n limit: z.number().optional().describe('Max records to return (LIMIT)'),\n offset: z.number().optional().describe('Records to skip (OFFSET)'),\n top: z.number().optional().describe('Alias for limit (OData compatibility)'),\n cursor: z.record(z.string(), z.unknown()).optional().describe('Cursor for keyset pagination'),\n \n /** Joins */\n joins: z.array(JoinNodeSchema).optional().describe('Explicit Table Joins'),\n \n /** Aggregations */\n aggregations: z.array(AggregationNodeSchema).optional().describe('Aggregation functions'),\n \n /** Group By Clause */\n groupBy: z.array(GroupByNodeSchema).optional().describe('GROUP BY targets (strings or `{field, dateGranularity?}` objects for date bucketing)'),\n \n /** Having Clause */\n having: FilterConditionSchema.optional().describe('HAVING clause for aggregation filtering'),\n \n /** Window Functions */\n windowFunctions: z.array(WindowFunctionNodeSchema).optional().describe('Window functions with OVER clause'),\n \n /** Subquery flag */\n distinct: z.boolean().optional().describe('SELECT DISTINCT flag'),\n});\n\n/**\n * QueryAST — Abstract Syntax Tree for data queries.\n *\n * The `expand` property enables recursive loading of related records through\n * lookup and master_detail fields. Each key is a relationship field name; the\n * value is a nested QueryAST that can further filter, select, sort, and expand\n * the related records (up to a default max depth of 3).\n *\n * @example\n * ```ts\n * const ast: QueryAST = {\n * object: 'task',\n * fields: ['title', 'assignee'],\n * expand: {\n * assignee: { object: 'user', fields: ['name', 'email'] },\n * project: {\n * object: 'project',\n * expand: { org: { object: 'org' } } // nested expand\n * }\n * }\n * };\n * ```\n */\nexport type QueryAST = z.infer<typeof BaseQuerySchema> & {\n expand?: Record<string, QueryAST>;\n};\n\nexport type QueryInput = z.input<typeof BaseQuerySchema> & {\n expand?: Record<string, QueryInput>;\n};\n\nexport const QuerySchema: z.ZodType<QueryAST> = lazySchema(() => BaseQuerySchema.extend({\n expand: z.lazy(() => z.record(z.string(), QuerySchema)).optional().describe(\n 'Recursive relation loading map. Keys are lookup/master_detail field names; '\n + 'values are nested QueryAST objects that control select (`fields`) and filter '\n + '(`where`, AND-merged with the batch $in), plus further expansion on the related '\n + 'object. The engine resolves expand via batch $in queries (driver-agnostic) with a '\n + 'default max depth of 3; per-parent `limit`/`offset`/`orderBy` are NOT applied on '\n + 'this path.'\n ),\n}));\n\nexport type SortNode = z.infer<typeof SortNodeSchema>;\nexport type AggregationNode = z.infer<typeof AggregationNodeSchema>;\nexport type GroupByNode = z.infer<typeof GroupByNodeSchema>;\nexport type DateGranularityValue = z.infer<typeof DateGranularity>;\nexport type JoinNode = z.infer<typeof JoinNodeSchema>;\nexport type WindowFunctionNode = z.infer<typeof WindowFunctionNodeSchema>;\nexport type WindowSpec = z.infer<typeof WindowSpecSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Date Macro Tokens — the declarative placeholders the UI substitutes\n * into filter values before sending a query to the data engine.\n *\n * # Why this lives in `spec`\n *\n * Filter values in dashboards, views, reports and pages travel as JSON.\n * Because JSON cannot evaluate code, callers cannot write `daysAgo(30)`\n * inline; they use a tiny placeholder grammar instead:\n *\n * { published_at: { $gte: '{last_quarter_start}' } }\n * { signal_at: { $gte: '{30_days_ago}' } }\n *\n * The placeholders are expanded **client-side** by\n * `resolveDateMacros()` in `@object-ui/core` immediately before the\n * filter is handed to the data source. The data engine itself only\n * sees ISO date / timestamp strings, never `{tokens}`.\n *\n * AI agents and template authors author these placeholders directly,\n * so the **set of recognised tokens is part of the platform contract**\n * and must live here next to the rest of the JSON-DSL schemas, not\n * inside any single UI implementation.\n *\n * # Two flavours of token\n *\n * 1. **Fixed tokens** — small, finite list (`{today}`,\n * `{current_quarter_start}`, `{last_year_end}`, …). Enumerated by\n * `DATE_MACRO_TOKENS` below.\n *\n * 2. **Parameterised tokens** — `{N_days_ago}`, `{N_weeks_from_now}`,\n * etc., where `N` is any non-negative integer. Matched by\n * `DATE_MACRO_PARAM_RE`. Units: `minute(s)`, `hour(s)`, `day(s)`,\n * `week(s)`, `month(s)`, `year(s)`. Directions: `ago`, `from_now`.\n *\n * # Out of scope\n *\n * - CEL expressions (`cel\\`daysAgo(30)\\``) run **server-side** in the\n * formula engine. They are unrelated to these placeholders; see\n * `@objectstack/formula`.\n * - Token resolution semantics (week-start day, timezone, fiscal\n * calendars) are defined by the resolver implementation; spec only\n * freezes the **vocabulary**.\n */\n\n/** Single-point tokens — moments in time. */\nexport const DATE_MACRO_INSTANT_TOKENS = [\n 'today',\n 'yesterday',\n 'tomorrow',\n 'now',\n] as const;\n\n/** Period boundaries for the current/last/next week/month/quarter/year. */\nexport const DATE_MACRO_PERIOD_TOKENS = [\n 'current_week_start', 'current_week_end',\n 'current_month_start', 'current_month_end',\n 'current_quarter_start', 'current_quarter_end',\n 'current_year_start', 'current_year_end',\n\n 'last_week_start', 'last_week_end',\n 'last_month_start', 'last_month_end',\n 'last_quarter_start', 'last_quarter_end',\n 'last_year_start', 'last_year_end',\n\n 'next_week_start', 'next_week_end',\n 'next_month_start', 'next_month_end',\n 'next_quarter_start', 'next_quarter_end',\n 'next_year_start', 'next_year_end',\n] as const;\n\n/**\n * Bare aliases — `{week_start}` means `{current_week_start}`, etc.\n * Provided because every other major dashboard tool accepts them and\n * AI agents reach for them by default.\n */\nexport const DATE_MACRO_ALIAS_TOKENS = [\n 'week_start', 'week_end',\n 'month_start', 'month_end',\n 'quarter_start','quarter_end',\n 'year_start', 'year_end',\n] as const;\n\n/** All fixed tokens — concat of the three groups above. */\nexport const DATE_MACRO_TOKENS = [\n ...DATE_MACRO_INSTANT_TOKENS,\n ...DATE_MACRO_PERIOD_TOKENS,\n ...DATE_MACRO_ALIAS_TOKENS,\n] as const;\n\nexport type DateMacroToken = (typeof DATE_MACRO_TOKENS)[number];\n\n/**\n * Parameterised token grammar.\n *\n * {<N>_<unit>(s)?_<direction>}\n *\n * Examples that match:\n * - `30_days_ago`\n * - `1_day_ago`\n * - `90_days_from_now`\n * - `2_weeks_ago`\n * - `6_months_from_now`\n * - `1_year_ago`\n * - `15_minutes_ago`\n * - `2_hours_from_now`\n *\n * Capture groups: 1=N (string of digits), 2=unit (singular or plural,\n * no trailing `s` stripped), 3=direction (`ago` | `from_now`).\n */\nexport const DATE_MACRO_PARAM_RE =\n /^(\\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/;\n\n/**\n * Units recognised by the parameterised grammar. Listed here so the\n * resolver and any token-completion UI can share the source of truth.\n */\nexport const DATE_MACRO_UNITS = [\n 'minute', 'hour', 'day', 'week', 'month', 'year',\n] as const;\n\nexport type DateMacroUnit = (typeof DATE_MACRO_UNITS)[number];\nexport type DateMacroDirection = 'ago' | 'from_now';\n\nexport interface DateMacroParamMatch {\n readonly n: number;\n readonly unit: DateMacroUnit;\n readonly direction: DateMacroDirection;\n}\n\n/**\n * Test helper: return whether `token` (without braces) is a valid\n * date macro — either a fixed token or a parameterised one. Use\n * this in lint passes or AI-side validators.\n */\nexport function isDateMacroToken(token: string): boolean {\n return (\n (DATE_MACRO_TOKENS as readonly string[]).includes(token) ||\n DATE_MACRO_PARAM_RE.test(token)\n );\n}\n\n/** Parse a parameterised token. Returns null if the token isn't parameterised. */\nexport function parseDateMacroParam(token: string): DateMacroParamMatch | null {\n const m = token.match(DATE_MACRO_PARAM_RE);\n if (!m) return null;\n const unit = m[2].replace(/s$/, '') as DateMacroUnit;\n return {\n n: parseInt(m[1], 10),\n unit,\n direction: m[3] as DateMacroDirection,\n };\n}\n\n/**\n * Strict zod schema for the **token name** (the bit inside `{}`).\n * Accepts any fixed token or anything matching `DATE_MACRO_PARAM_RE`.\n */\nexport const DateMacroTokenSchema = z\n .string()\n .refine(isDateMacroToken, {\n message:\n 'Unknown date macro. Must be a fixed token (see DATE_MACRO_TOKENS) ' +\n 'or match {N_<unit>_(ago|from_now)} where unit is one of: ' +\n DATE_MACRO_UNITS.join(', '),\n });\n\n/**\n * Match the **wrapped** form, i.e. the literal a filter author writes:\n * `{today}` or `${30_days_ago}`. Used by lint passes that walk filter\n * trees looking for placeholder strings.\n */\nexport const DATE_MACRO_WRAPPED_RE = /^\\$?\\{([a-zA-Z0-9_]+)\\}$/;\n\n/**\n * Zod schema for a complete placeholder string (`'{today}'`,\n * `'${30_days_ago}'`). Use as an opt-in refinement on filter values\n * to fail loudly on unknown tokens instead of silently sending them\n * to SQL.\n */\nexport const DateMacroPlaceholderSchema = z\n .string()\n .refine(\n (s) => {\n const m = s.match(DATE_MACRO_WRAPPED_RE);\n return !!m && isDateMacroToken(m[1]);\n },\n { message: 'Not a recognised {date-macro} placeholder' },\n );\n\n/**\n * Description table — handy for skill / docs generation. Pure data,\n * intentionally not exported through any zod schema.\n */\nexport const DATE_MACRO_DESCRIPTIONS: Record<DateMacroToken, string> = {\n today: 'Start of today (YYYY-MM-DD).',\n yesterday:'Start of yesterday.',\n tomorrow: 'Start of tomorrow.',\n now: 'Current timestamp (full ISO).',\n\n current_week_start: 'Monday 00:00 of this week.',\n current_week_end: 'Sunday of this week.',\n current_month_start: '1st of this month.',\n current_month_end: 'Last day of this month.',\n current_quarter_start: '1st day of this quarter.',\n current_quarter_end: 'Last day of this quarter.',\n current_year_start: 'Jan 1 of this year.',\n current_year_end: 'Dec 31 of this year.',\n\n last_week_start: 'Monday of last week.',\n last_week_end: 'Sunday of last week.',\n last_month_start: '1st of last month.',\n last_month_end: 'Last day of last month.',\n last_quarter_start: '1st day of last quarter.',\n last_quarter_end: 'Last day of last quarter.',\n last_year_start: 'Jan 1 of last year.',\n last_year_end: 'Dec 31 of last year.',\n\n next_week_start: 'Monday of next week.',\n next_week_end: 'Sunday of next week.',\n next_month_start: '1st of next month.',\n next_month_end: 'Last day of next month.',\n next_quarter_start: '1st day of next quarter.',\n next_quarter_end: 'Last day of next quarter.',\n next_year_start: 'Jan 1 of next year.',\n next_year_end: 'Dec 31 of next year.',\n\n week_start: 'Alias for current_week_start.',\n week_end: 'Alias for current_week_end.',\n month_start: 'Alias for current_month_start.',\n month_end: 'Alias for current_month_end.',\n quarter_start: 'Alias for current_quarter_start.',\n quarter_end: 'Alias for current_quarter_end.',\n year_start: 'Alias for current_year_start.',\n year_end: 'Alias for current_year_end.',\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * System Identifier Schema\n * \n * Universal naming convention for all machine identifiers (API Names) in ObjectStack.\n * Enforces lowercase with underscores or dots to ensure:\n * - Cross-platform compatibility (case-insensitive filesystems)\n * - URL-friendliness (no encoding needed)\n * - Database consistency (no collation issues)\n * - Security (no case-sensitivity bugs in permission checks)\n * \n * **Applies to all metadata that acts as a machine identifier:**\n * - Object names (tables/collections)\n * - Field names\n * - Role names\n * - Permission set names\n * - Action/trigger names\n * - Event keys\n * - App IDs\n * - Menu/page IDs\n * - Select option values\n * - Workflow names\n * - Webhook names\n * \n * **Naming Convention Summary:**\n * | Type | Pattern | Example |\n * |------|---------|---------|\n * | Machine ID | snake_case | `crm_account`, `btn_submit`, `role_admin` |\n * | Event keys | dot.notation | `user.login`, `order.created` |\n * | Labels | Any case | `Client Account`, `Submit Form` |\n * \n * @example Valid identifiers\n * - 'account'\n * - 'crm_account'\n * - 'user_profile'\n * - 'order.created' (for events)\n * - 'api_v2_endpoint'\n * \n * @example Invalid identifiers (will be rejected)\n * - 'Account' (uppercase)\n * - 'CrmAccount' (camelCase)\n * - 'crm-account' (kebab-case - use underscore instead)\n * - 'user profile' (spaces)\n */\nimport { lazySchema } from './lazy-schema';\nexport const SystemIdentifierSchema = lazySchema(() => z\n .string()\n .min(2, { message: 'System identifier must be at least 2 characters' })\n .regex(/^[a-z][a-z0-9_.]*$/, {\n message:\n 'System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., \"user_profile\" or \"order.created\")',\n })\n .describe('System identifier (lowercase with underscores or dots)'));\n\n/**\n * Strict Snake Case Identifier\n * \n * More restrictive than SystemIdentifierSchema - only allows underscores (no dots).\n * Use this for identifiers that should NOT contain dots (e.g., database table/column names).\n * \n * @example Valid\n * - 'account'\n * - 'crm_account'\n * - 'user_profile'\n * \n * @example Invalid\n * - 'user.profile' (dots not allowed)\n * - 'UserProfile' (uppercase)\n */\nexport const SnakeCaseIdentifierSchema = lazySchema(() => z\n .string()\n .min(2, { message: 'Identifier must be at least 2 characters' })\n .regex(/^[a-z][a-z0-9_]*$/, {\n message:\n 'Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., \"user_profile\")',\n })\n .describe('Snake case identifier (lowercase with underscores only)'));\n\n/**\n * Event Name Identifier\n * \n * Specialized identifier for event names that encourages dot notation.\n * Used in event-driven systems, message queues, and webhooks.\n * \n * Pattern: `namespace.action` or `entity.event_type`\n * \n * @example Valid\n * - 'user.created'\n * - 'order.paid'\n * - 'user.login_success'\n * - 'alarm.high_cpu'\n * \n * @example Invalid\n * - 'UserCreated' (camelCase)\n * - 'user_created' (should use dots for namespacing)\n */\nexport const EventNameSchema = lazySchema(() => z\n .string()\n .min(3, { message: 'Event name must be at least 3 characters' })\n .regex(/^[a-z][a-z0-9_.]*$/, {\n message:\n 'Event name must be lowercase with dots for namespacing (e.g., \"user.created\", \"order.paid\")',\n })\n .describe('Event name (lowercase with dot notation for namespacing)'));\n\n/**\n * Type Exports\n */\nexport type SystemIdentifier = z.infer<typeof SystemIdentifierSchema>;\nexport type SnakeCaseIdentifier = z.infer<typeof SnakeCaseIdentifierSchema>;\nexport type EventName = z.infer<typeof EventNameSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * # Expression Protocol\n *\n * Canonical wire format for all \"expression\"-shaped metadata across ObjectStack\n * (formula fields, predicates, conditions, criteria, visibility rules, seed\n * dynamic values, …).\n *\n * The persisted form is `{ dialect, source }` (and, after `objectstack\n * compile` normalization, `{ dialect, ast }`). String-only shorthand is\n * accepted at *input* time for developer ergonomics; build emits the canonical\n * envelope.\n *\n * ## Dialects\n *\n * | dialect | engine | use |\n * |:---|:---|:---|\n * | `cel` | `@objectstack/formula` (cel-js + ObjectStack stdlib) | formulas, predicates, seed dynamic values |\n * | `js` | sandboxed L2 hook bodies (`isolated-vm` / `quickjs`) | mapping, hook bodies |\n * | `cron` | `cron-parser` | job schedules |\n *\n * SQL fragments (analytics joins, partial indexes) are intentionally **not**\n * routed through this schema — they stay driver-native because their security\n * posture and portability story differ.\n *\n * @see content/docs/concepts/north-star.mdx §8 \"No private expression DSL\"\n */\n\n/** Supported expression dialects. */\nexport const ExpressionDialect = z.enum(['cel', 'js', 'cron', 'template']);\nexport type ExpressionDialect = z.infer<typeof ExpressionDialect>;\n\n/**\n * Authorship metadata for an expression. Optional but encouraged for AI-\n * generated artifacts so audit/explanation tooling has something to render.\n */\nexport const ExpressionMetaSchema = z.object({\n /** Human-readable rationale (often AI-emitted). */\n rationale: z.string().optional(),\n /** Identifier of the agent / tool that produced this expression. */\n generatedBy: z.string().optional(),\n});\nexport type ExpressionMeta = z.infer<typeof ExpressionMetaSchema>;\n\n/**\n * Canonical Expression envelope.\n *\n * Phase 1 (M9.1): `source` is the canonical persisted form. `ast` is reserved\n * and accepted as opaque structured value — `objectstack compile` will fill it\n * in M9.2 with the engine's parsed AST so the artifact carries an AST-only\n * representation.\n *\n * Phase 2 (M9.2+): `ast` becomes required in build output; `source` is kept\n * only for round-trip / debug.\n */\nexport const ExpressionSchema = z.object({\n /** Which engine evaluates `source` / `ast`. */\n dialect: ExpressionDialect,\n /** Surface syntax. Required while `ast` is not yet populated. */\n source: z.string().min(1).optional(),\n /**\n * Engine-native AST. Opaque at the spec layer; each engine validates its own\n * shape. For `dialect: 'cel'` this is the cel-js parsed AST node.\n */\n ast: z.unknown().optional(),\n /** Optional authorship metadata. */\n meta: ExpressionMetaSchema.optional(),\n}).refine(e => e.source !== undefined || e.ast !== undefined, {\n message: 'Expression requires at least one of `source` or `ast`',\n});\nexport type Expression = z.infer<typeof ExpressionSchema>;\n\n/**\n * Author-time input shape: a bare string is shorthand for `{ dialect: 'cel',\n * source }`. Engines that need other dialects must use the full envelope.\n *\n * Build (`objectstack compile`) normalizes this union to `Expression` so the\n * persisted artifact never contains the bare-string form.\n */\nexport const ExpressionInputSchema = z.union([\n z.string().min(1).transform((source): Expression => ({ dialect: 'cel', source })),\n ExpressionSchema,\n]);\nexport type ExpressionInput = z.input<typeof ExpressionInputSchema>;\n\n/**\n * Cron-typed input shape: a bare string is shorthand for `{ dialect: 'cron',\n * source }` (not `cel`). Use this for `schedule` / `cronExpression` fields so\n * authors can write `'0 9 * * 1-5'` without manually wrapping.\n */\nexport const CronExpressionInputSchema = z.union([\n z.string().min(1).transform((source): Expression => ({ dialect: 'cron', source })),\n ExpressionSchema,\n]);\nexport type CronExpressionInput = z.input<typeof CronExpressionInputSchema>;\n\n/**\n * Template-typed input shape: a bare string is shorthand for\n * `{ dialect: 'template', source }`. Use this for notification subjects/bodies,\n * titleFormat, prompt templates — anything with `{{var}}` interpolation.\n */\nexport const TemplateExpressionInputSchema = z.union([\n z.string().min(1).transform((source): Expression => ({ dialect: 'template', source })),\n ExpressionSchema,\n]);\nexport type TemplateExpressionInput = z.input<typeof TemplateExpressionInputSchema>;\n\n/**\n * Predicate — an Expression whose evaluation is expected to be boolean.\n * Spec layer cannot enforce return type at parse time; this alias exists for\n * intent documentation and future runtime type-check wiring.\n */\nexport const PredicateSchema = ExpressionSchema;\nexport type Predicate = z.infer<typeof PredicateSchema>;\n\nexport const PredicateInputSchema = ExpressionInputSchema;\nexport type PredicateInput = z.input<typeof PredicateInputSchema>;\n\n/**\n * Construct an Expression literal from a CEL source string. Used by DX\n * shorthand (`cel\\`...\\``) and by codegen tools.\n */\nexport function expression(source: string, dialect: ExpressionDialect = 'cel', meta?: ExpressionMeta): Expression {\n return { dialect, source, ...(meta ? { meta } : {}) };\n}\n\n/**\n * Tagged-template helpers for inline expression authoring.\n *\n * ```ts\n * import { cel, F, P } from '@objectstack/spec';\n *\n * const f = { formula: F`record.amount * 0.1` };\n * const v = { visible: P`record.status == \"open\"` };\n * const d = { close_date: cel`now() + duration(\"P30D\")` };\n * ```\n *\n * Each helper produces an {@link Expression} envelope with `dialect: 'cel'`\n * and the rendered template string as `source`. The CLI `objectstack compile`\n * step (M9.2) parses these into ASTs at build time so the persisted artifact\n * is dialect-AST only.\n */\nfunction renderTemplate(strings: TemplateStringsArray, values: readonly unknown[]): string {\n if (values.length === 0) return strings[0] ?? '';\n let out = strings[0] ?? '';\n for (let i = 0; i < values.length; i++) {\n const v = values[i];\n // Inline literal substitution. Strings get JSON-escaped so `${name}` for\n // `name = 'O\\'Brien'` produces a valid CEL string literal. Numbers and\n // booleans render as their toString. Anything exotic should be passed via\n // the variable scope (record/input) rather than interpolated.\n if (typeof v === 'string') out += JSON.stringify(v);\n else if (typeof v === 'number' || typeof v === 'boolean') out += String(v);\n else if (v === null || v === undefined) out += 'null';\n else out += JSON.stringify(v);\n out += strings[i + 1] ?? '';\n }\n return out;\n}\n\n/** Tagged template — produces a CEL Expression envelope. */\nexport function cel(strings: TemplateStringsArray, ...values: unknown[]): Expression {\n return { dialect: 'cel', source: renderTemplate(strings, values) };\n}\n\n/** Formula alias of {@link cel} — semantic shorthand for computed-field formulas. */\nexport const F = cel;\n\n/** Predicate alias of {@link cel} — semantic shorthand for boolean conditions. */\nexport const P = cel;\n\n/**\n * Tagged template — produces a Mustache-template Expression envelope. Use for\n * notification subjects, prompt bodies, titleFormat strings, etc. Variable\n * scope is the same as CEL (`{{record.x}}`, `{{os.user.id}}`).\n */\nexport function tmpl(strings: TemplateStringsArray, ...values: unknown[]): Expression {\n // Templates do not get JSON.stringify on substitution — interpolation happens\n // at evaluate time via `{{path}}` markers, so we keep raw substitutions here.\n let out = strings[0] ?? '';\n for (let i = 0; i < values.length; i++) {\n out += String(values[i]);\n out += strings[i + 1] ?? '';\n }\n return { dialect: 'template', source: out };\n}\n\n/** Tagged template — produces a cron Expression envelope. */\nexport function cron(strings: TemplateStringsArray, ...values: unknown[]): Expression {\n let out = strings[0] ?? '';\n for (let i = 0; i < values.length; i++) {\n out += String(values[i]);\n out += strings[i + 1] ?? '';\n }\n return { dialect: 'cron', source: out };\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { SystemIdentifierSchema } from '../shared/identifiers.zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\n\n/**\n * Field Type Enum\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const FieldType = z.enum([\n // Core Text\n 'text', 'textarea', 'email', 'url', 'phone', 'password',\n // Secret — reversible, encrypted-at-rest value (DB password, API key, token).\n // UNLIKE 'password' (a one-way hash owned by the auth subsystem), a 'secret'\n // is round-tripped: the engine encrypts it on write via the registered\n // ICryptoProvider, stores the ciphertext handle in `sys_secret`, persists only\n // an opaque ref on the row, and masks it on read. Fail-closed: no provider ⇒\n // writes throw rather than persist cleartext. See ADR (secret field channel).\n 'secret',\n // Rich Content\n 'markdown', 'html', 'richtext',\n // Numbers\n 'number', 'currency', 'percent', \n // Date & Time\n 'date', 'datetime', 'time',\n // Logic\n 'boolean', 'toggle', // Toggle is a distinct UI from checkbox\n // Selection\n 'select', // Single select dropdown\n 'multiselect', // Multi select (often tags)\n 'radio', // Radio group\n 'checkboxes', // Checkbox group\n // Relational\n 'lookup', 'master_detail', // Dynamic reference\n 'tree', // Hierarchical reference\n // User reference — a lookup specialized to the `sys_user` system object (person\n // picker; single, or multiple for collaborators/watchers). Stored IDENTICALLY to\n // 'lookup' (FK string column → sys_user.id; `multiple` ⇒ JSON) and resolved via the\n // same $expand machinery. The distinct type exists for modelling discoverability\n // (Studio/AI field palette), the user-search picker, and `current_user` defaults —\n // NOT a separate storage primitive. Ownership stays the existing `owner_id`\n // convention (plugin-security); a declarative `owner` is a possible future flag.\n 'user',\n // Media\n 'image', 'file', 'avatar', 'video', 'audio',\n // Calculated / System\n 'formula', 'summary', 'autonumber',\n // Embedded structured values (stored as JSON on the parent row — no separate table / FK)\n 'composite', // Single embedded sub-object with declared sub-fields (≈ Strapi component / ACF group)\n 'repeater', // Repeating embedded sub-object array with declared sub-fields (≈ Strapi repeatable component / ACF repeater)\n 'record', // Name-keyed map of embedded sub-objects (Record<string, SubObject>). Insertion order = display order. Used for collections where each item has a stable machine name (e.g. object.fields). See ADR-0007.\n // Enhanced Types\n 'location', // GPS coordinates\n 'address', // Structured address\n 'code', // Code editor (JSON/SQL/JS)\n 'json', // Structured JSON data (untyped escape hatch)\n 'color', // Color picker\n 'rating', // Star rating\n 'slider', // Numeric slider\n 'signature', // Digital signature\n 'qrcode', // QR code / Barcode\n 'progress', // Progress bar\n 'tags', // Simple tag list\n // AI/ML Types\n 'vector', // Vector embeddings for AI/ML (semantic search, RAG)\n]);\n\nexport type FieldType = z.infer<typeof FieldType>;\n\n/**\n * Select Option Schema\n * \n * Defines option values for select/picklist fields.\n * \n * **CRITICAL RULE**: The `value` field is a machine identifier that gets stored in the database.\n * It MUST be lowercase to avoid case-sensitivity issues in queries and comparisons.\n * \n * @example Good\n * { label: 'New', value: 'new' }\n * { label: 'In Progress', value: 'in_progress' }\n * { label: 'Closed Won', value: 'closed_won' }\n * \n * @example Bad (will be rejected)\n * { label: 'New', value: 'New' } // uppercase\n * { label: 'In Progress', value: 'In Progress' } // spaces and uppercase\n * { label: 'Closed Won', value: 'Closed_Won' } // mixed case\n */\nexport const SelectOptionSchema = lazySchema(() => z.object({\n label: z.string().describe('Display label (human-readable, any case allowed)'),\n value: SystemIdentifierSchema.describe('Stored value (lowercase machine identifier)'),\n color: z.string().optional().describe('Color code for badges/charts'),\n default: z.boolean().optional().describe('Is default option'),\n /**\n * Per-option visibility predicate (CEL) — the option is offered only when this\n * evaluates TRUE. Omit = always available. Evaluated against the SAME binding\n * environment as field-level `visibleWhen` (live `record` + `current_user`), so\n * it expresses BOTH cascading/dependent options (`record.country == 'cn'`) AND\n * role/context gating (`'admin' in current_user.roles`). When it references\n * sibling fields, declare those on the field's `dependsOn` so the form can gate\n * and re-evaluate the option list as the parent changes.\n *\n * ⚠️ Client-side hiding is UX, not authorization. When an option is gated for\n * access-control reasons the server MUST also reject writes of its value (the\n * rule-validator evaluates the picked value's `visibleWhen`) — hiding it in the\n * dropdown alone is bypassable.\n */\n visibleWhen: ExpressionInputSchema.optional().describe(\"Per-option visibility predicate (CEL) — option is offered only when TRUE (else omitted). Same env as field visibleWhen (record + current_user). e.g. P`record.country == 'cn'` or P`'admin' in current_user.roles`\"),\n}));\n\n/**\n * Location Coordinates Schema\n * GPS coordinates for location field type\n */\nexport const LocationCoordinatesSchema = lazySchema(() => z.object({\n latitude: z.number().min(-90).max(90).describe('Latitude coordinate'),\n longitude: z.number().min(-180).max(180).describe('Longitude coordinate'),\n altitude: z.number().optional().describe('Altitude in meters'),\n accuracy: z.number().optional().describe('Accuracy in meters'),\n}));\n\n/**\n * Currency Configuration Schema\n * Configuration for currency field type supporting multi-currency\n * \n * Note: Currency codes are validated by length only (3 characters) to support:\n * - Standard ISO 4217 codes (USD, EUR, CNY, etc.)\n * - Cryptocurrency codes (BTC, ETH, etc.)\n * - Custom business-specific codes\n * Stricter validation can be implemented at the application layer based on business requirements.\n */\nexport const CurrencyConfigSchema = lazySchema(() => z.object({\n precision: z.number().int().min(0).max(10).default(2).describe('Decimal precision (default: 2)'),\n currencyMode: z.enum(['dynamic', 'fixed']).default('dynamic').describe('Currency mode: dynamic (user selectable) or fixed (single currency)'),\n defaultCurrency: z.string().length(3).default('CNY').describe('Default or fixed currency code (ISO 4217, e.g., USD, CNY, EUR)'),\n}));\n\n/**\n * Currency Value Schema\n * Runtime value structure for currency fields\n * \n * Note: Currency codes are validated by length only (3 characters) to support flexibility.\n * See CurrencyConfigSchema for details on currency code validation strategy.\n */\nexport const CurrencyValueSchema = lazySchema(() => z.object({\n value: z.number().describe('Monetary amount'),\n currency: z.string().length(3).describe('Currency code (ISO 4217)'),\n}));\n\n/**\n * Address Schema\n * Structured address for address field type\n */\nexport const AddressSchema = lazySchema(() => z.object({\n street: z.string().optional().describe('Street address'),\n city: z.string().optional().describe('City name'),\n state: z.string().optional().describe('State/Province'),\n postalCode: z.string().optional().describe('Postal/ZIP code'),\n country: z.string().optional().describe('Country name or code'),\n countryCode: z.string().optional().describe('ISO country code (e.g., US, GB)'),\n formatted: z.string().optional().describe('Formatted address string'),\n}));\n\n/**\n * Vector Configuration Schema\n * Configuration for vector field type supporting AI/ML embeddings\n * \n * Vector fields store numerical embeddings for semantic search, similarity matching,\n * and Retrieval-Augmented Generation (RAG) workflows.\n * \n * @example\n * // Text embeddings for semantic search\n * {\n * dimensions: 1536, // OpenAI text-embedding-ada-002\n * distanceMetric: 'cosine',\n * indexed: true\n * }\n * \n * @example\n * // Image embeddings with normalization\n * {\n * dimensions: 512, // ResNet-50\n * distanceMetric: 'euclidean',\n * normalized: true,\n * indexed: true\n * }\n */\nexport const VectorConfigSchema = lazySchema(() => z.object({\n dimensions: z.number().int().min(1).max(10000).describe('Vector dimensionality (e.g., 1536 for OpenAI embeddings)'),\n distanceMetric: z.enum(['cosine', 'euclidean', 'dotProduct', 'manhattan']).default('cosine').describe('Distance/similarity metric for vector search'),\n normalized: z.boolean().default(false).describe('Whether vectors are normalized (unit length)'),\n indexed: z.boolean().default(true).describe('Whether to create a vector index for fast similarity search'),\n indexType: z.enum(['hnsw', 'ivfflat', 'flat']).optional().describe('Vector index algorithm (HNSW for high accuracy, IVFFlat for large datasets)'),\n}));\n\n/**\n * File Attachment Configuration Schema\n * Configuration for file and attachment field types\n * \n * Provides comprehensive file upload capabilities with:\n * - File type restrictions (allowed/blocked)\n * - File size limits (min/max)\n * - Virus scanning integration\n * - Storage provider integration\n * - Image-specific features (dimensions, thumbnails)\n * \n * @example Basic file upload with size limit\n * {\n * maxSize: 10485760, // 10MB\n * allowedTypes: ['.pdf', '.docx', '.xlsx'],\n * virusScan: true\n * }\n * \n * @example Image upload with validation\n * {\n * maxSize: 5242880, // 5MB\n * allowedTypes: ['.jpg', '.jpeg', '.png', '.webp'],\n * imageValidation: {\n * maxWidth: 4096,\n * maxHeight: 4096,\n * generateThumbnails: true\n * }\n * }\n */\nexport const FileAttachmentConfigSchema = lazySchema(() => z.object({\n /** File Size Limits */\n minSize: z.number().min(0).optional().describe('Minimum file size in bytes'),\n maxSize: z.number().min(1).optional().describe('Maximum file size in bytes (e.g., 10485760 = 10MB)'),\n \n /** File Type Restrictions */\n allowedTypes: z.array(z.string()).optional().describe('Allowed file extensions (e.g., [\".pdf\", \".docx\", \".jpg\"])'),\n blockedTypes: z.array(z.string()).optional().describe('Blocked file extensions (e.g., [\".exe\", \".bat\", \".sh\"])'),\n allowedMimeTypes: z.array(z.string()).optional().describe('Allowed MIME types (e.g., [\"image/jpeg\", \"application/pdf\"])'),\n blockedMimeTypes: z.array(z.string()).optional().describe('Blocked MIME types'),\n \n /** Virus Scanning */\n virusScan: z.boolean().default(false).describe('Enable virus scanning for uploaded files'),\n virusScanProvider: z.enum(['clamav', 'virustotal', 'metadefender', 'custom']).optional().describe('Virus scanning service provider'),\n virusScanOnUpload: z.boolean().default(true).describe('Scan files immediately on upload'),\n quarantineOnThreat: z.boolean().default(true).describe('Quarantine files if threat detected'),\n \n /** Storage Configuration */\n storageProvider: z.string().optional().describe('Object storage provider name (references ObjectStorageConfig)'),\n storageBucket: z.string().optional().describe('Target bucket name'),\n storagePrefix: z.string().optional().describe('Storage path prefix (e.g., \"uploads/documents/\")'),\n \n /** Image-Specific Validation */\n imageValidation: z.object({\n minWidth: z.number().min(1).optional().describe('Minimum image width in pixels'),\n maxWidth: z.number().min(1).optional().describe('Maximum image width in pixels'),\n minHeight: z.number().min(1).optional().describe('Minimum image height in pixels'),\n maxHeight: z.number().min(1).optional().describe('Maximum image height in pixels'),\n aspectRatio: z.string().optional().describe('Required aspect ratio (e.g., \"16:9\", \"1:1\")'),\n generateThumbnails: z.boolean().default(false).describe('Auto-generate thumbnails'),\n thumbnailSizes: z.array(z.object({\n name: z.string().describe('Thumbnail variant name (e.g., \"small\", \"medium\", \"large\")'),\n width: z.number().min(1).describe('Thumbnail width in pixels'),\n height: z.number().min(1).describe('Thumbnail height in pixels'),\n crop: z.boolean().default(false).describe('Crop to exact dimensions'),\n })).optional().describe('Thumbnail size configurations'),\n preserveMetadata: z.boolean().default(false).describe('Preserve EXIF metadata'),\n autoRotate: z.boolean().default(true).describe('Auto-rotate based on EXIF orientation'),\n }).optional().describe('Image-specific validation rules'),\n \n /** Upload Behavior */\n allowMultiple: z.boolean().default(false).describe('Allow multiple file uploads (overrides field.multiple)'),\n allowReplace: z.boolean().default(true).describe('Allow replacing existing files'),\n allowDelete: z.boolean().default(true).describe('Allow deleting uploaded files'),\n requireUpload: z.boolean().default(false).describe('Require at least one file when field is required'),\n \n /** Metadata Extraction */\n extractMetadata: z.boolean().default(true).describe('Extract file metadata (name, size, type, etc.)'),\n extractText: z.boolean().default(false).describe('Extract text content from documents (OCR/parsing)'),\n \n /** Versioning */\n versioningEnabled: z.boolean().default(false).describe('Keep previous versions of replaced files'),\n maxVersions: z.number().min(1).optional().describe('Maximum number of versions to retain'),\n \n /** Access Control */\n publicRead: z.boolean().default(false).describe('Allow public read access to uploaded files'),\n presignedUrlExpiry: z.number().min(60).max(604800).default(3600).describe('Presigned URL expiration in seconds (default: 1 hour)'),\n}).refine((data) => {\n // Validate minSize is less than or equal to maxSize\n if (data.minSize !== undefined && data.maxSize !== undefined && data.minSize > data.maxSize) {\n return false;\n }\n return true;\n}, {\n message: 'minSize must be less than or equal to maxSize',\n}).refine((data) => {\n // Validate virusScanProvider requires virusScan to be enabled\n if (data.virusScanProvider !== undefined && data.virusScan !== true) {\n return false;\n }\n return true;\n}, {\n message: 'virusScanProvider requires virusScan to be enabled',\n}));\n\n/**\n * Data Quality Rules Schema\n * Defines data quality validation and monitoring for fields\n * \n * @example Unique SSN field with completeness requirement\n * {\n * uniqueness: true,\n * completeness: 0.95, // 95% of records must have this field\n * accuracy: {\n * source: 'government_db',\n * threshold: 0.98\n * }\n * }\n */\nexport const DataQualityRulesSchema = lazySchema(() => z.object({\n /** Enforce uniqueness constraint */\n uniqueness: z.boolean().default(false).describe('Enforce unique values across all records'),\n \n /** Completeness ratio (0-1) indicating minimum percentage of non-null values */\n completeness: z.number().min(0).max(1).default(0).describe('Minimum ratio of non-null values (0-1, default: 0 = no requirement)'),\n \n /** Accuracy validation against authoritative source */\n accuracy: z.object({\n source: z.string().describe('Reference data source for validation (e.g., \"api.verify.com\", \"master_data\")'),\n threshold: z.number().min(0).max(1).describe('Minimum accuracy threshold (0-1, e.g., 0.95 = 95% match required)'),\n }).optional().describe('Accuracy validation configuration'),\n}));\n\n/**\n * Computed Field Caching Schema\n * Configuration for caching computed/formula field results\n * \n * @example Cache product price with 1-hour TTL, invalidate on inventory changes\n * {\n * enabled: true,\n * ttl: 3600,\n * invalidateOn: ['inventory.quantity', 'pricing.discount']\n * }\n */\nexport const ComputedFieldCacheSchema = lazySchema(() => z.object({\n /** Enable caching for this computed field */\n enabled: z.boolean().describe('Enable caching for computed field results'),\n \n /** Time-to-live in seconds */\n ttl: z.number().min(0).describe('Cache TTL in seconds (0 = no expiration)'),\n \n /** Array of field paths that trigger cache invalidation when changed */\n invalidateOn: z.array(z.string()).describe('Field paths that invalidate cache (e.g., [\"inventory.quantity\", \"pricing.base_price\"])'),\n}));\n\n/**\n * Field Schema - Best Practice Enterprise Pattern\n */\n/**\n * Field Definition Schema\n * Defines the properties, type, and behavior of a single field (column) on an object.\n * \n * @example Lookup Field\n * {\n * name: \"account_id\",\n * label: \"Account\",\n * type: \"lookup\",\n * reference: \"accounts\",\n * required: true\n * }\n * \n * @example Select Field\n * {\n * name: \"status\",\n * label: \"Status\",\n * type: \"select\",\n * options: [\n * { label: \"Open\", value: \"open\" },\n * { label: \"Closed\", value: \"closed\" }\n * ],\n * defaultValue: \"open\"\n * }\n */\nexport const FieldSchema = lazySchema(() => z.object({\n /** Identity */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name (snake_case)').optional(),\n label: z.string().optional().describe('Human readable label'),\n type: FieldType.describe('Field Data Type'),\n description: z.string().optional().describe('Tooltip/Help text'),\n format: z.string().optional().describe('Format string (e.g. email, phone)'),\n\n /** Storage Layer Mapping */\n columnName: z.string().optional().describe('Physical column name in the target datasource. Defaults to the field key when not set.'),\n\n /** Database Constraints */\n required: z.boolean().default(false).describe('Is required'),\n searchable: z.boolean().default(false).describe('Is searchable'),\n multiple: z.boolean().default(false).describe('Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image.'),\n unique: z.boolean().default(false).describe('Is unique constraint'),\n defaultValue: z.unknown().optional().describe('Default value'),\n \n /** Text/String Constraints */\n maxLength: z.number().optional().describe('Max character length'),\n minLength: z.number().optional().describe('Min character length'),\n \n /** Number Constraints */\n precision: z.number().optional().describe('Total digits'),\n scale: z.number().optional().describe('Decimal places'),\n min: z.number().optional().describe('Minimum value'),\n max: z.number().optional().describe('Maximum value'),\n\n /** Selection Options */\n options: z.array(SelectOptionSchema).optional().describe('Static options for select/multiselect'),\n\n /**\n * Relationship Config\n * \n * Used by `lookup` and `master_detail` field types to define cross-object references.\n * The `reference` property is **required** for these types — it identifies the target\n * object whose records this field links to. The engine uses `reference` during $expand\n * post-processing to resolve foreign key IDs into full related objects via batch queries.\n * \n * For `master_detail` fields, the parent record controls the lifecycle of child records\n * (e.g., cascade delete). For `lookup` fields, the reference is a soft link.\n */\n reference: z.string().optional().describe(\n 'Target object name (snake_case) for lookup/master_detail fields. '\n + 'Required for relationship types. Used by $expand to resolve foreign key IDs into full objects.'\n ),\n referenceFilters: z.array(z.string()).optional().describe('Filters applied to lookup dialogs (e.g. \"active = true\")'),\n deleteBehavior: z.enum(['set_null', 'cascade', 'restrict']).optional().default('set_null').describe('What happens if referenced record is deleted'),\n /**\n * Master-detail INLINE EDITING. On a child's `master_detail`/`lookup` field\n * (whose `reference` is the parent object), declare that \"this child is\n * entered/edited inline within the parent's form\". The parent's standard\n * create/edit form then renders the children and saves parent + children in\n * ONE atomic transaction — no form view config and no bespoke page. The intent\n * lives here in the data model; forms derive the UI.\n *\n * The value also selects the EDITING FORM FACTOR:\n * - `true` → auto: the UI picks `grid` or `form` from the child's shape\n * (rich types / many fields → `form`, else `grid`).\n * - `'grid'` → an editable line-item grid (fast bulk entry; thin children\n * like invoice lines / order items).\n * - `'form'` → a compact read-only list; \"Add\" / per-row edit opens the\n * child's FULL form (fat children with rich types, e.g. long\n * text, attachments, many fields).\n * Use for true line-item/composition children; leave off for associations\n * (comments, attachments) — surface those as detail-page related lists.\n */\n inlineEdit: z.union([z.boolean(), z.enum(['grid', 'form'])]).optional().describe('Edit these child records inline within the parent\\'s form (atomic master-detail). true = auto-pick grid/form by child shape; \\'grid\\' = editable line-item grid; \\'form\\' = list + per-row full form.'),\n /** Optional section title for the inline grid (defaults to the child object label). */\n inlineTitle: z.string().optional().describe('Title for the inline master-detail grid'),\n /** Optional explicit grid columns for the inline editor (derived from the child object when omitted). */\n inlineColumns: z.array(z.any()).optional().describe('Explicit columns for the inline grid (derived from the child object when omitted)'),\n /** Optional numeric child field summed for the inline grid running total. */\n inlineAmountField: z.string().optional().describe('Numeric child field summed for the inline grid total'),\n\n /**\n * Detail-page RELATED LIST — the read-side mirror of `inlineEdit`. On a\n * child's `master_detail`/`lookup` field (whose `reference` is the parent),\n * this governs whether/how the child collection appears as a related list on\n * the parent's record DETAIL page. Owned children (`master_detail`) and\n * `lookup` children are shown by default (derived from the relationship);\n * set `relatedList: false` to suppress a child from the detail page (e.g.\n * noisy audit/association links you don't want surfaced). Where `inlineEdit`\n * pulls a child INTO the parent's entry form (write side), `relatedList`\n * controls its appearance on the parent's detail page (read side). The intent\n * lives here in the data model; the detail page derives the UI.\n *\n * Tri-state (ADR-0085 semantic-role style — this is a PROMINENCE hint, NOT a\n * layout switch):\n * - `false` → suppress this child from the parent's detail page.\n * - `true` / absent → shown; stacks with the other non-primary children\n * under a single shared \"Related\" tab. Only `'primary'`\n * earns its own tab — there is no count-based auto-split.\n * - `'primary'` → CORE relationship: always surfaced prominently. The\n * detail renderer promotes it to its own tab regardless\n * of child count. This states business intent (true\n * across every surface — detail tab, mobile card, AI\n * summary, search facet); \"primary → own tab\" is only\n * the DETAIL renderer's interpretation. Being prominence\n * (not a `relatedLayout` switch) is what admits it to the\n * object model under ADR-0085's admission test.\n */\n relatedList: z.union([z.boolean(), z.literal('primary')]).optional().describe('Show this child collection as a related list on the parent\\'s detail page (read-side mirror of inlineEdit). false = suppress; true/absent = shown (stacked under the shared \"Related\" tab); \\'primary\\' = core relationship, promoted to its own tab. Prominence intent, not a layout switch (ADR-0085).'),\n /** Optional section title for the detail-page related list (defaults to the child object label). */\n relatedListTitle: z.string().optional().describe('Title for the detail-page related list'),\n /** Optional explicit columns for the detail-page related list (derived from the child object when omitted). */\n relatedListColumns: z.array(z.any()).optional().describe('Explicit columns for the detail-page related list (derived from the child object when omitted)'),\n\n /**\n * LOOKUP PICKER (forward) config — how THIS lookup/master_detail field's\n * record picker presents and scopes candidate records when the user selects a\n * related record. Read-side mirror is relatedList* (the PARENT's detail-page\n * list of children); these configure the CHILD-side picker that chooses the\n * parent. All optional: the renderer auto-derives a sensible multi-column\n * result from the referenced object's schema when omitted (objectui\n * packages/fields: LookupField / RecordPickerDialog / deriveLookupColumns,\n * which read both these camelCase keys and their snake_case aliases).\n */\n displayField: z.string().optional().describe(\"Field shown as each candidate's label in the picker/popover (defaults to the referenced object's name/title).\"),\n descriptionField: z.string().optional().describe('Secondary field shown under the label in the quick-select popover.'),\n lookupColumns: z.array(z.union([z.string(), z.object({\n field: z.string(),\n label: z.string().optional(),\n width: z.string().optional(),\n type: z.string().optional(),\n })])).optional().describe('Explicit columns for the record-picker table; auto-derived from the referenced object when omitted.'),\n lookupPageSize: z.number().int().positive().optional().describe('Rows per page in the record-picker dialog (default 10).'),\n lookupFilters: z.array(z.object({\n field: z.string(),\n operator: z.enum(['eq', 'ne', 'gt', 'lt', 'gte', 'lte', 'contains', 'in', 'notIn']),\n value: z.any(),\n })).optional().describe('Base filters restricting which records are selectable (e.g. only active). Structured, picker-honoured form of referenceFilters.'),\n dependsOn: z.array(z.union([z.string(), z.object({\n field: z.string(),\n param: z.string().optional(),\n })])).optional().describe(\"Declares that this field's available values depend on the value of other field(s) on the same record — the form gates the field until they are set and re-evaluates as they change. For `lookup`/`master_detail` it scopes the candidate query (string = same local/remote key; {field,param} when the remote filter key differs — the {field,param} form is lookup-only). For `select`/`multiselect`/`radio` the actual per-option rule lives in each option's `visibleWhen`; list the referenced fields here (string form) so the option list gates and refreshes with the parent.\"),\n allowCreate: z.boolean().optional().describe('Allow inline quick-create from the record picker: when no match exists the user can create a record from the typed text (optimistic dataSource.create with the display field). Best for simple objects whose only required field is the display field.'),\n\n /** Calculation — CEL formula. Plain string accepted for back-compat; build emits canonical envelope. */\n expression: ExpressionInputSchema.optional().describe('Formula expression (CEL). e.g. F`record.amount * 0.1`'),\n /**\n * The value type a `formula` field computes, declared at authoring (the way\n * Salesforce/Airtable carry a formula's result type). Lets consumers — dataset\n * measures, display formatting, validation — read a declared type instead of\n * re-parsing the expression. Authoring stamps it from the inferred CEL type;\n * absent when the type can't be proven (an ambiguous/`dyn` expression).\n */\n returnType: z.enum(['number', 'text', 'boolean', 'date']).optional()\n .describe('Inferred value type of a formula field (number/text/boolean/date)'),\n summaryOperations: z.object({\n object: z.string().describe('Source child object name for roll-up'),\n field: z.string().describe('Field on child object to aggregate (ignored for count)'),\n function: z.enum(['count', 'sum', 'min', 'max', 'avg']).describe('Aggregation function to apply'),\n relationshipField: z.string().optional().describe('FK field on the child pointing back to this parent. Auto-detected from the child\\'s lookup/master_detail field referencing this object when omitted; set explicitly only when the child has more than one such reference.'),\n }).optional().describe('Roll-up summary definition. The engine recomputes the value when child records are inserted/updated/deleted.'),\n\n /** Enhanced Field Type Configurations */\n // Pruned 2026-06 — per-type *display* knobs that were dead in both layers (no\n // runtime reader; renderers ignore them). See\n // docs/audits/2026-06-dead-surface-disposition-plan.md (P2 field prune): code\n // theme/lineNumbers, rating allowHalf, location displayMap/allowGeocoding, address\n // addressFormat, color colorFormat/allowAlpha/presetColors, slider showValue/marks,\n // barcode/qr barcodeFormat/qrErrorCorrection/displayValue/allowScanning.\n language: z.string().optional().describe('Programming language for syntax highlighting (e.g., javascript, python, sql)'),\n step: z.number().optional().describe('Step increment for slider (default: 1)'),\n\n // Currency field config\n currencyConfig: CurrencyConfigSchema.optional().describe('Configuration for currency field type'),\n\n // Vector field — flat dimensionality (the live authoring path).\n // The renderer reads this flat sibling (objectui VectorField.tsx:11); the\n // nested `vectorConfig` below is retained for back-compat but is a runtime\n // no-op (no vector-index DDL consumes it).\n dimensions: z.number().int().min(1).max(10000).optional().describe('Vector dimensionality (e.g., 1536 for OpenAI embeddings)'),\n\n // Vector field config (DEAD — kept for back-compat; set the flat `dimensions` sibling instead)\n vectorConfig: VectorConfigSchema.optional().describe('Configuration for vector field type (AI/ML embeddings)'),\n\n // File attachment field config\n fileAttachmentConfig: FileAttachmentConfigSchema.optional().describe('Configuration for file and attachment field types'),\n\n /**\n * Track this field's value changes on the record **activity timeline**. When\n * TRUE, the platform's activity writer renders each change as a human-readable\n * entry (\"<label>: <old> → <new>\") instead of a generic \"Updated <object>\"\n * row — no app code required. Opt-in per field (cf. Salesforce Feed Tracking,\n * ServiceNow field auditing, Dataverse column auditing). The writer already\n * captures the field diff; this flag controls whether it is surfaced legibly.\n *\n * Unlike the pruned `auditTrail` below, this flag HAS a runtime consumer\n * (`@objectstack/plugin-audit` audit-writers), satisfying enforce-or-remove\n * (ADR-0049). See ADR-0052 §5b.\n */\n trackHistory: z.boolean().optional().describe(\"Render this field's value changes as human-readable entries on the record activity timeline (ADR-0052 §5b). Opt-in per field.\"),\n\n // Pruned 2026-06 (dead in both layers — aspirational governance with no runtime\n // consumer; encryption/masking implied at-rest protection that never happened —\n // the real channel is type:'secret'). See\n // docs/audits/2026-06-dead-surface-disposition-plan.md (P0/P2 field prune):\n // encryptionConfig, maskingRule, auditTrail, cached, dataQuality.\n\n /** Field Dependencies & Relationships */\n dependencies: z.array(z.string()).optional().describe('Array of field names that this field depends on (for formulas, visibility rules, etc.)'),\n\n /** Layout & Grouping */\n group: z.string().optional().describe('Field group name for organizing fields in forms and layouts (e.g., \"contact_info\", \"billing\", \"system\")'),\n\n /**\n * Conditional field rules (CEL predicates over `record`). Evaluated on BOTH\n * sides: the client form toggles the field's visibility / read-only / required\n * state live as the record changes (UX), and the server enforces\n * `requiredWhen` and ignores writes to a field whose `readonlyWhen` is TRUE\n * (so the rule can't be bypassed). e.g. `P\\`record.status == 'paid'\\``.\n */\n visibleWhen: ExpressionInputSchema.optional().describe(\"Predicate (CEL) — field is shown only when TRUE (else hidden). e.g. P`record.type == 'invoice'`\"),\n readonlyWhen: ExpressionInputSchema.optional().describe(\"Predicate (CEL) — field is read-only when TRUE. e.g. P`record.status == 'paid'`\"),\n requiredWhen: ExpressionInputSchema.optional().describe(\"Predicate (CEL) — field is required when TRUE. Canonical name for `conditionalRequired`.\"),\n\n /** Conditional Requirements\n * @deprecated Alias of `requiredWhen` — kept for back-compat. */\n conditionalRequired: ExpressionInputSchema.optional().describe('Predicate (CEL) — field is required when TRUE. Alias of `requiredWhen`.'),\n\n /** Security & Visibility */\n hidden: z.boolean().default(false).describe('Hidden from default UI'),\n readonly: z.boolean().default(false).describe('Read-only in UI'),\n\n /**\n * [ADR-0066 D3] Capabilities required to READ/EDIT this field. A field\n * declaring `requiredPermissions` is masked on read and denied on write unless\n * the caller holds ALL listed capabilities — an AND-gate that is strictest-wins\n * over permission-set field grants. Enforced by plugin-security's FieldMasker.\n */\n requiredPermissions: z.array(z.string()).optional().describe('[ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate).'),\n system: z.boolean().optional().describe('Auto-injected system/audit field (e.g. created_at, updated_by, organization_id). Tools that surface system fields separately from author-declared business fields should branch on this flag.'),\n sortable: z.boolean().optional().default(true).describe('Whether field is sortable in list views'),\n inlineHelpText: z.string().optional().describe('Help text displayed below the field in forms'),\n /**\n * Auto-number display format. Literal text interleaved with `{...}` tokens:\n *\n * - `{0000}` — the sequence counter, zero-padded to that many digits as a\n * MINIMUM width (at most one slot; omit it and the bare number is\n * appended). Past that width the number simply grows — it never wraps.\n * - `{YYYY} {YY} {MM} {DD} {YYYYMMDD}` — generation date in the request's\n * business timezone (`ExecutionContext.timezone`, ADR-0053; UTC fallback).\n * - `{field_name}` — the value of another field on the SAME record\n * (e.g. `{island_zone}`, `{plan_no}`), interpolated as text.\n *\n * The counter is scoped to whatever renders BEFORE the `{0000}` slot, so the\n * period/group resets fall out automatically — no separate reset config:\n * - `AD{YYYYMMDD}{0000}` → `AD202606170032` (resets each day)\n * - `{section}{island_zone}{000}` → `JYG1A001` (per island)\n * - `{plan_no}{000}` → `…PROD20260617001001` (per parent record)\n * A fixed-prefix format with no date/field token (e.g. `CASE-{0000}`) keeps a\n * single global counter — fully backward compatible.\n *\n * A `{field}` token must name an EXISTING field that is SET before the record\n * is created (mark it `required: true`). An empty interpolated field would\n * collapse the number into the wrong counter scope, so generation throws\n * instead; `objectstack compile` lints this (unknown field → build error,\n * optional field → warning).\n */\n autonumberFormat: z.string().optional().describe('Auto-number format: literal text + {0000} counter, {YYYY}/{MM}/{DD}/{YYYYMMDD} date tokens (business tz), and {field_name} interpolation. Counter resets per rendered prefix (e.g. AD{YYYYMMDD}{0000} resets daily).'),\n /** Indexing */\n index: z.boolean().default(false).describe('Create standard database index'),\n externalId: z.boolean().default(false).describe('Is external ID for upsert operations'),\n}));\n\nexport type Field = z.infer<typeof FieldSchema>;\nexport type SelectOption = z.infer<typeof SelectOptionSchema>;\nexport type LocationCoordinates = z.infer<typeof LocationCoordinatesSchema>;\nexport type Address = z.infer<typeof AddressSchema>;\nexport type CurrencyConfig = z.infer<typeof CurrencyConfigSchema>;\nexport type CurrencyConfigInput = z.input<typeof CurrencyConfigSchema>;\nexport type CurrencyValue = z.infer<typeof CurrencyValueSchema>;\nexport type VectorConfig = z.infer<typeof VectorConfigSchema>;\nexport type VectorConfigInput = z.input<typeof VectorConfigSchema>;\nexport type FileAttachmentConfig = z.infer<typeof FileAttachmentConfigSchema>;\nexport type FileAttachmentConfigInput = z.input<typeof FileAttachmentConfigSchema>;\nexport type DataQualityRules = z.infer<typeof DataQualityRulesSchema>;\nexport type DataQualityRulesInput = z.input<typeof DataQualityRulesSchema>;\nexport type ComputedFieldCache = z.infer<typeof ComputedFieldCacheSchema>;\n\n/**\n * Field Factory Helper\n */\nexport type FieldInput = Omit<Partial<Field>, 'type'>;\n\nexport const Field = {\n text: (config: FieldInput = {}) => ({ type: 'text', ...config } as const),\n textarea: (config: FieldInput = {}) => ({ type: 'textarea', ...config } as const),\n number: (config: FieldInput = {}) => ({ type: 'number', ...config } as const),\n boolean: (config: FieldInput = {}) => ({ type: 'boolean', ...config } as const),\n date: (config: FieldInput = {}) => ({ type: 'date', ...config } as const),\n datetime: (config: FieldInput = {}) => ({ type: 'datetime', ...config } as const),\n currency: (config: FieldInput = {}) => ({ type: 'currency', ...config } as const),\n percent: (config: FieldInput = {}) => ({ type: 'percent', ...config } as const),\n url: (config: FieldInput = {}) => ({ type: 'url', ...config } as const),\n email: (config: FieldInput = {}) => ({ type: 'email', ...config } as const),\n phone: (config: FieldInput = {}) => ({ type: 'phone', ...config } as const),\n image: (config: FieldInput = {}) => ({ type: 'image', ...config } as const),\n file: (config: FieldInput = {}) => ({ type: 'file', ...config } as const),\n avatar: (config: FieldInput = {}) => ({ type: 'avatar', ...config } as const),\n formula: (config: FieldInput = {}) => ({ type: 'formula', ...config } as const),\n summary: (config: FieldInput = {}) => ({ type: 'summary', ...config } as const),\n autonumber: (config: FieldInput = {}) => ({ type: 'autonumber', ...config } as const),\n markdown: (config: FieldInput = {}) => ({ type: 'markdown', ...config } as const),\n html: (config: FieldInput = {}) => ({ type: 'html', ...config } as const),\n password: (config: FieldInput = {}) => ({ type: 'password', ...config } as const),\n /**\n * Secret field — reversible encrypted-at-rest value (DB password, API key,\n * token). Encrypted on write to `sys_secret` via the registered\n * ICryptoProvider; only an opaque ref is persisted on the row; masked on\n * read. Distinct from `password` (one-way hash, owned by the auth subsystem).\n */\n secret: (config: FieldInput = {}) => ({ type: 'secret', ...config } as const),\n \n /**\n * Select field helper with backward-compatible API\n * \n * Automatically converts option values to lowercase to enforce naming conventions.\n * \n * @example Old API (array first) - auto-converts to lowercase\n * Field.select(['High', 'Low'], { label: 'Priority' })\n * // Results in: [{ label: 'High', value: 'high' }, { label: 'Low', value: 'low' }]\n * \n * @example New API (config object) - enforces lowercase\n * Field.select({ options: [{label: 'High', value: 'high'}], label: 'Priority' })\n * \n * @example Multi-word values - converts to snake_case\n * Field.select(['In Progress', 'Closed Won'], { label: 'Status' })\n * // Results in: [{ label: 'In Progress', value: 'in_progress' }, { label: 'Closed Won', value: 'closed_won' }]\n */\n select: (optionsOrConfig: SelectOption[] | string[] | FieldInput & { options: SelectOption[] | string[] }, config?: FieldInput) => {\n // Helper function to convert string to lowercase snake_case\n const toSnakeCase = (str: string): string => {\n return str\n .toLowerCase()\n .replace(/\\s+/g, '_') // Replace spaces with underscores\n .replace(/[^a-z0-9_]/g, ''); // Remove invalid characters (keeping underscores only)\n };\n\n // Support both old and new signatures:\n // Old: Field.select(['a', 'b'], { label: 'X' })\n // New: Field.select({ options: [{label: 'A', value: 'a'}], label: 'X' })\n let options: SelectOption[];\n let finalConfig: FieldInput;\n \n if (Array.isArray(optionsOrConfig)) {\n // Old signature: array as first param\n options = optionsOrConfig.map(o => \n typeof o === 'string' \n ? { label: o, value: toSnakeCase(o) } // Auto-convert string to snake_case\n : { ...o, value: o.value.toLowerCase() } // Ensure value is lowercase\n );\n finalConfig = config || {};\n } else {\n // New signature: config object with options\n options = (optionsOrConfig.options || []).map(o => \n typeof o === 'string' \n ? { label: o, value: toSnakeCase(o) } // Auto-convert string to snake_case\n : { ...o, value: o.value.toLowerCase() } // Ensure value is lowercase\n );\n // Remove options from config to avoid confusion\n const { options: _, ...restConfig } = optionsOrConfig;\n finalConfig = restConfig;\n }\n \n return { type: 'select', options, ...finalConfig } as const;\n },\n\n \n lookup: (reference: string, config: FieldInput = {}) => ({ \n type: 'lookup', \n reference, \n ...config \n } as const),\n \n masterDetail: (reference: string, config: FieldInput = {}) => ({\n type: 'master_detail',\n reference,\n ...config\n } as const),\n\n /**\n * User field — a person picker. Semantic specialization of `lookup` with the\n * target fixed to the `sys_user` system object: stored identically (FK string\n * column → sys_user.id; `multiple: true` ⇒ JSON array) and resolved via the same\n * $expand machinery. The distinct `user` type drives the Studio/AI field palette,\n * the user-search picker, and `current_user` defaults — without re-implementing\n * lookup storage.\n *\n * @example Single assignee\n * Field.user({ label: 'Assignee' })\n * @example Collaborators / watchers (multi)\n * Field.user({ label: 'Watchers', multiple: true })\n * @example Auto-fill the acting user on create\n * Field.user({ label: 'Reporter', defaultValue: 'current_user' })\n */\n user: (config: FieldInput = {}) => ({\n type: 'user',\n reference: 'sys_user',\n ...config,\n } as const),\n\n // Enhanced Field Type Helpers\n location: (config: FieldInput = {}) => ({ \n type: 'location', \n ...config \n } as const),\n \n address: (config: FieldInput = {}) => ({ \n type: 'address', \n ...config \n } as const),\n \n richtext: (config: FieldInput = {}) => ({ \n type: 'richtext', \n ...config \n } as const),\n \n code: (language?: string, config: FieldInput = {}) => ({ \n type: 'code', \n language,\n ...config \n } as const),\n \n color: (config: FieldInput = {}) => ({ \n type: 'color', \n ...config \n } as const),\n \n rating: (max: number = 5, config: FieldInput = {}) => ({\n type: 'rating',\n max,\n ...config\n } as const),\n \n signature: (config: FieldInput = {}) => ({ \n type: 'signature', \n ...config \n } as const),\n \n slider: (config: FieldInput = {}) => ({ \n type: 'slider', \n ...config \n } as const),\n \n qrcode: (config: FieldInput = {}) => ({ \n type: 'qrcode', \n ...config \n } as const),\n \n json: (config: FieldInput = {}) => ({ \n type: 'json', \n ...config \n } as const),\n \n vector: (dimensions: number, config: FieldInput = {}) => ({\n type: 'vector',\n dimensions,\n ...config\n } as const),\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\n\n/**\n * # ObjectStack Validation Protocol\n * \n * This module defines the validation schema protocol for ObjectStack, providing a comprehensive\n * type-safe validation system similar to Salesforce's validation rules but with enhanced capabilities.\n * \n * ## Overview\n *\n * Validation rules are applied at the data layer to ensure data integrity and enforce business logic.\n * A validation rule is a **deterministic, synchronous, side-effect-free predicate over a single\n * record** — it must be decidable from the incoming write (and, on update, the prior record) with\n * no I/O. Everything advertised here runs on the write path (see\n * `objectql/src/validation/rule-validator.ts`); nothing is a silent no-op.\n *\n * The system supports these validation types:\n *\n * 1. **Script Validation**: Formula-based validation using a CEL predicate\n * 2. **State Machine Validation**: Control allowed state transitions\n * 3. **Format Validation**: Validate a field's value (email, URL, phone, JSON, regex)\n * 4. **Cross-Field Validation**: Validate relationships between multiple fields\n * 5. **JSON Schema Validation**: Validate a JSON field against a JSON Schema\n * 6. **Conditional Validation**: Apply a nested rule based on a CEL condition\n *\n * ## Deliberately NOT validation rules\n *\n * These were once declared here but never enforced. Because the contract above rules them out\n * (they need I/O or are client-side concerns), they were removed rather than left as silent\n * no-ops. Use the layer that already does each one correctly:\n *\n * - **Uniqueness** → a unique **index** (`ObjectSchema.indexes`, `{ fields, unique: true }`,\n * with `partial` for a scoped/conditional constraint), or field-level `unique: true`. A\n * SELECT-then-INSERT \"rule\" is inherently racy (TOCTOU); a DB unique constraint is not.\n * - **Async / remote validation** → a client-form concern (`debounce`/`validatorUrl` only mean\n * anything against keystrokes) and an SSRF/latency hazard on the server write path. Keep it in\n * the form layer, or enforce the underlying invariant with a `unique` index / lifecycle hook.\n * - **Custom handler** → a `beforeInsert` / `beforeUpdate` lifecycle hook, the typed, supported\n * extension point for arbitrary validation code.\n * \n * ## Salesforce Comparison\n * \n * ObjectStack validation rules are inspired by Salesforce validation rules but enhanced:\n * - Salesforce: Formula-based validation with `Error Condition Formula`\n * - ObjectStack: Multiple validation types with composable rules\n * \n * Example Salesforce validation rule:\n * ```\n * Rule Name: Discount_Cannot_Exceed_40_Percent\n * Error Condition Formula: Discount_Percent__c > 0.40\n * Error Message: Discount cannot exceed 40%.\n * ```\n * \n * Equivalent ObjectStack rule:\n * ```typescript\n * {\n * type: 'script',\n * name: 'discount_cannot_exceed_40_percent',\n * condition: 'discount_percent > 0.40',\n * message: 'Discount cannot exceed 40%',\n * severity: 'error'\n * }\n * ```\n */\n\n/**\n * Base Validation Rule\n * \n * All validation rules extend from this base schema with common properties.\n * \n * ## Industry Standard Enhancements\n * - **Label/Description**: Essential for governance in large systems with thousands of rules.\n * - **Events**: granular control over validation timing (Context-aware validation).\n * - **Tags**: categorization for reporting and management.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nconst BaseValidationSchema = z.object({\n // Identification\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Unique rule name (snake_case)'),\n label: z.string().optional().describe('Human-readable label for the rule listing'),\n description: z.string().optional().describe('Administrative notes explaining the business reason'),\n \n // Execution Control\n active: z.boolean().default(true),\n events: z.array(z.enum(['insert', 'update', 'delete'])).default(['insert', 'update']).describe('Validation contexts'),\n priority: z.number().int().min(0).max(9999).default(100).describe('Execution priority (lower runs first, default: 100)'),\n \n // Classification\n tags: z.array(z.string()).optional().describe('Categorization tags (e.g., \"compliance\", \"billing\")'),\n \n // Feedback\n severity: z.enum(['error', 'warning', 'info']).default('error'),\n message: z.string().describe('Error message to display to the user'),\n});\n\n/**\n * 1. Script/Expression Validation\n * Generic formula-based validation.\n */\nexport const ScriptValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('script'),\n condition: ExpressionInputSchema.describe('Predicate (CEL). If TRUE, validation fails. e.g. P`record.amount < 0`'),\n}));\n\n/**\n * 2. State Machine Validation\n * State transition logic.\n */\nexport const StateMachineValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('state_machine'),\n field: z.string().describe('State field (e.g. status)'),\n transitions: z.record(z.string(), z.array(z.string())).describe('Map of { OldState: [AllowedNewStates] }'),\n}));\n\n/**\n * 3. Value Format Validation\n * Regex or specialized formats.\n */\nexport const FormatValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('format'),\n field: z.string(),\n regex: z.string().optional(),\n format: z.enum(['email', 'url', 'phone', 'json']).optional(),\n}));\n\n/**\n * 4. Cross-Field Validation\n * Validates relationships between multiple fields.\n * \n * ## Use Cases\n * - Date range validations (end_date > start_date)\n * - Amount comparisons (discount < total)\n * - Complex business rules involving multiple fields\n * \n * ## Salesforce Examples\n * \n * ### Example 1: Close Date Must Be In Current or Future Month\n * **Salesforce Formula:**\n * ```\n * MONTH(CloseDate) < MONTH(TODAY()) ||\n * YEAR(CloseDate) < YEAR(TODAY())\n * ```\n * \n * **ObjectStack Equivalent:**\n * ```typescript\n * {\n * type: 'cross_field',\n * name: 'close_date_future',\n * condition: 'MONTH(close_date) >= MONTH(TODAY()) AND YEAR(close_date) >= YEAR(TODAY())',\n * fields: ['close_date'],\n * message: 'Close Date must be in the current or a future month'\n * }\n * ```\n * \n * ### Example 2: Discount Validation\n * **Salesforce Formula:**\n * ```\n * Discount__c > (Amount__c * 0.40)\n * ```\n * \n * **ObjectStack Equivalent:**\n * ```typescript\n * {\n * type: 'cross_field',\n * name: 'discount_limit',\n * condition: 'discount > (amount * 0.40)',\n * fields: ['discount', 'amount'],\n * message: 'Discount cannot exceed 40% of the amount'\n * }\n * ```\n * \n * ### Example 3: Opportunity Must Have Products\n * **Salesforce Formula:**\n * ```\n * ISBLANK(Products__c) && ISPICKVAL(StageName, \"Closed Won\")\n * ```\n * \n * **ObjectStack Equivalent:**\n * ```typescript\n * {\n * type: 'cross_field',\n * name: 'products_required_for_won',\n * condition: 'products = null AND stage = \"closed_won\"',\n * fields: ['products', 'stage'],\n * message: 'Opportunity must have products to be marked as Closed Won'\n * }\n * ```\n */\nexport const CrossFieldValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('cross_field'),\n condition: ExpressionInputSchema.describe('Predicate (CEL) comparing fields. e.g. P`record.end_date > record.start_date`'),\n fields: z.array(z.string()).describe('Fields involved in the validation'),\n}));\n\n/**\n * 5. JSON Structure Validation\n * Validates JSON fields against a JSON Schema.\n * \n * ## Use Cases\n * - Validating configuration objects stored in JSON fields\n * - Enforcing API payload structures\n * - Complex nested data validation\n */\nexport const JSONValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('json_schema'),\n field: z.string().describe('JSON field to validate'),\n schema: z.record(z.string(), z.unknown()).describe('JSON Schema object definition'),\n}));\n\n\n\n/**\n * 6. Master Validation Rule Schema\n */\n/** Base type for validation rules - used for z.lazy() recursive type annotation */\nexport interface BaseValidationRuleShape {\n type: string;\n name: string;\n message: string;\n label?: string;\n description?: string;\n active?: boolean;\n events?: ('insert' | 'update' | 'delete')[];\n priority?: number;\n tags?: string[];\n severity?: 'error' | 'warning' | 'info';\n [key: string]: unknown;\n}\n\nexport const ValidationRuleSchema: z.ZodType<BaseValidationRuleShape> = z.lazy(() =>\n z.discriminatedUnion('type', [\n ScriptValidationSchema,\n StateMachineValidationSchema,\n FormatValidationSchema,\n CrossFieldValidationSchema,\n JSONValidationSchema,\n ConditionalValidationSchema,\n ])\n);\n\n/**\n * 7. Conditional Validation\n * Validation that only applies when a condition is met.\n * \n * ## Overview\n * Conditional validations follow the pattern: \"Validate X only if Y is true\"\n * This allows for context-aware validation rules that adapt to different scenarios.\n * \n * ## Use Cases\n * \n * ### 1. Validate Based on Record Type\n * Apply different validation rules based on the type of record.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'enterprise_approval_required',\n * when: 'account_type = \"enterprise\"',\n * message: 'Enterprise validation',\n * then: {\n * type: 'script',\n * name: 'require_approval',\n * message: 'Enterprise accounts require manager approval',\n * condition: 'approval_status = null'\n * }\n * }\n * ```\n * \n * ### 2. Conditional Field Requirements\n * Require certain fields only when specific conditions are met.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'shipping_address_when_required',\n * when: 'requires_shipping = true',\n * message: 'Shipping validation',\n * then: {\n * type: 'script',\n * name: 'shipping_address_required',\n * message: 'Shipping address is required for physical products',\n * condition: 'shipping_address = null OR shipping_address = \"\"'\n * }\n * }\n * ```\n * \n * ### 3. Amount-Based Validation\n * Apply different rules based on transaction amount.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'high_value_approval',\n * when: 'order_total > 10000',\n * message: 'High value order validation',\n * then: {\n * type: 'script',\n * name: 'manager_approval_required',\n * message: 'Orders over $10,000 require manager approval',\n * condition: 'manager_approval_id = null'\n * },\n * otherwise: {\n * type: 'script',\n * name: 'standard_validation',\n * message: 'Payment method is required',\n * condition: 'payment_method = null'\n * }\n * }\n * ```\n * \n * ### 4. Regional Compliance\n * Apply region-specific validation rules.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'regional_compliance',\n * when: 'region = \"EU\"',\n * message: 'EU compliance validation',\n * then: {\n * type: 'script',\n * name: 'gdpr_consent',\n * message: 'GDPR consent is required for EU customers',\n * condition: 'gdpr_consent_given = false'\n * },\n * otherwise: {\n * type: 'script',\n * name: 'tos_acceptance',\n * message: 'Terms of Service acceptance required',\n * condition: 'tos_accepted = false'\n * }\n * }\n * ```\n * \n * ### 5. Nested Conditional Validation\n * Create complex validation logic with nested conditions.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'country_state_validation',\n * when: 'country = \"US\"',\n * message: 'US-specific validation',\n * then: {\n * type: 'conditional',\n * name: 'california_validation',\n * when: 'state = \"CA\"',\n * message: 'California-specific validation',\n * then: {\n * type: 'script',\n * name: 'ca_tax_id_required',\n * message: 'California requires a valid tax ID',\n * condition: 'tax_id = null OR NOT(REGEX(tax_id, \"^\\\\d{2}-\\\\d{7}$\"))'\n * }\n * }\n * }\n * ```\n * \n * ### 6. Tax Validation for Taxable Items\n * Only validate tax fields when the item is taxable.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'tax_field_validation',\n * when: 'is_taxable = true',\n * message: 'Tax validation',\n * then: {\n * type: 'script',\n * name: 'tax_code_required',\n * message: 'Tax code is required for taxable items',\n * condition: 'tax_code = null OR tax_code = \"\"'\n * }\n * }\n * ```\n * \n * ### 7. Role-Based Validation\n * Apply validation based on user role.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'role_based_approval_limit',\n * when: 'user_role = \"manager\"',\n * message: 'Manager approval limits',\n * then: {\n * type: 'script',\n * name: 'manager_limit',\n * message: 'Managers can approve up to $50,000',\n * condition: 'approval_amount > 50000'\n * }\n * }\n * ```\n * \n * ## Salesforce Pattern Comparison\n * \n * Salesforce doesn't have explicit \"conditional validation\" rules but achieves similar\n * behavior using formula logic. ObjectStack makes this pattern explicit and composable.\n * \n * **Salesforce Approach:**\n * ```\n * IF(\n * ISPICKVAL(Type, \"Enterprise\"),\n * AND(Amount > 100000, ISBLANK(Approval__c)),\n * FALSE\n * )\n * ```\n * \n * **ObjectStack Approach:**\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'enterprise_high_value',\n * when: 'type = \"enterprise\"',\n * then: {\n * type: 'cross_field',\n * name: 'amount_approval',\n * condition: 'amount > 100000 AND approval = null',\n * fields: ['amount', 'approval']\n * }\n * }\n * ```\n */\nexport const ConditionalValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('conditional'),\n when: ExpressionInputSchema.describe('Predicate (CEL). e.g. P`record.type == \\'enterprise\\'`'),\n then: ValidationRuleSchema.describe('Validation rule to apply when condition is true'),\n otherwise: ValidationRuleSchema.optional().describe('Validation rule to apply when condition is false'),\n}));\n\nexport type ValidationRule = z.infer<typeof ValidationRuleSchema>;\nexport type ScriptValidation = z.infer<typeof ScriptValidationSchema>;\nexport type StateMachineValidation = z.infer<typeof StateMachineValidationSchema>;\nexport type FormatValidation = z.infer<typeof FormatValidationSchema>;\nexport type CrossFieldValidation = z.infer<typeof CrossFieldValidationSchema>;\nexport type JSONValidation = z.infer<typeof JSONValidationSchema>;\nexport type ConditionalValidation = z.infer<typeof ConditionalValidationSchema>;","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * I18n Object Schema\n * Structured internationalization label with translation key and parameters.\n * \n * @example\n * ```typescript\n * const label: I18nObject = {\n * key: 'views.task_list.label',\n * defaultValue: 'Task List',\n * params: { count: 5 },\n * };\n * ```\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const I18nObjectSchema = lazySchema(() => z.object({\n /** Translation key (e.g., \"views.task_list.label\", \"apps.crm.description\") */\n key: z.string().describe('Translation key (e.g., \"views.task_list.label\")'),\n\n /** Default value when translation is not available */\n defaultValue: z.string().optional().describe('Fallback value when translation key is not found'),\n\n /** Interpolation parameters for dynamic translations */\n params: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional().describe('Interpolation parameters (e.g., { count: 5 })'),\n}));\n\nexport type I18nObject = z.infer<typeof I18nObjectSchema>;\n\n/**\n * I18n Label Schema\n * \n * A plain string label for display purposes.\n * i18n translation keys are auto-generated by the framework at registration time\n * based on a standardized naming convention (e.g., `apps.<packageId>.<name>.label`).\n * Developers only need to provide the default-language string; translations are\n * managed through translation files, not inline i18n objects.\n * \n * @example\n * ```typescript\n * const label: I18nLabel = \"All Active\";\n * ```\n */\nexport const I18nLabelSchema = lazySchema(() => z.string().describe('Display label (plain string; i18n keys are auto-generated by the framework)'));\n\nexport type I18nLabel = z.infer<typeof I18nLabelSchema>;\n\n/**\n * ARIA Accessibility Properties Schema\n * \n * Common ARIA attributes for UI components to support screen readers\n * and assistive technologies.\n * \n * Aligned with WAI-ARIA 1.2 specification.\n * \n * @see https://www.w3.org/TR/wai-aria-1.2/\n * \n * @example\n * ```typescript\n * const aria: AriaProps = {\n * ariaLabel: 'Close dialog',\n * ariaDescribedBy: 'dialog-description',\n * role: 'dialog',\n * };\n * ```\n */\nexport const AriaPropsSchema = lazySchema(() => z.object({\n /** Accessible label for screen readers */\n ariaLabel: I18nLabelSchema.optional().describe('Accessible label for screen readers (WAI-ARIA aria-label)'),\n\n /** ID of element that describes this component */\n ariaDescribedBy: z.string().optional().describe('ID of element providing additional description (WAI-ARIA aria-describedby)'),\n\n /** WAI-ARIA role override */\n role: z.string().optional().describe('WAI-ARIA role attribute (e.g., \"dialog\", \"navigation\", \"alert\")'),\n}).describe('ARIA accessibility attributes'));\n\nexport type AriaProps = z.infer<typeof AriaPropsSchema>;\n\n/**\n * Plural Rule Schema\n *\n * Defines plural forms for a translation key, following ICU MessageFormat / i18next conventions.\n * Supports zero, one, two, few, many, other forms per CLDR plural rules.\n *\n * @see https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules\n *\n * @example\n * ```typescript\n * const plural: PluralRule = {\n * key: 'items.count',\n * zero: 'No items',\n * one: '{count} item',\n * other: '{count} items',\n * };\n * ```\n */\nexport const PluralRuleSchema = lazySchema(() => z.object({\n /** Translation key for the plural form */\n key: z.string().describe('Translation key'),\n /** Form for zero quantity */\n zero: z.string().optional().describe('Zero form (e.g., \"No items\")'),\n /** Form for singular (1) */\n one: z.string().optional().describe('Singular form (e.g., \"{count} item\")'),\n /** Form for dual (2) — used in Arabic, Welsh, etc. */\n two: z.string().optional().describe('Dual form (e.g., \"{count} items\" for exactly 2)'),\n /** Form for few (2-4 in Slavic languages) */\n few: z.string().optional().describe('Few form (e.g., for 2-4 in some languages)'),\n /** Form for many (5+ in Slavic languages) */\n many: z.string().optional().describe('Many form (e.g., for 5+ in some languages)'),\n /** Default/fallback form */\n other: z.string().describe('Default plural form (e.g., \"{count} items\")'),\n}).describe('ICU plural rules for a translation key'));\n\nexport type PluralRule = z.infer<typeof PluralRuleSchema>;\n\n/**\n * Number Format Schema\n *\n * Defines number formatting rules for localization.\n *\n * @example\n * ```typescript\n * const format: NumberFormat = {\n * style: 'currency',\n * currency: 'USD',\n * minimumFractionDigits: 2,\n * };\n * ```\n */\nexport const NumberFormatSchema = lazySchema(() => z.object({\n style: z.enum(['decimal', 'currency', 'percent', 'unit']).default('decimal')\n .describe('Number formatting style'),\n currency: z.string().optional().describe('ISO 4217 currency code (e.g., \"USD\", \"EUR\")'),\n unit: z.string().optional().describe('Unit for unit formatting (e.g., \"kilometer\", \"liter\")'),\n minimumFractionDigits: z.number().optional().describe('Minimum number of fraction digits'),\n maximumFractionDigits: z.number().optional().describe('Maximum number of fraction digits'),\n useGrouping: z.boolean().optional().describe('Whether to use grouping separators (e.g., 1,000)'),\n}).describe('Number formatting rules'));\n\nexport type NumberFormat = z.infer<typeof NumberFormatSchema>;\n\n/**\n * Date Format Schema\n *\n * Defines date/time formatting rules for localization.\n *\n * @example\n * ```typescript\n * const format: DateFormat = {\n * dateStyle: 'medium',\n * timeStyle: 'short',\n * timeZone: 'America/New_York',\n * };\n * ```\n */\nexport const DateFormatSchema = lazySchema(() => z.object({\n dateStyle: z.enum(['full', 'long', 'medium', 'short']).optional()\n .describe('Date display style'),\n timeStyle: z.enum(['full', 'long', 'medium', 'short']).optional()\n .describe('Time display style'),\n timeZone: z.string().optional().describe('IANA time zone (e.g., \"America/New_York\")'),\n hour12: z.boolean().optional().describe('Use 12-hour format'),\n}).describe('Date/time formatting rules'));\n\nexport type DateFormat = z.infer<typeof DateFormatSchema>;\n\n/**\n * Locale Configuration Schema\n *\n * Defines a complete locale configuration including language code,\n * fallback chain, and formatting preferences.\n *\n * @example\n * ```typescript\n * const locale: LocaleConfig = {\n * code: 'zh-CN',\n * fallbackChain: ['zh-TW', 'en'],\n * direction: 'ltr',\n * numberFormat: { style: 'decimal', useGrouping: true },\n * dateFormat: { dateStyle: 'medium', timeStyle: 'short' },\n * };\n * ```\n */\nexport const LocaleConfigSchema = lazySchema(() => z.object({\n /** BCP 47 language code (e.g., \"en-US\", \"zh-CN\", \"ar-SA\") */\n code: z.string().describe('BCP 47 language code (e.g., \"en-US\", \"zh-CN\")'),\n\n /** Ordered fallback chain for missing translations */\n fallbackChain: z.array(z.string()).optional()\n .describe('Fallback language codes in priority order (e.g., [\"zh-TW\", \"en\"])'),\n\n /** Text direction */\n direction: z.enum(['ltr', 'rtl']).default('ltr')\n .describe('Text direction: left-to-right or right-to-left'),\n\n /** Default number formatting */\n numberFormat: NumberFormatSchema.optional().describe('Default number formatting rules'),\n\n /** Default date formatting */\n dateFormat: DateFormatSchema.optional().describe('Default date/time formatting rules'),\n}).describe('Locale configuration'));\n\nexport type LocaleConfig = z.infer<typeof LocaleConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Capability tokens a script body may request.\n *\n * The runtime sandbox enforces these — if a body uses a `ctx` API that requires\n * a capability it did not declare, the call throws at invocation time.\n *\n * - `api.read` — `ctx.api.object(...).find / findOne / count / aggregate`\n * - `api.write` — `ctx.api.object(...).insert / update / delete`\n * - `api.transaction` — `ctx.api.transaction(async () => { … })` — runs the\n * callback's `ctx.api` writes/reads inside one driver transaction, committed\n * on return and rolled back if the callback throws. Requires `api.write`\n * alongside it to be useful (the transaction body still needs write access).\n * - `crypto.uuid` — `ctx.crypto.randomUUID()`\n * - `crypto.hash` — `ctx.crypto.hash(algo, data)`\n * - `log` — `ctx.log.info / warn / error`\n *\n * `http.fetch` is intentionally absent — outbound calls go through Connector\n * recipes (separate spec) so they remain auditable and replayable.\n */\nexport const HookBodyCapability = z.enum([\n 'api.read',\n 'api.write',\n 'api.transaction',\n 'crypto.uuid',\n 'crypto.hash',\n 'log',\n]);\nexport type HookBodyCapability = z.infer<typeof HookBodyCapability>;\n\n/**\n * L1 — Pure expression body.\n *\n * Evaluated by the formula engine. No IO, no mutation. Used for predicates\n * (`condition`-style) and simple computed values.\n *\n * @example\n * ```json\n * { \"language\": \"expression\", \"source\": \"input.amount > 1000 && input.status == 'open'\" }\n * ```\n */\nexport const ExpressionBodySchema = z.object({\n language: z.literal('expression'),\n /** Formula-engine expression. Pure, side-effect-free. */\n source: z.string().min(1).describe('Formula expression source'),\n}).describe('L1 expression body — pure formula, no IO');\nexport type ExpressionBody = z.infer<typeof ExpressionBodySchema>;\n\n/**\n * L2 — Sandboxed JavaScript source.\n *\n * The `source` is the **function body only** (not a full module). The runtime\n * wraps it in `new AsyncFunction('ctx', source)` for hooks, or\n * `new AsyncFunction('input', 'ctx', source)` for actions, then executes\n * inside an isolated VM.\n *\n * Forbidden inside `source` (CLI build will reject):\n * - `import` / `require` / dynamic `import()`\n * - `process`, `globalThis`, `eval`, `new Function`\n * - any identifier resolved from a value-only top-level import\n *\n * @example\n * ```json\n * {\n * \"language\": \"js\",\n * \"source\": \"if (ctx.input.email) ctx.input.email = ctx.input.email.toLowerCase();\",\n * \"capabilities\": [],\n * \"timeoutMs\": 250\n * }\n * ```\n */\nexport const ScriptBodySchema = z.object({\n language: z.literal('js'),\n /** Function body source (NOT a full module — no top-level imports). */\n source: z.string().min(1).describe('Function body source'),\n /**\n * Capability tokens the body is allowed to use. Default: `[]`.\n * The sandbox throws if the body calls a `ctx` API not covered by these.\n */\n capabilities: z.array(HookBodyCapability).default([]).describe('Granted capability tokens'),\n /**\n * Per-invocation hard timeout in milliseconds.\n * Sandbox kills the script if it exceeds this; smaller of this and the\n * enclosing hook/action `timeout` wins.\n */\n timeoutMs: z.number().int().positive().max(30_000).optional().describe('Per-invocation timeout (ms)'),\n /**\n * Per-invocation memory cap in MB.\n * Subject to engine support (isolated-vm enforces, quickjs approximates).\n */\n memoryMb: z.number().int().positive().max(256).optional().describe('Per-invocation memory cap (MB)'),\n}).describe('L2 sandboxed JS body — runs inside an isolated VM with declared capabilities');\nexport type ScriptBody = z.infer<typeof ScriptBodySchema>;\n\n/**\n * Hook / Action body — discriminated by `language`.\n *\n * Two and only two forms are accepted:\n * - `expression` — L1, pure formula evaluated by the formula engine.\n * - `js` — L2, sandboxed JavaScript source string.\n *\n * The compiled-module path (`.mjs` envelope) is intentionally **not** part of\n * this union. All bodies are pure metadata and travel inside the project\n * artifact JSON — no separate runtime module is required.\n *\n * @see content/docs/concepts/north-star.mdx — \"Metadata-only runtime\"\n */\nexport const HookBodySchema = z.discriminatedUnion('language', [\n ExpressionBodySchema,\n ScriptBodySchema,\n]).describe('Hook/Action body — expression (L1) or sandboxed JS (L2)');\nexport type HookBody = z.infer<typeof HookBodySchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FieldType } from '../data/field.zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\nimport { I18nLabelSchema, AriaPropsSchema } from './i18n.zod';\nimport { HookBodySchema } from '../data/hook-body.zod';\n\n/**\n * Action Parameter Schema\n *\n * Defines inputs required before executing an action.\n *\n * Two declaration modes:\n *\n * 1. **Field-backed** (preferred) — reference an existing object field; the\n * runtime resolves the field's label (i18n), type, validation rules,\n * options, placeholder, help text, and widget mapping from object\n * metadata. Cross-object references use `objectOverride`.\n *\n * ```ts\n * params: [\n * { field: 'email' }, // same object\n * { field: 'role', objectOverride: 'sys_member' }, // different object\n * ]\n * ```\n *\n * 2. **Inline** (legacy / bespoke) — declare `name`, `label`, `type` etc.\n * inline when no matching object field exists. Inline values may also be\n * used alongside `field` to override individual properties.\n *\n * `name` is required unless `field` is provided (in which case it defaults\n * to the field name and is used as the request-body key).\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const ActionParamSchema = lazySchema(() => z.object({\n /** Request-body key. Defaults to `field` when `field` is set. */\n name: z.string().optional(),\n /** Reference an existing object field for label/type/validation/options. */\n field: SnakeCaseIdentifierSchema.optional(),\n /** Object that owns the referenced field (defaults to the action's parent object). */\n objectOverride: SnakeCaseIdentifierSchema.optional(),\n /** Overrides the resolved field label (or sets it for inline params). */\n label: I18nLabelSchema.optional(),\n /** Overrides the resolved field type (or sets it for inline params). */\n type: FieldType.optional(),\n /**\n * Required override; when omitted defaults to `false`. Consumers that wish\n * to inherit the underlying field's `required` flag should leave this\n * undefined in the source schema and resolve at runtime (the dialog\n * renderers check truthiness, so `false === undefined` for UI purposes).\n */\n required: z.boolean().optional().default(false),\n /** Select/picklist options override. */\n options: z.array(z.object({ label: I18nLabelSchema, value: z.string() })).optional(),\n /** Placeholder override. */\n placeholder: z.string().optional(),\n /** Help/description override. */\n helpText: z.string().optional(),\n /** Default value for the dialog input. */\n defaultValue: z.unknown().optional(),\n /**\n * When true, the param's default value is pulled from the current row record\n * (key = the resolved field name) when the action runs from a list_item\n * context. Useful for edit dialogs that pre-fill from the selected row.\n */\n defaultFromRow: z.boolean().optional(),\n}).refine(\n (p) => Boolean(p.name) || Boolean(p.field),\n { message: 'ActionParam requires either \"name\" or \"field\"' },\n));\n\n/**\n * Action type enum values.\n */\nexport const ActionType = z.enum(['script', 'url', 'modal', 'flow', 'api', 'form']);\n\n/**\n * Action types that require a `target` field.\n * Derived from ActionType, excluding 'script' which allows inline handlers.\n * These types reference an external resource (URL, flow, modal, or API endpoint)\n * and cannot function without a target binding.\n */\nconst TARGET_REQUIRED_TYPES: ReadonlySet<string> = new Set(\n ActionType.options.filter((t) => t !== 'script'),\n);\n\n/**\n * Action Schema\n * \n * **NAMING CONVENTION:**\n * Action names are machine identifiers used in code and must be lowercase snake_case.\n * \n * **TARGET BINDING:**\n * The `target` field is the canonical way to bind an action to its handler.\n * - `type: 'script'` — `target` is recommended (references a script/function name).\n * - `type: 'url'` — `target` is **required** (the URL to navigate to).\n * - `type: 'flow'` — `target` is **required** (the flow name to invoke).\n * - `type: 'modal'` — `target` is **required** (the modal/page name to open).\n * - `type: 'api'` — `target` is **required** (the API endpoint to call).\n * - `type: 'form'` — `target` is **required** (the FormView name to open, routed to `/console/forms/:name`).\n * \n * The `execute` field is **deprecated** and will be removed in a future version.\n * If `execute` is provided without `target`, it is automatically migrated to `target`.\n * \n * @example Good action names\n * - 'on_close_deal'\n * - 'send_welcome_email'\n * - 'approve_contract'\n * - 'export_report'\n * \n * @example Bad action names (will be rejected)\n * - 'OnCloseDeal' (PascalCase)\n * - 'sendEmail' (camelCase)\n * - 'Send Email' (spaces)\n * \n * Note: The action name is the configuration ID. JavaScript function names can use camelCase,\n * but the metadata ID must be lowercase snake_case.\n */\n/**\n * Action Location — where an action is allowed to surface in the UI.\n *\n * Canonical list (single source of truth for the whole platform). Renderers,\n * the ActionEngine, the Studio designer dropdowns, and `objectui` consumers\n * MUST import from this constant rather than re-declaring their own enum —\n * adding a new location should require touching this one file only.\n *\n * Semantics:\n * - `list_toolbar` — header/toolbar of a list view (bulk actions, \"New\", export).\n * - `list_item` — per-row action on a list/grid row (Salesforce row-level menu).\n * - `record_header` — primary actions in the record-detail title bar.\n * - `record_more` — overflow menu under the \"More\" / ⋯ button on a record.\n * - `record_related` — actions on a related list section inside a record.\n * - `record_section` — actions surfaced inside a body section/tab of a record\n * (e.g. a Security tab grouping change-password, 2FA, etc.).\n * - `global_nav` — global navigation/command-palette level actions.\n */\nexport const ACTION_LOCATIONS = [\n 'list_toolbar',\n 'list_item',\n 'record_header',\n 'record_more',\n 'record_related',\n 'record_section',\n 'global_nav',\n] as const;\n\nexport const ActionLocationSchema = z.enum(ACTION_LOCATIONS);\nexport type ActionLocation = z.infer<typeof ActionLocationSchema>;\n\n/**\n * Tool category values for {@link ActionAiSchema.category}.\n *\n * Mirrors `ToolCategorySchema` in `../ai/tool.zod`. Kept **inline** rather\n * than imported to avoid a `ui → ai` import cycle (`ai/*.form.ts` already\n * imports `defineForm` from `ui/view.zod`). If you change the canonical\n * tool categories, update both sides.\n */\nconst ActionAiCategorySchema = z.enum([\n 'data',\n 'action',\n 'flow',\n 'integration',\n 'vector_search',\n 'analytics',\n 'utility',\n]);\n\n/**\n * AI exposure block (ADR-0011 \"Actions as AI Tools\").\n *\n * **Opt-in, default off.** An action becomes an AI-callable tool only when\n * `exposed: true`. This is a deliberate governance gate: in an AI-authoring\n * world the platform's value is that a human can govern exactly which\n * capabilities the agent fleet is allowed to invoke — a half-finished or\n * unreviewed action must never be silently armed.\n *\n * When exposed, `description` is **required** — it is the LLM-facing contract\n * (when/why to call), authored explicitly rather than derived from the\n * UI `label`. The bridge in `@objectstack/service-ai` translates this block\n * into an `AIToolDefinition`.\n */\nexport const ActionAiSchema = z.object({\n /**\n * Expose this action to AI agents as a callable tool. Default `false`.\n * Setting `true` REQUIRES `description`.\n */\n exposed: z.boolean().default(false).describe('Expose this action to AI agents. Requires `description` when true.'),\n\n /**\n * LLM-facing description: tells the model when and why to call this action.\n * Distinct from the UI `label`. Plain English, ≥ 40 chars for useful tool\n * selection. Required whenever `exposed` is true.\n */\n description: z.string().min(40).optional().describe('LLM-facing description (≥40 chars). Required when exposed.'),\n\n /**\n * Override the derived tool category. Defaults to `action` (side-effect).\n * Use `data` for read-only actions, `analytics` for aggregations, etc.\n */\n category: ActionAiCategorySchema.optional().describe('Tool category override (defaults to \"action\").'),\n\n /**\n * Per-parameter AI hints, keyed by param name (or the injected `recordId`).\n * Tightens the JSON Schema the LLM sees (e.g. add `enum`, override\n * `description`, supply `examples`) WITHOUT changing the UI-facing field\n * metadata. Keys must match a declared `params[].name` (or `recordId`).\n */\n paramHints: z.record(z.string(), z.object({\n description: z.string().optional(),\n enum: z.array(z.union([z.string(), z.number()])).optional(),\n examples: z.array(z.unknown()).optional(),\n })).optional().describe('Per-parameter AI hints keyed by param name.'),\n\n /**\n * Output JSON Schema for the action's return value. Enables structured\n * downstream tool chaining (one action's output feeds another's input) and\n * is summarised into the tool description so the model knows what it gets\n * back. Optional — when omitted the return value is treated as freeform.\n */\n outputSchema: z.record(z.string(), z.unknown()).optional().describe('JSON Schema for the action return value.'),\n\n /**\n * Override confirmation for AI calls. When unset, the bridge defaults to\n * `true` for actions that look destructive (`confirmText` set, `mode:'delete'`,\n * or `variant:'danger'`). Set explicitly to `false` to assert a destructive-\n * looking action is safe to run without human approval, or `true` to force a\n * human-in-the-loop gate on an otherwise-safe action.\n */\n requiresConfirmation: z.boolean().optional().describe('Override HITL confirmation for AI invocations.'),\n});\n\nexport type ActionAi = z.infer<typeof ActionAiSchema>;\n\nexport const ActionSchema = lazySchema(() => z.object({\n /** Machine name of the action */\n name: SnakeCaseIdentifierSchema.describe('Machine name (lowercase snake_case)'),\n \n /** Display label */\n label: I18nLabelSchema.describe('Display label'),\n\n /** Target object this action belongs to (optional, snake_case) */\n objectName: z.string().regex(/^[a-z_][a-z0-9_]*$/).optional().describe('Target object this action belongs to. When set, the action is auto-merged into the object\\'s actions array by defineStack().'),\n \n /** Icon name (Lucide) */\n icon: z.string().optional().describe('Icon name'),\n\n /** Where does this action appear? */\n locations: z.array(ActionLocationSchema).optional().describe('Locations where this action is visible'),\n\n /** \n * Visual Component Type\n * Defaults to 'button' or 'menu_item' based on location,\n * but can be overridden.\n */\n component: z.enum([\n 'action:button', // Standard Button\n 'action:icon', // Icon only\n 'action:menu', // Dropdown menu\n 'action:group' // Button Group\n ]).optional().describe('Visual component override'),\n \n /** What type of interaction? */\n type: ActionType.default('script').describe('Action functionality type'),\n \n /** \n * Payload / Target — the canonical binding for the action handler.\n * Required for url, flow, modal, and api types.\n * For `script` type: prefer `body` over `target`. `target` is kept only for\n * legacy bundle.functions[name] references.\n *\n * **Interpolation** (renderer responsibility, all action types):\n * `target` MAY contain `${param.X}` and `${ctx.X}` tokens. Renderers\n * resolve them just before invocation:\n * - `${param.X}` — value collected from the action's params dialog.\n * - `${ctx.X}` — values from the action context: `ctx.origin`\n * (window.origin), `ctx.recordId`, `ctx.user.id`, `ctx.org.id`, etc.\n * Used by redirect-style actions like `link_social`, where the target is\n * e.g. `/api/v1/auth/sign-in/social?provider=${param.provider}&callbackURL=${ctx.origin}/_console/apps/account/sys_account`.\n * Renderers MUST `encodeURIComponent` interpolated values before\n * substituting them into URL query positions.\n */\n target: z.string().optional().describe('URL, Script Name, Flow ID, or API Endpoint. Supports ${param.X} and ${ctx.X} interpolation.'),\n\n /**\n * For `type:'url'` — where to open `target`. A simple, declarative new-tab\n * control for STATIC urls (no handler, no synchronous pre-open). objectui's\n * ActionRunner.executeUrl reads `openIn` with priority over the legacy\n * `params.newTab`/external-URL heuristic.\n *\n * - `'new-tab'` — opens `target` in a new browser tab.\n * - `'self'` — navigates in place.\n * - omitted — external/absolute URLs open in a new tab; relative URLs\n * navigate in place.\n *\n * Distinct from `opensInNewTab`/`newTabUrl`, which pre-open an about:blank\n * tab synchronously for ASYNC SSO-redirect handlers — do NOT use `openIn`\n * for those. This is a STATIC execution option: keep it OUT of `params`\n * (which is user-input-collection only).\n */\n openIn: z.enum(['self', 'new-tab']).optional().describe(\"For type:'url' — where to open `target`. 'new-tab' opens a new browser tab; 'self' navigates in place. When omitted, external/absolute URLs open in a new tab and relative URLs navigate in place. Static execution option — keep it OUT of `params` (which is user-input-collection only).\"),\n\n /**\n * Action Body (L1 expression or L2 sandboxed JS).\n *\n * Only meaningful when `type === 'script'`. When set, the runtime invokes\n * the body inside the sandbox as `(input, ctx) => Promise<output>` and\n * ignores `target`.\n *\n * - `{ language: 'expression', source: '...' }` — pure formula (L1).\n * - `{ language: 'js', source: '...', capabilities: [...] }` — sandboxed JS (L2).\n *\n * Compiled-module bodies are not supported. Outbound IO (HTTP, etc.) goes\n * through Connector recipes (separate spec).\n */\n body: HookBodySchema.optional().describe('Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`.'),\n\n /** \n * @deprecated Use `target` instead. This field is auto-migrated to `target` during parsing.\n */\n execute: z.string().optional().describe('@deprecated — Use target instead. Auto-migrated to target during parsing.'),\n \n /** User Input Requirements */\n params: z.array(ActionParamSchema).optional().describe('Input parameters required from user'),\n \n /** Visual Style */\n variant: z.enum(['primary', 'secondary', 'danger', 'ghost', 'link']).optional().describe('Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent)'),\n\n /** UX Behavior */\n confirmText: I18nLabelSchema.optional().describe('Confirmation message before execution'),\n successMessage: I18nLabelSchema.optional().describe('Success message to show after execution'),\n // Runtime (ActionRunner) already honours this — declared here so authors can\n // set a friendly failure toast instead of surfacing the raw error string.\n errorMessage: I18nLabelSchema.optional().describe('Error message to show when the action fails (overrides the raw error).'),\n refreshAfter: z.boolean().default(false).describe('Refresh view after execution'),\n // Single-record update actions only. When true, the runtime captures the\n // record's prior field values and offers an \"Undo\" affordance on the success\n // toast (backed by the client UndoManager) to restore them.\n undoable: z.boolean().optional().describe('Offer an Undo affordance after this single-record update action succeeds.'),\n\n /**\n * Result Dialog — describe how to render the API response on success.\n *\n * When set and the action returns successfully, the renderer SHOULD open a\n * dialog showing the selected fields from `result.data` instead of the\n * `successMessage` toast. The dialog has an acknowledge button only — the\n * user must explicitly close it. Used for **one-shot reveals** of values\n * the user must copy now because they cannot be retrieved later:\n *\n * - TOTP enrollment URI + secret (`enable_two_factor`)\n * - Backup recovery codes (`regenerate_backup_codes`)\n * - Freshly minted OAuth `client_secret` (`rotate_client_secret`,\n * `create_oauth_application`)\n *\n * `fields` selects what to render and how. Each entry's `path` is a dot\n * path into `result.data` (e.g. `'totpURI'`, `'backupCodes'`,\n * `'client.client_secret'`). When `fields` is omitted, the renderer falls\n * back to JSON-printing the whole response under a single block.\n *\n * `format` (dialog-level) is a default for fields that don't carry their\n * own `format`; the per-field `format` always wins.\n *\n * Renderer contract (objectui):\n * - `qrcode` — render the value as a QR code; also render the raw string\n * underneath with a copy button (so the user can paste into apps that\n * don't scan).\n * - `code-list` — value must be an array of strings; render each in a\n * monospace row with per-row copy and a \"Copy all\" affordance.\n * - `secret` — render a single string masked by default with a reveal\n * toggle and copy button.\n * - `text` — plain text with copy.\n * - `json` — pretty-printed JSON in a monospace block.\n *\n * The dialog SHOULD set `refreshAfter` to true on close (separate from\n * the existing `refreshAfter` flag, which fires immediately on success).\n */\n resultDialog: z.object({\n title: I18nLabelSchema.optional(),\n description: I18nLabelSchema.optional(),\n acknowledge: I18nLabelSchema.optional().describe('Acknowledge button label, e.g. \"I have saved this\"'),\n format: z.enum(['qrcode', 'code-list', 'secret', 'text', 'json']).optional().describe('Default format for fields without their own format. Defaults to json when omitted.'),\n fields: z.array(z.object({\n path: z.string().describe('Dot path into result.data (e.g. \"totpURI\", \"client.client_secret\").'),\n label: I18nLabelSchema.optional(),\n format: z.enum(['qrcode', 'code-list', 'secret', 'text', 'json']).optional().describe('Per-field format override.'),\n })).optional().describe('Which fields from result.data to render. Omit to dump full JSON.'),\n }).optional().describe('Render API response in a one-shot reveal dialog (suppresses successMessage when set).'),\n \n /** Access */\n visible: ExpressionInputSchema.optional().describe('Visibility predicate (CEL).'),\n disabled: z.union([z.boolean(), ExpressionInputSchema]).optional().describe('Boolean or predicate (CEL) — action is disabled when TRUE.'),\n\n /**\n * [ADR-0066 D4] System capabilities required to INVOKE this action — a\n * dual-surface gate from ONE declaration: the server (action route) rejects\n * the call with 403 when the caller's systemPermissions don't cover these (the\n * source of truth), and the objectui ActionRunner hides/disables the button\n * using the same requirement. Independent of `visible` (CEL): this is the RBAC\n * capability contract, mirroring `App.requiredPermissions`.\n */\n requiredPermissions: z.array(z.string()).optional().describe('[ADR-0066 D4] Capabilities required to invoke this action (server-enforced 403 + UI hide/disable).'),\n\n /** Keyboard Shortcut */\n shortcut: z.string().optional().describe('Keyboard shortcut to trigger this action (e.g., \"Ctrl+S\")'),\n\n /** Bulk Operations */\n bulkEnabled: z.boolean().optional().describe('Whether this action can be applied to multiple selected records'),\n\n /**\n * AI exposure block (ADR-0011). Opt-in, default off: an action is exposed\n * to AI agents only when `ai.exposed === true`, in which case `ai.description`\n * is required. See {@link ActionAiSchema}.\n */\n ai: ActionAiSchema.optional().describe('AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents.'),\n\n /**\n * Row-context: when the action runs from a list_item location, this body key\n * receives the row's id (or the field named by `recordIdField`). Defaults to\n * `id` when omitted but `recordIdField` is set; otherwise no injection.\n */\n recordIdParam: z.string().optional().describe('Body key to inject the row id into when running from a list_item context.'),\n /**\n * Row field whose value seeds `recordIdParam`. Defaults to `'id'` when\n * `recordIdParam` is set. Use this when the body key expects a non-id value\n * (e.g. `token` for `revoke-session`).\n */\n recordIdField: z.string().optional().describe('Row field whose value seeds recordIdParam. Defaults to \"id\".'),\n /**\n * Request-body shape. `'flat'` (default) sends collected params at the top\n * level. `{ wrap: 'data' }` nests the user-collected params under that key\n * (used by better-auth `organization/update`), while `recordIdParam` and\n * other top-level keys stay flat.\n */\n bodyShape: z.union([\n z.literal('flat'),\n z.object({ wrap: z.string() }),\n ]).optional().describe('Body wrapping: flat (default) or { wrap: key } to nest user-collected params under a key.'),\n /**\n * HTTP method to use when `type: 'api'`. Defaults to `POST`. Use `PATCH` to\n * call data-API update endpoints (e.g. `/api/v1/sys_api_key/{id}` with\n * `bodyExtra: { revoked: true }`).\n */\n method: z.enum(['POST', 'PATCH', 'PUT', 'DELETE']).optional().describe('HTTP method for type:\"api\" actions. Defaults to POST.'),\n /**\n * Static body fragment merged into the outgoing request body for `type:'api'`\n * actions. Useful for constants the user shouldn't (or can't) edit, e.g.\n * `bodyExtra: { resend: true }` on a resend-invitation action that reuses\n * better-auth's `invite-member` endpoint. Applied after user-collected\n * params and `recordIdParam` so constants always win.\n */\n bodyExtra: z.record(z.string(), z.unknown()).optional().describe('Constant body fields merged into the API request (applied last; overrides user params).'),\n /**\n * Semantic mode hint — UI / runtime can use this to pick confirm copy,\n * default variants, success messaging. Pure metadata; no runtime branching.\n */\n mode: z.enum(['create', 'edit', 'delete', 'custom']).optional().describe('Semantic mode of the action.'),\n\n /**\n * Open the action's result in a NEW TAB. The renderer pre-opens the tab\n * synchronously on click (preserving the user gesture so popup blockers\n * don't fire), paints a progress page, then drives the tab to the\n * handler's returned `redirectUrl` — or, when `newTabUrl` is set, straight\n * to that URL with no server round trip.\n */\n opensInNewTab: z.boolean().optional().describe('Open the action result in a new tab. The renderer pre-opens the tab synchronously on click (popup-blocker-safe) and navigates it to the handler\\'s redirectUrl.'),\n\n /**\n * Zero-roundtrip new-tab target. A path template the renderer navigates\n * the pre-opened tab to IMMEDIATELY on click, skipping the action POST\n * entirely. Only valid together with `opensInNewTab`. The target endpoint\n * MUST perform all auth/authz itself (e.g. the cloud `/sso-open` endpoint,\n * which re-runs every check the POST half would have done). Supports the\n * `{recordId}` placeholder, URL-encoded on substitution.\n */\n newTabUrl: z.string().optional().describe('Direct new-tab URL template ({recordId} placeholder). When set with opensInNewTab, the renderer navigates the pre-opened tab here immediately — no action POST. The endpoint must enforce auth itself.'),\n\n /** Execution */\n timeout: z.number().optional().describe('Maximum execution time in milliseconds for the action'),\n\n /** ARIA accessibility attributes */\n aria: AriaPropsSchema.optional().describe('ARIA accessibility attributes'),\n}).transform((data) => {\n // Auto-migrate deprecated `execute` → `target` for backward compatibility\n if (data.execute && !data.target) {\n return { ...data, target: data.execute };\n }\n return data;\n}).refine((data) => {\n // Require `target` for types that reference an external resource\n if (TARGET_REQUIRED_TYPES.has(data.type) && !data.target) {\n return false;\n }\n return true;\n}, {\n message: \"Action 'target' is required when type is 'url', 'flow', 'modal', 'api', or 'form'.\",\n path: ['target'],\n}).refine((data) => {\n // A `script` action must be *executable*: it needs either an inline `body`\n // (the runtime invokes it in the sandbox) or a `target` naming a registered\n // bundle function. With neither, AppPlugin registers no engine handler and\n // the action fails at runtime with `Action '<name>' on object '*' not found`\n // (the #2169 Mark Done bug) — a soft failure invisible to build & shape\n // tests. Reject it at author/compile time instead.\n if (data.type === 'script' && !data.body && !data.target) {\n return false;\n }\n return true;\n}, {\n message:\n \"A 'script' action requires either an inline `body` (sandboxed L1/L2 handler) or a `target` (a registered bundle function name).\",\n path: ['body'],\n}).refine((data) => {\n // ADR-0011: an exposed action must carry an LLM-facing description.\n if (data.ai?.exposed === true && !data.ai.description) {\n return false;\n }\n return true;\n}, {\n message: 'ai.description is required (≥40 chars) when ai.exposed is true.',\n path: ['ai', 'description'],\n}).refine((data) => {\n // ADR-0011: paramHints keys must reference a declared param (or the\n // auto-injected `recordId`), so a typo can't silently no-op.\n const hints = data.ai?.paramHints;\n if (!hints) return true;\n const known = new Set<string>(['recordId']);\n for (const p of data.params ?? []) {\n const key = p.name ?? p.field;\n if (key) known.add(key);\n }\n return Object.keys(hints).every((k) => known.has(k));\n}, {\n message: 'ai.paramHints keys must match a declared param name (or \"recordId\").',\n path: ['ai', 'paramHints'],\n}));\n\nexport type Action = z.infer<typeof ActionSchema>;\nexport type ActionParam = z.infer<typeof ActionParamSchema>;\nexport type ActionInput = z.input<typeof ActionSchema>;\n\n/**\n * Action Factory Helper\n */\nexport const Action = {\n create: (config: z.input<typeof ActionSchema>): Action => ActionSchema.parse(config),\n} as const;\n\n/**\n * Type-safe factory for a global or object action. Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: Action` literal.\n */\nexport function defineAction(config: z.input<typeof ActionSchema>): Action {\n return ActionSchema.parse(config);\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * # Metadata Protection Model — Phase 1 (ADR-0010)\n *\n * Phase 1 introduces the **item-level lock** (`_lock`) and the\n * provenance / package tags that drive it. Later phases extend this\n * file with the path-level (`_frozenPaths`) and package-level\n * (`metadataDefaults`) layers; the wire shapes here are forward-\n * compatible with those additions.\n *\n * Wire / runtime contract:\n * - `_lock` — 4-state enum, controls overlay / delete actions.\n * - `_lockReason` — short, user-visible explanation surfaced in\n * `403 item_locked` errors and on Studio tooltips.\n * - `_lockSource` — which layer set the lock (Phase 1 only emits\n * `'artifact'`; `'package'` and `'env-forced'`\n * are reserved for Phase 3/2 respectively).\n * - `_provenance` — `'package'` for loader-introduced items,\n * `'org'` for tenant-authored, `'env-forced'`\n * reserved for emergency overrides.\n * - `_packageId` / `_packageVersion` — denormalised from the\n * registry tag so consumers don't need a second\n * round-trip to inspect provenance.\n *\n * See `docs/adr/0010-metadata-protection-model.md` for the full\n * design (industry references, 4-layer model, audit trail).\n */\n\n// ─────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────\n\n/**\n * 4-state lock enum.\n *\n * | Value | Save (PUT / publish / rollback) | Delete |\n * |---------------|---------------------------------|--------|\n * | `none` | allow | allow |\n * | `no-overlay` | **deny** (403 item_locked) | allow |\n * | `no-delete` | allow | **deny** |\n * | `full` | **deny** | **deny** |\n *\n * `allowRuntimeCreate` for **brand-new** items is governed by the\n * type-level L1 registry flag and is never affected by `_lock`\n * (which describes an existing item). See ADR-0010 §3.3.\n */\nexport const MetadataLockSchema = z.enum(['none', 'no-overlay', 'no-delete', 'full']);\nexport type MetadataLock = z.infer<typeof MetadataLockSchema>;\n\n/** Where the `_lock` declaration came from. Reserved enum for forward compatibility. */\nexport const MetadataLockSourceSchema = z.enum(['artifact', 'package', 'env-forced']);\nexport type MetadataLockSource = z.infer<typeof MetadataLockSourceSchema>;\n\n/** Where the metadata item originated. */\nexport const MetadataProvenanceSchema = z.enum(['package', 'org', 'env-forced']);\nexport type MetadataProvenance = z.infer<typeof MetadataProvenanceSchema>;\n\n// ─────────────────────────────────────────────────────────────────────\n// Mixin — raw shape that schemas spread into themselves\n// ─────────────────────────────────────────────────────────────────────\n\n/**\n * Raw shape spliced into each metadata Zod schema that wants to expose\n * the optional protection envelope to its TS authors. Implemented as a\n * Zod raw shape (not a wrapping schema) so it composes with the\n * existing `z.object({ ... })` patterns without needing to introduce\n * a refinement layer.\n *\n * Usage:\n * ```ts\n * const AppSchema = z.object({\n * name: z.string(),\n * // …\n * ...MetadataProtectionFields,\n * });\n * ```\n */\nexport const MetadataProtectionFields = {\n /**\n * Per-item lock declaration. Defaults to `'none'` when omitted.\n * Enforced by the runtime protocol on save / publish / rollback /\n * delete. See ADR-0010 §3.3.\n */\n _lock: MetadataLockSchema.optional().describe(\n 'Item-level lock — controls overlay & delete (ADR-0010).',\n ),\n\n /**\n * Short, user-visible explanation surfaced in `403 item_locked`\n * error envelopes and Studio tooltips. Keep < 200 chars.\n */\n _lockReason: z.string().max(500).optional().describe(\n 'Human-readable reason shown when a write is refused by _lock.',\n ),\n\n /**\n * Which layer asserted the lock — Phase 1 only emits `'artifact'`.\n * Reserved for Phase 2/3 (`'package'`, `'env-forced'`).\n */\n _lockSource: MetadataLockSourceSchema.optional().describe(\n 'Layer that set _lock (artifact | package | env-forced).',\n ),\n\n /**\n * `'package'` — introduced by a loader from npm-package source.\n * `'org'` — authored by a tenant via the metadata API.\n * `'env-forced'` — emergency overrides via the unlock list.\n */\n _provenance: MetadataProvenanceSchema.optional().describe(\n 'Origin of the item (package | org | env-forced).',\n ),\n\n /** Owning package machine id (e.g. `com.objectstack.setup`). */\n _packageId: z.string().optional().describe('Owning package machine id.'),\n\n /** Owning package semver. */\n _packageVersion: z.string().optional().describe('Owning package version.'),\n\n /**\n * Optional URL the Studio lock banner links to for more context.\n * Populated by the loader from the author-facing\n * `protection.docsUrl` field — see `shared/protection.zod.ts`.\n */\n _lockDocsUrl: z.string().optional().describe(\n 'Optional documentation link surfaced next to _lockReason.',\n ),\n} as const;\n\n// ─────────────────────────────────────────────────────────────────────\n// Helpers\n// ─────────────────────────────────────────────────────────────────────\n\n/**\n * Read the protection envelope off any candidate item. Safe to call\n * on `undefined`, primitives, or items that have no protection fields\n * at all — returns a fully-defaulted record.\n */\nexport function extractProtection(item: unknown): {\n lock: MetadataLock;\n lockReason: string | undefined;\n lockSource: MetadataLockSource | undefined;\n lockDocsUrl: string | undefined;\n provenance: MetadataProvenance | undefined;\n packageId: string | undefined;\n packageVersion: string | undefined;\n} {\n const empty = {\n lock: 'none' as MetadataLock,\n lockReason: undefined,\n lockSource: undefined,\n lockDocsUrl: undefined,\n provenance: undefined,\n packageId: undefined,\n packageVersion: undefined,\n };\n if (!item || typeof item !== 'object') return empty;\n const rec = item as Record<string, unknown>;\n const lockRaw = rec['_lock'];\n const lock = typeof lockRaw === 'string' && MetadataLockSchema.options.includes(lockRaw as MetadataLock)\n ? (lockRaw as MetadataLock)\n : 'none';\n const lockReason = typeof rec['_lockReason'] === 'string' ? (rec['_lockReason'] as string) : undefined;\n const lockSource = typeof rec['_lockSource'] === 'string'\n && MetadataLockSourceSchema.options.includes(rec['_lockSource'] as MetadataLockSource)\n ? (rec['_lockSource'] as MetadataLockSource)\n : undefined;\n const lockDocsUrl = typeof rec['_lockDocsUrl'] === 'string' ? (rec['_lockDocsUrl'] as string) : undefined;\n const provenance = typeof rec['_provenance'] === 'string'\n && MetadataProvenanceSchema.options.includes(rec['_provenance'] as MetadataProvenance)\n ? (rec['_provenance'] as MetadataProvenance)\n : undefined;\n const packageId = typeof rec['_packageId'] === 'string' ? (rec['_packageId'] as string) : undefined;\n const packageVersion = typeof rec['_packageVersion'] === 'string' ? (rec['_packageVersion'] as string) : undefined;\n return { lock, lockReason, lockSource, lockDocsUrl, provenance, packageId, packageVersion };\n}\n\n/**\n * Decide whether a write-style operation (PUT / publish / rollback)\n * is allowed under the given lock state.\n *\n * Returns `null` on allow. Returns a structured refusal envelope when\n * the lock blocks the operation; the protocol layer turns that into a\n * `403 item_locked` HTTP error.\n */\nexport function evaluateLockForWrite(lock: MetadataLock): { code: 'item_locked'; reason: string } | null {\n if (lock === 'no-overlay' || lock === 'full') {\n return { code: 'item_locked', reason: `Write refused — _lock=${lock}` };\n }\n return null;\n}\n\n/** Counterpart of {@link evaluateLockForWrite} for delete operations. */\nexport function evaluateLockForDelete(lock: MetadataLock): { code: 'item_locked'; reason: string } | null {\n if (lock === 'no-delete' || lock === 'full') {\n return { code: 'item_locked', reason: `Delete refused — _lock=${lock}` };\n }\n return null;\n}\n\n/**\n * Derive the read-side flags Studio needs to render the UI. The\n * `editable` / `deletable` / `resettable` triple is what the\n * `GET /meta/:type/:name` response carries in Phase 1. See ADR-0010 §5.\n */\nexport function resolveLockState(item: unknown, artifactBacked: boolean): {\n lock: MetadataLock;\n lockReason: string | undefined;\n lockSource: MetadataLockSource | undefined;\n lockDocsUrl: string | undefined;\n provenance: MetadataProvenance | undefined;\n packageId: string | undefined;\n packageVersion: string | undefined;\n editable: boolean;\n deletable: boolean;\n resettable: boolean;\n} {\n const p = extractProtection(item);\n const editable = p.lock !== 'no-overlay' && p.lock !== 'full';\n const deletable = p.lock !== 'no-delete' && p.lock !== 'full';\n // Reset only makes sense when there is something to reset *to* —\n // i.e. the artifact is package-backed and an overlay can be peeled\n // off. Phase 3 will surface this through a dedicated endpoint; for\n // Phase 1 we publish the boolean so Studio can pre-disable the\n // button when artifactBacked is false.\n const resettable = artifactBacked;\n return { ...p, editable, deletable, resettable };\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * # Package-level metadata protection (ADR-0010 §3.7 — Phase 4.3)\n *\n * Public, type-safe author surface for package authors to declare\n * how much of one of their metadata items the runtime (and the\n * tenant's Studio) is allowed to mutate. Internally this is what\n * gets translated into the `_lock` / `_lockReason` / `_lockDocsUrl`\n * private envelope (`kernel/metadata-protection.zod.ts`) that the\n * protocol layer enforces.\n *\n * Why two layers?\n * - **`protection`** is the *author DX* surface — typed, validated,\n * and discoverable via IntelliSense on every `*.app.ts` /\n * `*.object.ts` / `*.view.ts` etc.\n * - **`_lock` envelope** is the *runtime* surface — strips off the\n * protection block on load and stamps the private fields so the\n * persistence and overlay layers don't drag the author-facing\n * block through every `sys_metadata` overlay diff.\n *\n * Example:\n * ```ts\n * export const SETUP_APP: App = {\n * name: 'setup',\n * label: 'Setup',\n * protection: {\n * lock: 'full',\n * reason: 'Core admin UI shipped by @objectstack/platform-objects.',\n * docsUrl: 'https://docs.objectstack.ai/adr/0010-metadata-protection',\n * },\n * // ...\n * };\n * ```\n *\n * The loader (`metadata/plugin.ts` + `objectql/registry.ts`) calls\n * {@link applyProtection} to translate this block into the private\n * `_lock` envelope at registration time. Authors should NEVER set\n * the underscored fields directly — they are an implementation\n * detail.\n *\n * See also:\n * - ADR-0010 §3.7 — Future work → now implemented.\n * - `kernel/metadata-protection.zod.ts` — the runtime envelope.\n */\n\nimport { z } from 'zod';\nimport {\n MetadataLockSchema,\n type MetadataLock,\n} from '../kernel/metadata-protection.zod';\n\n/**\n * Public protection block authored by package developers. Optional on\n * every lockable metadata type — omit to leave the item fully\n * overlay-editable and overlay-deletable (default behaviour).\n *\n * The shape is intentionally *small*: only the fields that have a\n * meaningful UX impact in Studio are exposed. Internal bookkeeping\n * (provenance, packageId, packageVersion) is auto-populated by the\n * loader and must not be supplied here.\n */\nexport const ProtectionSchema = z.object({\n /**\n * Lock policy for this item. See {@link MetadataLockSchema} for\n * the full semantics table.\n *\n * | Value | Save | Delete |\n * |---------------|------|--------|\n * | `none` | ✅ | ✅ |\n * | `no-overlay` | ❌ | ✅ |\n * | `no-delete` | ✅ | ❌ |\n * | `full` | ❌ | ❌ |\n *\n * `no-overlay` is recommended for \"structural\" items that should\n * stay authoritative but allow side-by-side extension (e.g. core\n * objects whose fields can be extended via `objectExtensions`).\n * `full` is for items that have no safe extension point at all\n * (e.g. the platform Setup app whose nav tree is wired directly\n * into framework code).\n */\n lock: MetadataLockSchema.describe(\n 'Lock policy — none | no-overlay | no-delete | full.',\n ),\n\n /**\n * Short user-visible explanation surfaced in `403 item_locked`\n * errors and the Studio lock banner. Aim for one sentence; the\n * banner truncates long values.\n */\n reason: z.string().min(1).max(500).describe(\n 'User-visible reason shown when the lock blocks an action.',\n ),\n\n /**\n * Optional documentation link rendered next to the reason in\n * the Studio lock banner. Use it to point operators at the\n * package's protection policy or to a \"how to customise this\"\n * guide. Must be a fully-qualified URL.\n */\n docsUrl: z.string().url().optional().describe(\n 'Optional URL the Studio banner links to for more context.',\n ),\n}).strict();\n\nexport type Protection = z.infer<typeof ProtectionSchema>;\n\n// ─────────────────────────────────────────────────────────────────────\n// Loader-side translation\n// ─────────────────────────────────────────────────────────────────────\n\n/** Loader context handed in by the registration pipeline. */\nexport interface ApplyProtectionContext {\n /** Owning package id (e.g. `com.objectstack.platform-objects`). */\n packageId?: string;\n /** Owning package semver. */\n packageVersion?: string;\n /**\n * `'package'` for items introduced by a package loader (default).\n * Pass `'env-forced'` when the runtime is materialising an\n * emergency override.\n */\n provenance?: 'package' | 'env-forced';\n}\n\n/**\n * Translate the author-facing `protection` block on `item` into the\n * private `_lock` envelope and strip the public block so it never\n * leaks into the overlay row.\n *\n * Safe to call on any object: items without `protection` are returned\n * unchanged (other than the standard `_packageId` / `_packageVersion`\n * stamping that always runs when the context supplies those fields).\n *\n * Always **mutates** `item` and returns it for chaining.\n */\nexport function applyProtection<T extends Record<string, unknown>>(\n item: T,\n ctx: ApplyProtectionContext = {},\n): T {\n if (!item || typeof item !== 'object') return item;\n\n // Stamp provenance / package coords first so they apply even when\n // there is no `protection` block. The loader pipeline used to do\n // _packageId stamping itself; centralising it here keeps the two\n // load paths (artifact loader + registry.registerItem) consistent.\n if (ctx.packageId && (item as any)._packageId === undefined) {\n (item as any)._packageId = ctx.packageId;\n }\n if (ctx.packageVersion && (item as any)._packageVersion === undefined) {\n (item as any)._packageVersion = ctx.packageVersion;\n }\n // Only stamp provenance when we actually have package coords or an\n // author-facing protection block; otherwise leave the item alone so\n // that DB-only / test fixtures don't acquire an unexpected\n // `_provenance` field. The loader passes packageId for genuine\n // package items; bare `registerItem(type, item)` calls without a\n // package context still produce a clean item.\n const hasProtectionBlock =\n (item as any).protection\n && typeof (item as any).protection === 'object';\n if (\n (ctx.packageId || hasProtectionBlock)\n && (item as any)._provenance === undefined\n ) {\n (item as any)._provenance = ctx.provenance ?? 'package';\n }\n\n const block = (item as any).protection;\n if (!block || typeof block !== 'object') return item;\n\n // Author-facing block exists — translate to the private envelope.\n // We accept partial values (lock alone, reason alone) and let the\n // protocol layer fall back to defaults; full Zod validation runs\n // upstream when the schemas were composed with ProtectionSchema.\n const lock = block.lock as MetadataLock | undefined;\n const reason = typeof block.reason === 'string' ? block.reason : undefined;\n const docsUrl = typeof block.docsUrl === 'string' ? block.docsUrl : undefined;\n\n if (lock !== undefined) {\n (item as any)._lock = lock;\n }\n if (reason !== undefined) {\n (item as any)._lockReason = reason;\n }\n if (docsUrl !== undefined) {\n (item as any)._lockDocsUrl = docsUrl;\n }\n // Lock source is 'package' for anything that came through this\n // helper. Artifact-only items (no packageId) fall back to\n // 'artifact' to preserve the Phase-1 contract.\n if ((item as any)._lockSource === undefined) {\n (item as any)._lockSource = ctx.packageId ? 'package' : 'artifact';\n }\n\n // Strip the public block — it lives only on the author-side\n // module, never on the persisted overlay row.\n delete (item as any).protection;\n\n return item;\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * @module ui/sharing\n *\n * Sharing & Embedding Protocol\n *\n * Defines schemas for public link sharing, embed configuration,\n * domain restrictions, and password protection for apps, pages, and forms.\n */\n\nimport { z } from 'zod';\n\n/**\n * Sharing Config Schema\n * Configuration for public sharing of an app, page, or form.\n * Supports public links, password protection, domain restrictions, and expiration.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SharingConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable public sharing'),\n publicLink: z.string().optional().describe('Generated public share URL'),\n password: z.string().optional().describe('Password required to access shared link'),\n allowedDomains: z.array(z.string()).optional()\n .describe('Restrict access to specific email domains (e.g. [\"example.com\"])'),\n expiresAt: z.string().optional()\n .describe('Expiration date/time in ISO 8601 format'),\n allowAnonymous: z.boolean().optional().default(false)\n .describe('Allow access without authentication'),\n}));\n\n/**\n * Embed Config Schema\n * Configuration for iframe embedding of an app, page, or form.\n * Supports origin restrictions, display options, and responsive sizing.\n */\nexport const EmbedConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable iframe embedding'),\n allowedOrigins: z.array(z.string()).optional()\n .describe('Allowed iframe parent origins (e.g. [\"https://example.com\"])'),\n width: z.string().optional().default('100%').describe('Embed width (CSS value)'),\n height: z.string().optional().default('600px').describe('Embed height (CSS value)'),\n showHeader: z.boolean().optional().default(true).describe('Show interface header in embed'),\n showNavigation: z.boolean().optional().default(false).describe('Show navigation in embed'),\n responsive: z.boolean().optional().default(true).describe('Enable responsive resizing'),\n}));\n\n// Type Exports\nexport type SharingConfig = z.infer<typeof SharingConfigSchema>;\nexport type EmbedConfig = z.infer<typeof EmbedConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Breakpoint Name Enum\n * Matches the breakpoint names defined in theme.zod.ts BreakpointsSchema.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const BreakpointName = z.enum(['xs', 'sm', 'md', 'lg', 'xl', '2xl']);\n\nexport type BreakpointName = z.infer<typeof BreakpointName>;\n\n/**\n * Responsive Configuration Schema\n *\n * Provides responsive layout configuration for UI components.\n * Maps breakpoint names to layout behavior (columns, visibility, order).\n *\n * Aligned with theme.zod.ts BreakpointsSchema for a unified responsive system.\n *\n * @example\n * ```typescript\n * const config: ResponsiveConfig = {\n * columns: { xs: 12, sm: 6, lg: 4 },\n * hiddenOn: ['xs'],\n * order: { xs: 2, lg: 1 },\n * };\n * ```\n */\n/**\n * Breakpoint Column Map Schema\n * Maps breakpoint names to grid column counts (1-12).\n * All entries are optional — only specified breakpoints are configured.\n */\nexport const BreakpointColumnMapSchema = lazySchema(() => z.object({\n xs: z.number().min(1).max(12).optional(),\n sm: z.number().min(1).max(12).optional(),\n md: z.number().min(1).max(12).optional(),\n lg: z.number().min(1).max(12).optional(),\n xl: z.number().min(1).max(12).optional(),\n '2xl': z.number().min(1).max(12).optional(),\n}).describe('Grid columns per breakpoint (1-12)'));\n\n/**\n * Breakpoint Order Map Schema\n * Maps breakpoint names to display order numbers.\n * All entries are optional — only specified breakpoints are configured.\n */\nexport const BreakpointOrderMapSchema = lazySchema(() => z.object({\n xs: z.number().optional(),\n sm: z.number().optional(),\n md: z.number().optional(),\n lg: z.number().optional(),\n xl: z.number().optional(),\n '2xl': z.number().optional(),\n}).describe('Display order per breakpoint'));\n\nexport const ResponsiveConfigSchema = lazySchema(() => z.object({\n /** Minimum breakpoint for visibility */\n breakpoint: BreakpointName.optional()\n .describe('Minimum breakpoint for visibility'),\n\n /** Hide on specific breakpoints */\n hiddenOn: z.array(BreakpointName).optional()\n .describe('Hide on these breakpoints'),\n\n /** Grid columns per breakpoint (1-12 column grid) */\n columns: BreakpointColumnMapSchema.optional().describe('Grid columns per breakpoint'),\n\n /** Display order per breakpoint */\n order: BreakpointOrderMapSchema.optional().describe('Display order per breakpoint'),\n}).describe('Responsive layout configuration'));\n\nexport type ResponsiveConfig = z.infer<typeof ResponsiveConfigSchema>;\n\n/**\n * Style Map Schema (ADR-0065)\n *\n * A CSS property → value map (camelCase keys, e.g. `flexDirection`). Values are\n * arbitrary CSS strings/numbers but authors should prefer design tokens\n * (`var(--space-6)`, `var(--surface)`) for consistency and AI-safety.\n */\nexport const StyleMapSchema = lazySchema(() =>\n z.record(z.string(), z.union([z.string(), z.number()]))\n .describe('CSS property → value map (camelCase keys; design tokens encouraged)'));\n\nexport type StyleMap = z.infer<typeof StyleMapSchema>;\n\n/**\n * Responsive Styles Schema (ADR-0065)\n *\n * Per-breakpoint CSS-property maps for the SDUI scoped-styling model. Compiled\n * to **id-scoped CSS at render** (objectui `SchemaRenderer`) — build-independent,\n * collision-free, responsive-correct. Desktop-first: `large` is the\n * unconditional base; `medium`/`small`/`xsmall` are `max-width` overrides.\n *\n * Distinct from {@link ResponsiveConfigSchema}, which configures *layout* (grid\n * columns / visibility / order) on the Tailwind `xs..2xl` axis. This styles a\n * node's own box; that arranges a node within a grid.\n */\nexport const ResponsiveStylesSchema = lazySchema(() => z.object({\n large: StyleMapSchema.optional().describe('Unconditional base (desktop-first)'),\n medium: StyleMapSchema.optional().describe('Applied at ≤ medium breakpoint'),\n small: StyleMapSchema.optional().describe('Applied at ≤ small breakpoint'),\n xsmall: StyleMapSchema.optional().describe('Applied at ≤ xsmall breakpoint'),\n}).describe('Per-breakpoint scoped style maps (ADR-0065)'));\n\nexport type ResponsiveStyles = z.infer<typeof ResponsiveStylesSchema>;\n\n/**\n * Performance Configuration Schema\n *\n * Defines performance optimization settings for UI components\n * such as lazy loading, virtual scrolling, and caching.\n *\n * @example\n * ```typescript\n * const perf: PerformanceConfig = {\n * lazyLoad: true,\n * virtualScroll: { enabled: true, itemHeight: 40, overscan: 5 },\n * cacheStrategy: 'stale-while-revalidate',\n * prefetch: true,\n * };\n * ```\n */\nexport const PerformanceConfigSchema = lazySchema(() => z.object({\n /** Enable lazy loading for this component */\n lazyLoad: z.boolean().optional()\n .describe('Enable lazy loading (defer rendering until visible)'),\n\n /** Virtual scrolling configuration for large datasets */\n virtualScroll: z.object({\n enabled: z.boolean().default(false).describe('Enable virtual scrolling'),\n itemHeight: z.number().optional().describe('Fixed item height in pixels (for estimation)'),\n overscan: z.number().optional().describe('Number of extra items to render outside viewport'),\n }).optional().describe('Virtual scrolling configuration'),\n\n /** Client-side caching strategy */\n cacheStrategy: z.enum([\n 'none',\n 'cache-first',\n 'network-first',\n 'stale-while-revalidate',\n ]).optional().describe('Client-side data caching strategy'),\n\n /** Enable data prefetching */\n prefetch: z.boolean().optional()\n .describe('Prefetch data before component is visible'),\n\n /** Maximum number of items to render before pagination */\n pageSize: z.number().optional()\n .describe('Number of items per page for pagination'),\n\n /** Debounce interval for user interactions (ms) */\n debounceMs: z.number().optional()\n .describe('Debounce interval for user interactions in milliseconds'),\n}).describe('Performance optimization configuration'));\n\nexport type PerformanceConfig = z.infer<typeof PerformanceConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Shared HTTP Schemas\n * \n * Common HTTP-related schemas used across API and System protocols.\n * These schemas ensure consistency across different parts of the stack.\n */\n\n// ==========================================\n// Basic HTTP Types\n// ==========================================\n\n/**\n * HTTP Method Enum\n */\nimport { lazySchema } from './lazy-schema';\nexport const HttpMethod = z.enum([\n 'GET', \n 'POST', \n 'PUT', \n 'DELETE', \n 'PATCH', \n 'HEAD', \n 'OPTIONS'\n]);\n\nexport type HttpMethod = z.infer<typeof HttpMethod>;\n\n/**\n * HTTP Method Schema (subset for UI/View data sources)\n * Common HTTP methods used in view data source configurations.\n * Migrated from ui/view.zod.ts to shared for reuse across modules.\n */\nexport const HttpMethodSchema = lazySchema(() => z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']));\n\nexport type HttpMethodType = z.infer<typeof HttpMethodSchema>;\n\n/**\n * HTTP Request Configuration Schema\n * Defines a complete HTTP request configuration used by API data providers.\n * Migrated from ui/view.zod.ts to shared for reuse across modules.\n */\nexport const HttpRequestSchema = lazySchema(() => z.object({\n url: z.string().describe('API endpoint URL'),\n method: HttpMethodSchema.optional().default('GET').describe('HTTP method'),\n headers: z.record(z.string(), z.string()).optional().describe('Custom HTTP headers'),\n params: z.record(z.string(), z.unknown()).optional().describe('Query parameters'),\n body: z.unknown().optional().describe('Request body for POST/PUT/PATCH'),\n}));\n\nexport type HttpRequest = z.infer<typeof HttpRequestSchema>;\n\n// ==========================================\n// CORS Configuration\n// ==========================================\n\n/**\n * CORS Configuration Schema\n * Cross-Origin Resource Sharing configuration\n * \n * Used by:\n * - api/router.zod.ts (RouterConfigSchema)\n * - system/http-server.zod.ts (HttpServerConfigSchema)\n * \n * @example\n * {\n * \"enabled\": true,\n * \"origins\": [\"http://localhost:3000\", \"https://app.example.com\"],\n * \"methods\": [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n * \"credentials\": true,\n * \"maxAge\": 86400\n * }\n */\nexport const CorsConfigSchema = lazySchema(() => z.object({\n /**\n * Enable CORS\n */\n enabled: z.boolean().default(true).describe('Enable CORS'),\n \n /**\n * Allowed origins (* for all)\n */\n origins: z.union([\n z.string(),\n z.array(z.string())\n ]).default('*').describe('Allowed origins (* for all)'),\n \n /**\n * Allowed HTTP methods\n */\n methods: z.array(HttpMethod).optional().describe('Allowed HTTP methods'),\n \n /**\n * Allow credentials (cookies, authorization headers)\n */\n credentials: z.boolean().default(false).describe('Allow credentials (cookies, authorization headers)'),\n \n /**\n * Preflight cache duration in seconds\n */\n maxAge: z.number().int().optional().describe('Preflight cache duration in seconds'),\n}));\n\nexport type CorsConfig = z.infer<typeof CorsConfigSchema>;\n\n// ==========================================\n// Rate Limiting\n// ==========================================\n\n/**\n * Rate Limit Configuration Schema\n * \n * Used by:\n * - api/endpoint.zod.ts (ApiEndpointSchema)\n * - system/http-server.zod.ts (HttpServerConfigSchema)\n * \n * @example\n * {\n * \"enabled\": true,\n * \"windowMs\": 60000,\n * \"maxRequests\": 100\n * }\n */\nexport const RateLimitConfigSchema = lazySchema(() => z.object({\n /**\n * Enable rate limiting\n */\n enabled: z.boolean().default(false).describe('Enable rate limiting'),\n \n /**\n * Time window in milliseconds\n */\n windowMs: z.number().int().default(60000).describe('Time window in milliseconds'),\n \n /**\n * Max requests per window\n */\n maxRequests: z.number().int().default(100).describe('Max requests per window'),\n}));\n\nexport type RateLimitConfig = z.infer<typeof RateLimitConfigSchema>;\n\n// ==========================================\n// Static File Serving\n// ==========================================\n\n/**\n * Static Mount Configuration Schema\n * Configuration for serving static files\n * \n * Used by:\n * - api/router.zod.ts (RouterConfigSchema)\n * - system/http-server.zod.ts (HttpServerConfigSchema)\n * \n * @example\n * {\n * \"path\": \"/static\",\n * \"directory\": \"./public\",\n * \"cacheControl\": \"public, max-age=31536000\"\n * }\n */\nexport const StaticMountSchema = lazySchema(() => z.object({\n /**\n * URL path to serve from\n */\n path: z.string().describe('URL path to serve from'),\n \n /**\n * Physical directory to serve\n */\n directory: z.string().describe('Physical directory to serve'),\n \n /**\n * Cache-Control header value\n */\n cacheControl: z.string().optional().describe('Cache-Control header value'),\n}));\n\nexport type StaticMount = z.infer<typeof StaticMountSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { ProtectionSchema } from '../shared/protection.zod';\nimport { MetadataProtectionFields } from '../kernel/metadata-protection.zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\nimport { I18nLabelSchema, AriaPropsSchema } from './i18n.zod';\nimport { SharingConfigSchema } from './sharing.zod';\nimport { ResponsiveConfigSchema, PerformanceConfigSchema } from './responsive.zod';\nimport { FieldType, SelectOptionSchema } from '../data/field.zod';\n\n/**\n * HTTP Method Enum & HTTP Request Schema\n * Migrated to shared/http.zod.ts. Re-exported here for backward compatibility.\n */\nimport { HttpMethodSchema, HttpRequestSchema } from '../shared/http.zod';\nimport { lazySchema } from '../shared/lazy-schema';\nexport { HttpMethodSchema, HttpRequestSchema };\n\n/**\n * View Data Source Configuration\n * Supports three modes:\n * 1. 'object': Standard Protocol - Auto-connects to ObjectStack Metadata and Data APIs\n * 2. 'api': Custom API - Explicitly provided API URLs\n * 3. 'value': Static Data - Hardcoded data array\n */\nexport const ViewDataSchema = lazySchema(() => z.discriminatedUnion('provider', [\n z.object({\n provider: z.literal('object'),\n object: z.string().describe('Target object name'),\n }),\n z.object({\n provider: z.literal('api'),\n read: HttpRequestSchema.optional().describe('Configuration for fetching data'),\n write: HttpRequestSchema.optional().describe('Configuration for submitting data (for forms/editable tables)'),\n }),\n z.object({\n provider: z.literal('value'),\n items: z.array(z.unknown()).describe('Static data array'),\n }),\n /**\n * Schema-bound data source — used by standalone forms whose data is\n * shaped by a JSON Schema (or Zod-derived schema) rather than by an\n * ObjectQL object. Powers the metadata editor, action input dialogs,\n * and any Form that is not bound to a CRUD object.\n */\n z.object({\n provider: z.literal('schema'),\n /** Schema identifier (e.g. metadata type name \"report\"). Resolved at runtime against /meta entries. */\n schemaId: z.string().describe('Schema identifier — typically the metadata type name'),\n /** Optional inline JSON Schema; when omitted the runtime resolves schemaId from the server. */\n schema: z.record(z.string(), z.unknown()).optional().describe('Inline JSON Schema (Draft 2020-12). Optional when schemaId is resolvable.'),\n }),\n]));\n\n/**\n * View Filter Rule Schema\n * Standardized filter condition used in list views, tabs, and page-level filters.\n * Uses a declarative array-of-objects format: [{ field, operator, value }].\n *\n * @example\n * ```ts\n * filter: [\n * { field: 'status', operator: 'equals', value: 'active' },\n * { field: 'close_date', operator: 'this_quarter' },\n * ]\n * ```\n */\nexport const ViewFilterRuleSchema = lazySchema(() => z.object({\n /** Field name to filter on */\n field: z.string().describe('Field name to filter on'),\n /** Filter operator */\n operator: z.string().describe('Filter operator (e.g. equals, not_equals, contains, this_quarter)'),\n /** Filter value (optional for unary operators like is_null, this_quarter) */\n value: z.union([z.string(), z.number(), z.boolean(), z.null(), z.array(z.union([z.string(), z.number()]))])\n .optional().describe('Filter value'),\n}).describe('View filter rule'));\n\nexport type ViewFilterRule = z.infer<typeof ViewFilterRuleSchema>;\n\n/**\n * Column Summary Function Schema\n * Aggregation function for column footer (Airtable-style column summaries)\n */\nexport const ColumnSummarySchema = lazySchema(() => z.enum([\n 'none',\n 'count',\n 'count_empty',\n 'count_filled',\n 'count_unique',\n 'percent_empty',\n 'percent_filled',\n 'sum',\n 'avg',\n 'min',\n 'max',\n]).describe('Aggregation function for column footer summary'));\n\n/**\n * List Column Configuration Schema\n * Detailed configuration for individual list view columns\n */\nexport const ListColumnSchema = lazySchema(() => z.object({\n field: z.string().describe('Field name (snake_case)'),\n label: I18nLabelSchema.optional().describe('Display label override'),\n width: z.number().positive().optional().describe('Column width in pixels'),\n align: z.enum(['left', 'center', 'right']).optional().describe('Text alignment'),\n hidden: z.boolean().optional().describe('Hide column by default'),\n sortable: z.boolean().optional().describe('Allow sorting by this column'),\n resizable: z.boolean().optional().describe('Allow resizing this column'),\n wrap: z.boolean().optional().describe('Allow text wrapping'),\n type: z.string().optional().describe('Renderer type override (e.g., \"currency\", \"date\")'),\n\n /** Pinning (Airtable-style frozen columns) */\n pinned: z.enum(['left', 'right']).optional().describe('Pin/freeze column to left or right side'),\n\n /** Column Footer Summary (Airtable-style aggregation) */\n summary: ColumnSummarySchema.optional().describe('Footer aggregation function for this column'),\n\n /** Interaction */\n link: z.boolean().optional().describe('Functions as the primary navigation link (triggers View navigation)'),\n action: z.string().optional().describe('Registered Action ID to execute when clicked'),\n}));\n\n/**\n * List View Selection Configuration\n */\nexport const SelectionConfigSchema = lazySchema(() => z.object({\n type: z.enum(['none', 'single', 'multiple']).default('none').describe('Selection mode'),\n}));\n\n/**\n * List View Pagination Configuration\n */\nexport const PaginationConfigSchema = lazySchema(() => z.object({\n pageSize: z.number().int().positive().default(25).describe('Number of records per page'),\n pageSizeOptions: z.array(z.number().int().positive()).optional().describe('Available page size options'),\n}));\n\n/**\n * Row Height / Density Schema (Airtable-style)\n * Controls the visual density of rows in a list view.\n */\nexport const RowHeightSchema = lazySchema(() => z.enum([\n 'compact', // Minimal padding, single line\n 'short', // Reduced padding\n 'medium', // Default padding\n 'tall', // Extra padding, multi-line preview\n 'extra_tall', // Maximum padding, rich content preview\n]).describe('Row height / density setting for list view'));\n\n/**\n * Grouping Field Configuration\n * Defines a single grouping level for record grouping.\n */\nexport const GroupingFieldSchema = lazySchema(() => z.object({\n field: z.string().describe('Field name to group by'),\n order: z.enum(['asc', 'desc']).default('asc').describe('Group sort order'),\n collapsed: z.boolean().default(false).describe('Collapse groups by default'),\n}));\n\n/**\n * Grouping Configuration Schema (Airtable-style)\n * Supports multi-level grouping for grid/gallery views.\n */\nexport const GroupingConfigSchema = lazySchema(() => z.object({\n fields: z.array(GroupingFieldSchema).min(1).describe('Fields to group by (supports up to 3 levels)'),\n}).describe('Record grouping configuration'));\n\n/**\n * Gallery View Configuration (Airtable-style)\n * Configures card layout for gallery/card views.\n */\nexport const GalleryConfigSchema = lazySchema(() => z.object({\n coverField: z.string().optional().describe('Attachment/image field to display as card cover'),\n coverFit: z.enum(['cover', 'contain']).default('cover').describe('Image fit mode for card cover'),\n cardSize: z.enum(['small', 'medium', 'large']).default('medium').describe('Card size in gallery view'),\n titleField: z.string().optional().describe('Field to display as card title'),\n visibleFields: z.array(z.string()).optional().describe('Fields to display on card body'),\n}).describe('Gallery/card view configuration'));\n\n/**\n * Timeline View Configuration (Airtable-style)\n * Configures timeline/chronological views.\n */\nexport const TimelineConfigSchema = lazySchema(() => z.object({\n startDateField: z.string().describe('Field for timeline item start date'),\n endDateField: z.string().optional().describe('Field for timeline item end date'),\n titleField: z.string().describe('Field to display as timeline item title'),\n groupByField: z.string().optional().describe('Field to group timeline rows'),\n colorField: z.string().optional().describe('Field to determine item color'),\n scale: z.enum(['hour', 'day', 'week', 'month', 'quarter', 'year']).default('week').describe('Default timeline scale'),\n}).describe('Timeline view configuration'));\n\n/**\n * View Sharing Configuration (Airtable-style)\n * Defines who can see and modify a view.\n */\nexport const ViewSharingSchema = lazySchema(() => z.object({\n type: z.enum(['personal', 'collaborative']).default('collaborative').describe('View ownership type'),\n lockedBy: z.string().optional().describe('User who locked the view configuration'),\n}).describe('View sharing and access configuration'));\n\n/**\n * Row Color Configuration (Airtable-style)\n * Defines how rows are colored based on field values.\n */\nexport const RowColorConfigSchema = lazySchema(() => z.object({\n field: z.string().describe('Field to derive color from (typically a select/status field)'),\n colors: z.record(z.string(), z.string()).optional().describe('Map of field value to color (hex/token)'),\n}).describe('Row color configuration based on field values'));\n\n/**\n * Visualization Type Schema\n * Whitelist of visualization types the user can switch between.\n * Maps to Airtable's \"Visualizations\" setting in Appearance panel.\n */\nexport const VisualizationTypeSchema = lazySchema(() => z.enum([\n 'grid',\n 'kanban',\n 'gallery',\n 'calendar',\n 'timeline',\n 'gantt',\n 'map',\n 'chart',\n 'tree',\n]).describe('Visualization type that users can switch to'));\n\n/**\n * User Actions Configuration Schema (Airtable Interface parity)\n * Controls which interactive actions are available to users in the view toolbar.\n * Each boolean toggles the corresponding toolbar element on/off.\n *\n * @see Airtable Interface → \"User actions\" panel\n */\nexport const UserActionsConfigSchema = lazySchema(() => z.object({\n sort: z.boolean().default(true).describe('Allow users to sort records'),\n search: z.boolean().default(true).describe('Allow users to search records'),\n filter: z.boolean().default(true).describe('Allow users to filter records'),\n rowHeight: z.boolean().default(true).describe('Allow users to toggle row height/density'),\n addRecordForm: z.boolean().default(false).describe('Add records through a form instead of inline'),\n editInline: z.boolean().default(false).describe('Allow users to edit records inline — click a cell to edit it with the field\\'s type-aware widget (the same control the form uses). Off by default: the list is read-only unless the author opts in.'),\n buttons: z.array(z.string()).optional().describe('Custom action button IDs to show in the toolbar'),\n}).describe('User action toggles for the view toolbar'));\n\n/**\n * Appearance Configuration Schema (Airtable Interface parity)\n * Controls visual presentation options for the view.\n *\n * @see Airtable Interface → \"Appearance\" panel\n */\nexport const AppearanceConfigSchema = lazySchema(() => z.object({\n showDescription: z.boolean().default(true).describe('Show the view description text'),\n allowedVisualizations: z.array(VisualizationTypeSchema).optional()\n .describe('Whitelist of visualization types users can switch between (e.g. [\"grid\", \"gallery\", \"kanban\"])'),\n}).describe('Appearance and visualization configuration'));\n\n/**\n * View Tab Schema (Airtable Interface parity)\n * Defines a tab in a multi-tab view interface.\n * Each tab references a named list view and can be ordered, pinned, or set as default.\n *\n * @see Airtable Interface → \"Tabs\" panel\n */\nexport const ViewTabSchema = lazySchema(() => z.object({\n name: SnakeCaseIdentifierSchema.describe('Tab identifier (snake_case)'),\n label: I18nLabelSchema.optional().describe('Display label'),\n icon: z.string().optional().describe('Tab icon name'),\n view: z.string().optional().describe('Referenced list view name from listViews'),\n filter: z.array(ViewFilterRuleSchema).optional().describe('Tab-specific filter criteria'),\n order: z.number().int().min(0).optional().describe('Tab display order'),\n pinned: z.boolean().default(false).describe('Pin tab (cannot be removed by users)'),\n isDefault: z.boolean().default(false).describe('Set as the default active tab'),\n visible: z.boolean().default(true).describe('Tab visibility'),\n}).describe('Tab configuration for multi-tab view interface'));\n\n/**\n * User Filter Field Schema (ADR-0047)\n * One field exposed as a quick-filter control in the end-user filter bar.\n * Rendering details (widget, options) default to inference from the field\n * definition on the source object — authors only override when needed.\n *\n * @see Airtable Interface → \"User filters\" panel (Dropdowns element)\n */\nexport const UserFilterFieldSchema = lazySchema(() => z.object({\n field: z.string().describe('Field name on the source object (must exist — checked by reference diagnostics)'),\n label: I18nLabelSchema.optional().describe('Display label override (defaults to the field label)'),\n type: z.enum(['select', 'multi-select', 'boolean', 'date-range', 'text']).optional()\n .describe('Filter control type. Omit to infer from the field definition'),\n options: z.array(z.object({\n value: z.union([z.string(), z.number(), z.boolean()]).describe('Option value'),\n label: I18nLabelSchema.describe('Option label'),\n color: z.string().optional().describe('Option color token/hex'),\n })).optional().describe('Static options. Omit to derive from the field definition (select options / lookup records)'),\n showCount: z.boolean().optional().describe('Show per-option record counts'),\n defaultValues: z.array(z.union([z.string(), z.number(), z.boolean()])).optional()\n .describe('Pre-selected values when the view loads'),\n}).describe('Quick-filter field configuration'));\n\n/**\n * User Filters Schema (ADR-0047, Airtable Interface parity)\n * The end-user-facing quick-filter surface above a list. The author picks the\n * element style and which fields/presets are exposed; end users combine them\n * at runtime (session-scoped — selections never persist as metadata).\n *\n * Distinct from `ListView.filter` (the always-on base criteria) and from the\n * advanced filter builder (`userActions.filter` toggle).\n *\n * @see Airtable Interface → \"User filters\" panel (Elements: tabs / dropdowns)\n */\nexport const UserFiltersSchema = lazySchema(() => z.object({\n // `toggle` is DEPRECATED (ADR-0047 §3.4a): it overlaps `tabs` (presets) and\n // `dropdown` (per-field values) without adding expressive power, needs\n // per-field defaultValues to be useful, and authoring tooling no longer\n // offers it (None / Tabs / Dropdown only). Kept in the enum so existing\n // configs keep rendering; do not author new `toggle` filters.\n element: z.enum(['dropdown', 'tabs', 'toggle']).default('dropdown')\n .describe('Filter control style: \"dropdown\" (per-field value selectors) or \"tabs\" (named presets). \"toggle\" is deprecated.'),\n fields: z.array(UserFilterFieldSchema).optional()\n .describe('Fields exposed as quick filters (dropdown/toggle elements)'),\n tabs: z.array(ViewTabSchema).optional()\n .describe('Named filter presets rendered as tabs (tabs element). Reuses ViewTabSchema'),\n showAllRecords: z.boolean().optional()\n .describe('Show an \"All records\" tab before the presets (tabs element)'),\n}).describe('End-user quick-filter configuration (Airtable \"User filters\" parity)'));\n\n/**\n * Add Record Configuration Schema (Airtable Interface parity)\n * Configures the \"Add Record\" entry point for a list view.\n *\n * @see Airtable Interface → \"+ Add record\" button\n */\nexport const AddRecordConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(true).describe('Show the add record entry point'),\n position: z.enum(['top', 'bottom', 'both']).default('bottom').describe('Position of the add record button'),\n mode: z.enum(['inline', 'form', 'modal']).default('inline').describe('How to add a new record'),\n formView: z.string().optional().describe('Named form view to use when mode is \"form\" or \"modal\"'),\n}).describe('Add record entry point configuration'));\n\n/**\n * Kanban Settings\n */\nexport const KanbanConfigSchema = lazySchema(() => z.object({\n groupByField: z.string().describe('Field to group columns by (usually status/select)'),\n summarizeField: z.string().optional().describe('Field to sum at top of column (e.g. amount)'),\n columns: z.array(z.string()).describe('Fields to show on cards'),\n}));\n\n/**\n * List Chart View Configuration (Airtable-style)\n * Configures aggregate chart visualizations (bar/line/pie/area/scatter)\n * when used as a `type: 'chart'` ListView. Distinct from the full-featured\n * `ChartConfigSchema` in `chart.zod.ts` (which is for embedded reports).\n */\nexport const ListChartConfigSchema = lazySchema(() => z.object({\n chartType: z.enum(['bar', 'line', 'pie', 'area', 'scatter']).default('bar').describe('Chart visualisation type'),\n /**\n * ADR-0021 — the semantic-layer `dataset` this chart binds to. Selects\n * dimensions/measures BY NAME so the chart's numbers stay consistent with\n * every other surface using the same dataset. This is the single author-facing\n * shape (the legacy inline `xAxisField` + `yAxisFields` + `aggregation` query\n * was removed in the cutover).\n */\n dataset: SnakeCaseIdentifierSchema.describe('Dataset name to bind (ADR-0021)'),\n /** Dimension names (from the dataset) for X / group / split. */\n dimensions: z.array(z.string()).optional().describe('Dimension names — X/group/split'),\n /** Measure names (from the dataset) for the value axis. */\n values: z.array(z.string()).min(1).describe('Measure names — Y (at least one)'),\n}).describe('List chart view configuration'));\n\n/**\n * Calendar Settings\n */\nexport const CalendarConfigSchema = lazySchema(() => z.object({\n startDateField: z.string(),\n endDateField: z.string().optional(),\n titleField: z.string(),\n colorField: z.string().optional(),\n}));\n\n/**\n * Quick filter dimension for the Gantt toolbar.\n */\nexport const GanttQuickFilterSchema = lazySchema(() => z.object({\n field: z.string().describe('Record field / dot-path the dimension filters on'),\n label: z.string().optional().describe('Trigger label (falls back to the field label)'),\n options: z.array(z.union([\n z.string(),\n z.object({\n value: z.union([z.string(), z.number()]),\n label: z.string().optional(),\n }),\n ])).optional().describe('Explicit option override for fixed enums'),\n}));\n\n/**\n * Gantt Settings\n *\n * Beyond the core timeline fields, the renderer supports a two-level\n * parent/child hierarchy (parentField/typeField), planned-vs-actual baselines,\n * dynamic grouping, a resource/workload view, hover tooltips and quick filters.\n */\nexport const GanttConfigSchema = lazySchema(() => z.object({\n startDateField: z.string(),\n endDateField: z.string(),\n titleField: z.string(),\n progressField: z.string().optional(),\n dependenciesField: z.string().optional(),\n colorField: z.string().optional().describe('Field that drives the bar color'),\n // Two-level hierarchy: a parent task id (summary bar) and a row type.\n parentField: z.string().optional().describe('Field holding the parent task id (builds the summary → step tree)'),\n typeField: z.string().optional().describe('Field whose value maps to task/summary/milestone'),\n // Planned-vs-actual reference bars.\n baselineStartField: z.string().optional().describe('Baseline (planned) start field'),\n baselineEndField: z.string().optional().describe('Baseline (planned) end field'),\n // Dynamic grouping: bucket leaf tasks under one synthesized summary per value.\n groupByField: z.string().optional().describe('Field to group leaf tasks by (synthesized summary rows)'),\n // Resource / workload view.\n resourceView: z.boolean().optional().describe('Render a per-resource workload histogram instead of the timeline'),\n assigneeField: z.string().optional().describe('Resource field to bucket load by (resource view)'),\n effortField: z.string().optional().describe('Per-task load units (resource view; default 1)'),\n capacity: z.number().optional().describe('Per-resource capacity ceiling; loads above this flag overload'),\n // Hover tooltip + quick filters.\n tooltipFields: z.array(z.union([\n z.string(),\n z.object({ field: z.string(), label: z.string().optional() }),\n ])).optional().describe('Fields to surface in the hover tooltip, in display order'),\n quickFilters: z.array(GanttQuickFilterSchema).optional().describe('Multi-select filter dropdowns rendered above the chart'),\n autoZoomToFilter: z.boolean().optional().describe('When true (default), filtering zooms the range to the filtered tasks'),\n// Forward-compatible: the gantt renderer (objectui plugin-gantt) keeps adding\n// config knobs (e.g. lockField / defaultCollapsedDepth) ahead of this schema.\n// Passthrough lets those extra fields reach the renderer instead of being\n// stripped here, so a renderer release no longer has to wait on a spec release.\n}).passthrough());\n\n/**\n * Tree (tree-grid) Settings\n *\n * Renders a self-referencing object as an indented, expand/collapse tree-grid.\n * Flat records are nested via a single-parent pointer field (`parentField`).\n * Unlike a fixed-depth `grouping`, a tree handles arbitrary depth (org charts,\n * category trees, BOMs, nested comments). When `parentField` is omitted the\n * renderer auto-detects the object's `tree`/self-reference field.\n */\nexport const TreeConfigSchema = lazySchema(() => z.object({\n parentField: z.string().optional().describe('Single-parent pointer field (auto-detected from the object schema when omitted)'),\n labelField: z.string().optional().describe('Field rendered indented in the first column (defaults to \"name\")'),\n fields: z.array(z.string()).optional().describe('Additional fields rendered as flat columns alongside the label'),\n defaultExpandedDepth: z.number().int().min(0).optional().describe('Initial expansion depth (0 = roots only; omit = expand all)'),\n// Forward-compatible: let renderer-ahead config knobs reach plugin-tree.\n}).passthrough());\n\n/**\n * Navigation Mode Enum\n * Defines how to navigate to the detail view from a list item.\n */\nexport const NavigationModeSchema = lazySchema(() => z.enum([\n 'page', // Navigate to a new route (default)\n 'drawer', // Open details in a side drawer/panel\n 'modal', // Open details in a modal dialog\n 'split', // Show details side-by-side with the list (master-detail)\n 'popover', // Show details in a popover (lightweight)\n 'new_window', // Open in new browser tab/window\n 'none' // No navigation (read-only list)\n]));\n\n/**\n * Navigation Configuration Schema\n */\nexport const NavigationConfigSchema = lazySchema(() => z.object({\n mode: NavigationModeSchema.default('page'),\n \n /** Target View Config */\n view: z.string().optional().describe('Name of the form view to use for details (e.g. \"summary_view\", \"edit_form\")'),\n \n /** Interaction Triggers */\n preventNavigation: z.boolean().default(false).describe('Disable standard navigation entirely'),\n openNewTab: z.boolean().default(false).describe('Force open in new tab (applies to page mode)'),\n \n /**\n * [#2578] Overlay size for a drawer/modal detail — coarse T-shirt buckets,\n * aligned with `FormView.modalSize` (`page` mode ignores it). `'auto'`\n * (default): the renderer derives the size from the object's field count and\n * clamps it to the client viewport, so AI writes nothing — it cannot know the\n * client width. Explicit buckets are a coarse, viewport-independent override.\n */\n size: z.enum(['auto', 'sm', 'md', 'lg', 'xl', 'full']).default('auto')\n .describe(\"[#2578] Overlay size bucket for drawer/modal detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it.\"),\n\n /**\n * @deprecated [#2578 → `size`] A pixel/percent width cannot be authored blind:\n * the author (often an AI) does not know the client viewport. Kept only as a\n * renderer fallback for pre-#2578 metadata; new metadata sets `size` (or omits\n * it for `auto`).\n */\n width: z.union([z.string(), z.number()]).optional().describe('[DEPRECATED → size] Pixel/percent width of the drawer/modal (e.g. \"600px\"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket.'),\n}));\n\n/**\n * List View Schema (Expanded)\n * Defines how a collection of records is displayed to the user.\n * \n * **NAMING CONVENTION:**\n * View names (when provided) are machine identifiers and must be lowercase snake_case.\n * \n * @example Standard Grid\n * {\n * name: \"all_active\",\n * label: \"All Active\",\n * type: \"grid\",\n * columns: [\"name\", \"status\", \"created_at\"],\n * filter: [[\"status\", \"=\", \"active\"]]\n * }\n * \n * @example Kanban Board\n * {\n * type: \"kanban\",\n * columns: [\"name\", \"amount\"],\n * kanban: {\n * groupByField: \"stage\",\n * summarizeField: \"amount\",\n * columns: [\"name\", \"close_date\"]\n * }\n * }\n */\nexport const ListViewSchema = lazySchema(() => z.object({\n name: SnakeCaseIdentifierSchema.optional().describe('Internal view name (lowercase snake_case)'),\n label: I18nLabelSchema.optional(), // Display label override (supports i18n)\n type: z.enum([\n 'grid', // Standard Data Table\n 'kanban', // Board / Columns\n 'gallery', // Card Deck / Masonry\n 'calendar', // Monthly/Weekly/Daily\n 'timeline', // Chronological Stream (Feed)\n 'gantt', // Project Timeline\n 'map', // Geospatial\n 'chart', // Aggregate visualisation\n 'tree' // Self-referencing hierarchy (tree-grid)\n ]).default('grid'),\n \n /** Data Source Configuration */\n data: ViewDataSchema.optional().describe('Data source configuration (defaults to \"object\" provider)'),\n \n /** Shared Query Config */\n columns: z.union([\n z.array(z.string()), // Legacy: simple field names\n z.array(ListColumnSchema), // Enhanced: detailed column config\n ]).describe('Fields to display as columns'),\n filter: z.array(ViewFilterRuleSchema).optional().describe('Filter criteria (JSON Rules)'),\n sort: z.union([\n z.string(), //Legacy \"field desc\"\n z.array(z.object({\n field: z.string(),\n order: z.enum(['asc', 'desc'])\n }))\n ]).optional(),\n \n /** Search & Filter */\n searchableFields: z.array(z.string()).optional().describe('Fields enabled for search'),\n filterableFields: z.array(z.string()).optional().describe('Legacy shorthand for userFilters.fields — bare field names enabled for end-user filtering. Prefer userFilters'),\n\n /** User Filters (ADR-0047, Airtable Interface parity) */\n userFilters: UserFiltersSchema.optional()\n .describe('End-user quick-filter bar: dropdown/toggle fields or tab presets. Omit to let the renderer derive filters from select/boolean fields'),\n\n /** Grid Features */\n resizable: z.boolean().optional().describe('Enable column resizing'),\n striped: z.boolean().optional().describe('Striped row styling'),\n bordered: z.boolean().optional().describe('Show borders'),\n compactToolbar: z.boolean().optional().describe('Collapse Group/Color/Density/Hide-fields into a single View settings popover'),\n\n /** Selection */\n selection: SelectionConfigSchema.optional().describe('Row selection configuration'),\n\n /** Navigation / Interaction */\n navigation: NavigationConfigSchema.optional().describe('Configuration for item click navigation (page, drawer, modal, etc.)'),\n\n /** Pagination */\n pagination: PaginationConfigSchema.optional().describe('Pagination configuration'),\n\n /** Type Specific Config */\n kanban: KanbanConfigSchema.optional(),\n calendar: CalendarConfigSchema.optional(),\n gantt: GanttConfigSchema.optional(),\n gallery: GalleryConfigSchema.optional(),\n timeline: TimelineConfigSchema.optional(),\n chart: ListChartConfigSchema.optional(),\n tree: TreeConfigSchema.optional(),\n\n /** View Metadata (Airtable-style view management) */\n description: I18nLabelSchema.optional().describe('View description for documentation/tooltips'),\n sharing: ViewSharingSchema.optional().describe('View sharing and access configuration'),\n\n /** Row Height / Density (Airtable-style) */\n rowHeight: RowHeightSchema.optional().describe('Row height / density setting'),\n\n /** Record Grouping (Airtable-style) */\n grouping: GroupingConfigSchema.optional().describe('Group records by one or more fields'),\n\n /** Row Color (Airtable-style) */\n rowColor: RowColorConfigSchema.optional().describe('Color rows based on field value'),\n\n /** Field Visibility & Ordering per View (Airtable-style) */\n hiddenFields: z.array(z.string()).optional().describe('Fields to hide in this specific view'),\n fieldOrder: z.array(z.string()).optional().describe('Explicit field display order for this view'),\n\n /** Row & Bulk Actions */\n rowActions: z.array(z.string()).optional().describe('Actions available for individual row items'),\n bulkActions: z.array(z.string()).optional().describe('Actions available when multiple rows are selected'),\n bulkActionDefs: z.array(z.record(z.string(), z.any())).optional().describe('Rich bulk action definitions (schema-driven, executed via BulkActionDialog)'),\n\n /** Performance */\n virtualScroll: z.boolean().optional().describe('Enable virtual scrolling for large datasets'),\n\n /** Conditional Formatting */\n conditionalFormatting: z.array(z.object({\n condition: ExpressionInputSchema.describe('Predicate (CEL) to evaluate.'),\n style: z.record(z.string(), z.string()).describe('CSS styles to apply when condition is true'),\n })).optional().describe('Conditional formatting rules for list rows'),\n\n /** Inline Edit */\n inlineEdit: z.boolean().optional().describe('Allow inline editing of records directly in the list view'),\n\n /** Export */\n exportOptions: z.array(z.enum(['csv', 'xlsx', 'pdf', 'json'])).optional().describe('Available export format options'),\n\n /** User Actions (Airtable Interface parity) */\n userActions: UserActionsConfigSchema.optional().describe('User action toggles for the view toolbar'),\n\n /** Appearance (Airtable Interface parity) */\n appearance: AppearanceConfigSchema.optional().describe('Appearance and visualization configuration'),\n\n /** Tabs (Airtable Interface parity) */\n tabs: z.array(ViewTabSchema).optional().describe('Tab definitions for multi-tab view interface'),\n\n /** Add Record (Airtable Interface parity) */\n addRecord: AddRecordConfigSchema.optional().describe('Add record entry point configuration'),\n\n /** Record Count Display (Airtable Interface parity) */\n showRecordCount: z.boolean().optional().describe('Show record count at the bottom of the list'),\n\n /** Advanced: Allow Printing (Airtable Interface parity) */\n allowPrinting: z.boolean().optional().describe('Allow users to print the view'),\n\n /** Empty State */\n emptyState: z.object({\n title: I18nLabelSchema.optional(),\n message: I18nLabelSchema.optional(),\n icon: z.string().optional(),\n }).optional().describe('Empty state configuration when no records found'),\n\n /** ARIA accessibility attributes */\n aria: AriaPropsSchema.optional().describe('ARIA accessibility attributes for the list view'),\n\n /** Responsive layout overrides per breakpoint */\n responsive: ResponsiveConfigSchema.optional().describe('Responsive layout configuration'),\n\n /** Performance optimization settings */\n performance: PerformanceConfigSchema.optional().describe('Performance optimization settings'),\n}));\n\n/**\n * Form Field Configuration Schema\n * Detailed configuration for individual form fields.\n * \n * Reuses Data.FieldType and related constraints from the Data protocol to avoid duplication.\n * The `type` field auto-infers widget rendering; explicit `widget` overrides are only needed\n * for custom components.\n * \n * @example Auto-inferred select widget\n * { field: 'status', type: 'select', options: [{ label: 'Open', value: 'open' }] }\n * \n * @example Lookup field with reference\n * { field: 'account_id', type: 'lookup', reference: 'account', label: 'Account' }\n * \n * @example Custom widget override\n * { field: 'filter', widget: 'filter-builder' }\n */\nexport const FormFieldSchema: z.ZodType<any> = lazySchema(() => z.object({\n /** Field name (snake_case) */\n field: z.string().describe('Field name (snake_case)'),\n \n /** Field type — reuses Data.FieldType. When set, widget is auto-inferred (can be overridden). */\n type: FieldType.optional().describe('Field type (auto-infers widget if omitted)'),\n \n /** Select/multiselect options — only needed when type=select/multiselect/radio/checkboxes */\n options: z.array(SelectOptionSchema).optional().describe('Options for select/multiselect/radio/checkboxes fields'),\n \n /** Reference object for lookup/master_detail fields */\n reference: z.string().optional().describe('Target object name for lookup/master_detail fields'),\n \n /** Text constraints */\n maxLength: z.number().optional().describe('Maximum character length (for text/textarea/email/url/phone)'),\n minLength: z.number().optional().describe('Minimum character length'),\n \n /** Number constraints */\n min: z.number().optional().describe('Minimum value (for number/currency/percent/slider)'),\n max: z.number().optional().describe('Maximum value'),\n precision: z.number().optional().describe('Total digits (for number/currency)'),\n scale: z.number().optional().describe('Decimal places'),\n \n /** Multi-value flag */\n multiple: z.boolean().optional().describe('Allow multiple values (for select/lookup/file/image)'),\n \n /** UI overrides */\n label: I18nLabelSchema.optional().describe('Display label override'),\n placeholder: I18nLabelSchema.optional().describe('Placeholder text'),\n helpText: I18nLabelSchema.optional().describe('Help/hint text'),\n readonly: z.boolean().optional().describe('Read-only override'),\n immutable: z.boolean().optional().describe('Editable on create, locked once the record exists (e.g. machine names).'),\n required: z.boolean().optional().describe('Required override'),\n hidden: z.boolean().optional().describe('Hidden override'),\n colSpan: z.number().int().min(1).max(4).optional().describe('[legacy — prefer `span`] Absolute column span (1-4). Fragile when the column count is derived per surface (mobile 1 / modal 2 / page 3-4): a fixed span only lines up at the width the author imagined. The renderer clamps it to the current column count. Prefer `span`.'),\n /**\n * [#2578] Relative field width — decoupled from the (often auto-derived)\n * column count, so it stays correct at 1/2/3/4 columns.\n */\n span: z.enum(['auto', 'full']).default('auto').describe(\"Relative field width. 'auto' (default — omit it): the renderer sizes the field from its widget type × the current column count (wide widgets like textarea/richtext/json/file/subform take the whole row). 'full': whole row at any column count. Prefer this over the absolute `colSpan`.\"),\n\n /** Custom widget override — only needed when auto-inference is insufficient */\n widget: z.string().optional().describe('Custom widget/component name (overrides type-based inference)'),\n\n /** For `code` fields: source language (e.g. 'javascript', 'sql', 'json', 'typescript', 'expression', 'cel'). Drives syntax highlighting. */\n language: z.string().optional().describe('Code editor language (for type=code)'),\n\n /**\n * Sub-fields for `composite` / `repeater` / `record` types — declares\n * the inner shape of an embedded sub-object (composite), each row of\n * an embedded sub-object array (repeater), or each entry of a name-keyed\n * map (record). Recursive: any of the three can nest.\n *\n * Use `lookup` / `master_detail` instead when the children are independent\n * records with their own IDs in a separate object/table.\n */\n fields: z.array(z.lazy(() => FormFieldSchema)).optional()\n .describe('Sub-fields for composite/repeater/record types'),\n\n /**\n * For `record`-typed fields only. Declares how the map key is sourced,\n * displayed, and validated when an admin creates a new entry.\n *\n * The same identifier is also stored as `name` on the inner value (so\n * `record.fields[k].name === k`). Most callers can omit this and accept\n * the defaults: `{ field: 'name', label: 'Name', regex: /^[a-z_][a-z0-9_]*$/, immutable: true }`.\n *\n * See ADR-0007 (record form field type).\n */\n keyField: z.object({\n field: z.string().default('name').describe('Property name that holds the key inside each item (defaults to \"name\")'),\n label: I18nLabelSchema.optional().describe('Display label for the key column'),\n placeholder: I18nLabelSchema.optional().describe('Placeholder when entering a new key'),\n helpText: I18nLabelSchema.optional().describe('Help text under the key input'),\n /** Validation pattern serialised as a regex source string (no flags). */\n regex: z.string().optional().describe('JS regex source string the key must match (no flags)'),\n /** Renamable after creation? Defaults to false — keys are usually identifiers. */\n immutable: z.boolean().default(true).describe('If true, the key is read-only after creation'),\n }).optional().describe('Key column config for record-typed fields'),\n\n dependsOn: z.string().optional().describe('Parent field name for cascading'),\n visibleOn: ExpressionInputSchema.optional().describe('Visibility predicate (CEL).'),\n disclosure: z.enum(['inline', 'popover']).optional().describe('Composite rendering: inline bordered box (default) or a summary line + gear popover (progressive disclosure).'),\n}));\n\n/**\n * Form Layout Section\n */\nexport const FormSectionSchema = lazySchema(() => z.object({\n /**\n * Stable identifier for translation lookup. snake_case convention.\n * When provided, translation bundles can target this section's `label`\n * and `description` via `metadataForms.<type>.sections.<name>`.\n * Optional for backward-compat with sections that only have a `label`.\n */\n name: z.string().optional().describe('Stable section identifier for i18n lookup (snake_case)'),\n label: I18nLabelSchema.optional(),\n description: z.string().optional().describe('Optional description rendered under the section header.'),\n collapsible: z.boolean().default(false),\n collapsed: z.boolean().default(false),\n visibleOn: ExpressionInputSchema.optional().describe('Visibility predicate (CEL). Hides the whole section when false.'),\n columns: z.union([\n z.enum(['1', '2', '3', '4']),\n z.literal(1),\n z.literal(2),\n z.literal(3),\n z.literal(4),\n ]).default(1).transform(val => (typeof val === 'string' ? parseInt(val) : val) as 1 | 2 | 3 | 4),\n fields: z.array(z.union([\n z.string(), // Legacy: simple field name\n FormFieldSchema, // Enhanced: detailed field config\n ])),\n}));\n\n/**\n * Form View Schema\n * Defines the layout for creating or editing a single record.\n * \n * @example Simple Sectioned Form\n * {\n * type: \"simple\",\n * sections: [\n * {\n * label: \"General Info\",\n * columns: 2,\n * fields: [\"name\", \"status\"]\n * },\n * {\n * label: \"Details\",\n * fields: [\"description\", { field: \"priority\", widget: \"rating\" }]\n * }\n * ]\n * }\n */\nexport const FormViewSchema = lazySchema(() => z.object({\n type: z.enum([\n 'simple', // Single column or sections\n 'tabbed', // Tabs\n 'wizard', // Step by step\n 'split', // Master-Detail split\n 'drawer', // Side panel\n 'modal' // Dialog\n ]).default('simple'),\n\n // --- Presentation options (per `type` variant). These mirror what the\n // ObjectForm component accepts so the protocol declares them; all optional. ---\n /** Field layout within the form body. */\n layout: z.enum(['vertical', 'horizontal', 'inline', 'grid']).optional().describe('Field layout direction'),\n /** Number of columns for the form body (grid/multi-column layouts). */\n columns: z.number().int().min(1).optional().describe('Number of columns for the form body'),\n /** Optional form title / description (for embedded or standalone forms). */\n title: z.string().optional().describe('Form title'),\n description: z.string().optional().describe('Form description'),\n /** Tabbed (`type: 'tabbed'`). */\n defaultTab: z.string().optional().describe('Initially active tab (tabbed forms)'),\n tabPosition: z.enum(['top', 'bottom', 'left', 'right']).optional().describe('Tab strip position (tabbed forms)'),\n /** Wizard (`type: 'wizard'`). */\n allowSkip: z.boolean().optional().describe('Allow skipping steps (wizard forms)'),\n showStepIndicator: z.boolean().optional().describe('Show the step indicator (wizard forms)'),\n /** Split (`type: 'split'`). */\n splitDirection: z.enum(['horizontal', 'vertical']).optional().describe('Split orientation (split forms)'),\n splitSize: z.number().optional().describe('Primary split panel size, % (split forms)'),\n splitResizable: z.boolean().optional().describe('Whether the split is resizable (split forms)'),\n /** Drawer (`type: 'drawer'`). */\n drawerSide: z.enum(['top', 'bottom', 'left', 'right']).optional().describe('Drawer side (drawer forms)'),\n /** @deprecated [#2578 → `modalSize` / size buckets] A pixel width can't be authored blind (unknown client viewport); the renderer derives width from content + viewport. */\n drawerWidth: z.string().optional().describe('[DEPRECATED → size buckets] Drawer width, e.g. \"480px\". A pixel width cannot be chosen without knowing the client viewport — the renderer derives it.'),\n /** Modal (`type: 'modal'`). */\n modalSize: z.enum(['sm', 'default', 'lg', 'xl', 'full']).optional().describe('Modal size (modal forms)'),\n\n /** Data Source Configuration */\n data: ViewDataSchema.optional().describe('Data source configuration (defaults to \"object\" provider)'),\n \n sections: z.array(FormSectionSchema).optional(), // For simple layout\n groups: z.array(FormSectionSchema).optional(), // Legacy support -> alias to sections\n\n /**\n * Inline child collections (master-detail). When present, the standard\n * create/edit form for this object renders as a master-detail form — the\n * object's own fields on top, an editable grid per child collection below,\n * persisted together in ONE atomic transaction — with no bespoke page. Each\n * entry needs only `childObject`; the relationship FK and grid columns are\n * derived from the child object's metadata (override via\n * `relationshipField` / `columns`).\n */\n subforms: z.array(z.object({\n childObject: z.string().describe('Child object whose records are entered inline'),\n relationshipField: z.string().optional().describe('FK on the child pointing back to the parent (auto-detected when omitted)'),\n columns: z.array(z.any()).optional().describe('Editable grid columns (derived from the child object when omitted)'),\n amountField: z.string().optional().describe('Numeric child column summed for the running total'),\n totalField: z.string().optional().describe('Parent field to receive the rolled-up sum'),\n title: z.string().optional().describe('Section title'),\n addLabel: z.string().optional().describe('Add-row button label'),\n minRows: z.number().optional(),\n maxRows: z.number().optional(),\n })).optional().describe('Inline master-detail child collections'),\n\n /** Default Sort for Related Lists (e.g., sort child records by date) */\n defaultSort: z.array(z.object({\n field: z.string().describe('Field name to sort by'),\n order: z.enum(['asc', 'desc']).default('desc').describe('Sort direction'),\n })).optional().describe('Default sort order for related list views within this form'),\n\n /** Public form sharing configuration */\n sharing: SharingConfigSchema.optional().describe('Public sharing configuration for this form'),\n\n /**\n * What happens after a successful submit.\n *\n * - `thank-you` (default) — show a confirmation panel\n * - `redirect` — send the browser to a URL\n * - `continue` — reset the form so another response can be entered\n * - `next-record` — advance to the next record (internal queues only)\n */\n submitBehavior: z.union([\n z.object({\n kind: z.literal('thank-you'),\n title: z.string().optional(),\n message: z.string().optional(),\n }),\n z.object({\n kind: z.literal('redirect'),\n url: z.string(),\n delayMs: z.number().int().min(0).optional(),\n }),\n z.object({ kind: z.literal('continue') }),\n z.object({ kind: z.literal('next-record') }),\n ]).optional().describe('Post-submit behavior'),\n\n /** ARIA accessibility attributes */\n aria: AriaPropsSchema.optional().describe('ARIA accessibility attributes for the form view'),\n}));\n\n/**\n * ADR-0053 \"views\" mode — an object's default list + named list views.\n *\n * Structurally a {@link ListViewSchema} MINUS the page-only control `userFilters`:\n * that field belongs to a page list (`InterfaceListPage`, \"filters\" mode), never an\n * object list view, whose only nav control is the `ViewTabBar`. Omitting the field\n * makes the wrong-context state untypable at author time (tsc). Runtime parse still\n * STRIPS an authored `userFilters` silently (default strip, no throw) for back-compat,\n * and the CLI `validate` list-view-mode rule reports it pre-parse. See objectui #2219\n * and ADR-0053 phase 4.\n */\nexport const ObjectListViewSchema = lazySchema(() => ListViewSchema.omit({ userFilters: true }));\n\n/**\n * Master View Schema\n * Can define multiple named views.\n */\n/**\n * View Container Schema\n * Aggregates all view definitions for a specific object or context.\n * \n * @example\n * {\n * list: { type: \"grid\", columns: [\"name\"] },\n * form: { type: \"simple\", fields: [\"name\"] },\n * listViews: {\n * \"all\": { label: \"All\", filter: [] },\n * \"my\": { label: \"Mine\", filter: [[\"owner\", \"=\", \"{user_id}\"]] }\n * }\n * }\n */\nexport const ViewSchema = lazySchema(() => z.object({\n list: ObjectListViewSchema.optional(), // Default list view (views mode — no userFilters, ADR-0053)\n form: FormViewSchema.optional(), // Default form view\n listViews: z.record(z.string(), ObjectListViewSchema).optional().describe('Additional named list views (views mode — no userFilters, ADR-0053)'),\n formViews: z.record(z.string(), FormViewSchema).optional().describe('Additional named form views'),\n /**\n * ADR-0010 §3.7 — Package-level protection envelope. Package\n * authors declare lock policy here; the loader translates it\n * into the private `_lock` envelope at registration time and\n * strips this block before persistence. See\n * `shared/protection.zod.ts`.\n */\n protection: ProtectionSchema.optional().describe(\n 'Package author protection block — lock policy for this view.',\n ),\n\n // ADR-0010 — runtime protection envelope (internal — set by loader).\n ...MetadataProtectionFields,\n\n}));\n\n/**\n * Type-safe factory for creating view definitions.\n *\n * Validates the config at creation time using Zod `.parse()`.\n *\n * @example\n * ```ts\n * const taskViews = defineView({\n * list: {\n * type: 'grid',\n * data: { provider: 'object', object: 'task' },\n * columns: ['subject', 'status', 'priority', 'due_date'],\n * },\n * form: {\n * type: 'simple',\n * sections: [{ label: 'Details', fields: [{ field: 'subject' }] }],\n * },\n * });\n * ```\n */\nexport function defineView(config: z.input<typeof ViewSchema>): View {\n return ViewSchema.parse(config);\n}\n\n// ───────────────────────────────────────────────────────────────────────────\n// Independent View Item model (Object has-many View)\n// ───────────────────────────────────────────────────────────────────────────\n//\n// The {@link ViewSchema} *container* above aggregates every view of an object\n// into one document. That model cannot express runtime-authored views (a user\n// adding \"My high-value leads\" at runtime cannot append to a developer's source\n// file), and it forces multiple distinct views into a single designer.\n//\n// {@link ViewItemSchema} promotes each named view to a first-class, independently\n// addressable entity bound to its object by a foreign key. The object↔view\n// switcher is then a *query* (`getViewsByObject`) rather than embedded storage —\n// mirroring Airtable / Salesforce / Notion, where a table/object has-many views.\n//\n// `defineView` is retained as authoring sugar: the backend loader expands an\n// aggregated document into N ViewItems at registration time, so existing\n// `*.view.ts` files and the published spec keep working unchanged.\n\n/**\n * Qualified view-item identity: `<object>.<viewKey>` — dotted snake_case\n * segments, e.g. `crm_lead.pipeline`. Globally unique, and the object can be\n * recovered from the prefix, so the registry key never collides across objects.\n */\nexport const ViewItemNameSchema = z\n .string()\n .regex(\n /^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$/,\n 'View item name must be a dotted snake_case qualified name, e.g. \"crm_lead.pipeline\".',\n )\n .describe('Globally-unique view id, `<object>.<viewKey>`.');\n\n/**\n * Identity layer for a view item — its visibility scope and ownership.\n *\n * - `package` — shipped from `*.view.ts` source / an installed package.\n * Not deletable (reinstall restores it); customisable via an\n * override layer; hideable from the switcher.\n * - `shared` — authored at runtime, visible org-wide. Creating one is gated\n * by the `view.manageShared` capability.\n * - `personal` — authored at runtime, scoped to `owner`. Any user with read\n * access to the object may create one.\n *\n * Named `scope` (not `provenance`) to avoid colliding with the loader-set\n * `_provenance` envelope field, which tracks a different axis\n * (package | org | env-forced).\n */\nexport const ViewScopeSchema = z\n .enum(['package', 'shared', 'personal'])\n .describe('View identity layer: package | shared | personal.');\n\n/** Discriminator for the kind of view a {@link ViewItemSchema} carries. */\nexport const ViewKindSchema = z\n .enum(['list', 'form'])\n .describe('Whether `config` is a ListView (list family) or a FormView.');\n\n/**\n * Fields shared by every independent view item, regardless of kind. Returned\n * as a raw Zod shape so it composes into each discriminated-union member\n * without forcing eager schema construction.\n */\nfunction viewItemBaseShape() {\n return {\n name: ViewItemNameSchema,\n object: z\n .string()\n .describe('Bound object name — the foreign key used to aggregate views.'),\n label: I18nLabelSchema.optional().describe('Display label (supports i18n).'),\n isDefault: z\n .boolean()\n .optional()\n .describe(\"Whether this is the object's default view in the switcher.\"),\n order: z\n .number()\n .int()\n .optional()\n .describe(\"Sort order within the object's view switcher / left rail.\"),\n scope: ViewScopeSchema.optional().describe(\n 'Identity layer (defaults to `package` for source-loaded views).',\n ),\n owner: z\n .string()\n .optional()\n .describe('Owner user id — set when `scope` is `personal`.'),\n hidden: z\n .boolean()\n .optional()\n .describe('Hidden from the switcher (per-user / per-org declutter).'),\n /**\n * Package author protection block — same envelope as {@link ViewSchema};\n * the loader translates it into the private `_lock` envelope.\n */\n protection: ProtectionSchema.optional().describe(\n 'Package author protection block — lock policy for this view.',\n ),\n // ADR-0010 — runtime protection envelope (internal — set by loader).\n ...MetadataProtectionFields,\n };\n}\n\n/**\n * Independent View Item — a single named view bound to one object.\n *\n * Discriminated on `viewKind`: a `list` item carries a {@link ListViewSchema}\n * config (grid / kanban / calendar / …), a `form` item carries a\n * {@link FormViewSchema} config.\n *\n * @example\n * ```ts\n * const pipeline = defineViewItem({\n * name: 'crm_lead.pipeline',\n * object: 'crm_lead',\n * viewKind: 'list',\n * label: 'Pipeline',\n * config: {\n * type: 'kanban',\n * data: { provider: 'object', object: 'crm_lead' },\n * columns: ['name', 'stage', 'amount'],\n * },\n * });\n * ```\n */\nexport const ViewItemSchema = lazySchema(() =>\n z.discriminatedUnion('viewKind', [\n z.object({\n viewKind: z.literal('list'),\n config: ListViewSchema.describe('List-family view configuration.'),\n ...viewItemBaseShape(),\n }),\n z.object({\n viewKind: z.literal('form'),\n config: FormViewSchema.describe('Form view configuration.'),\n ...viewItemBaseShape(),\n }),\n ]),\n);\n\n/**\n * Type-safe factory for an independent {@link ViewItem}.\n *\n * Validates the config at creation time using Zod `.parse()`.\n *\n * @example\n * ```ts\n * const allLeads = defineViewItem({\n * name: 'crm_lead.all',\n * object: 'crm_lead',\n * viewKind: 'list',\n * isDefault: true,\n * config: { type: 'grid', data: { provider: 'object', object: 'crm_lead' }, columns: ['name'] },\n * });\n * ```\n */\nexport function defineViewItem(config: z.input<typeof ViewItemSchema>): ViewItem {\n return ViewItemSchema.parse(config);\n}\n\n// ───────────────────────────────────────────────────────────────────────────\n// defineView container → ViewItem expansion (shared by every loader)\n//\n// `defineView({ list, form, listViews, formViews })` aggregates an object's\n// views into one document. Each registration path that ingests such a\n// container (the ObjectQL engine boot loop AND the metadata HMR plugin) must\n// expand it into N independent ViewItems registered under `<object>.<viewKey>`,\n// so each view is individually addressable and `getViewsByObject()` can rebuild\n// the switcher. The original container is ALSO kept under the bare `<object>`\n// key for backward-compatible reads. This logic lives in `@objectstack/spec`\n// (depended on by both objectql and metadata) so the two loaders cannot drift.\n\n/** A ViewItem materialised from an aggregated container (always `package`). */\nexport interface ExpandedViewItem {\n name: string;\n object: string;\n viewKind: 'list' | 'form';\n label?: unknown;\n config: any;\n isDefault?: boolean;\n order: number;\n scope: 'package';\n /** Non-blocking expansion diagnostics (MetadataValidationResult wire shape).\n * Present only when the item's name had to be rewritten to avoid a\n * collision — loaders surface `warnings` in their boot/HMR logs and\n * Studio can badge the view. */\n _diagnostics?: { valid: boolean; warnings: Array<{ path: string; message: string }> };\n}\n\n/** True when a raw view artifact still uses the aggregated container shape\n * (and is not already an independent ViewItem, which carries `viewKind`). */\nexport function isAggregatedViewContainer(item: any): boolean {\n if (!item || typeof item !== 'object') return false;\n if (item.viewKind) return false; // already an independent ViewItem\n return Boolean(item.list || item.form || item.listViews || item.formViews);\n}\n\n/** Structural signature used to collapse a container's default `list`/`form`\n * with a redundant `listViews`/`formViews` restatement of the same view (the\n * common \"default == listViews.all\" authoring pattern). */\nfunction viewSignature(v: any): string {\n if (!v || typeof v !== 'object') return '';\n try {\n return JSON.stringify({ type: v.type ?? null, label: v.label ?? null, columns: v.columns ?? null });\n } catch {\n return '';\n }\n}\n\n/** Allocate a collision-free `<object>.<key>` name within one expansion. */\nfunction uniqueViewName(base: string, used: Set<string>): string {\n let name = base;\n let i = 2;\n while (used.has(name)) name = `${base}_${i++}`;\n used.add(name);\n return name;\n}\n\n/** Stamp a rename warning on an expanded item whose `<object>.<key>` name was\n * already taken (e.g. `formViews.default` vs the implicit default `list`).\n * The rename itself is kept for backward compatibility — this makes it LOUD:\n * loaders log the warning and Studio can render it, so authors discover that\n * references to the requested name (form action `target`s, navigation\n * `viewName`s) resolve to a DIFFERENT view. */\nfunction stampRenameWarning(item: ExpandedViewItem, requestedName: string): void {\n if (item.name === requestedName) return;\n item._diagnostics = {\n valid: true,\n warnings: [{\n path: 'name',\n message:\n `View key collision: '${requestedName}' is already registered by another view in this `\n + `defineView container (list and form views share one '<object>.<key>' namespace, and the `\n + `default 'list' implicitly claims '<object>.default'). This ${item.viewKind} view was `\n + `renamed to '${item.name}'. References targeting '${requestedName}' — form action `\n + `targets, navigation viewNames — will resolve to the OTHER view. Rename the view key `\n + `to something unique to remove this warning.`,\n }],\n };\n}\n\nfunction cloneViewConfig(v: any): any {\n try {\n return structuredClone(v);\n } catch {\n return JSON.parse(JSON.stringify(v));\n }\n}\n\n/**\n * A view-key collision detected while expanding one `defineView` container.\n *\n * List and form views share a single `<object>.<key>` namespace during\n * expansion (see {@link expandViewContainer}), and the default `list`\n * implicitly claims `<object>.default`. When a later view competes for a name\n * already taken, it is renamed (`<object>.<key>` → `<object>.<key>_2`) to keep\n * the runtime registry key unique. That rename is a silent footgun: references\n * to the requested name (form action `target`s, navigation `viewName`s) resolve\n * to the OTHER view. The build-time view-ref lint turns each collision into a\n * hard error so the author fixes the key instead of shipping a broken reference.\n */\nexport interface ViewKeyCollision {\n /** The `<object>.<key>` name that was already registered by an earlier view. */\n requested: string;\n /** The disambiguated name the colliding view was renamed to (e.g. `…_2`). */\n renamedTo: string;\n /** Which family the renamed (losing) view belongs to. */\n viewKind: 'list' | 'form';\n /** The raw author-supplied key that collided. */\n key: string;\n}\n\n/** Result of {@link expandViewContainerWithDiagnostics}. */\nexport interface ExpandViewResult {\n items: ExpandedViewItem[];\n collisions: ViewKeyCollision[];\n}\n\n/**\n * Expand an aggregated view container into independent ViewItems, ALSO reporting\n * every name collision that forced a rename.\n *\n * List family: `listViews` entries first (keys taken from the author), then the\n * default `list` — deduped by structural signature so a `listViews.all` that\n * merely restates `list` collapses into one item. The view matching the\n * declared default is flagged `isDefault`. Form family: `formViews` entries,\n * then the default `form`.\n *\n * Collisions are captured at the exact points the shared `used` set forces a\n * rename, so the diagnostic can never drift from the expansion it describes.\n */\nexport function expandViewContainerWithDiagnostics(object: string, container: any): ExpandViewResult {\n const out: ExpandedViewItem[] = [];\n const collisions: ViewKeyCollision[] = [];\n const used = new Set<string>();\n let order = 0;\n\n // ---- list family ----\n const listSigToName = new Map<string, string>();\n const listViews =\n container.listViews && typeof container.listViews === 'object' ? container.listViews : {};\n for (const [k, v] of Object.entries<any>(listViews)) {\n if (!v || typeof v !== 'object') continue;\n const requested = `${object}.${k}`;\n const name = uniqueViewName(requested, used);\n if (name !== requested) collisions.push({ requested, renamedTo: name, viewKind: 'list', key: k });\n listSigToName.set(viewSignature(v), name);\n const item: ExpandedViewItem = { name, object, viewKind: 'list', label: v.label, config: cloneViewConfig(v), order: order++, scope: 'package' };\n stampRenameWarning(item, requested);\n out.push(item);\n }\n const defaultList = container.list;\n let defaultListName: string | undefined;\n if (defaultList && typeof defaultList === 'object') {\n const dup = listSigToName.get(viewSignature(defaultList));\n if (dup) {\n defaultListName = dup; // already represented by a named listViews entry\n } else {\n const key = typeof defaultList.name === 'string' && defaultList.name ? defaultList.name : 'default';\n const requested = `${object}.${key}`;\n const name = uniqueViewName(requested, used);\n if (name !== requested) collisions.push({ requested, renamedTo: name, viewKind: 'list', key });\n const item: ExpandedViewItem = { name, object, viewKind: 'list', label: defaultList.label, config: cloneViewConfig(defaultList), order: order++, scope: 'package' };\n stampRenameWarning(item, requested);\n out.push(item);\n defaultListName = name;\n }\n }\n if (!defaultListName && out.length) defaultListName = out[0].name;\n for (const item of out) {\n if (item.viewKind === 'list' && item.name === defaultListName) item.isDefault = true;\n }\n\n // ---- form family ----\n const formStart = out.length;\n const formSigSeen = new Set<string>();\n const formViews =\n container.formViews && typeof container.formViews === 'object' ? container.formViews : {};\n for (const [k, v] of Object.entries<any>(formViews)) {\n if (!v || typeof v !== 'object') continue;\n const requested = `${object}.${k}`;\n const name = uniqueViewName(requested, used);\n if (name !== requested) collisions.push({ requested, renamedTo: name, viewKind: 'form', key: k });\n formSigSeen.add(viewSignature(v));\n const item: ExpandedViewItem = { name, object, viewKind: 'form', label: v.label, config: cloneViewConfig(v), order: order++, scope: 'package' };\n stampRenameWarning(item, requested);\n out.push(item);\n }\n const defaultForm = container.form;\n let defaultFormName: string | undefined;\n if (defaultForm && typeof defaultForm === 'object' && !formSigSeen.has(viewSignature(defaultForm))) {\n const key = typeof defaultForm.name === 'string' && defaultForm.name ? defaultForm.name : 'form';\n const requested = `${object}.${key}`;\n const name = uniqueViewName(requested, used);\n if (name !== requested) collisions.push({ requested, renamedTo: name, viewKind: 'form', key });\n const item: ExpandedViewItem = { name, object, viewKind: 'form', label: defaultForm.label, config: cloneViewConfig(defaultForm), order: order++, scope: 'package' };\n stampRenameWarning(item, requested);\n out.push(item);\n defaultFormName = name;\n }\n if (!defaultFormName && out.length > formStart) defaultFormName = out[formStart].name;\n for (let i = formStart; i < out.length; i++) {\n if (out[i].name === defaultFormName) out[i].isDefault = true;\n }\n\n return { items: out, collisions };\n}\n\n/**\n * Expand an aggregated view container into independent ViewItems.\n *\n * Thin wrapper over {@link expandViewContainerWithDiagnostics} that discards the\n * collision diagnostics — the shape every runtime loader consumes. Behaviour is\n * unchanged: colliding names are still renamed so the registry key stays unique.\n */\nexport function expandViewContainer(object: string, container: any): ExpandedViewItem[] {\n return expandViewContainerWithDiagnostics(object, container).items;\n}\n\n/**\n * Type-safe factory for a standalone {@link FormView} bound to a JSON Schema\n * rather than to an ObjectQL object.\n *\n * Use this for forms that edit **metadata** (e.g. `report.form.ts`,\n * `dashboard.form.ts`), **action inputs**, or **flow screens** — anywhere the\n * data shape is described by a Zod-derived JSON Schema instead of an Object\n * field set.\n *\n * The returned FormView is validated at definition time; the runtime form\n * renderer (`@object-ui/plugin-form`) inspects `data.provider === 'schema'`\n * and pulls field metadata from the resolved JSON Schema instead of from\n * ObjectQL.\n *\n * @example\n * ```ts\n * export const reportForm = defineForm({\n * schemaId: 'report',\n * type: 'tabbed',\n * sections: [\n * { label: 'Basics', columns: 2, fields: [\n * { field: 'name' },\n * { field: 'label' },\n * { field: 'objectName', widget: 'ref:object' },\n * { field: 'type' },\n * ]},\n * { label: 'Columns', fields: [{ field: 'columns', widget: 'master-detail' }] },\n * { label: 'Advanced', collapsible: true, collapsed: true, fields: [\n * { field: 'filter', widget: 'filter-builder' },\n * { field: 'chart', widget: 'chart-config' },\n * ]},\n * ],\n * });\n * ```\n */\nexport function defineForm(\n config: Omit<z.input<typeof FormViewSchema>, 'data'> & { schemaId: string },\n): FormView {\n const { schemaId, ...rest } = config;\n return FormViewSchema.parse({\n ...rest,\n data: { provider: 'schema', schemaId },\n });\n}\n\nexport type View = z.infer<typeof ViewSchema>;\nexport type ViewItem = z.infer<typeof ViewItemSchema>;\nexport type ViewScope = z.infer<typeof ViewScopeSchema>;\nexport type ViewKind = z.infer<typeof ViewKindSchema>;\nexport type ListView = z.infer<typeof ListViewSchema>;\nexport type FormView = z.infer<typeof FormViewSchema>;\nexport type FormSection = z.infer<typeof FormSectionSchema>;\nexport type ListColumn = z.infer<typeof ListColumnSchema>;\nexport type FormField = z.infer<typeof FormFieldSchema>;\nexport type SelectionConfig = z.infer<typeof SelectionConfigSchema>;\nexport type NavigationConfig = z.infer<typeof NavigationConfigSchema>;\nexport type PaginationConfig = z.infer<typeof PaginationConfigSchema>;\nexport type ViewData = z.infer<typeof ViewDataSchema>;\nexport type HttpRequest = z.infer<typeof HttpRequestSchema>;\nexport type HttpMethod = z.infer<typeof HttpMethodSchema>;\nexport type ColumnSummary = z.infer<typeof ColumnSummarySchema>;\nexport type RowHeight = z.infer<typeof RowHeightSchema>;\nexport type GroupingConfig = z.infer<typeof GroupingConfigSchema>;\nexport type GalleryConfig = z.infer<typeof GalleryConfigSchema>;\nexport type TimelineConfig = z.infer<typeof TimelineConfigSchema>;\nexport type ListChartConfig = z.infer<typeof ListChartConfigSchema>;\nexport type ViewSharing = z.infer<typeof ViewSharingSchema>;\nexport type RowColorConfig = z.infer<typeof RowColorConfigSchema>;\nexport type VisualizationType = z.infer<typeof VisualizationTypeSchema>;\nexport type UserActionsConfig = z.infer<typeof UserActionsConfigSchema>;\nexport type AppearanceConfig = z.infer<typeof AppearanceConfigSchema>;\nexport type ViewTab = z.infer<typeof ViewTabSchema>;\nexport type UserFilterField = z.infer<typeof UserFilterFieldSchema>;\nexport type UserFilters = z.infer<typeof UserFiltersSchema>;\nexport type AddRecordConfig = z.infer<typeof AddRecordConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FieldSchema } from './field.zod';\nimport { ValidationRuleSchema } from './validation.zod';\nimport { ActionSchema } from '../ui/action.zod';\nimport { ObjectListViewSchema } from '../ui/view.zod';\n\n/**\n * API Operations Enum\n */\nimport { TemplateExpressionInputSchema } from '../shared/expression.zod';\nimport { lazySchema } from '../shared/lazy-schema';\nimport { MetadataProtectionFields } from '../kernel/metadata-protection.zod';\nimport { ProtectionSchema } from '../shared/protection.zod';\nexport const ApiMethod = z.enum([\n 'get', 'list', // Read\n 'create', 'update', 'delete', // Write\n 'upsert', // Idempotent Write\n 'bulk', // Batch operations\n 'aggregate', // Analytics (count, sum)\n 'history', // Audit access\n 'search', // Search access\n 'restore', 'purge', // Trash management\n 'import', 'export', // Data portability\n]);\nexport type ApiMethod = z.infer<typeof ApiMethod>;\n\n/**\n * Capability Flags\n * Defines what system features are enabled for this object.\n * \n * Optimized based on industry standards (Salesforce, ServiceNow):\n * - Added `activities` (Tasks/Events)\n * - Added `mru` (Recent Items)\n * - Added `feeds` (Social/Chatter)\n * - Grouped API permissions\n * \n * @example\n * {\n * trackHistory: true,\n * searchable: true,\n * apiEnabled: true,\n * files: true\n * }\n */\nexport const ObjectCapabilities = z.object({\n /** Enable history tracking (Audit Trail) */\n trackHistory: z.boolean().default(false).describe('Enable field history tracking for audit compliance'),\n \n /** Enable global search indexing */\n searchable: z.boolean().default(true).describe('Index records for global search'),\n \n /** Enable REST/GraphQL API access */\n apiEnabled: z.boolean().default(true).describe('Expose object via automatic APIs'),\n\n /** \n * API Supported Operations\n * Granular control over API exposure.\n */\n apiMethods: z.array(ApiMethod).optional().describe('Whitelist of allowed API operations'),\n \n /** Enable standard attachments/files engine */\n files: z.boolean().default(false).describe('Enable file attachments and document management'),\n \n /** Enable social collaboration (Comments, Mentions, Feeds) */\n feeds: z.boolean().default(false).describe('Enable social feed, comments, and mentions (Chatter-like)'),\n \n /** Enable standard Activity suite (Tasks, Calendars, Events) */\n activities: z.boolean().default(false).describe('Enable standard tasks and events tracking'),\n\n /** Enable Recycle Bin / Soft Delete */\n trash: z.boolean().default(true).describe('Enable soft-delete with restore capability'),\n\n /** Enable \"Recently Viewed\" tracking */\n mru: z.boolean().default(true).describe('Track Most Recently Used (MRU) list for users'),\n \n /** Allow cloning records */\n clone: z.boolean().default(true).describe('Allow record deep cloning'),\n});\n\n/**\n * Schema for database indexes.\n * Enhanced with additional index types and configuration options\n * \n * @example\n * {\n * name: \"idx_account_name\",\n * fields: [\"name\"],\n * type: \"btree\",\n * unique: true\n * }\n */\nexport const IndexSchema = lazySchema(() => z.object({\n name: z.string().optional().describe('Index name (auto-generated if not provided)'),\n fields: z.array(z.string()).describe('Fields included in the index'),\n type: z.enum(['btree', 'hash', 'gin', 'gist', 'fulltext']).optional().default('btree').describe('Index algorithm type'),\n unique: z.boolean().optional().default(false).describe('Whether the index enforces uniqueness'),\n partial: z.string().optional().describe('Partial index condition (SQL WHERE clause for conditional indexes)'),\n}));\n\n/**\n * Search Configuration\n * Defines how this object behaves in search results.\n * \n * @example\n * {\n * fields: [\"name\", \"email\", \"phone\"],\n * displayFields: [\"name\", \"title\"],\n * filters: [\"status = 'active'\"]\n * }\n */\nexport const SearchConfigSchema = lazySchema(() => z.object({\n fields: z.array(z.string()).describe('Fields to index for full-text search weighting'),\n displayFields: z.array(z.string()).optional().describe('Fields to display in search result cards'),\n filters: z.array(z.string()).optional().describe('Default filters for search results'),\n}));\n\n/**\n * Multi-Tenancy Configuration Schema\n * Configures tenant isolation strategy for SaaS applications\n * \n * @example Shared database with tenant_id isolation\n * {\n * enabled: true,\n * strategy: 'shared',\n * tenantField: 'tenant_id',\n * crossTenantAccess: false\n * }\n */\nexport const TenancyConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().describe('Enable multi-tenancy for this object'),\n strategy: z.enum(['shared', 'isolated', 'hybrid']).describe('Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)'),\n tenantField: z.string().default('tenant_id').describe('Field name for tenant identifier'),\n crossTenantAccess: z.boolean().default(false).describe('Allow cross-tenant data access (with explicit permission)'),\n}));\n\n/**\n * [ADR-0066 D2] Secure-by-default object posture.\n *\n * Declares whether the object participates in blanket wildcard permission\n * grants — a data-model posture like {@link TenancyConfigSchema}, NOT an\n * assignment (it names no principal).\n *\n * - `public` (default) — covered by a permission set's `'*'` wildcard object\n * grant; today's allow-by-default behaviour.\n * - `private` — NOT covered by the `'*'` wildcard grant; access requires an\n * EXPLICIT per-object grant (Salesforce \"new object = no access until\n * granted\"). A `private` object is ALSO exempt from wildcard RLS\n * (`tenant_isolation`, owner scoping): the posture-gated superuser bypass\n * (`viewAllRecords`/`modifyAllRecords`) short-circuits RLS, so a platform\n * admin — incl. one who is also an org admin whose `tenant_isolation` would\n * otherwise narrow the result — sees all rows, while non-admins without an\n * explicit grant see none.\n *\n * Pair with the object's `requiredPermissions` (D3) to additionally gate access\n * on holding a capability.\n */\nexport const ObjectAccessConfigSchema = lazySchema(() => z.object({\n default: z.enum(['public', 'private']).default('public')\n .describe('Default exposure posture: public (covered by wildcard grants) | private (needs explicit grant; exempt from wildcard RLS).'),\n}));\n\n/**\n * Soft Delete Configuration Schema\n * Implements recycle bin / trash functionality\n * \n * @example Standard soft delete with cascade\n * {\n * enabled: true,\n * field: 'deleted_at',\n * cascadeDelete: true\n * }\n */\nexport const SoftDeleteConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().describe('Enable soft delete (trash/recycle bin)'),\n field: z.string().default('deleted_at').describe('Field name for soft delete timestamp'),\n cascadeDelete: z.boolean().default(false).describe('Cascade soft delete to related records'),\n}));\n\n/**\n * Versioning Configuration Schema\n * Implements record versioning and history tracking\n * \n * @example Snapshot versioning with 90-day retention\n * {\n * enabled: true,\n * strategy: 'snapshot',\n * retentionDays: 90,\n * versionField: 'version'\n * }\n */\nexport const VersioningConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().describe('Enable record versioning'),\n strategy: z.enum(['snapshot', 'delta', 'event-sourcing']).describe('Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)'),\n retentionDays: z.number().min(1).optional().describe('Number of days to retain old versions (undefined = infinite)'),\n versionField: z.string().default('version').describe('Field name for version number/timestamp'),\n}));\n\n\n/**\n * Object Field Group Schema — MVP (data-layer protocol)\n * \n * Declares the set of logical field groups for an object. A group bundles\n * related fields together for presentation in forms, detail pages, and\n * editors (e.g., \"Contact Info\", \"Billing\", \"System\").\n * \n * Design rules (MVP):\n * - Group **order** is the declaration order of this array — no `order` property.\n * - Field → group mapping is derived automatically from `Field.group`\n * matching `ObjectFieldGroup.key`; the **in-group display order** equals\n * the traversal order of `ObjectSchema.fields`.\n * - Fields whose `group` is unset (or references an undeclared key) are\n * considered ungrouped and must be rendered by consumers in a default\n * bucket after the declared groups, preserving their field declaration order.\n * - Extension packages and runtime code use `Field.group` to assign fields\n * to an existing group — no per-field order property is introduced at this\n * layer.\n * \n * Migration operations supported by this MVP:\n * - add / rename / delete / reorder groups (via the array)\n * - assign an existing field to a group (via `Field.group`)\n * \n * Deferred (not part of MVP):\n * - explicit per-field in-group ordering\n * - nested groups / sub-groups\n * - group-level visibility predicates (a `visibleOn` key existed here\n * briefly with no consumer anywhere; removed per ADR-0085 / ADR-0049\n * enforce-or-remove — re-add together with its enforcement when a\n * surface actually evaluates it)\n *\n * Derivation semantics (declared order, empty groups dropped, ungrouped\n * trailing bucket, collapse passthrough) are single-sourced in\n * `deriveFieldGroupLayout` (field-group-layout.ts, ADR-0085 §5) — UI\n * renderers consume that helper instead of re-implementing the rules.\n *\n * @example\n * ```ts\n * fieldGroups: [\n * { key: 'contact_info', label: 'Contact Information', icon: 'user' },\n * { key: 'billing', label: 'Billing', collapse: 'collapsed' },\n * { key: 'system', label: 'System' },\n * ]\n * ```\n */\nexport const ObjectFieldGroupSchema = lazySchema(() => z.object({\n /** Group key — referenced by `Field.group` to assign a field to this group. Must be snake_case. */\n key: z.string().regex(/^[a-z_][a-z0-9_]*$/, {\n message: 'Field group key must be lowercase snake_case (e.g., \"contact_info\", \"billing\", \"system\")',\n }).describe('Group machine key (snake_case). Referenced by Field.group.'),\n\n /** Human-readable label displayed as the group header. */\n label: z.string().describe('Group display label'),\n\n /** Optional Lucide/Material icon name for the group header. */\n icon: z.string().optional().describe('Icon name (Lucide/Material) for the group header'),\n\n /** Optional description / help text shown under the group header. */\n description: z.string().optional().describe('Optional description shown under the group header'),\n\n /**\n * [ADR-0085] Collapse behaviour of the group's rendered section, on every\n * surface (form, detail, drawer). One enum, three valid states — replaces\n * the old `defaultExpanded` flag AND the UI-dialect `collapsible`/`collapsed`\n * boolean pair, which could express contradictions and had drifted between\n * spec and renderer (spec declared a key no renderer read; renderers read\n * keys the spec rejected).\n */\n collapse: z.enum(['none', 'expanded', 'collapsed']).optional().default('none')\n .describe(\"[ADR-0085] Section collapse behaviour: 'none' (always open, no toggle), 'expanded' (collapsible, starts open), 'collapsed' (collapsible, starts closed).\"),\n\n /**\n * @deprecated [ADR-0085 → `collapse`] Accepted as a parse-time alias:\n * `defaultExpanded: false` maps to `collapse: 'collapsed'`, `true` to\n * `'expanded'`, when `collapse` is absent. New metadata sets `collapse`.\n */\n defaultExpanded: z.boolean().optional().describe(\"[DEPRECATED → collapse] true → 'expanded', false → 'collapsed'.\"),\n /** @deprecated [ADR-0085 → `collapse`] UI-dialect alias (pair with `collapsed`); mapped onto `collapse` at parse. */\n collapsible: z.boolean().optional().describe(\"[DEPRECATED → collapse] Boolean pair with `collapsed`; use the `collapse` enum.\"),\n /** @deprecated [ADR-0085 → `collapse`] UI-dialect alias (pair with `collapsible`); mapped onto `collapse` at parse. */\n collapsed: z.boolean().optional().describe(\"[DEPRECATED → collapse] Boolean pair with `collapsible`; use the `collapse` enum.\"),\n}));\n\nexport type ObjectFieldGroup = z.infer<typeof ObjectFieldGroupSchema>;\nexport type ObjectFieldGroupInput = z.input<typeof ObjectFieldGroupSchema>;\n\n/**\n * Base Object Schema Definition\n * \n * The Blueprint of a Business Object.\n * Represents a table, a collection, or a virtual entity.\n * \n * @example\n * ```yaml\n * name: project_task\n * label: Project Task\n * icon: task\n * fields:\n * project:\n * type: lookup\n * reference: project\n * status:\n * type: select\n * options: [todo, in_progress, done]\n * enable:\n * trackHistory: true\n * files: true\n * ```\n */\n\n/**\n * External Binding (ADR-0015)\n *\n * Optional per-object descriptor that binds this object to a remote table\n * on a federated datasource (one whose `schemaMode !== 'managed'`). When\n * present, the object is \"external\": DDL is forbidden, the table is\n * validated against the remote schema at boot, and writes require a double\n * opt-in (`datasource.external.allowWrites` **and** this `writable`).\n *\n * The cross-field invariant (\"`external` only when the object's datasource\n * has `schemaMode !== 'managed'`\") is enforced at metadata-load time, not\n * in this schema, because the datasource may live in another artefact.\n */\nexport const ObjectExternalBindingSchema = z.object({\n remoteName: z.string().optional()\n .describe('Remote table/view name. Defaults to object.name.'),\n remoteSchema: z.string().optional()\n .describe('Remote schema/database qualifier.'),\n writable: z.boolean().default(false)\n .describe('Per-object write opt-in (also requires datasource.external.allowWrites).'),\n columnMap: z.record(z.string(), z.string()).optional()\n .describe('Remote column name → local field name.'),\n introspectedAt: z.string().datetime().optional()\n .describe('Set by `os datasource introspect`; informational.'),\n ignoreColumns: z.array(z.string()).optional()\n .describe('Remote columns to skip during validation (dev convenience).'),\n}).describe('External datasource binding (ADR-0015)');\n\nexport type ObjectExternalBinding = z.infer<typeof ObjectExternalBindingSchema>;\n\nconst ObjectSchemaBase = z.object({\n /** \n * Identity & Metadata \n */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine unique key (snake_case). Immutable.'),\n label: z.string().optional().describe('Human readable singular label (e.g. \"Account\")'),\n pluralLabel: z.string().optional().describe('Human readable plural label (e.g. \"Accounts\")'),\n description: z.string().optional().describe('Developer documentation / description'),\n icon: z.string().optional().describe('Icon name (Lucide/Material) for UI representation'),\n\n /**\n * Taxonomy & Organization\n */\n tags: z.array(z.string()).optional().describe('Categorization tags (e.g. \"sales\", \"system\", \"reference\")'),\n active: z.boolean().optional().default(true).describe('Is the object active and usable'),\n isSystem: z.boolean().optional().default(false).describe('Is system object (protected from deletion)'),\n abstract: z.boolean().optional().default(false).describe('Is abstract base object (cannot be instantiated)'),\n\n /**\n * Managed-by hint — declares which lifecycle bucket the object belongs\n * to so UI clients render the appropriate set of CRUD affordances and\n * the security layer can enforce matching defaults. Modelled after the\n * way Salesforce / ServiceNow / Workday segregate user-owned business\n * data from admin-authored configuration, system-driven runtime rows,\n * and append-only audit trails.\n *\n * - `platform` — **Default.** User-owned business data. Generic\n * New / Import / Edit / Delete affordances are all shown. Example:\n * the user's own `sys_attachment`, `sys_comment`, `sys_saved_report`.\n * - `config` — Admin-authored metadata / configuration. Generic\n * New / Edit / Delete shown (admins author via wizard or form), but\n * CSV Import is suppressed (config rows have nested JSON envelopes\n * that don't round-trip through a flat sheet; clients should offer a\n * purpose-built \"Import definition (JSON)\" action instead). Example:\n * `sys_sharing_rule`, `sys_role`, `sys_permission_set`, `sys_view`,\n * `sys_app`.\n * - `system` — Runtime rows whose lifecycle is owned by a\n * platform service (the approval engine, the sharing engine, the\n * invitation service, …). Generic CRUD is hidden — users interact\n * with these via *domain actions* invoked from the source record\n * (e.g. \"Submit for Approval\" on an Opportunity creates an\n * `sys_approval_request`; \"Recall\" on the request changes its\n * state). Example: `sys_approval_request`, `sys_record_share`,\n * `sys_notification`, `sys_invitation`,\n * `sys_user_permission_set` / `sys_role_permission_set`.\n * - `append-only` — Immutable audit log. No New / Import / Edit /\n * Delete; only View and Export. Example: `sys_approval_action`,\n * `sys_audit_log`, `sys_activity`, `sys_email`, `sys_presence`.\n * - `better-auth` — Identity tables owned by the better-auth driver\n * (sys_user, sys_session, sys_account, sys_member, sys_organization,\n * sys_api_key, sys_jwks, sys_verification, sys_two_factor,\n * sys_oauth_*, sys_device_code). Mutations must flow through the\n * better-auth API so password hashing, token signing, email\n * verification, and invitation flows fire correctly. Generic CRUD\n * suppressed; replaced by purpose-built actions\n * (Invite User, Reset Password, Revoke Session, Rotate Key, …).\n *\n * The flag is purely declarative on the schema. Enforcement happens in\n * two places:\n * 1. Default permission sets ({@link packages/platform-objects/src/security/default-permission-sets.ts})\n * deny direct CRUD for `system` / `append-only` / `better-auth`.\n * 2. UI clients honour {@link resolveCrudAffordances} to gate the\n * New / Import / Edit / Delete / Export buttons accordingly.\n *\n * Use {@link userActions} to override the default matrix for a single\n * field (e.g. an \"append-only\" table that should still allow Export).\n */\n managedBy: z.enum(['platform', 'config', 'system', 'append-only', 'better-auth']).optional().describe(\n 'Lifecycle bucket — platform (user CRUD) | config (admin authored) | system (engine-managed) | append-only (audit) | better-auth (identity). UI clients honour the resolved affordance matrix.',\n ),\n\n /**\n * Per-object override of the generic CRUD affordances that the UI\n * surfaces. Each flag overrides the default derived from\n * {@link managedBy} via {@link resolveCrudAffordances}. Useful for the\n * handful of objects whose lifecycle doesn't cleanly fit a single\n * bucket — e.g. an `append-only` table that should still expose CSV\n * Export, or a `config` table that admins legitimately want to bulk\n * import via CSV.\n *\n * Omitting the block (or leaving individual flags `undefined`) keeps\n * the {@link managedBy}-derived default.\n */\n userActions: z.object({\n create: z.boolean().optional().describe('Show generic \"New\" button.'),\n import: z.boolean().optional().describe('Show CSV import wizard entry.'),\n edit: z.boolean().optional().describe('Allow inline / form edit of existing rows.'),\n delete: z.boolean().optional().describe('Show row-level delete + bulk delete.'),\n exportCsv: z.boolean().optional().describe('Show CSV export entry.'),\n }).optional().describe('Per-object override of the resolved CRUD affordance matrix.'),\n\n /**\n * System-field auto-injection control.\n *\n * The `SchemaRegistry` augments every user object with a small set of\n * implicit system fields at registration time so authors don't have to\n * declare them per-object (Salesforce-style). Currently injected:\n *\n * - `organization_id` — `lookup → sys_organization`. Injected only when\n * the kernel runs in multi-tenant mode (`OS_MULTI_ORG_ENABLED === 'true'`;\n * default is off — single-tenant).\n * Required for the default `tenant_isolation` RLS policy and the\n * SecurityPlugin's auto-fill on insert to take effect.\n *\n * Author-declared fields with the same name always win over injection\n * (no overwrite). Objects with `managedBy` set are skipped entirely —\n * better-auth/system/platform tables already declare what they need.\n *\n * Set `systemFields: false` to opt the object out completely. Pass an\n * options object to selectively disable individual injections (currently\n * only `tenant`, but reserved keys `owner`/`audit` are pre-defined for\n * future expansion).\n *\n * @default undefined (= injection enabled, gated by kernel mode)\n */\n systemFields: z\n .union([\n z.literal(false),\n z.object({\n tenant: z.boolean().optional().describe('Inject organization_id (multi-tenant only). Default true.'),\n owner: z.boolean().optional().describe('Reserved for future owner_id auto-injection.'),\n audit: z.boolean().optional().describe('Reserved for future created_by/updated_by auto-injection.'),\n }),\n ])\n .optional()\n .describe('Opt out of, or selectively disable, registry-level system-field auto-injection.'),\n\n /** \n * Storage & Virtualization \n */\n datasource: z.string().optional().default('default').describe('Target Datasource ID. \"default\" is the primary DB.'),\n\n /**\n * External Binding (ADR-0015)\n * Present only for federated objects routed to a datasource whose\n * `schemaMode !== 'managed'`. Describes the remote table binding and\n * per-object writability. See {@link ObjectExternalBindingSchema}.\n */\n external: ObjectExternalBindingSchema.optional()\n .describe('Remote table binding for federated (external) objects.'),\n\n\n /**\n * Data Model\n */\n fields: z.record(z.string().regex(/^[a-z_][a-z0-9_]*$/, {\n message: 'Field names must be lowercase snake_case (e.g., \"first_name\", \"company\", \"annual_revenue\")',\n }), FieldSchema).describe('Field definitions map. Keys must be snake_case identifiers.'),\n indexes: z.array(IndexSchema).optional().describe('Database performance indexes'),\n\n /**\n * Field Groups (MVP)\n * \n * Declares logical groups for presenting fields in forms and detail\n * pages. The **array order is the group display order**. Each field's\n * `Field.group` references an entry's `key` to assign it to a group;\n * within a group, fields are displayed in their `ObjectSchema.fields`\n * declaration order.\n * \n * See {@link ObjectFieldGroupSchema} for the full MVP contract and\n * deferred features.\n */\n fieldGroups: z.array(ObjectFieldGroupSchema).refine(\n (groups) => new Set(groups.map(g => g.key)).size === groups.length,\n { message: 'fieldGroups[].key must be unique within an object' },\n ).optional().describe('Ordered list of field groups (array order = display order). See ObjectFieldGroupSchema.'),\n \n /**\n * Advanced Data Management\n */\n \n // Multi-tenancy configuration\n tenancy: TenancyConfigSchema.optional().describe('Multi-tenancy configuration for SaaS applications'),\n\n /**\n * [ADR-0066 D2] Secure-by-default object posture. `access.default: 'private'`\n * opts the object OUT of blanket wildcard (`'*'`) permission grants (access\n * then needs an explicit per-object grant) and exempts it from wildcard RLS\n * via the posture-gated superuser bypass. Absent ⇒ `public` (today's\n * allow-by-default behaviour; no migration for existing objects).\n */\n access: ObjectAccessConfigSchema.optional().describe('[ADR-0066 D2] Object exposure posture (public-by-default vs private secure-by-default).'),\n\n /**\n * [ADR-0066 D3] Capability contract — capability name(s) (permission-set\n * `systemPermissions`; D1 records) a caller MUST hold to access this object at\n * all. Mirrors `App.requiredPermissions`. Enforced by plugin-security as an\n * AND-gate: checked IN ADDITION to permission-set CRUD grants — a caller\n * missing any listed capability is denied regardless of grants. Absent/empty\n * ⇒ no capability gate.\n */\n requiredPermissions: z.array(z.string()).optional().describe('[ADR-0066 D3] Capabilities required to access this object (AND-gate, checked alongside CRUD grants).'),\n \n // Soft delete configuration\n softDelete: SoftDeleteConfigSchema.optional().describe('Soft delete (trash/recycle bin) configuration'),\n \n // Versioning configuration\n versioning: VersioningConfigSchema.optional().describe('Record versioning and history tracking configuration'),\n \n // Partitioning strategy\n \n /**\n * Logic & Validation (Co-located)\n * Best Practice: Define rules close to data.\n */\n validations: z.array(ValidationRuleSchema).optional().describe('Object-level validation rules'),\n\n /**\n * Declarative semantic activity milestones (ADR-0052 §5b.2). When a watched\n * field transitions INTO `value`, the platform emits a templated activity-row\n * on the record timeline — no `*.hook.ts` / `*.flow.ts`. Complements field-level\n * `trackHistory` (which renders raw \"Field: old → new\"): use milestones for\n * business-meaningful events (\"Deal won\", \"Task completed\"). `summary` supports\n * `{field}` tokens interpolated from the record; the milestone summary takes\n * precedence over the field-change summary for the same update. Consumed by\n * `@objectstack/plugin-audit` audit-writers (enforce-or-remove, ADR-0049).\n */\n activityMilestones: z.array(z.object({\n field: z.string().describe('Field to watch (typically a status/stage select).'),\n value: z.string().describe('The value the field must transition INTO to fire the milestone.'),\n summary: z.string().describe('Activity summary template; {field} tokens interpolate the record value. e.g. \"Deal won: {name}\".'),\n type: z.string().optional().describe('Activity type for the emitted row (default \"completed\").'),\n })).optional().describe('Declarative semantic activity milestones — emit a templated timeline row when a field transitions into a value, no hook code (ADR-0052 §5b.2).'),\n\n // ADR-0020: record state machines are not a separate `stateMachines` map —\n // each lifecycle is a `state_machine` rule in `validations` above (one rule\n // per state field). Parallel lifecycles = multiple rules. The write path\n // enforces the transition table; UIs read the legal next states via the\n // `/meta/objects/:name/state/:field?from=` introspection endpoint.\n\n /**\n * Display & UI Hints (Data-Layer)\n */\n /**\n * [ADR-0079] Canonical pointer to the object's PRIMARY title field — the one\n * real stored field (text / autonumber / formula→text) that is a record's\n * human name. Pairs with `recordName` (the Salesforce Name / Record-Name\n * model). Optional at the schema level for now (a hard required-refine is\n * staged so existing title-less metadata still parses). Resolve / derive via\n * `resolveDisplayField` from `@objectstack/spec/data` (display-name.ts), which\n * falls back to the deprecated `displayNameField` alias and then a derivation.\n */\n nameField: z.string().optional().describe('[ADR-0079] Canonical primary title field — the stored field used as the record display name (e.g. \"name\", \"title\"). Pairs with recordName.'),\n /**\n * @deprecated [ADR-0079] Renamed to `nameField`. Still ACCEPTED as an alias:\n * the schema copies `displayNameField` onto `nameField` on parse when\n * `nameField` is absent (both are preserved on the parsed output for\n * cross-repo back-compat). New metadata should set `nameField`.\n */\n displayNameField: z.string().optional().describe('[DEPRECATED → nameField] Field to use as the record display name (e.g., \"name\", \"title\"). Accepted as an alias for nameField.'),\n recordName: z.object({\n type: z.enum(['text', 'autonumber']).describe('Record name type: text (user-entered) or autonumber (system-generated)'),\n displayFormat: z.string().optional().describe('Auto-number format pattern (e.g., \"CASE-{0000}\", \"INV-{YYYY}-{0000}\")'),\n startNumber: z.number().int().min(0).optional().describe('Starting number for autonumber (default: 1)'),\n }).optional().describe('Record name generation configuration (Salesforce pattern)'),\n titleFormat: TemplateExpressionInputSchema.optional().describe('[DEPRECATED → nameField (ADR-0079)] Render-only title template; the server cannot return or query it, and an explicit nameField now takes precedence. Migrate a single-field title to nameField, a composite to a formula field designated as nameField.'),\n /**\n * [ADR-0085] Semantic role: the object's most important fields, in priority\n * order (the first entry wins wherever only one field fits, e.g. child-record\n * previews). Cross-surface by definition — drives default list/grid columns,\n * cards, hover/lookup previews, and the record-detail highlight strip (first\n * 4). Renamed from `compactLayout` (the value is an ordered field list, not\n * a layout); Salesforce compact-layout semantics.\n */\n highlightFields: z.array(z.string()).optional().describe('[ADR-0085] Ordered most-important fields; first entry wins where only one fits. Drives default columns, cards, previews, detail highlight strip. Renamed from compactLayout.'),\n // `compactLayout` (the pre-ADR-0085 spelling of `highlightFields`) was an\n // accepted parse-time alias for one deprecation window and is now RETIRED\n // (framework#2536): authoring it is rejected by `create()` like any unknown\n // key. All first-party consumers read `highlightFields` since objectui#2168.\n /**\n * [ADR-0085] Semantic role: the field that represents the record's LINEAR\n * lifecycle (an ordered pipeline / stage progression). A string names the\n * field; `false` declares the object's status-like field NON-linear (an\n * unordered state set such as active/suspended/void) and suppresses every\n * consumer's stage heuristics. Absent = consumers may heuristically detect\n * a stage field (status/stage/state/phase). Consumed by the record-detail\n * path/stepper today; kanban default grouping, list badges and report\n * bucketing are natural future consumers.\n */\n stageField: z.union([z.string(), z.literal(false)]).optional().describe('[ADR-0085] Lifecycle stage field (linear/ordered), or false to declare the status field non-linear and suppress stage heuristics. Absent = heuristic detection allowed.'),\n\n /**\n * Built-in List Views\n *\n * Curated, platform-shipped list views (grid / kanban / calendar / …)\n * keyed by view name. Rendered as segmented tabs in the console list page\n * **before** any user-saved `sys_view` rows. Use this for system objects\n * (audit, runtime, config) where the default \"All records\" grid lacks\n * business context — e.g. an approval-request list should ship with\n * \"My pending\", \"I submitted\", \"Completed\" tabs out of the box.\n *\n * Each value is an `ObjectListViewSchema` (a `ListViewSchema` minus the\n * page-only `userFilters` — ADR-0053 \"views\" mode, where the `ViewTabBar` is\n * the only nav control) so authors get the full tab/filter/sort/grouping\n * vocabulary without the wrong-context filter bar.\n *\n * @example\n * ```ts\n * listViews: {\n * my_pending: {\n * type: 'grid',\n * label: 'My Pending',\n * filter: [{ field: 'pending_approvers', operator: 'contains', value: '{current_user_id}' }],\n * sort: [{ field: 'updated_at', order: 'desc' }],\n * },\n * }\n * ```\n */\n listViews: z.record(z.string(), ObjectListViewSchema).optional().describe('Built-in named list views (segmented tabs) shipped with the object schema — \"views\" mode, no page-only userFilters (ADR-0053)'),\n\n /**\n * Search Engine Config \n */\n searchableFields: z.array(z.string()).optional().describe('Fields the `$search` query matches against (ADR-0061). Canonical default for the record picker, list quick-search and global search; views may narrow it. When unset, search auto-defaults to the name/title field plus short-text fields.'),\n search: SearchConfigSchema.optional().describe('Search engine configuration'),\n \n /** \n * System Capabilities \n */\n enable: ObjectCapabilities.optional().describe('Enabled system features modules'),\n\n /**\n * Sharing Model (org-wide default).\n *\n * `controlled_by_parent` (ADR-0055) makes this a DETAIL object in a\n * master-detail relationship: its access is *derived* from the master record\n * — a user sees/edits a detail only if they can see/edit its master. The\n * object must declare exactly one required `master_detail` field identifying\n * the master; the security layer auto-injects `masterFK IN (accessible master\n * ids)` on reads and requires master edit-access on by-id writes. No RLS policy\n * is authored — the inheritance is derived from the relationship.\n */\n sharingModel: z.enum(['private', 'public_read', 'public_read_write', 'controlled_by_parent', 'read', 'read_write', 'full']).optional().describe('Org-Wide Default record visibility (OWD). Canonical: private (owner-only) | public_read (everyone reads, owner writes) | public_read_write (everyone reads+writes) | controlled_by_parent (derived from the master record). Legacy aliases: read=public_read, read_write/full=public_read_write. ADR-0056 D1.'),\n\n /**\n * Public Share-Link Policy\n *\n * Opt-in declaration that records of this object MAY be published via\n * an opaque capability token (Notion / Google Docs / Figma \"anyone with\n * the link\" style). When omitted or `enabled:false`, the platform\n * refuses to create share-link rows for this object — independent of\n * any permission the caller holds.\n *\n * Distinct from {@link sharingModel}, which governs *principal-based*\n * sharing (share with specific users / teams / roles). A single object\n * can opt into both: principals get full edit, link recipients get\n * read-only with redaction.\n *\n * Defaults are conservative: when `enabled:true` and no other field is\n * provided, the plugin allows `link_only` audience + `view` permission\n * (the safest combination — caller still needs the URL to access).\n *\n * @see packages/plugins/plugin-sharing/src/share-link-service.ts\n */\n publicSharing: z.object({\n /** Master switch. When false (default), no share links can be issued for this object. */\n enabled: z.boolean().default(false).describe('Allow records of this object to be published via share link'),\n /**\n * Audiences the platform will accept when issuing a link.\n * - `public` — search engines may index; no token check (rare)\n * - `link_only` — anyone holding the token (default)\n * - `signed_in` — token + an authenticated session of any tenant user\n * - `email` — token + recipient's email matches an allowlist\n */\n allowedAudiences: z.array(z.enum(['public', 'link_only', 'signed_in', 'email'])).optional().describe('Audiences callers may select when creating a link'),\n /** Permission levels callers may grant via a link. Defaults to `['view']`. */\n allowedPermissions: z.array(z.enum(['view', 'comment', 'edit'])).optional().describe('Permission levels selectable on the share dialog'),\n /** Hard cap on requested expiry, in days. Links with `expires_at` further out are rejected. */\n maxExpiryDays: z.number().int().positive().optional().describe('Reject links with expiry beyond this many days'),\n /**\n * Fields stripped from every response served via a share token,\n * regardless of audience. Use for prompts, raw model output,\n * internal metadata, PII, etc. The owner's normal API access is\n * unaffected — redaction is applied only when the request principal\n * is `kind:'share-link'`.\n */\n redactFields: z.array(z.string()).optional().describe('Field names removed from records served via a share token'),\n /**\n * Optional CEL/JSONLogic predicate evaluated against the candidate\n * record when a link is created. When the predicate returns false,\n * the create call fails with 422 (e.g. \"draft records cannot be\n * shared\"). Evaluator is the same one used by sharing rules.\n */\n eligibility: z.string().optional().describe('CEL expression that must evaluate to true on the target record'),\n }).optional().describe('Public share-link policy (Notion/Figma-style link sharing)'),\n\n /** Key Prefix */\n keyPrefix: z.string().max(5).optional().describe('Short prefix for record IDs (e.g., \"001\" for Account)'),\n\n // [ADR-0085] The former `detail: { … }.passthrough()` UI-hints block is\n // REMOVED. Presentation intent lives in the cross-surface semantic roles\n // above (nameField / highlightFields / stageField / fieldGroups); per-page\n // control is an assigned Page. The passthrough block bred silently-inert\n // keys (9 read by renderers vs 3 typed; the typed `hideReferenceRail` was\n // itself a no-op for spec authors) — see the ADR for the full inventory.\n // `renderViaSchema` retires together with the legacy monolith render path.\n\n /**\n * Object Actions\n * \n * Actions associated with this object. Populated automatically by `defineStack()`\n * when top-level actions specify `objectName` matching this object.\n * Can also be defined directly on the object.\n * \n * Aligns with Salesforce/ServiceNow patterns where actions are part of the\n * object schema, so API responses (e.g., `/api/v1/meta/objects/:name`)\n * include the action list without requiring downstream merge.\n */\n actions: z.array(ActionSchema).optional().describe('Actions associated with this object (auto-populated from top-level actions via objectName)'),\n\n /**\n * ADR-0010 §3.7 — Package-level protection envelope. Package\n * authors declare lock policy here; the loader translates it\n * into the private `_lock` envelope at registration time and\n * strips this block before persistence. See\n * `shared/protection.zod.ts`.\n */\n protection: ProtectionSchema.optional().describe(\n 'Package author protection block — lock policy for this object.',\n ),\n\n // ADR-0010 — runtime protection envelope (internal — set by loader).\n ...MetadataProtectionFields,\n});\n\n/**\n * Converts a snake_case name to a human-readable Title Case label.\n * @example snakeCaseToLabel('project_task') → 'Project Task'\n */\nfunction snakeCaseToLabel(name: string): string {\n return name\n .split('_')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}\n\n/**\n * Known-confusable schema keys → precise authoring guidance.\n *\n * ADR-0032's \"no silent failure\" principle applied to metadata *shape*: an\n * unknown top-level key on `ObjectSchema.create()` used to be discarded by\n * Zod's default `.strip()`, so a misauthored schema key vanished with no\n * error, no warning, and a green `tsc` — shipping dead metadata the author\n * believed they had wired up (issue #1535, object-level `workflows: [...]`).\n *\n * These entries turn the most likely mistakes into a fixable error that points\n * at the *supported* mechanism rather than a generic \"unknown key\".\n */\nconst UNKNOWN_KEY_GUIDANCE: Record<string, string> = {\n workflows:\n '`workflows` is not an ObjectSchema field. Object-level, record-triggered ' +\n 'automation is authored as a lifecycle hook (`src/objects/<name>.hook.ts`, ' +\n 'registered via `defineHook()`) or as a top-level `record_change` flow — ' +\n 'not as `workflows[]` on the object schema.',\n workflow:\n '`workflow` is not an ObjectSchema field. Record-triggered automation is ' +\n 'authored as a lifecycle hook (`src/objects/<name>.hook.ts`) or a top-level ' +\n '`record_change` flow.',\n hooks:\n '`hooks` is not an ObjectSchema field. Lifecycle hooks live in their own ' +\n '`src/objects/<name>.hook.ts` module, registered via `defineHook()`.',\n triggers:\n '`triggers` is not an ObjectSchema field. Use a lifecycle hook ' +\n '(`src/objects/<name>.hook.ts`) or a top-level `record_change` flow.',\n\n // ── Tombstones for RETIRED keys (upgrade prescriptions) ────────────────\n // A retired key's error must carry the fix: the compile/validation error is\n // the one upgrade channel every consumer is guaranteed to hit — an agent\n // bumping @objectstack/spec sees THIS message, not our docs site. Each entry\n // names what replaced the key and the version/decision that removed it.\n // Tombstones age out too: drop an entry ~two majors after the removal\n // (by then it's archaeology, not an upgrade; see CHANGELOG.md for history).\n compactLayout:\n '`compactLayout` was renamed to `highlightFields` in @objectstack/spec 11.7.0 ' +\n '(ADR-0085 semantic roles) and the alias was retired in 11.9.1 (#2536). ' +\n 'Rename the key — the value shape (ordered field-name list) is unchanged.',\n detail:\n 'The `detail` UI-hints block was removed by ADR-0085 (spec 11.7.0). Its ' +\n 'jobs moved to top-level semantic roles: `detail.stageField` → `stageField` ' +\n '(string | false), `detail.highlightFields` → `highlightFields`, section ' +\n 'layout → `fieldGroups` + `Field.group`. Whole-page customization is done ' +\n 'by assigning a custom Page schema instead of per-page hint keys.',\n views:\n '`views` is not an ObjectSchema field: the object-level `views.form/*` and ' +\n '`views.detail/*` UI-hint dialect was never part of the spec and its ' +\n 'renderer support was removed (ADR-0085). Use the semantic roles ' +\n '(`highlightFields`, `stageField`, `fieldGroups`) for hints and `listViews` ' +\n 'for named list views.',\n defaultDetailForm:\n '`defaultDetailForm` was never implemented and was removed from the spec ' +\n '(#2402). Curate the record page by assigning a custom Page schema; form ' +\n 'layout derives from `fieldGroups` + `Field.group`.',\n};\n\n/** Levenshtein edit distance — backs the \"did you mean\" hint for typo'd keys. */\nfunction editDistance(a: string, b: string): number {\n const dp: number[][] = Array.from({ length: a.length + 1 }, () =>\n new Array<number>(b.length + 1).fill(0),\n );\n for (let i = 0; i <= a.length; i++) dp[i][0] = i;\n for (let j = 0; j <= b.length; j++) dp[0][j] = j;\n for (let i = 1; i <= a.length; i++) {\n for (let j = 1; j <= b.length; j++) {\n dp[i][j] = a[i - 1] === b[j - 1]\n ? dp[i - 1][j - 1]\n : 1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]);\n }\n }\n return dp[a.length][b.length];\n}\n\n/** Closest known key within a small edit distance, for typo hints (`indexs` → `indexes`). */\nfunction suggestKey(unknown: string, knownKeys: string[]): string | undefined {\n let best: string | undefined;\n let bestDist = Infinity;\n for (const key of knownKeys) {\n const d = editDistance(unknown.toLowerCase(), key.toLowerCase());\n if (d < bestDist) {\n bestDist = d;\n best = key;\n }\n }\n // Only suggest when the keys are genuinely close (guards against noise).\n return best !== undefined && bestDist <= Math.max(2, Math.floor(unknown.length / 3))\n ? best\n : undefined;\n}\n\n/**\n * Builds a precise, fixable error for unknown top-level keys on\n * `ObjectSchema.create()` — the metadata-shape analogue of ADR-0032's \"no\n * silent failure\" (issue #1535). Because authored `*.object.ts` modules call\n * `create()`, this surfaces as a located build error instead of a silently\n * stripped field.\n */\nfunction unknownKeyError(objectName: unknown, unknownKeys: string[], knownKeys: string[]): Error {\n const name = typeof objectName === 'string' && objectName.length > 0 ? objectName : '<unnamed>';\n const lines = unknownKeys.map((key) => {\n const guidance = UNKNOWN_KEY_GUIDANCE[key];\n if (guidance) return ` • ${guidance}`;\n const suggestion = suggestKey(key, knownKeys);\n return suggestion\n ? ` • \\`${key}\\` is not an ObjectSchema field — did you mean \\`${suggestion}\\`?`\n : ` • \\`${key}\\` is not an ObjectSchema field.`;\n });\n return new Error(\n `ObjectSchema.create('${name}'): unknown key(s) — ${unknownKeys.join(', ')}.\\n` +\n 'These keys would previously have been stripped silently at build, shipping ' +\n 'dead metadata with no diagnostic (ADR-0032 \"no silent failure\", issue #1535).\\n\\n' +\n `${lines.join('\\n')}\\n\\n` +\n 'Remove the unknown key(s), fix the typo, or move the logic to a supported mechanism.',\n );\n}\n\n/**\n * Rejects excess top-level keys at compile time: any key of `T` that is not a\n * key of the ObjectSchema input shape is constrained to `never`, turning the\n * silent strip into a `tsc` error at the authoring site as well as at build.\n */\ntype NoExcessObjectKeys<T> = T &\n Record<Exclude<keyof T, keyof z.input<typeof ObjectSchemaBase>>, never>;\n\n/**\n * [ADR-0079] Back-compat alias normalization: an object authored with the\n * deprecated `displayNameField` key still parses by mapping it onto the\n * canonical `nameField` when `nameField` is absent. `displayNameField` is\n * PRESERVED on the output (cross-repo consumers / older tests still read it).\n * Non-object inputs pass through untouched (Zod raises the real type error).\n */\nfunction normalizeNameFieldAlias(input: unknown): unknown {\n if (!input || typeof input !== 'object' || Array.isArray(input)) return input;\n const obj = input as Record<string, unknown>;\n if (obj.nameField == null && typeof obj.displayNameField === 'string') {\n return { ...obj, nameField: obj.displayNameField };\n }\n return input;\n}\n\n/**\n * [ADR-0085] Parse-time alias normalization for the semantic-role renames\n * (same pattern as `normalizeNameFieldAlias`; deprecated keys are PRESERVED\n * on output for cross-repo back-compat):\n *\n * - (`compactLayout` ⇄ `highlightFields` mirrored here during the ADR-0085\n * deprecation window; RETIRED by framework#2536 once objectui#2168 shipped.)\n * - `fieldGroups[].collapse` derived from the deprecated flags when absent:\n * the UI-dialect `collapsible`/`collapsed` pair wins over the old\n * `defaultExpanded` (it is what designer-authored metadata actually\n * carries); mapping: collapsed:true → 'collapsed'; collapsible:true →\n * 'expanded'; collapsible:false → 'none'; defaultExpanded:false →\n * 'collapsed'; defaultExpanded:true → 'expanded'.\n */\nfunction normalizeSemanticRoleAliases(input: unknown): unknown {\n if (!input || typeof input !== 'object' || Array.isArray(input)) return input;\n const obj = input as Record<string, unknown>;\n let out = obj;\n\n if (Array.isArray(obj.fieldGroups)) {\n let changed = false;\n const groups = (obj.fieldGroups as unknown[]).map((g) => {\n if (!g || typeof g !== 'object' || Array.isArray(g)) return g;\n const grp = g as Record<string, unknown>;\n if (grp.collapse != null) return g;\n let collapse: string | undefined;\n if (typeof grp.collapsible === 'boolean' || typeof grp.collapsed === 'boolean') {\n collapse = grp.collapsed === true ? 'collapsed' : grp.collapsible === true ? 'expanded' : 'none';\n } else if (typeof grp.defaultExpanded === 'boolean') {\n collapse = grp.defaultExpanded ? 'expanded' : 'collapsed';\n }\n if (collapse === undefined) return g;\n changed = true;\n return { ...grp, collapse };\n });\n if (changed) out = { ...out, fieldGroups: groups };\n }\n\n return out;\n}\n\n/**\n * Enhanced ObjectSchema with Factory\n */\nexport const ObjectSchema = lazySchema(() => {\n // Capture the ORIGINAL ZodObject parse/safeParse before `Object.assign`\n // mutates `ObjectSchemaBase` in place (assign returns the same object, so\n // overriding `.parse` on the result would otherwise recurse into itself).\n const baseParse = ObjectSchemaBase.parse.bind(ObjectSchemaBase);\n const baseSafeParse = ObjectSchemaBase.safeParse.bind(ObjectSchemaBase);\n return Object.assign(ObjectSchemaBase, {\n /**\n * [ADR-0079] Parse with deprecated-`displayNameField`→`nameField` alias\n * normalization applied first. Wraps the captured original ZodObject parse,\n * so `.shape` / `.create()`'s internal `ObjectSchemaBase.parse` keep working.\n */\n parse(data: unknown, params?: Parameters<typeof ObjectSchemaBase.parse>[1]) {\n return baseParse(normalizeSemanticRoleAliases(normalizeNameFieldAlias(data)), params);\n },\n safeParse(data: unknown, params?: Parameters<typeof ObjectSchemaBase.safeParse>[1]) {\n return baseSafeParse(normalizeSemanticRoleAliases(normalizeNameFieldAlias(data)), params);\n },\n /**\n * Type-safe factory for creating business object definitions.\n * \n * Enhancements over raw schema:\n * - **Auto-label**: Generates `label` from `name` if not provided (snake_case → Title Case).\n * - **Validation**: Runs Zod `.parse()` to validate the config at creation time.\n * - **No silent strip** (ADR-0032 / #1535): unknown top-level keys (e.g. a\n * typo'd `validation`, or an object-level `workflows[]`) are rejected with a\n * precise, fixable error instead of being discarded by Zod's `.strip()`.\n *\n * @example\n * ```ts\n * const Task = ObjectSchema.create({\n * name: 'project_task',\n * // label auto-generated as 'Project Task'\n * fields: {\n * subject: { type: 'text', label: 'Subject', required: true },\n * },\n * });\n * ```\n */\n create: <const T extends z.input<typeof ObjectSchemaBase>>(config: NoExcessObjectKeys<T>): Omit<ServiceObject, 'fields'> & Pick<T, 'fields'> => {\n // ADR-0032 \"no silent failure\" for schema shape (issue #1535): an unknown\n // top-level key here used to be discarded silently by Zod's `.strip()`. We\n // reject it with a located, fixable message *before* parsing so authors get\n // a build error instead of vanished metadata.\n const cfg = config as T & Record<string, unknown>;\n const knownKeys = Object.keys(ObjectSchemaBase.shape);\n const unknownKeys = Object.keys(cfg).filter((k) => !knownKeys.includes(k));\n if (unknownKeys.length > 0) {\n throw unknownKeyError(cfg.name, unknownKeys, knownKeys);\n }\n const withDefaults = {\n ...cfg,\n label: cfg.label ?? snakeCaseToLabel(cfg.name as string),\n };\n // [ADR-0079] `ObjectSchemaBase.parse` here is the alias-normalizing override\n // assigned just below (Object.assign mutates the base in place), so the\n // deprecated `displayNameField`→`nameField` mapping is applied for create()\n // too — no need to normalize again at this call site.\n return ObjectSchemaBase.parse(withDefaults) as Omit<ServiceObject, 'fields'> & Pick<T, 'fields'>;\n },\n });\n});\n\nexport type ServiceObject = z.infer<typeof ObjectSchemaBase>;\nexport type ServiceObjectInput = z.input<typeof ObjectSchemaBase>;\nexport type ObjectCapabilities = z.infer<typeof ObjectCapabilities>;\nexport type ObjectIndex = z.infer<typeof IndexSchema>;\nexport type TenancyConfig = z.infer<typeof TenancyConfigSchema>;\nexport type ObjectAccessConfig = z.infer<typeof ObjectAccessConfigSchema>;\nexport type SoftDeleteConfig = z.infer<typeof SoftDeleteConfigSchema>;\nexport type VersioningConfig = z.infer<typeof VersioningConfigSchema>;\n\n/**\n * Resolved CRUD affordance matrix for an object — what generic\n * lifecycle actions UI clients should expose in their toolbars.\n *\n * Use {@link resolveCrudAffordances} to compute this from a schema; the\n * `managedBy` flag drives the defaults, and the optional `userActions`\n * block per-flag-overrides them. UI clients (`ObjectView`,\n * `RecordDetailView`, `RecordFormPage`, …) gate their buttons on this\n * matrix in combination with the user's permissions.\n *\n * The presence of an affordance here means \"the *object* permits this\n * action conceptually\"; the user still needs the matching permission\n * grant to execute it.\n */\nexport interface CrudAffordances {\n /** Generic \"New\" button (single record creation form). */\n create: boolean;\n /** CSV bulk-import wizard. Disabled for config / system / append-only / better-auth by default. */\n import: boolean;\n /** Inline + form editing of existing rows. */\n edit: boolean;\n /** Row-level + bulk delete. */\n delete: boolean;\n /** CSV / clipboard export. Allowed even on append-only audit tables by default. */\n exportCsv: boolean;\n}\n\n/**\n * Default affordance matrix per {@link ObjectSchemaBase.managedBy} bucket.\n * Mirrors how Salesforce / ServiceNow / Workday / Notion expose CRUD on\n * different categories of system tables.\n *\n * platform — full CRUD (user-owned business data)\n * config — admin authored: New/Edit/Delete OK, no CSV import\n * (definitions have nested envelopes; admins should use\n * a purpose-built \"Import definition\" action instead)\n * system — engine-managed runtime rows: no generic CRUD; users\n * interact via domain actions on the source record\n * append-only — audit log: View + Export only\n * better-auth — identity tables owned by better-auth driver; CRUD\n * routed through purpose-built actions (Invite, Reset\n * PW, Revoke, …)\n */\nconst CRUD_AFFORDANCE_DEFAULTS: Record<NonNullable<ServiceObject['managedBy']> | 'platform', CrudAffordances> = {\n platform: { create: true, import: true, edit: true, delete: true, exportCsv: true },\n config: { create: true, import: false, edit: true, delete: true, exportCsv: true },\n system: { create: false, import: false, edit: false, delete: false, exportCsv: true },\n 'append-only': { create: false, import: false, edit: false, delete: false, exportCsv: true },\n 'better-auth': { create: false, import: false, edit: false, delete: false, exportCsv: true },\n};\n\n/**\n * Resolve the effective CRUD affordance matrix for an object schema.\n *\n * Starts from the bucket default keyed off `managedBy` (defaulting to\n * `'platform'` if unset) and applies the per-flag overrides in\n * `userActions`. Returns a fresh object so callers can mutate safely.\n *\n * @example\n * ```ts\n * const aff = resolveCrudAffordances(sysApprovalRequestSchema);\n * // → { create:false, import:false, edit:false, delete:false, exportCsv:true }\n * ```\n */\nexport function resolveCrudAffordances(\n obj: Pick<ServiceObject, 'managedBy' | 'userActions'> | { managedBy?: string; userActions?: ServiceObject['userActions'] },\n): CrudAffordances {\n const bucket = (obj?.managedBy ?? 'platform') as keyof typeof CRUD_AFFORDANCE_DEFAULTS;\n const base = CRUD_AFFORDANCE_DEFAULTS[bucket] ?? CRUD_AFFORDANCE_DEFAULTS.platform;\n const overrides = obj?.userActions ?? {};\n return {\n create: overrides.create ?? base.create,\n import: overrides.import ?? base.import,\n edit: overrides.edit ?? base.edit,\n delete: overrides.delete ?? base.delete,\n exportCsv: overrides.exportCsv ?? base.exportCsv,\n };\n}\n\n// =================================================================\n// Object Ownership Model\n// =================================================================\n\n/**\n * How a package relates to an object it references.\n * \n * - `own`: This package is the original author/owner of the object.\n * Only one package may own a given object name. The owner defines\n * the base schema (table name, primary key, core fields).\n * \n * - `extend`: This package adds fields, views, or actions to an\n * existing object owned by another package. Multiple packages\n * may extend the same object. Extensions are merged at boot time.\n * \n * Follows Salesforce/ServiceNow patterns:\n * object name = database table name, globally unique, no namespace prefix.\n */\nexport const ObjectOwnershipEnum = z.enum(['own', 'extend']);\nexport type ObjectOwnership = z.infer<typeof ObjectOwnershipEnum>;\n\n/**\n * Object Extension Entry — used in `objectExtensions` array.\n * Declares fields/config to merge into an existing object owned by another package.\n * \n * @example\n * ```ts\n * objectExtensions: [{\n * extend: 'contact', // target object FQN\n * fields: { sales_stage: Field.select([...]) },\n * }]\n * ```\n */\nexport const ObjectExtensionSchema = lazySchema(() => z.object({\n /** The target object name (FQN) to extend */\n extend: z.string().describe('Target object name (FQN) to extend'),\n \n /** Fields to merge into the target object (additive) */\n fields: z.record(z.string(), FieldSchema).optional().describe('Fields to add/override'),\n \n /** Override label */\n label: z.string().optional().describe('Override label for the extended object'),\n \n /** Override plural label */\n pluralLabel: z.string().optional().describe('Override plural label for the extended object'),\n \n /** Override description */\n description: z.string().optional().describe('Override description for the extended object'),\n \n /** Additional validation rules to add */\n validations: z.array(ValidationRuleSchema).optional().describe('Additional validation rules to merge into the target object'),\n \n /** Additional indexes to add */\n indexes: z.array(IndexSchema).optional().describe('Additional indexes to merge into the target object'),\n \n /** Merge priority. Higher number applied later (wins on conflict). Default: 200 */\n priority: z.number().int().min(0).max(999).default(200).describe('Merge priority (higher = applied later)'),\n}));\n\nexport type ObjectExtension = z.infer<typeof ObjectExtensionSchema>;\n/** Authoring input for {@link ObjectExtension} — defaulted fields are optional. */\nexport type ObjectExtensionInput = z.input<typeof ObjectExtensionSchema>;\n\n/**\n * Type-safe factory for an extension to an object owned by another package. Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: ObjectExtension` literal.\n */\nexport function defineObjectExtension(config: z.input<typeof ObjectExtensionSchema>): ObjectExtension {\n return ObjectExtensionSchema.parse(config);\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * Auto-number format renderer — shared by the ObjectQL engine (in-memory\n * fallback) and the SQL driver (persistent atomic sequence) so both paths\n * render identical record numbers from one `autonumberFormat` string (#1603).\n *\n * A format is literal text interleaved with `{...}` tokens:\n *\n * - Sequence token `{0000}` — one or more `0`s. The running counter,\n * zero-padded to that width. At most one per format; a format with none\n * appends the bare counter (legacy behaviour).\n * - Date tokens `{YYYY} {YY} {MM} {DD} {YYYYMMDD}` — the generation date in\n * the request's business timezone (ADR-0053), falling back to UTC.\n * - Field tokens `{field_name}` — the value of another field on the SAME\n * record (e.g. `{island_zone}`, `{plan_no}`), interpolated as a string.\n * - Everything else is literal text.\n *\n * The counter is scoped to whatever the tokens BEFORE the sequence render to\n * (the \"scope\"): `AD{YYYYMMDD}{0000}` counts per day, `{island_zone}{000}`\n * counts per island, `{plan_no}{000}` counts per parent record. A fresh scope\n * value starts a fresh count — so period reset (yearly/monthly/daily) and\n * per-group numbering both fall out of one mechanism with no extra config.\n *\n * Backward compatibility: a format with NO date/field tokens (e.g.\n * `CASE-{0000}`) has an empty scope, so existing fixed-prefix sequences keep\n * their single global counter and their behaviour is unchanged.\n */\n\nexport type AutonumberToken =\n | { kind: 'literal'; text: string }\n | { kind: 'date'; pattern: 'YYYY' | 'YY' | 'MM' | 'DD' | 'YYYYMMDD' }\n | { kind: 'field'; field: string }\n | { kind: 'seq'; width: number };\n\nconst DATE_PATTERNS = new Set(['YYYY', 'YY', 'MM', 'DD', 'YYYYMMDD']);\n\n/**\n * Parse an `autonumberFormat` into an ordered token list. An unrecognized\n * `{...}` group is kept verbatim as literal text, so a stray brace or a typo\n * never throws — it just renders literally.\n */\nexport function parseAutonumberFormat(format: string): AutonumberToken[] {\n const tokens: AutonumberToken[] = [];\n if (!format) return tokens;\n const re = /\\{([^{}]*)\\}/g;\n let last = 0;\n let m: RegExpExecArray | null;\n let seenSeq = false;\n while ((m = re.exec(format)) !== null) {\n if (m.index > last) tokens.push({ kind: 'literal', text: format.slice(last, m.index) });\n const body = m[1];\n if (/^0+$/.test(body) && !seenSeq) {\n // First `{0..0}` is the sequence slot. A second one is ambiguous, so\n // treat it as literal rather than silently producing two counters.\n tokens.push({ kind: 'seq', width: body.length });\n seenSeq = true;\n } else if (DATE_PATTERNS.has(body)) {\n tokens.push({ kind: 'date', pattern: body as 'YYYY' | 'YY' | 'MM' | 'DD' | 'YYYYMMDD' });\n } else if (/^[A-Za-z_][A-Za-z0-9_]*$/.test(body)) {\n tokens.push({ kind: 'field', field: body });\n } else {\n tokens.push({ kind: 'literal', text: m[0] });\n }\n last = re.lastIndex;\n }\n if (last < format.length) tokens.push({ kind: 'literal', text: format.slice(last) });\n return tokens;\n}\n\n/** True when the format interpolates anything date- or record-dependent. */\nexport function hasDynamicTokens(tokens: AutonumberToken[]): boolean {\n return tokens.some((t) => t.kind === 'date' || t.kind === 'field');\n}\n\n/** The sequence token's pad width, or `fallback` (default 4) when none. */\nexport function sequenceWidth(tokens: AutonumberToken[], fallback = 4): number {\n const seq = tokens.find((t) => t.kind === 'seq');\n return seq && seq.kind === 'seq' ? seq.width : fallback;\n}\n\n/** Field names referenced by `{field}` tokens (for read-back / validation). */\nexport function referencedFields(tokens: AutonumberToken[]): string[] {\n return tokens.filter((t): t is Extract<AutonumberToken, { kind: 'field' }> => t.kind === 'field').map((t) => t.field);\n}\n\n/**\n * `{field}` tokens whose value is missing on the record (null / undefined /\n * empty string). Such a field would silently render to an empty prefix and\n * collapse the counter into the wrong scope (a different group's sequence), so\n * callers should refuse to generate rather than emit a wrong record number.\n * Returns the referenced field names in format order, deduplicated.\n */\nexport function missingFieldValues(\n tokens: AutonumberToken[],\n record?: Record<string, unknown>,\n): string[] {\n const missing: string[] = [];\n for (const field of referencedFields(tokens)) {\n const v = record ? record[field] : undefined;\n if ((v == null || v === '') && !missing.includes(field)) missing.push(field);\n }\n return missing;\n}\n\ninterface CalendarParts {\n YYYY: string;\n YY: string;\n MM: string;\n DD: string;\n}\n\n/** Resolve the calendar Y/M/D of `now` in `timezone` (IANA), UTC on failure. */\nfunction calendarParts(now: Date, timezone?: string): CalendarParts {\n let y: string;\n let mo: string;\n let d: string;\n try {\n const fmt = new Intl.DateTimeFormat('en-CA', {\n timeZone: timezone || 'UTC',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n });\n const parts = fmt.formatToParts(now);\n y = parts.find((p) => p.type === 'year')?.value ?? '0000';\n mo = parts.find((p) => p.type === 'month')?.value ?? '01';\n d = parts.find((p) => p.type === 'day')?.value ?? '01';\n } catch {\n y = String(now.getUTCFullYear()).padStart(4, '0');\n mo = String(now.getUTCMonth() + 1).padStart(2, '0');\n d = String(now.getUTCDate()).padStart(2, '0');\n }\n return { YYYY: y, YY: y.slice(-2), MM: mo, DD: d };\n}\n\nfunction renderDate(pattern: string, p: CalendarParts): string {\n switch (pattern) {\n case 'YYYY': return p.YYYY;\n case 'YY': return p.YY;\n case 'MM': return p.MM;\n case 'DD': return p.DD;\n case 'YYYYMMDD': return `${p.YYYY}${p.MM}${p.DD}`;\n default: return '';\n }\n}\n\nexport interface RenderAutonumberInput {\n /** Parsed tokens (from {@link parseAutonumberFormat}). */\n tokens: AutonumberToken[];\n /** The reserved counter value. */\n seq: number;\n /** The record being written — source for `{field}` interpolation. */\n record?: Record<string, unknown>;\n /** Generation instant. Callers pass an explicit `Date` (no implicit clock). */\n now: Date;\n /** Business timezone for date tokens (ADR-0053); falls back to UTC. */\n timezone?: string;\n}\n\nexport interface RenderedAutonumber {\n /** Rendered text before the sequence slot. */\n prefix: string;\n /** Rendered text after the sequence slot. */\n suffix: string;\n /**\n * Counter scope: the rendered prefix when the format has date/field tokens,\n * else '' (legacy fixed-prefix formats keep one global counter under a\n * stable empty scope). Drives per-period / per-group numbering and reset.\n */\n scope: string;\n /** Final value: prefix + zero-padded(seq) + suffix. */\n value: string;\n}\n\n/**\n * Render a record number for a reserved counter value. Pure: identical inputs\n * yield identical output, which is what lets the engine and the SQL driver\n * agree on the same string.\n */\nexport function renderAutonumber(input: RenderAutonumberInput): RenderedAutonumber {\n const { tokens, seq, record, now, timezone } = input;\n const dp = calendarParts(now, timezone);\n let prefix = '';\n let suffix = '';\n let width: number | null = null;\n for (const t of tokens) {\n if (t.kind === 'seq') {\n width = t.width;\n continue;\n }\n let piece = '';\n if (t.kind === 'literal') piece = t.text;\n else if (t.kind === 'date') piece = renderDate(t.pattern, dp);\n else if (t.kind === 'field') {\n const v = record ? record[t.field] : undefined;\n piece = v == null ? '' : String(v);\n }\n if (width === null) prefix += piece;\n else suffix += piece;\n }\n const dynamic = hasDynamicTokens(tokens);\n // The scope IS the rendered prefix. Two records whose tokens render to the\n // same prefix string (e.g. `{a}{b}` for ('AB','C') and ('A','BC')) also render\n // the same VISIBLE number, so they must share one counter to stay unique —\n // splitting them by token boundary would mint duplicate record numbers. The\n // remedy for genuinely-distinct groups is an unambiguous format (a delimiter\n // literal between variable tokens); the compile lint nudges authors there.\n const scope = dynamic ? prefix : '';\n const value = width === null\n // No `{0..0}` slot — append the bare counter (legacy behaviour).\n ? `${prefix}${seq}`\n : `${prefix}${String(seq).padStart(width, '0')}${suffix}`;\n return { prefix, suffix, scope, value };\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\n\n/**\n * Hook Lifecycle Events\n * Defines the interception points in the ObjectQL execution pipeline.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nimport { HookBodySchema } from './hook-body.zod';\nexport const HookEvent = z.enum([\n // Read Operations\n 'beforeFind', 'afterFind',\n 'beforeFindOne', 'afterFindOne',\n 'beforeCount', 'afterCount',\n 'beforeAggregate', 'afterAggregate',\n\n // Write Operations\n 'beforeInsert', 'afterInsert',\n 'beforeUpdate', 'afterUpdate',\n 'beforeDelete', 'afterDelete',\n \n // Bulk Operations (Query-based)\n 'beforeUpdateMany', 'afterUpdateMany',\n 'beforeDeleteMany', 'afterDeleteMany',\n]);\n\n/**\n * Hook Definition Schema\n * \n * Hooks serve as the \"Logic Layer\" in ObjectStack, allowing developers to \n * inject custom code during the data access lifecycle.\n * \n * Use cases:\n * - Data Enrichment (Default values, Calculated fields)\n * - Validation (Complex business rules)\n * - Side Effects (Sending emails, Syncing to external systems)\n * - Security (Filtering data based on context)\n */\nexport const HookSchema = lazySchema(() => z.object({\n /**\n * Unique identifier for the hook\n * Required for debugging and overriding.\n */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Hook unique name (snake_case)'),\n\n /**\n * Human readable label\n */\n label: z.string().optional().describe('Description of what this hook does'),\n\n /**\n * Target Object(s)\n * can be:\n * - Single object: \"account\"\n * - List of objects: [\"account\", \"contact\"]\n * - Wildcard: \"*\" (All objects)\n */\n object: z.union([z.string(), z.array(z.string())]).describe('Target object(s)'),\n\n /**\n * Events to subscribe to\n * Combinations of timing (before/after) and action (find/insert/update/delete/etc)\n */\n events: z.array(HookEvent).describe('Lifecycle events'),\n\n /**\n * Handler Logic\n *\n * Two accepted shapes:\n *\n * - **Inline function** (authoring): `handler: async (ctx) => { ... }`.\n * Convenient in `defineStack({ hooks: [...] })` source files.\n * - **String reference** (build artifact / Studio): `handler: 'my_fn'`.\n * Resolved at runtime against the bundle's `functions` map +\n * anything `engine.registerFunction(name, fn)` added.\n *\n * `objectstack build` automatically lowers inline functions to the\n * string form (using `Hook.name` as the ref) and emits the originals\n * into a sibling `objectstack-runtime.<hash>.mjs` referenced by the\n * top-level `runtimeModule` field. The JSON artifact therefore only\n * ever contains the string form.\n */\n handler: z.union([z.string(), z.custom<(...args: any[]) => any>((v) => typeof v === 'function', { message: 'Expected function' })]).optional().describe('Handler function name (string, post-build) or inline function (pre-build) — DEPRECATED, prefer `body`'),\n\n /**\n * Hook Body (L1 expression or L2 sandboxed JS).\n *\n * Preferred over `handler` for new code. When both are present, runtime\n * loader uses `body` and ignores `handler`.\n *\n * - `{ language: 'expression', source: '...' }` — pure formula (L1).\n * - `{ language: 'js', source: '...', capabilities: [...] }` — sandboxed JS (L2).\n *\n * Authoring convenience: `objectstack build` extracts inline TS handlers from\n * `*.hook.ts` files, AST-checks them, and emits the result here. See plan §6.\n */\n body: HookBodySchema.optional().describe('Hook body — expression (L1) or sandboxed JS (L2)'),\n\n /**\n * Execution Order\n * Lower numbers run first.\n * - System Hooks: 0-99\n * - App Hooks: 100-999\n * - User Hooks: 1000+\n */\n priority: z.number().default(100).describe('Execution priority'),\n\n /**\n * Async / Background Execution\n * If true, the hook runs in the background and does not block the transaction.\n * Only applicable for 'after*' events.\n * Default: false (Blocking)\n */\n async: z.boolean().default(false).describe('Run specifically as fire-and-forget'),\n\n /**\n * Declarative Condition\n * Formula expression evaluated before the handler runs.\n * If provided and evaluates to FALSE, the hook is skipped entirely.\n * Useful for filtering by record data without writing handler code.\n * \n * @example \"status = 'active' AND amount > 1000\"\n */\n condition: ExpressionInputSchema.optional().describe('Predicate (CEL); hook runs only when TRUE. e.g. P`record.status == \"closed\" && record.amount > 1000`'),\n\n /**\n * Human-readable description\n */\n description: z.string().optional().describe('Human-readable description of what this hook does'),\n\n /**\n * Retry Policy\n */\n retryPolicy: z.object({\n maxRetries: z.number().default(3).describe('Maximum retry attempts on failure'),\n backoffMs: z.number().default(1000).describe('Backoff delay between retries in milliseconds'),\n }).optional().describe('Retry policy for failed hook executions'),\n\n /**\n * Execution Timeout\n */\n timeout: z.number().optional().describe('Maximum execution time in milliseconds before the hook is aborted'),\n\n /**\n * Error Policy\n * What to do if the hook throws an exception?\n * - abort: Rollback transaction (if blocking)\n * - log: Log error and continue\n */\n onError: z.enum(['abort', 'log']).default('abort').describe('Error handling strategy'),\n}));\n\n/**\n * Hook Runtime Context\n * Defines what is available to the hook handler during execution.\n * \n * Best Practices:\n * - **Immutability**: `object`, `event`, `id` are immutable.\n * - **Mutability**: `input` and `result` are mutable to allow transformation.\n * - **Encapsulation**: `session` isolates auth info; `transaction` ensures atomicity.\n */\nexport const HookContextSchema = lazySchema(() => z.object({\n /** Tracing ID */\n id: z.string().optional().describe('Unique execution ID for tracing'),\n\n /** Target Object Name */\n object: z.string(),\n \n /** Current Lifecycle Event */\n event: HookEvent,\n\n /** \n * Input Parameters (Mutable)\n * Modify this to change the behavior of the operation.\n * \n * - find: { query: QueryAST, options: DriverOptions }\n * - insert: { doc: Record, options: DriverOptions }\n * - update: { id: ID, doc: Record, options: DriverOptions }\n * - delete: { id: ID, options: DriverOptions }\n * - updateMany: { query: QueryAST, doc: Record, options: DriverOptions }\n * - deleteMany: { query: QueryAST, options: DriverOptions }\n */\n input: z.record(z.string(), z.unknown()).describe('Mutable input parameters'),\n\n /** \n * Operation Result (Mutable)\n * Available in 'after*' events. Modify this to transform the output.\n */\n result: z.unknown().optional().describe('Operation result (After hooks only)'),\n\n /**\n * Data Snapshot\n * The state of the record BEFORE the operation (for update/delete).\n */\n previous: z.record(z.string(), z.unknown()).optional().describe('Record state before operation'),\n\n /**\n * Execution Session\n * Contains authentication and tenancy information.\n */\n session: z.object({\n userId: z.string().optional(),\n tenantId: z.string().optional(),\n roles: z.array(z.string()).optional(),\n accessToken: z.string().optional(),\n isSystem: z.boolean().optional().describe('True when the call was made with an elevated system context (engine self-writes)'),\n }).optional().describe('Current session context'),\n \n /**\n * Transaction Handle\n * If the operation is part of a transaction, use this handle for side-effects.\n */\n transaction: z.unknown().optional().describe('Database transaction handle'),\n\n /**\n * Engine Access\n * Reference to the ObjectQL engine for performing side effects.\n */\n ql: z.unknown().describe('ObjectQL Engine Reference'),\n\n /**\n * Cross-Object API\n * Provides a scoped data access interface for performing CRUD operations\n * on other objects within hooks. Bound to the current execution context\n * (userId, tenantId, transaction).\n *\n * Usage in hooks:\n * const users = ctx.api.object('user');\n * const admin = await users.findOne({ filter: { role: 'admin' } });\n */\n api: z.unknown().optional().describe('Cross-object data access (ScopedContext)'),\n\n /**\n * Current User Info\n * Convenience shortcut for session.userId + additional user metadata.\n * Populated by the engine when available.\n */\n user: z.object({\n id: z.string().optional(),\n name: z.string().optional(),\n email: z.string().optional(),\n }).optional().describe('Current user info shortcut'),\n}));\n\nexport type Hook = z.input<typeof HookSchema>;\nexport type ResolvedHook = z.output<typeof HookSchema>;\nexport type HookEventType = z.infer<typeof HookEvent>;\nexport type HookContext = z.infer<typeof HookContextSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\nimport { QuerySchema } from './query.zod';\n\n/**\n * Transformation Logic\n * Built-in helpers for converting data during import.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const TransformType = z.enum([\n 'none', // Direct copy\n 'constant', // Use a hardcoded value\n 'lookup', // Resolve FK (Name -> ID)\n 'split', // \"John Doe\" -> [\"John\", \"Doe\"]\n 'join', // [\"John\", \"Doe\"] -> \"John Doe\"\n 'javascript', // Custom script (Review security!)\n 'map' // Value mapping (e.g. \"Active\" -> \"active\")\n]);\n\n/**\n * Field Mapping Item\n */\nexport const FieldMappingSchema = lazySchema(() => z.object({\n /** Source Column */\n source: z.union([z.string(), z.array(z.string())]).describe('Source column header(s)'),\n \n /** Target Field */\n target: z.union([z.string(), z.array(z.string())]).describe('Target object field(s)'),\n \n /** Transformation */\n transform: TransformType.default('none'),\n \n /** Configuration for transform */\n params: z.object({\n // Constant\n value: z.unknown().optional(),\n \n // Lookup\n object: z.string().optional(), // Lookup Object\n fromField: z.string().optional(), // Match on (e.g. \"name\")\n toField: z.string().optional(), // Value to take (e.g. \"id\")\n autoCreate: z.boolean().optional(), // Create if missing\n \n // Map\n valueMap: z.record(z.string(), z.unknown()).optional(), // { \"Open\": \"draft\" }\n \n // Split/Join\n separator: z.string().optional()\n }).optional()\n}));\n\n/**\n * Data Mapping Schema\n * Defines a reusable data mapping configuration for ETL operations.\n * \n * **NAMING CONVENTION:**\n * Mapping names are machine identifiers and must be lowercase snake_case.\n * \n * @example Good mapping names\n * - 'salesforce_to_crm'\n * - 'csv_import_contacts'\n * - 'api_sync_orders'\n * \n * @example Bad mapping names (will be rejected)\n * - 'SalesforceToCRM' (PascalCase)\n * - 'CSV Import' (spaces)\n */\nexport const MappingSchema = lazySchema(() => z.object({\n /** Identity */\n name: SnakeCaseIdentifierSchema.describe('Mapping unique name (lowercase snake_case)'),\n label: z.string().optional(),\n \n /** Scope */\n sourceFormat: z.enum(['csv', 'json', 'xml', 'sql']).default('csv'),\n targetObject: z.string().describe('Target Object Name'),\n \n /** Column Mappings */\n fieldMapping: z.array(FieldMappingSchema),\n \n /** Upsert Logic */\n mode: z.enum(['insert', 'update', 'upsert']).default('insert'),\n upsertKey: z.array(z.string()).optional().describe('Fields to match for upsert (e.g. email)'),\n \n /** Extract Logic (For Export) */\n extractQuery: QuerySchema.optional().describe('Query to run for export only'),\n \n /** Error Handling */\n errorPolicy: z.enum(['skip', 'abort', 'retry']).default('skip'),\n batchSize: z.number().default(1000)\n}));\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n/** Authoring input for {@link Mapping} — defaulted fields are optional. */\nexport type MappingInput = z.input<typeof MappingSchema>;\n\n/**\n * Type-safe factory for a data import/export mapping. Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: Mapping` literal.\n */\nexport function defineMapping(config: z.input<typeof MappingSchema>): Mapping {\n return MappingSchema.parse(config);\n}\nexport type FieldMapping = z.infer<typeof FieldMappingSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Execution Context Schema\n * \n * Defines the runtime context that flows from HTTP request → data operations.\n * This is the \"identity + environment\" envelope that every data operation can carry.\n * \n * Design:\n * - All fields are optional for backward compatibility\n * - `isSystem` bypasses permission checks (for internal/migration operations)\n * - `transaction` carries the database transaction handle for atomicity\n * - `traceId` enables distributed tracing across microservices\n * \n * Usage:\n * engine.find('account', { context: { userId: '...', tenantId: '...' } })\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const ExecutionContextSchema = lazySchema(() => z.object({\n /** Current user ID (resolved from session) */\n userId: z.string().optional(),\n\n /**\n * Stable principal label for AUDIT ATTRIBUTION when the operation is not a\n * real user — e.g. a service token (`svc:<name>`) or an automation. The audit\n * writer records this on `sys_audit_log.actor` so a non-user-authenticated\n * write (the class that left `user_id` null and made the os-790m7q env-delete\n * unattributable) is still attributable. `userId` takes precedence when set;\n * this is the fallback. The runtime/host sets it (e.g. the control plane's\n * service-mode auth) — the framework only defines + records the contract.\n */\n actor: z.string().optional(),\n\n /**\n * Current user's unique email (resolved from session, falling back to a\n * `sys_user` lookup). Exposed to RLS as `current_user.email` for seedable,\n * human-readable owner scoping. Unique by auth invariant — unlike display\n * `name`, which is intentionally not surfaced to RLS.\n */\n email: z.string().optional(),\n \n /** Current organization/tenant ID (resolved from session.activeOrganizationId) */\n tenantId: z.string().optional(),\n\n /**\n * Active reference timezone (IANA name, e.g. `America/New_York`), resolved\n * once per request from the `localization` settings (platform default →\n * global → tenant; ADR-0053 Phase 2). When unset, consumers treat it as\n * `UTC` — today's behavior.\n */\n timezone: z.string().optional(),\n\n /**\n * Active locale (BCP-47, e.g. `en-US`), resolved from the `localization`\n * settings alongside `timezone`. Drives message catalogs and number/date\n * formatting. When unset, consumers treat it as `en-US`.\n */\n locale: z.string().optional(),\n\n /**\n * Active default currency (ISO 4217, e.g. `USD`, `CNY`), resolved from the\n * `localization` settings alongside `timezone`/`locale`. The tenant-level\n * fallback applied when a currency field/measure omits its own (the\n * `localization.currency` manifest contract). Undefined when no tenant\n * default is configured — consumers then render a plain number.\n */\n currency: z.string().optional(),\n\n /** User role names (resolved from Member + Role) */\n roles: z.array(z.string()).default([]),\n \n /** Aggregated permission names (resolved from PermissionSet) */\n permissions: z.array(z.string()).default([]),\n\n /**\n * Aggregated system permissions (union of `PermissionSet.systemPermissions`\n * across the user's resolved permission sets). Used to gate app\n * entry (`AppSchema.requiredPermissions`) and system-level capabilities\n * like `manage_users`, `studio.access`, `setup.access`.\n */\n systemPermissions: z.array(z.string()).optional(),\n\n /**\n * Aggregated tab/app visibility overrides (merged most-permissive across\n * the user's resolved permission sets: visible > default_on > default_off > hidden).\n * Keyed by app name. A `hidden` value forces an app off the user's\n * authorized list even if `requiredPermissions` would otherwise pass.\n */\n tabPermissions: z.record(z.string(), z.enum(['visible', 'hidden', 'default_on', 'default_off'])).optional(),\n\n /**\n * IDs of all users in the active organization. Pre-resolved so RLS\n * expressions can scope visibility of identity tables (`sys_user`)\n * via `IN (current_user.org_user_ids)` without needing subquery\n * support in the RLS compiler. Populated by the runtime's\n * resolveExecutionContext from `sys_member`.\n */\n org_user_ids: z.array(z.string()).optional(),\n\n /**\n * Pre-resolved dynamic-membership arrays for RLS (§7.3.1). The runtime\n * resolves set-membership that would otherwise need a subquery — team\n * members under a manager, accounts in a sales rep's territories,\n * records shared with the user — and stages each set here under a\n * stable key. RLS policies then reference a key via\n * `field IN (current_user.<key>)`, which the compiler resolves against\n * this bag without any subquery support.\n *\n * `org_user_ids` is the one well-known, always-populated membership set\n * and stays a named field for back-compat; everything else lives here.\n * Keys are arbitrary `current_user.*` names; values are id arrays. A\n * missing or empty array makes the referencing policy drop out and\n * (if it was the only policy) fail closed — never fail open.\n *\n * @example { team_member_ids: ['u2', 'u3'], territory_account_ids: ['a7'] }\n */\n rlsMembership: z.record(z.string(), z.array(z.string())).optional(),\n\n /** Whether this is a system-level operation (bypasses permission checks) */\n isSystem: z.boolean().default(false),\n \n /** Raw access token (for external API call pass-through) */\n accessToken: z.string().optional(),\n \n /** Database transaction handle */\n transaction: z.unknown().optional(),\n \n /** Request trace ID (for distributed tracing) */\n traceId: z.string().optional(),\n}));\n\nexport type ExecutionContext = z.infer<typeof ExecutionContextSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FilterConditionSchema } from './filter.zod';\nimport { SortNodeSchema, QuerySchema, FullTextSearchSchema, FieldNodeSchema, AggregationNodeSchema } from './query.zod';\nimport { ExecutionContextSchema } from '../kernel/execution-context.zod';\n\n/**\n * Data Engine Protocol\n * \n * Defines the standard interface for data persistence engines in ObjectStack.\n * This protocol abstracts the underlying storage mechanism (SQL, NoSQL, API, Memory),\n * allowing the ObjectQL engine to execute standardized CRUD and Aggregation operations\n * regardless of where the data resides.\n * \n * The Data Engine acts as the \"Driver\" layer in the Hexagonal Architecture.\n */\n\n// ==========================================================================\n// 1. Shared Definitions\n// ==========================================================================\n\n/**\n * Data Engine Query filter conditions\n * Supports simple key-value map or complex Logic/Field expressions (DSL)\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const DataEngineFilterSchema = lazySchema(() => z.union([\n z.record(z.string(), z.unknown()),\n FilterConditionSchema\n]).describe('Data Engine query filter conditions'));\n\n/**\n * Sort order definition\n * Supports:\n * - { name: 'asc' }\n * - { name: 1 }\n * - [{ field: 'name', order: 'asc' }]\n */\nexport const DataEngineSortSchema = lazySchema(() => z.union([\n z.record(z.string(), z.enum(['asc', 'desc'])), \n z.record(z.string(), z.union([z.literal(1), z.literal(-1)])),\n z.array(SortNodeSchema)\n]).describe('Sort order definition'));\n\n// ==========================================================================\n// 1b. Base Engine Options (shared context)\n// ==========================================================================\n\n/**\n * Base Engine Options\n * \n * All Data Engine operation options extend this schema to carry\n * an optional ExecutionContext for identity, tenant, and transaction propagation.\n */\nexport const BaseEngineOptionsSchema = lazySchema(() => z.object({\n /** Execution context (identity, tenant, transaction) */\n context: ExecutionContextSchema.optional(),\n}));\n\n// ==========================================================================\n// 2. method: FIND (QueryAST-aligned)\n// ==========================================================================\n\n/**\n * Engine Query Options — QueryAST-aligned parameters for IDataEngine.find/findOne.\n * \n * Uses standard QueryAST field names (where/fields/orderBy/limit/offset/expand)\n * so that no mechanical translation is needed between the Engine and Driver layers.\n * \n * @example\n * ```ts\n * engine.find('account', {\n * where: { status: 'active' },\n * fields: ['id', 'name', 'email'],\n * orderBy: [{ field: 'name', order: 'asc' }],\n * limit: 10,\n * offset: 20,\n * expand: { owner: { object: 'user', fields: ['name'] } },\n * });\n * ```\n */\nexport const EngineQueryOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions (WHERE) — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n\n /** Fields to retrieve (SELECT) — standard QueryAST `fields` */\n fields: z.array(FieldNodeSchema).optional(),\n\n /** Sorting instructions (ORDER BY) — standard QueryAST `orderBy` */\n orderBy: z.array(SortNodeSchema).optional(),\n\n /** Max records to return (LIMIT) */\n limit: z.number().optional(),\n\n /** Records to skip (OFFSET) — standard QueryAST `offset` */\n offset: z.number().optional(),\n\n /** Alias for limit (OData compatibility) */\n top: z.number().optional(),\n\n /** Cursor for keyset pagination */\n cursor: z.record(z.string(), z.unknown()).optional(),\n\n /** Full-text search configuration */\n search: FullTextSearchSchema.optional(),\n\n /**\n * Recursive relation loading map (expand).\n * \n * Keys are lookup/master_detail field names; values are nested QueryAST\n * objects that control select, filter, sort, and further expansion on\n * the related object. The engine resolves expand via batch $in queries\n * (driver-agnostic) with a default max depth of 3.\n */\n expand: z.lazy(() => z.record(z.string(), QuerySchema)).optional(),\n\n /** SELECT DISTINCT flag */\n distinct: z.boolean().optional(),\n}).describe('QueryAST-aligned query options for IDataEngine.find() operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineQueryOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineQueryOptionsSchema` instead.\n * This schema uses legacy parameter names (filter/select/sort/skip/populate)\n * that require mechanical translation to QueryAST. Migrate to the\n * QueryAST-aligned `EngineQueryOptionsSchema` (where/fields/orderBy/offset/expand).\n */\nexport const DataEngineQueryOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineQueryOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n /** @deprecated Use `fields` (EngineQueryOptionsSchema) */\n select: z.array(z.string()).optional(),\n /** @deprecated Use `orderBy` (EngineQueryOptionsSchema) */\n sort: DataEngineSortSchema.optional(),\n limit: z.number().int().min(1).optional(),\n /** @deprecated Use `offset` (EngineQueryOptionsSchema) */\n skip: z.number().int().min(0).optional(),\n top: z.number().int().min(1).optional(),\n /** @deprecated Use `expand` (EngineQueryOptionsSchema) */\n populate: z.array(z.string()).optional(),\n}).describe('Query options for IDataEngine.find() operations'));\n\n// ==========================================================================\n// 3. method: INSERT\n// ==========================================================================\n\nexport const DataEngineInsertOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** \n * Return the inserted record(s)? \n * Some drivers support RETURNING clause for efficiency.\n * Default: true\n */\n returning: z.boolean().default(true).optional(),\n}).describe('Options for DataEngine.insert operations'));\n\n// ==========================================================================\n// 4. method: UPDATE (QueryAST-aligned)\n// ==========================================================================\n\nexport const EngineUpdateOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions to identify records to update — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n /** Perform an upsert? If true, insert if not found. */\n upsert: z.boolean().default(false).optional(),\n /** Update multiple records? If false, only the first match is updated. Default: false */\n multi: z.boolean().default(false).optional(),\n /** Return the updated record(s)? Default: false (returns update count/status) */\n returning: z.boolean().default(false).optional(),\n}).describe('QueryAST-aligned options for DataEngine.update operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineUpdateOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineUpdateOptionsSchema` instead.\n * Migrate `filter` → `where`.\n */\nexport const DataEngineUpdateOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineUpdateOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n upsert: z.boolean().default(false).optional(),\n multi: z.boolean().default(false).optional(),\n returning: z.boolean().default(false).optional(),\n}).describe('Options for DataEngine.update operations'));\n\n// ==========================================================================\n// 5. method: DELETE (QueryAST-aligned)\n// ==========================================================================\n\nexport const EngineDeleteOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions to identify records to delete — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n /** Delete multiple records? If false, only the first match is deleted. Default: false */\n multi: z.boolean().default(false).optional(),\n}).describe('QueryAST-aligned options for DataEngine.delete operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineDeleteOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineDeleteOptionsSchema` instead.\n * Migrate `filter` → `where`.\n */\nexport const DataEngineDeleteOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineDeleteOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n multi: z.boolean().default(false).optional(),\n}).describe('Options for DataEngine.delete operations'));\n\n// ==========================================================================\n// 6. method: AGGREGATE (QueryAST-aligned)\n// ==========================================================================\n\nexport const EngineAggregateOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions (WHERE) — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n /** Group By fields */\n groupBy: z.array(z.string()).optional(),\n /**\n * Aggregation definitions — uses standard AggregationNodeSchema (`function` key).\n * e.g. [{ function: 'sum', field: 'amount', alias: 'total' }]\n */\n aggregations: z.array(AggregationNodeSchema).optional(),\n /**\n * Reference timezone (IANA name) for date bucketing (ADR-0053 Phase 2).\n * When set to a non-UTC zone, `groupBy` items carrying a `dateGranularity`\n * bucket on that zone's calendar days. Unset or `'UTC'` keeps the UTC\n * fast path (native driver `date_trunc`).\n */\n timezone: z.string().optional(),\n}).describe('QueryAST-aligned options for DataEngine.aggregate operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineAggregateOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineAggregateOptionsSchema` instead.\n * Migrate `filter` → `where`, aggregation `method` → `function`.\n */\nexport const DataEngineAggregateOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineAggregateOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n groupBy: z.array(z.string()).optional(),\n /** \n * @deprecated Use `EngineAggregateOptionsSchema` with standard AggregationNodeSchema (`function` key).\n */\n aggregations: z.array(z.object({\n field: z.string(),\n method: z.enum(['count', 'sum', 'avg', 'min', 'max', 'count_distinct']),\n alias: z.string().optional()\n })).optional(),\n}).describe('Options for DataEngine.aggregate operations'));\n\n// ==========================================================================\n// 7. method: COUNT (QueryAST-aligned)\n// ==========================================================================\n\nexport const EngineCountOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n}).describe('QueryAST-aligned options for DataEngine.count operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineCountOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineCountOptionsSchema` instead.\n * Migrate `filter` → `where`.\n */\nexport const DataEngineCountOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineCountOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n}).describe('Options for DataEngine.count operations'));\n\n// ==========================================================================\n// 8. Definition (Contract)\n// ==========================================================================\n\nexport const DataEngineContractSchema = lazySchema(() => z.object({\n find: z.function()\n .input(z.tuple([z.string(), EngineQueryOptionsSchema.optional()]))\n .output(z.promise(z.array(z.unknown()))),\n \n findOne: z.function()\n .input(z.tuple([z.string(), EngineQueryOptionsSchema.optional()]))\n .output(z.promise(z.unknown())),\n \n insert: z.function()\n .input(z.tuple([z.string(), z.union([z.record(z.string(), z.unknown()), z.array(z.record(z.string(), z.unknown()))]), DataEngineInsertOptionsSchema.optional()]))\n .output(z.promise(z.unknown())),\n \n update: z.function()\n .input(z.tuple([z.string(), z.record(z.string(), z.unknown()), EngineUpdateOptionsSchema.optional()]))\n .output(z.promise(z.unknown())),\n \n delete: z.function()\n .input(z.tuple([z.string(), EngineDeleteOptionsSchema.optional()]))\n .output(z.promise(z.unknown())),\n \n count: z.function()\n .input(z.tuple([z.string(), EngineCountOptionsSchema.optional()]))\n .output(z.promise(z.number())),\n \n aggregate: z.function()\n .input(z.tuple([z.string(), EngineAggregateOptionsSchema]))\n .output(z.promise(z.array(z.unknown())))\n}).describe('Standard Data Engine Contract'));\n\n// ==========================================================================\n// 9. Virtualization & RPC Protocol\n// ==========================================================================\n\n/**\n * Data Engine RPC Request (Virtual ObjectQL)\n * \n * This schema defines the serialized format for executing Data Engine operations\n * via HTTP, Message Queue, or Plugin boundaries.\n * \n * It enables \"Virtual Data Engines\" where the implementation resides in a \n * separate microservice or plugin.\n */\n\n/**\n * RPC backward-compatibility mixin — shared `@deprecated filter` field.\n * When both `filter` and `where` are present, the protocol/engine ignores\n * `filter` in favor of `where`; only one should be provided.\n */\nconst RpcLegacyFilterMixin = {\n /** @deprecated Use `where` */\n filter: DataEngineFilterSchema.optional(),\n};\n\n/**\n * RPC query options that accept BOTH new (where/fields/orderBy) and\n * legacy (filter/select/sort/skip/populate) parameter names.\n * \n * **Precedence:** When both legacy and new keys are present for the same\n * concern, the protocol normalizer uses the new key (`where` > `filter`,\n * `fields` > `select`, `orderBy` > `sort`, `offset` > `skip`,\n * `expand` > `populate`). Callers should not mix vocabularies.\n */\nconst RpcQueryOptionsSchema = EngineQueryOptionsSchema.extend({\n ...RpcLegacyFilterMixin,\n /** @deprecated Use `fields` */\n select: z.array(z.string()).optional(),\n /** @deprecated Use `orderBy` */\n sort: DataEngineSortSchema.optional(),\n /** @deprecated Use `offset` */\n skip: z.number().int().min(0).optional(),\n /** @deprecated Use `expand` */\n populate: z.array(z.string()).optional(),\n});\n\nexport const DataEngineFindRequestSchema = lazySchema(() => z.object({\n method: z.literal('find'),\n object: z.string(),\n query: RpcQueryOptionsSchema.optional()\n}));\n\nexport const DataEngineFindOneRequestSchema = lazySchema(() => z.object({\n method: z.literal('findOne'),\n object: z.string(),\n query: RpcQueryOptionsSchema.optional()\n}));\n\nexport const DataEngineInsertRequestSchema = lazySchema(() => z.object({\n method: z.literal('insert'),\n object: z.string(),\n data: z.union([z.record(z.string(), z.unknown()), z.array(z.record(z.string(), z.unknown()))]),\n options: DataEngineInsertOptionsSchema.optional()\n}));\n\nexport const DataEngineUpdateRequestSchema = lazySchema(() => z.object({\n method: z.literal('update'),\n object: z.string(),\n data: z.record(z.string(), z.unknown()),\n id: z.union([z.string(), z.number()]).optional().describe('ID for single update, or use where in options'),\n options: EngineUpdateOptionsSchema.extend(RpcLegacyFilterMixin).optional()\n}));\n\nexport const DataEngineDeleteRequestSchema = lazySchema(() => z.object({\n method: z.literal('delete'),\n object: z.string(),\n id: z.union([z.string(), z.number()]).optional().describe('ID for single delete, or use where in options'),\n options: EngineDeleteOptionsSchema.extend(RpcLegacyFilterMixin).optional()\n}));\n\nexport const DataEngineCountRequestSchema = lazySchema(() => z.object({\n method: z.literal('count'),\n object: z.string(),\n query: EngineCountOptionsSchema.extend(RpcLegacyFilterMixin).optional()\n}));\n\nexport const DataEngineAggregateRequestSchema = lazySchema(() => z.object({\n method: z.literal('aggregate'),\n object: z.string(),\n query: EngineAggregateOptionsSchema.extend(RpcLegacyFilterMixin)\n}));\n\n/**\n * Data Engine Execute Request (Raw Command)\n * Execute a raw command/query native to the driver (e.g. SQL, Shell, Remote API).\n */\nexport const DataEngineExecuteRequestSchema = lazySchema(() => z.object({\n method: z.literal('execute'),\n /** The abstract command (string SQL, or JSON object) */\n command: z.unknown(),\n /** Optional options */\n options: z.record(z.string(), z.unknown()).optional()\n}));\n\n/**\n * Data Engine Vector Find Request (AI/RAG)\n * Perform a similarity search using vector embeddings.\n */\nexport const DataEngineVectorFindRequestSchema = lazySchema(() => z.object({\n method: z.literal('vectorFind'),\n object: z.string(),\n /** The vector embedding to search for */\n vector: z.array(z.number()),\n /** Optional pre-filter (Metadata filtering) — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n /** Fields to retrieve — standard QueryAST `fields` */\n fields: z.array(z.string()).optional(),\n /** Number of results */\n limit: z.number().int().default(5).optional(),\n /** Minimum similarity score (0-1) or distance threshold */\n threshold: z.number().optional()\n}));\n\n/**\n * Data Engine Batch Request\n * Execute multiple operations in a single transaction/request efficiently.\n */\nexport const DataEngineBatchRequestSchema = lazySchema(() => z.object({\n method: z.literal('batch'),\n requests: z.array(z.discriminatedUnion('method', [\n DataEngineFindRequestSchema,\n DataEngineFindOneRequestSchema,\n DataEngineInsertRequestSchema,\n DataEngineUpdateRequestSchema,\n DataEngineDeleteRequestSchema,\n DataEngineCountRequestSchema,\n DataEngineAggregateRequestSchema,\n DataEngineExecuteRequestSchema,\n DataEngineVectorFindRequestSchema\n ])),\n /** \n * Transaction Mode\n * - true: All or nothing (Atomic)\n * - false: Best effort, continue on error\n */\n transaction: z.boolean().default(true).optional()\n}));\n\n/**\n * Unified Data Engine Request Union\n * Use this to validate any incoming \"Virtual ObjectQL\" request.\n */\nexport const DataEngineRequestSchema = lazySchema(() => z.discriminatedUnion('method', [\n DataEngineFindRequestSchema,\n DataEngineFindOneRequestSchema,\n DataEngineInsertRequestSchema,\n DataEngineUpdateRequestSchema,\n DataEngineDeleteRequestSchema,\n DataEngineCountRequestSchema,\n DataEngineAggregateRequestSchema,\n DataEngineBatchRequestSchema,\n DataEngineExecuteRequestSchema,\n DataEngineVectorFindRequestSchema\n]).describe('Virtual ObjectQL Request Protocol'));\n\n// ==========================================================================\n// 10. Type Exports\n// ==========================================================================\n\n// --- New: QueryAST-aligned types (preferred) ---\nexport type EngineQueryOptions = z.infer<typeof EngineQueryOptionsSchema>;\nexport type EngineUpdateOptions = z.infer<typeof EngineUpdateOptionsSchema>;\nexport type EngineDeleteOptions = z.infer<typeof EngineDeleteOptionsSchema>;\nexport type EngineAggregateOptions = z.infer<typeof EngineAggregateOptionsSchema>;\nexport type EngineCountOptions = z.infer<typeof EngineCountOptionsSchema>;\n\n// --- Legacy: deprecated types (kept for backward compatibility) ---\nexport type DataEngineFilter = z.infer<typeof DataEngineFilterSchema>;\n/** @deprecated Use standard `SortNode[]` from QueryAST instead. */\nexport type DataEngineSort = z.infer<typeof DataEngineSortSchema>;\nexport type BaseEngineOptions = z.infer<typeof BaseEngineOptionsSchema>;\n/** @deprecated Use `EngineQueryOptions` instead. */\nexport type DataEngineQueryOptions = z.infer<typeof DataEngineQueryOptionsSchema>;\nexport type DataEngineInsertOptions = z.infer<typeof DataEngineInsertOptionsSchema>;\n/** @deprecated Use `EngineUpdateOptions` instead. */\nexport type DataEngineUpdateOptions = z.infer<typeof DataEngineUpdateOptionsSchema>;\n/** @deprecated Use `EngineDeleteOptions` instead. */\nexport type DataEngineDeleteOptions = z.infer<typeof DataEngineDeleteOptionsSchema>;\n/** @deprecated Use `EngineAggregateOptions` instead. */\nexport type DataEngineAggregateOptions = z.infer<typeof DataEngineAggregateOptionsSchema>;\n/** @deprecated Use `EngineCountOptions` instead. */\nexport type DataEngineCountOptions = z.infer<typeof DataEngineCountOptionsSchema>;\nexport type DataEngineRequest = z.infer<typeof DataEngineRequestSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n// ============================================================================\n// Shared Enumerations\n// ============================================================================\n\n/** Aggregation functions used across query, data-engine, analytics, field */\nimport { lazySchema } from './lazy-schema';\nexport const AggregationFunctionEnum = z.enum([\n 'count', 'sum', 'avg', 'min', 'max',\n 'count_distinct', 'percentile', 'median', 'stddev', 'variance',\n]).describe('Standard aggregation functions');\nexport type AggregationFunction = z.infer<typeof AggregationFunctionEnum>;\n\n/** Sort direction used across query, data-engine, analytics */\nexport const SortDirectionEnum = z.enum(['asc', 'desc'])\n .describe('Sort order direction');\nexport type SortDirection = z.infer<typeof SortDirectionEnum>;\n\n/** Reusable sort item — field + direction pair used across views, data sources, filters */\nexport const SortItemSchema = lazySchema(() => z.object({\n field: z.string().describe('Field name to sort by'),\n order: SortDirectionEnum.describe('Sort direction'),\n}).describe('Sort field and direction pair'));\nexport type SortItem = z.infer<typeof SortItemSchema>;\n\n/** CRUD mutation events used across hook, validation, object CDC */\nexport const MutationEventEnum = z.enum([\n 'insert', 'update', 'delete', 'upsert',\n]).describe('Data mutation event types');\nexport type MutationEvent = z.infer<typeof MutationEventEnum>;\n\n/** Database isolation levels — unified format */\nexport const IsolationLevelEnum = z.enum([\n 'read_uncommitted', 'read_committed', 'repeatable_read', 'serializable', 'snapshot',\n]).describe('Transaction isolation levels (snake_case standard)');\nexport type IsolationLevel = z.infer<typeof IsolationLevelEnum>;\n\n/** Cache eviction strategies */\nexport const CacheStrategyEnum = z.enum(['lru', 'lfu', 'ttl', 'fifo'])\n .describe('Cache eviction strategy');\nexport type CacheStrategy = z.infer<typeof CacheStrategyEnum>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { QuerySchema, DateGranularity } from '../data/query.zod';\nimport { IsolationLevelEnum } from '../shared/enums.zod';\n\n/**\n * Common Driver Options\n * Passed to most driver methods to control behavior (transactions, timeouts, etc.)\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const DriverOptionsSchema = lazySchema(() => z.object({\n /**\n * Transaction handle/identifier.\n * If provided, the operation must run within this transaction.\n */\n transaction: z.unknown().optional().describe('Transaction handle'),\n\n /**\n * Operation timeout in milliseconds.\n */\n timeout: z.number().optional().describe('Timeout in ms'),\n\n /**\n * Whether to bypass cache and force a fresh read.\n */\n skipCache: z.boolean().optional().describe('Bypass cache'),\n\n /**\n * Distributed Tracing Context.\n * Used for passing OpenTelemetry span context or request IDs for observability.\n */\n traceContext: z.record(z.string(), z.string()).optional().describe('OpenTelemetry context or request ID'),\n\n /**\n * Tenant Identifier.\n * For multi-tenant databases (row-level security or schema-per-tenant).\n */\n tenantId: z.string().optional().describe('Tenant Isolation identifier'),\n\n /**\n * Business reference timezone (IANA name, e.g. `Asia/Shanghai`) for the\n * request, threaded from `ExecutionContext.timezone` (ADR-0053). Drivers that\n * generate date-dependent values — notably `autonumber` date tokens\n * (`{YYYYMMDD}`) — resolve the calendar day in this zone, falling back to UTC.\n */\n timezone: z.string().optional().describe('Business reference timezone (IANA) for date-dependent generation, e.g. autonumber date tokens'),\n}));\n\n/**\n * Driver Capabilities Schema\n * \n * Defines what features a database driver supports.\n * This allows ObjectQL to adapt its behavior based on underlying database capabilities.\n * Enhanced with granular capability flags for better feature detection.\n */\nexport const DriverCapabilitiesSchema = lazySchema(() => z.object({\n // ============================================================================\n // Basic CRUD Operations\n // ============================================================================\n \n /**\n * Whether the driver supports create operations.\n */\n create: z.boolean().default(true).describe('Supports CREATE operations'),\n \n /**\n * Whether the driver supports read operations.\n */\n read: z.boolean().default(true).describe('Supports READ operations'),\n \n /**\n * Whether the driver supports update operations.\n */\n update: z.boolean().default(true).describe('Supports UPDATE operations'),\n \n /**\n * Whether the driver supports delete operations.\n */\n delete: z.boolean().default(true).describe('Supports DELETE operations'),\n\n // ============================================================================\n // Bulk Operations\n // ============================================================================\n \n /**\n * Whether the driver supports bulk create operations.\n */\n bulkCreate: z.boolean().default(false).describe('Supports bulk CREATE operations'),\n \n /**\n * Whether the driver supports bulk update operations.\n */\n bulkUpdate: z.boolean().default(false).describe('Supports bulk UPDATE operations'),\n \n /**\n * Whether the driver supports bulk delete operations.\n */\n bulkDelete: z.boolean().default(false).describe('Supports bulk DELETE operations'),\n\n // ============================================================================\n // Transaction & Connection Management\n // ============================================================================\n \n /**\n * Whether the driver supports database transactions.\n * If true, beginTransaction, commit, and rollback must be implemented.\n */\n transactions: z.boolean().default(false).describe('Supports ACID transactions'),\n \n /**\n * Whether the driver supports savepoints within transactions.\n */\n savepoints: z.boolean().default(false).describe('Supports transaction savepoints'),\n \n /**\n * Supported transaction isolation levels.\n */\n isolationLevels: z.array(IsolationLevelEnum).optional().describe('Supported isolation levels'),\n\n // ============================================================================\n // Query Operations\n // ============================================================================\n \n /**\n * Whether the driver supports WHERE clause filters.\n * If false, ObjectQL will fetch all records and filter in memory.\n * \n * Example: Memory driver might not support complex filter conditions.\n */\n queryFilters: z.boolean().default(true).describe('Supports WHERE clause filtering'),\n\n /**\n * Whether the driver supports aggregation functions (COUNT, SUM, AVG, etc.).\n * If false, ObjectQL will compute aggregations in memory.\n */\n queryAggregations: z.boolean().default(false).describe('Supports GROUP BY and aggregation functions'),\n\n /**\n * Per-granularity native SQL date bucketing support.\n *\n * Drivers that can emit `DATE_TRUNC` / `DATE_FORMAT` / `strftime` / `$dateTrunc`\n * for `groupBy` items shaped as `{ field, dateGranularity }` should advertise\n * the granularities they handle here, e.g. `{ day: true, week: false }` for a\n * SQLite build whose `strftime` lacks ISO week (`%V`).\n *\n * When omitted (or a granularity is falsy), the engine falls back to fetching\n * raw rows and bucketing in-memory (`applyInMemoryAggregation`), which is\n * always correct but loads the full row set into Node.\n *\n * **Output contract** (CRITICAL): the native SQL expression MUST produce the\n * same string label as `bucketDateValue()` in `@objectstack/objectql` —\n * `YYYY` / `YYYY-MM` / `YYYY-MM-DD` / `YYYY-Q[1-4]` / `YYYY-W[01-53]` (ISO-8601,\n * weeks start Monday). Any drift will misalign drill `groupKey` filters\n * between the two paths.\n */\n queryDateGranularity: z.record(DateGranularity, z.boolean()).optional()\n .describe('Per-granularity native date bucketing (day/week/month/quarter/year). Missing keys fall back to in-memory bucketing.'),\n\n /**\n * Whether the driver supports ORDER BY sorting.\n * If false, ObjectQL will sort results in memory.\n */\n querySorting: z.boolean().default(true).describe('Supports ORDER BY sorting'),\n\n /**\n * Whether the driver supports LIMIT/OFFSET pagination.\n * If false, ObjectQL will fetch all records and paginate in memory.\n */\n queryPagination: z.boolean().default(true).describe('Supports LIMIT/OFFSET pagination'),\n\n /**\n * Whether the driver supports window functions (ROW_NUMBER, RANK, LAG, LEAD, etc.).\n * If false, ObjectQL will compute window functions in memory.\n */\n queryWindowFunctions: z.boolean().default(false).describe('Supports window functions with OVER clause'),\n\n /**\n * Whether the driver supports subqueries (nested SELECT statements).\n * If false, ObjectQL will execute queries separately and combine results.\n */\n querySubqueries: z.boolean().default(false).describe('Supports subqueries'),\n \n /**\n * Whether the driver supports Common Table Expressions (WITH clause).\n */\n queryCTE: z.boolean().default(false).describe('Supports Common Table Expressions (WITH clause)'),\n\n /**\n * Whether the driver supports SQL-style joins.\n * If false, ObjectQL will fetch related data separately and join in memory.\n */\n joins: z.boolean().default(false).describe('Supports SQL joins'),\n\n // ============================================================================\n // Advanced Features\n // ============================================================================\n \n /**\n * Whether the driver supports full-text search.\n * If true, text search queries can be pushed to the database.\n */\n fullTextSearch: z.boolean().default(false).describe('Supports full-text search'),\n \n /**\n * Whether the driver supports JSON querying capabilities.\n */\n jsonQuery: z.boolean().default(false).describe('Supports JSON field querying'),\n \n /**\n * Whether the driver supports geospatial queries.\n */\n geospatialQuery: z.boolean().default(false).describe('Supports geospatial queries'),\n \n /**\n * Whether the driver supports streaming large result sets.\n */\n streaming: z.boolean().default(false).describe('Supports result streaming (cursors/iterators)'),\n\n /**\n * Whether the driver supports JSON field types.\n * If false, JSON data will be serialized as strings.\n */\n jsonFields: z.boolean().default(false).describe('Supports JSON field types'),\n\n /**\n * Whether the driver supports array field types.\n * If false, arrays will be stored as JSON strings or in separate tables.\n */\n arrayFields: z.boolean().default(false).describe('Supports array field types'),\n\n /**\n * Whether the driver supports vector embeddings and similarity search.\n * Required for RAG (Retrieval-Augmented Generation) and AI features.\n */\n vectorSearch: z.boolean().default(false).describe('Supports vector embeddings and similarity search'),\n\n /**\n * Whether the driver natively generates persistent autonumber / sequence\n * values inside `create()` / `bulkCreate()` / `upsert()` (e.g. a DB-backed\n * `_objectstack_sequences` table that survives restarts and is atomic across\n * concurrent writers / instances).\n *\n * When true, the ObjectQL engine MUST NOT pre-fill `autonumber` fields with\n * its own in-memory counter — the driver owns generation as the single,\n * persistent source of truth, and required-validation exempts the field\n * because the value is assigned after validation. When false/absent (memory,\n * mongodb), the engine falls back to its in-memory generator.\n *\n * Optional so existing driver capability objects need not be updated.\n */\n autonumber: z.boolean().optional().describe('Driver natively generates persistent autonumber/sequence values'),\n\n // ============================================================================\n // Schema Management\n // ============================================================================\n \n /**\n * Whether the driver supports automatic schema synchronization.\n */\n schemaSync: z.boolean().default(false).describe('Supports automatic schema synchronization'),\n\n /**\n * Whether the driver supports batching multiple schema sync operations\n * into a single (or fewer) round-trips for the DDL phase. When true,\n * the engine may call `syncSchemasBatch()` instead of calling\n * `syncSchema()` per object, reducing network round-trips for remote drivers.\n */\n batchSchemaSync: z.boolean().default(false).describe('Supports batched schema sync to reduce schema DDL round-trips'),\n \n /**\n * Whether the driver supports database migrations.\n */\n migrations: z.boolean().default(false).describe('Supports database migrations'),\n \n /**\n * Whether the driver supports index management.\n */\n indexes: z.boolean().default(false).describe('Supports index creation and management'),\n\n // ============================================================================\n // Performance & Optimization\n // ============================================================================\n \n /**\n * Whether the driver supports connection pooling.\n */\n connectionPooling: z.boolean().default(false).describe('Supports connection pooling'),\n \n /**\n * Whether the driver supports prepared statements.\n */\n preparedStatements: z.boolean().default(false).describe('Supports prepared statements (SQL injection prevention)'),\n \n /**\n * Whether the driver supports query result caching.\n */\n queryCache: z.boolean().default(false).describe('Supports query result caching'),\n}));\n\n/**\n * Unified Database Driver Interface\n * \n * This is the contract that all storage adapters (Postgres, Mongo, Excel, Salesforce) must implement.\n * It abstracts the underlying engine, enabling ObjectStack to be \"Database Agnostic\".\n */\nexport const DriverInterfaceSchema = lazySchema(() => z.object({\n /**\n * Driver name (e.g., 'postgresql', 'mongodb', 'rest_api').\n */\n name: z.string().describe('Driver unique name'),\n\n /**\n * Driver version.\n */\n version: z.string().describe('Driver version'),\n\n /**\n * Capabilities descriptor.\n */\n supports: DriverCapabilitiesSchema,\n\n // ============================================================================\n // Lifecycle Management\n // ============================================================================\n\n /**\n * Initialize connection pool or authenticate.\n */\n connect: z.function()\n .input(z.tuple([]))\n .output(z.promise(z.void()))\n .describe('Establish connection'),\n\n /**\n * Close connections and cleanup resources.\n */\n disconnect: z.function()\n .input(z.tuple([]))\n .output(z.promise(z.void()))\n .describe('Close connection'),\n\n /**\n * Check connection health.\n * @returns true if healthy, false otherwise.\n */\n checkHealth: z.function()\n .input(z.tuple([]))\n .output(z.promise(z.boolean()))\n .describe('Health check'),\n \n /**\n * Get Connection Pool Statistics.\n * Useful for monitoring database load.\n */\n getPoolStats: z.function()\n .input(z.tuple([]))\n .output(z.object({\n total: z.number(),\n idle: z.number(),\n active: z.number(),\n waiting: z.number(),\n }).optional())\n .optional()\n .describe('Get connection pool statistics'),\n\n // ============================================================================\n // Raw Execution (Escape Hatch)\n // ============================================================================\n\n /**\n * Execute a raw command/query native to the driver.\n * Useful for complex reports, stored procedures, or DDL not covered by standard sync.\n * \n * @param command - The raw command (e.g., SQL string, shell command, or remote API payload).\n * @param parameters - Optional array of bound parameters for safe execution (prevention of injection).\n * @param options - Driver options (transaction context, timeout).\n * @returns Promise resolving to the raw result from the driver.\n * \n * @example\n * // SQL Driver\n * await driver.execute('SELECT * FROM complex_view WHERE id = ?', [123]);\n * \n * // Mongo Driver\n * await driver.execute({ aggregate: 'orders', pipeline: [...] });\n */\n execute: z.function()\n .input(z.tuple([z.unknown(), z.array(z.unknown()).optional(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.unknown()))\n .describe('Execute raw command'),\n\n // ============================================================================\n // CRUD Operations\n // ============================================================================\n\n /**\n * Find multiple records matching the structured query.\n * Parsing the QueryAST is the responsibility of the driver implementation.\n * \n * @param object - The name of the object/table to query (e.g. 'account').\n * @param query - The structured QueryAST (filters, sorts, joins, pagination).\n * @param options - Driver options.\n * @returns Array of records.\n * \n * @example\n * await driver.find('account', {\n * filters: [['status', '=', 'active'], 'and', ['amount', '>', 500]],\n * sort: [{ field: 'created_at', order: 'desc' }],\n * top: 10\n * });\n * @returns Array of records.\n * MUST return `id` as string. MUST NOT return implementation details like `_id`.\n */\n find: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.promise(z.array(z.record(z.string(), z.unknown()))))\n .describe('Find records'),\n\n /**\n * Stream records matching the structured query.\n * Optimized for large datasets to avoid memory overflow.\n * \n * @param object - The name of the object.\n * @param query - The structured QueryAST.\n * @param options - Driver options.\n * @returns AsyncIterable/ReadableStream of records.\n */\n findStream: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.unknown())\n .describe('Stream records (AsyncIterable)'),\n\n /**\n * Find a single record by query.\n * Similar to find(), but returns only the first match or null.\n * \n * @param object - The name of the object.\n * @param query - QueryAST.\n * @param options - Driver options.\n * @returns The record or null.\n * MUST return `id` as string. MUST NOT return implementation details like `_id`.\n */\n findOne: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.promise(z.record(z.string(), z.unknown()).nullable()))\n .describe('Find one record'),\n\n /**\n * Create a new record.\n * \n * @param object - The object name.\n * @param data - Key-value map of field data.\n * @param options - Driver options.\n * @returns The created record, including server-generated fields (id, created_at, etc.).\n * MUST return `id` as string. MUST NOT return implementation details like `_id`.\n */\n create: z.function()\n .input(z.tuple([z.string(), z.record(z.string(), z.unknown()), DriverOptionsSchema.optional()]))\n .output(z.promise(z.record(z.string(), z.unknown())))\n .describe('Create record'),\n\n /**\n * Update an existing record by ID.\n * \n * @param object - The object name.\n * @param id - The unique identifier of the record.\n * @param data - The fields to update.\n * @param options - Driver options.\n * @returns The updated record.\n * MUST return `id` as string. MUST NOT return implementation details like `_id`.\n */\n update: z.function()\n .input(z.tuple([z.string(), z.string().or(z.number()), z.record(z.string(), z.unknown()), DriverOptionsSchema.optional()]))\n .output(z.promise(z.record(z.string(), z.unknown())))\n .describe('Update record'),\n\n /**\n * Upsert (Update or Insert) a record.\n * \n * @param object - The object name.\n * @param data - The data to upsert.\n * @param conflictKeys - Fields to check for conflict (uniqueness).\n * @param options - Driver options.\n * @returns The created or updated record.\n */\n upsert: z.function()\n .input(z.tuple([z.string(), z.record(z.string(), z.unknown()), z.array(z.string()).optional(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.record(z.string(), z.unknown())))\n .describe('Upsert record'),\n\n /**\n * Delete a record by ID.\n * \n * @param object - The object name.\n * @param id - The unique identifier of the record.\n * @param options - Driver options.\n * @returns True if deleted, false if not found.\n */\n delete: z.function()\n .input(z.tuple([z.string(), z.string().or(z.number()), DriverOptionsSchema.optional()]))\n .output(z.promise(z.boolean()))\n .describe('Delete record'),\n\n /**\n * Count records matching a query.\n * \n * @param object - The object name.\n * @param query - Optional filtering criteria.\n * @param options - Driver options.\n * @returns Total count.\n */\n count: z.function()\n .input(z.tuple([z.string(), QuerySchema.optional(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.number()))\n .describe('Count records'),\n\n // ============================================================================\n // Bulk Operations\n // ============================================================================\n\n /**\n * Create multiple records in a single batch.\n * Optimized for performance.\n * \n * @param object - The object name.\n * @param dataArray - Array of record data.\n * @returns Array of created records.\n */\n bulkCreate: z.function()\n .input(z.tuple([z.string(), z.array(z.record(z.string(), z.unknown())), DriverOptionsSchema.optional()]))\n .output(z.promise(z.array(z.record(z.string(), z.unknown())))),\n\n /**\n * Update multiple records in a single batch.\n * \n * @param object - The object name.\n * @param updates - Array of objects containing {id, data}.\n * @returns Array of updated records.\n */\n bulkUpdate: z.function()\n .input(z.tuple([z.string(), z.array(z.object({ id: z.string().or(z.number()), data: z.record(z.string(), z.unknown()) })), DriverOptionsSchema.optional()]))\n .output(z.promise(z.array(z.record(z.string(), z.unknown())))),\n\n /**\n * Delete multiple records in a single batch.\n * \n * @param object - The object name.\n * @param ids - Array of record IDs.\n */\n bulkDelete: z.function()\n .input(z.tuple([z.string(), z.array(z.string().or(z.number())), DriverOptionsSchema.optional()]))\n .output(z.promise(z.void())),\n\n /**\n * Update multiple records matching a query.\n * Direct database push-down. DOES NOT trigger per-record hooks.\n * \n * @param object - The object name.\n * @param query - The filtering criteria.\n * @param data - The data to update.\n * @returns Count of modified records.\n */\n updateMany: z.function()\n .input(z.tuple([z.string(), QuerySchema, z.record(z.string(), z.unknown()), DriverOptionsSchema.optional()]))\n .output(z.promise(z.number()))\n .optional(),\n\n /**\n * Delete multiple records matching a query.\n * Direct database push-down. DOES NOT trigger per-record hooks.\n * \n * @param object - The object name.\n * @param query - The filtering criteria.\n * @returns Count of deleted records.\n */\n deleteMany: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.promise(z.number()))\n .optional(),\n\n // ============================================================================\n // Transaction Management\n // ============================================================================\n\n /**\n * Begin a new database transaction.\n * @param options - Isolation level and other settings.\n * @returns A transaction handle to be passed to subsequent operations via `options.transaction`.\n */\n beginTransaction: z.function()\n .input(z.tuple([z.object({\n isolationLevel: IsolationLevelEnum.optional()\n }).optional()]))\n .output(z.promise(z.unknown()))\n .describe('Start transaction'),\n\n /**\n * Commit the transaction.\n * @param transaction - The transaction handle.\n */\n commit: z.function()\n .input(z.tuple([z.unknown()]))\n .output(z.promise(z.void()))\n .describe('Commit transaction'),\n\n /**\n * Rollback the transaction.\n * @param transaction - The transaction handle.\n */\n rollback: z.function()\n .input(z.tuple([z.unknown()]))\n .output(z.promise(z.void()))\n .describe('Rollback transaction'),\n\n // ============================================================================\n // Schema Management\n // ============================================================================\n\n /**\n * Synchronize the database schema with the Object definition.\n * This is an idempotent operation: it should create tables if missing, \n * add columns if missing, and update indexes.\n * \n * @param object - The object name.\n * @param schema - The full Object Schema (fields, indexes, etc).\n * @param options - Driver options.\n */\n syncSchema: z.function()\n .input(z.tuple([z.string(), z.unknown(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.void()))\n .describe('Sync object schema to DB'),\n\n /**\n * Batch-synchronize multiple object schemas with fewer round-trips.\n *\n * Drivers that advertise `supports.batchSchemaSync = true` MUST implement\n * this method. The engine will call it once with every\n * `{ object, schema }` pair instead of calling `syncSchema()` N times.\n *\n * @param schemas - Array of `{ object: string; schema: unknown }` pairs.\n * @param options - Driver options.\n */\n syncSchemasBatch: z.function()\n .input(z.tuple([\n z.array(z.object({ object: z.string(), schema: z.unknown() })),\n DriverOptionsSchema.optional(),\n ]))\n .output(z.promise(z.void()))\n .optional()\n .describe('Batch sync multiple schemas in one round-trip'),\n \n /**\n * Drop the underlying table or collection for an object.\n * WARNING: Destructive operation.\n * \n * @param object - The object name.\n */\n dropTable: z.function()\n .input(z.tuple([z.string(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.void())),\n\n /**\n * Analyze query performance.\n * Returns execution plan without executing the query (where possible).\n * \n * @param object - The object name.\n * @param query - The query to explain.\n * @returns The execution plan details.\n */\n explain: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.promise(z.unknown()))\n .optional(),\n}));\n\n/**\n * Connection Pool Configuration Schema\n * Manages database connection pooling for performance\n */\nexport const PoolConfigSchema = lazySchema(() => z.object({\n min: z.number().min(0).default(2).describe('Minimum number of connections in pool'),\n max: z.number().min(1).default(10).describe('Maximum number of connections in pool'),\n idleTimeoutMillis: z.number().min(0).default(30000).describe('Time in ms before idle connection is closed'),\n connectionTimeoutMillis: z.number().min(0).default(5000).describe('Time in ms to wait for available connection'),\n}));\n\n/**\n * Driver Configuration Schema\n * Base configuration for database drivers\n */\nexport const DriverConfigSchema = lazySchema(() => z.object({\n name: z.string().describe('Driver instance name'),\n type: z.enum(['sql', 'nosql', 'cache', 'search', 'graph', 'timeseries']).describe('Driver type category'),\n capabilities: DriverCapabilitiesSchema.describe('Driver capability flags'),\n connectionString: z.string().optional().describe('Database connection string (driver-specific format)'),\n poolConfig: PoolConfigSchema.optional().describe('Connection pool configuration'),\n}));\n\n/**\n * TypeScript types\n */\nexport type DriverOptions = z.infer<typeof DriverOptionsSchema>;\nexport type DriverCapabilities = z.infer<typeof DriverCapabilitiesSchema>;\nexport type DriverInterface = z.infer<typeof DriverInterfaceSchema>;\nexport type DriverConfig = z.infer<typeof DriverConfigSchema>;\nexport type PoolConfig = z.infer<typeof PoolConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { DriverConfigSchema } from './driver.zod';\n\n/**\n * SQL Dialect Enumeration\n * Supported SQL database dialects\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SQLDialectSchema = lazySchema(() => z.enum([\n 'postgresql',\n 'mysql',\n 'sqlite',\n 'mssql',\n 'oracle',\n 'mariadb',\n]));\n\nexport type SQLDialect = z.infer<typeof SQLDialectSchema>;\n\n/**\n * Data Type Mapping Schema\n * Maps ObjectStack field types to SQL-specific data types\n * \n * @example PostgreSQL data type mapping\n * {\n * text: 'VARCHAR(255)',\n * number: 'NUMERIC',\n * boolean: 'BOOLEAN',\n * date: 'DATE',\n * datetime: 'TIMESTAMP',\n * json: 'JSONB',\n * uuid: 'UUID',\n * binary: 'BYTEA'\n * }\n */\nexport const DataTypeMappingSchema = lazySchema(() => z.object({\n text: z.string().describe('SQL type for text fields (e.g., VARCHAR, TEXT)'),\n number: z.string().describe('SQL type for number fields (e.g., NUMERIC, DECIMAL, INT)'),\n boolean: z.string().describe('SQL type for boolean fields (e.g., BOOLEAN, BIT)'),\n date: z.string().describe('SQL type for date fields (e.g., DATE)'),\n datetime: z.string().describe('SQL type for datetime fields (e.g., TIMESTAMP, DATETIME)'),\n json: z.string().optional().describe('SQL type for JSON fields (e.g., JSON, JSONB)'),\n uuid: z.string().optional().describe('SQL type for UUID fields (e.g., UUID, CHAR(36))'),\n binary: z.string().optional().describe('SQL type for binary fields (e.g., BLOB, BYTEA)'),\n}));\n\nexport type DataTypeMapping = z.infer<typeof DataTypeMappingSchema>;\n\n/**\n * SSL Configuration Schema\n * SSL/TLS connection configuration for secure database connections\n * \n * @example PostgreSQL SSL configuration\n * {\n * rejectUnauthorized: true,\n * ca: '/path/to/ca-cert.pem',\n * cert: '/path/to/client-cert.pem',\n * key: '/path/to/client-key.pem'\n * }\n */\nexport const SSLConfigSchema = lazySchema(() => z.object({\n rejectUnauthorized: z.boolean().default(true).describe('Reject connections with invalid certificates'),\n ca: z.string().optional().describe('CA certificate file path or content'),\n cert: z.string().optional().describe('Client certificate file path or content'),\n key: z.string().optional().describe('Client private key file path or content'),\n}).refine((data) => {\n // If cert is provided, key must also be provided, and vice versa\n const hasCert = data.cert !== undefined;\n const hasKey = data.key !== undefined;\n return hasCert === hasKey;\n}, {\n message: 'Client certificate (cert) and private key (key) must be provided together',\n}));\n\nexport type SSLConfig = z.infer<typeof SSLConfigSchema>;\n\n/**\n * SQL Driver Configuration Schema\n * Extended driver configuration specific to SQL databases\n * \n * @example PostgreSQL driver configuration\n * {\n * name: 'primary-db',\n * type: 'sql',\n * dialect: 'postgresql',\n * connectionString: 'postgresql://user:pass@localhost:5432/mydb',\n * dataTypeMapping: {\n * text: 'VARCHAR(255)',\n * number: 'NUMERIC',\n * boolean: 'BOOLEAN',\n * date: 'DATE',\n * datetime: 'TIMESTAMP',\n * json: 'JSONB',\n * uuid: 'UUID',\n * binary: 'BYTEA'\n * },\n * ssl: true,\n * sslConfig: {\n * rejectUnauthorized: true,\n * ca: '/etc/ssl/certs/ca.pem'\n * },\n * poolConfig: {\n * min: 2,\n * max: 10,\n * idleTimeoutMillis: 30000,\n * connectionTimeoutMillis: 5000\n * },\n * capabilities: {\n * create: true,\n * read: true,\n * update: true,\n * delete: true,\n * bulkCreate: true,\n * bulkUpdate: true,\n * bulkDelete: true,\n * transactions: true,\n * savepoints: true,\n * isolationLevels: ['read-committed', 'repeatable-read', 'serializable'],\n * queryFilters: true,\n * queryAggregations: true,\n * querySorting: true,\n * queryPagination: true,\n * queryWindowFunctions: true,\n * querySubqueries: true,\n * queryCTE: true,\n * joins: true,\n * fullTextSearch: true,\n * jsonQuery: true,\n * geospatialQuery: false,\n * streaming: true,\n * jsonFields: true,\n * arrayFields: true,\n * vectorSearch: true,\n * schemaSync: true,\n * migrations: true,\n * indexes: true,\n * connectionPooling: true,\n * preparedStatements: true,\n * queryCache: false\n * }\n * }\n */\nexport const SQLDriverConfigSchema = lazySchema(() => DriverConfigSchema.extend({\n type: z.literal('sql').describe('Driver type must be \"sql\"'),\n dialect: SQLDialectSchema.describe('SQL database dialect'),\n dataTypeMapping: DataTypeMappingSchema.describe('SQL data type mapping configuration'),\n ssl: z.boolean().default(false).describe('Enable SSL/TLS connection'),\n sslConfig: SSLConfigSchema.optional().describe('SSL/TLS configuration (required when ssl is true)'),\n}).refine((data) => {\n // If ssl is enabled, sslConfig must be provided\n if (data.ssl && !data.sslConfig) {\n return false;\n }\n return true;\n}, {\n message: 'sslConfig is required when ssl is true',\n}));\n\nexport type SQLDriverConfig = z.infer<typeof SQLDriverConfigSchema>;\n\n// ==========================================================================\n// SQLite-Specific Constants\n// ==========================================================================\n\n/**\n * Default data type mappings for SQLite/libSQL dialect.\n *\n * SQLite uses a simplified type system with type affinity:\n * - TEXT: strings, dates, UUIDs\n * - REAL: floating-point numbers\n * - INTEGER: integers, booleans\n * - BLOB: binary data\n *\n * @see https://www.sqlite.org/datatype3.html\n */\nexport const SQLiteDataTypeMappingDefaults: DataTypeMapping = {\n text: 'TEXT',\n number: 'REAL',\n boolean: 'INTEGER',\n date: 'TEXT',\n datetime: 'TEXT',\n json: 'TEXT',\n uuid: 'TEXT',\n binary: 'BLOB',\n};\n\n/**\n * SQLite ALTER TABLE Limitations.\n *\n * SQLite has limited ALTER TABLE support compared to other SQL databases.\n * This constant documents the known limitations that affect migration planning.\n * The schema diff service must use the \"table rebuild\" strategy for operations\n * that SQLite cannot perform natively.\n *\n * @see https://www.sqlite.org/lang_altertable.html\n */\nexport const SQLiteAlterTableLimitations = {\n /** SQLite supports ADD COLUMN */\n supportsAddColumn: true,\n /** SQLite supports RENAME COLUMN (3.25.0+) */\n supportsRenameColumn: true,\n /** SQLite supports DROP COLUMN (3.35.0+) */\n supportsDropColumn: true,\n /** SQLite does NOT support MODIFY/ALTER COLUMN type */\n supportsModifyColumn: false,\n /** SQLite does NOT support adding constraints to existing columns */\n supportsAddConstraint: false,\n /**\n * When an unsupported alteration is needed, the migration planner\n * must use the 12-step table rebuild strategy:\n * 1. CREATE new table with desired schema\n * 2. Copy data from old table\n * 3. DROP old table\n * 4. RENAME new table to old name\n */\n rebuildStrategy: 'create_copy_drop_rename',\n} as const;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { DriverConfigSchema } from './driver.zod';\n\n/**\n * NoSQL Database Type Enumeration\n * Supported NoSQL database types\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const NoSQLDatabaseTypeSchema = lazySchema(() => z.enum([\n 'mongodb',\n 'couchdb',\n 'dynamodb',\n 'cassandra',\n 'redis',\n 'elasticsearch',\n 'neo4j',\n 'orientdb',\n]));\n\nexport type NoSQLDatabaseType = z.infer<typeof NoSQLDatabaseTypeSchema>;\n\n/**\n * NoSQL Query Operation Types\n * Different types of operations supported by NoSQL databases\n */\nexport const NoSQLOperationTypeSchema = lazySchema(() => z.enum([\n 'find', // Query documents/records\n 'findOne', // Get single document\n 'insert', // Insert document\n 'update', // Update document\n 'delete', // Delete document\n 'aggregate', // Aggregation pipeline\n 'mapReduce', // MapReduce operation\n 'count', // Count documents\n 'distinct', // Get distinct values\n 'createIndex', // Create index\n 'dropIndex', // Drop index\n]));\n\nexport type NoSQLOperationType = z.infer<typeof NoSQLOperationTypeSchema>;\n\n/**\n * NoSQL Consistency Level\n * Consistency guarantees for distributed NoSQL databases\n * \n * Consistency levels (from strongest to weakest):\n * - **all**: All replicas must respond (strongest consistency, lowest availability)\n * - **quorum**: Majority of replicas must respond (balanced)\n * - **one**: Any single replica responds (weakest consistency, highest availability)\n * - **local_quorum**: Majority of replicas in local datacenter\n * - **each_quorum**: Quorum of replicas in each datacenter\n * - **eventual**: Eventual consistency (highest availability, weakest consistency)\n */\nexport const ConsistencyLevelSchema = lazySchema(() => z.enum([\n 'all',\n 'quorum',\n 'one',\n 'local_quorum',\n 'each_quorum',\n 'eventual',\n]));\n\nexport type ConsistencyLevel = z.infer<typeof ConsistencyLevelSchema>;\n\n/**\n * NoSQL Index Type\n * Types of indexes supported by NoSQL databases\n */\nexport const NoSQLIndexTypeSchema = lazySchema(() => z.enum([\n 'single', // Single field index\n 'compound', // Multiple fields index\n 'unique', // Unique constraint\n 'text', // Full-text search index\n 'geospatial', // Geospatial index (2d, 2dsphere)\n 'hashed', // Hashed index for sharding\n 'ttl', // Time-to-live index (auto-deletion)\n 'sparse', // Sparse index (only indexed documents with field)\n]));\n\nexport type NoSQLIndexType = z.infer<typeof NoSQLIndexTypeSchema>;\n\n/**\n * NoSQL Sharding Configuration\n * Configuration for horizontal partitioning across multiple nodes\n */\nexport const ShardingConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable sharding'),\n shardKey: z.string().optional().describe('Field to use as shard key'),\n shardingStrategy: z.enum(['hash', 'range', 'zone']).optional().describe('Sharding strategy'),\n numShards: z.number().int().positive().optional().describe('Number of shards'),\n}));\n\nexport type ShardingConfig = z.infer<typeof ShardingConfigSchema>;\n\n/**\n * NoSQL Replication Configuration\n * Configuration for data replication across nodes\n */\nexport const ReplicationConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable replication'),\n replicaSetName: z.string().optional().describe('Replica set name'),\n replicas: z.number().int().positive().optional().describe('Number of replicas'),\n readPreference: z.enum(['primary', 'primaryPreferred', 'secondary', 'secondaryPreferred', 'nearest'])\n .optional()\n .describe('Read preference for replica set'),\n writeConcern: z.enum(['majority', 'acknowledged', 'unacknowledged'])\n .optional()\n .describe('Write concern level'),\n}));\n\nexport type ReplicationConfig = z.infer<typeof ReplicationConfigSchema>;\n\n/**\n * Document Schema Validation\n * Schema validation rules for document-based NoSQL databases\n */\nexport const DocumentSchemaValidationSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable schema validation'),\n validationLevel: z.enum(['strict', 'moderate', 'off']).optional().describe('Validation strictness'),\n validationAction: z.enum(['error', 'warn']).optional().describe('Action on validation failure'),\n jsonSchema: z.record(z.string(), z.unknown()).optional().describe('JSON Schema for validation'),\n}));\n\nexport type DocumentSchemaValidation = z.infer<typeof DocumentSchemaValidationSchema>;\n\n/**\n * NoSQL Data Type Mapping Schema\n * Maps ObjectStack field types to NoSQL-specific data types\n * \n * @example MongoDB data type mapping\n * {\n * text: 'string',\n * number: 'double',\n * boolean: 'bool',\n * date: 'date',\n * datetime: 'date',\n * json: 'object',\n * uuid: 'string',\n * binary: 'binData',\n * array: 'array',\n * objectId: 'objectId'\n * }\n */\nexport const NoSQLDataTypeMappingSchema = lazySchema(() => z.object({\n text: z.string().describe('NoSQL type for text fields'),\n number: z.string().describe('NoSQL type for number fields'),\n boolean: z.string().describe('NoSQL type for boolean fields'),\n date: z.string().describe('NoSQL type for date fields'),\n datetime: z.string().describe('NoSQL type for datetime fields'),\n json: z.string().optional().describe('NoSQL type for JSON/object fields'),\n uuid: z.string().optional().describe('NoSQL type for UUID fields'),\n binary: z.string().optional().describe('NoSQL type for binary fields'),\n array: z.string().optional().describe('NoSQL type for array fields'),\n objectId: z.string().optional().describe('NoSQL type for ObjectID fields (MongoDB)'),\n geopoint: z.string().optional().describe('NoSQL type for geospatial point fields'),\n}));\n\nexport type NoSQLDataTypeMapping = z.infer<typeof NoSQLDataTypeMappingSchema>;\n\n/**\n * NoSQL Driver Configuration Schema\n * Extended driver configuration specific to NoSQL databases\n * \n * @example MongoDB driver configuration\n * {\n * name: 'primary-mongo',\n * type: 'nosql',\n * databaseType: 'mongodb',\n * connectionString: 'mongodb://user:pass@localhost:27017/mydb',\n * dataTypeMapping: {\n * text: 'string',\n * number: 'double',\n * boolean: 'bool',\n * date: 'date',\n * datetime: 'date',\n * json: 'object',\n * uuid: 'string',\n * binary: 'binData',\n * array: 'array',\n * objectId: 'objectId'\n * },\n * consistency: 'quorum',\n * replication: {\n * enabled: true,\n * replicaSetName: 'rs0',\n * replicas: 3,\n * readPreference: 'primaryPreferred',\n * writeConcern: 'majority'\n * },\n * sharding: {\n * enabled: true,\n * shardKey: '_id',\n * shardingStrategy: 'hash',\n * numShards: 4\n * },\n * capabilities: {\n * create: true,\n * read: true,\n * update: true,\n * delete: true,\n * bulkCreate: true,\n * bulkUpdate: true,\n * bulkDelete: true,\n * transactions: true,\n * savepoints: false,\n * queryFilters: true,\n * queryAggregations: true,\n * querySorting: true,\n * queryPagination: true,\n * queryWindowFunctions: false,\n * querySubqueries: false,\n * queryCTE: false,\n * joins: false,\n * fullTextSearch: true,\n * jsonQuery: true,\n * geospatialQuery: true,\n * streaming: true,\n * jsonFields: true,\n * arrayFields: true,\n * vectorSearch: false,\n * schemaSync: true,\n * migrations: false,\n * indexes: true,\n * connectionPooling: true,\n * preparedStatements: false,\n * queryCache: false\n * }\n * }\n * \n * @example DynamoDB driver configuration\n * {\n * name: 'dynamodb-main',\n * type: 'nosql',\n * databaseType: 'dynamodb',\n * region: 'us-east-1',\n * accessKeyId: 'AKIAIOSFODNN7EXAMPLE',\n * secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',\n * consistency: 'eventual',\n * capabilities: {\n * create: true,\n * read: true,\n * update: true,\n * delete: true,\n * bulkCreate: true,\n * bulkUpdate: false,\n * bulkDelete: false,\n * transactions: true,\n * queryFilters: true,\n * queryAggregations: false,\n * querySorting: true,\n * queryPagination: true,\n * fullTextSearch: false,\n * jsonQuery: true,\n * indexes: true\n * }\n * }\n */\nexport const NoSQLDriverConfigSchema = lazySchema(() => DriverConfigSchema.extend({\n type: z.literal('nosql').describe('Driver type must be \"nosql\"'),\n databaseType: NoSQLDatabaseTypeSchema.describe('Specific NoSQL database type'),\n dataTypeMapping: NoSQLDataTypeMappingSchema.describe('NoSQL data type mapping configuration'),\n \n /**\n * Consistency level for reads/writes\n */\n consistency: ConsistencyLevelSchema.optional().describe('Consistency level for operations'),\n \n /**\n * Replication configuration\n */\n replication: ReplicationConfigSchema.optional().describe('Replication configuration'),\n \n /**\n * Sharding configuration\n */\n sharding: ShardingConfigSchema.optional().describe('Sharding configuration'),\n \n /**\n * Schema validation rules (for document databases)\n */\n schemaValidation: DocumentSchemaValidationSchema.optional().describe('Document schema validation'),\n \n /**\n * AWS Region (for DynamoDB, DocumentDB, etc.)\n */\n region: z.string().optional().describe('AWS region (for managed NoSQL services)'),\n \n /**\n * AWS Access Key ID (for DynamoDB, DocumentDB, etc.)\n */\n accessKeyId: z.string().optional().describe('AWS access key ID'),\n \n /**\n * AWS Secret Access Key (for DynamoDB, DocumentDB, etc.)\n */\n secretAccessKey: z.string().optional().describe('AWS secret access key'),\n \n /**\n * Time-to-live (TTL) field name\n * Automatically delete documents after a specified time\n */\n ttlField: z.string().optional().describe('Field name for TTL (auto-deletion)'),\n \n /**\n * Maximum document size in bytes\n */\n maxDocumentSize: z.number().int().positive().optional().describe('Maximum document size in bytes'),\n \n /**\n * Collection/Table name prefix\n * Useful for multi-tenancy or environment isolation\n */\n collectionPrefix: z.string().optional().describe('Prefix for collection/table names'),\n}));\n\nexport type NoSQLDriverConfig = z.infer<typeof NoSQLDriverConfigSchema>;\n\n/**\n * NoSQL Query Options\n * Additional options for NoSQL queries\n */\nexport const NoSQLQueryOptionsSchema = lazySchema(() => z.object({\n /**\n * Consistency level for this query\n */\n consistency: ConsistencyLevelSchema.optional().describe('Consistency level override'),\n \n /**\n * Read from secondary replicas\n */\n readFromSecondary: z.boolean().optional().describe('Allow reading from secondary replicas'),\n \n /**\n * Projection (fields to include/exclude)\n */\n projection: z.record(z.string(), z.union([z.literal(0), z.literal(1)])).optional().describe('Field projection'),\n \n /**\n * Query timeout in milliseconds\n */\n timeout: z.number().int().positive().optional().describe('Query timeout (ms)'),\n \n /**\n * Use cursor for large result sets\n */\n useCursor: z.boolean().optional().describe('Use cursor instead of loading all results'),\n \n /**\n * Batch size for cursor iteration\n */\n batchSize: z.number().int().positive().optional().describe('Cursor batch size'),\n \n /**\n * Enable query profiling\n */\n profile: z.boolean().optional().describe('Enable query profiling'),\n \n /**\n * Use hinted index\n */\n hint: z.string().optional().describe('Index hint for query optimization'),\n}));\n\nexport type NoSQLQueryOptions = z.infer<typeof NoSQLQueryOptionsSchema>;\n\n/**\n * NoSQL Aggregation Pipeline Stage\n * Represents a single stage in an aggregation pipeline (MongoDB-style)\n */\nexport const AggregationStageSchema = lazySchema(() => z.object({\n /**\n * Stage operator (e.g., $match, $group, $sort, $project)\n */\n operator: z.string().describe('Aggregation operator (e.g., $match, $group, $sort)'),\n \n /**\n * Stage parameters/options\n */\n options: z.record(z.string(), z.unknown()).describe('Stage-specific options'),\n}));\n\nexport type AggregationStage = z.infer<typeof AggregationStageSchema>;\n\n/**\n * NoSQL Aggregation Pipeline\n * Sequence of aggregation stages for complex data transformations\n */\nexport const AggregationPipelineSchema = lazySchema(() => z.object({\n /**\n * Collection/Table to aggregate\n */\n collection: z.string().describe('Collection/table name'),\n \n /**\n * Pipeline stages\n */\n stages: z.array(AggregationStageSchema).describe('Aggregation pipeline stages'),\n \n /**\n * Additional options\n */\n options: NoSQLQueryOptionsSchema.optional().describe('Query options'),\n}));\n\nexport type AggregationPipeline = z.infer<typeof AggregationPipelineSchema>;\n\n/**\n * NoSQL Index Definition\n * Definition for creating indexes in NoSQL databases\n */\nexport const NoSQLIndexSchema = lazySchema(() => z.object({\n /**\n * Index name\n */\n name: z.string().describe('Index name'),\n \n /**\n * Index type\n */\n type: NoSQLIndexTypeSchema.describe('Index type'),\n \n /**\n * Fields to index\n * For compound indexes, order matters\n */\n fields: z.array(z.object({\n field: z.string().describe('Field name'),\n order: z.enum(['asc', 'desc', 'text', '2dsphere']).optional().describe('Index order or type'),\n })).describe('Fields to index'),\n \n /**\n * Unique constraint\n */\n unique: z.boolean().default(false).describe('Enforce uniqueness'),\n \n /**\n * Sparse index (only index documents with the field)\n */\n sparse: z.boolean().default(false).describe('Sparse index'),\n \n /**\n * TTL in seconds (for TTL indexes)\n */\n expireAfterSeconds: z.number().int().positive().optional().describe('TTL in seconds'),\n \n /**\n * Partial index filter\n */\n partialFilterExpression: z.record(z.string(), z.unknown()).optional().describe('Partial index filter'),\n \n /**\n * Background index creation\n */\n background: z.boolean().default(false).describe('Create index in background'),\n}));\n\nexport type NoSQLIndex = z.infer<typeof NoSQLIndexSchema>;\n\n/**\n * NoSQL Transaction Options\n * Options for NoSQL transactions (where supported)\n */\nexport const NoSQLTransactionOptionsSchema = lazySchema(() => z.object({\n /**\n * Read concern level\n */\n readConcern: z.enum(['local', 'majority', 'linearizable', 'snapshot']).optional().describe('Read concern level'),\n \n /**\n * Write concern level\n */\n writeConcern: z.enum(['majority', 'acknowledged', 'unacknowledged']).optional().describe('Write concern level'),\n \n /**\n * Read preference\n */\n readPreference: z.enum(['primary', 'primaryPreferred', 'secondary', 'secondaryPreferred', 'nearest'])\n .optional()\n .describe('Read preference'),\n \n /**\n * Transaction timeout in milliseconds\n */\n maxCommitTimeMS: z.number().int().positive().optional().describe('Transaction commit timeout (ms)'),\n}));\n\nexport type NoSQLTransactionOptions = z.infer<typeof NoSQLTransactionOptionsSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Seed Import Strategy\n * Defines how the engine handles existing records when a seed is applied.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SeedMode = z.enum([\n 'insert', // Try to insert, fail on duplicate\n 'update', // Only update found records, ignore new\n 'upsert', // Create new or Update existing (Standard)\n 'replace', // Delete ALL records in object then insert (Dangerous - use for cache tables)\n 'ignore' // Try to insert, silently skip duplicates\n]);\n\n/**\n * Seed Schema (Seed Data / Fixtures)\n *\n * Standardized format for transporting initialization data. Used for:\n * 1. System Bootstrapping (Admin accounts, Standard Roles)\n * 2. Reference Data (Countries, Currencies)\n * 3. Demo / sample data (incl. AI-authored, applied on publish)\n *\n * This is the shape of the runtime-draftable `seed` metadata type: an author\n * (or the AI metadata assistant) stages a `seed` draft against this schema and\n * its rows load when the draft is published. Named `Seed` (not `Dataset`) so\n * the `dataset` name stays reserved for the ADR-0021 analytics semantic layer.\n */\nexport const SeedSchema = lazySchema(() => z.object({\n /**\n * Target Object\n * The machine name of the object to populate.\n */\n object: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Target Object Name'),\n\n /**\n * Idempotency Key (The \"Upsert\" Key)\n * The field used to check if a record already exists.\n * Best Practice: Use a natural key like 'code', 'slug', 'username' or 'external_id'.\n * Standard: 'id' is rarely used for portable seed data — prefer natural keys.\n */\n externalId: z.string().default('name').describe('Field match for uniqueness check'),\n\n /**\n * Import Strategy\n */\n mode: SeedMode.default('upsert').describe('Conflict resolution strategy'),\n\n /**\n * Environment Scope\n * - 'all': Always load\n * - 'dev': Only for development/demo\n * - 'test': Only for CI/CD tests\n */\n env: z.array(z.enum(['prod', 'dev', 'test'])).default(['prod', 'dev', 'test']).describe('Applicable environments'),\n\n /**\n * The Payload\n * Array of raw JSON objects matching the Object Schema.\n */\n records: z.array(z.record(z.string(), z.unknown())).describe('Data records'),\n}));\n\n/** Parsed/output type — all defaults are applied (env, mode, externalId always present) */\nexport type Seed = z.infer<typeof SeedSchema>;\n\n/** Input type — fields with defaults (env, mode, externalId) are optional */\nexport type SeedInput = z.input<typeof SeedSchema>;\n\nexport type SeedImportMode = z.infer<typeof SeedMode>;\n\n/**\n * Per-field value type for a seed record.\n *\n * Reference fields (`lookup` / `master_detail`) are resolved during seeding by\n * matching the value against the target record's externalId — so the value MUST\n * be the plain natural-key string (e.g. `account: 'Acme Corp'`), or `null`.\n * Passing a wrapper object like `account: { externalId: 'Acme Corp' }` does NOT\n * resolve: the loader skips non-string reference values, the raw object reaches\n * the SQL driver, and on update it crashes with \"SQLite3 can only bind numbers,\n * strings, bigints, buffers, and null\" (silently masked on an always-empty\n * `:memory:` DB, fatal-looking on a persistent one). Constrain those fields to\n * `string | null` at compile time; every other field stays `unknown`.\n */\ntype SeedFieldValue<TFieldDef> =\n TFieldDef extends { type: 'lookup' | 'master_detail' } ? string | null : unknown;\n\n/** Shape of a single seed record, derived from the object's field definitions. */\ntype SeedRecord<TFields> = {\n [K in keyof TFields]?: SeedFieldValue<TFields[K]>;\n};\n\n/**\n * Type-safe factory for creating seed definitions.\n * Infers valid field keys from the object definition passed in,\n * so typos in record field names are caught at compile time. Reference\n * fields (lookup/master_detail) are additionally constrained to the\n * natural-key string the loader resolves — see {@link SeedFieldValue}.\n *\n * @example\n * ```ts\n * export const leadSeed = defineSeed(Lead, {\n * externalId: 'email',\n * records: [\n * { first_name: 'Alice', lead_source: 'web' }, // ✅ type-checked\n * { source: 'web' }, // ❌ compile error (unknown field)\n * { first_name: 'Bob', account: 'Acme Corp' }, // ✅ reference by natural key\n * { first_name: 'Bob', account: { externalId: 'Acme Corp' } }, // ❌ object not allowed\n * ],\n * });\n * ```\n */\nexport function defineSeed<\n const TObj extends { name: string; fields: Record<string, unknown> }\n>(\n objectDef: TObj,\n config: Omit<SeedInput, 'object' | 'records'> & {\n records: Array<SeedRecord<TObj['fields']>>;\n }\n): Seed {\n return SeedSchema.parse({ ...config, object: objectDef.name });\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { defineForm } from '../ui/view.zod';\n\n/**\n * Form Layout for Object Metadata Type\n */\nexport const objectForm = defineForm({\n schemaId: 'object',\n type: 'simple',\n sections: [\n {\n name: 'basics',\n label: 'Basics',\n description: 'Identity, labels, and taxonomy.',\n columns: 2,\n fields: [\n { field: 'name', type: 'text', required: true, immutable: true, colSpan: 1, helpText: 'snake_case unique identifier (immutable after creation)' },\n { field: 'label', type: 'text', colSpan: 1, helpText: 'Singular display name (e.g. \"Account\")' },\n { field: 'pluralLabel', type: 'text', colSpan: 1, helpText: 'Plural display name (e.g. \"Accounts\")' },\n { field: 'icon', type: 'text', colSpan: 1, helpText: 'Lucide icon name (e.g. \"building\", \"users\")' },\n { field: 'description', type: 'textarea', colSpan: 2, helpText: 'Developer documentation' },\n { field: 'tags', type: 'tags', colSpan: 2, helpText: 'Categorization tags (e.g. \"sales\", \"system\")' },\n { field: 'active', type: 'boolean', colSpan: 1, helpText: 'Is the object active and usable' },\n { field: 'isSystem', type: 'boolean', colSpan: 1, helpText: 'System object (protected from deletion)' },\n { field: 'abstract', type: 'boolean', colSpan: 1, helpText: 'Abstract base (cannot be instantiated)' },\n ],\n },\n {\n name: 'fields',\n label: 'Fields',\n description: 'Define the data model — each entry becomes a column in the database table.',\n fields: [\n {\n field: 'fields',\n type: 'record',\n required: true,\n helpText: 'Add the columns this object will store',\n keyField: {\n field: 'name',\n label: 'Name',\n placeholder: 'snake_case_identifier',\n helpText: 'snake_case machine name (used as column name and API key)',\n regex: '^[a-z_][a-z0-9_]*$',\n immutable: true,\n },\n fields: [\n { field: 'label', type: 'text', helpText: 'Display label' },\n {\n field: 'type',\n type: 'select',\n required: true,\n helpText: 'Field type',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Textarea', value: 'textarea' },\n { label: 'Email', value: 'email' },\n { label: 'URL', value: 'url' },\n { label: 'Phone', value: 'phone' },\n { label: 'Password', value: 'password' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'HTML', value: 'html' },\n { label: 'Rich Text', value: 'richtext' },\n { label: 'Number', value: 'number' },\n { label: 'Currency', value: 'currency' },\n { label: 'Percent', value: 'percent' },\n { label: 'Date', value: 'date' },\n { label: 'Date & Time', value: 'datetime' },\n { label: 'Time', value: 'time' },\n { label: 'Boolean', value: 'boolean' },\n { label: 'Toggle', value: 'toggle' },\n { label: 'Select', value: 'select' },\n { label: 'Multiselect', value: 'multiselect' },\n { label: 'Radio', value: 'radio' },\n { label: 'Checkboxes', value: 'checkboxes' },\n { label: 'Lookup (reference)', value: 'lookup' },\n { label: 'Master–Detail', value: 'master_detail' },\n { label: 'Tree', value: 'tree' },\n { label: 'Image', value: 'image' },\n { label: 'File', value: 'file' },\n { label: 'Avatar', value: 'avatar' },\n { label: 'Video', value: 'video' },\n { label: 'Audio', value: 'audio' },\n { label: 'Formula (computed)', value: 'formula' },\n { label: 'Summary (rollup)', value: 'summary' },\n { label: 'Autonumber', value: 'autonumber' },\n { label: 'Composite (embedded)', value: 'composite' },\n { label: 'Repeater (embedded array)', value: 'repeater' },\n { label: 'Record (keyed map)', value: 'record' },\n { label: 'Location (GPS)', value: 'location' },\n { label: 'Address', value: 'address' },\n { label: 'Code', value: 'code' },\n { label: 'JSON', value: 'json' },\n { label: 'Color', value: 'color' },\n { label: 'Rating', value: 'rating' },\n { label: 'Slider', value: 'slider' },\n { label: 'Signature', value: 'signature' },\n { label: 'QR / Barcode', value: 'qrcode' },\n { label: 'Progress', value: 'progress' },\n { label: 'Tags', value: 'tags' },\n { label: 'Vector embedding', value: 'vector' },\n ],\n },\n { field: 'description', type: 'textarea', helpText: 'Developer documentation for this column' },\n { field: 'required', type: 'boolean', helpText: 'Must be set on every record' },\n { field: 'unique', type: 'boolean', helpText: 'Disallow duplicate values' },\n { field: 'indexed', type: 'boolean', helpText: 'Create a database index for faster querying' },\n { field: 'readonly', type: 'boolean', helpText: 'Visible but never user-editable' },\n { field: 'immutable', type: 'boolean', helpText: 'Editable on create, locked thereafter' },\n { field: 'hidden', type: 'boolean', helpText: 'Hidden from default UI' },\n { field: 'searchable', type: 'boolean', helpText: 'Include in full-text search' },\n { field: 'sortable', type: 'boolean', helpText: 'Allow sorting on this column' },\n { field: 'filterable', type: 'boolean', helpText: 'Allow filtering on this column' },\n { field: 'defaultValue', type: 'text', helpText: 'Default value for new records (JSON literal)' },\n { field: 'placeholder', type: 'text', helpText: 'Placeholder hint' },\n\n // Text constraints\n { field: 'maxLength', type: 'number', helpText: 'Max characters', visibleOn: \"type in ['text','textarea','email','url','phone','password','markdown','html','richtext']\" },\n { field: 'minLength', type: 'number', helpText: 'Min characters', visibleOn: \"type in ['text','textarea','email','url','phone','password','markdown','html','richtext']\" },\n\n // Numeric constraints\n { field: 'min', type: 'number', helpText: 'Minimum value', visibleOn: \"type in ['number','currency','percent','rating','slider','progress']\" },\n { field: 'max', type: 'number', helpText: 'Maximum value', visibleOn: \"type in ['number','currency','percent','rating','slider','progress']\" },\n { field: 'precision', type: 'number', helpText: 'Total digits', visibleOn: \"type in ['number','currency','percent']\" },\n { field: 'scale', type: 'number', helpText: 'Decimal places', visibleOn: \"type in ['number','currency','percent']\" },\n\n // Selection options\n {\n field: 'options',\n type: 'repeater',\n helpText: 'Available choices',\n visibleOn: \"type in ['select','multiselect','radio','checkboxes']\",\n fields: [\n { field: 'label', type: 'text', required: true },\n { field: 'value', type: 'text', required: true },\n { field: 'color', type: 'color' },\n { field: 'icon', type: 'text', helpText: 'Lucide icon name' },\n { field: 'description', type: 'text' },\n ],\n },\n\n // Relational\n { field: 'reference', type: 'text', helpText: 'Target object name', visibleOn: \"type in ['lookup','master_detail','tree']\" },\n { field: 'referenceFilter', type: 'code', language: 'expression', helpText: 'CEL filter applied to the picker', visibleOn: \"type in ['lookup','master_detail']\" },\n { field: 'cascadeDelete', type: 'boolean', helpText: 'Delete children when parent is deleted', visibleOn: \"type == 'master_detail'\" },\n { field: 'multiple', type: 'boolean', helpText: 'Allow selecting multiple records', visibleOn: \"type in ['lookup']\" },\n\n // Formula / summary\n { field: 'formula', type: 'code', language: 'expression', helpText: 'CEL formula expression', visibleOn: \"type == 'formula'\" },\n { field: 'returnType', type: 'select', helpText: 'Result type for formulas', visibleOn: \"type == 'formula'\", options: [\n { label: 'Text', value: 'text' }, { label: 'Number', value: 'number' }, { label: 'Boolean', value: 'boolean' },\n { label: 'Date', value: 'date' }, { label: 'Datetime', value: 'datetime' }, { label: 'Currency', value: 'currency' },\n ] },\n { field: 'summaryType', type: 'select', helpText: 'Aggregation', visibleOn: \"type == 'summary'\", options: [\n { label: 'Count', value: 'count' }, { label: 'Sum', value: 'sum' }, { label: 'Avg', value: 'avg' },\n { label: 'Min', value: 'min' }, { label: 'Max', value: 'max' },\n ] },\n { field: 'summaryField', type: 'text', helpText: 'Field on child object to aggregate', visibleOn: \"type == 'summary'\" },\n\n // Autonumber\n { field: 'displayFormat', type: 'text', helpText: 'e.g. \"INV-{0000}\"', visibleOn: \"type == 'autonumber'\" },\n { field: 'startingNumber', type: 'number', helpText: 'Starting sequence value', visibleOn: \"type == 'autonumber'\" },\n\n // Code language\n { field: 'language', type: 'text', helpText: 'Editor language (e.g. sql, javascript)', visibleOn: \"type == 'code'\" },\n\n // Validation / governance\n { field: 'validation', type: 'code', language: 'expression', helpText: 'CEL predicate — must evaluate true' },\n { field: 'errorMessage', type: 'text', helpText: 'Shown when validation fails' },\n { field: 'audit', type: 'boolean', helpText: 'Audit changes to this field' },\n { field: 'trackHistory', type: 'boolean', helpText: 'Keep change history' },\n { field: 'pii', type: 'boolean', helpText: 'Personally identifiable information' },\n { field: 'encrypted', type: 'boolean', helpText: 'Encrypt at rest' },\n ],\n },\n ],\n },\n {\n name: 'capabilities',\n label: 'Capabilities',\n description: 'System features and API exposure.',\n collapsible: true,\n collapsed: true,\n fields: [\n {\n field: 'capabilities',\n type: 'composite',\n helpText: 'Enable/disable system features',\n fields: [\n { field: 'trackHistory', type: 'boolean' },\n { field: 'searchable', type: 'boolean' },\n { field: 'apiEnabled', type: 'boolean' },\n { field: 'files', type: 'boolean' },\n { field: 'feeds', type: 'boolean' },\n { field: 'activities', type: 'boolean' },\n { field: 'trash', type: 'boolean' },\n { field: 'mru', type: 'boolean' },\n { field: 'clone', type: 'boolean' },\n ],\n },\n ],\n },\n {\n name: 'advanced',\n label: 'Advanced',\n description: 'State machines, actions, and storage.',\n collapsible: true,\n collapsed: true,\n fields: [\n { field: 'datasource', type: 'text', helpText: 'Target datasource ID (default: \"default\")' },\n ],\n },\n ],\n});\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { defineForm } from '../ui/view.zod';\n\n/**\n * Field Metadata Form\n * \n * Form layout for creating/editing field metadata definitions.\n */\nexport const fieldForm = defineForm({\n schemaId: 'field',\n type: 'simple',\n sections: [\n {\n name: 'basics',\n label: 'Basics',\n description: 'Core field identity and constraints.',\n columns: 2,\n fields: [\n { field: 'name', required: true, immutable: true, colSpan: 1, helpText: 'Unique identifier (snake_case, immutable after creation)' },\n { field: 'label', required: true, colSpan: 1, helpText: 'Display name for users' },\n { field: 'type', required: true, colSpan: 1, helpText: 'Data type of this field' },\n { field: 'group', colSpan: 1, helpText: 'Group name for form layout' },\n { field: 'description', widget: 'textarea', colSpan: 2, helpText: 'Help text shown to users' },\n { field: 'required', colSpan: 1, helpText: 'User must provide a value' },\n { field: 'unique', colSpan: 1, helpText: 'No two records can have the same value' },\n { field: 'multiple', colSpan: 1, helpText: 'Allow multiple values (for select/lookup)' },\n ],\n },\n {\n name: 'configuration',\n label: 'Configuration',\n description: 'Field-type specific settings (visible blocks depend on the chosen type).',\n fields: [\n { field: 'defaultValue', helpText: 'Default value for new records' },\n // Text field options\n { field: 'minLength', visibleOn: \"data.type == 'text' || data.type == 'textarea' || data.type == 'email'\", helpText: 'Minimum character length' },\n { field: 'maxLength', visibleOn: \"data.type == 'text' || data.type == 'textarea' || data.type == 'email'\", helpText: 'Maximum character length' },\n // Number field options\n { field: 'min', visibleOn: \"data.type == 'number' || data.type == 'currency'\", helpText: 'Minimum value' },\n { field: 'max', visibleOn: \"data.type == 'number' || data.type == 'currency'\", helpText: 'Maximum value' },\n { field: 'precision', visibleOn: \"data.type == 'currency' || data.type == 'number'\", helpText: 'Decimal places (e.g., 2 for $10.50)' },\n { field: 'scale', visibleOn: \"data.type == 'number'\", helpText: 'Number of decimal digits' },\n // Select field options\n { field: 'options', type: 'repeater', visibleOn: \"data.type == 'select' || data.type == 'multiselect'\", helpText: 'Available options (label/value pairs)' },\n // Reference field options\n { field: 'reference', widget: 'ref:object', visibleOn: \"data.type == 'lookup' || data.type == 'master_detail'\", helpText: 'Referenced object name' },\n { field: 'referenceFilters', widget: 'string-tags', visibleOn: \"data.type == 'lookup' || data.type == 'master_detail'\", helpText: 'Filter expressions (e.g., \"active = true\")' },\n { field: 'deleteBehavior', visibleOn: \"data.type == 'lookup' || data.type == 'master_detail'\", helpText: 'What happens when referenced record is deleted' },\n ],\n },\n {\n name: 'formula',\n label: 'Formula & Computed',\n description: 'Calculated values and roll-up summaries.',\n collapsible: true,\n collapsed: true,\n fields: [\n { field: 'expression', widget: 'textarea', helpText: 'CEL expression to calculate this field (makes it read-only)' },\n { field: 'summaryOperations', type: 'composite', helpText: 'Roll-up summary configuration (for parent-child relationships)' },\n ],\n },\n {\n name: 'advanced',\n label: 'Advanced',\n description: 'Database, UI, audit, and security settings.',\n collapsible: true,\n collapsed: true,\n columns: 2,\n fields: [\n // Database & Performance\n { field: 'columnName', colSpan: 2, helpText: 'Physical column name in database (defaults to field name)' },\n { field: 'index', colSpan: 1, helpText: 'Create database index for faster queries' },\n { field: 'externalId', colSpan: 1, helpText: 'Mark as external ID for upsert operations' },\n // UI & Visibility\n { field: 'readonly', colSpan: 1, helpText: 'Field is read-only in forms' },\n { field: 'hidden', colSpan: 1, helpText: 'Hide field from default UI views' },\n { field: 'searchable', colSpan: 1, helpText: 'Include in global search results' },\n { field: 'sortable', colSpan: 1, helpText: 'Allow sorting lists by this field' },\n ],\n },\n ],\n});\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { defineForm } from '../ui/view.zod';\n\n/**\n * Form Layout for Hook Metadata Type\n *\n * Hooks intercept the data lifecycle. The body field is a composite\n * (`{ language, source, capabilities?, timeoutMs?, memoryMb? }`) whose\n * `source` renders in a Monaco code editor with language-appropriate\n * syntax highlighting.\n */\nexport const hookForm = defineForm({\n schemaId: 'hook',\n type: 'simple',\n sections: [\n {\n label: 'Identity',\n description: 'What this hook is and when it fires.',\n columns: 2,\n fields: [\n { field: 'name', type: 'text', required: true, immutable: true, colSpan: 1, helpText: 'snake_case identifier (immutable after creation)' },\n { field: 'label', type: 'text', colSpan: 1 },\n { field: 'description', type: 'textarea', colSpan: 2 },\n { field: 'object', type: 'text', required: true, colSpan: 1, helpText: 'Target object name (or \"*\" for global)' },\n { field: 'events', type: 'tags', required: true, colSpan: 1, helpText: 'Lifecycle events (e.g. beforeInsert, afterUpdate)' },\n { field: 'priority', type: 'number', colSpan: 1, helpText: 'Lower numbers run first' },\n ],\n },\n {\n label: 'Body',\n description: 'Inline expression or sandboxed JavaScript executed when the hook fires.',\n fields: [\n {\n field: 'body',\n type: 'composite',\n helpText: 'Either an L1 expression or an L2 sandboxed JS body',\n fields: [\n { field: 'language', type: 'select', required: true, helpText: 'expression = pure formula; js = sandboxed JavaScript', options: [\n { label: 'Expression (L1)', value: 'expression' },\n { label: 'JavaScript (L2 sandboxed)', value: 'js' },\n ] },\n { field: 'source', type: 'code', language: 'javascript', required: true, helpText: 'Function body source — no top-level imports' },\n { field: 'capabilities', type: 'tags', helpText: 'Allowed ctx APIs (api.read, api.write, crypto.uuid, log, …)' },\n { field: 'timeoutMs', type: 'number', helpText: 'Per-invocation timeout (ms)' },\n ],\n },\n ],\n },\n {\n label: 'Legacy handler',\n description: 'Function name reference — deprecated in favour of body.',\n collapsible: true,\n collapsed: true,\n fields: [\n { field: 'handler', type: 'text', helpText: 'Handler function name (deprecated — prefer `body`)' },\n ],\n },\n {\n label: 'Execution',\n collapsible: true,\n collapsed: true,\n columns: 2,\n fields: [\n { field: 'async', type: 'boolean', colSpan: 1, helpText: 'Run in background, do not block the transaction' },\n { field: 'onError', type: 'select', colSpan: 1, options: [\n { label: 'Abort', value: 'abort' },\n { label: 'Log', value: 'log' },\n ] },\n { field: 'timeout', type: 'number', colSpan: 1, helpText: 'Abort the hook after N milliseconds' },\n { field: 'condition', type: 'code', language: 'javascript', colSpan: 2, helpText: 'Optional formula — skip the hook when this evaluates to false' },\n {\n field: 'retryPolicy',\n type: 'composite',\n colSpan: 2,\n helpText: 'Retry on failure — most useful for async hooks',\n fields: [\n { field: 'maxRetries', type: 'number', helpText: 'Maximum retry attempts' },\n { field: 'backoffMs', type: 'number', helpText: 'Delay between retries (ms)' },\n ],\n },\n ],\n },\n ],\n});\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { SeedSchema, SeedMode } from './seed.zod';\n\n/**\n * # Seed Loader Protocol\n *\n * Defines the schemas for metadata-driven seed data loading with automatic\n * relationship resolution, dependency ordering, and multi-pass insertion.\n *\n * ## Architecture Alignment\n * - **Salesforce Data Loader**: External ID-based upsert with relationship resolution\n * - **ServiceNow**: Sys ID and display value mapping during import\n * - **Airtable**: Linked record resolution via display names\n *\n * ## Loading Flow\n * ```\n * 1. Build object dependency graph from field metadata (lookup/master_detail)\n * 2. Topological sort → determine insert order (parents before children)\n * 3. Pass 1: Insert/upsert records, resolve references via externalId\n * 4. Pass 2: Fill deferred references (circular/delayed dependencies)\n * 5. Validate & report unresolved references\n * 6. Return structured result with per-object stats\n * ```\n */\n\n// ==========================================================================\n// 1. Reference Resolution\n// ==========================================================================\n\n/**\n * Describes how a single field reference should be resolved during seed loading.\n *\n * When a lookup/master_detail field value is not an internal ID, the loader\n * attempts to match it against the target object's externalId field.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const ReferenceResolutionSchema = lazySchema(() => z.object({\n /** The field name on the source object (e.g., 'account_id') */\n field: z.string().describe('Source field name containing the reference value'),\n\n /** The target object being referenced (e.g., 'account') */\n targetObject: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Target object name (snake_case)'),\n\n /**\n * The field on the target object used to match the reference value.\n * Defaults to the target object's externalId (usually 'name').\n */\n targetField: z.string().default('name').describe('Field on target object used for matching'),\n\n /** The field type that triggered this resolution (lookup, master_detail, or user) */\n fieldType: z.enum(['lookup', 'master_detail', 'user']).describe('Relationship field type'),\n}).describe('Describes how a field reference is resolved during seed loading'));\n\nexport type ReferenceResolution = z.infer<typeof ReferenceResolutionSchema>;\n\n// ==========================================================================\n// 2. Object Dependency Node\n// ==========================================================================\n\n/**\n * Represents a single object in the dependency graph.\n * Built from object metadata by inspecting lookup/master_detail fields.\n */\nexport const ObjectDependencyNodeSchema = lazySchema(() => z.object({\n /** Object machine name */\n object: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Object name (snake_case)'),\n\n /**\n * Objects that this object depends on (via lookup/master_detail fields).\n * These must be loaded before this object.\n */\n dependsOn: z.array(z.string()).describe('Objects this object depends on'),\n\n /**\n * Field-level reference details for each dependency.\n * Maps field name → reference resolution info.\n */\n references: z.array(ReferenceResolutionSchema).describe('Field-level reference details'),\n}).describe('Object node in the seed data dependency graph'));\n\nexport type ObjectDependencyNode = z.infer<typeof ObjectDependencyNodeSchema>;\n\n// ==========================================================================\n// 3. Object Dependency Graph\n// ==========================================================================\n\n/**\n * The complete object dependency graph for seed data loading.\n * Used to determine topological insert order and detect circular dependencies.\n */\nexport const ObjectDependencyGraphSchema = lazySchema(() => z.object({\n /** All object nodes in the graph */\n nodes: z.array(ObjectDependencyNodeSchema).describe('All objects in the dependency graph'),\n\n /**\n * Topologically sorted object names for insertion order.\n * Parent objects appear before child objects.\n */\n insertOrder: z.array(z.string()).describe('Topologically sorted insert order'),\n\n /**\n * Circular dependency chains detected in the graph.\n * Each chain is an array of object names forming a cycle.\n * When present, the loader must use a multi-pass strategy.\n *\n * @example [['project', 'task', 'project']]\n */\n circularDependencies: z.array(z.array(z.string())).default([])\n .describe('Circular dependency chains (e.g., [[\"a\", \"b\", \"a\"]])'),\n}).describe('Complete object dependency graph for seed data loading'));\n\nexport type ObjectDependencyGraph = z.infer<typeof ObjectDependencyGraphSchema>;\n\n// ==========================================================================\n// 4. Reference Resolution Error\n// ==========================================================================\n\n/**\n * Actionable error for a failed reference resolution.\n * Provides all context needed to diagnose and fix the broken reference.\n *\n * Aligns with Salesforce Data Loader error reporting patterns:\n * field name, target object, attempted value, and reason.\n */\nexport const ReferenceResolutionErrorSchema = lazySchema(() => z.object({\n /** The source object containing the broken reference */\n sourceObject: z.string().describe('Object with the broken reference'),\n\n /** The field containing the unresolved value */\n field: z.string().describe('Field name with unresolved reference'),\n\n /** The target object that was searched */\n targetObject: z.string().describe('Target object searched for the reference'),\n\n /** The externalId field used for matching on the target object */\n targetField: z.string().describe('ExternalId field used for matching'),\n\n /** The value that could not be resolved */\n attemptedValue: z.unknown().describe('Value that failed to resolve'),\n\n /** The index of the record in the dataset's records array */\n recordIndex: z.number().int().min(0).describe('Index of the record in the dataset'),\n\n /** Human-readable error message */\n message: z.string().describe('Human-readable error description'),\n}).describe('Actionable error for a failed reference resolution'));\n\nexport type ReferenceResolutionError = z.infer<typeof ReferenceResolutionErrorSchema>;\n\n// ==========================================================================\n// 4b. Seed Identity (os.user / os.org binding)\n// ==========================================================================\n\n/**\n * Identity bound to `os.user` / `os.org` when the loader evaluates CEL\n * expressions embedded in seed records (e.g. `owner_id: cel\\`os.user.id\\``).\n *\n * The seed loader populates the formula evaluation context from this, so\n * identity-derived seed values resolve to the installer/system identity\n * instead of failing. The canonical producer is the runtime's deterministic\n * system user (`usr_system`), ensured before seeding so this always resolves\n * — even on a fresh boot before the first human sign-up.\n *\n * Defined eagerly (only primitive fields, no circular refs) so it can be\n * referenced from the lazily-built config schema below.\n */\nexport const SeedIdentitySchema = z.object({\n /**\n * Subject bound to `os.user` in seed CEL. Typically the deterministic\n * system user (`usr_system`) or the promoted platform admin.\n */\n user: z.object({\n id: z.string().min(1),\n role: z.string().optional(),\n email: z.string().optional(),\n }).optional().describe('Subject bound to os.user in seed CEL expressions'),\n\n /**\n * Organization bound to `os.org` in seed CEL. During per-tenant replay\n * the loader defaults this to `organizationId` when omitted.\n */\n org: z.object({\n id: z.string().min(1),\n tier: z.string().optional(),\n }).optional().describe('Organization bound to os.org in seed CEL expressions'),\n}).describe('Identity context for resolving os.user / os.org in seed CEL values');\n\nexport type SeedIdentity = z.infer<typeof SeedIdentitySchema>;\n\n// ==========================================================================\n// 5. Seed Loader Configuration\n// ==========================================================================\n\n/**\n * Configuration for the seed data loader.\n * Controls behavior for reference resolution, error handling, and validation.\n */\nexport const SeedLoaderConfigSchema = lazySchema(() => z.object({\n /**\n * Dry-run mode: validate all references without writing data.\n * Surfaces broken references before any mutations occur.\n * @default false\n */\n dryRun: z.boolean().default(false)\n .describe('Validate references without writing data'),\n\n /**\n * Whether to halt on the first reference resolution error.\n * When false, collects all errors and continues loading.\n * @default false\n */\n haltOnError: z.boolean().default(false)\n .describe('Stop on first reference resolution error'),\n\n /**\n * Enable multi-pass loading for circular dependencies.\n * Pass 1: Insert records with null for circular references.\n * Pass 2: Update records to fill deferred references.\n * @default true\n */\n multiPass: z.boolean().default(true)\n .describe('Enable multi-pass loading for circular dependencies'),\n\n /**\n * Default dataset mode when not specified per-dataset.\n * @default 'upsert'\n */\n defaultMode: SeedMode.default('upsert')\n .describe('Default conflict resolution strategy'),\n\n /**\n * Maximum number of records to process in a single batch.\n * Controls memory usage for large datasets.\n * @default 1000\n */\n batchSize: z.number().int().min(1).default(1000)\n .describe('Maximum records per batch insert/upsert'),\n\n /**\n * Whether to wrap the entire load operation in a transaction.\n * When true, all-or-nothing semantics apply.\n * @default false\n */\n transaction: z.boolean().default(false)\n .describe('Wrap entire load in a transaction (all-or-nothing)'),\n\n /**\n * Environment filter. Only datasets matching this environment are loaded.\n * When not specified, all datasets are loaded regardless of env scope.\n */\n env: z.enum(['prod', 'dev', 'test']).optional()\n .describe('Only load datasets matching this environment'),\n\n /**\n * Target organization for per-tenant seed loading.\n *\n * When set, the loader:\n * - Injects `organization_id: <id>` into every record before write\n * (unless the record already supplies one).\n * - Scopes existing-record lookups (`loadExistingRecords`,\n * `resolveFromDatabase`) to `organization_id = <id>`, so `upsert`\n * mode finds the per-org copy rather than another tenant's row.\n *\n * Use this from a `sys_organization` insert hook to give every new\n * tenant a private copy of the artifact-shipped demo data (Salesforce\n * sandbox style). Omit for cross-tenant / platform-wide seeds (e.g.\n * `sys_permission_set`) — those rows should have `organization_id`\n * NULL and are not filtered by the default tenant RLS.\n */\n organizationId: z.string().min(1).optional()\n .describe('Target organization id for per-tenant seed replay'),\n\n /**\n * Identity bound to `os.user` / `os.org` when evaluating CEL expressions\n * embedded in seed records (e.g. `owner_id: cel\\`os.user.id\\``,\n * `organization_id: cel\\`os.org.id\\``).\n *\n * When omitted, `os.user` / `os.org` are simply unbound — and any record\n * that references them fails loudly (the record is dropped with an\n * actionable error rather than persisting the raw Expression envelope into\n * the column). The runtime supplies a deterministic system user here so\n * identity-derived seeds resolve even before the first human sign-up.\n */\n identity: SeedIdentitySchema.optional()\n .describe('Identity bound to os.user / os.org when resolving CEL seed values'),\n}).describe('Seed data loader configuration'));\n\nexport type SeedLoaderConfig = z.infer<typeof SeedLoaderConfigSchema>;\n\n/** Input type — all fields with defaults are optional */\nexport type SeedLoaderConfigInput = z.input<typeof SeedLoaderConfigSchema>;\n\n// ==========================================================================\n// 6. Per-Object Load Result\n// ==========================================================================\n\n/**\n * Result of loading a single object's dataset.\n */\nexport const SeedLoadResultSchema = lazySchema(() => z.object({\n /** Target object name */\n object: z.string().describe('Object that was loaded'),\n\n /** Import mode used */\n mode: SeedMode.describe('Import mode used'),\n\n /** Number of records successfully inserted */\n inserted: z.number().int().min(0).describe('Records inserted'),\n\n /** Number of records successfully updated (upsert matched existing) */\n updated: z.number().int().min(0).describe('Records updated'),\n\n /** Number of records skipped (mode: ignore, or already exists) */\n skipped: z.number().int().min(0).describe('Records skipped'),\n\n /** Number of records with errors */\n errored: z.number().int().min(0).describe('Records with errors'),\n\n /** Total records in the dataset */\n total: z.number().int().min(0).describe('Total records in dataset'),\n\n /** Number of references resolved via externalId */\n referencesResolved: z.number().int().min(0).describe('References resolved via externalId'),\n\n /** Number of references deferred to pass 2 (circular dependencies) */\n referencesDeferred: z.number().int().min(0).describe('References deferred to second pass'),\n\n /** Reference resolution errors for this object */\n errors: z.array(ReferenceResolutionErrorSchema).default([])\n .describe('Reference resolution errors'),\n}).describe('Result of loading a single dataset'));\n\nexport type SeedLoadResult = z.infer<typeof SeedLoadResultSchema>;\n\n// ==========================================================================\n// 7. Seed Loader Result\n// ==========================================================================\n\n/**\n * Complete result of a seed loading operation.\n * Aggregates all per-object results and provides summary statistics.\n */\nexport const SeedLoaderResultSchema = lazySchema(() => z.object({\n /** Whether the overall load operation succeeded */\n success: z.boolean().describe('Overall success status'),\n\n /** Was this a dry-run (validation only, no writes)? */\n dryRun: z.boolean().describe('Whether this was a dry-run'),\n\n /** The dependency graph used for ordering */\n dependencyGraph: ObjectDependencyGraphSchema.describe('Object dependency graph'),\n\n /** Per-object load results, in the order they were processed */\n results: z.array(SeedLoadResultSchema).describe('Per-object load results'),\n\n /** All reference resolution errors across all objects */\n errors: z.array(ReferenceResolutionErrorSchema).describe('All reference resolution errors'),\n\n /** Summary statistics */\n summary: z.object({\n /** Total objects processed */\n objectsProcessed: z.number().int().min(0).describe('Total objects processed'),\n\n /** Total records across all objects */\n totalRecords: z.number().int().min(0).describe('Total records across all objects'),\n\n /** Total records inserted */\n totalInserted: z.number().int().min(0).describe('Total records inserted'),\n\n /** Total records updated */\n totalUpdated: z.number().int().min(0).describe('Total records updated'),\n\n /** Total records skipped */\n totalSkipped: z.number().int().min(0).describe('Total records skipped'),\n\n /** Total records with errors */\n totalErrored: z.number().int().min(0).describe('Total records with errors'),\n\n /** Total references resolved via externalId */\n totalReferencesResolved: z.number().int().min(0).describe('Total references resolved'),\n\n /** Total references deferred to second pass */\n totalReferencesDeferred: z.number().int().min(0).describe('Total references deferred'),\n\n /** Number of circular dependency chains detected */\n circularDependencyCount: z.number().int().min(0).describe('Circular dependency chains detected'),\n\n /** Duration of the load operation in milliseconds */\n durationMs: z.number().min(0).describe('Load duration in milliseconds'),\n }).describe('Summary statistics'),\n}).describe('Complete seed loader result'));\n\nexport type SeedLoaderResult = z.infer<typeof SeedLoaderResultSchema>;\n\n// ==========================================================================\n// 8. Seed Loader Request\n// ==========================================================================\n\n/**\n * Input request for the seed loader.\n * Combines datasets with loader configuration.\n */\nexport const SeedLoaderRequestSchema = lazySchema(() => z.object({\n /** Seeds to load */\n seeds: z.array(SeedSchema).min(1).describe('Seeds to load'),\n\n /** Loader configuration */\n config: SeedLoaderConfigSchema.default(() => SeedLoaderConfigSchema.parse({})).describe('Loader configuration'),\n}).describe('Seed loader request with datasets and configuration'));\n\nexport type SeedLoaderRequest = z.infer<typeof SeedLoaderRequestSchema>;\n\n/** Input type — config defaults are optional */\nexport type SeedLoaderRequestInput = z.input<typeof SeedLoaderRequestSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Document Version Schema\n * \n * Represents a single version of a document in a version-controlled system.\n * Each version is immutable and maintains its own metadata and download URL.\n * \n * @example\n * ```json\n * {\n * \"versionNumber\": 2,\n * \"createdAt\": 1704067200000,\n * \"createdBy\": \"user_123\",\n * \"size\": 2048576,\n * \"checksum\": \"a1b2c3d4e5f6\",\n * \"downloadUrl\": \"https://storage.example.com/docs/v2/file.pdf\",\n * \"isLatest\": true\n * }\n * ```\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const DocumentVersionSchema = lazySchema(() => z.object({\n /**\n * Sequential version number (increments with each new version)\n */\n versionNumber: z.number().describe('Version number'),\n\n /**\n * Timestamp when this version was created (Unix milliseconds)\n */\n createdAt: z.number().describe('Creation timestamp'),\n\n /**\n * User ID who created this version\n */\n createdBy: z.string().describe('Creator user ID'),\n\n /**\n * File size in bytes\n */\n size: z.number().describe('File size in bytes'),\n\n /**\n * Checksum/hash of the file content (for integrity verification)\n */\n checksum: z.string().describe('File checksum'),\n\n /**\n * URL to download this specific version\n */\n downloadUrl: z.string().url().describe('Download URL'),\n\n /**\n * Whether this is the latest version\n * @default false\n */\n isLatest: z.boolean().optional().default(false).describe('Is latest version'),\n}));\n\n/**\n * Document Template Schema\n * \n * Defines a reusable document template with dynamic placeholders.\n * Templates can be used to generate documents with variable content.\n * \n * @example\n * ```json\n * {\n * \"id\": \"contract-template\",\n * \"name\": \"Service Agreement\",\n * \"description\": \"Standard service agreement template\",\n * \"fileUrl\": \"https://example.com/templates/contract.docx\",\n * \"fileType\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n * \"placeholders\": [\n * {\n * \"key\": \"client_name\",\n * \"label\": \"Client Name\",\n * \"type\": \"text\",\n * \"required\": true\n * },\n * {\n * \"key\": \"contract_date\",\n * \"label\": \"Contract Date\",\n * \"type\": \"date\",\n * \"required\": true\n * }\n * ]\n * }\n * ```\n */\nexport const DocumentTemplateSchema = lazySchema(() => z.object({\n /**\n * Unique identifier for the template\n */\n id: z.string().describe('Template ID'),\n\n /**\n * Human-readable name of the template\n */\n name: z.string().describe('Template name'),\n\n /**\n * Optional description of the template's purpose\n */\n description: z.string().optional().describe('Template description'),\n\n /**\n * URL to the template file\n */\n fileUrl: z.string().url().describe('Template file URL'),\n\n /**\n * MIME type of the template file\n */\n fileType: z.string().describe('File MIME type'),\n\n /**\n * List of dynamic placeholders in the template\n */\n placeholders: z.array(z.object({\n /**\n * Placeholder identifier (used in template)\n */\n key: z.string().describe('Placeholder key'),\n\n /**\n * Human-readable label for the placeholder\n */\n label: z.string().describe('Placeholder label'),\n\n /**\n * Data type of the placeholder value\n */\n type: z.enum(['text', 'number', 'date', 'image']).describe('Placeholder type'),\n\n /**\n * Whether this placeholder must be filled\n * @default false\n */\n required: z.boolean().optional().default(false).describe('Is required'),\n })).describe('Template placeholders'),\n}));\n\n/**\n * E-Signature Configuration Schema\n * \n * Configuration for electronic signature workflows.\n * Supports integration with popular e-signature providers.\n * \n * @example\n * ```json\n * {\n * \"provider\": \"docusign\",\n * \"enabled\": true,\n * \"signers\": [\n * {\n * \"email\": \"client@example.com\",\n * \"name\": \"John Doe\",\n * \"role\": \"Client\",\n * \"order\": 1\n * },\n * {\n * \"email\": \"manager@example.com\",\n * \"name\": \"Jane Smith\",\n * \"role\": \"Manager\",\n * \"order\": 2\n * }\n * ],\n * \"expirationDays\": 30,\n * \"reminderDays\": 7\n * }\n * ```\n */\nexport const ESignatureConfigSchema = lazySchema(() => z.object({\n /**\n * E-signature service provider\n */\n provider: z.enum(['docusign', 'adobe-sign', 'hellosign', 'custom']).describe('E-signature provider'),\n\n /**\n * Whether e-signature is enabled for this document\n * @default false\n */\n enabled: z.boolean().optional().default(false).describe('E-signature enabled'),\n\n /**\n * List of signers in signing order\n */\n signers: z.array(z.object({\n /**\n * Signer's email address\n */\n email: z.string().email().describe('Signer email'),\n\n /**\n * Signer's full name\n */\n name: z.string().describe('Signer name'),\n\n /**\n * Signer's role in the document\n */\n role: z.string().describe('Signer role'),\n\n /**\n * Signing order (lower numbers sign first)\n */\n order: z.number().describe('Signing order'),\n })).describe('Document signers'),\n\n /**\n * Days until signature request expires\n * @default 30\n */\n expirationDays: z.number().optional().default(30).describe('Expiration days'),\n\n /**\n * Days between reminder emails\n * @default 7\n */\n reminderDays: z.number().optional().default(7).describe('Reminder interval days'),\n}));\n\n/**\n * Document Schema\n * \n * Comprehensive document management protocol supporting versioning,\n * templates, e-signatures, and access control.\n * \n * @example\n * ```json\n * {\n * \"id\": \"doc_123\",\n * \"name\": \"Service Agreement 2024\",\n * \"description\": \"Annual service agreement\",\n * \"fileType\": \"application/pdf\",\n * \"fileSize\": 1048576,\n * \"category\": \"contracts\",\n * \"tags\": [\"legal\", \"2024\", \"services\"],\n * \"versioning\": {\n * \"enabled\": true,\n * \"versions\": [\n * {\n * \"versionNumber\": 1,\n * \"createdAt\": 1704067200000,\n * \"createdBy\": \"user_123\",\n * \"size\": 1048576,\n * \"checksum\": \"abc123\",\n * \"downloadUrl\": \"https://example.com/docs/v1.pdf\",\n * \"isLatest\": true\n * }\n * ],\n * \"majorVersion\": 1,\n * \"minorVersion\": 0\n * },\n * \"access\": {\n * \"isPublic\": false,\n * \"sharedWith\": [\"user_456\", \"team_789\"],\n * \"expiresAt\": 1735689600000\n * },\n * \"metadata\": {\n * \"author\": \"John Doe\",\n * \"department\": \"Legal\"\n * }\n * }\n * ```\n */\nexport const DocumentSchema = lazySchema(() => z.object({\n /**\n * Unique document identifier\n */\n id: z.string().describe('Document ID'),\n\n /**\n * Document name\n */\n name: z.string().describe('Document name'),\n\n /**\n * Optional document description\n */\n description: z.string().optional().describe('Document description'),\n\n /**\n * MIME type of the document\n */\n fileType: z.string().describe('File MIME type'),\n\n /**\n * File size in bytes\n */\n fileSize: z.number().describe('File size in bytes'),\n\n /**\n * Document category for organization\n */\n category: z.string().optional().describe('Document category'),\n\n /**\n * Tags for searchability and organization\n */\n tags: z.array(z.string()).optional().describe('Document tags'),\n\n /**\n * Version control configuration\n */\n versioning: z.object({\n /**\n * Whether versioning is enabled\n */\n enabled: z.boolean().describe('Versioning enabled'),\n\n /**\n * List of all document versions\n */\n versions: z.array(DocumentVersionSchema).describe('Version history'),\n\n /**\n * Current major version number\n */\n majorVersion: z.number().describe('Major version'),\n\n /**\n * Current minor version number\n */\n minorVersion: z.number().describe('Minor version'),\n }).optional().describe('Version control'),\n\n /**\n * Template configuration (if document is generated from template)\n */\n template: DocumentTemplateSchema.optional().describe('Document template'),\n\n /**\n * E-signature configuration\n */\n eSignature: ESignatureConfigSchema.optional().describe('E-signature config'),\n\n /**\n * Access control settings\n */\n access: z.object({\n /**\n * Whether document is publicly accessible\n * @default false\n */\n isPublic: z.boolean().optional().default(false).describe('Public access'),\n\n /**\n * List of user/team IDs with access\n */\n sharedWith: z.array(z.string()).optional().describe('Shared with'),\n\n /**\n * Timestamp when access expires (Unix milliseconds)\n */\n expiresAt: z.number().optional().describe('Access expiration'),\n }).optional().describe('Access control'),\n\n /**\n * Custom metadata fields\n */\n metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata'),\n}));\n\n// Type exports\nexport type Document = z.infer<typeof DocumentSchema>;\nexport type DocumentVersion = z.infer<typeof DocumentVersionSchema>;\nexport type DocumentTemplate = z.infer<typeof DocumentTemplateSchema>;\nexport type ESignatureConfig = z.infer<typeof ESignatureConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { ExpressionInputSchema } from './expression.zod';\n\n/**\n * Base Field Mapping Protocol\n * \n * Shared by: ETL, Sync, Connector, External Lookup\n * \n * This module provides the canonical field mapping schema used across\n * ObjectStack for data transformation and synchronization.\n * \n * **Use Cases:**\n * - ETL pipelines (data/mapping.zod.ts)\n * - Data synchronization (automation/sync.zod.ts)\n * - Integration connectors (integration/connector.zod.ts)\n * - External lookups (data/external-lookup.zod.ts)\n * \n * @example Basic field mapping\n * ```typescript\n * const mapping: FieldMapping = {\n * source: 'external_user_id',\n * target: 'user_id',\n * };\n * ```\n * \n * @example With transformation\n * ```typescript\n * const mapping: FieldMapping = {\n * source: 'user_name',\n * target: 'name',\n * transform: { type: 'cast', targetType: 'string' },\n * defaultValue: 'Unknown'\n * };\n * ```\n */\n\n/**\n * Transform Type Schema\n * \n * Defines the type of transformation to apply to a field value.\n * Implementations can extend this for domain-specific transforms.\n */\nimport { lazySchema } from './lazy-schema';\nexport const TransformTypeSchema = lazySchema(() => z.discriminatedUnion('type', [\n z.object({\n type: z.literal('constant'),\n value: z.unknown().describe('Constant value to use'),\n }).describe('Set a constant value'),\n \n z.object({\n type: z.literal('cast'),\n targetType: z.enum(['string', 'number', 'boolean', 'date']).describe('Target data type'),\n }).describe('Cast to a specific data type'),\n \n z.object({\n type: z.literal('lookup'),\n table: z.string().describe('Lookup table name'),\n keyField: z.string().describe('Field to match on'),\n valueField: z.string().describe('Field to retrieve'),\n }).describe('Lookup value from another table'),\n \n z.object({\n type: z.literal('javascript'),\n expression: ExpressionInputSchema.describe('JS expression (dialect=\"js\" recommended). e.g. value.toUpperCase()'),\n }).describe('Custom JavaScript transformation'),\n \n z.object({\n type: z.literal('map'),\n mappings: z.record(z.string(), z.unknown()).describe('Value mappings (e.g., {\"Active\": \"active\"})'),\n }).describe('Map values using a dictionary'),\n]));\n\nexport type TransformType = z.infer<typeof TransformTypeSchema>;\n\n/**\n * Field Mapping Schema\n * \n * Base schema for mapping fields between source and target systems.\n * \n * **NAMING CONVENTION:**\n * - source: Field name in the source system\n * - target: Field name in the target system (should be snake_case for ObjectStack)\n * \n * @example\n * ```typescript\n * {\n * source: 'FirstName',\n * target: 'first_name',\n * transform: { type: 'cast', targetType: 'string' },\n * defaultValue: ''\n * }\n * ```\n */\nexport const FieldMappingSchema = lazySchema(() => z.object({\n /**\n * Source field name\n */\n source: z.string().describe('Source field name'),\n \n /**\n * Target field name (should be snake_case for ObjectStack)\n */\n target: z.string().describe('Target field name'),\n \n /**\n * Transformation to apply\n */\n transform: TransformTypeSchema.optional().describe('Transformation to apply'),\n \n /**\n * Default value if source is null/undefined\n */\n defaultValue: z.unknown().optional().describe('Default if source is null/undefined'),\n}));\n\nexport type FieldMapping = z.infer<typeof FieldMappingSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FieldMappingSchema as BaseFieldMappingSchema } from '../shared/mapping.zod';\n\n/**\n * External Data Source Schema\n * \n * Configuration for connecting to external data systems.\n * Similar to Salesforce External Objects for real-time data integration.\n * \n * @example\n * ```json\n * {\n * \"id\": \"salesforce-accounts\",\n * \"name\": \"Salesforce Account Data\",\n * \"type\": \"rest-api\",\n * \"endpoint\": \"https://api.salesforce.com/services/data/v58.0\",\n * \"authentication\": {\n * \"type\": \"oauth2\",\n * \"config\": {\n * \"clientId\": \"...\",\n * \"clientSecret\": \"...\",\n * \"tokenUrl\": \"https://login.salesforce.com/services/oauth2/token\"\n * }\n * }\n * }\n * ```\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const ExternalDataSourceSchema = lazySchema(() => z.object({\n /**\n * Unique identifier for the external data source\n */\n id: z.string().describe('Data source ID'),\n\n /**\n * Human-readable name of the data source\n */\n name: z.string().describe('Data source name'),\n\n /**\n * Protocol type for connecting to the data source\n */\n type: z.enum(['odata', 'rest-api', 'graphql', 'custom']).describe('Protocol type'),\n\n /**\n * Base URL endpoint for the external system\n */\n endpoint: z.string().url().describe('API endpoint URL'),\n\n /**\n * Authentication configuration\n */\n authentication: z.object({\n /**\n * Authentication method\n */\n type: z.enum(['oauth2', 'api-key', 'basic', 'none']).describe('Auth type'),\n\n /**\n * Authentication-specific configuration\n * Structure varies based on auth type\n */\n config: z.record(z.string(), z.unknown()).describe('Auth configuration'),\n }).describe('Authentication'),\n}));\n\n/**\n * Field Mapping Schema for External Lookups\n * \n * Extends the base field mapping with external lookup specific features.\n * Uses the canonical field mapping protocol from shared/mapping.zod.ts.\n * \n * @see {@link BaseFieldMappingSchema} for the base field mapping schema\n * \n * @example\n * ```json\n * {\n * \"source\": \"AccountName\",\n * \"target\": \"name\",\n * \"readonly\": true\n * }\n * ```\n */\nexport const ExternalFieldMappingSchema = lazySchema(() => BaseFieldMappingSchema.extend({\n /**\n * Field data type\n */\n type: z.string().optional().describe('Field type'),\n\n /**\n * Whether the field is read-only\n * @default true\n */\n readonly: z.boolean().optional().default(true).describe('Read-only field'),\n}));\n\n/**\n * External Lookup Schema\n * \n * Real-time data lookup protocol for external systems.\n * Enables querying external data sources without replication.\n * Inspired by Salesforce External Objects and OData protocols.\n * \n * @example\n * ```json\n * {\n * \"fieldName\": \"external_account\",\n * \"dataSource\": {\n * \"id\": \"salesforce-api\",\n * \"name\": \"Salesforce\",\n * \"type\": \"rest-api\",\n * \"endpoint\": \"https://api.salesforce.com/services/data/v58.0\",\n * \"authentication\": {\n * \"type\": \"oauth2\",\n * \"config\": {\"clientId\": \"...\"}\n * }\n * },\n * \"query\": {\n * \"endpoint\": \"/sobjects/Account\",\n * \"method\": \"GET\",\n * \"parameters\": {\"limit\": 100}\n * },\n * \"fieldMappings\": [\n * {\n * \"externalField\": \"Name\",\n * \"localField\": \"account_name\",\n * \"type\": \"text\",\n * \"readonly\": true\n * }\n * ],\n * \"caching\": {\n * \"enabled\": true,\n * \"ttl\": 300,\n * \"strategy\": \"ttl\"\n * },\n * \"fallback\": {\n * \"enabled\": true,\n * \"showError\": true\n * },\n * \"rateLimit\": {\n * \"requestsPerSecond\": 10,\n * \"burstSize\": 20\n * }\n * }\n * ```\n */\nexport const ExternalLookupSchema = lazySchema(() => z.object({\n /**\n * Name of the field that uses external lookup\n */\n fieldName: z.string().describe('Field name'),\n\n /**\n * External data source configuration\n */\n dataSource: ExternalDataSourceSchema.describe('External data source'),\n\n /**\n * Query configuration for fetching external data\n */\n query: z.object({\n /**\n * API endpoint path (relative to base endpoint)\n */\n endpoint: z.string().describe('Query endpoint path'),\n\n /**\n * HTTP method for the query\n * @default 'GET'\n */\n method: z.enum(['GET', 'POST']).optional().default('GET').describe('HTTP method'),\n\n /**\n * Query parameters or request body\n */\n parameters: z.record(z.string(), z.unknown()).optional().describe('Query parameters'),\n }).describe('Query configuration'),\n\n /**\n * Mapping between external and local fields\n */\n fieldMappings: z.array(ExternalFieldMappingSchema).describe('Field mappings'),\n\n /**\n * Cache configuration for external data\n */\n caching: z.object({\n /**\n * Whether caching is enabled\n * @default true\n */\n enabled: z.boolean().optional().default(true).describe('Cache enabled'),\n\n /**\n * Time-to-live in seconds\n * @default 300\n */\n ttl: z.number().optional().default(300).describe('Cache TTL (seconds)'),\n\n /**\n * Cache eviction strategy\n * @default 'ttl'\n */\n strategy: z.enum(['lru', 'lfu', 'ttl']).optional().default('ttl').describe('Cache strategy'),\n }).optional().describe('Caching configuration'),\n\n /**\n * Fallback behavior when external system is unavailable\n */\n fallback: z.object({\n /**\n * Whether fallback is enabled\n * @default true\n */\n enabled: z.boolean().optional().default(true).describe('Fallback enabled'),\n\n /**\n * Default value to use when external system fails\n */\n defaultValue: z.unknown().optional().describe('Default fallback value'),\n\n /**\n * Whether to show error message to user\n * @default true\n */\n showError: z.boolean().optional().default(true).describe('Show error to user'),\n }).optional().describe('Fallback configuration'),\n\n /**\n * Rate limiting to prevent overwhelming external system\n */\n rateLimit: z.object({\n /**\n * Maximum requests per second\n */\n requestsPerSecond: z.number().describe('Requests per second limit'),\n\n /**\n * Burst size for handling spikes\n */\n burstSize: z.number().optional().describe('Burst size'),\n }).optional().describe('Rate limiting'),\n\n /**\n * Retry configuration with exponential backoff\n *\n * @example\n * ```json\n * {\n * \"maxRetries\": 3,\n * \"initialDelayMs\": 1000,\n * \"maxDelayMs\": 30000,\n * \"backoffMultiplier\": 2,\n * \"retryableStatusCodes\": [429, 500, 502, 503, 504]\n * }\n * ```\n */\n retry: z.object({\n /** Maximum number of retry attempts */\n maxRetries: z.number().min(0).default(3).describe('Maximum retry attempts'),\n /** Initial delay before first retry (ms) */\n initialDelayMs: z.number().default(1000).describe('Initial retry delay in milliseconds'),\n /** Maximum delay between retries (ms) */\n maxDelayMs: z.number().default(30000).describe('Maximum retry delay in milliseconds'),\n /** Backoff multiplier for exponential backoff */\n backoffMultiplier: z.number().default(2).describe('Exponential backoff multiplier'),\n /** HTTP status codes that trigger a retry */\n retryableStatusCodes: z.array(z.number()).default([429, 500, 502, 503, 504])\n .describe('HTTP status codes that are retryable'),\n }).optional().describe('Retry configuration with exponential backoff'),\n\n /**\n * Request/response transformation pipeline\n *\n * Allows transforming request parameters and response data\n * before they are processed by the external lookup system.\n */\n transform: z.object({\n /** Transform request parameters before sending */\n request: z.object({\n /** Header transformations (key-value additions) */\n headers: z.record(z.string(), z.string()).optional().describe('Additional request headers'),\n /** Query parameter transformations */\n queryParams: z.record(z.string(), z.string()).optional().describe('Additional query parameters'),\n }).optional().describe('Request transformation'),\n /** Transform response data after receiving */\n response: z.object({\n /** JSONPath expression to extract data from response */\n dataPath: z.string().optional().describe('JSONPath to extract data (e.g., \"$.data.results\")'),\n /** JSONPath expression to extract total count for pagination */\n totalPath: z.string().optional().describe('JSONPath to extract total count (e.g., \"$.meta.total\")'),\n }).optional().describe('Response transformation'),\n }).optional().describe('Request/response transformation pipeline'),\n\n /** Pagination support for external data sources */\n pagination: z.object({\n /** Pagination type */\n type: z.enum(['offset', 'cursor', 'page']).default('offset').describe('Pagination type'),\n /** Page size */\n pageSize: z.number().default(100).describe('Items per page'),\n /** Maximum pages to fetch */\n maxPages: z.number().optional().describe('Maximum number of pages to fetch'),\n }).optional().describe('Pagination configuration for external data'),\n}));\n\n// Type exports\nexport type ExternalLookup = z.infer<typeof ExternalLookupSchema>;\nexport type ExternalDataSource = z.infer<typeof ExternalDataSourceSchema>;\nexport type ExternalFieldMapping = z.infer<typeof ExternalFieldMappingSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n\n/**\n * Driver Identifier\n * Can be a built-in driver or a plugin-contributed driver (e.g., \"com.vendor.snowflake\").\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const DriverType = z.string().describe('Underlying driver identifier');\n\n/**\n * Driver Definition Schema\n * Metadata describing a Database Driver.\n * Plugins use this to register new connectivity options.\n */\nexport const DriverDefinitionSchema = lazySchema(() => z.object({\n id: z.string().describe('Unique driver identifier (e.g. \"postgres\")'),\n label: z.string().describe('Display label (e.g. \"PostgreSQL\")'),\n description: z.string().optional(),\n icon: z.string().optional(),\n \n /**\n * Configuration Schema (JSON Schema)\n * Describes the structure of the `config` object needed for this driver.\n * Used by the UI to generate the connection form.\n */\n configSchema: z.record(z.string(), z.unknown()).describe('JSON Schema for connection configuration'),\n \n /**\n * Default Capabilities\n * What this driver supports out-of-the-box.\n */\n capabilities: z.lazy(() => DatasourceCapabilities).optional(),\n}));\n\n/**\n * Datasource Capabilities Schema\n * Declares what this datasource naturally supports.\n * The ObjectQL engine uses this to determine what logic to push down\n * and what to compute in memory.\n */\nexport const DatasourceCapabilities = z.object({\n // ============================================================================\n // Transaction & Connection Management\n // ============================================================================\n \n /** Can handle ACID transactions? */\n transactions: z.boolean().default(false),\n \n // ============================================================================\n // Query Operations\n // ============================================================================\n \n /** Can execute WHERE clause filters natively? */\n queryFilters: z.boolean().default(false),\n \n /** Can perform aggregation (group by, sum, avg)? */\n queryAggregations: z.boolean().default(false),\n \n /** Can perform ORDER BY sorting? */\n querySorting: z.boolean().default(false),\n \n /** Can perform LIMIT/OFFSET pagination? */\n queryPagination: z.boolean().default(false),\n \n /** Can perform window functions? */\n queryWindowFunctions: z.boolean().default(false),\n \n /** Can perform subqueries? */\n querySubqueries: z.boolean().default(false),\n \n /** Can execute SQL-like joins natively? */\n joins: z.boolean().default(false),\n \n // ============================================================================\n // Advanced Features\n // ============================================================================\n \n /** Can perform full-text search? */\n fullTextSearch: z.boolean().default(false),\n \n /** Is read-only? */\n readOnly: z.boolean().default(false),\n \n /** Is scheme-less (needs schema inference)? */\n dynamicSchema: z.boolean().default(false),\n});\n\n/**\n * Schema Ownership Mode (ADR-0015)\n *\n * Distinguishes \"ObjectStack owns this schema\" from \"this is somebody\n * else's production database — never touch DDL\". Gates migrations,\n * boot-time validation, and writes.\n *\n * - `managed` — ObjectStack owns the schema: DDL + migrations allowed.\n * - `external` — Mature external DB: DDL forbidden; mismatch fails boot.\n * - `validate-only` — Like `external`, but mismatches warn instead of fail.\n */\nexport const SchemaModeSchema = z\n .enum(['managed', 'external', 'validate-only'])\n .describe('Schema ownership mode');\n\nexport type SchemaMode = z.infer<typeof SchemaModeSchema>;\n\n/**\n * External Datasource Settings (ADR-0015)\n *\n * Present only when `schemaMode !== 'managed'`. Carries the federation\n * policy for a mature external database: write gating, schema whitelist,\n * boot/drift validation behaviour, credentials reference, and query caps.\n */\nexport const ExternalDatasourceSettingsSchema = z.object({\n label: z.string().optional()\n .describe('Display label, e.g. \"Snowflake — ANALYTICS / PROD\"'),\n allowedSchemas: z.array(z.string()).optional()\n .describe('Whitelist of remote schemas/databases that may be exposed.'),\n allowWrites: z.boolean().default(false)\n .describe('Global write gate. Individual objects must also opt in via object.external.writable.'),\n validation: z.object({\n onMismatch: z.enum(['fail', 'warn', 'ignore']).default('fail')\n .describe('What to do when a federated object diverges from the remote table.'),\n checkOnBoot: z.boolean().default(true)\n .describe('Validate federated objects against the remote schema at boot.'),\n checkIntervalMs: z.number().optional()\n .describe('Optional background drift-check interval in milliseconds.'),\n }).default({ onMismatch: 'fail', checkOnBoot: true }).describe('Boot/drift validation policy'),\n credentialsRef: z.string().optional()\n .describe('Reference into the secrets store; never inline credentials.'),\n queryTimeoutMs: z.number().default(30_000)\n .describe('Hard cap on per-query execution time.'),\n requirePermission: z.string().optional()\n .describe('Optional convenience: gate the entire datasource behind a single role.'),\n}).describe('External datasource federation settings (schemaMode != \"managed\")');\n\nexport type ExternalDatasourceSettings = z.infer<typeof ExternalDatasourceSettingsSchema>;\n\n/**\n * Datasource Schema\n * Represents a connection to an external data store.\n */\nexport const DatasourceSchema = lazySchema(() => z.object({\n /** Machine Name */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Unique datasource identifier'),\n \n /** Human Label */\n label: z.string().optional().describe('Display label'),\n \n /** Driver */\n driver: DriverType.describe('Underlying driver type'),\n \n /** \n * Connection Configuration \n * Specific to the driver (e.g., host, port, user, password, bucket, etc.)\n * Stored securely (passwords usually interpolated from ENV).\n */\n config: z.record(z.string(), z.unknown()).describe('Driver specific configuration'),\n \n /**\n * Connection Pool Configuration\n * Standard connection pooling settings.\n */\n pool: z.object({\n min: z.number().default(0).describe('Minimum connections'),\n max: z.number().default(10).describe('Maximum connections'),\n idleTimeoutMillis: z.number().default(30000).describe('Idle timeout'),\n connectionTimeoutMillis: z.number().default(3000).describe('Connection establishment timeout'),\n }).optional().describe('Connection pool settings'),\n\n /**\n * Read Replicas\n * Optional list of duplicate configurations for read-only operations.\n * Useful for scaling read throughput.\n */\n readReplicas: z.array(z.record(z.string(), z.unknown())).optional().describe('Read-only replica configurations'),\n\n /**\n * Capability Overrides\n * Manually override what the driver claims to support.\n */\n capabilities: DatasourceCapabilities.optional().describe('Capability overrides'),\n \n /** Health Check */\n healthCheck: z.object({\n enabled: z.boolean().default(true).describe('Enable health check endpoint'),\n intervalMs: z.number().default(30000).describe('Health check interval in milliseconds'),\n timeoutMs: z.number().default(5000).describe('Health check timeout in milliseconds'),\n }).optional().describe('Datasource health check configuration'),\n\n /** SSL/TLS Configuration */\n ssl: z.object({\n enabled: z.boolean().default(false).describe('Enable SSL/TLS for database connection'),\n rejectUnauthorized: z.boolean().default(true).describe('Reject connections with invalid/self-signed certificates'),\n ca: z.string().optional().describe('CA certificate (PEM format or path to file)'),\n cert: z.string().optional().describe('Client certificate (PEM format or path to file)'),\n key: z.string().optional().describe('Client private key (PEM format or path to file)'),\n }).optional().describe('SSL/TLS configuration for secure database connections'),\n\n /** Retry Policy */\n retryPolicy: z.object({\n maxRetries: z.number().default(3).describe('Maximum number of retry attempts'),\n baseDelayMs: z.number().default(1000).describe('Base delay between retries in milliseconds'),\n maxDelayMs: z.number().default(30000).describe('Maximum delay between retries in milliseconds'),\n backoffMultiplier: z.number().default(2).describe('Exponential backoff multiplier'),\n }).optional().describe('Connection retry policy for transient failures'),\n\n /** Description */\n description: z.string().optional().describe('Internal description'),\n \n /** Is enabled? */\n active: z.boolean().default(true).describe('Is datasource enabled'),\n\n /**\n * Auto-connect opt-in (ADR-0062 D2(c)).\n *\n * Forces the runtime to build a live driver for this datasource at boot even\n * when it is `managed` and nothing routes to it. By default a declared\n * datasource only auto-connects when it is `external` or an object explicitly\n * binds to it via `object.datasource` (see ADR-0062 D2). Set this to opt a\n * managed, unrouted datasource into the live-connection lifecycle.\n */\n autoConnect: z.boolean().default(false)\n .describe('Force a live driver connection at boot even when managed + unrouted (ADR-0062 D2).'),\n\n /**\n * Schema Ownership Mode (ADR-0015)\n * Declares whether ObjectStack owns this schema (`managed`, default) or\n * is a guest in a mature external database (`external` / `validate-only`).\n */\n schemaMode: SchemaModeSchema.default('managed'),\n\n /**\n * External Federation Settings (ADR-0015)\n * Required when `schemaMode !== 'managed'`; forbidden otherwise.\n */\n external: ExternalDatasourceSettingsSchema.optional(),\n\n /**\n * Provenance (ADR-0015 Addendum)\n *\n * Server-managed, read-only. Distinguishes code-defined datasources\n * (`code` — authored as `*.datasource.ts`, GitOps-owned, read-only in the\n * UI) from runtime datasources (`runtime` — created via the Studio wizard,\n * persisted in the runtime metadata store, environment-scoped, editable).\n *\n * Never accepted from client input: the runtime stamps `code` on artefact\n * load and `runtime` on UI create. Defaults to `code` for artefact-defined\n * datasources that predate this field.\n */\n origin: z.enum(['code', 'runtime']).default('code')\n .describe('Datasource provenance (server-managed, read-only)'),\n}).superRefine((ds, ctx) => {\n if (ds.schemaMode !== 'managed' && !ds.external) {\n ctx.addIssue({\n code: 'custom',\n path: ['external'],\n message: `schemaMode='${ds.schemaMode}' requires 'external' settings.`,\n });\n }\n if (ds.schemaMode === 'managed' && ds.external) {\n ctx.addIssue({\n code: 'custom',\n path: ['external'],\n message: `'external' settings only apply when schemaMode != 'managed'.`,\n });\n }\n}));\n\nexport type Datasource = z.infer<typeof DatasourceSchema>;\n/** Authoring input for {@link Datasource} — defaulted fields are optional. */\nexport type DatasourceInput = z.input<typeof DatasourceSchema>;\nexport type DatasourceCapabilitiesType = z.infer<typeof DatasourceCapabilities>;\n\n/**\n * Type-safe factory for an external data connection (datasource). Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: Datasource` literal.\n */\nexport function defineDatasource(config: z.input<typeof DatasourceSchema>): Datasource {\n return DatasourceSchema.parse(config);\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * SQL ⇆ ObjectStack field-type compatibility matrix (ADR-0015 §4.6).\n *\n * A pure, dialect-aware module mapping remote SQL column types\n * (`text`, `varchar(255)`, `numeric(10,2)`, `timestamptz`, `jsonb`, …) to\n * ObjectStack field types, and answering \"can this remote column back this\n * field type?\". Used by `IExternalDatasourceService`:\n *\n * - `generateObjectDraft` → {@link suggestFieldType} to draft `*.object.ts`.\n * - `validateObject` → {@link isCompatible} to diff a declared field\n * against the remote column.\n *\n * No I/O, no driver coupling — operates on raw type strings so it can be\n * unit-tested independently and extended per dialect without touching the\n * runtime.\n */\n\nimport type { FieldType } from './field.zod';\n\n/** SQL dialects whose type vocabularies the matrix understands. */\nexport type SqlDialect =\n | 'postgres'\n | 'mysql'\n | 'sqlite'\n | 'snowflake'\n | 'bigquery'\n | 'mongo';\n\n/**\n * Result of a compatibility check:\n * - `true` — exact / safe mapping.\n * - `'lossy'`— usable but information may be lost (e.g. `jsonb` → `text`,\n * `numeric(38,0)` → JS `number`). Generated drafts flag these `// REVIEW:`.\n * - `false` — incompatible; the validator emits a `type_mismatch` diff.\n */\nexport type Compatibility = boolean | 'lossy';\n\n/**\n * Canonical \"base\" SQL type after stripping parameters/qualifiers and\n * applying dialect aliases. Internal vocabulary the matrix is keyed on.\n */\ntype CanonicalSqlType =\n | 'text'\n | 'integer'\n | 'bigint'\n | 'decimal'\n | 'float'\n | 'boolean'\n | 'date'\n | 'time'\n | 'datetime'\n | 'json'\n | 'uuid'\n | 'binary'\n | 'enum'\n | 'array'\n | 'vector'\n | 'unknown';\n\n/**\n * Per-dialect aliases mapping vendor type names to a {@link CanonicalSqlType}.\n * Only entries that differ from the shared base map (below) need listing.\n */\nconst DIALECT_ALIASES: Partial<Record<SqlDialect, Record<string, CanonicalSqlType>>> = {\n postgres: {\n int2: 'integer', int4: 'integer', int8: 'bigint', serial: 'integer', bigserial: 'bigint',\n float4: 'float', float8: 'float', numeric: 'decimal', bool: 'boolean',\n timestamptz: 'datetime', timestamp: 'datetime', timetz: 'time',\n jsonb: 'json', json: 'json', uuid: 'uuid', bytea: 'binary', bpchar: 'text',\n citext: 'text', vector: 'vector',\n },\n mysql: {\n tinyint: 'integer', smallint: 'integer', mediumint: 'integer', int: 'integer',\n bigint: 'bigint', double: 'float', real: 'float', decimal: 'decimal',\n datetime: 'datetime', timestamp: 'datetime', tinytext: 'text', mediumtext: 'text',\n longtext: 'text', json: 'json', blob: 'binary', longblob: 'binary', enum: 'enum',\n },\n sqlite: {\n integer: 'integer', int: 'integer', real: 'float', numeric: 'decimal',\n text: 'text', blob: 'binary',\n },\n snowflake: {\n number: 'decimal', int: 'integer', integer: 'integer', bigint: 'bigint',\n float: 'float', double: 'float', string: 'text', varchar: 'text', variant: 'json',\n object: 'json', array: 'array', boolean: 'boolean', timestamp_ntz: 'datetime',\n timestamp_tz: 'datetime', timestamp_ltz: 'datetime', binary: 'binary',\n },\n bigquery: {\n int64: 'bigint', float64: 'float', numeric: 'decimal', bignumeric: 'decimal',\n string: 'text', bytes: 'binary', bool: 'boolean', boolean: 'boolean',\n timestamp: 'datetime', datetime: 'datetime', struct: 'json', json: 'json',\n array: 'array', record: 'json',\n },\n mongo: {\n objectid: 'text', string: 'text', double: 'float', int: 'integer', long: 'bigint',\n decimal: 'decimal', bool: 'boolean', boolean: 'boolean', date: 'datetime',\n object: 'json', array: 'array', bindata: 'binary',\n },\n};\n\n/**\n * Dialect-agnostic base map of common ANSI/SQL type names to canonical types.\n * Consulted after dialect aliases.\n */\nconst BASE_ALIASES: Record<string, CanonicalSqlType> = {\n text: 'text', varchar: 'text', char: 'text', character: 'text', string: 'text',\n 'character varying': 'text', nvarchar: 'text', nchar: 'text', clob: 'text',\n integer: 'integer', int: 'integer', smallint: 'integer', tinyint: 'integer',\n bigint: 'bigint',\n decimal: 'decimal', numeric: 'decimal', number: 'decimal', money: 'decimal',\n float: 'float', double: 'float', 'double precision': 'float', real: 'float',\n boolean: 'boolean', bool: 'boolean', bit: 'boolean',\n date: 'date',\n time: 'time',\n datetime: 'datetime', timestamp: 'datetime',\n json: 'json', jsonb: 'json',\n uuid: 'uuid', guid: 'uuid',\n binary: 'binary', varbinary: 'binary', blob: 'binary', bytes: 'binary',\n enum: 'enum',\n array: 'array',\n vector: 'vector',\n};\n\n/**\n * For each canonical SQL type: the suggested ObjectStack field type plus the\n * set of field types it is exactly / lossily compatible with.\n */\nconst CANONICAL_TO_FIELD: Record<\n CanonicalSqlType,\n { suggested: FieldType; exact: FieldType[]; lossy: FieldType[] }\n> = {\n text: { suggested: 'text', exact: ['text', 'textarea', 'email', 'url', 'phone', 'markdown', 'html', 'richtext', 'code', 'select', 'color'], lossy: [] },\n integer: { suggested: 'number', exact: ['number', 'autonumber', 'rating', 'percent'], lossy: ['currency', 'boolean'] },\n bigint: { suggested: 'number', exact: ['number', 'autonumber'], lossy: ['currency'] },\n decimal: { suggested: 'number', exact: ['number', 'currency', 'percent'], lossy: ['rating'] },\n float: { suggested: 'number', exact: ['number', 'currency', 'percent', 'slider'], lossy: [] },\n boolean: { suggested: 'boolean', exact: ['boolean', 'toggle'], lossy: [] },\n date: { suggested: 'date', exact: ['date'], lossy: ['datetime'] },\n time: { suggested: 'time', exact: ['time'], lossy: [] },\n datetime: { suggested: 'datetime', exact: ['datetime'], lossy: ['date'] },\n json: { suggested: 'json', exact: ['json', 'composite', 'repeater', 'record', 'location', 'address', 'tags', 'multiselect'], lossy: ['text'] },\n uuid: { suggested: 'text', exact: ['text', 'lookup', 'master_detail', 'user'], lossy: [] },\n binary: { suggested: 'file', exact: ['file', 'image', 'signature'], lossy: ['text'] },\n enum: { suggested: 'select', exact: ['select', 'radio', 'text'], lossy: [] },\n array: { suggested: 'multiselect', exact: ['multiselect', 'checkboxes', 'tags', 'json'], lossy: ['text'] },\n vector: { suggested: 'vector', exact: ['vector'], lossy: ['json'] },\n unknown: { suggested: 'text', exact: [], lossy: ['text', 'json'] },\n};\n\n/**\n * Reduce a raw SQL type string to its canonical form.\n *\n * Strips length/precision (`varchar(255)` → `varchar`), array suffixes\n * (`text[]` → array), and qualifiers (`timestamp without time zone` →\n * `timestamp`), then applies dialect aliases, then the base map.\n */\nexport function canonicalizeSqlType(rawType: string, dialect?: SqlDialect): CanonicalSqlType {\n if (!rawType) return 'unknown';\n let t = rawType.trim().toLowerCase();\n\n // Postgres / generic array notation: `text[]`, `_int4`.\n const isArray = t.endsWith('[]') || t.startsWith('_');\n if (isArray) return 'array';\n\n // Drop precision/length: `numeric(10,2)` → `numeric`, `varchar(255)` →\n // `varchar`. Linear substring slice (no regex backtracking).\n const paren = t.indexOf('(');\n if (paren !== -1) t = t.slice(0, paren).trim();\n\n // Normalise common trailing qualifiers using literal, anchored suffix\n // checks — avoids polynomial-backtracking regexes on uncontrolled input.\n for (const suffix of [' without time zone', ' with time zone', ' unsigned', ' signed']) {\n if (t.endsWith(suffix)) {\n t = t.slice(0, t.length - suffix.length).trim();\n break;\n }\n }\n\n // `timestamp with time zone` collapsed to `timestamp` above; `timestamptz`\n // handled via alias.\n const dialectMap = dialect ? DIALECT_ALIASES[dialect] : undefined;\n if (dialectMap && dialectMap[t]) return dialectMap[t];\n if (BASE_ALIASES[t]) return BASE_ALIASES[t];\n\n // `timestamp with time zone` may survive as `timestamp` already mapped;\n // anything else is unknown.\n return 'unknown';\n}\n\n/**\n * The ObjectStack field type best suited to back a given remote SQL column.\n * Returns `undefined` only when the type is wholly unrecognised (the caller\n * may fall back to `text` and flag it for review).\n */\nexport function suggestFieldType(rawType: string, dialect?: SqlDialect): FieldType | undefined {\n const canonical = canonicalizeSqlType(rawType, dialect);\n if (canonical === 'unknown') return undefined;\n return CANONICAL_TO_FIELD[canonical].suggested;\n}\n\n/**\n * Whether a remote SQL column type can back the given ObjectStack field type.\n *\n * @returns `true` (exact), `'lossy'` (usable with possible loss), or `false`.\n */\nexport function isCompatible(\n rawType: string,\n fieldType: FieldType,\n dialect?: SqlDialect,\n): Compatibility {\n const canonical = canonicalizeSqlType(rawType, dialect);\n const entry = CANONICAL_TO_FIELD[canonical];\n if (entry.exact.includes(fieldType)) return true;\n if (entry.lossy.includes(fieldType)) return 'lossy';\n // Unknown remote types are permissive-but-lossy against text/json only,\n // already encoded in CANONICAL_TO_FIELD.unknown.\n return false;\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * ExternalCatalog — cached remote-schema snapshot for a federated datasource\n * (ADR-0015 §4.3).\n *\n * Introspecting a mature warehouse on every boot is expensive, so the\n * `IExternalDatasourceService.refreshCatalog` persists a snapshot of the\n * remote tables/columns as an `external_catalog` metadata record. The\n * boot-validation gate (Gate 2) and Studio's schema browser read from it;\n * drift is detected by diffing a fresh introspection against the snapshot.\n */\n\nimport { z } from 'zod';\nimport { lazySchema } from '../shared/lazy-schema';\n\n/** A single remote column captured in a catalog snapshot. */\nexport const ExternalColumnSchema = z.object({\n name: z.string().describe('Remote column name'),\n sqlType: z.string().describe('Raw remote SQL type (e.g. \"numeric(10,2)\")'),\n nullable: z.boolean().describe('Whether the remote column is nullable'),\n primaryKey: z.boolean().default(false).describe('Part of the remote primary key'),\n suggestedFieldType: z.string().optional()\n .describe('ObjectStack field type suggested by the type-compat matrix'),\n});\n\nexport type ExternalColumn = z.infer<typeof ExternalColumnSchema>;\n\n/** A single remote table/view captured in a catalog snapshot. */\nexport const ExternalTableSchema = z.object({\n remoteSchema: z.string().optional().describe('Remote schema/database qualifier'),\n remoteName: z.string().describe('Remote table/view name'),\n columns: z.array(ExternalColumnSchema).describe('Remote columns'),\n indexes: z.array(z.object({\n name: z.string(),\n columns: z.array(z.string()),\n unique: z.boolean(),\n })).optional().describe('Remote indexes, when introspectable'),\n rowCountEstimate: z.number().optional().describe('Approximate row count'),\n});\n\nexport type ExternalTable = z.infer<typeof ExternalTableSchema>;\n\n/**\n * The persisted snapshot of a federated datasource's remote schema.\n * Conventionally named `<datasource>_catalog`.\n */\nexport const ExternalCatalogSchema = lazySchema(() => z.object({\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Catalog id, conventionally `<datasource>_catalog`.'),\n datasource: z.string().describe('Datasource.name this catalog snapshots.'),\n snapshotAt: z.string().datetime().describe('When the snapshot was taken (ISO 8601).'),\n dialect: z.string().optional().describe('Remote SQL dialect, when known.'),\n tables: z.array(ExternalTableSchema).describe('Snapshotted remote tables.'),\n}));\n\nexport type ExternalCatalog = z.infer<typeof ExternalCatalogSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FilterConditionSchema } from './filter.zod';\n\n/**\n * Analytics/Semantic Layer Protocol\n * \n * Defines the \"Business Logic\" for data analysis.\n * Inspired by Cube.dev, LookML, and dbt MetricFlow.\n * \n * This layer decouples the \"Physical Data\" (Tables/Columns) from the \n * \"Business Data\" (Metrics/Dimensions).\n */\n\n/**\n * Aggregation Metric Type\n * The mathematical operation to perform on a metric.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const AggregationMetricType = z.enum([\n 'count', \n 'sum', \n 'avg', \n 'min', \n 'max', \n 'count_distinct', \n 'number', // Custom SQL expression returning a number\n 'string', // Custom SQL expression returning a string\n 'boolean' // Custom SQL expression returning a boolean\n]);\n\n/**\n * Dimension Type\n * The nature of the grouping field.\n */\nexport const DimensionType = z.enum([\n 'string', \n 'number', \n 'boolean', \n 'time', \n 'geo'\n]);\n\n/**\n * Time Interval for Time Dimensions\n */\nexport const TimeUpdateInterval = z.enum([\n 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'\n]);\n\n/**\n * Metric Schema\n * A quantitative measurement (e.g., \"Total Revenue\", \"Average Order Value\").\n */\nexport const MetricSchema = lazySchema(() => z.object({\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Unique metric ID'),\n label: z.string().describe('Human readable label'),\n description: z.string().optional(),\n \n type: AggregationMetricType,\n \n /** Source Calculation */\n sql: z.string().describe('SQL expression or field reference'),\n \n /** Filtering for this specific metric (e.g. \"Revenue from Premium Users\") */\n filters: z.array(z.object({\n sql: z.string()\n })).optional(),\n \n /** Format for display (e.g. \"currency\", \"percent\") */\n format: z.string().optional(),\n}));\n\n/**\n * Dimension Schema\n * A categorical attribute to group by (e.g., \"Product Category\", \"Order Date\").\n */\nexport const DimensionSchema = lazySchema(() => z.object({\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Unique dimension ID'),\n label: z.string().describe('Human readable label'),\n description: z.string().optional(),\n \n type: DimensionType,\n \n /** Source Column */\n sql: z.string().describe('SQL expression or column reference'),\n \n /** For Time Dimensions: Supported Granularities */\n granularities: z.array(TimeUpdateInterval).optional(),\n}));\n\n/**\n * Join Schema\n * Defines how this cube relates to others.\n */\nexport const CubeJoinSchema = lazySchema(() => z.object({\n name: z.string().describe('Target cube name'),\n relationship: z.enum(['one_to_one', 'one_to_many', 'many_to_one']).default('many_to_one'),\n sql: z.string().describe('Join condition (ON clause)'),\n}));\n\n/**\n * Cube Schema\n * A logical data model representing a business entity or process for analysis.\n * Maps physical tables to business metrics and dimensions.\n */\nexport const CubeSchema = lazySchema(() => z.object({\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Cube name (snake_case)'),\n title: z.string().optional(),\n description: z.string().optional(),\n \n /** Physical Data Source */\n sql: z.string().describe('Base SQL statement or Table Name'),\n \n /** Semantic Definitions */\n measures: z.record(z.string(), MetricSchema).describe('Quantitative metrics'),\n dimensions: z.record(z.string(), DimensionSchema).describe('Qualitative attributes'),\n \n /** Relationships */\n joins: z.record(z.string(), CubeJoinSchema).optional(),\n \n /** Pre-aggregations / Caching */\n refreshKey: z.object({\n every: z.string().optional(), // e.g. \"1 hour\"\n sql: z.string().optional(), // SQL to check for data changes\n }).optional(),\n \n /** Access Control */\n public: z.boolean().default(false),\n}));\n\n/**\n * Analytics Query Schema\n * The request format for the Analytics API.\n */\nexport const AnalyticsQuerySchema = lazySchema(() => z.object({\n cube: z.string().optional().describe('Target cube name (optional when provided externally, e.g. in API request wrapper)'),\n measures: z.array(z.string()).describe('List of metrics to calculate'),\n dimensions: z.array(z.string()).optional().describe('List of dimensions to group by'),\n\n /**\n * WHERE clause — canonical filter shape per the unified Query DSL\n * (see {@link FilterConditionSchema} in `data/filter.zod.ts` and\n * {@link QuerySchema} in `data/query.zod.ts`). This is the same\n * MongoDB-style filter used by `find()`, dashboard widget `filter`,\n * RLS conditions, etc.\n *\n * @example\n * ```ts\n * { where: { is_active: true, stage: { $nin: ['lost'] } } }\n * ```\n */\n where: FilterConditionSchema.optional().describe('Filtering criteria (canonical Query DSL FilterCondition)'),\n\n timeDimensions: z.array(z.object({\n dimension: z.string(),\n granularity: TimeUpdateInterval.optional(),\n dateRange: z.union([\n z.string(), // \"Last 7 days\"\n z.array(z.string()) // [\"2023-01-01\", \"2023-01-31\"]\n ]).optional(),\n })).optional(),\n\n order: z.record(z.string(), z.enum(['asc', 'desc'])).optional(),\n\n limit: z.number().optional(),\n offset: z.number().optional(),\n\n timezone: z.string().optional().default('UTC'),\n}));\n\nexport type Metric = z.infer<typeof MetricSchema>;\nexport type Dimension = z.infer<typeof DimensionSchema>;\nexport type CubeJoin = z.infer<typeof CubeJoinSchema>;\nexport type Cube = z.infer<typeof CubeSchema>;\n/** Authoring input for {@link Cube} — defaulted fields are optional. */\nexport type CubeInput = z.input<typeof CubeSchema>;\n\n/**\n * Type-safe factory for an analytics semantic-layer cube. Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: Cube` literal.\n */\nexport function defineCube(config: z.input<typeof CubeSchema>): Cube {\n return CubeSchema.parse(config);\n}\nexport type AnalyticsQuery = z.infer<typeof AnalyticsQuerySchema>;\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * Field → aggregation semantics. The single source of truth for \"how should a\n * numeric field be aggregated into a measure\", shared by authoring (dataset\n * derivation) and validation (build-time coherence checks) so the two cannot\n * drift.\n *\n * The motivating defect: additive amounts (currency/number) SUM correctly, but\n * a RATE — a `percent` field such as a win-probability or conversion rate — must\n * AVG. Summing percentages is meaningless: the total routinely exceeds 100%.\n */\n\n/** Numeric field types that can back a value measure. */\nexport const MEASURE_FIELD_TYPES: ReadonlySet<string> = new Set(['number', 'currency', 'percent']);\n\n/**\n * The aggregation a derived value measure should use for a field of this type:\n * rates (`percent`) AVG, every other additive amount SUMs.\n */\nexport function defaultAggregateFor(fieldType: string | undefined): 'sum' | 'avg' {\n return fieldType === 'percent' ? 'avg' : 'sum';\n}\n\n/**\n * Is applying `aggregate` to a field of `fieldType` semantically incoherent?\n * True only for cases that produce a meaningless number — today: SUM (or\n * COUNT_DISTINCT) of a percentage/rate. Returns false when the field type is\n * unknown (cannot judge) so callers never raise a false positive.\n */\nexport function isIncoherentAggregate(aggregate: string, fieldType: string | undefined): boolean {\n if (fieldType === 'percent' && (aggregate === 'sum' || aggregate === 'count_distinct')) return true;\n return false;\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * ADR-0079 — Record display-name contract.\n *\n * A record's human title is a STRUCTURAL INVARIANT: every object has exactly one\n * primary title field, which is a real STORED field (text / autonumber / formula\n * whose result is text). This module is the single source of truth for:\n * - which field types may back a title (`isTitleEligible` / `TITLE_ELIGIBLE`),\n * - how the primary title field is resolved (`resolveDisplayField`) — explicit\n * pointer first (`nameField`, then the deprecated `displayNameField` alias),\n * then a deterministic derivation,\n * - how a single record's display name is rendered (`resolveRecordDisplayName`)\n * with a stable `Record #<id>` floor — NEVER a bare \"Untitled\",\n * - a pure transform that GUARANTEES a primary exists (`provisionPrimary`),\n * - and a completeness classifier for lint/quality reporting\n * (`objectTitleCompleteness`).\n *\n * Pure + framework-agnostic (no Zod, no engine). Shared by authoring, the\n * approval/notification display-enrichment path, objectql search field\n * resolution, and build-time lint.\n *\n * NOTE on the schema: `nameField` is the canonical pointer (pairs with\n * `recordName` — the Salesforce Name/Record-Name model). `displayNameField` is\n * accepted as a DEPRECATED ALIAS at the schema level (mapped onto `nameField`).\n * Both are still read here so this resolver works against metadata that has not\n * yet been normalized.\n */\n\n/**\n * Minimal structural shape of a field definition this module needs to judge\n * title-eligibility. Intentionally loose — callers pass `Data.Field`,\n * `sys_metadata` rows, or hand-built fakes.\n */\nexport interface TitleEligibleFieldDef {\n type?: string;\n /**\n * For `formula` fields: the declared result type. The framework field schema\n * carries this as `returnType` (number/text/boolean/date); `valueType` is also\n * accepted for forward/cross-repo compatibility. A formula is title-eligible\n * ONLY when this is `text`.\n */\n returnType?: string;\n valueType?: string;\n [k: string]: unknown;\n}\n\n/**\n * Minimal structural shape of an object's metadata this module reads.\n * `fields` is a name-keyed map (declaration order = `Object.keys` order, which\n * the framework preserves for the `record` field type and object materialization).\n */\nexport interface DisplayNameObjectMeta {\n /** Canonical primary-title pointer (ADR-0079). */\n nameField?: string;\n /** Deprecated alias for `nameField`; still honored as a fallback. */\n displayNameField?: string;\n fields?: Record<string, TitleEligibleFieldDef> | undefined;\n [k: string]: unknown;\n}\n\n/**\n * Field types that are NEVER a record title — they carry no human-readable\n * short label (dates, numbers, booleans, media, structured/relational values,\n * choice tokens, and system/auto values). `autonumber` is excluded from\n * *derivation* here: an autonumber is a valid primary only when an author\n * points at it explicitly (it pairs with `recordName.type='autonumber'`), not\n * something we silently pick. `formula` is conditionally eligible — see\n * `isTitleEligible`.\n *\n * `phone` is deliberately excluded (a phone number is not a title); `email` IS\n * eligible (commonly the human handle on identity-ish objects).\n */\nexport const TITLE_INELIGIBLE_TYPES: ReadonlySet<string> = new Set([\n // Date & time\n 'date', 'datetime', 'time',\n // Numbers\n 'number', 'currency', 'percent',\n // Logic\n 'boolean', 'toggle',\n // Media / files / attachments\n 'file', 'image', 'avatar', 'video', 'audio', 'attachment', 'signature', 'qrcode',\n // Structured / untyped\n 'json', 'code', 'composite', 'repeater', 'record', 'address', 'vector',\n // Geo\n 'geolocation', 'location',\n // Choice tokens (machine values, not titles)\n 'select', 'multiselect', 'multi_select', 'radio', 'checkboxes', 'checkbox', 'tags', 'color', 'rating', 'slider', 'progress',\n // Relational\n 'lookup', 'master_detail', 'tree', 'user',\n // System / auto / derived\n 'autonumber', 'password', 'secret',\n // Phone is not a title (email IS — handled in the eligible set)\n 'phone',\n]);\n\n/**\n * Text-ish field types that ARE title-eligible. Used as a positive allowlist so\n * an UNKNOWN/new field type does not accidentally become a title (fail-closed).\n * `formula` is handled separately (eligible only when its result type is text).\n */\nexport const TITLE_ELIGIBLE_TYPES: ReadonlySet<string> = new Set([\n 'text', 'textarea', 'email', 'url', 'markdown', 'html', 'richtext',\n]);\n\n/**\n * Convenience alias for `TITLE_ELIGIBLE_TYPES` named in ADR-0079 as the\n * `TITLE_ELIGIBLE` rule.\n */\nexport const TITLE_ELIGIBLE = TITLE_ELIGIBLE_TYPES;\n\n/**\n * Is `fieldDef` a field that can back a record's human title?\n *\n * Eligible: text-ish types (`text`, `textarea`, `email`, `url`, `markdown`,\n * `html`, `richtext`) and a `formula` whose result type (`returnType`, or\n * `valueType`) is `text`. Everything else — explicitly the\n * {@link TITLE_INELIGIBLE_TYPES} set — is ineligible. Unknown types are\n * ineligible (fail-closed against the positive allowlist).\n */\nexport function isTitleEligible(fieldDef: TitleEligibleFieldDef | undefined | null): boolean {\n if (!fieldDef) return false;\n const type = fieldDef.type;\n if (!type) return false;\n if (type === 'formula') {\n const rt = fieldDef.returnType ?? fieldDef.valueType;\n return rt === 'text';\n }\n if (TITLE_INELIGIBLE_TYPES.has(type)) return false;\n return TITLE_ELIGIBLE_TYPES.has(type);\n}\n\n/** Exact name-ish field names (case-insensitive), highest derivation priority. */\nconst NAME_ISH_EXACT: ReadonlySet<string> = new Set([\n 'name', 'title', 'subject', 'label', 'full_name', 'display_name',\n]);\n\n/** Affix tokens that make a field name \"name-ish\" (e.g. `first_name`, `job_title`, `name_en`). */\nconst NAME_ISH_AFFIX_SUFFIX = ['_name', '_title'];\nconst NAME_ISH_AFFIX_PREFIX = ['name_'];\n\nfunction isNameIshExact(fieldName: string): boolean {\n return NAME_ISH_EXACT.has(fieldName.toLowerCase());\n}\n\nfunction isNameIshAffix(fieldName: string): boolean {\n const lower = fieldName.toLowerCase();\n if (NAME_ISH_EXACT.has(lower)) return false; // exact handled at a higher tier\n return (\n NAME_ISH_AFFIX_SUFFIX.some((s) => lower.endsWith(s)) ||\n NAME_ISH_AFFIX_PREFIX.some((p) => lower.startsWith(p))\n );\n}\n\n/**\n * Derive the title field from the object's fields when no explicit pointer is\n * set. Ranking (highest first), restricted to title-eligible fields:\n * 1. name-ish EXACT — `name`/`title`/`subject`/`label`/`full_name`/`display_name`\n * 2. name-ish AFFIX — `*_name` / `*_title` / `name_*`\n * 3. first title-eligible field by declaration order\n * Returns `undefined` when no field is title-eligible.\n */\nfunction deriveDisplayField(fields: Record<string, TitleEligibleFieldDef> | undefined): string | undefined {\n if (!fields) return undefined;\n const names = Object.keys(fields);\n\n // Tier 1: name-ish exact, in the EXACT priority order (name > title > subject > …)\n // so `name` wins over `title` when both exist, independent of declaration order.\n const exactOrder = ['name', 'title', 'subject', 'label', 'full_name', 'display_name'];\n for (const wanted of exactOrder) {\n for (const fname of names) {\n if (fname.toLowerCase() === wanted && isTitleEligible(fields[fname])) return fname;\n }\n }\n\n // Tier 2: name-ish affix, by declaration order.\n for (const fname of names) {\n if (isNameIshAffix(fname) && isTitleEligible(fields[fname])) return fname;\n }\n\n // Tier 3: first title-eligible field by declaration order.\n for (const fname of names) {\n if (!isNameIshExact(fname) && isTitleEligible(fields[fname])) return fname;\n }\n\n return undefined;\n}\n\n/**\n * Resolve the object's primary title field name:\n * `nameField` (canonical) ?? `displayNameField` (deprecated alias) ?? derived.\n *\n * An explicit pointer is honored even if it is not currently title-eligible\n * (the author asserted it; eligibility gates only DERIVATION). Returns\n * `undefined` when there is no explicit pointer and nothing derivable.\n */\nexport function resolveDisplayField(objectMeta: DisplayNameObjectMeta | undefined | null): string | undefined {\n if (!objectMeta) return undefined;\n const explicit = objectMeta.nameField ?? objectMeta.displayNameField;\n if (explicit) return explicit;\n return deriveDisplayField(objectMeta.fields);\n}\n\n/** Options for {@link resolveRecordDisplayName}. */\nexport interface ResolveRecordDisplayNameOptions {\n /**\n * A view-declared title field that OVERRIDES the object's resolved display\n * field for this render (e.g. a list view choosing a different column as the\n * row label). When set, the record's value at this field is used directly.\n */\n viewTitleField?: string;\n}\n\nfunction isEmptyish(v: unknown): boolean {\n return v == null || (typeof v === 'string' && v.trim() === '');\n}\n\n/**\n * Render a single record's human display name.\n *\n * opts.viewTitleField ? record[viewTitleField] : record[resolveDisplayField(meta)]\n *\n * Falls back to a stable `Record #<id>` floor (using `record.id` or `record._id`)\n * when the resolved value is null/empty. NEVER returns a bare \"Untitled\".\n */\nexport function resolveRecordDisplayName(\n objectMeta: DisplayNameObjectMeta | undefined | null,\n record: Record<string, unknown> | undefined | null,\n opts?: ResolveRecordDisplayNameOptions,\n): string {\n const rec = record ?? {};\n const field = opts?.viewTitleField ?? resolveDisplayField(objectMeta);\n const value = field ? (rec as Record<string, unknown>)[field] : undefined;\n if (!isEmptyish(value)) return String(value);\n const id = (rec as Record<string, unknown>).id ?? (rec as Record<string, unknown>)._id;\n return `Record #${id ?? ''}`.trimEnd();\n}\n\n/** Options for {@link provisionPrimary}. */\nexport interface ProvisionPrimaryOptions {\n /**\n * Whether to SYNTHESIZE a `name` text field when nothing is title-eligible.\n *\n * - `true` (default) — full provisioning: designate a derivable title, else\n * add a `name` text field and point `nameField` at it. GUARANTEES a primary\n * exists. This adds a column, so for an already-materialized table it is a\n * schema-migration-bearing change.\n * - `false` — DESIGNATE-ONLY: set `nameField` when a title can be\n * resolved/derived from an EXISTING field, otherwise return the object\n * unchanged (no `name` field is added, no schema change). Safe to run at the\n * object-materialization seam against title-less system tables.\n */\n synthesize?: boolean;\n}\n\n/**\n * Pure transform that provisions the object's primary title field.\n *\n * - If a title can be resolved/derived from an existing field, set `nameField`\n * to it (idempotent — a second call is a no-op).\n * - Otherwise, when `synthesize !== false` (the default), SYNTHESIZE a `name`\n * text field (added to `fields`) and set `nameField: 'name'` — GUARANTEEING a\n * primary exists. When `synthesize === false`, the object is returned\n * UNCHANGED (no field added, no schema-migration-bearing column).\n *\n * Returns a NEW object when it changes anything (does not mutate the input); in\n * designate-only mode with nothing to designate it returns the input as-is. The\n * deprecated `displayNameField` is left untouched for back-compat; `nameField`\n * becomes the authoritative pointer.\n */\nexport function provisionPrimary<T extends DisplayNameObjectMeta>(\n objectMeta: T,\n opts?: ProvisionPrimaryOptions,\n): T {\n const resolved = resolveDisplayField(objectMeta);\n if (resolved) {\n if (objectMeta.nameField === resolved) return objectMeta; // already canonical — no-op\n return { ...objectMeta, nameField: resolved };\n }\n // Nothing eligible to designate.\n if (opts?.synthesize === false) {\n // Designate-only: leave the object exactly as-is (no synthesized column,\n // no schema migration). The canonical pointer stays resolved on read.\n return objectMeta;\n }\n // Synthesize a primary `name` text field.\n const fields = { ...(objectMeta.fields ?? {}) };\n if (!fields.name) {\n fields.name = { type: 'text', label: 'Name', required: true } as TitleEligibleFieldDef;\n }\n return { ...objectMeta, fields, nameField: 'name' };\n}\n\n/** Result of {@link objectTitleCompleteness}. */\nexport interface ObjectTitleCompleteness {\n /**\n * - `explicit` — an explicit pointer (`nameField`/`displayNameField`) is set.\n * - `derived` — no explicit pointer, but a title-eligible field was derivable.\n * - `synthesized` — `nameField` points at a field NOT present in `fields`\n * (e.g. a synthesized/expected `name`); the runtime must materialize it.\n * - `none` — no pointer and nothing derivable. Lint/quality should flag.\n */\n status: 'explicit' | 'derived' | 'synthesized' | 'none';\n /** The resolved field name when one exists. */\n field?: string;\n}\n\n/**\n * Classify how an object's title is satisfied, for lint / quality reporting.\n * Does not mutate; mirrors `resolveDisplayField` precedence.\n */\nexport function objectTitleCompleteness(objectMeta: DisplayNameObjectMeta | undefined | null): ObjectTitleCompleteness {\n if (!objectMeta) return { status: 'none' };\n const explicit = objectMeta.nameField ?? objectMeta.displayNameField;\n if (explicit) {\n const present = !!objectMeta.fields && Object.prototype.hasOwnProperty.call(objectMeta.fields, explicit);\n return { status: present ? 'explicit' : 'synthesized', field: explicit };\n }\n const derived = deriveDisplayField(objectMeta.fields);\n if (derived) return { status: 'derived', field: derived };\n return { status: 'none' };\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * Field-group layout derivation — the single source of the `fieldGroups`\n * rendering semantics (ADR-0085 §5).\n *\n * An object's `fieldGroups` + each field's `Field.group` membership are a\n * cross-surface semantic role: forms, detail pages, drawers and the designer\n * all render the SAME grouping. The rules live here — a pure, dependency-free\n * helper next to the schema that defines the keys (the ADR-0078 §2\n * shared-predicate pattern) — so renderers consume one implementation instead\n * of re-deriving it (two near-identical copies in `@object-ui` predate this\n * module and are retired by it).\n *\n * Rules (per the ObjectFieldGroupSchema contract):\n * - sections come back in declared-group order;\n * - declared groups no visible field references are dropped;\n * - fields without a (declared) group collect into a trailing untitled\n * bucket, preserving field declaration order — EXCEPT audit/system\n * fields, which only surface when an author EXPLICITLY groups them\n * (explicit listing wins, same as authored page sections);\n * - hidden fields never surface;\n * - `collapse` passes through (deprecated `defaultExpanded` /\n * `collapsible`+`collapsed` aliases are honoured for pre-ADR-0085\n * metadata that reaches consumers un-normalized, e.g. bare DB rows).\n *\n * Returns `null` when grouping does not apply — no declared groups, or no\n * visible field references one — so callers fall back to their existing\n * flat/auto layout.\n */\n\n/** Collapse behaviour of a derived section (mirrors ObjectFieldGroupSchema.collapse). */\nexport type FieldGroupCollapse = 'none' | 'expanded' | 'collapsed';\n\n/** One derived section. `key` is absent on the trailing ungrouped bucket. */\nexport interface FieldGroupSection {\n /** Group machine key; i18n anchor (`…objects.{obj}._sections.{key}.label`). Absent = ungrouped bucket. */\n key?: string;\n /** Group display label (default text; i18n overrides at render time). */\n label?: string;\n /** Optional icon name declared on the group. */\n icon?: string;\n /** Optional description declared on the group. */\n description?: string;\n /** Collapse behaviour; 'none' when the group declared nothing. */\n collapse: FieldGroupCollapse;\n /** Member field NAMES in field-declaration order. Renderers resolve defs themselves. */\n fields: string[];\n}\n\n/**\n * Audit/system fields excluded from the derived UNGROUPED bucket (they carry\n * no business meaning in a default layout). A field an author explicitly\n * assigns to a group is kept. Exported so renderers filtering flat layouts\n * agree with the derivation.\n */\nexport const FIELD_GROUP_SYSTEM_FIELDS: ReadonlySet<string> = new Set([\n 'created_at', 'created_by', 'updated_at', 'updated_by',\n 'organization_id', 'tenant_id', 'is_deleted', 'deleted_at',\n]);\n\ntype AnyRec = Record<string, unknown>;\n\n/** Normalize one declared group entry; null for malformed/keyless entries. */\nfunction readGroup(g: unknown): { key: string; label?: string; icon?: string; description?: string; collapse: FieldGroupCollapse } | null {\n if (!g || typeof g !== 'object' || Array.isArray(g)) return null;\n const grp = g as AnyRec;\n if (typeof grp.key !== 'string' || grp.key.length === 0) return null;\n let collapse: FieldGroupCollapse = 'none';\n if (grp.collapse === 'expanded' || grp.collapse === 'collapsed' || grp.collapse === 'none') {\n collapse = grp.collapse;\n } else if (typeof grp.collapsible === 'boolean' || typeof grp.collapsed === 'boolean') {\n // Deprecated UI-dialect pair (pre-ADR-0085 designer metadata).\n collapse = grp.collapsed === true ? 'collapsed' : grp.collapsible === true ? 'expanded' : 'none';\n } else if (typeof grp.defaultExpanded === 'boolean') {\n // Deprecated spec flag.\n collapse = grp.defaultExpanded ? 'expanded' : 'collapsed';\n }\n return {\n key: grp.key,\n label: typeof grp.label === 'string' ? grp.label : undefined,\n icon: typeof grp.icon === 'string' ? grp.icon : undefined,\n description: typeof grp.description === 'string' ? grp.description : undefined,\n collapse,\n };\n}\n\n/**\n * Derive the grouped layout for an object definition (or any bare metadata\n * record shaped like one — the helper is deliberately tolerant of\n * un-parsed/legacy input so every consumer can call it).\n */\nexport function deriveFieldGroupLayout(def: unknown): FieldGroupSection[] | null {\n if (!def || typeof def !== 'object' || Array.isArray(def)) return null;\n const obj = def as AnyRec;\n\n const declared = (Array.isArray(obj.fieldGroups) ? obj.fieldGroups : [])\n .map(readGroup)\n .filter((g): g is NonNullable<ReturnType<typeof readGroup>> => g !== null);\n if (declared.length === 0) return null;\n\n const declaredKeys = new Set(declared.map((g) => g.key));\n const fields = (obj.fields && typeof obj.fields === 'object' && !Array.isArray(obj.fields))\n ? (obj.fields as Record<string, AnyRec | undefined>)\n : {};\n\n const buckets = new Map<string, string[]>();\n for (const g of declared) buckets.set(g.key, []);\n const ungrouped: string[] = [];\n let anyGrouped = false;\n for (const [name, f] of Object.entries(fields)) {\n if (f?.hidden === true) continue;\n const g = typeof f?.group === 'string' && declaredKeys.has(f.group) ? (f.group as string) : null;\n if (g) {\n buckets.get(g)!.push(name);\n anyGrouped = true;\n } else if (!FIELD_GROUP_SYSTEM_FIELDS.has(name)) {\n ungrouped.push(name);\n }\n }\n // No visible field references a declared group → grouping doesn't apply.\n if (!anyGrouped) return null;\n\n const sections: FieldGroupSection[] = [];\n for (const g of declared) {\n const names = buckets.get(g.key)!;\n if (names.length === 0) continue; // declared-but-empty groups are dropped\n sections.push({\n key: g.key,\n label: g.label ?? g.key,\n ...(g.icon !== undefined ? { icon: g.icon } : {}),\n ...(g.description !== undefined ? { description: g.description } : {}),\n collapse: g.collapse,\n fields: names,\n });\n }\n // Trailing untitled bucket: ungrouped fields render flat (no key/label →\n // renderers show no card chrome) after the declared groups.\n if (ungrouped.length > 0) {\n sections.push({ collapse: 'none', fields: ungrouped });\n }\n return sections.length > 0 ? sections : null;\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * Record-surface derivation — the single source for *how* an object's\n * create / edit / detail record opens by DEFAULT: a full page, or an overlay\n * (drawer / modal). ADR-0085 §5 \"one shared derivation, every surface\".\n *\n * Why this is a derivation and NOT an authored object key\n * ------------------------------------------------------\n * ADR-0085 §2's admission test rejects per-surface presentation toggles on the\n * object: modal-vs-page is not a business fact a machine cannot infer — it is\n * exactly inferable from how heavy the record is. So the platform derives a\n * sensible default here (field-heavy → full page; otherwise a side drawer),\n * and AI authors write nothing in the common case. Explicit control, when a\n * specific object genuinely needs it, is the sanctioned per-page path: an\n * assigned page. The renderer therefore uses this ONLY as the default and lets\n * an explicit form/navigation config win.\n *\n * The rule is deliberately simple and predictable (a single field-count\n * threshold + a mobile override) because an unpredictable heuristic is its own\n * kind of \"silently wrong\" for an AI-authored system.\n *\n * Pure and dependency-free, tolerant of bare/un-parsed metadata records (same\n * contract as {@link deriveFieldGroupLayout}) so every consumer can call it.\n */\n\nimport { FIELD_GROUP_SYSTEM_FIELDS } from './field-group-layout';\n\n/** The presentation surface a record's create/edit/detail opens on. */\nexport type RecordSurface = 'page' | 'modal' | 'drawer';\n\n/** Viewport hint; overlays are cramped on phones, so mobile always pages. */\nexport type RecordSurfaceViewport = 'mobile' | 'desktop';\n\nexport interface RecordSurfaceOptions {\n /** Viewport hint. `'mobile'` forces `'page'` (overlays are cramped). */\n viewport?: RecordSurfaceViewport;\n /**\n * Authorable-field count at/above which the record opens as a full page.\n * Defaults to {@link RECORD_SURFACE_PAGE_THRESHOLD}. Exposed so a host can\n * tune the break point without forking the rule.\n */\n pageThreshold?: number;\n}\n\n/**\n * Default break point: at/above this many authorable (visible, non-system)\n * fields, a record is \"heavy\" enough to warrant a full page rather than an\n * overlay. ~12 fields overflow a comfortable two-column modal; beyond it a\n * page (with its own URL, scroll and back button) reads better.\n */\nexport const RECORD_SURFACE_PAGE_THRESHOLD = 12;\n\ntype AnyRec = Record<string, unknown>;\n\n/**\n * Count the fields a user actually fills on a form: visible (not `hidden`) and\n * not an audit/system field. Mirrors the visibility rules of the field-group\n * layout so the two derivations agree on what \"the fields\" are.\n */\nexport function countAuthorableFields(def: unknown): number {\n if (!def || typeof def !== 'object' || Array.isArray(def)) return 0;\n const fields = (def as AnyRec).fields;\n if (!fields || typeof fields !== 'object' || Array.isArray(fields)) return 0;\n let n = 0;\n for (const [name, f] of Object.entries(fields as Record<string, AnyRec | undefined>)) {\n if (f?.hidden === true) continue;\n if (FIELD_GROUP_SYSTEM_FIELDS.has(name)) continue;\n n++;\n }\n return n;\n}\n\n/**\n * Derive the DEFAULT record surface for an object definition (or any bare\n * metadata record shaped like one).\n *\n * Rule:\n * - `viewport: 'mobile'` → `'page'` (overlays are cramped on phones);\n * - authorable field count ≥ threshold → `'page'` (field-heavy);\n * - otherwise → `'drawer'` (a light side overlay — the historical default).\n *\n * `'modal'` is never emitted by the heuristic; it remains in the return type\n * because an explicit form config can still select it and consumers switch on\n * the full set. Renderers must treat this as a default only — an explicit\n * `formType` / `navigation.mode` wins.\n */\nexport function deriveRecordSurface(def: unknown, opts: RecordSurfaceOptions = {}): RecordSurface {\n if (opts.viewport === 'mobile') return 'page';\n const threshold = opts.pageThreshold ?? RECORD_SURFACE_PAGE_THRESHOLD;\n if (countAuthorableFields(def) >= threshold) return 'page';\n return 'drawer';\n}\n\n/**\n * The record flow being opened. `view` shows state; the other four perform a\n * task (create/change a record). For `child-*` flows — a subtable / related-\n * list child created or edited from its PARENT's detail — pass the CHILD\n * object's def: the overlay sizes to the record being edited, while the\n * return target is always the parent (#2604 D3).\n */\nexport type RecordFlow = 'view' | 'create' | 'edit' | 'child-create' | 'child-edit';\n\n/** How the surface is mounted: a navigated route, or an overlay over the origin. */\nexport type RecordFlowContainer = 'route' | 'overlay';\n\nexport interface RecordFlowSurface {\n /**\n * `'route'` only ever for flow `'view'` (a record is shareable state —\n * deep-linkable, refresh-safe). Every task flow is an `'overlay'`: close\n * returns to the origin with its context (scroll / filters / tab) intact,\n * which is the #2604 return-flow invariant — and a create/edit URL would be\n * a false promise anyway (refresh loses the draft).\n */\n container: RecordFlowContainer;\n surface: RecordSurface;\n /** Maps onto `navigation.size` / `FormView.modalSize`; routes ignore it. */\n size: 'auto' | 'full';\n}\n\n/**\n * Derive the DEFAULT surface for a record FLOW (#2604; extends\n * {@link deriveRecordSurface}, ADR-0085 §5 \"one shared derivation\").\n *\n * Rule — the two axes are independent:\n * - how BIG (field count, via {@link deriveRecordSurface}) is unchanged;\n * - whether it ROUTES is decided by what the flow *is*: viewing a record is\n * state → route-capable; making/changing one is a task → always overlay.\n *\n * So `view` keeps the #2578 behavior verbatim (`'page'` → route), while the\n * task flows map the derived `'page'` to a FULL-SCREEN MODAL — same big\n * canvas, overlay return semantics. This mapping is why `'modal'` exists in\n * {@link RecordSurface} without the base heuristic ever emitting it.\n *\n * Like the base derivation this is a DEFAULT only: explicit `navigation.mode`\n * / `navigation.size`, `FormView.type` / `modalSize`, or an assigned page win\n * (the sanctioned per-object overrides — no new authorable key, ADR-0085 §2).\n */\nexport function deriveRecordFlowSurface(\n def: unknown,\n flow: RecordFlow,\n opts: RecordSurfaceOptions = {},\n): RecordFlowSurface {\n const surface = deriveRecordSurface(def, opts);\n if (flow === 'view') {\n return { container: surface === 'page' ? 'route' : 'overlay', surface, size: 'auto' };\n }\n // Task flows (create / edit / child-*): never a route. Field-heavy (or\n // mobile, where the base derivation says 'page') → full-screen modal.\n if (surface === 'page') return { container: 'overlay', surface: 'modal', size: 'full' };\n return { container: 'overlay', surface, size: 'auto' };\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Feed Item Type\n * Unified activity types for the record timeline.\n * Covers comments, field changes, tasks, events, and system activities.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const FeedItemType = z.enum([\n 'comment',\n 'field_change',\n 'task',\n 'event',\n 'email',\n 'call',\n 'note',\n 'file',\n 'record_create',\n 'record_delete',\n 'approval',\n 'sharing',\n 'system',\n]);\nexport type FeedItemType = z.infer<typeof FeedItemType>;\n\n/**\n * Mention Schema\n * Represents an @mention within comment body text.\n */\nexport const MentionSchema = lazySchema(() => z.object({\n type: z.enum(['user', 'team', 'record']).describe('Mention target type'),\n id: z.string().describe('Target ID'),\n name: z.string().describe('Display name for rendering'),\n offset: z.number().int().min(0).describe('Character offset in body text'),\n length: z.number().int().min(1).describe('Length of mention token in body text'),\n}));\nexport type Mention = z.infer<typeof MentionSchema>;\n\n/**\n * Field Change Entry Schema\n * Represents a single field-level change within a field_change feed item.\n */\nexport const FieldChangeEntrySchema = lazySchema(() => z.object({\n field: z.string().describe('Field machine name'),\n fieldLabel: z.string().optional().describe('Field display label'),\n oldValue: z.unknown().optional().describe('Previous value'),\n newValue: z.unknown().optional().describe('New value'),\n oldDisplayValue: z.string().optional().describe('Human-readable old value'),\n newDisplayValue: z.string().optional().describe('Human-readable new value'),\n}));\nexport type FieldChangeEntry = z.infer<typeof FieldChangeEntrySchema>;\n\n/**\n * Reaction Schema\n * Represents an emoji reaction on a feed item.\n */\nexport const ReactionSchema = lazySchema(() => z.object({\n emoji: z.string().describe('Emoji character or shortcode (e.g., \"👍\", \":thumbsup:\")'),\n userIds: z.array(z.string()).describe('Users who reacted'),\n count: z.number().int().min(1).describe('Total reaction count'),\n}));\nexport type Reaction = z.infer<typeof ReactionSchema>;\n\n/**\n * Feed Actor Schema\n * Represents the actor who performed the action.\n */\nexport const FeedActorSchema = lazySchema(() => z.object({\n type: z.enum(['user', 'system', 'service', 'automation']).describe('Actor type'),\n id: z.string().describe('Actor ID'),\n name: z.string().optional().describe('Actor display name'),\n avatarUrl: z.string().url().optional().describe('Actor avatar URL'),\n source: z.string().optional().describe('Source application (e.g., \"Omni\", \"API\", \"Studio\")'),\n}));\nexport type FeedActor = z.infer<typeof FeedActorSchema>;\n\n/**\n * Feed Item Visibility\n */\nexport const FeedVisibility = z.enum(['public', 'internal', 'private']);\nexport type FeedVisibility = z.infer<typeof FeedVisibility>;\n\n/**\n * Feed Item Schema\n * A single entry in the unified activity timeline.\n *\n * @example Comment\n * {\n * id: 'feed_001',\n * type: 'comment',\n * object: 'account',\n * recordId: 'rec_123',\n * body: 'Great progress! @jane.doe can you follow up?',\n * mentions: [{ type: 'user', id: 'user_123', name: 'Jane Doe', offset: 17, length: 9 }],\n * actor: { type: 'user', id: 'user_456', name: 'John Smith' },\n * createdAt: '2026-01-15T10:30:00Z',\n * }\n *\n * @example Field Change\n * {\n * id: 'feed_002',\n * type: 'field_change',\n * object: 'account',\n * recordId: 'rec_123',\n * changes: [\n * { field: 'status', oldDisplayValue: 'New', newDisplayValue: 'Active' },\n * { field: 'region', oldDisplayValue: '', newDisplayValue: 'Asia-Pacific' },\n * ],\n * actor: { type: 'user', id: 'user_456', name: 'John Smith' },\n * createdAt: '2026-01-15T10:25:00Z',\n * }\n */\nexport const FeedItemSchema = lazySchema(() => z.object({\n /** Unique identifier */\n id: z.string().describe('Feed item ID'),\n\n /** Feed item type */\n type: FeedItemType.describe('Activity type'),\n\n /** Target record reference */\n object: z.string().describe('Object name (e.g., \"account\")'),\n recordId: z.string().describe('Record ID this feed item belongs to'),\n\n /** Actor (who performed the action) */\n actor: FeedActorSchema.describe('Who performed this action'),\n\n /** Content (for comments/notes) */\n body: z.string().optional().describe('Rich text body (Markdown supported)'),\n\n /** @Mentions */\n mentions: z.array(MentionSchema).optional().describe('Mentioned users/teams/records'),\n\n /** Field changes (for field_change type) */\n changes: z.array(FieldChangeEntrySchema).optional().describe('Field-level changes'),\n\n /** Reactions */\n reactions: z.array(ReactionSchema).optional().describe('Emoji reactions on this item'),\n\n /** Reply threading */\n parentId: z.string().optional().describe('Parent feed item ID for threaded replies'),\n replyCount: z.number().int().min(0).default(0).describe('Number of replies'),\n\n /** Pin / Star */\n pinned: z.boolean().default(false).describe('Whether the feed item is pinned to the top of the timeline'),\n pinnedAt: z.string().datetime().optional().describe('Timestamp when the item was pinned'),\n pinnedBy: z.string().optional().describe('User ID who pinned the item'),\n starred: z.boolean().default(false).describe('Whether the feed item is starred/bookmarked by the current user'),\n starredAt: z.string().datetime().optional().describe('Timestamp when the item was starred'),\n\n /** Visibility */\n visibility: FeedVisibility.default('public')\n .describe('Visibility: public (all users), internal (team only), private (author + mentioned)'),\n\n /** Timestamps */\n createdAt: z.string().datetime().describe('Creation timestamp'),\n updatedAt: z.string().datetime().optional().describe('Last update timestamp'),\n editedAt: z.string().datetime().optional().describe('When comment was last edited'),\n isEdited: z.boolean().default(false).describe('Whether comment has been edited'),\n}));\nexport type FeedItem = z.infer<typeof FeedItemSchema>;\n\n/**\n * Feed Filter Mode\n * Controls which feed item types to display in the timeline.\n */\nexport const FeedFilterMode = z.enum([\n 'all',\n 'comments_only',\n 'changes_only',\n 'tasks_only',\n]);\nexport type FeedFilterMode = z.infer<typeof FeedFilterMode>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Subscription Event Type\n * Event types that can be subscribed to for record-level notifications.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SubscriptionEventType = z.enum([\n 'comment',\n 'mention',\n 'field_change',\n 'task',\n 'approval',\n 'all',\n]);\nexport type SubscriptionEventType = z.infer<typeof SubscriptionEventType>;\n\n/**\n * Notification Channel\n * Delivery channels for record subscription notifications.\n */\nexport const NotificationChannel = z.enum([\n 'in_app',\n 'email',\n 'push',\n 'slack',\n]);\nexport type NotificationChannel = z.infer<typeof NotificationChannel>;\n\n/**\n * Record Subscription Schema\n * Defines a user's subscription to record-level notifications.\n * Enables Airtable-style bell icon for record change notifications.\n */\nexport const RecordSubscriptionSchema = lazySchema(() => z.object({\n /** Target */\n object: z.string().describe('Object name'),\n recordId: z.string().describe('Record ID'),\n\n /** Subscriber */\n userId: z.string().describe('Subscribing user ID'),\n\n /** Events to subscribe to */\n events: z.array(SubscriptionEventType)\n .default(['all'])\n .describe('Event types to receive notifications for'),\n\n /** Notification channels */\n channels: z.array(NotificationChannel)\n .default(['in_app'])\n .describe('Notification delivery channels'),\n\n /** Active */\n active: z.boolean().default(true).describe('Whether the subscription is active'),\n\n /** Timestamps */\n createdAt: z.string().datetime().describe('Subscription creation timestamp'),\n}));\nexport type RecordSubscription = z.infer<typeof RecordSubscriptionSchema>;\n"]}
1
+ {"version":3,"sources":["../../src/shared/lazy-schema.ts","../../src/data/filter.zod.ts","../../src/data/query.zod.ts","../../src/data/date-macros.zod.ts","../../src/shared/identifiers.zod.ts","../../src/shared/expression.zod.ts","../../src/data/field.zod.ts","../../src/data/validation.zod.ts","../../src/ui/i18n.zod.ts","../../src/data/hook-body.zod.ts","../../src/ui/action.zod.ts","../../src/kernel/metadata-protection.zod.ts","../../src/shared/protection.zod.ts","../../src/ui/sharing.zod.ts","../../src/ui/responsive.zod.ts","../../src/shared/http.zod.ts","../../src/ui/view.zod.ts","../../src/data/object.zod.ts","../../src/data/autonumber-format.ts","../../src/data/hook.zod.ts","../../src/data/mapping.zod.ts","../../src/kernel/execution-context.zod.ts","../../src/data/data-engine.zod.ts","../../src/shared/enums.zod.ts","../../src/data/driver.zod.ts","../../src/data/driver-sql.zod.ts","../../src/data/driver-nosql.zod.ts","../../src/data/seed.zod.ts","../../src/data/object.form.ts","../../src/data/field.form.ts","../../src/data/hook.form.ts","../../src/data/seed-loader.zod.ts","../../src/data/document.zod.ts","../../src/shared/mapping.zod.ts","../../src/data/external-lookup.zod.ts","../../src/data/datasource.zod.ts","../../src/data/type-compat.ts","../../src/data/external-catalog.zod.ts","../../src/data/analytics.zod.ts","../../src/data/aggregation-policy.ts","../../src/data/display-name.ts","../../src/data/field-group-layout.ts","../../src/data/record-surface.ts","../../src/data/feed.zod.ts","../../src/data/subscription.zod.ts"],"names":["z","FieldMappingSchema"],"mappings":";;;;;AAoBO,SAAS,WAAmC,OAAA,EAAqB;AACtE,EAAA,IAAI,OAAO,OAAA,KAAY,WAAA,IAAe,OAAA,CAAQ,GAAA,EAAK,qBAAqB,GAAA,EAAK;AAC3E,IAAA,OAAO,OAAA,EAAQ;AAAA,EACjB;AAEA,EAAA,IAAI,MAAA;AACJ,EAAA,MAAM,UAAU,MAAS;AACvB,IAAA,IAAI,MAAA,KAAW,MAAA,EAAW,MAAA,GAAS,OAAA,EAAQ;AAC3C,IAAA,OAAO,MAAA;AAAA,EACT,CAAA;AAEA,EAAA,MAAM,MAAA,GAAS,SAAS,OAAA,GAAU;AAAA,EAAC,CAAA;AAEnC,EAAA,MAAM,KAAA,GAAQ,IAAI,KAAA,CAAM,MAAA,EAAkB;AAAA,IACxC,GAAA,CAAI,IAAI,IAAA,EAAM;AACZ,MAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,MAAA,MAAM,KAAA,GAAQ,KAAK,IAAI,CAAA;AACvB,MAAA,IAAI,OAAO,UAAU,UAAA,EAAY;AAC/B,QAAA,OAAQ,KAAA,CAAuC,KAAK,IAAI,CAAA;AAAA,MAC1D;AACA,MAAA,OAAO,KAAA;AAAA,IACT,CAAA;AAAA,IACA,GAAA,CAAI,EAAA,EAAI,IAAA,EAAM,KAAA,EAAO;AACnB,MAAA,MAAM,OAAO,OAAA,EAAQ;AACrB,MAAA,IAAA,CAAK,IAAI,CAAA,GAAI,KAAA;AACb,MAAA,OAAO,IAAA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C1C,SAAA;AAAA,EACA,SAAA;AAAA,EACA,cAAA;AAAA,EACA,MAAA;AAAA,EACA,UAAA;AAAA,EACA;AACF,CAAC;AAOM,IAAM,mBAAA,GAAsBA,EAAE,IAAA,CAAK;AAAA,EACxC,QAAA;AAAA,EACA,OAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAC;AAQM,IAAM,wBAAA,GAA2B,UAAA,CAAW,MAAMA,CAAAA,CAAE,MAAA,CAAO;AAAA;AAAA,EAEhE,MAAA,EAAQA,CAAAA,CAAE,MAAA,EAAO,CAAE,SAAS,aAAa,CAAA;AAAA,EACzC,QAAA,EAAUA,CAAAA,CAAE,MAAA,EAAO,CAAE,SAAS,WAAW,CAAA;AAAA;AAAA,EAGzC,MAAA,EAAQA,CAAAA,CAAE,MAAA,EAAO,CAAE,SAAS,qBAAqB,CAAA;AAAA;AAAA,EAGjD,MAAA,EAAQA,CAAAA,CAAE,KAAA,CAAM,qBAAqB,CAAA,CAClC,OAAA,CAAQ,CAAC,KAAK,CAAC,CAAA,CACf,QAAA,CAAS,0CAA0C,CAAA;AAAA;AAAA,EAGtD,QAAA,EAAUA,CAAAA,CAAE,KAAA,CAAM,mBAAmB,CAAA,CAClC,OAAA,CAAQ,CAAC,QAAQ,CAAC,CAAA,CAClB,QAAA,CAAS,gCAAgC,CAAA;AAAA;AAAA,EAG5C,MAAA,EAAQA,EAAE,OAAA,EAAQ,CAAE,QAAQ,IAAI,CAAA,CAAE,SAAS,oCAAoC,CAAA;AAAA;AAAA,EAG/E,WAAWA,CAAAA,CAAE,MAAA,GAAS,QAAA,EAAS,CAAE,SAAS,iCAAiC;AAC7E,CAAC,CAAC","file":"index.mjs","sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { z } from 'zod';\n\n/**\n * Wrap a Zod schema constructor so its body is only evaluated on first use.\n *\n * Why: building Zod schemas at module-load creates millions of closures that\n * dominate dev-server RSS even though most schemas are never parsed in a\n * given session. Wrapping the constructor in a Proxy defers allocation until\n * the first property access (`.parse`, `.shape`, `._def`, etc.) and reuses\n * a single cached instance thereafter.\n *\n * Type system: the returned Proxy is structurally indistinguishable from the\n * underlying ZodType, so `z.infer<typeof X>` and `.parse()` callers do not\n * need to change.\n *\n * Emergency rollback: set `OS_EAGER_SCHEMAS=1` to evaluate the\n * factory immediately and bypass the Proxy entirely.\n */\nexport function lazySchema<T extends z.ZodTypeAny>(factory: () => T): T {\n if (typeof process !== 'undefined' && process.env?.OS_EAGER_SCHEMAS === '1') {\n return factory();\n }\n\n let cached: T | undefined;\n const resolve = (): T => {\n if (cached === undefined) cached = factory();\n return cached;\n };\n\n const target = function lazyZod() {} as unknown as T;\n\n const proxy = new Proxy(target as object, {\n get(_t, prop) {\n const real = resolve() as unknown as Record<PropertyKey, unknown>;\n const value = real[prop];\n if (typeof value === 'function') {\n return (value as (...a: unknown[]) => unknown).bind(real);\n }\n return value;\n },\n set(_t, prop, value) {\n const real = resolve() as unknown as Record<PropertyKey, unknown>;\n real[prop] = value;\n return true;\n },\n has(_t, prop) {\n return prop in (resolve() as object);\n },\n ownKeys() {\n return Reflect.ownKeys(resolve() as object);\n },\n getOwnPropertyDescriptor(_t, prop) {\n return Reflect.getOwnPropertyDescriptor(resolve() as object, prop);\n },\n getPrototypeOf() {\n return Reflect.getPrototypeOf(resolve() as object);\n },\n });\n\n return proxy as T;\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Unified Query DSL Specification\n * \n * Based on industry best practices from:\n * - Prisma ORM\n * - Strapi CMS\n * - TypeORM\n * - LoopBack Framework\n * \n * Version: 1.0.0\n * Status: Draft\n * \n * Objective: Define a JSON-based, database-agnostic query syntax standard\n * for data filtering interactions between frontend and backend APIs.\n * \n * Design Principles:\n * 1. Declarative: Frontend describes \"what data to get\", not \"how to query\"\n * 2. Database Agnostic: Syntax contains no database-specific directives\n * 3. Type Safe: Structure can be statically inferred by TypeScript\n * 4. Convention over Configuration: Implicit syntax for common queries\n */\n\n/**\n * Field Reference\n * Represents a reference to another field/column instead of a literal value.\n * Used for joins (ON clause) and cross-field comparisons.\n * \n * @example\n * // user.id = order.owner_id\n * { \"$eq\": { \"$field\": \"order.owner_id\" } }\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const FieldReferenceSchema = lazySchema(() => z.object({\n $field: z.string().describe('Field Reference/Column Name')\n}));\n\nexport type FieldReference = z.infer<typeof FieldReferenceSchema>;\n\n// ============================================================================\n// 3.1 Comparison Operators\n// ============================================================================\n\n/**\n * Comparison operators for equality and inequality checks.\n * Supported data types: Any\n */\nexport const EqualityOperatorSchema = lazySchema(() => z.object({\n /** Equal to (default) - SQL: = | MongoDB: $eq */\n $eq: z.any().optional(),\n \n /** Not equal to - SQL: <> or != | MongoDB: $ne */\n $ne: z.any().optional(),\n}));\n\n/**\n * Comparison operators for numeric and date comparisons.\n * Supported data types: Number, Date\n */\nexport const ComparisonOperatorSchema = lazySchema(() => z.object({\n /** Greater than - SQL: > | MongoDB: $gt */\n $gt: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n \n /** Greater than or equal to - SQL: >= | MongoDB: $gte */\n $gte: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n \n /** Less than - SQL: < | MongoDB: $lt */\n $lt: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n \n /** Less than or equal to - SQL: <= | MongoDB: $lte */\n $lte: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n}));\n\n// ============================================================================\n// 3.2 Set & Range Operators\n// ============================================================================\n\n/**\n * Set operators for membership checks.\n */\nexport const SetOperatorSchema = lazySchema(() => z.object({\n /** In list - SQL: IN (?, ?, ?) | MongoDB: $in */\n $in: z.array(z.any()).optional(),\n \n /** Not in list - SQL: NOT IN (...) | MongoDB: $nin */\n $nin: z.array(z.any()).optional(),\n}));\n\n/**\n * Range operator for interval checks (closed interval).\n * SQL: BETWEEN ? AND ? | MongoDB: $gte AND $lte\n */\nexport const RangeOperatorSchema = lazySchema(() => z.object({\n /** Between (inclusive) - takes [min, max] array */\n $between: z.tuple([\n z.union([z.number(), z.date(), FieldReferenceSchema]),\n z.union([z.number(), z.date(), FieldReferenceSchema])\n ]).optional(),\n}));\n\n// ============================================================================\n// 3.3 String-Specific Operators\n// ============================================================================\n\n/**\n * String pattern matching operators.\n * Note: Case sensitivity should be handled at backend level.\n */\nexport const StringOperatorSchema = lazySchema(() => z.object({\n /** Contains substring - SQL: LIKE %?% | MongoDB: $regex */\n $contains: z.string().optional(),\n \n /** Does not contain substring - SQL: NOT LIKE %?% | MongoDB: $not: $regex */\n $notContains: z.string().optional(),\n \n /** Starts with prefix - SQL: LIKE ?% | MongoDB: $regex */\n $startsWith: z.string().optional(),\n \n /** Ends with suffix - SQL: LIKE %? | MongoDB: $regex */\n $endsWith: z.string().optional(),\n}));\n\n// ============================================================================\n// 3.5 Special Operators\n// ============================================================================\n\n/**\n * Special check operators for null and existence.\n */\nexport const SpecialOperatorSchema = lazySchema(() => z.object({\n /** Is null check - SQL: IS NULL (true) / IS NOT NULL (false) | MongoDB: field: null */\n $null: z.boolean().optional(),\n \n /** Field exists check (primarily for NoSQL) - MongoDB: $exists */\n $exists: z.boolean().optional(),\n}));\n\n// ============================================================================\n// Combined Field Operators\n// ============================================================================\n\n/**\n * All field-level operators combined.\n * These can be applied to individual fields in a filter.\n */\nexport const FieldOperatorsSchema = lazySchema(() => z.object({\n // Equality\n $eq: z.any().optional(),\n $ne: z.any().optional(),\n \n // Comparison (numeric/date)\n $gt: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n $gte: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n $lt: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n $lte: z.union([z.number(), z.date(), FieldReferenceSchema]).optional(),\n \n // Set & Range\n $in: z.array(z.any()).optional(),\n $nin: z.array(z.any()).optional(),\n $between: z.tuple([\n z.union([z.number(), z.date(), FieldReferenceSchema]),\n z.union([z.number(), z.date(), FieldReferenceSchema])\n ]).optional(),\n \n // String-specific\n $contains: z.string().optional(),\n $notContains: z.string().optional(),\n $startsWith: z.string().optional(),\n $endsWith: z.string().optional(),\n \n // Special\n $null: z.boolean().optional(),\n $exists: z.boolean().optional(),\n}));\n\n// ============================================================================\n// 3.4 Logical Operators & Recursive Filter Structure\n// ============================================================================\n\n/**\n * Recursive filter type that supports:\n * 1. Implicit equality: { field: value }\n * 2. Explicit operators: { field: { $op: value } }\n * 3. Logical combinations: { $and: [...], $or: [...], $not: {...} }\n * 4. Nested relations: { relation: { field: value } }\n */\nexport type FilterCondition = {\n [key: string]: \n | any // Implicit equality: key: value\n | z.infer<typeof FieldOperatorsSchema> // Explicit operators: key: { $op: value }\n | FilterCondition; // Nested relation: key: { nested: ... }\n} & {\n /** Logical AND - combines all conditions that must be true */\n $and?: FilterCondition[];\n \n /** Logical OR - at least one condition must be true */\n $or?: FilterCondition[];\n \n /** Logical NOT - negates the condition */\n $not?: FilterCondition;\n};\n\n/**\n * Zod schema for recursive filter validation.\n * Uses z.lazy() to handle recursive structure.\n */\nexport const FilterConditionSchema: z.ZodType<FilterCondition> = z.lazy(() =>\n z.record(z.string(), z.unknown()).and(\n z.object({\n $and: z.array(FilterConditionSchema).optional(),\n $or: z.array(FilterConditionSchema).optional(),\n $not: FilterConditionSchema.optional(),\n })\n )\n);\n\n// ============================================================================\n// Query Filter Wrapper\n// ============================================================================\n\n/**\n * Top-level query filter wrapper.\n * This is typically used as the \"where\" clause in a query.\n * \n * @example\n * ```typescript\n * const filter: QueryFilter = {\n * where: {\n * status: \"active\", // Implicit equality\n * age: { $gte: 18 }, // Explicit operator\n * $or: [ // Logical combination\n * { role: \"admin\" },\n * { email: { $contains: \"@company.com\" } }\n * ],\n * profile: { // Nested relation\n * verified: true\n * }\n * }\n * }\n * ```\n */\nexport const QueryFilterSchema = lazySchema(() => z.object({\n where: FilterConditionSchema.optional(),\n}));\n\n// ============================================================================\n// TypeScript Type Exports\n// ============================================================================\n\n/**\n * Type-safe filter operators for use in TypeScript.\n * \n * @example\n * ```typescript\n * type UserFilter = Filter<User>;\n * \n * const filter: UserFilter = {\n * age: { $gte: 18 },\n * email: { $contains: \"@example.com\" }\n * };\n * ```\n */\nexport type Filter<T = any> = {\n [K in keyof T]?: \n | T[K] // Implicit equality\n | {\n $eq?: T[K];\n $ne?: T[K];\n $gt?: T[K] extends number | Date ? T[K] : never;\n $gte?: T[K] extends number | Date ? T[K] : never;\n $lt?: T[K] extends number | Date ? T[K] : never;\n $lte?: T[K] extends number | Date ? T[K] : never;\n $in?: T[K][];\n $nin?: T[K][];\n $between?: T[K] extends number | Date ? [T[K], T[K]] : never;\n $contains?: T[K] extends string ? string : never;\n $notContains?: T[K] extends string ? string : never;\n $startsWith?: T[K] extends string ? string : never;\n $endsWith?: T[K] extends string ? string : never;\n $null?: boolean;\n $exists?: boolean;\n }\n | (T[K] extends object ? Filter<T[K]> : never); // Nested relation\n} & {\n $and?: Filter<T>[];\n $or?: Filter<T>[];\n $not?: Filter<T>;\n};\n\n/**\n * Scalar types supported by the filter system.\n */\nexport type Scalar = string | number | boolean | Date | null;\n\n// Export inferred types\nexport type FieldOperators = z.infer<typeof FieldOperatorsSchema>;\nexport type QueryFilter = z.infer<typeof QueryFilterSchema>;\n\n// ============================================================================\n// Normalization Utilities (Internal Representation)\n// ============================================================================\n\n/**\n * Normalized filter AST structure.\n * This is the internal representation after converting all syntactic sugar\n * to explicit operators.\n * \n * Stage 1: Normalization Pass\n * Input: { age: 18, role: \"admin\" }\n * Output: { $and: [{ age: { $eq: 18 } }, { role: { $eq: \"admin\" } }] }\n * \n * This simplifies adapter implementation by providing a consistent structure.\n */\nexport const NormalizedFilterSchema: z.ZodType<any> = z.lazy(() => \n z.object({\n $and: z.array(\n z.union([\n // Field condition: { field: { $op: value } }\n z.record(z.string(), FieldOperatorsSchema),\n // Nested logical group\n NormalizedFilterSchema,\n ])\n ).optional(),\n \n $or: z.array(\n z.union([\n z.record(z.string(), FieldOperatorsSchema),\n NormalizedFilterSchema,\n ])\n ).optional(),\n \n $not: z.union([\n z.record(z.string(), FieldOperatorsSchema),\n NormalizedFilterSchema,\n ]).optional(),\n })\n);\n\nexport type NormalizedFilter = z.infer<typeof NormalizedFilterSchema>;\n\n// ============================================================================\n// AST Array Format Detection & Validation\n// ============================================================================\n\n/**\n * Set of valid AST comparison operators (case-insensitive).\n * Used by `isFilterAST()` to validate AST structure beyond `Array.isArray`.\n */\nexport const VALID_AST_OPERATORS = new Set([\n '=', '==', '!=', '<>', '>', '>=', '<', '<=',\n 'in', 'nin', 'not_in',\n 'contains', 'notcontains', 'not_contains', 'like',\n 'startswith', 'starts_with',\n 'endswith', 'ends_with',\n 'between',\n 'is_null', 'is_not_null',\n]);\n\n/**\n * Detect whether a value is a valid Filter AST array structure.\n *\n * A valid AST is one of:\n * - Comparison node: `[field: string, operator: string, value: unknown]` where operator is a known operator\n * - Logical node: `[\"and\" | \"or\", ...children]` where children are valid AST nodes\n * - Legacy flat array: `[[cond], [cond], ...]` where all elements are sub-arrays (each a valid AST node)\n *\n * This replaces the naïve `Array.isArray(filter)` check, preventing accidental\n * misidentification of arbitrary arrays as filter ASTs.\n *\n * @example\n * isFilterAST([\"status\", \"=\", \"active\"]) // true\n * isFilterAST([\"and\", [\"a\", \"=\", 1], [\"b\", \">\", 2]]) // true\n * isFilterAST([[\"a\", \"=\", 1], [\"b\", \"=\", 2]]) // true (legacy)\n * isFilterAST([1, 2, 3]) // false\n * isFilterAST(\"not an array\") // false\n * isFilterAST({ status: \"active\" }) // false\n */\nexport function isFilterAST(filter: unknown): boolean {\n if (!Array.isArray(filter) || filter.length === 0) return false;\n\n const first = filter[0];\n\n // Logical node: [\"and\", ...] or [\"or\", ...]\n if (typeof first === 'string') {\n const lower = first.toLowerCase();\n if (lower === 'and' || lower === 'or') {\n return filter.length >= 2 && filter.slice(1).every((child: unknown) => isFilterAST(child));\n }\n\n // Comparison node: [field, operator, value]\n if (filter.length >= 2 && typeof filter[1] === 'string') {\n return VALID_AST_OPERATORS.has(filter[1].toLowerCase());\n }\n }\n\n // Legacy flat array: [[cond], [cond], ...]\n if (filter.every((item: unknown) => isFilterAST(item))) {\n return filter.length > 0;\n }\n\n return false;\n}\n\n// ============================================================================\n// AST Array → FilterCondition Conversion\n// ============================================================================\n\n/**\n * Operator mapping from AST infix operators to FilterCondition `$`-prefixed operators.\n */\nconst AST_OPERATOR_MAP: Record<string, string> = {\n '=': '$eq',\n '==': '$eq',\n '!=': '$ne',\n '<>': '$ne',\n '>': '$gt',\n '>=': '$gte',\n '<': '$lt',\n '<=': '$lte',\n 'in': '$in',\n 'nin': '$nin',\n 'not_in': '$nin',\n 'contains': '$contains',\n 'notcontains': '$notContains',\n 'not_contains': '$notContains',\n 'like': '$contains',\n 'startswith': '$startsWith',\n 'starts_with': '$startsWith',\n 'endswith': '$endsWith',\n 'ends_with': '$endsWith',\n 'between': '$between',\n 'is_null': '$null',\n 'is_not_null': '$null',\n};\n\n/**\n * Convert a single AST comparison node `[field, operator, value]` to a FilterCondition object.\n */\nfunction convertComparison(node: [string, string, unknown]): FilterCondition {\n const [field, operator, value] = node;\n const op = operator.toLowerCase();\n\n // Special case: equality shorthand\n if (op === '=' || op === '==') {\n return { [field]: value } as FilterCondition;\n }\n\n // Null check operators\n if (op === 'is_null') {\n return { [field]: { $null: true } } as FilterCondition;\n }\n if (op === 'is_not_null') {\n return { [field]: { $null: false } } as FilterCondition;\n }\n\n const mapped = AST_OPERATOR_MAP[op];\n if (mapped) {\n return { [field]: { [mapped]: value } } as FilterCondition;\n }\n\n // Fallback: use the operator as-is with $ prefix\n return { [field]: { [`$${op}`]: value } } as FilterCondition;\n}\n\n/**\n * Parse a filter from AST array format to FilterCondition object format.\n *\n * The AST array format is used by the ObjectUI client and the `FilterBuilder`:\n * - Comparison: `[field, operator, value]` → `{ field: value }` or `{ field: { $op: value } }`\n * - Logical AND: `[\"and\", cond1, cond2, ...]` → `{ $and: [...] }`\n * - Logical OR: `[\"or\", cond1, cond2, ...]` → `{ $or: [...] }`\n *\n * If the input is already a FilterCondition object (not an array), it is returned as-is.\n * If the input is `null` or `undefined`, it is returned as-is.\n *\n * @example\n * // Simple condition\n * parseFilterAST([\"status\", \"=\", \"active\"])\n * // → { status: \"active\" }\n *\n * @example\n * // Compound AND\n * parseFilterAST([\"and\", [\"priority\", \"=\", \"high\"], [\"status\", \"=\", \"active\"]])\n * // → { $and: [{ priority: \"high\" }, { status: \"active\" }] }\n *\n * @example\n * // Object passthrough\n * parseFilterAST({ status: \"active\" })\n * // → { status: \"active\" }\n */\nexport function parseFilterAST(filter: unknown): FilterCondition | undefined {\n if (filter == null) return undefined;\n if (!Array.isArray(filter)) return filter as FilterCondition;\n if (filter.length === 0) return undefined;\n\n const first = filter[0];\n\n // Logical node: [\"and\", cond1, cond2, ...] or [\"or\", cond1, cond2, ...]\n if (typeof first === 'string' && (first.toLowerCase() === 'and' || first.toLowerCase() === 'or')) {\n const logicOp = `$${first.toLowerCase()}` as '$and' | '$or';\n const children = filter.slice(1).map((child: unknown) => parseFilterAST(child)).filter(Boolean) as FilterCondition[];\n if (children.length === 0) return undefined;\n if (children.length === 1) return children[0];\n return { [logicOp]: children } as FilterCondition;\n }\n\n // Comparison node: [field, operator, value]\n if (filter.length >= 2 && typeof first === 'string') {\n return convertComparison(filter as [string, string, unknown]);\n }\n\n // Legacy flat array: [[field, op, val], [field, op, val], ...]\n // All elements are sub-arrays → treat as implicit AND\n if (filter.every((item: unknown) => Array.isArray(item))) {\n const children = filter.map((child: unknown) => parseFilterAST(child)).filter(Boolean) as FilterCondition[];\n if (children.length === 0) return undefined;\n if (children.length === 1) return children[0];\n return { $and: children } as FilterCondition;\n }\n\n return undefined;\n}\n\n// ============================================================================\n// Constants & Metadata\n// ============================================================================\n\n/**\n * All supported operator keys.\n * Useful for validation and parsing.\n */\nexport const FILTER_OPERATORS = [\n // Equality\n '$eq', '$ne',\n // Comparison\n '$gt', '$gte', '$lt', '$lte',\n // Set & Range\n '$in', '$nin', '$between',\n // String\n '$contains', '$notContains', '$startsWith', '$endsWith',\n // Special\n '$null', '$exists',\n] as const;\n\n/**\n * Logical operator keys.\n */\nexport const LOGICAL_OPERATORS = ['$and', '$or', '$not'] as const;\n\n/**\n * All operator keys (field + logical).\n */\nexport const ALL_OPERATORS = [...FILTER_OPERATORS, ...LOGICAL_OPERATORS] as const;\n\nexport type FilterOperatorKey = typeof FILTER_OPERATORS[number];\nexport type LogicalOperatorKey = typeof LOGICAL_OPERATORS[number];\nexport type OperatorKey = typeof ALL_OPERATORS[number];\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FilterConditionSchema } from './filter.zod';\n\n/**\n * Sort Node\n * Represents \"Order By\".\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SortNodeSchema = lazySchema(() => z.object({\n field: z.string(),\n order: z.enum(['asc', 'desc']).default('asc')\n}));\n\n/**\n * Aggregation Function Enum\n * Standard aggregation functions for data analysis.\n * \n * Supported Functions:\n * - **count**: Count rows (SQL: COUNT(*) or COUNT(field))\n * - **sum**: Sum numeric values (SQL: SUM(field))\n * - **avg**: Average numeric values (SQL: AVG(field))\n * - **min**: Minimum value (SQL: MIN(field))\n * - **max**: Maximum value (SQL: MAX(field))\n * - **count_distinct**: Count unique values (SQL: COUNT(DISTINCT field))\n * - **array_agg**: Aggregate values into array (SQL: ARRAY_AGG(field))\n * - **string_agg**: Concatenate values (SQL: STRING_AGG(field, delimiter))\n * \n * Performance Considerations:\n * - COUNT(*) is typically faster than COUNT(field) as it doesn't check for nulls\n * - COUNT DISTINCT may require additional memory for tracking unique values\n * - Window aggregates (with OVER clause) can be more efficient than subqueries\n * - Large GROUP BY operations benefit from proper indexing on grouped fields\n * \n * @example\n * // SQL: SELECT region, SUM(amount) FROM sales GROUP BY region\n * {\n * object: 'sales',\n * fields: ['region'],\n * aggregations: [\n * { function: 'sum', field: 'amount', alias: 'total_sales' }\n * ],\n * groupBy: ['region']\n * }\n * \n * @example\n * // Salesforce SOQL: SELECT COUNT(Id) FROM Account\n * {\n * object: 'account',\n * aggregations: [\n * { function: 'count', alias: 'total_accounts' }\n * ]\n * }\n */\nexport const AggregationFunction = z.enum([\n 'count', 'sum', 'avg', 'min', 'max',\n 'count_distinct', 'array_agg', 'string_agg'\n]);\n\n/**\n * Date Granularity Enum\n * Used to bucket date/timestamp fields into uniform periods during GROUP BY.\n *\n * Backends MAY emit `DATE_TRUNC` (PostgreSQL), `DATE_FORMAT` (MySQL),\n * `$dateTrunc` (MongoDB), or any other equivalent. When a driver does not\n * support server-side truncation the engine falls back to an in-memory bucket\n * using ISO-8601 conventions (weeks start Monday).\n */\nexport const DateGranularity = z.enum(['day', 'week', 'month', 'quarter', 'year']);\n\n/**\n * GroupBy Node\n *\n * A grouping target — either a bare field name (string) for plain grouping,\n * or a structured object that adds `dateGranularity` for time-bucketed\n * grouping. The string form remains the canonical short-hand:\n *\n * ```ts\n * groupBy: ['region', { field: 'closed_at', dateGranularity: 'quarter' }]\n * ```\n *\n * This is backward-compatible: every existing `groupBy: ['region']` payload\n * continues to validate.\n */\nexport const GroupByNodeSchema = lazySchema(() => z.union([\n z.string(),\n z.object({\n field: z.string().describe('Field to group by'),\n dateGranularity: DateGranularity.optional().describe('Bucket date values into uniform periods (day/week/month/quarter/year)'),\n /** Optional alias for the projected group value (defaults to `field`). */\n alias: z.string().optional().describe('Alias for the projected group value'),\n }),\n]));\n\n/**\n * Aggregation Node\n * Represents an aggregated field with function.\n * \n * Aggregations summarize data across groups of rows (GROUP BY).\n * Used with `groupBy` to create analytical queries.\n * \n * @example\n * // SQL: SELECT customer_id, COUNT(*), SUM(amount) FROM orders GROUP BY customer_id\n * {\n * object: 'order',\n * fields: ['customer_id'],\n * aggregations: [\n * { function: 'count', alias: 'order_count' },\n * { function: 'sum', field: 'amount', alias: 'total_amount' }\n * ],\n * groupBy: ['customer_id']\n * }\n * \n * @example\n * // Salesforce SOQL: SELECT LeadSource, COUNT(Id) FROM Lead GROUP BY LeadSource\n * {\n * object: 'lead',\n * fields: ['lead_source'],\n * aggregations: [\n * { function: 'count', alias: 'lead_count' }\n * ],\n * groupBy: ['lead_source']\n * }\n */\nexport const AggregationNodeSchema = lazySchema(() => z.object({\n function: AggregationFunction.describe('Aggregation function'),\n field: z.string().optional().describe('Field to aggregate (optional for COUNT(*))'),\n alias: z.string().describe('Result column alias'),\n distinct: z.boolean().optional().describe('Apply DISTINCT before aggregation'),\n filter: FilterConditionSchema.optional().describe('Filter/Condition to apply to the aggregation (FILTER WHERE clause)'),\n}));\n\n/**\n * Join Type Enum\n * Standard SQL join types for combining tables.\n * \n * Join Types:\n * - **inner**: Returns only matching rows from both tables (SQL: INNER JOIN)\n * - **left**: Returns all rows from left table, matching rows from right (SQL: LEFT JOIN)\n * - **right**: Returns all rows from right table, matching rows from left (SQL: RIGHT JOIN)\n * - **full**: Returns all rows from both tables (SQL: FULL OUTER JOIN)\n * \n * @example\n * // SQL: SELECT * FROM orders INNER JOIN customers ON orders.customer_id = customers.id\n * {\n * object: 'order',\n * joins: [\n * {\n * type: 'inner',\n * object: 'customer',\n * on: ['order.customer_id', '=', 'customer.id']\n * }\n * ]\n * }\n * \n * @example\n * // Salesforce SOQL-style: Find all customers and their orders (if any)\n * {\n * object: 'customer',\n * joins: [\n * {\n * type: 'left',\n * object: 'order',\n * on: ['customer.id', '=', 'order.customer_id']\n * }\n * ]\n * }\n */\nexport const JoinType = z.enum(['inner', 'left', 'right', 'full']);\n\n/**\n * Join Execution Strategy\n * Hints to the query engine on how to execute the join.\n * \n * Strategies:\n * - **auto**: Engine decides best strategy (Default).\n * - **database**: Push down join to the database (Requires same datasource).\n * - **hash**: Load both sets into memory and hash join (Cross-datasource, memory intensive).\n * - **loop**: Nested loop lookup (N+1 safe version). (Good for small right-side lookups).\n */\nexport const JoinStrategy = z.enum(['auto', 'database', 'hash', 'loop']);\n\n/**\n * Join Node\n * Represents table joins for combining data from multiple objects.\n * \n * Joins connect related data across multiple tables using ON conditions.\n * Supports both direct object joins and subquery joins.\n * \n * @example\n * // SQL: SELECT o.*, c.name FROM orders o INNER JOIN customers c ON o.customer_id = c.id\n * {\n * object: 'order',\n * fields: ['id', 'amount'],\n * joins: [\n * {\n * type: 'inner',\n * object: 'customer',\n * alias: 'c',\n * on: ['order.customer_id', '=', 'c.id']\n * }\n * ]\n * }\n * \n * @example\n * // SQL: Multi-table join\n * // SELECT * FROM orders o\n * // INNER JOIN customers c ON o.customer_id = c.id\n * // LEFT JOIN shipments s ON o.id = s.order_id\n * {\n * object: 'order',\n * joins: [\n * {\n * type: 'inner',\n * object: 'customer',\n * alias: 'c',\n * on: ['order.customer_id', '=', 'c.id']\n * },\n * {\n * type: 'left',\n * object: 'shipment',\n * alias: 's',\n * on: ['order.id', '=', 's.order_id']\n * }\n * ]\n * }\n * \n * @example\n * // Salesforce SOQL: SELECT Name, (SELECT LastName FROM Contacts) FROM Account\n * {\n * object: 'account',\n * fields: ['name'],\n * joins: [\n * {\n * type: 'left',\n * object: 'contact',\n * on: ['account.id', '=', 'contact.account_id']\n * }\n * ]\n * }\n * \n * @example\n * // Subquery Join: Join with a filtered/aggregated dataset\n * {\n * object: 'customer',\n * joins: [\n * {\n * type: 'left',\n * object: 'order',\n * alias: 'high_value_orders',\n * on: ['customer.id', '=', 'high_value_orders.customer_id'],\n * subquery: {\n * object: 'order',\n * fields: ['customer_id', 'total'],\n * filters: ['total', '>', 1000]\n * }\n * }\n * ]\n * }\n */\nexport const JoinNodeSchema: z.ZodType<any> = z.lazy(() => \n z.object({\n type: JoinType.describe('Join type'),\n strategy: JoinStrategy.optional().describe('Execution strategy hint'),\n object: z.string().describe('Object/table to join'),\n alias: z.string().optional().describe('Table alias'),\n on: FilterConditionSchema.describe('Join condition'),\n subquery: z.lazy(() => QuerySchema).optional().describe('Subquery instead of object'),\n })\n);\n\n/**\n * Window Function Enum\n * Advanced analytical functions for row-based calculations.\n * \n * Window Functions:\n * - **row_number**: Sequential number within partition (SQL: ROW_NUMBER() OVER (...))\n * - **rank**: Rank with gaps for ties (SQL: RANK() OVER (...))\n * - **dense_rank**: Rank without gaps (SQL: DENSE_RANK() OVER (...))\n * - **percent_rank**: Relative rank as percentage (SQL: PERCENT_RANK() OVER (...))\n * - **lag**: Access previous row value (SQL: LAG(field) OVER (...))\n * - **lead**: Access next row value (SQL: LEAD(field) OVER (...))\n * - **first_value**: First value in window (SQL: FIRST_VALUE(field) OVER (...))\n * - **last_value**: Last value in window (SQL: LAST_VALUE(field) OVER (...))\n * - **sum/avg/count/min/max**: Aggregates over window (SQL: SUM(field) OVER (...))\n * \n * @example\n * // SQL: SELECT *, ROW_NUMBER() OVER (PARTITION BY customer_id ORDER BY amount DESC) as rank\n * // FROM orders\n * {\n * object: 'order',\n * fields: ['id', 'customer_id', 'amount'],\n * windowFunctions: [\n * {\n * function: 'row_number',\n * alias: 'rank',\n * over: {\n * partitionBy: ['customer_id'],\n * orderBy: [{ field: 'amount', order: 'desc' }]\n * }\n * }\n * ]\n * }\n * \n * @example\n * // SQL: Running total with SUM() OVER (...)\n * {\n * object: 'transaction',\n * fields: ['date', 'amount'],\n * windowFunctions: [\n * {\n * function: 'sum',\n * field: 'amount',\n * alias: 'running_total',\n * over: {\n * orderBy: [{ field: 'date', order: 'asc' }],\n * frame: {\n * type: 'rows',\n * start: 'UNBOUNDED PRECEDING',\n * end: 'CURRENT ROW'\n * }\n * }\n * }\n * ]\n * }\n */\nexport const WindowFunction = z.enum([\n 'row_number', 'rank', 'dense_rank', 'percent_rank',\n 'lag', 'lead', 'first_value', 'last_value',\n 'sum', 'avg', 'count', 'min', 'max'\n]);\n\n/**\n * Window Specification\n * Defines PARTITION BY and ORDER BY for window functions.\n * \n * Window specifications control how window functions compute values:\n * - **partitionBy**: Divide rows into groups (like GROUP BY but without collapsing rows)\n * - **orderBy**: Define order for ranking and offset functions\n * - **frame**: Specify which rows to include in aggregate calculations\n * \n * @example\n * // Partition by department, order by salary\n * {\n * partitionBy: ['department'],\n * orderBy: [{ field: 'salary', order: 'desc' }]\n * }\n * \n * @example\n * // Moving average with frame specification\n * {\n * orderBy: [{ field: 'date', order: 'asc' }],\n * frame: {\n * type: 'rows',\n * start: '6 PRECEDING',\n * end: 'CURRENT ROW'\n * }\n * }\n */\nexport const WindowSpecSchema = lazySchema(() => z.object({\n partitionBy: z.array(z.string()).optional().describe('PARTITION BY fields'),\n orderBy: z.array(SortNodeSchema).optional().describe('ORDER BY specification'),\n frame: z.object({\n type: z.enum(['rows', 'range']).optional(),\n start: z.string().optional().describe('Frame start (e.g., \"UNBOUNDED PRECEDING\", \"1 PRECEDING\")'),\n end: z.string().optional().describe('Frame end (e.g., \"CURRENT ROW\", \"1 FOLLOWING\")'),\n }).optional().describe('Window frame specification'),\n}));\n\n/**\n * Window Function Node\n * Represents window function with OVER clause.\n * \n * Window functions perform calculations across a set of rows related to the current row,\n * without collapsing the result set (unlike GROUP BY aggregations).\n * \n * @example\n * // SQL: Top 3 products per category\n * // SELECT *, ROW_NUMBER() OVER (PARTITION BY category ORDER BY sales DESC) as rank\n * // FROM products\n * {\n * object: 'product',\n * fields: ['name', 'category', 'sales'],\n * windowFunctions: [\n * {\n * function: 'row_number',\n * alias: 'category_rank',\n * over: {\n * partitionBy: ['category'],\n * orderBy: [{ field: 'sales', order: 'desc' }]\n * }\n * }\n * ]\n * }\n * \n * @example\n * // SQL: Year-over-year comparison with LAG\n * {\n * object: 'monthly_sales',\n * fields: ['month', 'revenue'],\n * windowFunctions: [\n * {\n * function: 'lag',\n * field: 'revenue',\n * alias: 'prev_year_revenue',\n * over: {\n * orderBy: [{ field: 'month', order: 'asc' }]\n * }\n * }\n * ]\n * }\n */\nexport const WindowFunctionNodeSchema = lazySchema(() => z.object({\n function: WindowFunction.describe('Window function name'),\n field: z.string().optional().describe('Field to operate on (for aggregate window functions)'),\n alias: z.string().describe('Result column alias'),\n over: WindowSpecSchema.describe('Window specification (OVER clause)'),\n}));\n\n/**\n * Field Selection Node\n * Represents \"Select\" attributes, including joins.\n */\nexport const FieldNodeSchema: z.ZodType<any> = z.lazy(() => \n z.union([\n z.string(), // Primitive field: \"name\"\n z.object({\n field: z.string(), // Relationship field: \"owner\"\n fields: z.array(FieldNodeSchema).optional(), // Nested select: [\"name\", \"email\"]\n alias: z.string().optional()\n })\n ])\n);\n\n/**\n * Full-Text Search Configuration\n * Defines full-text search parameters for text queries.\n * \n * Supports:\n * - Multi-field search\n * - Relevance scoring\n * - Fuzzy matching\n * - Language-specific analyzers\n * \n * @example\n * {\n * query: \"John Smith\",\n * fields: [\"name\", \"email\", \"description\"],\n * fuzzy: true,\n * boost: { \"name\": 2.0, \"email\": 1.5 }\n * }\n */\nexport const FullTextSearchSchema = lazySchema(() => z.object({\n query: z.string().describe('Search query text'),\n fields: z.array(z.string()).optional().describe('Fields to search in (if not specified, searches all text fields)'),\n fuzzy: z.boolean().optional().default(false).describe('Enable fuzzy matching (tolerates typos)'),\n operator: z.enum(['and', 'or']).optional().default('or').describe('Logical operator between terms'),\n boost: z.record(z.string(), z.number()).optional().describe('Field-specific relevance boosting (field name -> boost factor)'),\n minScore: z.number().optional().describe('Minimum relevance score threshold'),\n language: z.string().optional().describe('Language for text analysis (e.g., \"en\", \"zh\", \"es\")'),\n highlight: z.boolean().optional().default(false).describe('Enable search result highlighting'),\n}));\n\nexport type FullTextSearch = z.infer<typeof FullTextSearchSchema>;\n\n/**\n * Query AST Schema\n * The universal data retrieval contract defined in `ast-structure.mdx`.\n * \n * This schema represents ObjectQL - a universal query language that abstracts\n * SQL, NoSQL, and SaaS APIs into a single unified interface.\n * \n * Updates (v2):\n * - Aligned with modern ORM standards (Prisma/TypeORM)\n * - Added `cursor` based pagination support\n * - Renamed `top`/`skip` to `limit`/`offset`\n * - Unified filtering syntax with `FilterConditionSchema`\n * \n * Updates (v3):\n * - Added `search` parameter for full-text search (P2 requirement)\n * \n * @example\n * // Simple query: SELECT name, email FROM account WHERE status = 'active'\n * {\n * object: 'account',\n * fields: ['name', 'email'],\n * where: { status: 'active' }\n * }\n * \n * @example\n * // Pagination with Limit/Offset\n * {\n * object: 'post',\n * where: { published: true },\n * orderBy: [{ field: 'created_at', order: 'desc' }],\n * limit: 20,\n * offset: 40\n * }\n * \n * @example\n * // Full-text search\n * {\n * object: 'article',\n * search: {\n * query: \"machine learning\",\n * fields: [\"title\", \"content\"],\n * fuzzy: true,\n * boost: { \"title\": 2.0 }\n * },\n * limit: 10\n * }\n */\nconst BaseQuerySchema = z.object({\n /** Target Entity */\n object: z.string().describe('Object name (e.g. account)'),\n \n /** Select Clause */\n fields: z.array(FieldNodeSchema).optional().describe('Fields to retrieve'),\n \n /** Where Clause (Filtering) */\n where: FilterConditionSchema.optional().describe('Filtering criteria (WHERE)'),\n \n /** Full-Text Search */\n search: FullTextSearchSchema.optional().describe('Full-text search configuration ($search parameter)'),\n \n /** Order By Clause (Sorting) */\n orderBy: z.array(SortNodeSchema).optional().describe('Sorting instructions (ORDER BY)'),\n \n /** Pagination */\n limit: z.number().optional().describe('Max records to return (LIMIT)'),\n offset: z.number().optional().describe('Records to skip (OFFSET)'),\n top: z.number().optional().describe('Alias for limit (OData compatibility)'),\n cursor: z.record(z.string(), z.unknown()).optional().describe('Cursor for keyset pagination'),\n \n /** Joins */\n joins: z.array(JoinNodeSchema).optional().describe('Explicit Table Joins'),\n \n /** Aggregations */\n aggregations: z.array(AggregationNodeSchema).optional().describe('Aggregation functions'),\n \n /** Group By Clause */\n groupBy: z.array(GroupByNodeSchema).optional().describe('GROUP BY targets (strings or `{field, dateGranularity?}` objects for date bucketing)'),\n \n /** Having Clause */\n having: FilterConditionSchema.optional().describe('HAVING clause for aggregation filtering'),\n \n /** Window Functions */\n windowFunctions: z.array(WindowFunctionNodeSchema).optional().describe('Window functions with OVER clause'),\n \n /** Subquery flag */\n distinct: z.boolean().optional().describe('SELECT DISTINCT flag'),\n});\n\n/**\n * QueryAST — Abstract Syntax Tree for data queries.\n *\n * The `expand` property enables recursive loading of related records through\n * lookup and master_detail fields. Each key is a relationship field name; the\n * value is a nested QueryAST that can further filter, select, sort, and expand\n * the related records (up to a default max depth of 3).\n *\n * @example\n * ```ts\n * const ast: QueryAST = {\n * object: 'task',\n * fields: ['title', 'assignee'],\n * expand: {\n * assignee: { object: 'user', fields: ['name', 'email'] },\n * project: {\n * object: 'project',\n * expand: { org: { object: 'org' } } // nested expand\n * }\n * }\n * };\n * ```\n */\nexport type QueryAST = z.infer<typeof BaseQuerySchema> & {\n expand?: Record<string, QueryAST>;\n};\n\nexport type QueryInput = z.input<typeof BaseQuerySchema> & {\n expand?: Record<string, QueryInput>;\n};\n\nexport const QuerySchema: z.ZodType<QueryAST> = lazySchema(() => BaseQuerySchema.extend({\n expand: z.lazy(() => z.record(z.string(), QuerySchema)).optional().describe(\n 'Recursive relation loading map. Keys are lookup/master_detail field names; '\n + 'values are nested QueryAST objects that control select (`fields`) and filter '\n + '(`where`, AND-merged with the batch $in), plus further expansion on the related '\n + 'object. The engine resolves expand via batch $in queries (driver-agnostic) with a '\n + 'default max depth of 3; per-parent `limit`/`offset`/`orderBy` are NOT applied on '\n + 'this path.'\n ),\n}));\n\nexport type SortNode = z.infer<typeof SortNodeSchema>;\nexport type AggregationNode = z.infer<typeof AggregationNodeSchema>;\nexport type GroupByNode = z.infer<typeof GroupByNodeSchema>;\nexport type DateGranularityValue = z.infer<typeof DateGranularity>;\nexport type JoinNode = z.infer<typeof JoinNodeSchema>;\nexport type WindowFunctionNode = z.infer<typeof WindowFunctionNodeSchema>;\nexport type WindowSpec = z.infer<typeof WindowSpecSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Date Macro Tokens — the declarative placeholders the UI substitutes\n * into filter values before sending a query to the data engine.\n *\n * # Why this lives in `spec`\n *\n * Filter values in dashboards, views, reports and pages travel as JSON.\n * Because JSON cannot evaluate code, callers cannot write `daysAgo(30)`\n * inline; they use a tiny placeholder grammar instead:\n *\n * { published_at: { $gte: '{last_quarter_start}' } }\n * { signal_at: { $gte: '{30_days_ago}' } }\n *\n * The placeholders are expanded **client-side** by\n * `resolveDateMacros()` in `@object-ui/core` immediately before the\n * filter is handed to the data source. The data engine itself only\n * sees ISO date / timestamp strings, never `{tokens}`.\n *\n * AI agents and template authors author these placeholders directly,\n * so the **set of recognised tokens is part of the platform contract**\n * and must live here next to the rest of the JSON-DSL schemas, not\n * inside any single UI implementation.\n *\n * # Two flavours of token\n *\n * 1. **Fixed tokens** — small, finite list (`{today}`,\n * `{current_quarter_start}`, `{last_year_end}`, …). Enumerated by\n * `DATE_MACRO_TOKENS` below.\n *\n * 2. **Parameterised tokens** — `{N_days_ago}`, `{N_weeks_from_now}`,\n * etc., where `N` is any non-negative integer. Matched by\n * `DATE_MACRO_PARAM_RE`. Units: `minute(s)`, `hour(s)`, `day(s)`,\n * `week(s)`, `month(s)`, `year(s)`. Directions: `ago`, `from_now`.\n *\n * # Out of scope\n *\n * - CEL expressions (`cel\\`daysAgo(30)\\``) run **server-side** in the\n * formula engine. They are unrelated to these placeholders; see\n * `@objectstack/formula`.\n * - Token resolution semantics (week-start day, timezone, fiscal\n * calendars) are defined by the resolver implementation; spec only\n * freezes the **vocabulary**.\n */\n\n/** Single-point tokens — moments in time. */\nexport const DATE_MACRO_INSTANT_TOKENS = [\n 'today',\n 'yesterday',\n 'tomorrow',\n 'now',\n] as const;\n\n/** Period boundaries for the current/last/next week/month/quarter/year. */\nexport const DATE_MACRO_PERIOD_TOKENS = [\n 'current_week_start', 'current_week_end',\n 'current_month_start', 'current_month_end',\n 'current_quarter_start', 'current_quarter_end',\n 'current_year_start', 'current_year_end',\n\n 'last_week_start', 'last_week_end',\n 'last_month_start', 'last_month_end',\n 'last_quarter_start', 'last_quarter_end',\n 'last_year_start', 'last_year_end',\n\n 'next_week_start', 'next_week_end',\n 'next_month_start', 'next_month_end',\n 'next_quarter_start', 'next_quarter_end',\n 'next_year_start', 'next_year_end',\n] as const;\n\n/**\n * Bare aliases — `{week_start}` means `{current_week_start}`, etc.\n * Provided because every other major dashboard tool accepts them and\n * AI agents reach for them by default.\n */\nexport const DATE_MACRO_ALIAS_TOKENS = [\n 'week_start', 'week_end',\n 'month_start', 'month_end',\n 'quarter_start','quarter_end',\n 'year_start', 'year_end',\n] as const;\n\n/** All fixed tokens — concat of the three groups above. */\nexport const DATE_MACRO_TOKENS = [\n ...DATE_MACRO_INSTANT_TOKENS,\n ...DATE_MACRO_PERIOD_TOKENS,\n ...DATE_MACRO_ALIAS_TOKENS,\n] as const;\n\nexport type DateMacroToken = (typeof DATE_MACRO_TOKENS)[number];\n\n/**\n * Parameterised token grammar.\n *\n * {<N>_<unit>(s)?_<direction>}\n *\n * Examples that match:\n * - `30_days_ago`\n * - `1_day_ago`\n * - `90_days_from_now`\n * - `2_weeks_ago`\n * - `6_months_from_now`\n * - `1_year_ago`\n * - `15_minutes_ago`\n * - `2_hours_from_now`\n *\n * Capture groups: 1=N (string of digits), 2=unit (singular or plural,\n * no trailing `s` stripped), 3=direction (`ago` | `from_now`).\n */\nexport const DATE_MACRO_PARAM_RE =\n /^(\\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/;\n\n/**\n * Units recognised by the parameterised grammar. Listed here so the\n * resolver and any token-completion UI can share the source of truth.\n */\nexport const DATE_MACRO_UNITS = [\n 'minute', 'hour', 'day', 'week', 'month', 'year',\n] as const;\n\nexport type DateMacroUnit = (typeof DATE_MACRO_UNITS)[number];\nexport type DateMacroDirection = 'ago' | 'from_now';\n\nexport interface DateMacroParamMatch {\n readonly n: number;\n readonly unit: DateMacroUnit;\n readonly direction: DateMacroDirection;\n}\n\n/**\n * Test helper: return whether `token` (without braces) is a valid\n * date macro — either a fixed token or a parameterised one. Use\n * this in lint passes or AI-side validators.\n */\nexport function isDateMacroToken(token: string): boolean {\n return (\n (DATE_MACRO_TOKENS as readonly string[]).includes(token) ||\n DATE_MACRO_PARAM_RE.test(token)\n );\n}\n\n/** Parse a parameterised token. Returns null if the token isn't parameterised. */\nexport function parseDateMacroParam(token: string): DateMacroParamMatch | null {\n const m = token.match(DATE_MACRO_PARAM_RE);\n if (!m) return null;\n const unit = m[2].replace(/s$/, '') as DateMacroUnit;\n return {\n n: parseInt(m[1], 10),\n unit,\n direction: m[3] as DateMacroDirection,\n };\n}\n\n/**\n * Strict zod schema for the **token name** (the bit inside `{}`).\n * Accepts any fixed token or anything matching `DATE_MACRO_PARAM_RE`.\n */\nexport const DateMacroTokenSchema = z\n .string()\n .refine(isDateMacroToken, {\n message:\n 'Unknown date macro. Must be a fixed token (see DATE_MACRO_TOKENS) ' +\n 'or match {N_<unit>_(ago|from_now)} where unit is one of: ' +\n DATE_MACRO_UNITS.join(', '),\n });\n\n/**\n * Match the **wrapped** form, i.e. the literal a filter author writes:\n * `{today}` or `${30_days_ago}`. Used by lint passes that walk filter\n * trees looking for placeholder strings.\n */\nexport const DATE_MACRO_WRAPPED_RE = /^\\$?\\{([a-zA-Z0-9_]+)\\}$/;\n\n/**\n * Zod schema for a complete placeholder string (`'{today}'`,\n * `'${30_days_ago}'`). Use as an opt-in refinement on filter values\n * to fail loudly on unknown tokens instead of silently sending them\n * to SQL.\n */\nexport const DateMacroPlaceholderSchema = z\n .string()\n .refine(\n (s) => {\n const m = s.match(DATE_MACRO_WRAPPED_RE);\n return !!m && isDateMacroToken(m[1]);\n },\n { message: 'Not a recognised {date-macro} placeholder' },\n );\n\n/**\n * Description table — handy for skill / docs generation. Pure data,\n * intentionally not exported through any zod schema.\n */\nexport const DATE_MACRO_DESCRIPTIONS: Record<DateMacroToken, string> = {\n today: 'Start of today (YYYY-MM-DD).',\n yesterday:'Start of yesterday.',\n tomorrow: 'Start of tomorrow.',\n now: 'Current timestamp (full ISO).',\n\n current_week_start: 'Monday 00:00 of this week.',\n current_week_end: 'Sunday of this week.',\n current_month_start: '1st of this month.',\n current_month_end: 'Last day of this month.',\n current_quarter_start: '1st day of this quarter.',\n current_quarter_end: 'Last day of this quarter.',\n current_year_start: 'Jan 1 of this year.',\n current_year_end: 'Dec 31 of this year.',\n\n last_week_start: 'Monday of last week.',\n last_week_end: 'Sunday of last week.',\n last_month_start: '1st of last month.',\n last_month_end: 'Last day of last month.',\n last_quarter_start: '1st day of last quarter.',\n last_quarter_end: 'Last day of last quarter.',\n last_year_start: 'Jan 1 of last year.',\n last_year_end: 'Dec 31 of last year.',\n\n next_week_start: 'Monday of next week.',\n next_week_end: 'Sunday of next week.',\n next_month_start: '1st of next month.',\n next_month_end: 'Last day of next month.',\n next_quarter_start: '1st day of next quarter.',\n next_quarter_end: 'Last day of next quarter.',\n next_year_start: 'Jan 1 of next year.',\n next_year_end: 'Dec 31 of next year.',\n\n week_start: 'Alias for current_week_start.',\n week_end: 'Alias for current_week_end.',\n month_start: 'Alias for current_month_start.',\n month_end: 'Alias for current_month_end.',\n quarter_start: 'Alias for current_quarter_start.',\n quarter_end: 'Alias for current_quarter_end.',\n year_start: 'Alias for current_year_start.',\n year_end: 'Alias for current_year_end.',\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * System Identifier Schema\n * \n * Universal naming convention for all machine identifiers (API Names) in ObjectStack.\n * Enforces lowercase with underscores or dots to ensure:\n * - Cross-platform compatibility (case-insensitive filesystems)\n * - URL-friendliness (no encoding needed)\n * - Database consistency (no collation issues)\n * - Security (no case-sensitivity bugs in permission checks)\n * \n * **Applies to all metadata that acts as a machine identifier:**\n * - Object names (tables/collections)\n * - Field names\n * - Role names\n * - Permission set names\n * - Action/trigger names\n * - Event keys\n * - App IDs\n * - Menu/page IDs\n * - Select option values\n * - Workflow names\n * - Webhook names\n * \n * **Naming Convention Summary:**\n * | Type | Pattern | Example |\n * |------|---------|---------|\n * | Machine ID | snake_case | `crm_account`, `btn_submit`, `role_admin` |\n * | Event keys | dot.notation | `user.login`, `order.created` |\n * | Labels | Any case | `Client Account`, `Submit Form` |\n * \n * @example Valid identifiers\n * - 'account'\n * - 'crm_account'\n * - 'user_profile'\n * - 'order.created' (for events)\n * - 'api_v2_endpoint'\n * \n * @example Invalid identifiers (will be rejected)\n * - 'Account' (uppercase)\n * - 'CrmAccount' (camelCase)\n * - 'crm-account' (kebab-case - use underscore instead)\n * - 'user profile' (spaces)\n */\nimport { lazySchema } from './lazy-schema';\nexport const SystemIdentifierSchema = lazySchema(() => z\n .string()\n .min(2, { message: 'System identifier must be at least 2 characters' })\n .regex(/^[a-z][a-z0-9_.]*$/, {\n message:\n 'System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., \"user_profile\" or \"order.created\")',\n })\n .describe('System identifier (lowercase with underscores or dots)'));\n\n/**\n * Strict Snake Case Identifier\n * \n * More restrictive than SystemIdentifierSchema - only allows underscores (no dots).\n * Use this for identifiers that should NOT contain dots (e.g., database table/column names).\n * \n * @example Valid\n * - 'account'\n * - 'crm_account'\n * - 'user_profile'\n * \n * @example Invalid\n * - 'user.profile' (dots not allowed)\n * - 'UserProfile' (uppercase)\n */\nexport const SnakeCaseIdentifierSchema = lazySchema(() => z\n .string()\n .min(2, { message: 'Identifier must be at least 2 characters' })\n .regex(/^[a-z][a-z0-9_]*$/, {\n message:\n 'Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., \"user_profile\")',\n })\n .describe('Snake case identifier (lowercase with underscores only)'));\n\n/**\n * Event Name Identifier\n * \n * Specialized identifier for event names that encourages dot notation.\n * Used in event-driven systems, message queues, and webhooks.\n * \n * Pattern: `namespace.action` or `entity.event_type`\n * \n * @example Valid\n * - 'user.created'\n * - 'order.paid'\n * - 'user.login_success'\n * - 'alarm.high_cpu'\n * \n * @example Invalid\n * - 'UserCreated' (camelCase)\n * - 'user_created' (should use dots for namespacing)\n */\nexport const EventNameSchema = lazySchema(() => z\n .string()\n .min(3, { message: 'Event name must be at least 3 characters' })\n .regex(/^[a-z][a-z0-9_.]*$/, {\n message:\n 'Event name must be lowercase with dots for namespacing (e.g., \"user.created\", \"order.paid\")',\n })\n .describe('Event name (lowercase with dot notation for namespacing)'));\n\n/**\n * Type Exports\n */\nexport type SystemIdentifier = z.infer<typeof SystemIdentifierSchema>;\nexport type SnakeCaseIdentifier = z.infer<typeof SnakeCaseIdentifierSchema>;\nexport type EventName = z.infer<typeof EventNameSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * # Expression Protocol\n *\n * Canonical wire format for all \"expression\"-shaped metadata across ObjectStack\n * (formula fields, predicates, conditions, criteria, visibility rules, seed\n * dynamic values, …).\n *\n * The persisted form is `{ dialect, source }` (and, after `objectstack\n * compile` normalization, `{ dialect, ast }`). String-only shorthand is\n * accepted at *input* time for developer ergonomics; build emits the canonical\n * envelope.\n *\n * ## Dialects\n *\n * | dialect | engine | use |\n * |:---|:---|:---|\n * | `cel` | `@objectstack/formula` (cel-js + ObjectStack stdlib) | formulas, predicates, seed dynamic values |\n * | `js` | sandboxed L2 hook bodies (`isolated-vm` / `quickjs`) | mapping, hook bodies |\n * | `cron` | `cron-parser` | job schedules |\n *\n * SQL fragments (analytics joins, partial indexes) are intentionally **not**\n * routed through this schema — they stay driver-native because their security\n * posture and portability story differ.\n *\n * @see content/docs/concepts/north-star.mdx §8 \"No private expression DSL\"\n */\n\n/** Supported expression dialects. */\nexport const ExpressionDialect = z.enum(['cel', 'js', 'cron', 'template']);\nexport type ExpressionDialect = z.infer<typeof ExpressionDialect>;\n\n/**\n * Authorship metadata for an expression. Optional but encouraged for AI-\n * generated artifacts so audit/explanation tooling has something to render.\n */\nexport const ExpressionMetaSchema = z.object({\n /** Human-readable rationale (often AI-emitted). */\n rationale: z.string().optional(),\n /** Identifier of the agent / tool that produced this expression. */\n generatedBy: z.string().optional(),\n});\nexport type ExpressionMeta = z.infer<typeof ExpressionMetaSchema>;\n\n/**\n * Canonical Expression envelope.\n *\n * Phase 1 (M9.1): `source` is the canonical persisted form. `ast` is reserved\n * and accepted as opaque structured value — `objectstack compile` will fill it\n * in M9.2 with the engine's parsed AST so the artifact carries an AST-only\n * representation.\n *\n * Phase 2 (M9.2+): `ast` becomes required in build output; `source` is kept\n * only for round-trip / debug.\n */\nexport const ExpressionSchema = z.object({\n /** Which engine evaluates `source` / `ast`. */\n dialect: ExpressionDialect,\n /** Surface syntax. Required while `ast` is not yet populated. */\n source: z.string().min(1).optional(),\n /**\n * Engine-native AST. Opaque at the spec layer; each engine validates its own\n * shape. For `dialect: 'cel'` this is the cel-js parsed AST node.\n */\n ast: z.unknown().optional(),\n /** Optional authorship metadata. */\n meta: ExpressionMetaSchema.optional(),\n}).refine(e => e.source !== undefined || e.ast !== undefined, {\n message: 'Expression requires at least one of `source` or `ast`',\n});\nexport type Expression = z.infer<typeof ExpressionSchema>;\n\n/**\n * Author-time input shape: a bare string is shorthand for `{ dialect: 'cel',\n * source }`. Engines that need other dialects must use the full envelope.\n *\n * Build (`objectstack compile`) normalizes this union to `Expression` so the\n * persisted artifact never contains the bare-string form.\n */\nexport const ExpressionInputSchema = z.union([\n z.string().min(1).transform((source): Expression => ({ dialect: 'cel', source })),\n ExpressionSchema,\n]);\nexport type ExpressionInput = z.input<typeof ExpressionInputSchema>;\n\n/**\n * Cron-typed input shape: a bare string is shorthand for `{ dialect: 'cron',\n * source }` (not `cel`). Use this for `schedule` / `cronExpression` fields so\n * authors can write `'0 9 * * 1-5'` without manually wrapping.\n */\nexport const CronExpressionInputSchema = z.union([\n z.string().min(1).transform((source): Expression => ({ dialect: 'cron', source })),\n ExpressionSchema,\n]);\nexport type CronExpressionInput = z.input<typeof CronExpressionInputSchema>;\n\n/**\n * Template-typed input shape: a bare string is shorthand for\n * `{ dialect: 'template', source }`. Use this for notification subjects/bodies,\n * titleFormat, prompt templates — anything with `{{var}}` interpolation.\n */\nexport const TemplateExpressionInputSchema = z.union([\n z.string().min(1).transform((source): Expression => ({ dialect: 'template', source })),\n ExpressionSchema,\n]);\nexport type TemplateExpressionInput = z.input<typeof TemplateExpressionInputSchema>;\n\n/**\n * Predicate — an Expression whose evaluation is expected to be boolean.\n * Spec layer cannot enforce return type at parse time; this alias exists for\n * intent documentation and future runtime type-check wiring.\n */\nexport const PredicateSchema = ExpressionSchema;\nexport type Predicate = z.infer<typeof PredicateSchema>;\n\nexport const PredicateInputSchema = ExpressionInputSchema;\nexport type PredicateInput = z.input<typeof PredicateInputSchema>;\n\n/**\n * Construct an Expression literal from a CEL source string. Used by DX\n * shorthand (`cel\\`...\\``) and by codegen tools.\n */\nexport function expression(source: string, dialect: ExpressionDialect = 'cel', meta?: ExpressionMeta): Expression {\n return { dialect, source, ...(meta ? { meta } : {}) };\n}\n\n/**\n * Tagged-template helpers for inline expression authoring.\n *\n * ```ts\n * import { cel, F, P } from '@objectstack/spec';\n *\n * const f = { formula: F`record.amount * 0.1` };\n * const v = { visible: P`record.status == \"open\"` };\n * const d = { close_date: cel`now() + duration(\"P30D\")` };\n * ```\n *\n * Each helper produces an {@link Expression} envelope with `dialect: 'cel'`\n * and the rendered template string as `source`. The CLI `objectstack compile`\n * step (M9.2) parses these into ASTs at build time so the persisted artifact\n * is dialect-AST only.\n */\nfunction renderTemplate(strings: TemplateStringsArray, values: readonly unknown[]): string {\n if (values.length === 0) return strings[0] ?? '';\n let out = strings[0] ?? '';\n for (let i = 0; i < values.length; i++) {\n const v = values[i];\n // Inline literal substitution. Strings get JSON-escaped so `${name}` for\n // `name = 'O\\'Brien'` produces a valid CEL string literal. Numbers and\n // booleans render as their toString. Anything exotic should be passed via\n // the variable scope (record/input) rather than interpolated.\n if (typeof v === 'string') out += JSON.stringify(v);\n else if (typeof v === 'number' || typeof v === 'boolean') out += String(v);\n else if (v === null || v === undefined) out += 'null';\n else out += JSON.stringify(v);\n out += strings[i + 1] ?? '';\n }\n return out;\n}\n\n/** Tagged template — produces a CEL Expression envelope. */\nexport function cel(strings: TemplateStringsArray, ...values: unknown[]): Expression {\n return { dialect: 'cel', source: renderTemplate(strings, values) };\n}\n\n/** Formula alias of {@link cel} — semantic shorthand for computed-field formulas. */\nexport const F = cel;\n\n/** Predicate alias of {@link cel} — semantic shorthand for boolean conditions. */\nexport const P = cel;\n\n/**\n * Tagged template — produces a Mustache-template Expression envelope. Use for\n * notification subjects, prompt bodies, titleFormat strings, etc. Variable\n * scope is the same as CEL (`{{record.x}}`, `{{os.user.id}}`).\n */\nexport function tmpl(strings: TemplateStringsArray, ...values: unknown[]): Expression {\n // Templates do not get JSON.stringify on substitution — interpolation happens\n // at evaluate time via `{{path}}` markers, so we keep raw substitutions here.\n let out = strings[0] ?? '';\n for (let i = 0; i < values.length; i++) {\n out += String(values[i]);\n out += strings[i + 1] ?? '';\n }\n return { dialect: 'template', source: out };\n}\n\n/** Tagged template — produces a cron Expression envelope. */\nexport function cron(strings: TemplateStringsArray, ...values: unknown[]): Expression {\n let out = strings[0] ?? '';\n for (let i = 0; i < values.length; i++) {\n out += String(values[i]);\n out += strings[i + 1] ?? '';\n }\n return { dialect: 'cron', source: out };\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { SystemIdentifierSchema } from '../shared/identifiers.zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\n\n/**\n * Field Type Enum\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const FieldType = z.enum([\n // Core Text\n 'text', 'textarea', 'email', 'url', 'phone', 'password',\n // Secret — reversible, encrypted-at-rest value (DB password, API key, token).\n // UNLIKE 'password' (a one-way hash owned by the auth subsystem), a 'secret'\n // is round-tripped: the engine encrypts it on write via the registered\n // ICryptoProvider, stores the ciphertext handle in `sys_secret`, persists only\n // an opaque ref on the row, and masks it on read. Fail-closed: no provider ⇒\n // writes throw rather than persist cleartext. See ADR (secret field channel).\n 'secret',\n // Rich Content\n 'markdown', 'html', 'richtext',\n // Numbers\n 'number', 'currency', 'percent', \n // Date & Time\n 'date', 'datetime', 'time',\n // Logic\n 'boolean', 'toggle', // Toggle is a distinct UI from checkbox\n // Selection\n 'select', // Single select dropdown\n 'multiselect', // Multi select (often tags)\n 'radio', // Radio group\n 'checkboxes', // Checkbox group\n // Relational\n 'lookup', 'master_detail', // Dynamic reference\n 'tree', // Hierarchical reference\n // User reference — a lookup specialized to the `sys_user` system object (person\n // picker; single, or multiple for collaborators/watchers). Stored IDENTICALLY to\n // 'lookup' (FK string column → sys_user.id; `multiple` ⇒ JSON) and resolved via the\n // same $expand machinery. The distinct type exists for modelling discoverability\n // (Studio/AI field palette), the user-search picker, and `current_user` defaults —\n // NOT a separate storage primitive. Ownership stays the existing `owner_id`\n // convention (plugin-security); a declarative `owner` is a possible future flag.\n 'user',\n // Media\n 'image', 'file', 'avatar', 'video', 'audio',\n // Calculated / System\n 'formula', 'summary', 'autonumber',\n // Embedded structured values (stored as JSON on the parent row — no separate table / FK)\n 'composite', // Single embedded sub-object with declared sub-fields (≈ Strapi component / ACF group)\n 'repeater', // Repeating embedded sub-object array with declared sub-fields (≈ Strapi repeatable component / ACF repeater)\n 'record', // Name-keyed map of embedded sub-objects (Record<string, SubObject>). Insertion order = display order. Used for collections where each item has a stable machine name (e.g. object.fields). See ADR-0007.\n // Enhanced Types\n 'location', // GPS coordinates\n 'address', // Structured address\n 'code', // Code editor (JSON/SQL/JS)\n 'json', // Structured JSON data (untyped escape hatch)\n 'color', // Color picker\n 'rating', // Star rating\n 'slider', // Numeric slider\n 'signature', // Digital signature\n 'qrcode', // QR code / Barcode\n 'progress', // Progress bar\n 'tags', // Simple tag list\n // AI/ML Types\n 'vector', // Vector embeddings for AI/ML (semantic search, RAG)\n]);\n\nexport type FieldType = z.infer<typeof FieldType>;\n\n/**\n * Select Option Schema\n * \n * Defines option values for select/picklist fields.\n * \n * **CRITICAL RULE**: The `value` field is a machine identifier that gets stored in the database.\n * It MUST be lowercase to avoid case-sensitivity issues in queries and comparisons.\n * \n * @example Good\n * { label: 'New', value: 'new' }\n * { label: 'In Progress', value: 'in_progress' }\n * { label: 'Closed Won', value: 'closed_won' }\n * \n * @example Bad (will be rejected)\n * { label: 'New', value: 'New' } // uppercase\n * { label: 'In Progress', value: 'In Progress' } // spaces and uppercase\n * { label: 'Closed Won', value: 'Closed_Won' } // mixed case\n */\nexport const SelectOptionSchema = lazySchema(() => z.object({\n label: z.string().describe('Display label (human-readable, any case allowed)'),\n value: SystemIdentifierSchema.describe('Stored value (lowercase machine identifier)'),\n color: z.string().optional().describe('Color code for badges/charts'),\n default: z.boolean().optional().describe('Is default option'),\n /**\n * Per-option visibility predicate (CEL) — the option is offered only when this\n * evaluates TRUE. Omit = always available. Evaluated against the SAME binding\n * environment as field-level `visibleWhen` (live `record` + `current_user`), so\n * it expresses BOTH cascading/dependent options (`record.country == 'cn'`) AND\n * role/context gating (`'admin' in current_user.roles`). When it references\n * sibling fields, declare those on the field's `dependsOn` so the form can gate\n * and re-evaluate the option list as the parent changes.\n *\n * ⚠️ Client-side hiding is UX, not authorization. When an option is gated for\n * access-control reasons the server MUST also reject writes of its value (the\n * rule-validator evaluates the picked value's `visibleWhen`) — hiding it in the\n * dropdown alone is bypassable.\n */\n visibleWhen: ExpressionInputSchema.optional().describe(\"Per-option visibility predicate (CEL) — option is offered only when TRUE (else omitted). Same env as field visibleWhen (record + current_user). e.g. P`record.country == 'cn'` or P`'admin' in current_user.roles`\"),\n}));\n\n/**\n * Location Coordinates Schema\n * GPS coordinates for location field type\n */\nexport const LocationCoordinatesSchema = lazySchema(() => z.object({\n latitude: z.number().min(-90).max(90).describe('Latitude coordinate'),\n longitude: z.number().min(-180).max(180).describe('Longitude coordinate'),\n altitude: z.number().optional().describe('Altitude in meters'),\n accuracy: z.number().optional().describe('Accuracy in meters'),\n}));\n\n/**\n * Currency Configuration Schema\n * Configuration for currency field type supporting multi-currency\n * \n * Note: Currency codes are validated by length only (3 characters) to support:\n * - Standard ISO 4217 codes (USD, EUR, CNY, etc.)\n * - Cryptocurrency codes (BTC, ETH, etc.)\n * - Custom business-specific codes\n * Stricter validation can be implemented at the application layer based on business requirements.\n */\nexport const CurrencyConfigSchema = lazySchema(() => z.object({\n precision: z.number().int().min(0).max(10).default(2).describe('Decimal precision (default: 2)'),\n currencyMode: z.enum(['dynamic', 'fixed']).default('dynamic').describe('Currency mode: dynamic (user selectable) or fixed (single currency)'),\n defaultCurrency: z.string().length(3).default('CNY').describe('Default or fixed currency code (ISO 4217, e.g., USD, CNY, EUR)'),\n}));\n\n/**\n * Currency Value Schema\n * Runtime value structure for currency fields\n * \n * Note: Currency codes are validated by length only (3 characters) to support flexibility.\n * See CurrencyConfigSchema for details on currency code validation strategy.\n */\nexport const CurrencyValueSchema = lazySchema(() => z.object({\n value: z.number().describe('Monetary amount'),\n currency: z.string().length(3).describe('Currency code (ISO 4217)'),\n}));\n\n/**\n * Address Schema\n * Structured address for address field type\n */\nexport const AddressSchema = lazySchema(() => z.object({\n street: z.string().optional().describe('Street address'),\n city: z.string().optional().describe('City name'),\n state: z.string().optional().describe('State/Province'),\n postalCode: z.string().optional().describe('Postal/ZIP code'),\n country: z.string().optional().describe('Country name or code'),\n countryCode: z.string().optional().describe('ISO country code (e.g., US, GB)'),\n formatted: z.string().optional().describe('Formatted address string'),\n}));\n\n/**\n * Vector Configuration Schema\n * Configuration for vector field type supporting AI/ML embeddings\n * \n * Vector fields store numerical embeddings for semantic search, similarity matching,\n * and Retrieval-Augmented Generation (RAG) workflows.\n * \n * @example\n * // Text embeddings for semantic search\n * {\n * dimensions: 1536, // OpenAI text-embedding-ada-002\n * distanceMetric: 'cosine',\n * indexed: true\n * }\n * \n * @example\n * // Image embeddings with normalization\n * {\n * dimensions: 512, // ResNet-50\n * distanceMetric: 'euclidean',\n * normalized: true,\n * indexed: true\n * }\n */\nexport const VectorConfigSchema = lazySchema(() => z.object({\n dimensions: z.number().int().min(1).max(10000).describe('Vector dimensionality (e.g., 1536 for OpenAI embeddings)'),\n distanceMetric: z.enum(['cosine', 'euclidean', 'dotProduct', 'manhattan']).default('cosine').describe('Distance/similarity metric for vector search'),\n normalized: z.boolean().default(false).describe('Whether vectors are normalized (unit length)'),\n indexed: z.boolean().default(true).describe('Whether to create a vector index for fast similarity search'),\n indexType: z.enum(['hnsw', 'ivfflat', 'flat']).optional().describe('Vector index algorithm (HNSW for high accuracy, IVFFlat for large datasets)'),\n}));\n\n/**\n * File Attachment Configuration Schema\n * Configuration for file and attachment field types\n * \n * Provides comprehensive file upload capabilities with:\n * - File type restrictions (allowed/blocked)\n * - File size limits (min/max)\n * - Virus scanning integration\n * - Storage provider integration\n * - Image-specific features (dimensions, thumbnails)\n * \n * @example Basic file upload with size limit\n * {\n * maxSize: 10485760, // 10MB\n * allowedTypes: ['.pdf', '.docx', '.xlsx'],\n * virusScan: true\n * }\n * \n * @example Image upload with validation\n * {\n * maxSize: 5242880, // 5MB\n * allowedTypes: ['.jpg', '.jpeg', '.png', '.webp'],\n * imageValidation: {\n * maxWidth: 4096,\n * maxHeight: 4096,\n * generateThumbnails: true\n * }\n * }\n */\nexport const FileAttachmentConfigSchema = lazySchema(() => z.object({\n /** File Size Limits */\n minSize: z.number().min(0).optional().describe('Minimum file size in bytes'),\n maxSize: z.number().min(1).optional().describe('Maximum file size in bytes (e.g., 10485760 = 10MB)'),\n \n /** File Type Restrictions */\n allowedTypes: z.array(z.string()).optional().describe('Allowed file extensions (e.g., [\".pdf\", \".docx\", \".jpg\"])'),\n blockedTypes: z.array(z.string()).optional().describe('Blocked file extensions (e.g., [\".exe\", \".bat\", \".sh\"])'),\n allowedMimeTypes: z.array(z.string()).optional().describe('Allowed MIME types (e.g., [\"image/jpeg\", \"application/pdf\"])'),\n blockedMimeTypes: z.array(z.string()).optional().describe('Blocked MIME types'),\n \n /** Virus Scanning */\n virusScan: z.boolean().default(false).describe('Enable virus scanning for uploaded files'),\n virusScanProvider: z.enum(['clamav', 'virustotal', 'metadefender', 'custom']).optional().describe('Virus scanning service provider'),\n virusScanOnUpload: z.boolean().default(true).describe('Scan files immediately on upload'),\n quarantineOnThreat: z.boolean().default(true).describe('Quarantine files if threat detected'),\n \n /** Storage Configuration */\n storageProvider: z.string().optional().describe('Object storage provider name (references ObjectStorageConfig)'),\n storageBucket: z.string().optional().describe('Target bucket name'),\n storagePrefix: z.string().optional().describe('Storage path prefix (e.g., \"uploads/documents/\")'),\n \n /** Image-Specific Validation */\n imageValidation: z.object({\n minWidth: z.number().min(1).optional().describe('Minimum image width in pixels'),\n maxWidth: z.number().min(1).optional().describe('Maximum image width in pixels'),\n minHeight: z.number().min(1).optional().describe('Minimum image height in pixels'),\n maxHeight: z.number().min(1).optional().describe('Maximum image height in pixels'),\n aspectRatio: z.string().optional().describe('Required aspect ratio (e.g., \"16:9\", \"1:1\")'),\n generateThumbnails: z.boolean().default(false).describe('Auto-generate thumbnails'),\n thumbnailSizes: z.array(z.object({\n name: z.string().describe('Thumbnail variant name (e.g., \"small\", \"medium\", \"large\")'),\n width: z.number().min(1).describe('Thumbnail width in pixels'),\n height: z.number().min(1).describe('Thumbnail height in pixels'),\n crop: z.boolean().default(false).describe('Crop to exact dimensions'),\n })).optional().describe('Thumbnail size configurations'),\n preserveMetadata: z.boolean().default(false).describe('Preserve EXIF metadata'),\n autoRotate: z.boolean().default(true).describe('Auto-rotate based on EXIF orientation'),\n }).optional().describe('Image-specific validation rules'),\n \n /** Upload Behavior */\n allowMultiple: z.boolean().default(false).describe('Allow multiple file uploads (overrides field.multiple)'),\n allowReplace: z.boolean().default(true).describe('Allow replacing existing files'),\n allowDelete: z.boolean().default(true).describe('Allow deleting uploaded files'),\n requireUpload: z.boolean().default(false).describe('Require at least one file when field is required'),\n \n /** Metadata Extraction */\n extractMetadata: z.boolean().default(true).describe('Extract file metadata (name, size, type, etc.)'),\n extractText: z.boolean().default(false).describe('Extract text content from documents (OCR/parsing)'),\n \n /** Versioning */\n versioningEnabled: z.boolean().default(false).describe('Keep previous versions of replaced files'),\n maxVersions: z.number().min(1).optional().describe('Maximum number of versions to retain'),\n \n /** Access Control */\n publicRead: z.boolean().default(false).describe('Allow public read access to uploaded files'),\n presignedUrlExpiry: z.number().min(60).max(604800).default(3600).describe('Presigned URL expiration in seconds (default: 1 hour)'),\n}).refine((data) => {\n // Validate minSize is less than or equal to maxSize\n if (data.minSize !== undefined && data.maxSize !== undefined && data.minSize > data.maxSize) {\n return false;\n }\n return true;\n}, {\n message: 'minSize must be less than or equal to maxSize',\n}).refine((data) => {\n // Validate virusScanProvider requires virusScan to be enabled\n if (data.virusScanProvider !== undefined && data.virusScan !== true) {\n return false;\n }\n return true;\n}, {\n message: 'virusScanProvider requires virusScan to be enabled',\n}));\n\n/**\n * Data Quality Rules Schema\n * Defines data quality validation and monitoring for fields\n * \n * @example Unique SSN field with completeness requirement\n * {\n * uniqueness: true,\n * completeness: 0.95, // 95% of records must have this field\n * accuracy: {\n * source: 'government_db',\n * threshold: 0.98\n * }\n * }\n */\nexport const DataQualityRulesSchema = lazySchema(() => z.object({\n /** Enforce uniqueness constraint */\n uniqueness: z.boolean().default(false).describe('Enforce unique values across all records'),\n \n /** Completeness ratio (0-1) indicating minimum percentage of non-null values */\n completeness: z.number().min(0).max(1).default(0).describe('Minimum ratio of non-null values (0-1, default: 0 = no requirement)'),\n \n /** Accuracy validation against authoritative source */\n accuracy: z.object({\n source: z.string().describe('Reference data source for validation (e.g., \"api.verify.com\", \"master_data\")'),\n threshold: z.number().min(0).max(1).describe('Minimum accuracy threshold (0-1, e.g., 0.95 = 95% match required)'),\n }).optional().describe('Accuracy validation configuration'),\n}));\n\n/**\n * Computed Field Caching Schema\n * Configuration for caching computed/formula field results\n * \n * @example Cache product price with 1-hour TTL, invalidate on inventory changes\n * {\n * enabled: true,\n * ttl: 3600,\n * invalidateOn: ['inventory.quantity', 'pricing.discount']\n * }\n */\nexport const ComputedFieldCacheSchema = lazySchema(() => z.object({\n /** Enable caching for this computed field */\n enabled: z.boolean().describe('Enable caching for computed field results'),\n \n /** Time-to-live in seconds */\n ttl: z.number().min(0).describe('Cache TTL in seconds (0 = no expiration)'),\n \n /** Array of field paths that trigger cache invalidation when changed */\n invalidateOn: z.array(z.string()).describe('Field paths that invalidate cache (e.g., [\"inventory.quantity\", \"pricing.base_price\"])'),\n}));\n\n/**\n * Field Schema - Best Practice Enterprise Pattern\n */\n/**\n * Field Definition Schema\n * Defines the properties, type, and behavior of a single field (column) on an object.\n * \n * @example Lookup Field\n * {\n * name: \"account_id\",\n * label: \"Account\",\n * type: \"lookup\",\n * reference: \"accounts\",\n * required: true\n * }\n * \n * @example Select Field\n * {\n * name: \"status\",\n * label: \"Status\",\n * type: \"select\",\n * options: [\n * { label: \"Open\", value: \"open\" },\n * { label: \"Closed\", value: \"closed\" }\n * ],\n * defaultValue: \"open\"\n * }\n */\nexport const FieldSchema = lazySchema(() => z.object({\n /** Identity */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine name (snake_case)').optional(),\n label: z.string().optional().describe('Human readable label'),\n type: FieldType.describe('Field Data Type'),\n description: z.string().optional().describe('Tooltip/Help text'),\n format: z.string().optional().describe('Format string (e.g. email, phone)'),\n\n /** Storage Layer Mapping */\n columnName: z.string().optional().describe('Physical column name in the target datasource. Defaults to the field key when not set.'),\n\n /** Database Constraints */\n required: z.boolean().default(false).describe('Is required'),\n searchable: z.boolean().default(false).describe('Is searchable'),\n multiple: z.boolean().default(false).describe('Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image.'),\n unique: z.boolean().default(false).describe('Is unique constraint'),\n defaultValue: z.unknown().optional().describe('Default value'),\n \n /** Text/String Constraints */\n maxLength: z.number().optional().describe('Max character length'),\n minLength: z.number().optional().describe('Min character length'),\n \n /** Number Constraints */\n precision: z.number().optional().describe('Total digits'),\n scale: z.number().optional().describe('Decimal places'),\n min: z.number().optional().describe('Minimum value'),\n max: z.number().optional().describe('Maximum value'),\n\n /** Selection Options */\n options: z.array(SelectOptionSchema).optional().describe('Static options for select/multiselect'),\n\n /**\n * Relationship Config\n * \n * Used by `lookup` and `master_detail` field types to define cross-object references.\n * The `reference` property is **required** for these types — it identifies the target\n * object whose records this field links to. The engine uses `reference` during $expand\n * post-processing to resolve foreign key IDs into full related objects via batch queries.\n * \n * For `master_detail` fields, the parent record controls the lifecycle of child records\n * (e.g., cascade delete). For `lookup` fields, the reference is a soft link.\n */\n reference: z.string().optional().describe(\n 'Target object name (snake_case) for lookup/master_detail fields. '\n + 'Required for relationship types. Used by $expand to resolve foreign key IDs into full objects.'\n ),\n referenceFilters: z.array(z.string()).optional().describe('Filters applied to lookup dialogs (e.g. \"active = true\")'),\n deleteBehavior: z.enum(['set_null', 'cascade', 'restrict']).optional().default('set_null').describe('What happens if referenced record is deleted'),\n /**\n * Master-detail INLINE EDITING. On a child's `master_detail`/`lookup` field\n * (whose `reference` is the parent object), declare that \"this child is\n * entered/edited inline within the parent's form\". The parent's standard\n * create/edit form then renders the children and saves parent + children in\n * ONE atomic transaction — no form view config and no bespoke page. The intent\n * lives here in the data model; forms derive the UI.\n *\n * The value also selects the EDITING FORM FACTOR:\n * - `true` → auto: the UI picks `grid` or `form` from the child's shape\n * (rich types / many fields → `form`, else `grid`).\n * - `'grid'` → an editable line-item grid (fast bulk entry; thin children\n * like invoice lines / order items).\n * - `'form'` → a compact read-only list; \"Add\" / per-row edit opens the\n * child's FULL form (fat children with rich types, e.g. long\n * text, attachments, many fields).\n * Use for true line-item/composition children; leave off for associations\n * (comments, attachments) — surface those as detail-page related lists.\n */\n inlineEdit: z.union([z.boolean(), z.enum(['grid', 'form'])]).optional().describe('Edit these child records inline within the parent\\'s form (atomic master-detail). true = auto-pick grid/form by child shape; \\'grid\\' = editable line-item grid; \\'form\\' = list + per-row full form.'),\n /** Optional section title for the inline grid (defaults to the child object label). */\n inlineTitle: z.string().optional().describe('Title for the inline master-detail grid'),\n /** Optional explicit grid columns for the inline editor (derived from the child object when omitted). */\n inlineColumns: z.array(z.any()).optional().describe('Explicit columns for the inline grid (derived from the child object when omitted)'),\n /** Optional numeric child field summed for the inline grid running total. */\n inlineAmountField: z.string().optional().describe('Numeric child field summed for the inline grid total'),\n\n /**\n * Detail-page RELATED LIST — the read-side mirror of `inlineEdit`. On a\n * child's `master_detail`/`lookup` field (whose `reference` is the parent),\n * this governs whether/how the child collection appears as a related list on\n * the parent's record DETAIL page. Owned children (`master_detail`) and\n * `lookup` children are shown by default (derived from the relationship);\n * set `relatedList: false` to suppress a child from the detail page (e.g.\n * noisy audit/association links you don't want surfaced). Where `inlineEdit`\n * pulls a child INTO the parent's entry form (write side), `relatedList`\n * controls its appearance on the parent's detail page (read side). The intent\n * lives here in the data model; the detail page derives the UI.\n *\n * Tri-state (ADR-0085 semantic-role style — this is a PROMINENCE hint, NOT a\n * layout switch):\n * - `false` → suppress this child from the parent's detail page.\n * - `true` / absent → shown; stacks with the other non-primary children\n * under a single shared \"Related\" tab. Only `'primary'`\n * earns its own tab — there is no count-based auto-split.\n * - `'primary'` → CORE relationship: always surfaced prominently. The\n * detail renderer promotes it to its own tab regardless\n * of child count. This states business intent (true\n * across every surface — detail tab, mobile card, AI\n * summary, search facet); \"primary → own tab\" is only\n * the DETAIL renderer's interpretation. Being prominence\n * (not a `relatedLayout` switch) is what admits it to the\n * object model under ADR-0085's admission test.\n */\n relatedList: z.union([z.boolean(), z.literal('primary')]).optional().describe('Show this child collection as a related list on the parent\\'s detail page (read-side mirror of inlineEdit). false = suppress; true/absent = shown (stacked under the shared \"Related\" tab); \\'primary\\' = core relationship, promoted to its own tab. Prominence intent, not a layout switch (ADR-0085).'),\n /** Optional section title for the detail-page related list (defaults to the child object label). */\n relatedListTitle: z.string().optional().describe('Title for the detail-page related list'),\n /** Optional explicit columns for the detail-page related list (derived from the child object when omitted). */\n relatedListColumns: z.array(z.any()).optional().describe('Explicit columns for the detail-page related list (derived from the child object when omitted)'),\n\n /**\n * LOOKUP PICKER (forward) config — how THIS lookup/master_detail field's\n * record picker presents and scopes candidate records when the user selects a\n * related record. Read-side mirror is relatedList* (the PARENT's detail-page\n * list of children); these configure the CHILD-side picker that chooses the\n * parent. All optional: the renderer auto-derives a sensible multi-column\n * result from the referenced object's schema when omitted (objectui\n * packages/fields: LookupField / RecordPickerDialog / deriveLookupColumns,\n * which read both these camelCase keys and their snake_case aliases).\n */\n displayField: z.string().optional().describe(\"Field shown as each candidate's label in the picker/popover (defaults to the referenced object's name/title).\"),\n descriptionField: z.string().optional().describe('Secondary field shown under the label in the quick-select popover.'),\n lookupColumns: z.array(z.union([z.string(), z.object({\n field: z.string(),\n label: z.string().optional(),\n width: z.string().optional(),\n type: z.string().optional(),\n })])).optional().describe('Explicit columns for the record-picker table; auto-derived from the referenced object when omitted.'),\n lookupPageSize: z.number().int().positive().optional().describe('Rows per page in the record-picker dialog (default 10).'),\n lookupFilters: z.array(z.object({\n field: z.string(),\n operator: z.enum(['eq', 'ne', 'gt', 'lt', 'gte', 'lte', 'contains', 'in', 'notIn']),\n value: z.any(),\n })).optional().describe('Base filters restricting which records are selectable (e.g. only active). Structured, picker-honoured form of referenceFilters.'),\n dependsOn: z.array(z.union([z.string(), z.object({\n field: z.string(),\n param: z.string().optional(),\n })])).optional().describe(\"Declares that this field's available values depend on the value of other field(s) on the same record — the form gates the field until they are set and re-evaluates as they change. For `lookup`/`master_detail` it scopes the candidate query (string = same local/remote key; {field,param} when the remote filter key differs — the {field,param} form is lookup-only). For `select`/`multiselect`/`radio` the actual per-option rule lives in each option's `visibleWhen`; list the referenced fields here (string form) so the option list gates and refreshes with the parent.\"),\n allowCreate: z.boolean().optional().describe('Allow inline quick-create from the record picker: when no match exists the user can create a record from the typed text (optimistic dataSource.create with the display field). Best for simple objects whose only required field is the display field.'),\n\n /** Calculation — CEL formula. Plain string accepted for back-compat; build emits canonical envelope. */\n expression: ExpressionInputSchema.optional().describe('Formula expression (CEL). e.g. F`record.amount * 0.1`'),\n /**\n * The value type a `formula` field computes, declared at authoring (the way\n * Salesforce/Airtable carry a formula's result type). Lets consumers — dataset\n * measures, display formatting, validation — read a declared type instead of\n * re-parsing the expression. Authoring stamps it from the inferred CEL type;\n * absent when the type can't be proven (an ambiguous/`dyn` expression).\n */\n returnType: z.enum(['number', 'text', 'boolean', 'date']).optional()\n .describe('Inferred value type of a formula field (number/text/boolean/date)'),\n summaryOperations: z.object({\n object: z.string().describe('Source child object name for roll-up'),\n field: z.string().describe('Field on child object to aggregate (ignored for count)'),\n function: z.enum(['count', 'sum', 'min', 'max', 'avg']).describe('Aggregation function to apply'),\n relationshipField: z.string().optional().describe('FK field on the child pointing back to this parent. Auto-detected from the child\\'s lookup/master_detail field referencing this object when omitted; set explicitly only when the child has more than one such reference.'),\n }).optional().describe('Roll-up summary definition. The engine recomputes the value when child records are inserted/updated/deleted.'),\n\n /** Enhanced Field Type Configurations */\n // Pruned 2026-06 — per-type *display* knobs that were dead in both layers (no\n // runtime reader; renderers ignore them). See\n // docs/audits/2026-06-dead-surface-disposition-plan.md (P2 field prune): code\n // theme/lineNumbers, rating allowHalf, location displayMap/allowGeocoding, address\n // addressFormat, color colorFormat/allowAlpha/presetColors, slider showValue/marks,\n // barcode/qr barcodeFormat/qrErrorCorrection/displayValue/allowScanning.\n language: z.string().optional().describe('Programming language for syntax highlighting (e.g., javascript, python, sql)'),\n step: z.number().optional().describe('Step increment for slider (default: 1)'),\n\n // Currency field config\n currencyConfig: CurrencyConfigSchema.optional().describe('Configuration for currency field type'),\n\n // Vector field — flat dimensionality (the live authoring path).\n // The renderer reads this flat sibling (objectui VectorField.tsx:11); the\n // nested `vectorConfig` below is retained for back-compat but is a runtime\n // no-op (no vector-index DDL consumes it).\n dimensions: z.number().int().min(1).max(10000).optional().describe('Vector dimensionality (e.g., 1536 for OpenAI embeddings)'),\n\n // Vector field config (DEAD — kept for back-compat; set the flat `dimensions` sibling instead)\n vectorConfig: VectorConfigSchema.optional().describe('Configuration for vector field type (AI/ML embeddings)'),\n\n // File attachment field config\n fileAttachmentConfig: FileAttachmentConfigSchema.optional().describe('Configuration for file and attachment field types'),\n\n /**\n * Track this field's value changes on the record **activity timeline**. When\n * TRUE, the platform's activity writer renders each change as a human-readable\n * entry (\"<label>: <old> → <new>\") instead of a generic \"Updated <object>\"\n * row — no app code required. Opt-in per field (cf. Salesforce Feed Tracking,\n * ServiceNow field auditing, Dataverse column auditing). The writer already\n * captures the field diff; this flag controls whether it is surfaced legibly.\n *\n * Unlike the pruned `auditTrail` below, this flag HAS a runtime consumer\n * (`@objectstack/plugin-audit` audit-writers), satisfying enforce-or-remove\n * (ADR-0049). See ADR-0052 §5b.\n */\n trackHistory: z.boolean().optional().describe(\"Render this field's value changes as human-readable entries on the record activity timeline (ADR-0052 §5b). Opt-in per field.\"),\n\n // Pruned 2026-06 (dead in both layers — aspirational governance with no runtime\n // consumer; encryption/masking implied at-rest protection that never happened —\n // the real channel is type:'secret'). See\n // docs/audits/2026-06-dead-surface-disposition-plan.md (P0/P2 field prune):\n // encryptionConfig, maskingRule, auditTrail, cached, dataQuality.\n\n /** Field Dependencies & Relationships */\n dependencies: z.array(z.string()).optional().describe('Array of field names that this field depends on (for formulas, visibility rules, etc.)'),\n\n /** Layout & Grouping */\n group: z.string().optional().describe('Field group name for organizing fields in forms and layouts (e.g., \"contact_info\", \"billing\", \"system\")'),\n\n /**\n * Conditional field rules (CEL predicates over `record`). Evaluated on BOTH\n * sides: the client form toggles the field's visibility / read-only / required\n * state live as the record changes (UX), and the server enforces\n * `requiredWhen` and ignores writes to a field whose `readonlyWhen` is TRUE\n * (so the rule can't be bypassed). e.g. `P\\`record.status == 'paid'\\``.\n */\n visibleWhen: ExpressionInputSchema.optional().describe(\"Predicate (CEL) — field is shown only when TRUE (else hidden). e.g. P`record.type == 'invoice'`\"),\n readonlyWhen: ExpressionInputSchema.optional().describe(\"Predicate (CEL) — field is read-only when TRUE. e.g. P`record.status == 'paid'`\"),\n requiredWhen: ExpressionInputSchema.optional().describe(\"Predicate (CEL) — field is required when TRUE. Canonical name for `conditionalRequired`.\"),\n\n /** Conditional Requirements\n * @deprecated Alias of `requiredWhen` — kept for back-compat. */\n conditionalRequired: ExpressionInputSchema.optional().describe('Predicate (CEL) — field is required when TRUE. Alias of `requiredWhen`.'),\n\n /** Security & Visibility */\n hidden: z.boolean().default(false).describe('Hidden from default UI'),\n readonly: z.boolean().default(false).describe('Read-only in UI'),\n\n /**\n * [ADR-0066 D3] Capabilities required to READ/EDIT this field. A field\n * declaring `requiredPermissions` is masked on read and denied on write unless\n * the caller holds ALL listed capabilities — an AND-gate that is strictest-wins\n * over permission-set field grants. Enforced by plugin-security's FieldMasker.\n */\n requiredPermissions: z.array(z.string()).optional().describe('[ADR-0066 D3] Capabilities required to read/edit this field (mask on read, deny on write; AND-gate).'),\n system: z.boolean().optional().describe('Auto-injected system/audit field (e.g. created_at, updated_by, organization_id). Tools that surface system fields separately from author-declared business fields should branch on this flag.'),\n sortable: z.boolean().optional().default(true).describe('Whether field is sortable in list views'),\n inlineHelpText: z.string().optional().describe('Help text displayed below the field in forms'),\n /**\n * Auto-number display format. Literal text interleaved with `{...}` tokens:\n *\n * - `{0000}` — the sequence counter, zero-padded to that many digits as a\n * MINIMUM width (at most one slot; omit it and the bare number is\n * appended). Past that width the number simply grows — it never wraps.\n * - `{YYYY} {YY} {MM} {DD} {YYYYMMDD}` — generation date in the request's\n * business timezone (`ExecutionContext.timezone`, ADR-0053; UTC fallback).\n * - `{field_name}` — the value of another field on the SAME record\n * (e.g. `{island_zone}`, `{plan_no}`), interpolated as text.\n *\n * The counter is scoped to whatever renders BEFORE the `{0000}` slot, so the\n * period/group resets fall out automatically — no separate reset config:\n * - `AD{YYYYMMDD}{0000}` → `AD202606170032` (resets each day)\n * - `{section}{island_zone}{000}` → `JYG1A001` (per island)\n * - `{plan_no}{000}` → `…PROD20260617001001` (per parent record)\n * A fixed-prefix format with no date/field token (e.g. `CASE-{0000}`) keeps a\n * single global counter — fully backward compatible.\n *\n * A `{field}` token must name an EXISTING field that is SET before the record\n * is created (mark it `required: true`). An empty interpolated field would\n * collapse the number into the wrong counter scope, so generation throws\n * instead; `objectstack compile` lints this (unknown field → build error,\n * optional field → warning).\n */\n autonumberFormat: z.string().optional().describe('Auto-number format: literal text + {0000} counter, {YYYY}/{MM}/{DD}/{YYYYMMDD} date tokens (business tz), and {field_name} interpolation. Counter resets per rendered prefix (e.g. AD{YYYYMMDD}{0000} resets daily).'),\n /** Indexing */\n index: z.boolean().default(false).describe('Create standard database index'),\n externalId: z.boolean().default(false).describe('Is external ID for upsert operations'),\n}));\n\nexport type Field = z.infer<typeof FieldSchema>;\nexport type SelectOption = z.infer<typeof SelectOptionSchema>;\nexport type LocationCoordinates = z.infer<typeof LocationCoordinatesSchema>;\nexport type Address = z.infer<typeof AddressSchema>;\nexport type CurrencyConfig = z.infer<typeof CurrencyConfigSchema>;\nexport type CurrencyConfigInput = z.input<typeof CurrencyConfigSchema>;\nexport type CurrencyValue = z.infer<typeof CurrencyValueSchema>;\nexport type VectorConfig = z.infer<typeof VectorConfigSchema>;\nexport type VectorConfigInput = z.input<typeof VectorConfigSchema>;\nexport type FileAttachmentConfig = z.infer<typeof FileAttachmentConfigSchema>;\nexport type FileAttachmentConfigInput = z.input<typeof FileAttachmentConfigSchema>;\nexport type DataQualityRules = z.infer<typeof DataQualityRulesSchema>;\nexport type DataQualityRulesInput = z.input<typeof DataQualityRulesSchema>;\nexport type ComputedFieldCache = z.infer<typeof ComputedFieldCacheSchema>;\n\n/**\n * Field Factory Helper\n */\nexport type FieldInput = Omit<Partial<Field>, 'type'>;\n\nexport const Field = {\n text: (config: FieldInput = {}) => ({ type: 'text', ...config } as const),\n textarea: (config: FieldInput = {}) => ({ type: 'textarea', ...config } as const),\n number: (config: FieldInput = {}) => ({ type: 'number', ...config } as const),\n boolean: (config: FieldInput = {}) => ({ type: 'boolean', ...config } as const),\n date: (config: FieldInput = {}) => ({ type: 'date', ...config } as const),\n datetime: (config: FieldInput = {}) => ({ type: 'datetime', ...config } as const),\n currency: (config: FieldInput = {}) => ({ type: 'currency', ...config } as const),\n percent: (config: FieldInput = {}) => ({ type: 'percent', ...config } as const),\n url: (config: FieldInput = {}) => ({ type: 'url', ...config } as const),\n email: (config: FieldInput = {}) => ({ type: 'email', ...config } as const),\n phone: (config: FieldInput = {}) => ({ type: 'phone', ...config } as const),\n image: (config: FieldInput = {}) => ({ type: 'image', ...config } as const),\n file: (config: FieldInput = {}) => ({ type: 'file', ...config } as const),\n avatar: (config: FieldInput = {}) => ({ type: 'avatar', ...config } as const),\n formula: (config: FieldInput = {}) => ({ type: 'formula', ...config } as const),\n summary: (config: FieldInput = {}) => ({ type: 'summary', ...config } as const),\n autonumber: (config: FieldInput = {}) => ({ type: 'autonumber', ...config } as const),\n markdown: (config: FieldInput = {}) => ({ type: 'markdown', ...config } as const),\n html: (config: FieldInput = {}) => ({ type: 'html', ...config } as const),\n password: (config: FieldInput = {}) => ({ type: 'password', ...config } as const),\n /**\n * Secret field — reversible encrypted-at-rest value (DB password, API key,\n * token). Encrypted on write to `sys_secret` via the registered\n * ICryptoProvider; only an opaque ref is persisted on the row; masked on\n * read. Distinct from `password` (one-way hash, owned by the auth subsystem).\n */\n secret: (config: FieldInput = {}) => ({ type: 'secret', ...config } as const),\n \n /**\n * Select field helper with backward-compatible API\n * \n * Automatically converts option values to lowercase to enforce naming conventions.\n * \n * @example Old API (array first) - auto-converts to lowercase\n * Field.select(['High', 'Low'], { label: 'Priority' })\n * // Results in: [{ label: 'High', value: 'high' }, { label: 'Low', value: 'low' }]\n * \n * @example New API (config object) - enforces lowercase\n * Field.select({ options: [{label: 'High', value: 'high'}], label: 'Priority' })\n * \n * @example Multi-word values - converts to snake_case\n * Field.select(['In Progress', 'Closed Won'], { label: 'Status' })\n * // Results in: [{ label: 'In Progress', value: 'in_progress' }, { label: 'Closed Won', value: 'closed_won' }]\n */\n select: (optionsOrConfig: SelectOption[] | string[] | FieldInput & { options: SelectOption[] | string[] }, config?: FieldInput) => {\n // Helper function to convert string to lowercase snake_case\n const toSnakeCase = (str: string): string => {\n return str\n .toLowerCase()\n .replace(/\\s+/g, '_') // Replace spaces with underscores\n .replace(/[^a-z0-9_]/g, ''); // Remove invalid characters (keeping underscores only)\n };\n\n // Support both old and new signatures:\n // Old: Field.select(['a', 'b'], { label: 'X' })\n // New: Field.select({ options: [{label: 'A', value: 'a'}], label: 'X' })\n let options: SelectOption[];\n let finalConfig: FieldInput;\n \n if (Array.isArray(optionsOrConfig)) {\n // Old signature: array as first param\n options = optionsOrConfig.map(o => \n typeof o === 'string' \n ? { label: o, value: toSnakeCase(o) } // Auto-convert string to snake_case\n : { ...o, value: o.value.toLowerCase() } // Ensure value is lowercase\n );\n finalConfig = config || {};\n } else {\n // New signature: config object with options\n options = (optionsOrConfig.options || []).map(o => \n typeof o === 'string' \n ? { label: o, value: toSnakeCase(o) } // Auto-convert string to snake_case\n : { ...o, value: o.value.toLowerCase() } // Ensure value is lowercase\n );\n // Remove options from config to avoid confusion\n const { options: _, ...restConfig } = optionsOrConfig;\n finalConfig = restConfig;\n }\n \n return { type: 'select', options, ...finalConfig } as const;\n },\n\n \n lookup: (reference: string, config: FieldInput = {}) => ({ \n type: 'lookup', \n reference, \n ...config \n } as const),\n \n masterDetail: (reference: string, config: FieldInput = {}) => ({\n type: 'master_detail',\n reference,\n ...config\n } as const),\n\n /**\n * User field — a person picker. Semantic specialization of `lookup` with the\n * target fixed to the `sys_user` system object: stored identically (FK string\n * column → sys_user.id; `multiple: true` ⇒ JSON array) and resolved via the same\n * $expand machinery. The distinct `user` type drives the Studio/AI field palette,\n * the user-search picker, and `current_user` defaults — without re-implementing\n * lookup storage.\n *\n * @example Single assignee\n * Field.user({ label: 'Assignee' })\n * @example Collaborators / watchers (multi)\n * Field.user({ label: 'Watchers', multiple: true })\n * @example Auto-fill the acting user on create\n * Field.user({ label: 'Reporter', defaultValue: 'current_user' })\n */\n user: (config: FieldInput = {}) => ({\n type: 'user',\n reference: 'sys_user',\n ...config,\n } as const),\n\n // Enhanced Field Type Helpers\n location: (config: FieldInput = {}) => ({ \n type: 'location', \n ...config \n } as const),\n \n address: (config: FieldInput = {}) => ({ \n type: 'address', \n ...config \n } as const),\n \n richtext: (config: FieldInput = {}) => ({ \n type: 'richtext', \n ...config \n } as const),\n \n code: (language?: string, config: FieldInput = {}) => ({ \n type: 'code', \n language,\n ...config \n } as const),\n \n color: (config: FieldInput = {}) => ({ \n type: 'color', \n ...config \n } as const),\n \n rating: (max: number = 5, config: FieldInput = {}) => ({\n type: 'rating',\n max,\n ...config\n } as const),\n \n signature: (config: FieldInput = {}) => ({ \n type: 'signature', \n ...config \n } as const),\n \n slider: (config: FieldInput = {}) => ({ \n type: 'slider', \n ...config \n } as const),\n \n qrcode: (config: FieldInput = {}) => ({ \n type: 'qrcode', \n ...config \n } as const),\n \n json: (config: FieldInput = {}) => ({ \n type: 'json', \n ...config \n } as const),\n \n vector: (dimensions: number, config: FieldInput = {}) => ({\n type: 'vector',\n dimensions,\n ...config\n } as const),\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\n\n/**\n * # ObjectStack Validation Protocol\n * \n * This module defines the validation schema protocol for ObjectStack, providing a comprehensive\n * type-safe validation system similar to Salesforce's validation rules but with enhanced capabilities.\n * \n * ## Overview\n *\n * Validation rules are applied at the data layer to ensure data integrity and enforce business logic.\n * A validation rule is a **deterministic, synchronous, side-effect-free predicate over a single\n * record** — it must be decidable from the incoming write (and, on update, the prior record) with\n * no I/O. Everything advertised here runs on the write path (see\n * `objectql/src/validation/rule-validator.ts`); nothing is a silent no-op.\n *\n * The system supports these validation types:\n *\n * 1. **Script Validation**: Formula-based validation using a CEL predicate\n * 2. **State Machine Validation**: Control allowed state transitions\n * 3. **Format Validation**: Validate a field's value (email, URL, phone, JSON, regex)\n * 4. **Cross-Field Validation**: Validate relationships between multiple fields\n * 5. **JSON Schema Validation**: Validate a JSON field against a JSON Schema\n * 6. **Conditional Validation**: Apply a nested rule based on a CEL condition\n *\n * ## Deliberately NOT validation rules\n *\n * These were once declared here but never enforced. Because the contract above rules them out\n * (they need I/O or are client-side concerns), they were removed rather than left as silent\n * no-ops. Use the layer that already does each one correctly:\n *\n * - **Uniqueness** → a unique **index** (`ObjectSchema.indexes`, `{ fields, unique: true }`,\n * with `partial` for a scoped/conditional constraint), or field-level `unique: true`. A\n * SELECT-then-INSERT \"rule\" is inherently racy (TOCTOU); a DB unique constraint is not.\n * - **Async / remote validation** → a client-form concern (`debounce`/`validatorUrl` only mean\n * anything against keystrokes) and an SSRF/latency hazard on the server write path. Keep it in\n * the form layer, or enforce the underlying invariant with a `unique` index / lifecycle hook.\n * - **Custom handler** → a `beforeInsert` / `beforeUpdate` lifecycle hook, the typed, supported\n * extension point for arbitrary validation code.\n * \n * ## Salesforce Comparison\n * \n * ObjectStack validation rules are inspired by Salesforce validation rules but enhanced:\n * - Salesforce: Formula-based validation with `Error Condition Formula`\n * - ObjectStack: Multiple validation types with composable rules\n * \n * Example Salesforce validation rule:\n * ```\n * Rule Name: Discount_Cannot_Exceed_40_Percent\n * Error Condition Formula: Discount_Percent__c > 0.40\n * Error Message: Discount cannot exceed 40%.\n * ```\n * \n * Equivalent ObjectStack rule:\n * ```typescript\n * {\n * type: 'script',\n * name: 'discount_cannot_exceed_40_percent',\n * condition: 'discount_percent > 0.40',\n * message: 'Discount cannot exceed 40%',\n * severity: 'error'\n * }\n * ```\n */\n\n/**\n * Base Validation Rule\n * \n * All validation rules extend from this base schema with common properties.\n * \n * ## Industry Standard Enhancements\n * - **Label/Description**: Essential for governance in large systems with thousands of rules.\n * - **Events**: granular control over validation timing (Context-aware validation).\n * - **Tags**: categorization for reporting and management.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nconst BaseValidationSchema = z.object({\n // Identification\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Unique rule name (snake_case)'),\n label: z.string().optional().describe('Human-readable label for the rule listing'),\n description: z.string().optional().describe('Administrative notes explaining the business reason'),\n \n // Execution Control\n active: z.boolean().default(true),\n events: z.array(z.enum(['insert', 'update', 'delete'])).default(['insert', 'update']).describe('Validation contexts'),\n priority: z.number().int().min(0).max(9999).default(100).describe('Execution priority (lower runs first, default: 100)'),\n \n // Classification\n tags: z.array(z.string()).optional().describe('Categorization tags (e.g., \"compliance\", \"billing\")'),\n \n // Feedback\n severity: z.enum(['error', 'warning', 'info']).default('error'),\n message: z.string().describe('Error message to display to the user'),\n});\n\n/**\n * 1. Script/Expression Validation\n * Generic formula-based validation.\n */\nexport const ScriptValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('script'),\n condition: ExpressionInputSchema.describe('Predicate (CEL). If TRUE, validation fails. e.g. P`record.amount < 0`'),\n}));\n\n/**\n * 2. State Machine Validation\n * State transition logic.\n */\nexport const StateMachineValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('state_machine'),\n field: z.string().describe('State field (e.g. status)'),\n transitions: z.record(z.string(), z.array(z.string())).describe('Map of { OldState: [AllowedNewStates] }'),\n}));\n\n/**\n * 3. Value Format Validation\n * Regex or specialized formats.\n */\nexport const FormatValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('format'),\n field: z.string(),\n regex: z.string().optional(),\n format: z.enum(['email', 'url', 'phone', 'json']).optional(),\n}));\n\n/**\n * 4. Cross-Field Validation\n * Validates relationships between multiple fields.\n * \n * ## Use Cases\n * - Date range validations (end_date > start_date)\n * - Amount comparisons (discount < total)\n * - Complex business rules involving multiple fields\n * \n * ## Salesforce Examples\n * \n * ### Example 1: Close Date Must Be In Current or Future Month\n * **Salesforce Formula:**\n * ```\n * MONTH(CloseDate) < MONTH(TODAY()) ||\n * YEAR(CloseDate) < YEAR(TODAY())\n * ```\n * \n * **ObjectStack Equivalent:**\n * ```typescript\n * {\n * type: 'cross_field',\n * name: 'close_date_future',\n * condition: 'MONTH(close_date) >= MONTH(TODAY()) AND YEAR(close_date) >= YEAR(TODAY())',\n * fields: ['close_date'],\n * message: 'Close Date must be in the current or a future month'\n * }\n * ```\n * \n * ### Example 2: Discount Validation\n * **Salesforce Formula:**\n * ```\n * Discount__c > (Amount__c * 0.40)\n * ```\n * \n * **ObjectStack Equivalent:**\n * ```typescript\n * {\n * type: 'cross_field',\n * name: 'discount_limit',\n * condition: 'discount > (amount * 0.40)',\n * fields: ['discount', 'amount'],\n * message: 'Discount cannot exceed 40% of the amount'\n * }\n * ```\n * \n * ### Example 3: Opportunity Must Have Products\n * **Salesforce Formula:**\n * ```\n * ISBLANK(Products__c) && ISPICKVAL(StageName, \"Closed Won\")\n * ```\n * \n * **ObjectStack Equivalent:**\n * ```typescript\n * {\n * type: 'cross_field',\n * name: 'products_required_for_won',\n * condition: 'products = null AND stage = \"closed_won\"',\n * fields: ['products', 'stage'],\n * message: 'Opportunity must have products to be marked as Closed Won'\n * }\n * ```\n */\nexport const CrossFieldValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('cross_field'),\n condition: ExpressionInputSchema.describe('Predicate (CEL) comparing fields. e.g. P`record.end_date > record.start_date`'),\n fields: z.array(z.string()).describe('Fields involved in the validation'),\n}));\n\n/**\n * 5. JSON Structure Validation\n * Validates JSON fields against a JSON Schema.\n * \n * ## Use Cases\n * - Validating configuration objects stored in JSON fields\n * - Enforcing API payload structures\n * - Complex nested data validation\n */\nexport const JSONValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('json_schema'),\n field: z.string().describe('JSON field to validate'),\n schema: z.record(z.string(), z.unknown()).describe('JSON Schema object definition'),\n}));\n\n\n\n/**\n * 6. Master Validation Rule Schema\n */\n/** Base type for validation rules - used for z.lazy() recursive type annotation */\nexport interface BaseValidationRuleShape {\n type: string;\n name: string;\n message: string;\n label?: string;\n description?: string;\n active?: boolean;\n events?: ('insert' | 'update' | 'delete')[];\n priority?: number;\n tags?: string[];\n severity?: 'error' | 'warning' | 'info';\n [key: string]: unknown;\n}\n\nexport const ValidationRuleSchema: z.ZodType<BaseValidationRuleShape> = z.lazy(() =>\n z.discriminatedUnion('type', [\n ScriptValidationSchema,\n StateMachineValidationSchema,\n FormatValidationSchema,\n CrossFieldValidationSchema,\n JSONValidationSchema,\n ConditionalValidationSchema,\n ])\n);\n\n/**\n * 7. Conditional Validation\n * Validation that only applies when a condition is met.\n * \n * ## Overview\n * Conditional validations follow the pattern: \"Validate X only if Y is true\"\n * This allows for context-aware validation rules that adapt to different scenarios.\n * \n * ## Use Cases\n * \n * ### 1. Validate Based on Record Type\n * Apply different validation rules based on the type of record.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'enterprise_approval_required',\n * when: 'account_type = \"enterprise\"',\n * message: 'Enterprise validation',\n * then: {\n * type: 'script',\n * name: 'require_approval',\n * message: 'Enterprise accounts require manager approval',\n * condition: 'approval_status = null'\n * }\n * }\n * ```\n * \n * ### 2. Conditional Field Requirements\n * Require certain fields only when specific conditions are met.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'shipping_address_when_required',\n * when: 'requires_shipping = true',\n * message: 'Shipping validation',\n * then: {\n * type: 'script',\n * name: 'shipping_address_required',\n * message: 'Shipping address is required for physical products',\n * condition: 'shipping_address = null OR shipping_address = \"\"'\n * }\n * }\n * ```\n * \n * ### 3. Amount-Based Validation\n * Apply different rules based on transaction amount.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'high_value_approval',\n * when: 'order_total > 10000',\n * message: 'High value order validation',\n * then: {\n * type: 'script',\n * name: 'manager_approval_required',\n * message: 'Orders over $10,000 require manager approval',\n * condition: 'manager_approval_id = null'\n * },\n * otherwise: {\n * type: 'script',\n * name: 'standard_validation',\n * message: 'Payment method is required',\n * condition: 'payment_method = null'\n * }\n * }\n * ```\n * \n * ### 4. Regional Compliance\n * Apply region-specific validation rules.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'regional_compliance',\n * when: 'region = \"EU\"',\n * message: 'EU compliance validation',\n * then: {\n * type: 'script',\n * name: 'gdpr_consent',\n * message: 'GDPR consent is required for EU customers',\n * condition: 'gdpr_consent_given = false'\n * },\n * otherwise: {\n * type: 'script',\n * name: 'tos_acceptance',\n * message: 'Terms of Service acceptance required',\n * condition: 'tos_accepted = false'\n * }\n * }\n * ```\n * \n * ### 5. Nested Conditional Validation\n * Create complex validation logic with nested conditions.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'country_state_validation',\n * when: 'country = \"US\"',\n * message: 'US-specific validation',\n * then: {\n * type: 'conditional',\n * name: 'california_validation',\n * when: 'state = \"CA\"',\n * message: 'California-specific validation',\n * then: {\n * type: 'script',\n * name: 'ca_tax_id_required',\n * message: 'California requires a valid tax ID',\n * condition: 'tax_id = null OR NOT(REGEX(tax_id, \"^\\\\d{2}-\\\\d{7}$\"))'\n * }\n * }\n * }\n * ```\n * \n * ### 6. Tax Validation for Taxable Items\n * Only validate tax fields when the item is taxable.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'tax_field_validation',\n * when: 'is_taxable = true',\n * message: 'Tax validation',\n * then: {\n * type: 'script',\n * name: 'tax_code_required',\n * message: 'Tax code is required for taxable items',\n * condition: 'tax_code = null OR tax_code = \"\"'\n * }\n * }\n * ```\n * \n * ### 7. Role-Based Validation\n * Apply validation based on user role.\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'role_based_approval_limit',\n * when: 'user_role = \"manager\"',\n * message: 'Manager approval limits',\n * then: {\n * type: 'script',\n * name: 'manager_limit',\n * message: 'Managers can approve up to $50,000',\n * condition: 'approval_amount > 50000'\n * }\n * }\n * ```\n * \n * ## Salesforce Pattern Comparison\n * \n * Salesforce doesn't have explicit \"conditional validation\" rules but achieves similar\n * behavior using formula logic. ObjectStack makes this pattern explicit and composable.\n * \n * **Salesforce Approach:**\n * ```\n * IF(\n * ISPICKVAL(Type, \"Enterprise\"),\n * AND(Amount > 100000, ISBLANK(Approval__c)),\n * FALSE\n * )\n * ```\n * \n * **ObjectStack Approach:**\n * ```typescript\n * {\n * type: 'conditional',\n * name: 'enterprise_high_value',\n * when: 'type = \"enterprise\"',\n * then: {\n * type: 'cross_field',\n * name: 'amount_approval',\n * condition: 'amount > 100000 AND approval = null',\n * fields: ['amount', 'approval']\n * }\n * }\n * ```\n */\nexport const ConditionalValidationSchema = lazySchema(() => BaseValidationSchema.extend({\n type: z.literal('conditional'),\n when: ExpressionInputSchema.describe('Predicate (CEL). e.g. P`record.type == \\'enterprise\\'`'),\n then: ValidationRuleSchema.describe('Validation rule to apply when condition is true'),\n otherwise: ValidationRuleSchema.optional().describe('Validation rule to apply when condition is false'),\n}));\n\nexport type ValidationRule = z.infer<typeof ValidationRuleSchema>;\nexport type ScriptValidation = z.infer<typeof ScriptValidationSchema>;\nexport type StateMachineValidation = z.infer<typeof StateMachineValidationSchema>;\nexport type FormatValidation = z.infer<typeof FormatValidationSchema>;\nexport type CrossFieldValidation = z.infer<typeof CrossFieldValidationSchema>;\nexport type JSONValidation = z.infer<typeof JSONValidationSchema>;\nexport type ConditionalValidation = z.infer<typeof ConditionalValidationSchema>;","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * I18n Object Schema\n * Structured internationalization label with translation key and parameters.\n * \n * @example\n * ```typescript\n * const label: I18nObject = {\n * key: 'views.task_list.label',\n * defaultValue: 'Task List',\n * params: { count: 5 },\n * };\n * ```\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const I18nObjectSchema = lazySchema(() => z.object({\n /** Translation key (e.g., \"views.task_list.label\", \"apps.crm.description\") */\n key: z.string().describe('Translation key (e.g., \"views.task_list.label\")'),\n\n /** Default value when translation is not available */\n defaultValue: z.string().optional().describe('Fallback value when translation key is not found'),\n\n /** Interpolation parameters for dynamic translations */\n params: z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional().describe('Interpolation parameters (e.g., { count: 5 })'),\n}));\n\nexport type I18nObject = z.infer<typeof I18nObjectSchema>;\n\n/**\n * I18n Label Schema\n * \n * A plain string label for display purposes.\n * i18n translation keys are auto-generated by the framework at registration time\n * based on a standardized naming convention (e.g., `apps.<packageId>.<name>.label`).\n * Developers only need to provide the default-language string; translations are\n * managed through translation files, not inline i18n objects.\n * \n * @example\n * ```typescript\n * const label: I18nLabel = \"All Active\";\n * ```\n */\nexport const I18nLabelSchema = lazySchema(() => z.string().describe('Display label (plain string; i18n keys are auto-generated by the framework)'));\n\nexport type I18nLabel = z.infer<typeof I18nLabelSchema>;\n\n/**\n * ARIA Accessibility Properties Schema\n * \n * Common ARIA attributes for UI components to support screen readers\n * and assistive technologies.\n * \n * Aligned with WAI-ARIA 1.2 specification.\n * \n * @see https://www.w3.org/TR/wai-aria-1.2/\n * \n * @example\n * ```typescript\n * const aria: AriaProps = {\n * ariaLabel: 'Close dialog',\n * ariaDescribedBy: 'dialog-description',\n * role: 'dialog',\n * };\n * ```\n */\nexport const AriaPropsSchema = lazySchema(() => z.object({\n /** Accessible label for screen readers */\n ariaLabel: I18nLabelSchema.optional().describe('Accessible label for screen readers (WAI-ARIA aria-label)'),\n\n /** ID of element that describes this component */\n ariaDescribedBy: z.string().optional().describe('ID of element providing additional description (WAI-ARIA aria-describedby)'),\n\n /** WAI-ARIA role override */\n role: z.string().optional().describe('WAI-ARIA role attribute (e.g., \"dialog\", \"navigation\", \"alert\")'),\n}).describe('ARIA accessibility attributes'));\n\nexport type AriaProps = z.infer<typeof AriaPropsSchema>;\n\n/**\n * Plural Rule Schema\n *\n * Defines plural forms for a translation key, following ICU MessageFormat / i18next conventions.\n * Supports zero, one, two, few, many, other forms per CLDR plural rules.\n *\n * @see https://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules\n *\n * @example\n * ```typescript\n * const plural: PluralRule = {\n * key: 'items.count',\n * zero: 'No items',\n * one: '{count} item',\n * other: '{count} items',\n * };\n * ```\n */\nexport const PluralRuleSchema = lazySchema(() => z.object({\n /** Translation key for the plural form */\n key: z.string().describe('Translation key'),\n /** Form for zero quantity */\n zero: z.string().optional().describe('Zero form (e.g., \"No items\")'),\n /** Form for singular (1) */\n one: z.string().optional().describe('Singular form (e.g., \"{count} item\")'),\n /** Form for dual (2) — used in Arabic, Welsh, etc. */\n two: z.string().optional().describe('Dual form (e.g., \"{count} items\" for exactly 2)'),\n /** Form for few (2-4 in Slavic languages) */\n few: z.string().optional().describe('Few form (e.g., for 2-4 in some languages)'),\n /** Form for many (5+ in Slavic languages) */\n many: z.string().optional().describe('Many form (e.g., for 5+ in some languages)'),\n /** Default/fallback form */\n other: z.string().describe('Default plural form (e.g., \"{count} items\")'),\n}).describe('ICU plural rules for a translation key'));\n\nexport type PluralRule = z.infer<typeof PluralRuleSchema>;\n\n/**\n * Number Format Schema\n *\n * Defines number formatting rules for localization.\n *\n * @example\n * ```typescript\n * const format: NumberFormat = {\n * style: 'currency',\n * currency: 'USD',\n * minimumFractionDigits: 2,\n * };\n * ```\n */\nexport const NumberFormatSchema = lazySchema(() => z.object({\n style: z.enum(['decimal', 'currency', 'percent', 'unit']).default('decimal')\n .describe('Number formatting style'),\n currency: z.string().optional().describe('ISO 4217 currency code (e.g., \"USD\", \"EUR\")'),\n unit: z.string().optional().describe('Unit for unit formatting (e.g., \"kilometer\", \"liter\")'),\n minimumFractionDigits: z.number().optional().describe('Minimum number of fraction digits'),\n maximumFractionDigits: z.number().optional().describe('Maximum number of fraction digits'),\n useGrouping: z.boolean().optional().describe('Whether to use grouping separators (e.g., 1,000)'),\n}).describe('Number formatting rules'));\n\nexport type NumberFormat = z.infer<typeof NumberFormatSchema>;\n\n/**\n * Date Format Schema\n *\n * Defines date/time formatting rules for localization.\n *\n * @example\n * ```typescript\n * const format: DateFormat = {\n * dateStyle: 'medium',\n * timeStyle: 'short',\n * timeZone: 'America/New_York',\n * };\n * ```\n */\nexport const DateFormatSchema = lazySchema(() => z.object({\n dateStyle: z.enum(['full', 'long', 'medium', 'short']).optional()\n .describe('Date display style'),\n timeStyle: z.enum(['full', 'long', 'medium', 'short']).optional()\n .describe('Time display style'),\n timeZone: z.string().optional().describe('IANA time zone (e.g., \"America/New_York\")'),\n hour12: z.boolean().optional().describe('Use 12-hour format'),\n}).describe('Date/time formatting rules'));\n\nexport type DateFormat = z.infer<typeof DateFormatSchema>;\n\n/**\n * Locale Configuration Schema\n *\n * Defines a complete locale configuration including language code,\n * fallback chain, and formatting preferences.\n *\n * @example\n * ```typescript\n * const locale: LocaleConfig = {\n * code: 'zh-CN',\n * fallbackChain: ['zh-TW', 'en'],\n * direction: 'ltr',\n * numberFormat: { style: 'decimal', useGrouping: true },\n * dateFormat: { dateStyle: 'medium', timeStyle: 'short' },\n * };\n * ```\n */\nexport const LocaleConfigSchema = lazySchema(() => z.object({\n /** BCP 47 language code (e.g., \"en-US\", \"zh-CN\", \"ar-SA\") */\n code: z.string().describe('BCP 47 language code (e.g., \"en-US\", \"zh-CN\")'),\n\n /** Ordered fallback chain for missing translations */\n fallbackChain: z.array(z.string()).optional()\n .describe('Fallback language codes in priority order (e.g., [\"zh-TW\", \"en\"])'),\n\n /** Text direction */\n direction: z.enum(['ltr', 'rtl']).default('ltr')\n .describe('Text direction: left-to-right or right-to-left'),\n\n /** Default number formatting */\n numberFormat: NumberFormatSchema.optional().describe('Default number formatting rules'),\n\n /** Default date formatting */\n dateFormat: DateFormatSchema.optional().describe('Default date/time formatting rules'),\n}).describe('Locale configuration'));\n\nexport type LocaleConfig = z.infer<typeof LocaleConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Capability tokens a script body may request.\n *\n * The runtime sandbox enforces these — if a body uses a `ctx` API that requires\n * a capability it did not declare, the call throws at invocation time.\n *\n * - `api.read` — `ctx.api.object(...).find / findOne / count / aggregate`\n * - `api.write` — `ctx.api.object(...).insert / update / delete`\n * - `api.transaction` — `ctx.api.transaction(async () => { … })` — runs the\n * callback's `ctx.api` writes/reads inside one driver transaction, committed\n * on return and rolled back if the callback throws. Requires `api.write`\n * alongside it to be useful (the transaction body still needs write access).\n * - `crypto.uuid` — `ctx.crypto.randomUUID()`\n * - `crypto.hash` — `ctx.crypto.hash(algo, data)`\n * - `log` — `ctx.log.info / warn / error`\n *\n * `http.fetch` is intentionally absent — outbound calls go through Connector\n * recipes (separate spec) so they remain auditable and replayable.\n */\nexport const HookBodyCapability = z.enum([\n 'api.read',\n 'api.write',\n 'api.transaction',\n 'crypto.uuid',\n 'crypto.hash',\n 'log',\n]);\nexport type HookBodyCapability = z.infer<typeof HookBodyCapability>;\n\n/**\n * L1 — Pure expression body.\n *\n * Evaluated by the formula engine. No IO, no mutation. Used for predicates\n * (`condition`-style) and simple computed values.\n *\n * @example\n * ```json\n * { \"language\": \"expression\", \"source\": \"input.amount > 1000 && input.status == 'open'\" }\n * ```\n */\nexport const ExpressionBodySchema = z.object({\n language: z.literal('expression'),\n /** Formula-engine expression. Pure, side-effect-free. */\n source: z.string().min(1).describe('Formula expression source'),\n}).describe('L1 expression body — pure formula, no IO');\nexport type ExpressionBody = z.infer<typeof ExpressionBodySchema>;\n\n/**\n * L2 — Sandboxed JavaScript source.\n *\n * The `source` is the **function body only** (not a full module). The runtime\n * wraps it in `new AsyncFunction('ctx', source)` for hooks, or\n * `new AsyncFunction('input', 'ctx', source)` for actions, then executes\n * inside an isolated VM.\n *\n * Forbidden inside `source` (CLI build will reject):\n * - `import` / `require` / dynamic `import()`\n * - `process`, `globalThis`, `eval`, `new Function`\n * - any identifier resolved from a value-only top-level import\n *\n * @example\n * ```json\n * {\n * \"language\": \"js\",\n * \"source\": \"if (ctx.input.email) ctx.input.email = ctx.input.email.toLowerCase();\",\n * \"capabilities\": [],\n * \"timeoutMs\": 250\n * }\n * ```\n */\nexport const ScriptBodySchema = z.object({\n language: z.literal('js'),\n /** Function body source (NOT a full module — no top-level imports). */\n source: z.string().min(1).describe('Function body source'),\n /**\n * Capability tokens the body is allowed to use. Default: `[]`.\n * The sandbox throws if the body calls a `ctx` API not covered by these.\n */\n capabilities: z.array(HookBodyCapability).default([]).describe('Granted capability tokens'),\n /**\n * Per-invocation hard timeout in milliseconds.\n * Sandbox kills the script if it exceeds this; smaller of this and the\n * enclosing hook/action `timeout` wins.\n */\n timeoutMs: z.number().int().positive().max(30_000).optional().describe('Per-invocation timeout (ms)'),\n /**\n * Per-invocation memory cap in MB.\n * Subject to engine support (isolated-vm enforces, quickjs approximates).\n */\n memoryMb: z.number().int().positive().max(256).optional().describe('Per-invocation memory cap (MB)'),\n}).describe('L2 sandboxed JS body — runs inside an isolated VM with declared capabilities');\nexport type ScriptBody = z.infer<typeof ScriptBodySchema>;\n\n/**\n * Hook / Action body — discriminated by `language`.\n *\n * Two and only two forms are accepted:\n * - `expression` — L1, pure formula evaluated by the formula engine.\n * - `js` — L2, sandboxed JavaScript source string.\n *\n * The compiled-module path (`.mjs` envelope) is intentionally **not** part of\n * this union. All bodies are pure metadata and travel inside the project\n * artifact JSON — no separate runtime module is required.\n *\n * @see content/docs/concepts/north-star.mdx — \"Metadata-only runtime\"\n */\nexport const HookBodySchema = z.discriminatedUnion('language', [\n ExpressionBodySchema,\n ScriptBodySchema,\n]).describe('Hook/Action body — expression (L1) or sandboxed JS (L2)');\nexport type HookBody = z.infer<typeof HookBodySchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FieldType } from '../data/field.zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\nimport { I18nLabelSchema, AriaPropsSchema } from './i18n.zod';\nimport { HookBodySchema } from '../data/hook-body.zod';\n\n/**\n * Action Parameter Schema\n *\n * Defines inputs required before executing an action.\n *\n * Two declaration modes:\n *\n * 1. **Field-backed** (preferred) — reference an existing object field; the\n * runtime resolves the field's label (i18n), type, validation rules,\n * options, placeholder, help text, and widget mapping from object\n * metadata. Cross-object references use `objectOverride`.\n *\n * ```ts\n * params: [\n * { field: 'email' }, // same object\n * { field: 'role', objectOverride: 'sys_member' }, // different object\n * ]\n * ```\n *\n * 2. **Inline** (legacy / bespoke) — declare `name`, `label`, `type` etc.\n * inline when no matching object field exists. Inline values may also be\n * used alongside `field` to override individual properties.\n *\n * `name` is required unless `field` is provided (in which case it defaults\n * to the field name and is used as the request-body key).\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const ActionParamSchema = lazySchema(() => z.object({\n /** Request-body key. Defaults to `field` when `field` is set. */\n name: z.string().optional(),\n /** Reference an existing object field for label/type/validation/options. */\n field: SnakeCaseIdentifierSchema.optional(),\n /** Object that owns the referenced field (defaults to the action's parent object). */\n objectOverride: SnakeCaseIdentifierSchema.optional(),\n /** Overrides the resolved field label (or sets it for inline params). */\n label: I18nLabelSchema.optional(),\n /** Overrides the resolved field type (or sets it for inline params). */\n type: FieldType.optional(),\n /**\n * Required override; when omitted defaults to `false`. Consumers that wish\n * to inherit the underlying field's `required` flag should leave this\n * undefined in the source schema and resolve at runtime (the dialog\n * renderers check truthiness, so `false === undefined` for UI purposes).\n */\n required: z.boolean().optional().default(false),\n /** Select/picklist options override. */\n options: z.array(z.object({ label: I18nLabelSchema, value: z.string() })).optional(),\n /** Placeholder override. */\n placeholder: z.string().optional(),\n /** Help/description override. */\n helpText: z.string().optional(),\n /** Default value for the dialog input. */\n defaultValue: z.unknown().optional(),\n /**\n * When true, the param's default value is pulled from the current row record\n * (key = the resolved field name) when the action runs from a list_item\n * context. Useful for edit dialogs that pre-fill from the selected row.\n */\n defaultFromRow: z.boolean().optional(),\n}).refine(\n (p) => Boolean(p.name) || Boolean(p.field),\n { message: 'ActionParam requires either \"name\" or \"field\"' },\n));\n\n/**\n * Action type enum values.\n */\nexport const ActionType = z.enum(['script', 'url', 'modal', 'flow', 'api', 'form']);\n\n/**\n * Action types that require a `target` field.\n * Derived from ActionType, excluding 'script' which allows inline handlers.\n * These types reference an external resource (URL, flow, modal, or API endpoint)\n * and cannot function without a target binding.\n */\nconst TARGET_REQUIRED_TYPES: ReadonlySet<string> = new Set(\n ActionType.options.filter((t) => t !== 'script'),\n);\n\n/**\n * Action Schema\n * \n * **NAMING CONVENTION:**\n * Action names are machine identifiers used in code and must be lowercase snake_case.\n * \n * **TARGET BINDING:**\n * The `target` field is the canonical way to bind an action to its handler.\n * - `type: 'script'` — `target` is recommended (references a script/function name).\n * - `type: 'url'` — `target` is **required** (the URL to navigate to).\n * - `type: 'flow'` — `target` is **required** (the flow name to invoke).\n * - `type: 'modal'` — `target` is **required** (the modal/page name to open).\n * - `type: 'api'` — `target` is **required** (the API endpoint to call).\n * - `type: 'form'` — `target` is **required** (the FormView name to open, routed to `/console/forms/:name`).\n * \n * The `execute` field is **deprecated** and will be removed in a future version.\n * If `execute` is provided without `target`, it is automatically migrated to `target`.\n * \n * @example Good action names\n * - 'on_close_deal'\n * - 'send_welcome_email'\n * - 'approve_contract'\n * - 'export_report'\n * \n * @example Bad action names (will be rejected)\n * - 'OnCloseDeal' (PascalCase)\n * - 'sendEmail' (camelCase)\n * - 'Send Email' (spaces)\n * \n * Note: The action name is the configuration ID. JavaScript function names can use camelCase,\n * but the metadata ID must be lowercase snake_case.\n */\n/**\n * Action Location — where an action is allowed to surface in the UI.\n *\n * Canonical list (single source of truth for the whole platform). Renderers,\n * the ActionEngine, the Studio designer dropdowns, and `objectui` consumers\n * MUST import from this constant rather than re-declaring their own enum —\n * adding a new location should require touching this one file only.\n *\n * Semantics:\n * - `list_toolbar` — header/toolbar of a list view (bulk actions, \"New\", export).\n * - `list_item` — per-row action on a list/grid row (Salesforce row-level menu).\n * - `record_header` — primary actions in the record-detail title bar.\n * - `record_more` — overflow menu under the \"More\" / ⋯ button on a record.\n * - `record_related` — actions on a related list section inside a record.\n * - `record_section` — actions surfaced inside a body section/tab of a record\n * (e.g. a Security tab grouping change-password, 2FA, etc.).\n * - `global_nav` — global navigation/command-palette level actions.\n */\nexport const ACTION_LOCATIONS = [\n 'list_toolbar',\n 'list_item',\n 'record_header',\n 'record_more',\n 'record_related',\n 'record_section',\n 'global_nav',\n] as const;\n\nexport const ActionLocationSchema = z.enum(ACTION_LOCATIONS);\nexport type ActionLocation = z.infer<typeof ActionLocationSchema>;\n\n/**\n * Tool category values for {@link ActionAiSchema.category}.\n *\n * Mirrors `ToolCategorySchema` in `../ai/tool.zod`. Kept **inline** rather\n * than imported to avoid a `ui → ai` import cycle (`ai/*.form.ts` already\n * imports `defineForm` from `ui/view.zod`). If you change the canonical\n * tool categories, update both sides.\n */\nconst ActionAiCategorySchema = z.enum([\n 'data',\n 'action',\n 'flow',\n 'integration',\n 'vector_search',\n 'analytics',\n 'utility',\n]);\n\n/**\n * AI exposure block (ADR-0011 \"Actions as AI Tools\").\n *\n * **Opt-in, default off.** An action becomes an AI-callable tool only when\n * `exposed: true`. This is a deliberate governance gate: in an AI-authoring\n * world the platform's value is that a human can govern exactly which\n * capabilities the agent fleet is allowed to invoke — a half-finished or\n * unreviewed action must never be silently armed.\n *\n * When exposed, `description` is **required** — it is the LLM-facing contract\n * (when/why to call), authored explicitly rather than derived from the\n * UI `label`. The bridge in `@objectstack/service-ai` translates this block\n * into an `AIToolDefinition`.\n */\nexport const ActionAiSchema = z.object({\n /**\n * Expose this action to AI agents as a callable tool. Default `false`.\n * Setting `true` REQUIRES `description`.\n */\n exposed: z.boolean().default(false).describe('Expose this action to AI agents. Requires `description` when true.'),\n\n /**\n * LLM-facing description: tells the model when and why to call this action.\n * Distinct from the UI `label`. Plain English, ≥ 40 chars for useful tool\n * selection. Required whenever `exposed` is true.\n */\n description: z.string().min(40).optional().describe('LLM-facing description (≥40 chars). Required when exposed.'),\n\n /**\n * Override the derived tool category. Defaults to `action` (side-effect).\n * Use `data` for read-only actions, `analytics` for aggregations, etc.\n */\n category: ActionAiCategorySchema.optional().describe('Tool category override (defaults to \"action\").'),\n\n /**\n * Per-parameter AI hints, keyed by param name (or the injected `recordId`).\n * Tightens the JSON Schema the LLM sees (e.g. add `enum`, override\n * `description`, supply `examples`) WITHOUT changing the UI-facing field\n * metadata. Keys must match a declared `params[].name` (or `recordId`).\n */\n paramHints: z.record(z.string(), z.object({\n description: z.string().optional(),\n enum: z.array(z.union([z.string(), z.number()])).optional(),\n examples: z.array(z.unknown()).optional(),\n })).optional().describe('Per-parameter AI hints keyed by param name.'),\n\n /**\n * Output JSON Schema for the action's return value. Enables structured\n * downstream tool chaining (one action's output feeds another's input) and\n * is summarised into the tool description so the model knows what it gets\n * back. Optional — when omitted the return value is treated as freeform.\n */\n outputSchema: z.record(z.string(), z.unknown()).optional().describe('JSON Schema for the action return value.'),\n\n /**\n * Override confirmation for AI calls. When unset, the bridge defaults to\n * `true` for actions that look destructive (`confirmText` set, `mode:'delete'`,\n * or `variant:'danger'`). Set explicitly to `false` to assert a destructive-\n * looking action is safe to run without human approval, or `true` to force a\n * human-in-the-loop gate on an otherwise-safe action.\n */\n requiresConfirmation: z.boolean().optional().describe('Override HITL confirmation for AI invocations.'),\n});\n\nexport type ActionAi = z.infer<typeof ActionAiSchema>;\n\nexport const ActionSchema = lazySchema(() => z.object({\n /** Machine name of the action */\n name: SnakeCaseIdentifierSchema.describe('Machine name (lowercase snake_case)'),\n \n /** Display label */\n label: I18nLabelSchema.describe('Display label'),\n\n /** Target object this action belongs to (optional, snake_case) */\n objectName: z.string().regex(/^[a-z_][a-z0-9_]*$/).optional().describe('Target object this action belongs to. When set, the action is auto-merged into the object\\'s actions array by defineStack().'),\n \n /** Icon name (Lucide) */\n icon: z.string().optional().describe('Icon name'),\n\n /** Where does this action appear? */\n locations: z.array(ActionLocationSchema).optional().describe('Locations where this action is visible'),\n\n /** \n * Visual Component Type\n * Defaults to 'button' or 'menu_item' based on location,\n * but can be overridden.\n */\n component: z.enum([\n 'action:button', // Standard Button\n 'action:icon', // Icon only\n 'action:menu', // Dropdown menu\n 'action:group' // Button Group\n ]).optional().describe('Visual component override'),\n \n /** What type of interaction? */\n type: ActionType.default('script').describe('Action functionality type'),\n \n /** \n * Payload / Target — the canonical binding for the action handler.\n * Required for url, flow, modal, and api types.\n * For `script` type: prefer `body` over `target`. `target` is kept only for\n * legacy bundle.functions[name] references.\n *\n * **Interpolation** (renderer responsibility, all action types):\n * `target` MAY contain `${param.X}` and `${ctx.X}` tokens. Renderers\n * resolve them just before invocation:\n * - `${param.X}` — value collected from the action's params dialog.\n * - `${ctx.X}` — values from the action context: `ctx.origin`\n * (window.origin), `ctx.recordId`, `ctx.user.id`, `ctx.org.id`, etc.\n * Used by redirect-style actions like `link_social`, where the target is\n * e.g. `/api/v1/auth/sign-in/social?provider=${param.provider}&callbackURL=${ctx.origin}/_console/apps/account/sys_account`.\n * Renderers MUST `encodeURIComponent` interpolated values before\n * substituting them into URL query positions.\n */\n target: z.string().optional().describe('URL, Script Name, Flow ID, or API Endpoint. Supports ${param.X} and ${ctx.X} interpolation.'),\n\n /**\n * For `type:'url'` — where to open `target`. A simple, declarative new-tab\n * control for STATIC urls (no handler, no synchronous pre-open). objectui's\n * ActionRunner.executeUrl reads `openIn` with priority over the legacy\n * `params.newTab`/external-URL heuristic.\n *\n * - `'new-tab'` — opens `target` in a new browser tab.\n * - `'self'` — navigates in place.\n * - omitted — external/absolute URLs open in a new tab; relative URLs\n * navigate in place.\n *\n * Distinct from `opensInNewTab`/`newTabUrl`, which pre-open an about:blank\n * tab synchronously for ASYNC SSO-redirect handlers — do NOT use `openIn`\n * for those. This is a STATIC execution option: keep it OUT of `params`\n * (which is user-input-collection only).\n */\n openIn: z.enum(['self', 'new-tab']).optional().describe(\"For type:'url' — where to open `target`. 'new-tab' opens a new browser tab; 'self' navigates in place. When omitted, external/absolute URLs open in a new tab and relative URLs navigate in place. Static execution option — keep it OUT of `params` (which is user-input-collection only).\"),\n\n /**\n * Action Body (L1 expression or L2 sandboxed JS).\n *\n * Only meaningful when `type === 'script'`. When set, the runtime invokes\n * the body inside the sandbox as `(input, ctx) => Promise<output>` and\n * ignores `target`.\n *\n * - `{ language: 'expression', source: '...' }` — pure formula (L1).\n * - `{ language: 'js', source: '...', capabilities: [...] }` — sandboxed JS (L2).\n *\n * Compiled-module bodies are not supported. Outbound IO (HTTP, etc.) goes\n * through Connector recipes (separate spec).\n */\n body: HookBodySchema.optional().describe('Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`.'),\n\n /** \n * @deprecated Use `target` instead. This field is auto-migrated to `target` during parsing.\n */\n execute: z.string().optional().describe('@deprecated — Use target instead. Auto-migrated to target during parsing.'),\n \n /** User Input Requirements */\n params: z.array(ActionParamSchema).optional().describe('Input parameters required from user'),\n \n /** Visual Style */\n variant: z.enum(['primary', 'secondary', 'danger', 'ghost', 'link']).optional().describe('Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent)'),\n\n /** UX Behavior */\n confirmText: I18nLabelSchema.optional().describe('Confirmation message before execution'),\n successMessage: I18nLabelSchema.optional().describe('Success message to show after execution'),\n // Runtime (ActionRunner) already honours this — declared here so authors can\n // set a friendly failure toast instead of surfacing the raw error string.\n errorMessage: I18nLabelSchema.optional().describe('Error message to show when the action fails (overrides the raw error).'),\n refreshAfter: z.boolean().default(false).describe('Refresh view after execution'),\n // Single-record update actions only. When true, the runtime captures the\n // record's prior field values and offers an \"Undo\" affordance on the success\n // toast (backed by the client UndoManager) to restore them.\n undoable: z.boolean().optional().describe('Offer an Undo affordance after this single-record update action succeeds.'),\n\n /**\n * Result Dialog — describe how to render the API response on success.\n *\n * When set and the action returns successfully, the renderer SHOULD open a\n * dialog showing the selected fields from `result.data` instead of the\n * `successMessage` toast. The dialog has an acknowledge button only — the\n * user must explicitly close it. Used for **one-shot reveals** of values\n * the user must copy now because they cannot be retrieved later:\n *\n * - TOTP enrollment URI + secret (`enable_two_factor`)\n * - Backup recovery codes (`regenerate_backup_codes`)\n * - Freshly minted OAuth `client_secret` (`rotate_client_secret`,\n * `create_oauth_application`)\n *\n * `fields` selects what to render and how. Each entry's `path` is a dot\n * path into `result.data` (e.g. `'totpURI'`, `'backupCodes'`,\n * `'client.client_secret'`). When `fields` is omitted, the renderer falls\n * back to JSON-printing the whole response under a single block.\n *\n * `format` (dialog-level) is a default for fields that don't carry their\n * own `format`; the per-field `format` always wins.\n *\n * Renderer contract (objectui):\n * - `qrcode` — render the value as a QR code; also render the raw string\n * underneath with a copy button (so the user can paste into apps that\n * don't scan).\n * - `code-list` — value must be an array of strings; render each in a\n * monospace row with per-row copy and a \"Copy all\" affordance.\n * - `secret` — render a single string masked by default with a reveal\n * toggle and copy button.\n * - `text` — plain text with copy.\n * - `json` — pretty-printed JSON in a monospace block.\n *\n * The dialog SHOULD set `refreshAfter` to true on close (separate from\n * the existing `refreshAfter` flag, which fires immediately on success).\n */\n resultDialog: z.object({\n title: I18nLabelSchema.optional(),\n description: I18nLabelSchema.optional(),\n acknowledge: I18nLabelSchema.optional().describe('Acknowledge button label, e.g. \"I have saved this\"'),\n format: z.enum(['qrcode', 'code-list', 'secret', 'text', 'json']).optional().describe('Default format for fields without their own format. Defaults to json when omitted.'),\n fields: z.array(z.object({\n path: z.string().describe('Dot path into result.data (e.g. \"totpURI\", \"client.client_secret\").'),\n label: I18nLabelSchema.optional(),\n format: z.enum(['qrcode', 'code-list', 'secret', 'text', 'json']).optional().describe('Per-field format override.'),\n })).optional().describe('Which fields from result.data to render. Omit to dump full JSON.'),\n }).optional().describe('Render API response in a one-shot reveal dialog (suppresses successMessage when set).'),\n \n /** Access */\n visible: ExpressionInputSchema.optional().describe('Visibility predicate (CEL).'),\n disabled: z.union([z.boolean(), ExpressionInputSchema]).optional().describe('Boolean or predicate (CEL) — action is disabled when TRUE.'),\n\n /**\n * [ADR-0066 D4] System capabilities required to INVOKE this action — a\n * dual-surface gate from ONE declaration: the server (action route) rejects\n * the call with 403 when the caller's systemPermissions don't cover these (the\n * source of truth), and the objectui ActionRunner hides/disables the button\n * using the same requirement. Independent of `visible` (CEL): this is the RBAC\n * capability contract, mirroring `App.requiredPermissions`.\n */\n requiredPermissions: z.array(z.string()).optional().describe('[ADR-0066 D4] Capabilities required to invoke this action (server-enforced 403 + UI hide/disable).'),\n\n /** Keyboard Shortcut */\n shortcut: z.string().optional().describe('Keyboard shortcut to trigger this action (e.g., \"Ctrl+S\")'),\n\n /** Bulk Operations */\n bulkEnabled: z.boolean().optional().describe('Whether this action can be applied to multiple selected records'),\n\n /**\n * AI exposure block (ADR-0011). Opt-in, default off: an action is exposed\n * to AI agents only when `ai.exposed === true`, in which case `ai.description`\n * is required. See {@link ActionAiSchema}.\n */\n ai: ActionAiSchema.optional().describe('AI exposure (opt-in). Set ai.exposed=true + ai.description to make this callable by agents.'),\n\n /**\n * Row-context: when the action runs from a list_item location, this body key\n * receives the row's id (or the field named by `recordIdField`). Defaults to\n * `id` when omitted but `recordIdField` is set; otherwise no injection.\n */\n recordIdParam: z.string().optional().describe('Body key to inject the row id into when running from a list_item context.'),\n /**\n * Row field whose value seeds `recordIdParam`. Defaults to `'id'` when\n * `recordIdParam` is set. Use this when the body key expects a non-id value\n * (e.g. `token` for `revoke-session`).\n */\n recordIdField: z.string().optional().describe('Row field whose value seeds recordIdParam. Defaults to \"id\".'),\n /**\n * Request-body shape. `'flat'` (default) sends collected params at the top\n * level. `{ wrap: 'data' }` nests the user-collected params under that key\n * (used by better-auth `organization/update`), while `recordIdParam` and\n * other top-level keys stay flat.\n */\n bodyShape: z.union([\n z.literal('flat'),\n z.object({ wrap: z.string() }),\n ]).optional().describe('Body wrapping: flat (default) or { wrap: key } to nest user-collected params under a key.'),\n /**\n * HTTP method to use when `type: 'api'`. Defaults to `POST`. Use `PATCH` to\n * call data-API update endpoints (e.g. `/api/v1/sys_api_key/{id}` with\n * `bodyExtra: { revoked: true }`).\n */\n method: z.enum(['POST', 'PATCH', 'PUT', 'DELETE']).optional().describe('HTTP method for type:\"api\" actions. Defaults to POST.'),\n /**\n * Static body fragment merged into the outgoing request body for `type:'api'`\n * actions. Useful for constants the user shouldn't (or can't) edit, e.g.\n * `bodyExtra: { resend: true }` on a resend-invitation action that reuses\n * better-auth's `invite-member` endpoint. Applied after user-collected\n * params and `recordIdParam` so constants always win.\n */\n bodyExtra: z.record(z.string(), z.unknown()).optional().describe('Constant body fields merged into the API request (applied last; overrides user params).'),\n /**\n * Semantic mode hint — UI / runtime can use this to pick confirm copy,\n * default variants, success messaging. Pure metadata; no runtime branching.\n */\n mode: z.enum(['create', 'edit', 'delete', 'custom']).optional().describe('Semantic mode of the action.'),\n\n /**\n * Open the action's result in a NEW TAB. The renderer pre-opens the tab\n * synchronously on click (preserving the user gesture so popup blockers\n * don't fire), paints a progress page, then drives the tab to the\n * handler's returned `redirectUrl` — or, when `newTabUrl` is set, straight\n * to that URL with no server round trip.\n */\n opensInNewTab: z.boolean().optional().describe('Open the action result in a new tab. The renderer pre-opens the tab synchronously on click (popup-blocker-safe) and navigates it to the handler\\'s redirectUrl.'),\n\n /**\n * Zero-roundtrip new-tab target. A path template the renderer navigates\n * the pre-opened tab to IMMEDIATELY on click, skipping the action POST\n * entirely. Only valid together with `opensInNewTab`. The target endpoint\n * MUST perform all auth/authz itself (e.g. the cloud `/sso-open` endpoint,\n * which re-runs every check the POST half would have done). Supports the\n * `{recordId}` placeholder, URL-encoded on substitution.\n */\n newTabUrl: z.string().optional().describe('Direct new-tab URL template ({recordId} placeholder). When set with opensInNewTab, the renderer navigates the pre-opened tab here immediately — no action POST. The endpoint must enforce auth itself.'),\n\n /** Execution */\n timeout: z.number().optional().describe('Maximum execution time in milliseconds for the action'),\n\n /** ARIA accessibility attributes */\n aria: AriaPropsSchema.optional().describe('ARIA accessibility attributes'),\n}).transform((data) => {\n // Auto-migrate deprecated `execute` → `target` for backward compatibility\n if (data.execute && !data.target) {\n return { ...data, target: data.execute };\n }\n return data;\n}).refine((data) => {\n // Require `target` for types that reference an external resource\n if (TARGET_REQUIRED_TYPES.has(data.type) && !data.target) {\n return false;\n }\n return true;\n}, {\n message: \"Action 'target' is required when type is 'url', 'flow', 'modal', 'api', or 'form'.\",\n path: ['target'],\n}).refine((data) => {\n // A `script` action must be *executable*: it needs either an inline `body`\n // (the runtime invokes it in the sandbox) or a `target` naming a registered\n // bundle function. With neither, AppPlugin registers no engine handler and\n // the action fails at runtime with `Action '<name>' on object '*' not found`\n // (the #2169 Mark Done bug) — a soft failure invisible to build & shape\n // tests. Reject it at author/compile time instead.\n if (data.type === 'script' && !data.body && !data.target) {\n return false;\n }\n return true;\n}, {\n message:\n \"A 'script' action requires either an inline `body` (sandboxed L1/L2 handler) or a `target` (a registered bundle function name).\",\n path: ['body'],\n}).refine((data) => {\n // ADR-0011: an exposed action must carry an LLM-facing description.\n if (data.ai?.exposed === true && !data.ai.description) {\n return false;\n }\n return true;\n}, {\n message: 'ai.description is required (≥40 chars) when ai.exposed is true.',\n path: ['ai', 'description'],\n}).refine((data) => {\n // ADR-0011: paramHints keys must reference a declared param (or the\n // auto-injected `recordId`), so a typo can't silently no-op.\n const hints = data.ai?.paramHints;\n if (!hints) return true;\n const known = new Set<string>(['recordId']);\n for (const p of data.params ?? []) {\n const key = p.name ?? p.field;\n if (key) known.add(key);\n }\n return Object.keys(hints).every((k) => known.has(k));\n}, {\n message: 'ai.paramHints keys must match a declared param name (or \"recordId\").',\n path: ['ai', 'paramHints'],\n}));\n\nexport type Action = z.infer<typeof ActionSchema>;\nexport type ActionParam = z.infer<typeof ActionParamSchema>;\nexport type ActionInput = z.input<typeof ActionSchema>;\n\n/**\n * Action Factory Helper\n */\nexport const Action = {\n create: (config: z.input<typeof ActionSchema>): Action => ActionSchema.parse(config),\n} as const;\n\n/**\n * Type-safe factory for a global or object action. Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: Action` literal.\n */\nexport function defineAction(config: z.input<typeof ActionSchema>): Action {\n return ActionSchema.parse(config);\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * # Metadata Protection Model — Phase 1 (ADR-0010)\n *\n * Phase 1 introduces the **item-level lock** (`_lock`) and the\n * provenance / package tags that drive it. Later phases extend this\n * file with the path-level (`_frozenPaths`) and package-level\n * (`metadataDefaults`) layers; the wire shapes here are forward-\n * compatible with those additions.\n *\n * Wire / runtime contract:\n * - `_lock` — 4-state enum, controls overlay / delete actions.\n * - `_lockReason` — short, user-visible explanation surfaced in\n * `403 item_locked` errors and on Studio tooltips.\n * - `_lockSource` — which layer set the lock (Phase 1 only emits\n * `'artifact'`; `'package'` and `'env-forced'`\n * are reserved for Phase 3/2 respectively).\n * - `_provenance` — `'package'` for loader-introduced items,\n * `'org'` for tenant-authored, `'env-forced'`\n * reserved for emergency overrides.\n * - `_packageId` / `_packageVersion` — denormalised from the\n * registry tag so consumers don't need a second\n * round-trip to inspect provenance.\n *\n * See `docs/adr/0010-metadata-protection-model.md` for the full\n * design (industry references, 4-layer model, audit trail).\n */\n\n// ─────────────────────────────────────────────────────────────────────\n// Enums\n// ─────────────────────────────────────────────────────────────────────\n\n/**\n * 4-state lock enum.\n *\n * | Value | Save (PUT / publish / rollback) | Delete |\n * |---------------|---------------------------------|--------|\n * | `none` | allow | allow |\n * | `no-overlay` | **deny** (403 item_locked) | allow |\n * | `no-delete` | allow | **deny** |\n * | `full` | **deny** | **deny** |\n *\n * `allowRuntimeCreate` for **brand-new** items is governed by the\n * type-level L1 registry flag and is never affected by `_lock`\n * (which describes an existing item). See ADR-0010 §3.3.\n */\nexport const MetadataLockSchema = z.enum(['none', 'no-overlay', 'no-delete', 'full']);\nexport type MetadataLock = z.infer<typeof MetadataLockSchema>;\n\n/** Where the `_lock` declaration came from. Reserved enum for forward compatibility. */\nexport const MetadataLockSourceSchema = z.enum(['artifact', 'package', 'env-forced']);\nexport type MetadataLockSource = z.infer<typeof MetadataLockSourceSchema>;\n\n/** Where the metadata item originated. */\nexport const MetadataProvenanceSchema = z.enum(['package', 'org', 'env-forced']);\nexport type MetadataProvenance = z.infer<typeof MetadataProvenanceSchema>;\n\n// ─────────────────────────────────────────────────────────────────────\n// Mixin — raw shape that schemas spread into themselves\n// ─────────────────────────────────────────────────────────────────────\n\n/**\n * Raw shape spliced into each metadata Zod schema that wants to expose\n * the optional protection envelope to its TS authors. Implemented as a\n * Zod raw shape (not a wrapping schema) so it composes with the\n * existing `z.object({ ... })` patterns without needing to introduce\n * a refinement layer.\n *\n * Usage:\n * ```ts\n * const AppSchema = z.object({\n * name: z.string(),\n * // …\n * ...MetadataProtectionFields,\n * });\n * ```\n */\nexport const MetadataProtectionFields = {\n /**\n * Per-item lock declaration. Defaults to `'none'` when omitted.\n * Enforced by the runtime protocol on save / publish / rollback /\n * delete. See ADR-0010 §3.3.\n */\n _lock: MetadataLockSchema.optional().describe(\n 'Item-level lock — controls overlay & delete (ADR-0010).',\n ),\n\n /**\n * Short, user-visible explanation surfaced in `403 item_locked`\n * error envelopes and Studio tooltips. Keep < 200 chars.\n */\n _lockReason: z.string().max(500).optional().describe(\n 'Human-readable reason shown when a write is refused by _lock.',\n ),\n\n /**\n * Which layer asserted the lock — Phase 1 only emits `'artifact'`.\n * Reserved for Phase 2/3 (`'package'`, `'env-forced'`).\n */\n _lockSource: MetadataLockSourceSchema.optional().describe(\n 'Layer that set _lock (artifact | package | env-forced).',\n ),\n\n /**\n * `'package'` — introduced by a loader from npm-package source.\n * `'org'` — authored by a tenant via the metadata API.\n * `'env-forced'` — emergency overrides via the unlock list.\n */\n _provenance: MetadataProvenanceSchema.optional().describe(\n 'Origin of the item (package | org | env-forced).',\n ),\n\n /** Owning package machine id (e.g. `com.objectstack.setup`). */\n _packageId: z.string().optional().describe('Owning package machine id.'),\n\n /** Owning package semver. */\n _packageVersion: z.string().optional().describe('Owning package version.'),\n\n /**\n * Optional URL the Studio lock banner links to for more context.\n * Populated by the loader from the author-facing\n * `protection.docsUrl` field — see `shared/protection.zod.ts`.\n */\n _lockDocsUrl: z.string().optional().describe(\n 'Optional documentation link surfaced next to _lockReason.',\n ),\n} as const;\n\n// ─────────────────────────────────────────────────────────────────────\n// Helpers\n// ─────────────────────────────────────────────────────────────────────\n\n/**\n * Read the protection envelope off any candidate item. Safe to call\n * on `undefined`, primitives, or items that have no protection fields\n * at all — returns a fully-defaulted record.\n */\nexport function extractProtection(item: unknown): {\n lock: MetadataLock;\n lockReason: string | undefined;\n lockSource: MetadataLockSource | undefined;\n lockDocsUrl: string | undefined;\n provenance: MetadataProvenance | undefined;\n packageId: string | undefined;\n packageVersion: string | undefined;\n} {\n const empty = {\n lock: 'none' as MetadataLock,\n lockReason: undefined,\n lockSource: undefined,\n lockDocsUrl: undefined,\n provenance: undefined,\n packageId: undefined,\n packageVersion: undefined,\n };\n if (!item || typeof item !== 'object') return empty;\n const rec = item as Record<string, unknown>;\n const lockRaw = rec['_lock'];\n const lock = typeof lockRaw === 'string' && MetadataLockSchema.options.includes(lockRaw as MetadataLock)\n ? (lockRaw as MetadataLock)\n : 'none';\n const lockReason = typeof rec['_lockReason'] === 'string' ? (rec['_lockReason'] as string) : undefined;\n const lockSource = typeof rec['_lockSource'] === 'string'\n && MetadataLockSourceSchema.options.includes(rec['_lockSource'] as MetadataLockSource)\n ? (rec['_lockSource'] as MetadataLockSource)\n : undefined;\n const lockDocsUrl = typeof rec['_lockDocsUrl'] === 'string' ? (rec['_lockDocsUrl'] as string) : undefined;\n const provenance = typeof rec['_provenance'] === 'string'\n && MetadataProvenanceSchema.options.includes(rec['_provenance'] as MetadataProvenance)\n ? (rec['_provenance'] as MetadataProvenance)\n : undefined;\n const packageId = typeof rec['_packageId'] === 'string' ? (rec['_packageId'] as string) : undefined;\n const packageVersion = typeof rec['_packageVersion'] === 'string' ? (rec['_packageVersion'] as string) : undefined;\n return { lock, lockReason, lockSource, lockDocsUrl, provenance, packageId, packageVersion };\n}\n\n/**\n * Decide whether a write-style operation (PUT / publish / rollback)\n * is allowed under the given lock state.\n *\n * Returns `null` on allow. Returns a structured refusal envelope when\n * the lock blocks the operation; the protocol layer turns that into a\n * `403 item_locked` HTTP error.\n */\nexport function evaluateLockForWrite(lock: MetadataLock): { code: 'item_locked'; reason: string } | null {\n if (lock === 'no-overlay' || lock === 'full') {\n return { code: 'item_locked', reason: `Write refused — _lock=${lock}` };\n }\n return null;\n}\n\n/** Counterpart of {@link evaluateLockForWrite} for delete operations. */\nexport function evaluateLockForDelete(lock: MetadataLock): { code: 'item_locked'; reason: string } | null {\n if (lock === 'no-delete' || lock === 'full') {\n return { code: 'item_locked', reason: `Delete refused — _lock=${lock}` };\n }\n return null;\n}\n\n/**\n * Derive the read-side flags Studio needs to render the UI. The\n * `editable` / `deletable` / `resettable` triple is what the\n * `GET /meta/:type/:name` response carries in Phase 1. See ADR-0010 §5.\n */\nexport function resolveLockState(item: unknown, artifactBacked: boolean): {\n lock: MetadataLock;\n lockReason: string | undefined;\n lockSource: MetadataLockSource | undefined;\n lockDocsUrl: string | undefined;\n provenance: MetadataProvenance | undefined;\n packageId: string | undefined;\n packageVersion: string | undefined;\n editable: boolean;\n deletable: boolean;\n resettable: boolean;\n} {\n const p = extractProtection(item);\n const editable = p.lock !== 'no-overlay' && p.lock !== 'full';\n const deletable = p.lock !== 'no-delete' && p.lock !== 'full';\n // Reset only makes sense when there is something to reset *to* —\n // i.e. the artifact is package-backed and an overlay can be peeled\n // off. Phase 3 will surface this through a dedicated endpoint; for\n // Phase 1 we publish the boolean so Studio can pre-disable the\n // button when artifactBacked is false.\n const resettable = artifactBacked;\n return { ...p, editable, deletable, resettable };\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * # Package-level metadata protection (ADR-0010 §3.7 — Phase 4.3)\n *\n * Public, type-safe author surface for package authors to declare\n * how much of one of their metadata items the runtime (and the\n * tenant's Studio) is allowed to mutate. Internally this is what\n * gets translated into the `_lock` / `_lockReason` / `_lockDocsUrl`\n * private envelope (`kernel/metadata-protection.zod.ts`) that the\n * protocol layer enforces.\n *\n * Why two layers?\n * - **`protection`** is the *author DX* surface — typed, validated,\n * and discoverable via IntelliSense on every `*.app.ts` /\n * `*.object.ts` / `*.view.ts` etc.\n * - **`_lock` envelope** is the *runtime* surface — strips off the\n * protection block on load and stamps the private fields so the\n * persistence and overlay layers don't drag the author-facing\n * block through every `sys_metadata` overlay diff.\n *\n * Example:\n * ```ts\n * export const SETUP_APP: App = {\n * name: 'setup',\n * label: 'Setup',\n * protection: {\n * lock: 'full',\n * reason: 'Core admin UI shipped by @objectstack/platform-objects.',\n * docsUrl: 'https://docs.objectstack.ai/adr/0010-metadata-protection',\n * },\n * // ...\n * };\n * ```\n *\n * The loader (`metadata/plugin.ts` + `objectql/registry.ts`) calls\n * {@link applyProtection} to translate this block into the private\n * `_lock` envelope at registration time. Authors should NEVER set\n * the underscored fields directly — they are an implementation\n * detail.\n *\n * See also:\n * - ADR-0010 §3.7 — Future work → now implemented.\n * - `kernel/metadata-protection.zod.ts` — the runtime envelope.\n */\n\nimport { z } from 'zod';\nimport {\n MetadataLockSchema,\n type MetadataLock,\n} from '../kernel/metadata-protection.zod';\n\n/**\n * Public protection block authored by package developers. Optional on\n * every lockable metadata type — omit to leave the item fully\n * overlay-editable and overlay-deletable (default behaviour).\n *\n * The shape is intentionally *small*: only the fields that have a\n * meaningful UX impact in Studio are exposed. Internal bookkeeping\n * (provenance, packageId, packageVersion) is auto-populated by the\n * loader and must not be supplied here.\n */\nexport const ProtectionSchema = z.object({\n /**\n * Lock policy for this item. See {@link MetadataLockSchema} for\n * the full semantics table.\n *\n * | Value | Save | Delete |\n * |---------------|------|--------|\n * | `none` | ✅ | ✅ |\n * | `no-overlay` | ❌ | ✅ |\n * | `no-delete` | ✅ | ❌ |\n * | `full` | ❌ | ❌ |\n *\n * `no-overlay` is recommended for \"structural\" items that should\n * stay authoritative but allow side-by-side extension (e.g. core\n * objects whose fields can be extended via `objectExtensions`).\n * `full` is for items that have no safe extension point at all\n * (e.g. the platform Setup app whose nav tree is wired directly\n * into framework code).\n */\n lock: MetadataLockSchema.describe(\n 'Lock policy — none | no-overlay | no-delete | full.',\n ),\n\n /**\n * Short user-visible explanation surfaced in `403 item_locked`\n * errors and the Studio lock banner. Aim for one sentence; the\n * banner truncates long values.\n */\n reason: z.string().min(1).max(500).describe(\n 'User-visible reason shown when the lock blocks an action.',\n ),\n\n /**\n * Optional documentation link rendered next to the reason in\n * the Studio lock banner. Use it to point operators at the\n * package's protection policy or to a \"how to customise this\"\n * guide. Must be a fully-qualified URL.\n */\n docsUrl: z.string().url().optional().describe(\n 'Optional URL the Studio banner links to for more context.',\n ),\n}).strict();\n\nexport type Protection = z.infer<typeof ProtectionSchema>;\n\n// ─────────────────────────────────────────────────────────────────────\n// Loader-side translation\n// ─────────────────────────────────────────────────────────────────────\n\n/** Loader context handed in by the registration pipeline. */\nexport interface ApplyProtectionContext {\n /** Owning package id (e.g. `com.objectstack.platform-objects`). */\n packageId?: string;\n /** Owning package semver. */\n packageVersion?: string;\n /**\n * `'package'` for items introduced by a package loader (default).\n * Pass `'env-forced'` when the runtime is materialising an\n * emergency override.\n */\n provenance?: 'package' | 'env-forced';\n}\n\n/**\n * Translate the author-facing `protection` block on `item` into the\n * private `_lock` envelope and strip the public block so it never\n * leaks into the overlay row.\n *\n * Safe to call on any object: items without `protection` are returned\n * unchanged (other than the standard `_packageId` / `_packageVersion`\n * stamping that always runs when the context supplies those fields).\n *\n * Always **mutates** `item` and returns it for chaining.\n */\nexport function applyProtection<T extends Record<string, unknown>>(\n item: T,\n ctx: ApplyProtectionContext = {},\n): T {\n if (!item || typeof item !== 'object') return item;\n\n // Stamp provenance / package coords first so they apply even when\n // there is no `protection` block. The loader pipeline used to do\n // _packageId stamping itself; centralising it here keeps the two\n // load paths (artifact loader + registry.registerItem) consistent.\n if (ctx.packageId && (item as any)._packageId === undefined) {\n (item as any)._packageId = ctx.packageId;\n }\n if (ctx.packageVersion && (item as any)._packageVersion === undefined) {\n (item as any)._packageVersion = ctx.packageVersion;\n }\n // Only stamp provenance when we actually have package coords or an\n // author-facing protection block; otherwise leave the item alone so\n // that DB-only / test fixtures don't acquire an unexpected\n // `_provenance` field. The loader passes packageId for genuine\n // package items; bare `registerItem(type, item)` calls without a\n // package context still produce a clean item.\n const hasProtectionBlock =\n (item as any).protection\n && typeof (item as any).protection === 'object';\n if (\n (ctx.packageId || hasProtectionBlock)\n && (item as any)._provenance === undefined\n ) {\n (item as any)._provenance = ctx.provenance ?? 'package';\n }\n\n const block = (item as any).protection;\n if (!block || typeof block !== 'object') return item;\n\n // Author-facing block exists — translate to the private envelope.\n // We accept partial values (lock alone, reason alone) and let the\n // protocol layer fall back to defaults; full Zod validation runs\n // upstream when the schemas were composed with ProtectionSchema.\n const lock = block.lock as MetadataLock | undefined;\n const reason = typeof block.reason === 'string' ? block.reason : undefined;\n const docsUrl = typeof block.docsUrl === 'string' ? block.docsUrl : undefined;\n\n if (lock !== undefined) {\n (item as any)._lock = lock;\n }\n if (reason !== undefined) {\n (item as any)._lockReason = reason;\n }\n if (docsUrl !== undefined) {\n (item as any)._lockDocsUrl = docsUrl;\n }\n // Lock source is 'package' for anything that came through this\n // helper. Artifact-only items (no packageId) fall back to\n // 'artifact' to preserve the Phase-1 contract.\n if ((item as any)._lockSource === undefined) {\n (item as any)._lockSource = ctx.packageId ? 'package' : 'artifact';\n }\n\n // Strip the public block — it lives only on the author-side\n // module, never on the persisted overlay row.\n delete (item as any).protection;\n\n return item;\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * @module ui/sharing\n *\n * Sharing & Embedding Protocol\n *\n * Defines schemas for public link sharing, embed configuration,\n * domain restrictions, and password protection for apps, pages, and forms.\n */\n\nimport { z } from 'zod';\n\n/**\n * Sharing Config Schema\n * Configuration for public sharing of an app, page, or form.\n * Supports public links, password protection, domain restrictions, and expiration.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SharingConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable public sharing'),\n publicLink: z.string().optional().describe('Generated public share URL'),\n password: z.string().optional().describe('Password required to access shared link'),\n allowedDomains: z.array(z.string()).optional()\n .describe('Restrict access to specific email domains (e.g. [\"example.com\"])'),\n expiresAt: z.string().optional()\n .describe('Expiration date/time in ISO 8601 format'),\n allowAnonymous: z.boolean().optional().default(false)\n .describe('Allow access without authentication'),\n}));\n\n/**\n * Embed Config Schema\n * Configuration for iframe embedding of an app, page, or form.\n * Supports origin restrictions, display options, and responsive sizing.\n */\nexport const EmbedConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable iframe embedding'),\n allowedOrigins: z.array(z.string()).optional()\n .describe('Allowed iframe parent origins (e.g. [\"https://example.com\"])'),\n width: z.string().optional().default('100%').describe('Embed width (CSS value)'),\n height: z.string().optional().default('600px').describe('Embed height (CSS value)'),\n showHeader: z.boolean().optional().default(true).describe('Show interface header in embed'),\n showNavigation: z.boolean().optional().default(false).describe('Show navigation in embed'),\n responsive: z.boolean().optional().default(true).describe('Enable responsive resizing'),\n}));\n\n// Type Exports\nexport type SharingConfig = z.infer<typeof SharingConfigSchema>;\nexport type EmbedConfig = z.infer<typeof EmbedConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Breakpoint Name Enum\n * Matches the breakpoint names defined in theme.zod.ts BreakpointsSchema.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const BreakpointName = z.enum(['xs', 'sm', 'md', 'lg', 'xl', '2xl']);\n\nexport type BreakpointName = z.infer<typeof BreakpointName>;\n\n/**\n * Responsive Configuration Schema\n *\n * Provides responsive layout configuration for UI components.\n * Maps breakpoint names to layout behavior (columns, visibility, order).\n *\n * Aligned with theme.zod.ts BreakpointsSchema for a unified responsive system.\n *\n * @example\n * ```typescript\n * const config: ResponsiveConfig = {\n * columns: { xs: 12, sm: 6, lg: 4 },\n * hiddenOn: ['xs'],\n * order: { xs: 2, lg: 1 },\n * };\n * ```\n */\n/**\n * Breakpoint Column Map Schema\n * Maps breakpoint names to grid column counts (1-12).\n * All entries are optional — only specified breakpoints are configured.\n */\nexport const BreakpointColumnMapSchema = lazySchema(() => z.object({\n xs: z.number().min(1).max(12).optional(),\n sm: z.number().min(1).max(12).optional(),\n md: z.number().min(1).max(12).optional(),\n lg: z.number().min(1).max(12).optional(),\n xl: z.number().min(1).max(12).optional(),\n '2xl': z.number().min(1).max(12).optional(),\n}).describe('Grid columns per breakpoint (1-12)'));\n\n/**\n * Breakpoint Order Map Schema\n * Maps breakpoint names to display order numbers.\n * All entries are optional — only specified breakpoints are configured.\n */\nexport const BreakpointOrderMapSchema = lazySchema(() => z.object({\n xs: z.number().optional(),\n sm: z.number().optional(),\n md: z.number().optional(),\n lg: z.number().optional(),\n xl: z.number().optional(),\n '2xl': z.number().optional(),\n}).describe('Display order per breakpoint'));\n\nexport const ResponsiveConfigSchema = lazySchema(() => z.object({\n /** Minimum breakpoint for visibility */\n breakpoint: BreakpointName.optional()\n .describe('Minimum breakpoint for visibility'),\n\n /** Hide on specific breakpoints */\n hiddenOn: z.array(BreakpointName).optional()\n .describe('Hide on these breakpoints'),\n\n /** Grid columns per breakpoint (1-12 column grid) */\n columns: BreakpointColumnMapSchema.optional().describe('Grid columns per breakpoint'),\n\n /** Display order per breakpoint */\n order: BreakpointOrderMapSchema.optional().describe('Display order per breakpoint'),\n}).describe('Responsive layout configuration'));\n\nexport type ResponsiveConfig = z.infer<typeof ResponsiveConfigSchema>;\n\n/**\n * Style Map Schema (ADR-0065)\n *\n * A CSS property → value map (camelCase keys, e.g. `flexDirection`). Values are\n * arbitrary CSS strings/numbers but authors should prefer design tokens\n * (`var(--space-6)`, `var(--surface)`) for consistency and AI-safety.\n */\nexport const StyleMapSchema = lazySchema(() =>\n z.record(z.string(), z.union([z.string(), z.number()]))\n .describe('CSS property → value map (camelCase keys; design tokens encouraged)'));\n\nexport type StyleMap = z.infer<typeof StyleMapSchema>;\n\n/**\n * Responsive Styles Schema (ADR-0065)\n *\n * Per-breakpoint CSS-property maps for the SDUI scoped-styling model. Compiled\n * to **id-scoped CSS at render** (objectui `SchemaRenderer`) — build-independent,\n * collision-free, responsive-correct. Desktop-first: `large` is the\n * unconditional base; `medium`/`small`/`xsmall` are `max-width` overrides.\n *\n * Distinct from {@link ResponsiveConfigSchema}, which configures *layout* (grid\n * columns / visibility / order) on the Tailwind `xs..2xl` axis. This styles a\n * node's own box; that arranges a node within a grid.\n */\nexport const ResponsiveStylesSchema = lazySchema(() => z.object({\n large: StyleMapSchema.optional().describe('Unconditional base (desktop-first)'),\n medium: StyleMapSchema.optional().describe('Applied at ≤ medium breakpoint'),\n small: StyleMapSchema.optional().describe('Applied at ≤ small breakpoint'),\n xsmall: StyleMapSchema.optional().describe('Applied at ≤ xsmall breakpoint'),\n}).describe('Per-breakpoint scoped style maps (ADR-0065)'));\n\nexport type ResponsiveStyles = z.infer<typeof ResponsiveStylesSchema>;\n\n/**\n * Performance Configuration Schema\n *\n * Defines performance optimization settings for UI components\n * such as lazy loading, virtual scrolling, and caching.\n *\n * @example\n * ```typescript\n * const perf: PerformanceConfig = {\n * lazyLoad: true,\n * virtualScroll: { enabled: true, itemHeight: 40, overscan: 5 },\n * cacheStrategy: 'stale-while-revalidate',\n * prefetch: true,\n * };\n * ```\n */\nexport const PerformanceConfigSchema = lazySchema(() => z.object({\n /** Enable lazy loading for this component */\n lazyLoad: z.boolean().optional()\n .describe('Enable lazy loading (defer rendering until visible)'),\n\n /** Virtual scrolling configuration for large datasets */\n virtualScroll: z.object({\n enabled: z.boolean().default(false).describe('Enable virtual scrolling'),\n itemHeight: z.number().optional().describe('Fixed item height in pixels (for estimation)'),\n overscan: z.number().optional().describe('Number of extra items to render outside viewport'),\n }).optional().describe('Virtual scrolling configuration'),\n\n /** Client-side caching strategy */\n cacheStrategy: z.enum([\n 'none',\n 'cache-first',\n 'network-first',\n 'stale-while-revalidate',\n ]).optional().describe('Client-side data caching strategy'),\n\n /** Enable data prefetching */\n prefetch: z.boolean().optional()\n .describe('Prefetch data before component is visible'),\n\n /** Maximum number of items to render before pagination */\n pageSize: z.number().optional()\n .describe('Number of items per page for pagination'),\n\n /** Debounce interval for user interactions (ms) */\n debounceMs: z.number().optional()\n .describe('Debounce interval for user interactions in milliseconds'),\n}).describe('Performance optimization configuration'));\n\nexport type PerformanceConfig = z.infer<typeof PerformanceConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Shared HTTP Schemas\n * \n * Common HTTP-related schemas used across API and System protocols.\n * These schemas ensure consistency across different parts of the stack.\n */\n\n// ==========================================\n// Basic HTTP Types\n// ==========================================\n\n/**\n * HTTP Method Enum\n */\nimport { lazySchema } from './lazy-schema';\nexport const HttpMethod = z.enum([\n 'GET', \n 'POST', \n 'PUT', \n 'DELETE', \n 'PATCH', \n 'HEAD', \n 'OPTIONS'\n]);\n\nexport type HttpMethod = z.infer<typeof HttpMethod>;\n\n/**\n * HTTP Method Schema (subset for UI/View data sources)\n * Common HTTP methods used in view data source configurations.\n * Migrated from ui/view.zod.ts to shared for reuse across modules.\n */\nexport const HttpMethodSchema = lazySchema(() => z.enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE']));\n\nexport type HttpMethodType = z.infer<typeof HttpMethodSchema>;\n\n/**\n * HTTP Request Configuration Schema\n * Defines a complete HTTP request configuration used by API data providers.\n * Migrated from ui/view.zod.ts to shared for reuse across modules.\n */\nexport const HttpRequestSchema = lazySchema(() => z.object({\n url: z.string().describe('API endpoint URL'),\n method: HttpMethodSchema.optional().default('GET').describe('HTTP method'),\n headers: z.record(z.string(), z.string()).optional().describe('Custom HTTP headers'),\n params: z.record(z.string(), z.unknown()).optional().describe('Query parameters'),\n body: z.unknown().optional().describe('Request body for POST/PUT/PATCH'),\n}));\n\nexport type HttpRequest = z.infer<typeof HttpRequestSchema>;\n\n// ==========================================\n// CORS Configuration\n// ==========================================\n\n/**\n * CORS Configuration Schema\n * Cross-Origin Resource Sharing configuration\n * \n * Used by:\n * - api/router.zod.ts (RouterConfigSchema)\n * - system/http-server.zod.ts (HttpServerConfigSchema)\n * \n * @example\n * {\n * \"enabled\": true,\n * \"origins\": [\"http://localhost:3000\", \"https://app.example.com\"],\n * \"methods\": [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n * \"credentials\": true,\n * \"maxAge\": 86400\n * }\n */\nexport const CorsConfigSchema = lazySchema(() => z.object({\n /**\n * Enable CORS\n */\n enabled: z.boolean().default(true).describe('Enable CORS'),\n \n /**\n * Allowed origins (* for all)\n */\n origins: z.union([\n z.string(),\n z.array(z.string())\n ]).default('*').describe('Allowed origins (* for all)'),\n \n /**\n * Allowed HTTP methods\n */\n methods: z.array(HttpMethod).optional().describe('Allowed HTTP methods'),\n \n /**\n * Allow credentials (cookies, authorization headers)\n */\n credentials: z.boolean().default(false).describe('Allow credentials (cookies, authorization headers)'),\n \n /**\n * Preflight cache duration in seconds\n */\n maxAge: z.number().int().optional().describe('Preflight cache duration in seconds'),\n}));\n\nexport type CorsConfig = z.infer<typeof CorsConfigSchema>;\n\n// ==========================================\n// Rate Limiting\n// ==========================================\n\n/**\n * Rate Limit Configuration Schema\n * \n * Used by:\n * - api/endpoint.zod.ts (ApiEndpointSchema)\n * - system/http-server.zod.ts (HttpServerConfigSchema)\n * \n * @example\n * {\n * \"enabled\": true,\n * \"windowMs\": 60000,\n * \"maxRequests\": 100\n * }\n */\nexport const RateLimitConfigSchema = lazySchema(() => z.object({\n /**\n * Enable rate limiting\n */\n enabled: z.boolean().default(false).describe('Enable rate limiting'),\n \n /**\n * Time window in milliseconds\n */\n windowMs: z.number().int().default(60000).describe('Time window in milliseconds'),\n \n /**\n * Max requests per window\n */\n maxRequests: z.number().int().default(100).describe('Max requests per window'),\n}));\n\nexport type RateLimitConfig = z.infer<typeof RateLimitConfigSchema>;\n\n// ==========================================\n// Static File Serving\n// ==========================================\n\n/**\n * Static Mount Configuration Schema\n * Configuration for serving static files\n * \n * Used by:\n * - api/router.zod.ts (RouterConfigSchema)\n * - system/http-server.zod.ts (HttpServerConfigSchema)\n * \n * @example\n * {\n * \"path\": \"/static\",\n * \"directory\": \"./public\",\n * \"cacheControl\": \"public, max-age=31536000\"\n * }\n */\nexport const StaticMountSchema = lazySchema(() => z.object({\n /**\n * URL path to serve from\n */\n path: z.string().describe('URL path to serve from'),\n \n /**\n * Physical directory to serve\n */\n directory: z.string().describe('Physical directory to serve'),\n \n /**\n * Cache-Control header value\n */\n cacheControl: z.string().optional().describe('Cache-Control header value'),\n}));\n\nexport type StaticMount = z.infer<typeof StaticMountSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { ProtectionSchema } from '../shared/protection.zod';\nimport { MetadataProtectionFields } from '../kernel/metadata-protection.zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\nimport { I18nLabelSchema, AriaPropsSchema } from './i18n.zod';\nimport { SharingConfigSchema } from './sharing.zod';\nimport { ResponsiveConfigSchema, PerformanceConfigSchema } from './responsive.zod';\nimport { FieldType, SelectOptionSchema } from '../data/field.zod';\n\n/**\n * HTTP Method Enum & HTTP Request Schema\n * Migrated to shared/http.zod.ts. Re-exported here for backward compatibility.\n */\nimport { HttpMethodSchema, HttpRequestSchema } from '../shared/http.zod';\nimport { lazySchema } from '../shared/lazy-schema';\nexport { HttpMethodSchema, HttpRequestSchema };\n\n/**\n * View Data Source Configuration\n * Supports three modes:\n * 1. 'object': Standard Protocol - Auto-connects to ObjectStack Metadata and Data APIs\n * 2. 'api': Custom API - Explicitly provided API URLs\n * 3. 'value': Static Data - Hardcoded data array\n */\nexport const ViewDataSchema = lazySchema(() => z.discriminatedUnion('provider', [\n z.object({\n provider: z.literal('object'),\n object: z.string().describe('Target object name'),\n }),\n z.object({\n provider: z.literal('api'),\n read: HttpRequestSchema.optional().describe('Configuration for fetching data'),\n write: HttpRequestSchema.optional().describe('Configuration for submitting data (for forms/editable tables)'),\n }),\n z.object({\n provider: z.literal('value'),\n items: z.array(z.unknown()).describe('Static data array'),\n }),\n /**\n * Schema-bound data source — used by standalone forms whose data is\n * shaped by a JSON Schema (or Zod-derived schema) rather than by an\n * ObjectQL object. Powers the metadata editor, action input dialogs,\n * and any Form that is not bound to a CRUD object.\n */\n z.object({\n provider: z.literal('schema'),\n /** Schema identifier (e.g. metadata type name \"report\"). Resolved at runtime against /meta entries. */\n schemaId: z.string().describe('Schema identifier — typically the metadata type name'),\n /** Optional inline JSON Schema; when omitted the runtime resolves schemaId from the server. */\n schema: z.record(z.string(), z.unknown()).optional().describe('Inline JSON Schema (Draft 2020-12). Optional when schemaId is resolvable.'),\n }),\n]));\n\n/**\n * View Filter Rule Schema\n * Standardized filter condition used in list views, tabs, and page-level filters.\n * Uses a declarative array-of-objects format: [{ field, operator, value }].\n *\n * @example\n * ```ts\n * filter: [\n * { field: 'status', operator: 'equals', value: 'active' },\n * { field: 'close_date', operator: 'this_quarter' },\n * ]\n * ```\n */\nexport const ViewFilterRuleSchema = lazySchema(() => z.object({\n /** Field name to filter on */\n field: z.string().describe('Field name to filter on'),\n /** Filter operator */\n operator: z.string().describe('Filter operator (e.g. equals, not_equals, contains, this_quarter)'),\n /** Filter value (optional for unary operators like is_null, this_quarter) */\n value: z.union([z.string(), z.number(), z.boolean(), z.null(), z.array(z.union([z.string(), z.number()]))])\n .optional().describe('Filter value'),\n}).describe('View filter rule'));\n\nexport type ViewFilterRule = z.infer<typeof ViewFilterRuleSchema>;\n\n/**\n * Column Summary Function Schema\n * Aggregation function for column footer (Airtable-style column summaries)\n */\nexport const ColumnSummarySchema = lazySchema(() => z.enum([\n 'none',\n 'count',\n 'count_empty',\n 'count_filled',\n 'count_unique',\n 'percent_empty',\n 'percent_filled',\n 'sum',\n 'avg',\n 'min',\n 'max',\n]).describe('Aggregation function for column footer summary'));\n\n/**\n * List Column Configuration Schema\n * Detailed configuration for individual list view columns\n */\nexport const ListColumnSchema = lazySchema(() => z.object({\n field: z.string().describe('Field name (snake_case)'),\n label: I18nLabelSchema.optional().describe('Display label override'),\n width: z.number().positive().optional().describe('Column width in pixels'),\n align: z.enum(['left', 'center', 'right']).optional().describe('Text alignment'),\n hidden: z.boolean().optional().describe('Hide column by default'),\n sortable: z.boolean().optional().describe('Allow sorting by this column'),\n resizable: z.boolean().optional().describe('Allow resizing this column'),\n wrap: z.boolean().optional().describe('Allow text wrapping'),\n type: z.string().optional().describe('Renderer type override (e.g., \"currency\", \"date\")'),\n\n /** Pinning (Airtable-style frozen columns) */\n pinned: z.enum(['left', 'right']).optional().describe('Pin/freeze column to left or right side'),\n\n /** Column Footer Summary (Airtable-style aggregation) */\n summary: ColumnSummarySchema.optional().describe('Footer aggregation function for this column'),\n\n /** Interaction */\n link: z.boolean().optional().describe('Functions as the primary navigation link (triggers View navigation)'),\n action: z.string().optional().describe('Registered Action ID to execute when clicked'),\n}));\n\n/**\n * List View Selection Configuration\n */\nexport const SelectionConfigSchema = lazySchema(() => z.object({\n type: z.enum(['none', 'single', 'multiple']).default('none').describe('Selection mode'),\n}));\n\n/**\n * List View Pagination Configuration\n */\nexport const PaginationConfigSchema = lazySchema(() => z.object({\n pageSize: z.number().int().positive().default(25).describe('Number of records per page'),\n pageSizeOptions: z.array(z.number().int().positive()).optional().describe('Available page size options'),\n}));\n\n/**\n * Row Height / Density Schema (Airtable-style)\n * Controls the visual density of rows in a list view.\n */\nexport const RowHeightSchema = lazySchema(() => z.enum([\n 'compact', // Minimal padding, single line\n 'short', // Reduced padding\n 'medium', // Default padding\n 'tall', // Extra padding, multi-line preview\n 'extra_tall', // Maximum padding, rich content preview\n]).describe('Row height / density setting for list view'));\n\n/**\n * Grouping Field Configuration\n * Defines a single grouping level for record grouping.\n */\nexport const GroupingFieldSchema = lazySchema(() => z.object({\n field: z.string().describe('Field name to group by'),\n order: z.enum(['asc', 'desc']).default('asc').describe('Group sort order'),\n collapsed: z.boolean().default(false).describe('Collapse groups by default'),\n}));\n\n/**\n * Grouping Configuration Schema (Airtable-style)\n * Supports multi-level grouping for grid/gallery views.\n */\nexport const GroupingConfigSchema = lazySchema(() => z.object({\n fields: z.array(GroupingFieldSchema).min(1).describe('Fields to group by (supports up to 3 levels)'),\n}).describe('Record grouping configuration'));\n\n/**\n * Gallery View Configuration (Airtable-style)\n * Configures card layout for gallery/card views.\n */\nexport const GalleryConfigSchema = lazySchema(() => z.object({\n coverField: z.string().optional().describe('Attachment/image field to display as card cover'),\n coverFit: z.enum(['cover', 'contain']).default('cover').describe('Image fit mode for card cover'),\n cardSize: z.enum(['small', 'medium', 'large']).default('medium').describe('Card size in gallery view'),\n titleField: z.string().optional().describe('Field to display as card title'),\n visibleFields: z.array(z.string()).optional().describe('Fields to display on card body'),\n}).describe('Gallery/card view configuration'));\n\n/**\n * Timeline View Configuration (Airtable-style)\n * Configures timeline/chronological views.\n */\nexport const TimelineConfigSchema = lazySchema(() => z.object({\n startDateField: z.string().describe('Field for timeline item start date'),\n endDateField: z.string().optional().describe('Field for timeline item end date'),\n titleField: z.string().describe('Field to display as timeline item title'),\n groupByField: z.string().optional().describe('Field to group timeline rows'),\n colorField: z.string().optional().describe('Field to determine item color'),\n scale: z.enum(['hour', 'day', 'week', 'month', 'quarter', 'year']).default('week').describe('Default timeline scale'),\n}).describe('Timeline view configuration'));\n\n/**\n * View Sharing Configuration (Airtable-style)\n * Defines who can see and modify a view.\n */\nexport const ViewSharingSchema = lazySchema(() => z.object({\n type: z.enum(['personal', 'collaborative']).default('collaborative').describe('View ownership type'),\n lockedBy: z.string().optional().describe('User who locked the view configuration'),\n}).describe('View sharing and access configuration'));\n\n/**\n * Row Color Configuration (Airtable-style)\n * Defines how rows are colored based on field values.\n */\nexport const RowColorConfigSchema = lazySchema(() => z.object({\n field: z.string().describe('Field to derive color from (typically a select/status field)'),\n colors: z.record(z.string(), z.string()).optional().describe('Map of field value to color (hex/token)'),\n}).describe('Row color configuration based on field values'));\n\n/**\n * Visualization Type Schema\n * Whitelist of visualization types the user can switch between.\n * Maps to Airtable's \"Visualizations\" setting in Appearance panel.\n */\nexport const VisualizationTypeSchema = lazySchema(() => z.enum([\n 'grid',\n 'kanban',\n 'gallery',\n 'calendar',\n 'timeline',\n 'gantt',\n 'map',\n 'chart',\n 'tree',\n]).describe('Visualization type that users can switch to'));\n\n/**\n * User Actions Configuration Schema (Airtable Interface parity)\n * Controls which interactive actions are available to users in the view toolbar.\n * Each boolean toggles the corresponding toolbar element on/off.\n *\n * @see Airtable Interface → \"User actions\" panel\n */\nexport const UserActionsConfigSchema = lazySchema(() => z.object({\n sort: z.boolean().default(true).describe('Allow users to sort records'),\n search: z.boolean().default(true).describe('Allow users to search records'),\n filter: z.boolean().default(true).describe('Allow users to filter records'),\n rowHeight: z.boolean().default(true).describe('Allow users to toggle row height/density'),\n addRecordForm: z.boolean().default(false).describe('Add records through a form instead of inline'),\n editInline: z.boolean().default(false).describe('Allow users to edit records inline — click a cell to edit it with the field\\'s type-aware widget (the same control the form uses). Off by default: the list is read-only unless the author opts in.'),\n buttons: z.array(z.string()).optional().describe('Custom action button IDs to show in the toolbar'),\n}).describe('User action toggles for the view toolbar'));\n\n/**\n * Appearance Configuration Schema (Airtable Interface parity)\n * Controls visual presentation options for the view.\n *\n * @see Airtable Interface → \"Appearance\" panel\n */\nexport const AppearanceConfigSchema = lazySchema(() => z.object({\n showDescription: z.boolean().default(true).describe('Show the view description text'),\n allowedVisualizations: z.array(VisualizationTypeSchema).optional()\n .describe('Whitelist of visualization types users can switch between (e.g. [\"grid\", \"gallery\", \"kanban\"])'),\n}).describe('Appearance and visualization configuration'));\n\n/**\n * View Tab Schema (Airtable Interface parity)\n * Defines a tab in a multi-tab view interface.\n * Each tab references a named list view and can be ordered, pinned, or set as default.\n *\n * @see Airtable Interface → \"Tabs\" panel\n */\nexport const ViewTabSchema = lazySchema(() => z.object({\n name: SnakeCaseIdentifierSchema.describe('Tab identifier (snake_case)'),\n label: I18nLabelSchema.optional().describe('Display label'),\n icon: z.string().optional().describe('Tab icon name'),\n view: z.string().optional().describe('Referenced list view name from listViews'),\n filter: z.array(ViewFilterRuleSchema).optional().describe('Tab-specific filter criteria'),\n order: z.number().int().min(0).optional().describe('Tab display order'),\n pinned: z.boolean().default(false).describe('Pin tab (cannot be removed by users)'),\n isDefault: z.boolean().default(false).describe('Set as the default active tab'),\n visible: z.boolean().default(true).describe('Tab visibility'),\n}).describe('Tab configuration for multi-tab view interface'));\n\n/**\n * User Filter Field Schema (ADR-0047)\n * One field exposed as a quick-filter control in the end-user filter bar.\n * Rendering details (widget, options) default to inference from the field\n * definition on the source object — authors only override when needed.\n *\n * @see Airtable Interface → \"User filters\" panel (Dropdowns element)\n */\nexport const UserFilterFieldSchema = lazySchema(() => z.object({\n field: z.string().describe('Field name on the source object (must exist — checked by reference diagnostics)'),\n label: I18nLabelSchema.optional().describe('Display label override (defaults to the field label)'),\n type: z.enum(['select', 'multi-select', 'boolean', 'date-range', 'text']).optional()\n .describe('Filter control type. Omit to infer from the field definition'),\n options: z.array(z.object({\n value: z.union([z.string(), z.number(), z.boolean()]).describe('Option value'),\n label: I18nLabelSchema.describe('Option label'),\n color: z.string().optional().describe('Option color token/hex'),\n })).optional().describe('Static options. Omit to derive from the field definition (select options / lookup records)'),\n showCount: z.boolean().optional().describe('Show per-option record counts'),\n defaultValues: z.array(z.union([z.string(), z.number(), z.boolean()])).optional()\n .describe('Pre-selected values when the view loads'),\n}).describe('Quick-filter field configuration'));\n\n/**\n * User Filters Schema (ADR-0047, Airtable Interface parity)\n * The end-user-facing quick-filter surface above a list. The author picks the\n * element style and which fields/presets are exposed; end users combine them\n * at runtime (session-scoped — selections never persist as metadata).\n *\n * Distinct from `ListView.filter` (the always-on base criteria) and from the\n * advanced filter builder (`userActions.filter` toggle).\n *\n * @see Airtable Interface → \"User filters\" panel (Elements: tabs / dropdowns)\n */\nexport const UserFiltersSchema = lazySchema(() => z.object({\n // `toggle` is DEPRECATED (ADR-0047 §3.4a): it overlaps `tabs` (presets) and\n // `dropdown` (per-field values) without adding expressive power, needs\n // per-field defaultValues to be useful, and authoring tooling no longer\n // offers it (None / Tabs / Dropdown only). Kept in the enum so existing\n // configs keep rendering; do not author new `toggle` filters.\n element: z.enum(['dropdown', 'tabs', 'toggle']).default('dropdown')\n .describe('Filter control style: \"dropdown\" (per-field value selectors) or \"tabs\" (named presets). \"toggle\" is deprecated.'),\n fields: z.array(UserFilterFieldSchema).optional()\n .describe('Fields exposed as quick filters (dropdown/toggle elements)'),\n tabs: z.array(ViewTabSchema).optional()\n .describe('Named filter presets rendered as tabs (tabs element). Reuses ViewTabSchema'),\n showAllRecords: z.boolean().optional()\n .describe('Show an \"All records\" tab before the presets (tabs element)'),\n}).describe('End-user quick-filter configuration (Airtable \"User filters\" parity)'));\n\n/**\n * Add Record Configuration Schema (Airtable Interface parity)\n * Configures the \"Add Record\" entry point for a list view.\n *\n * @see Airtable Interface → \"+ Add record\" button\n */\nexport const AddRecordConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(true).describe('Show the add record entry point'),\n position: z.enum(['top', 'bottom', 'both']).default('bottom').describe('Position of the add record button'),\n mode: z.enum(['inline', 'form', 'modal']).default('inline').describe('How to add a new record'),\n formView: z.string().optional().describe('Named form view to use when mode is \"form\" or \"modal\"'),\n}).describe('Add record entry point configuration'));\n\n/**\n * Kanban Settings\n */\nexport const KanbanConfigSchema = lazySchema(() => z.object({\n groupByField: z.string().describe('Field to group columns by (usually status/select)'),\n summarizeField: z.string().optional().describe('Field to sum at top of column (e.g. amount)'),\n columns: z.array(z.string()).describe('Fields to show on cards'),\n}));\n\n/**\n * List Chart View Configuration (Airtable-style)\n * Configures aggregate chart visualizations (bar/line/pie/area/scatter)\n * when used as a `type: 'chart'` ListView. Distinct from the full-featured\n * `ChartConfigSchema` in `chart.zod.ts` (which is for embedded reports).\n */\nexport const ListChartConfigSchema = lazySchema(() => z.object({\n chartType: z.enum(['bar', 'line', 'pie', 'area', 'scatter']).default('bar').describe('Chart visualisation type'),\n /**\n * ADR-0021 — the semantic-layer `dataset` this chart binds to. Selects\n * dimensions/measures BY NAME so the chart's numbers stay consistent with\n * every other surface using the same dataset. This is the single author-facing\n * shape (the legacy inline `xAxisField` + `yAxisFields` + `aggregation` query\n * was removed in the cutover).\n */\n dataset: SnakeCaseIdentifierSchema.describe('Dataset name to bind (ADR-0021)'),\n /** Dimension names (from the dataset) for X / group / split. */\n dimensions: z.array(z.string()).optional().describe('Dimension names — X/group/split'),\n /** Measure names (from the dataset) for the value axis. */\n values: z.array(z.string()).min(1).describe('Measure names — Y (at least one)'),\n}).describe('List chart view configuration'));\n\n/**\n * Calendar Settings\n */\nexport const CalendarConfigSchema = lazySchema(() => z.object({\n startDateField: z.string(),\n endDateField: z.string().optional(),\n titleField: z.string(),\n colorField: z.string().optional(),\n}));\n\n/**\n * Quick filter dimension for the Gantt toolbar.\n */\nexport const GanttQuickFilterSchema = lazySchema(() => z.object({\n field: z.string().describe('Record field / dot-path the dimension filters on'),\n label: z.string().optional().describe('Trigger label (falls back to the field label)'),\n options: z.array(z.union([\n z.string(),\n z.object({\n value: z.union([z.string(), z.number()]),\n label: z.string().optional(),\n }),\n ])).optional().describe('Explicit option override for fixed enums'),\n}));\n\n/**\n * Gantt Settings\n *\n * Beyond the core timeline fields, the renderer supports a two-level\n * parent/child hierarchy (parentField/typeField), planned-vs-actual baselines,\n * dynamic grouping, a resource/workload view, hover tooltips and quick filters.\n */\nexport const GanttConfigSchema = lazySchema(() => z.object({\n startDateField: z.string(),\n endDateField: z.string(),\n titleField: z.string(),\n progressField: z.string().optional(),\n dependenciesField: z.string().optional(),\n colorField: z.string().optional().describe('Field that drives the bar color'),\n // Two-level hierarchy: a parent task id (summary bar) and a row type.\n parentField: z.string().optional().describe('Field holding the parent task id (builds the summary → step tree)'),\n typeField: z.string().optional().describe('Field whose value maps to task/summary/milestone'),\n // Planned-vs-actual reference bars.\n baselineStartField: z.string().optional().describe('Baseline (planned) start field'),\n baselineEndField: z.string().optional().describe('Baseline (planned) end field'),\n // Dynamic grouping: bucket leaf tasks under one synthesized summary per value.\n groupByField: z.string().optional().describe('Field to group leaf tasks by (synthesized summary rows)'),\n // Resource / workload view.\n resourceView: z.boolean().optional().describe('Render a per-resource workload histogram instead of the timeline'),\n assigneeField: z.string().optional().describe('Resource field to bucket load by (resource view)'),\n effortField: z.string().optional().describe('Per-task load units (resource view; default 1)'),\n capacity: z.number().optional().describe('Per-resource capacity ceiling; loads above this flag overload'),\n // Hover tooltip + quick filters.\n tooltipFields: z.array(z.union([\n z.string(),\n z.object({ field: z.string(), label: z.string().optional() }),\n ])).optional().describe('Fields to surface in the hover tooltip, in display order'),\n quickFilters: z.array(GanttQuickFilterSchema).optional().describe('Multi-select filter dropdowns rendered above the chart'),\n autoZoomToFilter: z.boolean().optional().describe('When true (default), filtering zooms the range to the filtered tasks'),\n// Forward-compatible: the gantt renderer (objectui plugin-gantt) keeps adding\n// config knobs (e.g. lockField / defaultCollapsedDepth) ahead of this schema.\n// Passthrough lets those extra fields reach the renderer instead of being\n// stripped here, so a renderer release no longer has to wait on a spec release.\n}).passthrough());\n\n/**\n * Tree (tree-grid) Settings\n *\n * Renders a self-referencing object as an indented, expand/collapse tree-grid.\n * Flat records are nested via a single-parent pointer field (`parentField`).\n * Unlike a fixed-depth `grouping`, a tree handles arbitrary depth (org charts,\n * category trees, BOMs, nested comments). When `parentField` is omitted the\n * renderer auto-detects the object's `tree`/self-reference field.\n */\nexport const TreeConfigSchema = lazySchema(() => z.object({\n parentField: z.string().optional().describe('Single-parent pointer field (auto-detected from the object schema when omitted)'),\n labelField: z.string().optional().describe('Field rendered indented in the first column (defaults to \"name\")'),\n fields: z.array(z.string()).optional().describe('Additional fields rendered as flat columns alongside the label'),\n defaultExpandedDepth: z.number().int().min(0).optional().describe('Initial expansion depth (0 = roots only; omit = expand all)'),\n// Forward-compatible: let renderer-ahead config knobs reach plugin-tree.\n}).passthrough());\n\n/**\n * Navigation Mode Enum\n * Defines how to navigate to the detail view from a list item.\n */\nexport const NavigationModeSchema = lazySchema(() => z.enum([\n 'page', // Navigate to a new route (default)\n 'drawer', // Open details in a side drawer/panel\n 'modal', // Open details in a modal dialog\n 'split', // Show details side-by-side with the list (master-detail)\n 'popover', // Show details in a popover (lightweight)\n 'new_window', // Open in new browser tab/window\n 'none' // No navigation (read-only list)\n]));\n\n/**\n * Navigation Configuration Schema\n */\nexport const NavigationConfigSchema = lazySchema(() => z.object({\n mode: NavigationModeSchema.default('page'),\n \n /** Target View Config */\n view: z.string().optional().describe('Name of the form view to use for details (e.g. \"summary_view\", \"edit_form\")'),\n \n /** Interaction Triggers */\n preventNavigation: z.boolean().default(false).describe('Disable standard navigation entirely'),\n openNewTab: z.boolean().default(false).describe('Force open in new tab (applies to page mode)'),\n \n /**\n * [#2578] Overlay size for a drawer/modal detail — coarse T-shirt buckets,\n * aligned with `FormView.modalSize` (`page` mode ignores it). `'auto'`\n * (default): the renderer derives the size from the object's field count and\n * clamps it to the client viewport, so AI writes nothing — it cannot know the\n * client width. Explicit buckets are a coarse, viewport-independent override.\n */\n size: z.enum(['auto', 'sm', 'md', 'lg', 'xl', 'full']).default('auto')\n .describe(\"[#2578] Overlay size bucket for drawer/modal detail: 'auto' (default — renderer derives from field count + viewport; AI writes nothing) or a coarse override sm/md/lg/xl/full. Prefer this over the pixel `width`; page mode ignores it.\"),\n\n /**\n * @deprecated [#2578 → `size`] A pixel/percent width cannot be authored blind:\n * the author (often an AI) does not know the client viewport. Kept only as a\n * renderer fallback for pre-#2578 metadata; new metadata sets `size` (or omits\n * it for `auto`).\n */\n width: z.union([z.string(), z.number()]).optional().describe('[DEPRECATED → size] Pixel/percent width of the drawer/modal (e.g. \"600px\"). A pixel width cannot be chosen at authoring time without knowing the client viewport — use the `size` bucket.'),\n}));\n\n/**\n * List View Schema (Expanded)\n * Defines how a collection of records is displayed to the user.\n * \n * **NAMING CONVENTION:**\n * View names (when provided) are machine identifiers and must be lowercase snake_case.\n * \n * @example Standard Grid\n * {\n * name: \"all_active\",\n * label: \"All Active\",\n * type: \"grid\",\n * columns: [\"name\", \"status\", \"created_at\"],\n * filter: [[\"status\", \"=\", \"active\"]]\n * }\n * \n * @example Kanban Board\n * {\n * type: \"kanban\",\n * columns: [\"name\", \"amount\"],\n * kanban: {\n * groupByField: \"stage\",\n * summarizeField: \"amount\",\n * columns: [\"name\", \"close_date\"]\n * }\n * }\n */\nexport const ListViewSchema = lazySchema(() => z.object({\n name: SnakeCaseIdentifierSchema.optional().describe('Internal view name (lowercase snake_case)'),\n label: I18nLabelSchema.optional(), // Display label override (supports i18n)\n type: z.enum([\n 'grid', // Standard Data Table\n 'kanban', // Board / Columns\n 'gallery', // Card Deck / Masonry\n 'calendar', // Monthly/Weekly/Daily\n 'timeline', // Chronological Stream (Feed)\n 'gantt', // Project Timeline\n 'map', // Geospatial\n 'chart', // Aggregate visualisation\n 'tree' // Self-referencing hierarchy (tree-grid)\n ]).default('grid'),\n \n /** Data Source Configuration */\n data: ViewDataSchema.optional().describe('Data source configuration (defaults to \"object\" provider)'),\n \n /** Shared Query Config */\n columns: z.union([\n z.array(z.string()), // Legacy: simple field names\n z.array(ListColumnSchema), // Enhanced: detailed column config\n ]).describe('Fields to display as columns'),\n filter: z.array(ViewFilterRuleSchema).optional().describe('Filter criteria (JSON Rules)'),\n sort: z.union([\n z.string(), //Legacy \"field desc\"\n z.array(z.object({\n field: z.string(),\n order: z.enum(['asc', 'desc'])\n }))\n ]).optional(),\n \n /** Search & Filter */\n searchableFields: z.array(z.string()).optional().describe('Fields enabled for search'),\n filterableFields: z.array(z.string()).optional().describe('Legacy shorthand for userFilters.fields — bare field names enabled for end-user filtering. Prefer userFilters'),\n\n /** User Filters (ADR-0047, Airtable Interface parity) */\n userFilters: UserFiltersSchema.optional()\n .describe('End-user quick-filter bar: dropdown/toggle fields or tab presets. Omit to let the renderer derive filters from select/boolean fields'),\n\n /** Grid Features */\n resizable: z.boolean().optional().describe('Enable column resizing'),\n striped: z.boolean().optional().describe('Striped row styling'),\n bordered: z.boolean().optional().describe('Show borders'),\n compactToolbar: z.boolean().optional().describe('Collapse Group/Color/Density/Hide-fields into a single View settings popover'),\n\n /** Selection */\n selection: SelectionConfigSchema.optional().describe('Row selection configuration'),\n\n /** Navigation / Interaction */\n navigation: NavigationConfigSchema.optional().describe('Configuration for item click navigation (page, drawer, modal, etc.)'),\n\n /** Pagination */\n pagination: PaginationConfigSchema.optional().describe('Pagination configuration'),\n\n /** Type Specific Config */\n kanban: KanbanConfigSchema.optional(),\n calendar: CalendarConfigSchema.optional(),\n gantt: GanttConfigSchema.optional(),\n gallery: GalleryConfigSchema.optional(),\n timeline: TimelineConfigSchema.optional(),\n chart: ListChartConfigSchema.optional(),\n tree: TreeConfigSchema.optional(),\n\n /** View Metadata (Airtable-style view management) */\n description: I18nLabelSchema.optional().describe('View description for documentation/tooltips'),\n sharing: ViewSharingSchema.optional().describe('View sharing and access configuration'),\n\n /** Row Height / Density (Airtable-style) */\n rowHeight: RowHeightSchema.optional().describe('Row height / density setting'),\n\n /** Record Grouping (Airtable-style) */\n grouping: GroupingConfigSchema.optional().describe('Group records by one or more fields'),\n\n /** Row Color (Airtable-style) */\n rowColor: RowColorConfigSchema.optional().describe('Color rows based on field value'),\n\n /** Field Visibility & Ordering per View (Airtable-style) */\n hiddenFields: z.array(z.string()).optional().describe('Fields to hide in this specific view'),\n fieldOrder: z.array(z.string()).optional().describe('Explicit field display order for this view'),\n\n /** Row & Bulk Actions */\n rowActions: z.array(z.string()).optional().describe('Actions available for individual row items'),\n bulkActions: z.array(z.string()).optional().describe('Actions available when multiple rows are selected'),\n bulkActionDefs: z.array(z.record(z.string(), z.any())).optional().describe('Rich bulk action definitions (schema-driven, executed via BulkActionDialog)'),\n\n /** Performance */\n virtualScroll: z.boolean().optional().describe('Enable virtual scrolling for large datasets'),\n\n /** Conditional Formatting */\n conditionalFormatting: z.array(z.object({\n condition: ExpressionInputSchema.describe('Predicate (CEL) to evaluate.'),\n style: z.record(z.string(), z.string()).describe('CSS styles to apply when condition is true'),\n })).optional().describe('Conditional formatting rules for list rows'),\n\n /** Inline Edit */\n inlineEdit: z.boolean().optional().describe('Allow inline editing of records directly in the list view'),\n\n /** Export */\n exportOptions: z.array(z.enum(['csv', 'xlsx', 'pdf', 'json'])).optional().describe('Available export format options'),\n\n /** User Actions (Airtable Interface parity) */\n userActions: UserActionsConfigSchema.optional().describe('User action toggles for the view toolbar'),\n\n /** Appearance (Airtable Interface parity) */\n appearance: AppearanceConfigSchema.optional().describe('Appearance and visualization configuration'),\n\n /** Tabs (Airtable Interface parity) */\n tabs: z.array(ViewTabSchema).optional().describe('Tab definitions for multi-tab view interface'),\n\n /** Add Record (Airtable Interface parity) */\n addRecord: AddRecordConfigSchema.optional().describe('Add record entry point configuration'),\n\n /** Record Count Display (Airtable Interface parity) */\n showRecordCount: z.boolean().optional().describe('Show record count at the bottom of the list'),\n\n /** Advanced: Allow Printing (Airtable Interface parity) */\n allowPrinting: z.boolean().optional().describe('Allow users to print the view'),\n\n /** Empty State */\n emptyState: z.object({\n title: I18nLabelSchema.optional(),\n message: I18nLabelSchema.optional(),\n icon: z.string().optional(),\n }).optional().describe('Empty state configuration when no records found'),\n\n /** ARIA accessibility attributes */\n aria: AriaPropsSchema.optional().describe('ARIA accessibility attributes for the list view'),\n\n /** Responsive layout overrides per breakpoint */\n responsive: ResponsiveConfigSchema.optional().describe('Responsive layout configuration'),\n\n /** Performance optimization settings */\n performance: PerformanceConfigSchema.optional().describe('Performance optimization settings'),\n}));\n\n/**\n * Form Field Configuration Schema\n * Detailed configuration for individual form fields.\n * \n * Reuses Data.FieldType and related constraints from the Data protocol to avoid duplication.\n * The `type` field auto-infers widget rendering; explicit `widget` overrides are only needed\n * for custom components.\n * \n * @example Auto-inferred select widget\n * { field: 'status', type: 'select', options: [{ label: 'Open', value: 'open' }] }\n * \n * @example Lookup field with reference\n * { field: 'account_id', type: 'lookup', reference: 'account', label: 'Account' }\n * \n * @example Custom widget override\n * { field: 'filter', widget: 'filter-builder' }\n */\nexport const FormFieldSchema: z.ZodType<any> = lazySchema(() => z.object({\n /** Field name (snake_case) */\n field: z.string().describe('Field name (snake_case)'),\n \n /** Field type — reuses Data.FieldType. When set, widget is auto-inferred (can be overridden). */\n type: FieldType.optional().describe('Field type (auto-infers widget if omitted)'),\n \n /** Select/multiselect options — only needed when type=select/multiselect/radio/checkboxes */\n options: z.array(SelectOptionSchema).optional().describe('Options for select/multiselect/radio/checkboxes fields'),\n \n /** Reference object for lookup/master_detail fields */\n reference: z.string().optional().describe('Target object name for lookup/master_detail fields'),\n \n /** Text constraints */\n maxLength: z.number().optional().describe('Maximum character length (for text/textarea/email/url/phone)'),\n minLength: z.number().optional().describe('Minimum character length'),\n \n /** Number constraints */\n min: z.number().optional().describe('Minimum value (for number/currency/percent/slider)'),\n max: z.number().optional().describe('Maximum value'),\n precision: z.number().optional().describe('Total digits (for number/currency)'),\n scale: z.number().optional().describe('Decimal places'),\n \n /** Multi-value flag */\n multiple: z.boolean().optional().describe('Allow multiple values (for select/lookup/file/image)'),\n \n /** UI overrides */\n label: I18nLabelSchema.optional().describe('Display label override'),\n placeholder: I18nLabelSchema.optional().describe('Placeholder text'),\n helpText: I18nLabelSchema.optional().describe('Help/hint text'),\n readonly: z.boolean().optional().describe('Read-only override'),\n immutable: z.boolean().optional().describe('Editable on create, locked once the record exists (e.g. machine names).'),\n required: z.boolean().optional().describe('Required override'),\n hidden: z.boolean().optional().describe('Hidden override'),\n colSpan: z.number().int().min(1).max(4).optional().describe('[legacy — prefer `span`] Absolute column span (1-4). Fragile when the column count is derived per surface (mobile 1 / modal 2 / page 3-4): a fixed span only lines up at the width the author imagined. The renderer clamps it to the current column count. Prefer `span`.'),\n /**\n * [#2578] Relative field width — decoupled from the (often auto-derived)\n * column count, so it stays correct at 1/2/3/4 columns.\n */\n span: z.enum(['auto', 'full']).default('auto').describe(\"Relative field width. 'auto' (default — omit it): the renderer sizes the field from its widget type × the current column count (wide widgets like textarea/richtext/json/file/subform take the whole row). 'full': whole row at any column count. Prefer this over the absolute `colSpan`.\"),\n\n /** Custom widget override — only needed when auto-inference is insufficient */\n widget: z.string().optional().describe('Custom widget/component name (overrides type-based inference)'),\n\n /** For `code` fields: source language (e.g. 'javascript', 'sql', 'json', 'typescript', 'expression', 'cel'). Drives syntax highlighting. */\n language: z.string().optional().describe('Code editor language (for type=code)'),\n\n /**\n * Sub-fields for `composite` / `repeater` / `record` types — declares\n * the inner shape of an embedded sub-object (composite), each row of\n * an embedded sub-object array (repeater), or each entry of a name-keyed\n * map (record). Recursive: any of the three can nest.\n *\n * Use `lookup` / `master_detail` instead when the children are independent\n * records with their own IDs in a separate object/table.\n */\n fields: z.array(z.lazy(() => FormFieldSchema)).optional()\n .describe('Sub-fields for composite/repeater/record types'),\n\n /**\n * For `record`-typed fields only. Declares how the map key is sourced,\n * displayed, and validated when an admin creates a new entry.\n *\n * The same identifier is also stored as `name` on the inner value (so\n * `record.fields[k].name === k`). Most callers can omit this and accept\n * the defaults: `{ field: 'name', label: 'Name', regex: /^[a-z_][a-z0-9_]*$/, immutable: true }`.\n *\n * See ADR-0007 (record form field type).\n */\n keyField: z.object({\n field: z.string().default('name').describe('Property name that holds the key inside each item (defaults to \"name\")'),\n label: I18nLabelSchema.optional().describe('Display label for the key column'),\n placeholder: I18nLabelSchema.optional().describe('Placeholder when entering a new key'),\n helpText: I18nLabelSchema.optional().describe('Help text under the key input'),\n /** Validation pattern serialised as a regex source string (no flags). */\n regex: z.string().optional().describe('JS regex source string the key must match (no flags)'),\n /** Renamable after creation? Defaults to false — keys are usually identifiers. */\n immutable: z.boolean().default(true).describe('If true, the key is read-only after creation'),\n }).optional().describe('Key column config for record-typed fields'),\n\n dependsOn: z.string().optional().describe('Parent field name for cascading'),\n visibleOn: ExpressionInputSchema.optional().describe('Visibility predicate (CEL).'),\n disclosure: z.enum(['inline', 'popover']).optional().describe('Composite rendering: inline bordered box (default) or a summary line + gear popover (progressive disclosure).'),\n}));\n\n/**\n * Form Layout Section\n */\nexport const FormSectionSchema = lazySchema(() => z.object({\n /**\n * Stable identifier for translation lookup. snake_case convention.\n * When provided, translation bundles can target this section's `label`\n * and `description` via `metadataForms.<type>.sections.<name>`.\n * Optional for backward-compat with sections that only have a `label`.\n */\n name: z.string().optional().describe('Stable section identifier for i18n lookup (snake_case)'),\n label: I18nLabelSchema.optional(),\n description: z.string().optional().describe('Optional description rendered under the section header.'),\n collapsible: z.boolean().default(false),\n collapsed: z.boolean().default(false),\n visibleOn: ExpressionInputSchema.optional().describe('Visibility predicate (CEL). Hides the whole section when false.'),\n columns: z.union([\n z.enum(['1', '2', '3', '4']),\n z.literal(1),\n z.literal(2),\n z.literal(3),\n z.literal(4),\n ]).default(1).transform(val => (typeof val === 'string' ? parseInt(val) : val) as 1 | 2 | 3 | 4),\n fields: z.array(z.union([\n z.string(), // Legacy: simple field name\n FormFieldSchema, // Enhanced: detailed field config\n ])),\n}));\n\n/**\n * Form View Schema\n * Defines the layout for creating or editing a single record.\n * \n * @example Simple Sectioned Form\n * {\n * type: \"simple\",\n * sections: [\n * {\n * label: \"General Info\",\n * columns: 2,\n * fields: [\"name\", \"status\"]\n * },\n * {\n * label: \"Details\",\n * fields: [\"description\", { field: \"priority\", widget: \"rating\" }]\n * }\n * ]\n * }\n */\nexport const FormViewSchema = lazySchema(() => z.object({\n type: z.enum([\n 'simple', // Single column or sections\n 'tabbed', // Tabs\n 'wizard', // Step by step\n 'split', // Master-Detail split\n 'drawer', // Side panel\n 'modal' // Dialog\n ]).default('simple'),\n\n // --- Presentation options (per `type` variant). These mirror what the\n // ObjectForm component accepts so the protocol declares them; all optional. ---\n /** Field layout within the form body. */\n layout: z.enum(['vertical', 'horizontal', 'inline', 'grid']).optional().describe('Field layout direction'),\n /** Number of columns for the form body (grid/multi-column layouts). */\n columns: z.number().int().min(1).optional().describe('Number of columns for the form body'),\n /** Optional form title / description (for embedded or standalone forms). */\n title: z.string().optional().describe('Form title'),\n description: z.string().optional().describe('Form description'),\n /** Tabbed (`type: 'tabbed'`). */\n defaultTab: z.string().optional().describe('Initially active tab (tabbed forms)'),\n tabPosition: z.enum(['top', 'bottom', 'left', 'right']).optional().describe('Tab strip position (tabbed forms)'),\n /** Wizard (`type: 'wizard'`). */\n allowSkip: z.boolean().optional().describe('Allow skipping steps (wizard forms)'),\n showStepIndicator: z.boolean().optional().describe('Show the step indicator (wizard forms)'),\n /** Split (`type: 'split'`). */\n splitDirection: z.enum(['horizontal', 'vertical']).optional().describe('Split orientation (split forms)'),\n splitSize: z.number().optional().describe('Primary split panel size, % (split forms)'),\n splitResizable: z.boolean().optional().describe('Whether the split is resizable (split forms)'),\n /** Drawer (`type: 'drawer'`). */\n drawerSide: z.enum(['top', 'bottom', 'left', 'right']).optional().describe('Drawer side (drawer forms)'),\n /** @deprecated [#2578 → `modalSize` / size buckets] A pixel width can't be authored blind (unknown client viewport); the renderer derives width from content + viewport. */\n drawerWidth: z.string().optional().describe('[DEPRECATED → size buckets] Drawer width, e.g. \"480px\". A pixel width cannot be chosen without knowing the client viewport — the renderer derives it.'),\n /** Modal (`type: 'modal'`). */\n modalSize: z.enum(['sm', 'default', 'lg', 'xl', 'full']).optional().describe('Modal size (modal forms)'),\n\n /** Data Source Configuration */\n data: ViewDataSchema.optional().describe('Data source configuration (defaults to \"object\" provider)'),\n \n sections: z.array(FormSectionSchema).optional(), // For simple layout\n groups: z.array(FormSectionSchema).optional(), // Legacy support -> alias to sections\n\n /**\n * Inline child collections (master-detail). When present, the standard\n * create/edit form for this object renders as a master-detail form — the\n * object's own fields on top, an editable grid per child collection below,\n * persisted together in ONE atomic transaction — with no bespoke page. Each\n * entry needs only `childObject`; the relationship FK and grid columns are\n * derived from the child object's metadata (override via\n * `relationshipField` / `columns`).\n */\n subforms: z.array(z.object({\n childObject: z.string().describe('Child object whose records are entered inline'),\n relationshipField: z.string().optional().describe('FK on the child pointing back to the parent (auto-detected when omitted)'),\n columns: z.array(z.any()).optional().describe('Editable grid columns (derived from the child object when omitted)'),\n amountField: z.string().optional().describe('Numeric child column summed for the running total'),\n totalField: z.string().optional().describe('Parent field to receive the rolled-up sum'),\n title: z.string().optional().describe('Section title'),\n addLabel: z.string().optional().describe('Add-row button label'),\n minRows: z.number().optional(),\n maxRows: z.number().optional(),\n })).optional().describe('Inline master-detail child collections'),\n\n /** Default Sort for Related Lists (e.g., sort child records by date) */\n defaultSort: z.array(z.object({\n field: z.string().describe('Field name to sort by'),\n order: z.enum(['asc', 'desc']).default('desc').describe('Sort direction'),\n })).optional().describe('Default sort order for related list views within this form'),\n\n /** Public form sharing configuration */\n sharing: SharingConfigSchema.optional().describe('Public sharing configuration for this form'),\n\n /**\n * What happens after a successful submit.\n *\n * - `thank-you` (default) — show a confirmation panel\n * - `redirect` — send the browser to a URL\n * - `continue` — reset the form so another response can be entered\n * - `next-record` — advance to the next record (internal queues only)\n */\n submitBehavior: z.union([\n z.object({\n kind: z.literal('thank-you'),\n title: z.string().optional(),\n message: z.string().optional(),\n }),\n z.object({\n kind: z.literal('redirect'),\n url: z.string(),\n delayMs: z.number().int().min(0).optional(),\n }),\n z.object({ kind: z.literal('continue') }),\n z.object({ kind: z.literal('next-record') }),\n ]).optional().describe('Post-submit behavior'),\n\n /** ARIA accessibility attributes */\n aria: AriaPropsSchema.optional().describe('ARIA accessibility attributes for the form view'),\n}));\n\n/**\n * ADR-0053 \"views\" mode — an object's default list + named list views.\n *\n * Structurally a {@link ListViewSchema} MINUS the page-only control `userFilters`:\n * that field belongs to a page list (`InterfaceListPage`, \"filters\" mode), never an\n * object list view, whose only nav control is the `ViewTabBar`. Omitting the field\n * makes the wrong-context state untypable at author time (tsc). Runtime parse still\n * STRIPS an authored `userFilters` silently (default strip, no throw) for back-compat,\n * and the CLI `validate` list-view-mode rule reports it pre-parse. See objectui #2219\n * and ADR-0053 phase 4.\n */\nexport const ObjectListViewSchema = lazySchema(() => ListViewSchema.omit({ userFilters: true }));\n\n/**\n * Master View Schema\n * Can define multiple named views.\n */\n/**\n * View Container Schema\n * Aggregates all view definitions for a specific object or context.\n * \n * @example\n * {\n * list: { type: \"grid\", columns: [\"name\"] },\n * form: { type: \"simple\", fields: [\"name\"] },\n * listViews: {\n * \"all\": { label: \"All\", filter: [] },\n * \"my\": { label: \"Mine\", filter: [[\"owner\", \"=\", \"{user_id}\"]] }\n * }\n * }\n */\nexport const ViewSchema = lazySchema(() => z.object({\n list: ObjectListViewSchema.optional(), // Default list view (views mode — no userFilters, ADR-0053)\n form: FormViewSchema.optional(), // Default form view\n listViews: z.record(z.string(), ObjectListViewSchema).optional().describe('Additional named list views (views mode — no userFilters, ADR-0053)'),\n formViews: z.record(z.string(), FormViewSchema).optional().describe('Additional named form views'),\n /**\n * ADR-0010 §3.7 — Package-level protection envelope. Package\n * authors declare lock policy here; the loader translates it\n * into the private `_lock` envelope at registration time and\n * strips this block before persistence. See\n * `shared/protection.zod.ts`.\n */\n protection: ProtectionSchema.optional().describe(\n 'Package author protection block — lock policy for this view.',\n ),\n\n // ADR-0010 — runtime protection envelope (internal — set by loader).\n ...MetadataProtectionFields,\n\n}));\n\n/**\n * Type-safe factory for creating view definitions.\n *\n * Validates the config at creation time using Zod `.parse()`.\n *\n * @example\n * ```ts\n * const taskViews = defineView({\n * list: {\n * type: 'grid',\n * data: { provider: 'object', object: 'task' },\n * columns: ['subject', 'status', 'priority', 'due_date'],\n * },\n * form: {\n * type: 'simple',\n * sections: [{ label: 'Details', fields: [{ field: 'subject' }] }],\n * },\n * });\n * ```\n */\nexport function defineView(config: z.input<typeof ViewSchema>): View {\n return ViewSchema.parse(config);\n}\n\n// ───────────────────────────────────────────────────────────────────────────\n// Independent View Item model (Object has-many View)\n// ───────────────────────────────────────────────────────────────────────────\n//\n// The {@link ViewSchema} *container* above aggregates every view of an object\n// into one document. That model cannot express runtime-authored views (a user\n// adding \"My high-value leads\" at runtime cannot append to a developer's source\n// file), and it forces multiple distinct views into a single designer.\n//\n// {@link ViewItemSchema} promotes each named view to a first-class, independently\n// addressable entity bound to its object by a foreign key. The object↔view\n// switcher is then a *query* (`getViewsByObject`) rather than embedded storage —\n// mirroring Airtable / Salesforce / Notion, where a table/object has-many views.\n//\n// `defineView` is retained as authoring sugar: the backend loader expands an\n// aggregated document into N ViewItems at registration time, so existing\n// `*.view.ts` files and the published spec keep working unchanged.\n\n/**\n * Qualified view-item identity: `<object>.<viewKey>` — dotted snake_case\n * segments, e.g. `crm_lead.pipeline`. Globally unique, and the object can be\n * recovered from the prefix, so the registry key never collides across objects.\n */\nexport const ViewItemNameSchema = z\n .string()\n .regex(\n /^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*)+$/,\n 'View item name must be a dotted snake_case qualified name, e.g. \"crm_lead.pipeline\".',\n )\n .describe('Globally-unique view id, `<object>.<viewKey>`.');\n\n/**\n * Identity layer for a view item — its visibility scope and ownership.\n *\n * - `package` — shipped from `*.view.ts` source / an installed package.\n * Not deletable (reinstall restores it); customisable via an\n * override layer; hideable from the switcher.\n * - `shared` — authored at runtime, visible org-wide. Creating one is gated\n * by the `view.manageShared` capability.\n * - `personal` — authored at runtime, scoped to `owner`. Any user with read\n * access to the object may create one.\n *\n * Named `scope` (not `provenance`) to avoid colliding with the loader-set\n * `_provenance` envelope field, which tracks a different axis\n * (package | org | env-forced).\n */\nexport const ViewScopeSchema = z\n .enum(['package', 'shared', 'personal'])\n .describe('View identity layer: package | shared | personal.');\n\n/** Discriminator for the kind of view a {@link ViewItemSchema} carries. */\nexport const ViewKindSchema = z\n .enum(['list', 'form'])\n .describe('Whether `config` is a ListView (list family) or a FormView.');\n\n/**\n * Fields shared by every independent view item, regardless of kind. Returned\n * as a raw Zod shape so it composes into each discriminated-union member\n * without forcing eager schema construction.\n */\nfunction viewItemBaseShape() {\n return {\n name: ViewItemNameSchema,\n object: z\n .string()\n .describe('Bound object name — the foreign key used to aggregate views.'),\n label: I18nLabelSchema.optional().describe('Display label (supports i18n).'),\n isDefault: z\n .boolean()\n .optional()\n .describe(\"Whether this is the object's default view in the switcher.\"),\n order: z\n .number()\n .int()\n .optional()\n .describe(\"Sort order within the object's view switcher / left rail.\"),\n scope: ViewScopeSchema.optional().describe(\n 'Identity layer (defaults to `package` for source-loaded views).',\n ),\n owner: z\n .string()\n .optional()\n .describe('Owner user id — set when `scope` is `personal`.'),\n hidden: z\n .boolean()\n .optional()\n .describe('Hidden from the switcher (per-user / per-org declutter).'),\n /**\n * Package author protection block — same envelope as {@link ViewSchema};\n * the loader translates it into the private `_lock` envelope.\n */\n protection: ProtectionSchema.optional().describe(\n 'Package author protection block — lock policy for this view.',\n ),\n // ADR-0010 — runtime protection envelope (internal — set by loader).\n ...MetadataProtectionFields,\n };\n}\n\n/**\n * Independent View Item — a single named view bound to one object.\n *\n * Discriminated on `viewKind`: a `list` item carries a {@link ListViewSchema}\n * config (grid / kanban / calendar / …), a `form` item carries a\n * {@link FormViewSchema} config.\n *\n * @example\n * ```ts\n * const pipeline = defineViewItem({\n * name: 'crm_lead.pipeline',\n * object: 'crm_lead',\n * viewKind: 'list',\n * label: 'Pipeline',\n * config: {\n * type: 'kanban',\n * data: { provider: 'object', object: 'crm_lead' },\n * columns: ['name', 'stage', 'amount'],\n * },\n * });\n * ```\n */\nexport const ViewItemSchema = lazySchema(() =>\n z.discriminatedUnion('viewKind', [\n z.object({\n viewKind: z.literal('list'),\n config: ListViewSchema.describe('List-family view configuration.'),\n ...viewItemBaseShape(),\n }),\n z.object({\n viewKind: z.literal('form'),\n config: FormViewSchema.describe('Form view configuration.'),\n ...viewItemBaseShape(),\n }),\n ]),\n);\n\n/**\n * Type-safe factory for an independent {@link ViewItem}.\n *\n * Validates the config at creation time using Zod `.parse()`.\n *\n * @example\n * ```ts\n * const allLeads = defineViewItem({\n * name: 'crm_lead.all',\n * object: 'crm_lead',\n * viewKind: 'list',\n * isDefault: true,\n * config: { type: 'grid', data: { provider: 'object', object: 'crm_lead' }, columns: ['name'] },\n * });\n * ```\n */\nexport function defineViewItem(config: z.input<typeof ViewItemSchema>): ViewItem {\n return ViewItemSchema.parse(config);\n}\n\n// ───────────────────────────────────────────────────────────────────────────\n// defineView container → ViewItem expansion (shared by every loader)\n//\n// `defineView({ list, form, listViews, formViews })` aggregates an object's\n// views into one document. Each registration path that ingests such a\n// container (the ObjectQL engine boot loop AND the metadata HMR plugin) must\n// expand it into N independent ViewItems registered under `<object>.<viewKey>`,\n// so each view is individually addressable and `getViewsByObject()` can rebuild\n// the switcher. The original container is ALSO kept under the bare `<object>`\n// key for backward-compatible reads. This logic lives in `@objectstack/spec`\n// (depended on by both objectql and metadata) so the two loaders cannot drift.\n\n/** A ViewItem materialised from an aggregated container (always `package`). */\nexport interface ExpandedViewItem {\n name: string;\n object: string;\n viewKind: 'list' | 'form';\n label?: unknown;\n config: any;\n isDefault?: boolean;\n order: number;\n scope: 'package';\n /** Non-blocking expansion diagnostics (MetadataValidationResult wire shape).\n * Present only when the item's name had to be rewritten to avoid a\n * collision — loaders surface `warnings` in their boot/HMR logs and\n * Studio can badge the view. */\n _diagnostics?: { valid: boolean; warnings: Array<{ path: string; message: string }> };\n}\n\n/** True when a raw view artifact still uses the aggregated container shape\n * (and is not already an independent ViewItem, which carries `viewKind`). */\nexport function isAggregatedViewContainer(item: any): boolean {\n if (!item || typeof item !== 'object') return false;\n if (item.viewKind) return false; // already an independent ViewItem\n return Boolean(item.list || item.form || item.listViews || item.formViews);\n}\n\n/** Structural signature used to collapse a container's default `list`/`form`\n * with a redundant `listViews`/`formViews` restatement of the same view (the\n * common \"default == listViews.all\" authoring pattern). */\nfunction viewSignature(v: any): string {\n if (!v || typeof v !== 'object') return '';\n try {\n return JSON.stringify({ type: v.type ?? null, label: v.label ?? null, columns: v.columns ?? null });\n } catch {\n return '';\n }\n}\n\n/** Allocate a collision-free `<object>.<key>` name within one expansion. */\nfunction uniqueViewName(base: string, used: Set<string>): string {\n let name = base;\n let i = 2;\n while (used.has(name)) name = `${base}_${i++}`;\n used.add(name);\n return name;\n}\n\n/** Stamp a rename warning on an expanded item whose `<object>.<key>` name was\n * already taken (e.g. `formViews.default` vs the implicit default `list`).\n * The rename itself is kept for backward compatibility — this makes it LOUD:\n * loaders log the warning and Studio can render it, so authors discover that\n * references to the requested name (form action `target`s, navigation\n * `viewName`s) resolve to a DIFFERENT view. */\nfunction stampRenameWarning(item: ExpandedViewItem, requestedName: string): void {\n if (item.name === requestedName) return;\n item._diagnostics = {\n valid: true,\n warnings: [{\n path: 'name',\n message:\n `View key collision: '${requestedName}' is already registered by another view in this `\n + `defineView container (list and form views share one '<object>.<key>' namespace, and the `\n + `default 'list' implicitly claims '<object>.default'). This ${item.viewKind} view was `\n + `renamed to '${item.name}'. References targeting '${requestedName}' — form action `\n + `targets, navigation viewNames — will resolve to the OTHER view. Rename the view key `\n + `to something unique to remove this warning.`,\n }],\n };\n}\n\nfunction cloneViewConfig(v: any): any {\n try {\n return structuredClone(v);\n } catch {\n return JSON.parse(JSON.stringify(v));\n }\n}\n\n/**\n * A view-key collision detected while expanding one `defineView` container.\n *\n * List and form views share a single `<object>.<key>` namespace during\n * expansion (see {@link expandViewContainer}), and the default `list`\n * implicitly claims `<object>.default`. When a later view competes for a name\n * already taken, it is renamed (`<object>.<key>` → `<object>.<key>_2`) to keep\n * the runtime registry key unique. That rename is a silent footgun: references\n * to the requested name (form action `target`s, navigation `viewName`s) resolve\n * to the OTHER view. The build-time view-ref lint turns each collision into a\n * hard error so the author fixes the key instead of shipping a broken reference.\n */\nexport interface ViewKeyCollision {\n /** The `<object>.<key>` name that was already registered by an earlier view. */\n requested: string;\n /** The disambiguated name the colliding view was renamed to (e.g. `…_2`). */\n renamedTo: string;\n /** Which family the renamed (losing) view belongs to. */\n viewKind: 'list' | 'form';\n /** The raw author-supplied key that collided. */\n key: string;\n}\n\n/** Result of {@link expandViewContainerWithDiagnostics}. */\nexport interface ExpandViewResult {\n items: ExpandedViewItem[];\n collisions: ViewKeyCollision[];\n}\n\n/**\n * Expand an aggregated view container into independent ViewItems, ALSO reporting\n * every name collision that forced a rename.\n *\n * List family: `listViews` entries first (keys taken from the author), then the\n * default `list` — deduped by structural signature so a `listViews.all` that\n * merely restates `list` collapses into one item. The view matching the\n * declared default is flagged `isDefault`. Form family: `formViews` entries,\n * then the default `form`.\n *\n * Collisions are captured at the exact points the shared `used` set forces a\n * rename, so the diagnostic can never drift from the expansion it describes.\n */\nexport function expandViewContainerWithDiagnostics(object: string, container: any): ExpandViewResult {\n const out: ExpandedViewItem[] = [];\n const collisions: ViewKeyCollision[] = [];\n const used = new Set<string>();\n let order = 0;\n\n // ---- list family ----\n const listSigToName = new Map<string, string>();\n const listViews =\n container.listViews && typeof container.listViews === 'object' ? container.listViews : {};\n for (const [k, v] of Object.entries<any>(listViews)) {\n if (!v || typeof v !== 'object') continue;\n const requested = `${object}.${k}`;\n const name = uniqueViewName(requested, used);\n if (name !== requested) collisions.push({ requested, renamedTo: name, viewKind: 'list', key: k });\n listSigToName.set(viewSignature(v), name);\n const item: ExpandedViewItem = { name, object, viewKind: 'list', label: v.label, config: cloneViewConfig(v), order: order++, scope: 'package' };\n stampRenameWarning(item, requested);\n out.push(item);\n }\n const defaultList = container.list;\n let defaultListName: string | undefined;\n if (defaultList && typeof defaultList === 'object') {\n const dup = listSigToName.get(viewSignature(defaultList));\n if (dup) {\n defaultListName = dup; // already represented by a named listViews entry\n } else {\n const key = typeof defaultList.name === 'string' && defaultList.name ? defaultList.name : 'default';\n const requested = `${object}.${key}`;\n const name = uniqueViewName(requested, used);\n if (name !== requested) collisions.push({ requested, renamedTo: name, viewKind: 'list', key });\n const item: ExpandedViewItem = { name, object, viewKind: 'list', label: defaultList.label, config: cloneViewConfig(defaultList), order: order++, scope: 'package' };\n stampRenameWarning(item, requested);\n out.push(item);\n defaultListName = name;\n }\n }\n if (!defaultListName && out.length) defaultListName = out[0].name;\n for (const item of out) {\n if (item.viewKind === 'list' && item.name === defaultListName) item.isDefault = true;\n }\n\n // ---- form family ----\n const formStart = out.length;\n const formSigSeen = new Set<string>();\n const formViews =\n container.formViews && typeof container.formViews === 'object' ? container.formViews : {};\n for (const [k, v] of Object.entries<any>(formViews)) {\n if (!v || typeof v !== 'object') continue;\n const requested = `${object}.${k}`;\n const name = uniqueViewName(requested, used);\n if (name !== requested) collisions.push({ requested, renamedTo: name, viewKind: 'form', key: k });\n formSigSeen.add(viewSignature(v));\n const item: ExpandedViewItem = { name, object, viewKind: 'form', label: v.label, config: cloneViewConfig(v), order: order++, scope: 'package' };\n stampRenameWarning(item, requested);\n out.push(item);\n }\n const defaultForm = container.form;\n let defaultFormName: string | undefined;\n if (defaultForm && typeof defaultForm === 'object' && !formSigSeen.has(viewSignature(defaultForm))) {\n const key = typeof defaultForm.name === 'string' && defaultForm.name ? defaultForm.name : 'form';\n const requested = `${object}.${key}`;\n const name = uniqueViewName(requested, used);\n if (name !== requested) collisions.push({ requested, renamedTo: name, viewKind: 'form', key });\n const item: ExpandedViewItem = { name, object, viewKind: 'form', label: defaultForm.label, config: cloneViewConfig(defaultForm), order: order++, scope: 'package' };\n stampRenameWarning(item, requested);\n out.push(item);\n defaultFormName = name;\n }\n if (!defaultFormName && out.length > formStart) defaultFormName = out[formStart].name;\n for (let i = formStart; i < out.length; i++) {\n if (out[i].name === defaultFormName) out[i].isDefault = true;\n }\n\n return { items: out, collisions };\n}\n\n/**\n * Expand an aggregated view container into independent ViewItems.\n *\n * Thin wrapper over {@link expandViewContainerWithDiagnostics} that discards the\n * collision diagnostics — the shape every runtime loader consumes. Behaviour is\n * unchanged: colliding names are still renamed so the registry key stays unique.\n */\nexport function expandViewContainer(object: string, container: any): ExpandedViewItem[] {\n return expandViewContainerWithDiagnostics(object, container).items;\n}\n\n/**\n * Type-safe factory for a standalone {@link FormView} bound to a JSON Schema\n * rather than to an ObjectQL object.\n *\n * Use this for forms that edit **metadata** (e.g. `report.form.ts`,\n * `dashboard.form.ts`), **action inputs**, or **flow screens** — anywhere the\n * data shape is described by a Zod-derived JSON Schema instead of an Object\n * field set.\n *\n * The returned FormView is validated at definition time; the runtime form\n * renderer (`@object-ui/plugin-form`) inspects `data.provider === 'schema'`\n * and pulls field metadata from the resolved JSON Schema instead of from\n * ObjectQL.\n *\n * @example\n * ```ts\n * export const reportForm = defineForm({\n * schemaId: 'report',\n * type: 'tabbed',\n * sections: [\n * { label: 'Basics', columns: 2, fields: [\n * { field: 'name' },\n * { field: 'label' },\n * { field: 'objectName', widget: 'ref:object' },\n * { field: 'type' },\n * ]},\n * { label: 'Columns', fields: [{ field: 'columns', widget: 'master-detail' }] },\n * { label: 'Advanced', collapsible: true, collapsed: true, fields: [\n * { field: 'filter', widget: 'filter-builder' },\n * { field: 'chart', widget: 'chart-config' },\n * ]},\n * ],\n * });\n * ```\n */\nexport function defineForm(\n config: Omit<z.input<typeof FormViewSchema>, 'data'> & { schemaId: string },\n): FormView {\n const { schemaId, ...rest } = config;\n return FormViewSchema.parse({\n ...rest,\n data: { provider: 'schema', schemaId },\n });\n}\n\nexport type View = z.infer<typeof ViewSchema>;\nexport type ViewItem = z.infer<typeof ViewItemSchema>;\nexport type ViewScope = z.infer<typeof ViewScopeSchema>;\nexport type ViewKind = z.infer<typeof ViewKindSchema>;\nexport type ListView = z.infer<typeof ListViewSchema>;\nexport type FormView = z.infer<typeof FormViewSchema>;\nexport type FormSection = z.infer<typeof FormSectionSchema>;\nexport type ListColumn = z.infer<typeof ListColumnSchema>;\nexport type FormField = z.infer<typeof FormFieldSchema>;\nexport type SelectionConfig = z.infer<typeof SelectionConfigSchema>;\nexport type NavigationConfig = z.infer<typeof NavigationConfigSchema>;\nexport type PaginationConfig = z.infer<typeof PaginationConfigSchema>;\nexport type ViewData = z.infer<typeof ViewDataSchema>;\nexport type HttpRequest = z.infer<typeof HttpRequestSchema>;\nexport type HttpMethod = z.infer<typeof HttpMethodSchema>;\nexport type ColumnSummary = z.infer<typeof ColumnSummarySchema>;\nexport type RowHeight = z.infer<typeof RowHeightSchema>;\nexport type GroupingConfig = z.infer<typeof GroupingConfigSchema>;\nexport type GalleryConfig = z.infer<typeof GalleryConfigSchema>;\nexport type TimelineConfig = z.infer<typeof TimelineConfigSchema>;\nexport type ListChartConfig = z.infer<typeof ListChartConfigSchema>;\nexport type ViewSharing = z.infer<typeof ViewSharingSchema>;\nexport type RowColorConfig = z.infer<typeof RowColorConfigSchema>;\nexport type VisualizationType = z.infer<typeof VisualizationTypeSchema>;\nexport type UserActionsConfig = z.infer<typeof UserActionsConfigSchema>;\nexport type AppearanceConfig = z.infer<typeof AppearanceConfigSchema>;\nexport type ViewTab = z.infer<typeof ViewTabSchema>;\nexport type UserFilterField = z.infer<typeof UserFilterFieldSchema>;\nexport type UserFilters = z.infer<typeof UserFiltersSchema>;\nexport type AddRecordConfig = z.infer<typeof AddRecordConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FieldSchema } from './field.zod';\nimport { ValidationRuleSchema } from './validation.zod';\nimport { ActionSchema } from '../ui/action.zod';\nimport { ObjectListViewSchema } from '../ui/view.zod';\n\n/**\n * API Operations Enum\n */\nimport { TemplateExpressionInputSchema } from '../shared/expression.zod';\nimport { lazySchema } from '../shared/lazy-schema';\nimport { MetadataProtectionFields } from '../kernel/metadata-protection.zod';\nimport { ProtectionSchema } from '../shared/protection.zod';\nexport const ApiMethod = z.enum([\n 'get', 'list', // Read\n 'create', 'update', 'delete', // Write\n 'upsert', // Idempotent Write\n 'bulk', // Batch operations\n 'aggregate', // Analytics (count, sum)\n 'history', // Audit access\n 'search', // Search access\n 'restore', 'purge', // Trash management\n 'import', 'export', // Data portability\n]);\nexport type ApiMethod = z.infer<typeof ApiMethod>;\n\n/**\n * Capability Flags\n * Defines what system features are enabled for this object.\n * \n * Optimized based on industry standards (Salesforce, ServiceNow):\n * - Added `activities` (Tasks/Events)\n * - Added `mru` (Recent Items)\n * - Added `feeds` (Social/Chatter)\n * - Grouped API permissions\n * \n * @example\n * {\n * trackHistory: true,\n * searchable: true,\n * apiEnabled: true,\n * files: true\n * }\n */\nexport const ObjectCapabilities = z.object({\n /** Enable history tracking (Audit Trail) */\n trackHistory: z.boolean().default(false).describe('Enable field history tracking for audit compliance'),\n \n /** Enable global search indexing */\n searchable: z.boolean().default(true).describe('Index records for global search'),\n \n /** Enable REST/GraphQL API access */\n apiEnabled: z.boolean().default(true).describe('Expose object via automatic APIs'),\n\n /** \n * API Supported Operations\n * Granular control over API exposure.\n */\n apiMethods: z.array(ApiMethod).optional().describe('Whitelist of allowed API operations'),\n \n /** Enable standard attachments/files engine */\n files: z.boolean().default(false).describe('Enable file attachments and document management'),\n \n /** Enable social collaboration (Comments, Mentions, Feeds) */\n feeds: z.boolean().default(false).describe('Enable social feed, comments, and mentions (Chatter-like)'),\n \n /** Enable standard Activity suite (Tasks, Calendars, Events) */\n activities: z.boolean().default(false).describe('Enable standard tasks and events tracking'),\n\n /** Enable Recycle Bin / Soft Delete */\n trash: z.boolean().default(true).describe('Enable soft-delete with restore capability'),\n\n /** Enable \"Recently Viewed\" tracking */\n mru: z.boolean().default(true).describe('Track Most Recently Used (MRU) list for users'),\n \n /** Allow cloning records */\n clone: z.boolean().default(true).describe('Allow record deep cloning'),\n});\n\n/**\n * Schema for database indexes.\n * Enhanced with additional index types and configuration options\n * \n * @example\n * {\n * name: \"idx_account_name\",\n * fields: [\"name\"],\n * type: \"btree\",\n * unique: true\n * }\n */\nexport const IndexSchema = lazySchema(() => z.object({\n name: z.string().optional().describe('Index name (auto-generated if not provided)'),\n fields: z.array(z.string()).describe('Fields included in the index'),\n type: z.enum(['btree', 'hash', 'gin', 'gist', 'fulltext']).optional().default('btree').describe('Index algorithm type'),\n unique: z.boolean().optional().default(false).describe('Whether the index enforces uniqueness'),\n partial: z.string().optional().describe('Partial index condition (SQL WHERE clause for conditional indexes)'),\n}));\n\n/**\n * Search Configuration\n * Defines how this object behaves in search results.\n * \n * @example\n * {\n * fields: [\"name\", \"email\", \"phone\"],\n * displayFields: [\"name\", \"title\"],\n * filters: [\"status = 'active'\"]\n * }\n */\nexport const SearchConfigSchema = lazySchema(() => z.object({\n fields: z.array(z.string()).describe('Fields to index for full-text search weighting'),\n displayFields: z.array(z.string()).optional().describe('Fields to display in search result cards'),\n filters: z.array(z.string()).optional().describe('Default filters for search results'),\n}));\n\n/**\n * Multi-Tenancy Configuration Schema\n * Configures tenant isolation strategy for SaaS applications\n * \n * @example Shared database with tenant_id isolation\n * {\n * enabled: true,\n * strategy: 'shared',\n * tenantField: 'tenant_id',\n * crossTenantAccess: false\n * }\n */\nexport const TenancyConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().describe('Enable multi-tenancy for this object'),\n strategy: z.enum(['shared', 'isolated', 'hybrid']).describe('Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)'),\n tenantField: z.string().default('tenant_id').describe('Field name for tenant identifier'),\n crossTenantAccess: z.boolean().default(false).describe('Allow cross-tenant data access (with explicit permission)'),\n}));\n\n/**\n * [ADR-0066 D2] Secure-by-default object posture.\n *\n * Declares whether the object participates in blanket wildcard permission\n * grants — a data-model posture like {@link TenancyConfigSchema}, NOT an\n * assignment (it names no principal).\n *\n * - `public` (default) — covered by a permission set's `'*'` wildcard object\n * grant; today's allow-by-default behaviour.\n * - `private` — NOT covered by the `'*'` wildcard grant; access requires an\n * EXPLICIT per-object grant (Salesforce \"new object = no access until\n * granted\"). A `private` object is ALSO exempt from wildcard RLS\n * (`tenant_isolation`, owner scoping): the posture-gated superuser bypass\n * (`viewAllRecords`/`modifyAllRecords`) short-circuits RLS, so a platform\n * admin — incl. one who is also an org admin whose `tenant_isolation` would\n * otherwise narrow the result — sees all rows, while non-admins without an\n * explicit grant see none.\n *\n * Pair with the object's `requiredPermissions` (D3) to additionally gate access\n * on holding a capability.\n */\nexport const ObjectAccessConfigSchema = lazySchema(() => z.object({\n default: z.enum(['public', 'private']).default('public')\n .describe('Default exposure posture: public (covered by wildcard grants) | private (needs explicit grant; exempt from wildcard RLS).'),\n}));\n\n/**\n * Soft Delete Configuration Schema\n * Implements recycle bin / trash functionality\n * \n * @example Standard soft delete with cascade\n * {\n * enabled: true,\n * field: 'deleted_at',\n * cascadeDelete: true\n * }\n */\nexport const SoftDeleteConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().describe('Enable soft delete (trash/recycle bin)'),\n field: z.string().default('deleted_at').describe('Field name for soft delete timestamp'),\n cascadeDelete: z.boolean().default(false).describe('Cascade soft delete to related records'),\n}));\n\n/**\n * Versioning Configuration Schema\n * Implements record versioning and history tracking\n * \n * @example Snapshot versioning with 90-day retention\n * {\n * enabled: true,\n * strategy: 'snapshot',\n * retentionDays: 90,\n * versionField: 'version'\n * }\n */\nexport const VersioningConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().describe('Enable record versioning'),\n strategy: z.enum(['snapshot', 'delta', 'event-sourcing']).describe('Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)'),\n retentionDays: z.number().min(1).optional().describe('Number of days to retain old versions (undefined = infinite)'),\n versionField: z.string().default('version').describe('Field name for version number/timestamp'),\n}));\n\n\n/**\n * Object Field Group Schema — MVP (data-layer protocol)\n * \n * Declares the set of logical field groups for an object. A group bundles\n * related fields together for presentation in forms, detail pages, and\n * editors (e.g., \"Contact Info\", \"Billing\", \"System\").\n * \n * Design rules (MVP):\n * - Group **order** is the declaration order of this array — no `order` property.\n * - Field → group mapping is derived automatically from `Field.group`\n * matching `ObjectFieldGroup.key`; the **in-group display order** equals\n * the traversal order of `ObjectSchema.fields`.\n * - Fields whose `group` is unset (or references an undeclared key) are\n * considered ungrouped and must be rendered by consumers in a default\n * bucket after the declared groups, preserving their field declaration order.\n * - Extension packages and runtime code use `Field.group` to assign fields\n * to an existing group — no per-field order property is introduced at this\n * layer.\n * \n * Migration operations supported by this MVP:\n * - add / rename / delete / reorder groups (via the array)\n * - assign an existing field to a group (via `Field.group`)\n * \n * Deferred (not part of MVP):\n * - explicit per-field in-group ordering\n * - nested groups / sub-groups\n * - group-level visibility predicates (a `visibleOn` key existed here\n * briefly with no consumer anywhere; removed per ADR-0085 / ADR-0049\n * enforce-or-remove — re-add together with its enforcement when a\n * surface actually evaluates it)\n *\n * Derivation semantics (declared order, empty groups dropped, ungrouped\n * trailing bucket, collapse passthrough) are single-sourced in\n * `deriveFieldGroupLayout` (field-group-layout.ts, ADR-0085 §5) — UI\n * renderers consume that helper instead of re-implementing the rules.\n *\n * @example\n * ```ts\n * fieldGroups: [\n * { key: 'contact_info', label: 'Contact Information', icon: 'user' },\n * { key: 'billing', label: 'Billing', collapse: 'collapsed' },\n * { key: 'system', label: 'System' },\n * ]\n * ```\n */\nexport const ObjectFieldGroupSchema = lazySchema(() => z.object({\n /** Group key — referenced by `Field.group` to assign a field to this group. Must be snake_case. */\n key: z.string().regex(/^[a-z_][a-z0-9_]*$/, {\n message: 'Field group key must be lowercase snake_case (e.g., \"contact_info\", \"billing\", \"system\")',\n }).describe('Group machine key (snake_case). Referenced by Field.group.'),\n\n /** Human-readable label displayed as the group header. */\n label: z.string().describe('Group display label'),\n\n /** Optional Lucide/Material icon name for the group header. */\n icon: z.string().optional().describe('Icon name (Lucide/Material) for the group header'),\n\n /** Optional description / help text shown under the group header. */\n description: z.string().optional().describe('Optional description shown under the group header'),\n\n /**\n * [ADR-0085] Collapse behaviour of the group's rendered section, on every\n * surface (form, detail, drawer). One enum, three valid states — replaces\n * the old `defaultExpanded` flag AND the UI-dialect `collapsible`/`collapsed`\n * boolean pair, which could express contradictions and had drifted between\n * spec and renderer (spec declared a key no renderer read; renderers read\n * keys the spec rejected).\n */\n collapse: z.enum(['none', 'expanded', 'collapsed']).optional().default('none')\n .describe(\"[ADR-0085] Section collapse behaviour: 'none' (always open, no toggle), 'expanded' (collapsible, starts open), 'collapsed' (collapsible, starts closed).\"),\n\n /**\n * @deprecated [ADR-0085 → `collapse`] Accepted as a parse-time alias:\n * `defaultExpanded: false` maps to `collapse: 'collapsed'`, `true` to\n * `'expanded'`, when `collapse` is absent. New metadata sets `collapse`.\n */\n defaultExpanded: z.boolean().optional().describe(\"[DEPRECATED → collapse] true → 'expanded', false → 'collapsed'.\"),\n /** @deprecated [ADR-0085 → `collapse`] UI-dialect alias (pair with `collapsed`); mapped onto `collapse` at parse. */\n collapsible: z.boolean().optional().describe(\"[DEPRECATED → collapse] Boolean pair with `collapsed`; use the `collapse` enum.\"),\n /** @deprecated [ADR-0085 → `collapse`] UI-dialect alias (pair with `collapsible`); mapped onto `collapse` at parse. */\n collapsed: z.boolean().optional().describe(\"[DEPRECATED → collapse] Boolean pair with `collapsible`; use the `collapse` enum.\"),\n}));\n\nexport type ObjectFieldGroup = z.infer<typeof ObjectFieldGroupSchema>;\nexport type ObjectFieldGroupInput = z.input<typeof ObjectFieldGroupSchema>;\n\n/**\n * Base Object Schema Definition\n * \n * The Blueprint of a Business Object.\n * Represents a table, a collection, or a virtual entity.\n * \n * @example\n * ```yaml\n * name: project_task\n * label: Project Task\n * icon: task\n * fields:\n * project:\n * type: lookup\n * reference: project\n * status:\n * type: select\n * options: [todo, in_progress, done]\n * enable:\n * trackHistory: true\n * files: true\n * ```\n */\n\n/**\n * External Binding (ADR-0015)\n *\n * Optional per-object descriptor that binds this object to a remote table\n * on a federated datasource (one whose `schemaMode !== 'managed'`). When\n * present, the object is \"external\": DDL is forbidden, the table is\n * validated against the remote schema at boot, and writes require a double\n * opt-in (`datasource.external.allowWrites` **and** this `writable`).\n *\n * The cross-field invariant (\"`external` only when the object's datasource\n * has `schemaMode !== 'managed'`\") is enforced at metadata-load time, not\n * in this schema, because the datasource may live in another artefact.\n */\nexport const ObjectExternalBindingSchema = z.object({\n remoteName: z.string().optional()\n .describe('Remote table/view name. Defaults to object.name.'),\n remoteSchema: z.string().optional()\n .describe('Remote schema/database qualifier.'),\n writable: z.boolean().default(false)\n .describe('Per-object write opt-in (also requires datasource.external.allowWrites).'),\n columnMap: z.record(z.string(), z.string()).optional()\n .describe('Remote column name → local field name.'),\n introspectedAt: z.string().datetime().optional()\n .describe('Set by `os datasource introspect`; informational.'),\n ignoreColumns: z.array(z.string()).optional()\n .describe('Remote columns to skip during validation (dev convenience).'),\n}).describe('External datasource binding (ADR-0015)');\n\nexport type ObjectExternalBinding = z.infer<typeof ObjectExternalBindingSchema>;\n\nconst ObjectSchemaBase = z.object({\n /** \n * Identity & Metadata \n */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Machine unique key (snake_case). Immutable.'),\n label: z.string().optional().describe('Human readable singular label (e.g. \"Account\")'),\n pluralLabel: z.string().optional().describe('Human readable plural label (e.g. \"Accounts\")'),\n description: z.string().optional().describe('Developer documentation / description'),\n icon: z.string().optional().describe('Icon name (Lucide/Material) for UI representation'),\n\n /**\n * Taxonomy & Organization\n */\n tags: z.array(z.string()).optional().describe('Categorization tags (e.g. \"sales\", \"system\", \"reference\")'),\n active: z.boolean().optional().default(true).describe('Is the object active and usable'),\n isSystem: z.boolean().optional().default(false).describe('Is system object (protected from deletion)'),\n abstract: z.boolean().optional().default(false).describe('Is abstract base object (cannot be instantiated)'),\n\n /**\n * Managed-by hint — declares which lifecycle bucket the object belongs\n * to so UI clients render the appropriate set of CRUD affordances and\n * the security layer can enforce matching defaults. Modelled after the\n * way Salesforce / ServiceNow / Workday segregate user-owned business\n * data from admin-authored configuration, system-driven runtime rows,\n * and append-only audit trails.\n *\n * - `platform` — **Default.** User-owned business data. Generic\n * New / Import / Edit / Delete affordances are all shown. Example:\n * the user's own `sys_attachment`, `sys_comment`, `sys_saved_report`.\n * - `config` — Admin-authored metadata / configuration. Generic\n * New / Edit / Delete shown (admins author via wizard or form), but\n * CSV Import is suppressed (config rows have nested JSON envelopes\n * that don't round-trip through a flat sheet; clients should offer a\n * purpose-built \"Import definition (JSON)\" action instead). Example:\n * `sys_sharing_rule`, `sys_role`, `sys_permission_set`, `sys_view`,\n * `sys_app`.\n * - `system` — Runtime rows whose lifecycle is owned by a\n * platform service (the approval engine, the sharing engine, the\n * invitation service, …). Generic CRUD is hidden — users interact\n * with these via *domain actions* invoked from the source record\n * (e.g. \"Submit for Approval\" on an Opportunity creates an\n * `sys_approval_request`; \"Recall\" on the request changes its\n * state). Example: `sys_approval_request`, `sys_record_share`,\n * `sys_notification`, `sys_invitation`,\n * `sys_user_permission_set` / `sys_role_permission_set`.\n * - `append-only` — Immutable audit log. No New / Import / Edit /\n * Delete; only View and Export. Example: `sys_approval_action`,\n * `sys_audit_log`, `sys_activity`, `sys_email`, `sys_presence`.\n * - `better-auth` — Identity tables owned by the better-auth driver\n * (sys_user, sys_session, sys_account, sys_member, sys_organization,\n * sys_api_key, sys_jwks, sys_verification, sys_two_factor,\n * sys_oauth_*, sys_device_code). Mutations must flow through the\n * better-auth API so password hashing, token signing, email\n * verification, and invitation flows fire correctly. Generic CRUD\n * suppressed; replaced by purpose-built actions\n * (Invite User, Reset Password, Revoke Session, Rotate Key, …).\n *\n * The flag is purely declarative on the schema. Enforcement happens in\n * two places:\n * 1. Default permission sets ({@link packages/platform-objects/src/security/default-permission-sets.ts})\n * deny direct CRUD for `system` / `append-only` / `better-auth`.\n * 2. UI clients honour {@link resolveCrudAffordances} to gate the\n * New / Import / Edit / Delete / Export buttons accordingly.\n *\n * Use {@link userActions} to override the default matrix for a single\n * field (e.g. an \"append-only\" table that should still allow Export).\n */\n managedBy: z.enum(['platform', 'config', 'system', 'append-only', 'better-auth']).optional().describe(\n 'Lifecycle bucket — platform (user CRUD) | config (admin authored) | system (engine-managed) | append-only (audit) | better-auth (identity). UI clients honour the resolved affordance matrix.',\n ),\n\n /**\n * Per-object override of the generic CRUD affordances that the UI\n * surfaces. Each flag overrides the default derived from\n * {@link managedBy} via {@link resolveCrudAffordances}. Useful for the\n * handful of objects whose lifecycle doesn't cleanly fit a single\n * bucket — e.g. an `append-only` table that should still expose CSV\n * Export, or a `config` table that admins legitimately want to bulk\n * import via CSV.\n *\n * Omitting the block (or leaving individual flags `undefined`) keeps\n * the {@link managedBy}-derived default.\n */\n userActions: z.object({\n create: z.boolean().optional().describe('Show generic \"New\" button.'),\n import: z.boolean().optional().describe('Show CSV import wizard entry.'),\n edit: z.boolean().optional().describe('Allow inline / form edit of existing rows.'),\n delete: z.boolean().optional().describe('Show row-level delete + bulk delete.'),\n exportCsv: z.boolean().optional().describe('Show CSV export entry.'),\n }).optional().describe('Per-object override of the resolved CRUD affordance matrix.'),\n\n /**\n * System-field auto-injection control.\n *\n * The `SchemaRegistry` augments every user object with a small set of\n * implicit system fields at registration time so authors don't have to\n * declare them per-object (Salesforce-style). Currently injected:\n *\n * - `organization_id` — `lookup → sys_organization`. Injected only when\n * the kernel runs in multi-tenant mode (`OS_MULTI_ORG_ENABLED === 'true'`;\n * default is off — single-tenant).\n * Required for the default `tenant_isolation` RLS policy and the\n * SecurityPlugin's auto-fill on insert to take effect.\n *\n * Author-declared fields with the same name always win over injection\n * (no overwrite). Objects with `managedBy` set are skipped entirely —\n * better-auth/system/platform tables already declare what they need.\n *\n * Set `systemFields: false` to opt the object out completely. Pass an\n * options object to selectively disable individual injections (currently\n * only `tenant`, but reserved keys `owner`/`audit` are pre-defined for\n * future expansion).\n *\n * @default undefined (= injection enabled, gated by kernel mode)\n */\n systemFields: z\n .union([\n z.literal(false),\n z.object({\n tenant: z.boolean().optional().describe('Inject organization_id (multi-tenant only). Default true.'),\n owner: z.boolean().optional().describe('Reserved for future owner_id auto-injection.'),\n audit: z.boolean().optional().describe('Reserved for future created_by/updated_by auto-injection.'),\n }),\n ])\n .optional()\n .describe('Opt out of, or selectively disable, registry-level system-field auto-injection.'),\n\n /** \n * Storage & Virtualization \n */\n datasource: z.string().optional().default('default').describe('Target Datasource ID. \"default\" is the primary DB.'),\n\n /**\n * External Binding (ADR-0015)\n * Present only for federated objects routed to a datasource whose\n * `schemaMode !== 'managed'`. Describes the remote table binding and\n * per-object writability. See {@link ObjectExternalBindingSchema}.\n */\n external: ObjectExternalBindingSchema.optional()\n .describe('Remote table binding for federated (external) objects.'),\n\n\n /**\n * Data Model\n */\n fields: z.record(z.string().regex(/^[a-z_][a-z0-9_]*$/, {\n message: 'Field names must be lowercase snake_case (e.g., \"first_name\", \"company\", \"annual_revenue\")',\n }), FieldSchema).describe('Field definitions map. Keys must be snake_case identifiers.'),\n indexes: z.array(IndexSchema).optional().describe('Database performance indexes'),\n\n /**\n * Field Groups (MVP)\n * \n * Declares logical groups for presenting fields in forms and detail\n * pages. The **array order is the group display order**. Each field's\n * `Field.group` references an entry's `key` to assign it to a group;\n * within a group, fields are displayed in their `ObjectSchema.fields`\n * declaration order.\n * \n * See {@link ObjectFieldGroupSchema} for the full MVP contract and\n * deferred features.\n */\n fieldGroups: z.array(ObjectFieldGroupSchema).refine(\n (groups) => new Set(groups.map(g => g.key)).size === groups.length,\n { message: 'fieldGroups[].key must be unique within an object' },\n ).optional().describe('Ordered list of field groups (array order = display order). See ObjectFieldGroupSchema.'),\n \n /**\n * Advanced Data Management\n */\n \n // Multi-tenancy configuration\n tenancy: TenancyConfigSchema.optional().describe('Multi-tenancy configuration for SaaS applications'),\n\n /**\n * [ADR-0066 D2] Secure-by-default object posture. `access.default: 'private'`\n * opts the object OUT of blanket wildcard (`'*'`) permission grants (access\n * then needs an explicit per-object grant) and exempts it from wildcard RLS\n * via the posture-gated superuser bypass. Absent ⇒ `public` (today's\n * allow-by-default behaviour; no migration for existing objects).\n */\n access: ObjectAccessConfigSchema.optional().describe('[ADR-0066 D2] Object exposure posture (public-by-default vs private secure-by-default).'),\n\n /**\n * [ADR-0066 D3] Capability contract — capability name(s) (permission-set\n * `systemPermissions`; D1 records) a caller MUST hold to access this object at\n * all. Mirrors `App.requiredPermissions`. Enforced by plugin-security as an\n * AND-gate: checked IN ADDITION to permission-set CRUD grants — a caller\n * missing any listed capability is denied regardless of grants. Absent/empty\n * ⇒ no capability gate.\n */\n requiredPermissions: z.array(z.string()).optional().describe('[ADR-0066 D3] Capabilities required to access this object (AND-gate, checked alongside CRUD grants).'),\n \n // Soft delete configuration\n softDelete: SoftDeleteConfigSchema.optional().describe('Soft delete (trash/recycle bin) configuration'),\n \n // Versioning configuration\n versioning: VersioningConfigSchema.optional().describe('Record versioning and history tracking configuration'),\n \n // Partitioning strategy\n \n /**\n * Logic & Validation (Co-located)\n * Best Practice: Define rules close to data.\n */\n validations: z.array(ValidationRuleSchema).optional().describe('Object-level validation rules'),\n\n /**\n * Declarative semantic activity milestones (ADR-0052 §5b.2). When a watched\n * field transitions INTO `value`, the platform emits a templated activity-row\n * on the record timeline — no `*.hook.ts` / `*.flow.ts`. Complements field-level\n * `trackHistory` (which renders raw \"Field: old → new\"): use milestones for\n * business-meaningful events (\"Deal won\", \"Task completed\"). `summary` supports\n * `{field}` tokens interpolated from the record; the milestone summary takes\n * precedence over the field-change summary for the same update. Consumed by\n * `@objectstack/plugin-audit` audit-writers (enforce-or-remove, ADR-0049).\n */\n activityMilestones: z.array(z.object({\n field: z.string().describe('Field to watch (typically a status/stage select).'),\n value: z.string().describe('The value the field must transition INTO to fire the milestone.'),\n summary: z.string().describe('Activity summary template; {field} tokens interpolate the record value. e.g. \"Deal won: {name}\".'),\n type: z.string().optional().describe('Activity type for the emitted row (default \"completed\").'),\n })).optional().describe('Declarative semantic activity milestones — emit a templated timeline row when a field transitions into a value, no hook code (ADR-0052 §5b.2).'),\n\n // ADR-0020: record state machines are not a separate `stateMachines` map —\n // each lifecycle is a `state_machine` rule in `validations` above (one rule\n // per state field). Parallel lifecycles = multiple rules. The write path\n // enforces the transition table; UIs read the legal next states via the\n // `/meta/objects/:name/state/:field?from=` introspection endpoint.\n\n /**\n * Display & UI Hints (Data-Layer)\n */\n /**\n * [ADR-0079] Canonical pointer to the object's PRIMARY title field — the one\n * real stored field (text / autonumber / formula→text) that is a record's\n * human name. Pairs with `recordName` (the Salesforce Name / Record-Name\n * model). Optional at the schema level for now (a hard required-refine is\n * staged so existing title-less metadata still parses). Resolve / derive via\n * `resolveDisplayField` from `@objectstack/spec/data` (display-name.ts), which\n * falls back to the deprecated `displayNameField` alias and then a derivation.\n */\n nameField: z.string().optional().describe('[ADR-0079] Canonical primary title field — the stored field used as the record display name (e.g. \"name\", \"title\"). Pairs with recordName.'),\n /**\n * @deprecated [ADR-0079] Renamed to `nameField`. Still ACCEPTED as an alias:\n * the schema copies `displayNameField` onto `nameField` on parse when\n * `nameField` is absent (both are preserved on the parsed output for\n * cross-repo back-compat). New metadata should set `nameField`.\n */\n displayNameField: z.string().optional().describe('[DEPRECATED → nameField] Field to use as the record display name (e.g., \"name\", \"title\"). Accepted as an alias for nameField.'),\n recordName: z.object({\n type: z.enum(['text', 'autonumber']).describe('Record name type: text (user-entered) or autonumber (system-generated)'),\n displayFormat: z.string().optional().describe('Auto-number format pattern (e.g., \"CASE-{0000}\", \"INV-{YYYY}-{0000}\")'),\n startNumber: z.number().int().min(0).optional().describe('Starting number for autonumber (default: 1)'),\n }).optional().describe('Record name generation configuration (Salesforce pattern)'),\n titleFormat: TemplateExpressionInputSchema.optional().describe('[DEPRECATED → nameField (ADR-0079)] Render-only title template; the server cannot return or query it, and an explicit nameField now takes precedence. Migrate a single-field title to nameField, a composite to a formula field designated as nameField.'),\n /**\n * [ADR-0085] Semantic role: the object's most important fields, in priority\n * order (the first entry wins wherever only one field fits, e.g. child-record\n * previews). Cross-surface by definition — drives default list/grid columns,\n * cards, hover/lookup previews, and the record-detail highlight strip (first\n * 4). Renamed from `compactLayout` (the value is an ordered field list, not\n * a layout); Salesforce compact-layout semantics.\n */\n highlightFields: z.array(z.string()).optional().describe('[ADR-0085] Ordered most-important fields; first entry wins where only one fits. Drives default columns, cards, previews, detail highlight strip. Renamed from compactLayout.'),\n // `compactLayout` (the pre-ADR-0085 spelling of `highlightFields`) was an\n // accepted parse-time alias for one deprecation window and is now RETIRED\n // (framework#2536): authoring it is rejected by `create()` like any unknown\n // key. All first-party consumers read `highlightFields` since objectui#2168.\n /**\n * [ADR-0085] Semantic role: the field that represents the record's LINEAR\n * lifecycle (an ordered pipeline / stage progression). A string names the\n * field; `false` declares the object's status-like field NON-linear (an\n * unordered state set such as active/suspended/void) and suppresses every\n * consumer's stage heuristics. Absent = consumers may heuristically detect\n * a stage field (status/stage/state/phase). Consumed by the record-detail\n * path/stepper today; kanban default grouping, list badges and report\n * bucketing are natural future consumers.\n */\n stageField: z.union([z.string(), z.literal(false)]).optional().describe('[ADR-0085] Lifecycle stage field (linear/ordered), or false to declare the status field non-linear and suppress stage heuristics. Absent = heuristic detection allowed.'),\n\n /**\n * Built-in List Views\n *\n * Curated, platform-shipped list views (grid / kanban / calendar / …)\n * keyed by view name. Rendered as segmented tabs in the console list page\n * **before** any user-saved `sys_view` rows. Use this for system objects\n * (audit, runtime, config) where the default \"All records\" grid lacks\n * business context — e.g. an approval-request list should ship with\n * \"My pending\", \"I submitted\", \"Completed\" tabs out of the box.\n *\n * Each value is an `ObjectListViewSchema` (a `ListViewSchema` minus the\n * page-only `userFilters` — ADR-0053 \"views\" mode, where the `ViewTabBar` is\n * the only nav control) so authors get the full tab/filter/sort/grouping\n * vocabulary without the wrong-context filter bar.\n *\n * @example\n * ```ts\n * listViews: {\n * my_pending: {\n * type: 'grid',\n * label: 'My Pending',\n * filter: [{ field: 'pending_approvers', operator: 'contains', value: '{current_user_id}' }],\n * sort: [{ field: 'updated_at', order: 'desc' }],\n * },\n * }\n * ```\n */\n listViews: z.record(z.string(), ObjectListViewSchema).optional().describe('Built-in named list views (segmented tabs) shipped with the object schema — \"views\" mode, no page-only userFilters (ADR-0053)'),\n\n /**\n * Search Engine Config \n */\n searchableFields: z.array(z.string()).optional().describe('Fields the `$search` query matches against (ADR-0061). Canonical default for the record picker, list quick-search and global search; views may narrow it. When unset, search auto-defaults to the name/title field plus short-text fields.'),\n search: SearchConfigSchema.optional().describe('Search engine configuration'),\n \n /** \n * System Capabilities \n */\n enable: ObjectCapabilities.optional().describe('Enabled system features modules'),\n\n /**\n * Sharing Model (org-wide default).\n *\n * `controlled_by_parent` (ADR-0055) makes this a DETAIL object in a\n * master-detail relationship: its access is *derived* from the master record\n * — a user sees/edits a detail only if they can see/edit its master. The\n * object must declare exactly one required `master_detail` field identifying\n * the master; the security layer auto-injects `masterFK IN (accessible master\n * ids)` on reads and requires master edit-access on by-id writes. No RLS policy\n * is authored — the inheritance is derived from the relationship.\n */\n sharingModel: z.enum(['private', 'public_read', 'public_read_write', 'controlled_by_parent', 'read', 'read_write', 'full']).optional().describe('Org-Wide Default record visibility (OWD). Canonical: private (owner-only) | public_read (everyone reads, owner writes) | public_read_write (everyone reads+writes) | controlled_by_parent (derived from the master record). Legacy aliases: read=public_read, read_write/full=public_read_write. ADR-0056 D1.'),\n\n /**\n * Public Share-Link Policy\n *\n * Opt-in declaration that records of this object MAY be published via\n * an opaque capability token (Notion / Google Docs / Figma \"anyone with\n * the link\" style). When omitted or `enabled:false`, the platform\n * refuses to create share-link rows for this object — independent of\n * any permission the caller holds.\n *\n * Distinct from {@link sharingModel}, which governs *principal-based*\n * sharing (share with specific users / teams / roles). A single object\n * can opt into both: principals get full edit, link recipients get\n * read-only with redaction.\n *\n * Defaults are conservative: when `enabled:true` and no other field is\n * provided, the plugin allows `link_only` audience + `view` permission\n * (the safest combination — caller still needs the URL to access).\n *\n * @see packages/plugins/plugin-sharing/src/share-link-service.ts\n */\n publicSharing: z.object({\n /** Master switch. When false (default), no share links can be issued for this object. */\n enabled: z.boolean().default(false).describe('Allow records of this object to be published via share link'),\n /**\n * Audiences the platform will accept when issuing a link.\n * - `public` — search engines may index; no token check (rare)\n * - `link_only` — anyone holding the token (default)\n * - `signed_in` — token + an authenticated session of any tenant user\n * - `email` — token + recipient's email matches an allowlist\n */\n allowedAudiences: z.array(z.enum(['public', 'link_only', 'signed_in', 'email'])).optional().describe('Audiences callers may select when creating a link'),\n /** Permission levels callers may grant via a link. Defaults to `['view']`. */\n allowedPermissions: z.array(z.enum(['view', 'comment', 'edit'])).optional().describe('Permission levels selectable on the share dialog'),\n /** Hard cap on requested expiry, in days. Links with `expires_at` further out are rejected. */\n maxExpiryDays: z.number().int().positive().optional().describe('Reject links with expiry beyond this many days'),\n /**\n * Fields stripped from every response served via a share token,\n * regardless of audience. Use for prompts, raw model output,\n * internal metadata, PII, etc. The owner's normal API access is\n * unaffected — redaction is applied only when the request principal\n * is `kind:'share-link'`.\n */\n redactFields: z.array(z.string()).optional().describe('Field names removed from records served via a share token'),\n /**\n * Optional CEL/JSONLogic predicate evaluated against the candidate\n * record when a link is created. When the predicate returns false,\n * the create call fails with 422 (e.g. \"draft records cannot be\n * shared\"). Evaluator is the same one used by sharing rules.\n */\n eligibility: z.string().optional().describe('CEL expression that must evaluate to true on the target record'),\n }).optional().describe('Public share-link policy (Notion/Figma-style link sharing)'),\n\n /** Key Prefix */\n keyPrefix: z.string().max(5).optional().describe('Short prefix for record IDs (e.g., \"001\" for Account)'),\n\n // [ADR-0085] The former `detail: { … }.passthrough()` UI-hints block is\n // REMOVED. Presentation intent lives in the cross-surface semantic roles\n // above (nameField / highlightFields / stageField / fieldGroups); per-page\n // control is an assigned Page. The passthrough block bred silently-inert\n // keys (9 read by renderers vs 3 typed; the typed `hideReferenceRail` was\n // itself a no-op for spec authors) — see the ADR for the full inventory.\n // `renderViaSchema` retires together with the legacy monolith render path.\n\n /**\n * Object Actions\n * \n * Actions associated with this object. Populated automatically by `defineStack()`\n * when top-level actions specify `objectName` matching this object.\n * Can also be defined directly on the object.\n * \n * Aligns with Salesforce/ServiceNow patterns where actions are part of the\n * object schema, so API responses (e.g., `/api/v1/meta/objects/:name`)\n * include the action list without requiring downstream merge.\n */\n actions: z.array(ActionSchema).optional().describe('Actions associated with this object (auto-populated from top-level actions via objectName)'),\n\n /**\n * ADR-0010 §3.7 — Package-level protection envelope. Package\n * authors declare lock policy here; the loader translates it\n * into the private `_lock` envelope at registration time and\n * strips this block before persistence. See\n * `shared/protection.zod.ts`.\n */\n protection: ProtectionSchema.optional().describe(\n 'Package author protection block — lock policy for this object.',\n ),\n\n // ADR-0010 — runtime protection envelope (internal — set by loader).\n ...MetadataProtectionFields,\n});\n\n/**\n * Converts a snake_case name to a human-readable Title Case label.\n * @example snakeCaseToLabel('project_task') → 'Project Task'\n */\nfunction snakeCaseToLabel(name: string): string {\n return name\n .split('_')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}\n\n/**\n * Known-confusable schema keys → precise authoring guidance.\n *\n * ADR-0032's \"no silent failure\" principle applied to metadata *shape*: an\n * unknown top-level key on `ObjectSchema.create()` used to be discarded by\n * Zod's default `.strip()`, so a misauthored schema key vanished with no\n * error, no warning, and a green `tsc` — shipping dead metadata the author\n * believed they had wired up (issue #1535, object-level `workflows: [...]`).\n *\n * These entries turn the most likely mistakes into a fixable error that points\n * at the *supported* mechanism rather than a generic \"unknown key\".\n */\nconst UNKNOWN_KEY_GUIDANCE: Record<string, string> = {\n workflows:\n '`workflows` is not an ObjectSchema field. Object-level, record-triggered ' +\n 'automation is authored as a lifecycle hook (`src/objects/<name>.hook.ts`, ' +\n 'registered via `defineHook()`) or as a top-level `record_change` flow — ' +\n 'not as `workflows[]` on the object schema.',\n workflow:\n '`workflow` is not an ObjectSchema field. Record-triggered automation is ' +\n 'authored as a lifecycle hook (`src/objects/<name>.hook.ts`) or a top-level ' +\n '`record_change` flow.',\n hooks:\n '`hooks` is not an ObjectSchema field. Lifecycle hooks live in their own ' +\n '`src/objects/<name>.hook.ts` module, registered via `defineHook()`.',\n triggers:\n '`triggers` is not an ObjectSchema field. Use a lifecycle hook ' +\n '(`src/objects/<name>.hook.ts`) or a top-level `record_change` flow.',\n\n // ── Tombstones for RETIRED keys (upgrade prescriptions) ────────────────\n // A retired key's error must carry the fix: the compile/validation error is\n // the one upgrade channel every consumer is guaranteed to hit — an agent\n // bumping @objectstack/spec sees THIS message, not our docs site. Each entry\n // names what replaced the key and the version/decision that removed it.\n // Tombstones age out too: drop an entry ~two majors after the removal\n // (by then it's archaeology, not an upgrade; see CHANGELOG.md for history).\n compactLayout:\n '`compactLayout` was renamed to `highlightFields` in @objectstack/spec 11.7.0 ' +\n '(ADR-0085 semantic roles) and the alias was retired in 11.9.1 (#2536). ' +\n 'Rename the key — the value shape (ordered field-name list) is unchanged.',\n detail:\n 'The `detail` UI-hints block was removed by ADR-0085 (spec 11.7.0). Its ' +\n 'jobs moved to top-level semantic roles: `detail.stageField` → `stageField` ' +\n '(string | false), `detail.highlightFields` → `highlightFields`, section ' +\n 'layout → `fieldGroups` + `Field.group`. Whole-page customization is done ' +\n 'by assigning a custom Page schema instead of per-page hint keys.',\n views:\n '`views` is not an ObjectSchema field: the object-level `views.form/*` and ' +\n '`views.detail/*` UI-hint dialect was never part of the spec and its ' +\n 'renderer support was removed (ADR-0085). Use the semantic roles ' +\n '(`highlightFields`, `stageField`, `fieldGroups`) for hints and `listViews` ' +\n 'for named list views.',\n defaultDetailForm:\n '`defaultDetailForm` was never implemented and was removed from the spec ' +\n '(#2402). Curate the record page by assigning a custom Page schema; form ' +\n 'layout derives from `fieldGroups` + `Field.group`.',\n};\n\n/** Levenshtein edit distance — backs the \"did you mean\" hint for typo'd keys. */\nfunction editDistance(a: string, b: string): number {\n const dp: number[][] = Array.from({ length: a.length + 1 }, () =>\n new Array<number>(b.length + 1).fill(0),\n );\n for (let i = 0; i <= a.length; i++) dp[i][0] = i;\n for (let j = 0; j <= b.length; j++) dp[0][j] = j;\n for (let i = 1; i <= a.length; i++) {\n for (let j = 1; j <= b.length; j++) {\n dp[i][j] = a[i - 1] === b[j - 1]\n ? dp[i - 1][j - 1]\n : 1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]);\n }\n }\n return dp[a.length][b.length];\n}\n\n/** Closest known key within a small edit distance, for typo hints (`indexs` → `indexes`). */\nfunction suggestKey(unknown: string, knownKeys: string[]): string | undefined {\n let best: string | undefined;\n let bestDist = Infinity;\n for (const key of knownKeys) {\n const d = editDistance(unknown.toLowerCase(), key.toLowerCase());\n if (d < bestDist) {\n bestDist = d;\n best = key;\n }\n }\n // Only suggest when the keys are genuinely close (guards against noise).\n return best !== undefined && bestDist <= Math.max(2, Math.floor(unknown.length / 3))\n ? best\n : undefined;\n}\n\n/**\n * Builds a precise, fixable error for unknown top-level keys on\n * `ObjectSchema.create()` — the metadata-shape analogue of ADR-0032's \"no\n * silent failure\" (issue #1535). Because authored `*.object.ts` modules call\n * `create()`, this surfaces as a located build error instead of a silently\n * stripped field.\n */\nfunction unknownKeyError(objectName: unknown, unknownKeys: string[], knownKeys: string[]): Error {\n const name = typeof objectName === 'string' && objectName.length > 0 ? objectName : '<unnamed>';\n const lines = unknownKeys.map((key) => {\n const guidance = UNKNOWN_KEY_GUIDANCE[key];\n if (guidance) return ` • ${guidance}`;\n const suggestion = suggestKey(key, knownKeys);\n return suggestion\n ? ` • \\`${key}\\` is not an ObjectSchema field — did you mean \\`${suggestion}\\`?`\n : ` • \\`${key}\\` is not an ObjectSchema field.`;\n });\n return new Error(\n `ObjectSchema.create('${name}'): unknown key(s) — ${unknownKeys.join(', ')}.\\n` +\n 'These keys would previously have been stripped silently at build, shipping ' +\n 'dead metadata with no diagnostic (ADR-0032 \"no silent failure\", issue #1535).\\n\\n' +\n `${lines.join('\\n')}\\n\\n` +\n 'Remove the unknown key(s), fix the typo, or move the logic to a supported mechanism.',\n );\n}\n\n/**\n * Rejects excess top-level keys at compile time: any key of `T` that is not a\n * key of the ObjectSchema input shape is constrained to `never`, turning the\n * silent strip into a `tsc` error at the authoring site as well as at build.\n */\ntype NoExcessObjectKeys<T> = T &\n Record<Exclude<keyof T, keyof z.input<typeof ObjectSchemaBase>>, never>;\n\n/**\n * [ADR-0079] Back-compat alias normalization: an object authored with the\n * deprecated `displayNameField` key still parses by mapping it onto the\n * canonical `nameField` when `nameField` is absent. `displayNameField` is\n * PRESERVED on the output (cross-repo consumers / older tests still read it).\n * Non-object inputs pass through untouched (Zod raises the real type error).\n */\nfunction normalizeNameFieldAlias(input: unknown): unknown {\n if (!input || typeof input !== 'object' || Array.isArray(input)) return input;\n const obj = input as Record<string, unknown>;\n if (obj.nameField == null && typeof obj.displayNameField === 'string') {\n return { ...obj, nameField: obj.displayNameField };\n }\n return input;\n}\n\n/**\n * [ADR-0085] Parse-time alias normalization for the semantic-role renames\n * (same pattern as `normalizeNameFieldAlias`; deprecated keys are PRESERVED\n * on output for cross-repo back-compat):\n *\n * - (`compactLayout` ⇄ `highlightFields` mirrored here during the ADR-0085\n * deprecation window; RETIRED by framework#2536 once objectui#2168 shipped.)\n * - `fieldGroups[].collapse` derived from the deprecated flags when absent:\n * the UI-dialect `collapsible`/`collapsed` pair wins over the old\n * `defaultExpanded` (it is what designer-authored metadata actually\n * carries); mapping: collapsed:true → 'collapsed'; collapsible:true →\n * 'expanded'; collapsible:false → 'none'; defaultExpanded:false →\n * 'collapsed'; defaultExpanded:true → 'expanded'.\n */\nfunction normalizeSemanticRoleAliases(input: unknown): unknown {\n if (!input || typeof input !== 'object' || Array.isArray(input)) return input;\n const obj = input as Record<string, unknown>;\n let out = obj;\n\n if (Array.isArray(obj.fieldGroups)) {\n let changed = false;\n const groups = (obj.fieldGroups as unknown[]).map((g) => {\n if (!g || typeof g !== 'object' || Array.isArray(g)) return g;\n const grp = g as Record<string, unknown>;\n if (grp.collapse != null) return g;\n let collapse: string | undefined;\n if (typeof grp.collapsible === 'boolean' || typeof grp.collapsed === 'boolean') {\n collapse = grp.collapsed === true ? 'collapsed' : grp.collapsible === true ? 'expanded' : 'none';\n } else if (typeof grp.defaultExpanded === 'boolean') {\n collapse = grp.defaultExpanded ? 'expanded' : 'collapsed';\n }\n if (collapse === undefined) return g;\n changed = true;\n return { ...grp, collapse };\n });\n if (changed) out = { ...out, fieldGroups: groups };\n }\n\n return out;\n}\n\n/**\n * Enhanced ObjectSchema with Factory\n */\nexport const ObjectSchema = lazySchema(() => {\n // Capture the ORIGINAL ZodObject parse/safeParse before `Object.assign`\n // mutates `ObjectSchemaBase` in place (assign returns the same object, so\n // overriding `.parse` on the result would otherwise recurse into itself).\n const baseParse = ObjectSchemaBase.parse.bind(ObjectSchemaBase);\n const baseSafeParse = ObjectSchemaBase.safeParse.bind(ObjectSchemaBase);\n return Object.assign(ObjectSchemaBase, {\n /**\n * [ADR-0079] Parse with deprecated-`displayNameField`→`nameField` alias\n * normalization applied first. Wraps the captured original ZodObject parse,\n * so `.shape` / `.create()`'s internal `ObjectSchemaBase.parse` keep working.\n */\n parse(data: unknown, params?: Parameters<typeof ObjectSchemaBase.parse>[1]) {\n return baseParse(normalizeSemanticRoleAliases(normalizeNameFieldAlias(data)), params);\n },\n safeParse(data: unknown, params?: Parameters<typeof ObjectSchemaBase.safeParse>[1]) {\n return baseSafeParse(normalizeSemanticRoleAliases(normalizeNameFieldAlias(data)), params);\n },\n /**\n * Type-safe factory for creating business object definitions.\n * \n * Enhancements over raw schema:\n * - **Auto-label**: Generates `label` from `name` if not provided (snake_case → Title Case).\n * - **Validation**: Runs Zod `.parse()` to validate the config at creation time.\n * - **No silent strip** (ADR-0032 / #1535): unknown top-level keys (e.g. a\n * typo'd `validation`, or an object-level `workflows[]`) are rejected with a\n * precise, fixable error instead of being discarded by Zod's `.strip()`.\n *\n * @example\n * ```ts\n * const Task = ObjectSchema.create({\n * name: 'project_task',\n * // label auto-generated as 'Project Task'\n * fields: {\n * subject: { type: 'text', label: 'Subject', required: true },\n * },\n * });\n * ```\n */\n create: <const T extends z.input<typeof ObjectSchemaBase>>(config: NoExcessObjectKeys<T>): Omit<ServiceObject, 'fields'> & Pick<T, 'fields'> => {\n // ADR-0032 \"no silent failure\" for schema shape (issue #1535): an unknown\n // top-level key here used to be discarded silently by Zod's `.strip()`. We\n // reject it with a located, fixable message *before* parsing so authors get\n // a build error instead of vanished metadata.\n const cfg = config as T & Record<string, unknown>;\n const knownKeys = Object.keys(ObjectSchemaBase.shape);\n const unknownKeys = Object.keys(cfg).filter((k) => !knownKeys.includes(k));\n if (unknownKeys.length > 0) {\n throw unknownKeyError(cfg.name, unknownKeys, knownKeys);\n }\n const withDefaults = {\n ...cfg,\n label: cfg.label ?? snakeCaseToLabel(cfg.name as string),\n };\n // [ADR-0079] `ObjectSchemaBase.parse` here is the alias-normalizing override\n // assigned just below (Object.assign mutates the base in place), so the\n // deprecated `displayNameField`→`nameField` mapping is applied for create()\n // too — no need to normalize again at this call site.\n return ObjectSchemaBase.parse(withDefaults) as Omit<ServiceObject, 'fields'> & Pick<T, 'fields'>;\n },\n });\n});\n\nexport type ServiceObject = z.infer<typeof ObjectSchemaBase>;\nexport type ServiceObjectInput = z.input<typeof ObjectSchemaBase>;\nexport type ObjectCapabilities = z.infer<typeof ObjectCapabilities>;\nexport type ObjectIndex = z.infer<typeof IndexSchema>;\nexport type TenancyConfig = z.infer<typeof TenancyConfigSchema>;\nexport type ObjectAccessConfig = z.infer<typeof ObjectAccessConfigSchema>;\nexport type SoftDeleteConfig = z.infer<typeof SoftDeleteConfigSchema>;\nexport type VersioningConfig = z.infer<typeof VersioningConfigSchema>;\n\n/**\n * Resolved CRUD affordance matrix for an object — what generic\n * lifecycle actions UI clients should expose in their toolbars.\n *\n * Use {@link resolveCrudAffordances} to compute this from a schema; the\n * `managedBy` flag drives the defaults, and the optional `userActions`\n * block per-flag-overrides them. UI clients (`ObjectView`,\n * `RecordDetailView`, `RecordFormPage`, …) gate their buttons on this\n * matrix in combination with the user's permissions.\n *\n * The presence of an affordance here means \"the *object* permits this\n * action conceptually\"; the user still needs the matching permission\n * grant to execute it.\n */\nexport interface CrudAffordances {\n /** Generic \"New\" button (single record creation form). */\n create: boolean;\n /** CSV bulk-import wizard. Disabled for config / system / append-only / better-auth by default. */\n import: boolean;\n /** Inline + form editing of existing rows. */\n edit: boolean;\n /** Row-level + bulk delete. */\n delete: boolean;\n /** CSV / clipboard export. Allowed even on append-only audit tables by default. */\n exportCsv: boolean;\n}\n\n/**\n * Default affordance matrix per {@link ObjectSchemaBase.managedBy} bucket.\n * Mirrors how Salesforce / ServiceNow / Workday / Notion expose CRUD on\n * different categories of system tables.\n *\n * platform — full CRUD (user-owned business data)\n * config — admin authored: New/Edit/Delete OK, no CSV import\n * (definitions have nested envelopes; admins should use\n * a purpose-built \"Import definition\" action instead)\n * system — engine-managed runtime rows: no generic CRUD; users\n * interact via domain actions on the source record\n * append-only — audit log: View + Export only\n * better-auth — identity tables owned by better-auth driver; CRUD\n * routed through purpose-built actions (Invite, Reset\n * PW, Revoke, …)\n */\nconst CRUD_AFFORDANCE_DEFAULTS: Record<NonNullable<ServiceObject['managedBy']> | 'platform', CrudAffordances> = {\n platform: { create: true, import: true, edit: true, delete: true, exportCsv: true },\n config: { create: true, import: false, edit: true, delete: true, exportCsv: true },\n system: { create: false, import: false, edit: false, delete: false, exportCsv: true },\n 'append-only': { create: false, import: false, edit: false, delete: false, exportCsv: true },\n 'better-auth': { create: false, import: false, edit: false, delete: false, exportCsv: true },\n};\n\n/**\n * Resolve the effective CRUD affordance matrix for an object schema.\n *\n * Starts from the bucket default keyed off `managedBy` (defaulting to\n * `'platform'` if unset) and applies the per-flag overrides in\n * `userActions`. Returns a fresh object so callers can mutate safely.\n *\n * @example\n * ```ts\n * const aff = resolveCrudAffordances(sysApprovalRequestSchema);\n * // → { create:false, import:false, edit:false, delete:false, exportCsv:true }\n * ```\n */\nexport function resolveCrudAffordances(\n obj: Pick<ServiceObject, 'managedBy' | 'userActions'> | { managedBy?: string; userActions?: ServiceObject['userActions'] },\n): CrudAffordances {\n const bucket = (obj?.managedBy ?? 'platform') as keyof typeof CRUD_AFFORDANCE_DEFAULTS;\n const base = CRUD_AFFORDANCE_DEFAULTS[bucket] ?? CRUD_AFFORDANCE_DEFAULTS.platform;\n const overrides = obj?.userActions ?? {};\n return {\n create: overrides.create ?? base.create,\n import: overrides.import ?? base.import,\n edit: overrides.edit ?? base.edit,\n delete: overrides.delete ?? base.delete,\n exportCsv: overrides.exportCsv ?? base.exportCsv,\n };\n}\n\n// =================================================================\n// Object Ownership Model\n// =================================================================\n\n/**\n * How a package relates to an object it references.\n * \n * - `own`: This package is the original author/owner of the object.\n * Only one package may own a given object name. The owner defines\n * the base schema (table name, primary key, core fields).\n * \n * - `extend`: This package adds fields, views, or actions to an\n * existing object owned by another package. Multiple packages\n * may extend the same object. Extensions are merged at boot time.\n * \n * Follows Salesforce/ServiceNow patterns:\n * object name = database table name, globally unique, no namespace prefix.\n */\nexport const ObjectOwnershipEnum = z.enum(['own', 'extend']);\nexport type ObjectOwnership = z.infer<typeof ObjectOwnershipEnum>;\n\n/**\n * Object Extension Entry — used in `objectExtensions` array.\n * Declares fields/config to merge into an existing object owned by another package.\n * \n * @example\n * ```ts\n * objectExtensions: [{\n * extend: 'contact', // target object FQN\n * fields: { sales_stage: Field.select([...]) },\n * }]\n * ```\n */\nexport const ObjectExtensionSchema = lazySchema(() => z.object({\n /** The target object name (FQN) to extend */\n extend: z.string().describe('Target object name (FQN) to extend'),\n \n /** Fields to merge into the target object (additive) */\n fields: z.record(z.string(), FieldSchema).optional().describe('Fields to add/override'),\n \n /** Override label */\n label: z.string().optional().describe('Override label for the extended object'),\n \n /** Override plural label */\n pluralLabel: z.string().optional().describe('Override plural label for the extended object'),\n \n /** Override description */\n description: z.string().optional().describe('Override description for the extended object'),\n \n /** Additional validation rules to add */\n validations: z.array(ValidationRuleSchema).optional().describe('Additional validation rules to merge into the target object'),\n \n /** Additional indexes to add */\n indexes: z.array(IndexSchema).optional().describe('Additional indexes to merge into the target object'),\n \n /** Merge priority. Higher number applied later (wins on conflict). Default: 200 */\n priority: z.number().int().min(0).max(999).default(200).describe('Merge priority (higher = applied later)'),\n}));\n\nexport type ObjectExtension = z.infer<typeof ObjectExtensionSchema>;\n/** Authoring input for {@link ObjectExtension} — defaulted fields are optional. */\nexport type ObjectExtensionInput = z.input<typeof ObjectExtensionSchema>;\n\n/**\n * Type-safe factory for an extension to an object owned by another package. Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: ObjectExtension` literal.\n */\nexport function defineObjectExtension(config: z.input<typeof ObjectExtensionSchema>): ObjectExtension {\n return ObjectExtensionSchema.parse(config);\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * Auto-number format renderer — shared by the ObjectQL engine (in-memory\n * fallback) and the SQL driver (persistent atomic sequence) so both paths\n * render identical record numbers from one `autonumberFormat` string (#1603).\n *\n * A format is literal text interleaved with `{...}` tokens:\n *\n * - Sequence token `{0000}` — one or more `0`s. The running counter,\n * zero-padded to that width. At most one per format; a format with none\n * appends the bare counter (legacy behaviour).\n * - Date tokens `{YYYY} {YY} {MM} {DD} {YYYYMMDD}` — the generation date in\n * the request's business timezone (ADR-0053), falling back to UTC.\n * - Field tokens `{field_name}` — the value of another field on the SAME\n * record (e.g. `{island_zone}`, `{plan_no}`), interpolated as a string.\n * - Everything else is literal text.\n *\n * The counter is scoped to whatever the tokens BEFORE the sequence render to\n * (the \"scope\"): `AD{YYYYMMDD}{0000}` counts per day, `{island_zone}{000}`\n * counts per island, `{plan_no}{000}` counts per parent record. A fresh scope\n * value starts a fresh count — so period reset (yearly/monthly/daily) and\n * per-group numbering both fall out of one mechanism with no extra config.\n *\n * Backward compatibility: a format with NO date/field tokens (e.g.\n * `CASE-{0000}`) has an empty scope, so existing fixed-prefix sequences keep\n * their single global counter and their behaviour is unchanged.\n */\n\nexport type AutonumberToken =\n | { kind: 'literal'; text: string }\n | { kind: 'date'; pattern: 'YYYY' | 'YY' | 'MM' | 'DD' | 'YYYYMMDD' }\n | { kind: 'field'; field: string }\n | { kind: 'seq'; width: number };\n\nconst DATE_PATTERNS = new Set(['YYYY', 'YY', 'MM', 'DD', 'YYYYMMDD']);\n\n/**\n * Parse an `autonumberFormat` into an ordered token list. An unrecognized\n * `{...}` group is kept verbatim as literal text, so a stray brace or a typo\n * never throws — it just renders literally.\n */\nexport function parseAutonumberFormat(format: string): AutonumberToken[] {\n const tokens: AutonumberToken[] = [];\n if (!format) return tokens;\n const re = /\\{([^{}]*)\\}/g;\n let last = 0;\n let m: RegExpExecArray | null;\n let seenSeq = false;\n while ((m = re.exec(format)) !== null) {\n if (m.index > last) tokens.push({ kind: 'literal', text: format.slice(last, m.index) });\n const body = m[1];\n if (/^0+$/.test(body) && !seenSeq) {\n // First `{0..0}` is the sequence slot. A second one is ambiguous, so\n // treat it as literal rather than silently producing two counters.\n tokens.push({ kind: 'seq', width: body.length });\n seenSeq = true;\n } else if (DATE_PATTERNS.has(body)) {\n tokens.push({ kind: 'date', pattern: body as 'YYYY' | 'YY' | 'MM' | 'DD' | 'YYYYMMDD' });\n } else if (/^[A-Za-z_][A-Za-z0-9_]*$/.test(body)) {\n tokens.push({ kind: 'field', field: body });\n } else {\n tokens.push({ kind: 'literal', text: m[0] });\n }\n last = re.lastIndex;\n }\n if (last < format.length) tokens.push({ kind: 'literal', text: format.slice(last) });\n return tokens;\n}\n\n/** True when the format interpolates anything date- or record-dependent. */\nexport function hasDynamicTokens(tokens: AutonumberToken[]): boolean {\n return tokens.some((t) => t.kind === 'date' || t.kind === 'field');\n}\n\n/** The sequence token's pad width, or `fallback` (default 4) when none. */\nexport function sequenceWidth(tokens: AutonumberToken[], fallback = 4): number {\n const seq = tokens.find((t) => t.kind === 'seq');\n return seq && seq.kind === 'seq' ? seq.width : fallback;\n}\n\n/** Field names referenced by `{field}` tokens (for read-back / validation). */\nexport function referencedFields(tokens: AutonumberToken[]): string[] {\n return tokens.filter((t): t is Extract<AutonumberToken, { kind: 'field' }> => t.kind === 'field').map((t) => t.field);\n}\n\n/**\n * `{field}` tokens whose value is missing on the record (null / undefined /\n * empty string). Such a field would silently render to an empty prefix and\n * collapse the counter into the wrong scope (a different group's sequence), so\n * callers should refuse to generate rather than emit a wrong record number.\n * Returns the referenced field names in format order, deduplicated.\n */\nexport function missingFieldValues(\n tokens: AutonumberToken[],\n record?: Record<string, unknown>,\n): string[] {\n const missing: string[] = [];\n for (const field of referencedFields(tokens)) {\n const v = record ? record[field] : undefined;\n if ((v == null || v === '') && !missing.includes(field)) missing.push(field);\n }\n return missing;\n}\n\ninterface CalendarParts {\n YYYY: string;\n YY: string;\n MM: string;\n DD: string;\n}\n\n/** Resolve the calendar Y/M/D of `now` in `timezone` (IANA), UTC on failure. */\nfunction calendarParts(now: Date, timezone?: string): CalendarParts {\n let y: string;\n let mo: string;\n let d: string;\n try {\n const fmt = new Intl.DateTimeFormat('en-CA', {\n timeZone: timezone || 'UTC',\n year: 'numeric',\n month: '2-digit',\n day: '2-digit',\n });\n const parts = fmt.formatToParts(now);\n y = parts.find((p) => p.type === 'year')?.value ?? '0000';\n mo = parts.find((p) => p.type === 'month')?.value ?? '01';\n d = parts.find((p) => p.type === 'day')?.value ?? '01';\n } catch {\n y = String(now.getUTCFullYear()).padStart(4, '0');\n mo = String(now.getUTCMonth() + 1).padStart(2, '0');\n d = String(now.getUTCDate()).padStart(2, '0');\n }\n return { YYYY: y, YY: y.slice(-2), MM: mo, DD: d };\n}\n\nfunction renderDate(pattern: string, p: CalendarParts): string {\n switch (pattern) {\n case 'YYYY': return p.YYYY;\n case 'YY': return p.YY;\n case 'MM': return p.MM;\n case 'DD': return p.DD;\n case 'YYYYMMDD': return `${p.YYYY}${p.MM}${p.DD}`;\n default: return '';\n }\n}\n\nexport interface RenderAutonumberInput {\n /** Parsed tokens (from {@link parseAutonumberFormat}). */\n tokens: AutonumberToken[];\n /** The reserved counter value. */\n seq: number;\n /** The record being written — source for `{field}` interpolation. */\n record?: Record<string, unknown>;\n /** Generation instant. Callers pass an explicit `Date` (no implicit clock). */\n now: Date;\n /** Business timezone for date tokens (ADR-0053); falls back to UTC. */\n timezone?: string;\n}\n\nexport interface RenderedAutonumber {\n /** Rendered text before the sequence slot. */\n prefix: string;\n /** Rendered text after the sequence slot. */\n suffix: string;\n /**\n * Counter scope: the rendered prefix when the format has date/field tokens,\n * else '' (legacy fixed-prefix formats keep one global counter under a\n * stable empty scope). Drives per-period / per-group numbering and reset.\n */\n scope: string;\n /** Final value: prefix + zero-padded(seq) + suffix. */\n value: string;\n}\n\n/**\n * Render a record number for a reserved counter value. Pure: identical inputs\n * yield identical output, which is what lets the engine and the SQL driver\n * agree on the same string.\n */\nexport function renderAutonumber(input: RenderAutonumberInput): RenderedAutonumber {\n const { tokens, seq, record, now, timezone } = input;\n const dp = calendarParts(now, timezone);\n let prefix = '';\n let suffix = '';\n let width: number | null = null;\n for (const t of tokens) {\n if (t.kind === 'seq') {\n width = t.width;\n continue;\n }\n let piece = '';\n if (t.kind === 'literal') piece = t.text;\n else if (t.kind === 'date') piece = renderDate(t.pattern, dp);\n else if (t.kind === 'field') {\n const v = record ? record[t.field] : undefined;\n piece = v == null ? '' : String(v);\n }\n if (width === null) prefix += piece;\n else suffix += piece;\n }\n const dynamic = hasDynamicTokens(tokens);\n // The scope IS the rendered prefix. Two records whose tokens render to the\n // same prefix string (e.g. `{a}{b}` for ('AB','C') and ('A','BC')) also render\n // the same VISIBLE number, so they must share one counter to stay unique —\n // splitting them by token boundary would mint duplicate record numbers. The\n // remedy for genuinely-distinct groups is an unambiguous format (a delimiter\n // literal between variable tokens); the compile lint nudges authors there.\n const scope = dynamic ? prefix : '';\n const value = width === null\n // No `{0..0}` slot — append the bare counter (legacy behaviour).\n ? `${prefix}${seq}`\n : `${prefix}${String(seq).padStart(width, '0')}${suffix}`;\n return { prefix, suffix, scope, value };\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { ExpressionInputSchema } from '../shared/expression.zod';\n\n/**\n * Hook Lifecycle Events\n * Defines the interception points in the ObjectQL execution pipeline.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nimport { HookBodySchema } from './hook-body.zod';\nexport const HookEvent = z.enum([\n // Read Operations\n 'beforeFind', 'afterFind',\n 'beforeFindOne', 'afterFindOne',\n 'beforeCount', 'afterCount',\n 'beforeAggregate', 'afterAggregate',\n\n // Write Operations\n 'beforeInsert', 'afterInsert',\n 'beforeUpdate', 'afterUpdate',\n 'beforeDelete', 'afterDelete',\n \n // Bulk Operations (Query-based)\n 'beforeUpdateMany', 'afterUpdateMany',\n 'beforeDeleteMany', 'afterDeleteMany',\n]);\n\n/**\n * Hook Definition Schema\n * \n * Hooks serve as the \"Logic Layer\" in ObjectStack, allowing developers to \n * inject custom code during the data access lifecycle.\n * \n * Use cases:\n * - Data Enrichment (Default values, Calculated fields)\n * - Validation (Complex business rules)\n * - Side Effects (Sending emails, Syncing to external systems)\n * - Security (Filtering data based on context)\n */\nexport const HookSchema = lazySchema(() => z.object({\n /**\n * Unique identifier for the hook\n * Required for debugging and overriding.\n */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Hook unique name (snake_case)'),\n\n /**\n * Human readable label\n */\n label: z.string().optional().describe('Description of what this hook does'),\n\n /**\n * Target Object(s)\n * can be:\n * - Single object: \"account\"\n * - List of objects: [\"account\", \"contact\"]\n * - Wildcard: \"*\" (All objects)\n */\n object: z.union([z.string(), z.array(z.string())]).describe('Target object(s)'),\n\n /**\n * Events to subscribe to\n * Combinations of timing (before/after) and action (find/insert/update/delete/etc)\n */\n events: z.array(HookEvent).describe('Lifecycle events'),\n\n /**\n * Handler Logic\n *\n * Two accepted shapes:\n *\n * - **Inline function** (authoring): `handler: async (ctx) => { ... }`.\n * Convenient in `defineStack({ hooks: [...] })` source files.\n * - **String reference** (build artifact / Studio): `handler: 'my_fn'`.\n * Resolved at runtime against the bundle's `functions` map +\n * anything `engine.registerFunction(name, fn)` added.\n *\n * `objectstack build` automatically lowers inline functions to the\n * string form (using `Hook.name` as the ref) and emits the originals\n * into a sibling `objectstack-runtime.<hash>.mjs` referenced by the\n * top-level `runtimeModule` field. The JSON artifact therefore only\n * ever contains the string form.\n */\n handler: z.union([z.string(), z.custom<(...args: any[]) => any>((v) => typeof v === 'function', { message: 'Expected function' })]).optional().describe('Handler function name (string, post-build) or inline function (pre-build) — DEPRECATED, prefer `body`'),\n\n /**\n * Hook Body (L1 expression or L2 sandboxed JS).\n *\n * Preferred over `handler` for new code. When both are present, runtime\n * loader uses `body` and ignores `handler`.\n *\n * - `{ language: 'expression', source: '...' }` — pure formula (L1).\n * - `{ language: 'js', source: '...', capabilities: [...] }` — sandboxed JS (L2).\n *\n * Authoring convenience: `objectstack build` extracts inline TS handlers from\n * `*.hook.ts` files, AST-checks them, and emits the result here. See plan §6.\n */\n body: HookBodySchema.optional().describe('Hook body — expression (L1) or sandboxed JS (L2)'),\n\n /**\n * Execution Order\n * Lower numbers run first.\n * - System Hooks: 0-99\n * - App Hooks: 100-999\n * - User Hooks: 1000+\n */\n priority: z.number().default(100).describe('Execution priority'),\n\n /**\n * Async / Background Execution\n * If true, the hook runs in the background and does not block the transaction.\n * Only applicable for 'after*' events.\n * Default: false (Blocking)\n */\n async: z.boolean().default(false).describe('Run specifically as fire-and-forget'),\n\n /**\n * Declarative Condition\n * Formula expression evaluated before the handler runs.\n * If provided and evaluates to FALSE, the hook is skipped entirely.\n * Useful for filtering by record data without writing handler code.\n * \n * @example \"status = 'active' AND amount > 1000\"\n */\n condition: ExpressionInputSchema.optional().describe('Predicate (CEL); hook runs only when TRUE. e.g. P`record.status == \"closed\" && record.amount > 1000`'),\n\n /**\n * Human-readable description\n */\n description: z.string().optional().describe('Human-readable description of what this hook does'),\n\n /**\n * Retry Policy\n */\n retryPolicy: z.object({\n maxRetries: z.number().default(3).describe('Maximum retry attempts on failure'),\n backoffMs: z.number().default(1000).describe('Backoff delay between retries in milliseconds'),\n }).optional().describe('Retry policy for failed hook executions'),\n\n /**\n * Execution Timeout\n */\n timeout: z.number().optional().describe('Maximum execution time in milliseconds before the hook is aborted'),\n\n /**\n * Error Policy\n * What to do if the hook throws an exception?\n * - abort: Rollback transaction (if blocking)\n * - log: Log error and continue\n */\n onError: z.enum(['abort', 'log']).default('abort').describe('Error handling strategy'),\n}));\n\n/**\n * Hook Runtime Context\n * Defines what is available to the hook handler during execution.\n * \n * Best Practices:\n * - **Immutability**: `object`, `event`, `id` are immutable.\n * - **Mutability**: `input` and `result` are mutable to allow transformation.\n * - **Encapsulation**: `session` isolates auth info; `transaction` ensures atomicity.\n */\nexport const HookContextSchema = lazySchema(() => z.object({\n /** Tracing ID */\n id: z.string().optional().describe('Unique execution ID for tracing'),\n\n /** Target Object Name */\n object: z.string(),\n \n /** Current Lifecycle Event */\n event: HookEvent,\n\n /** \n * Input Parameters (Mutable)\n * Modify this to change the behavior of the operation.\n * \n * - find: { query: QueryAST, options: DriverOptions }\n * - insert: { doc: Record, options: DriverOptions }\n * - update: { id: ID, doc: Record, options: DriverOptions }\n * - delete: { id: ID, options: DriverOptions }\n * - updateMany: { query: QueryAST, doc: Record, options: DriverOptions }\n * - deleteMany: { query: QueryAST, options: DriverOptions }\n */\n input: z.record(z.string(), z.unknown()).describe('Mutable input parameters'),\n\n /** \n * Operation Result (Mutable)\n * Available in 'after*' events. Modify this to transform the output.\n */\n result: z.unknown().optional().describe('Operation result (After hooks only)'),\n\n /**\n * Data Snapshot\n * The state of the record BEFORE the operation (for update/delete).\n */\n previous: z.record(z.string(), z.unknown()).optional().describe('Record state before operation'),\n\n /**\n * Execution Session\n * Contains authentication and tenancy information.\n */\n session: z.object({\n userId: z.string().optional(),\n tenantId: z.string().optional(),\n roles: z.array(z.string()).optional(),\n accessToken: z.string().optional(),\n isSystem: z.boolean().optional().describe('True when the call was made with an elevated system context (engine self-writes)'),\n skipTriggers: z.boolean().optional().describe('True when record-change automation (flow triggers) must be suppressed for this write — e.g. package seed replay. Lifecycle hooks still run.'),\n }).optional().describe('Current session context'),\n \n /**\n * Transaction Handle\n * If the operation is part of a transaction, use this handle for side-effects.\n */\n transaction: z.unknown().optional().describe('Database transaction handle'),\n\n /**\n * Engine Access\n * Reference to the ObjectQL engine for performing side effects.\n */\n ql: z.unknown().describe('ObjectQL Engine Reference'),\n\n /**\n * Cross-Object API\n * Provides a scoped data access interface for performing CRUD operations\n * on other objects within hooks. Bound to the current execution context\n * (userId, tenantId, transaction).\n *\n * Usage in hooks:\n * const users = ctx.api.object('user');\n * const admin = await users.findOne({ filter: { role: 'admin' } });\n */\n api: z.unknown().optional().describe('Cross-object data access (ScopedContext)'),\n\n /**\n * Current User Info\n * Convenience shortcut for session.userId + additional user metadata.\n * Populated by the engine when available.\n */\n user: z.object({\n id: z.string().optional(),\n name: z.string().optional(),\n email: z.string().optional(),\n }).optional().describe('Current user info shortcut'),\n}));\n\nexport type Hook = z.input<typeof HookSchema>;\nexport type ResolvedHook = z.output<typeof HookSchema>;\nexport type HookEventType = z.infer<typeof HookEvent>;\nexport type HookContext = z.infer<typeof HookContextSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { SnakeCaseIdentifierSchema } from '../shared/identifiers.zod';\nimport { QuerySchema } from './query.zod';\n\n/**\n * Transformation Logic\n * Built-in helpers for converting data during import.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const TransformType = z.enum([\n 'none', // Direct copy\n 'constant', // Use a hardcoded value\n 'lookup', // Resolve FK (Name -> ID)\n 'split', // \"John Doe\" -> [\"John\", \"Doe\"]\n 'join', // [\"John\", \"Doe\"] -> \"John Doe\"\n 'javascript', // Custom script (Review security!)\n 'map' // Value mapping (e.g. \"Active\" -> \"active\")\n]);\n\n/**\n * Field Mapping Item\n */\nexport const FieldMappingSchema = lazySchema(() => z.object({\n /** Source Column */\n source: z.union([z.string(), z.array(z.string())]).describe('Source column header(s)'),\n \n /** Target Field */\n target: z.union([z.string(), z.array(z.string())]).describe('Target object field(s)'),\n \n /** Transformation */\n transform: TransformType.default('none'),\n \n /** Configuration for transform */\n params: z.object({\n // Constant\n value: z.unknown().optional(),\n \n // Lookup\n object: z.string().optional(), // Lookup Object\n fromField: z.string().optional(), // Match on (e.g. \"name\")\n toField: z.string().optional(), // Value to take (e.g. \"id\")\n autoCreate: z.boolean().optional(), // Create if missing\n \n // Map\n valueMap: z.record(z.string(), z.unknown()).optional(), // { \"Open\": \"draft\" }\n \n // Split/Join\n separator: z.string().optional()\n }).optional()\n}));\n\n/**\n * Data Mapping Schema\n * Defines a reusable data mapping configuration for ETL operations.\n * \n * **NAMING CONVENTION:**\n * Mapping names are machine identifiers and must be lowercase snake_case.\n * \n * @example Good mapping names\n * - 'salesforce_to_crm'\n * - 'csv_import_contacts'\n * - 'api_sync_orders'\n * \n * @example Bad mapping names (will be rejected)\n * - 'SalesforceToCRM' (PascalCase)\n * - 'CSV Import' (spaces)\n */\nexport const MappingSchema = lazySchema(() => z.object({\n /** Identity */\n name: SnakeCaseIdentifierSchema.describe('Mapping unique name (lowercase snake_case)'),\n label: z.string().optional(),\n \n /** Scope */\n sourceFormat: z.enum(['csv', 'json', 'xml', 'sql']).default('csv'),\n targetObject: z.string().describe('Target Object Name'),\n \n /** Column Mappings */\n fieldMapping: z.array(FieldMappingSchema),\n \n /** Upsert Logic */\n mode: z.enum(['insert', 'update', 'upsert']).default('insert'),\n upsertKey: z.array(z.string()).optional().describe('Fields to match for upsert (e.g. email)'),\n \n /** Extract Logic (For Export) */\n extractQuery: QuerySchema.optional().describe('Query to run for export only'),\n \n /** Error Handling */\n errorPolicy: z.enum(['skip', 'abort', 'retry']).default('skip'),\n batchSize: z.number().default(1000)\n}));\n\nexport type Mapping = z.infer<typeof MappingSchema>;\n/** Authoring input for {@link Mapping} — defaulted fields are optional. */\nexport type MappingInput = z.input<typeof MappingSchema>;\n\n/**\n * Type-safe factory for a data import/export mapping. Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: Mapping` literal.\n */\nexport function defineMapping(config: z.input<typeof MappingSchema>): Mapping {\n return MappingSchema.parse(config);\n}\nexport type FieldMapping = z.infer<typeof FieldMappingSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Execution Context Schema\n * \n * Defines the runtime context that flows from HTTP request → data operations.\n * This is the \"identity + environment\" envelope that every data operation can carry.\n * \n * Design:\n * - All fields are optional for backward compatibility\n * - `isSystem` bypasses permission checks (for internal/migration operations)\n * - `transaction` carries the database transaction handle for atomicity\n * - `traceId` enables distributed tracing across microservices\n * \n * Usage:\n * engine.find('account', { context: { userId: '...', tenantId: '...' } })\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const ExecutionContextSchema = lazySchema(() => z.object({\n /** Current user ID (resolved from session) */\n userId: z.string().optional(),\n\n /**\n * Stable principal label for AUDIT ATTRIBUTION when the operation is not a\n * real user — e.g. a service token (`svc:<name>`) or an automation. The audit\n * writer records this on `sys_audit_log.actor` so a non-user-authenticated\n * write (the class that left `user_id` null and made the os-790m7q env-delete\n * unattributable) is still attributable. `userId` takes precedence when set;\n * this is the fallback. The runtime/host sets it (e.g. the control plane's\n * service-mode auth) — the framework only defines + records the contract.\n */\n actor: z.string().optional(),\n\n /**\n * Current user's unique email (resolved from session, falling back to a\n * `sys_user` lookup). Exposed to RLS as `current_user.email` for seedable,\n * human-readable owner scoping. Unique by auth invariant — unlike display\n * `name`, which is intentionally not surfaced to RLS.\n */\n email: z.string().optional(),\n \n /** Current organization/tenant ID (resolved from session.activeOrganizationId) */\n tenantId: z.string().optional(),\n\n /**\n * Active reference timezone (IANA name, e.g. `America/New_York`), resolved\n * once per request from the `localization` settings (platform default →\n * global → tenant; ADR-0053 Phase 2). When unset, consumers treat it as\n * `UTC` — today's behavior.\n */\n timezone: z.string().optional(),\n\n /**\n * Active locale (BCP-47, e.g. `en-US`), resolved from the `localization`\n * settings alongside `timezone`. Drives message catalogs and number/date\n * formatting. When unset, consumers treat it as `en-US`.\n */\n locale: z.string().optional(),\n\n /**\n * Active default currency (ISO 4217, e.g. `USD`, `CNY`), resolved from the\n * `localization` settings alongside `timezone`/`locale`. The tenant-level\n * fallback applied when a currency field/measure omits its own (the\n * `localization.currency` manifest contract). Undefined when no tenant\n * default is configured — consumers then render a plain number.\n */\n currency: z.string().optional(),\n\n /** User role names (resolved from Member + Role) */\n roles: z.array(z.string()).default([]),\n \n /** Aggregated permission names (resolved from PermissionSet) */\n permissions: z.array(z.string()).default([]),\n\n /**\n * Aggregated system permissions (union of `PermissionSet.systemPermissions`\n * across the user's resolved permission sets). Used to gate app\n * entry (`AppSchema.requiredPermissions`) and system-level capabilities\n * like `manage_users`, `studio.access`, `setup.access`.\n */\n systemPermissions: z.array(z.string()).optional(),\n\n /**\n * Aggregated tab/app visibility overrides (merged most-permissive across\n * the user's resolved permission sets: visible > default_on > default_off > hidden).\n * Keyed by app name. A `hidden` value forces an app off the user's\n * authorized list even if `requiredPermissions` would otherwise pass.\n */\n tabPermissions: z.record(z.string(), z.enum(['visible', 'hidden', 'default_on', 'default_off'])).optional(),\n\n /**\n * IDs of all users in the active organization. Pre-resolved so RLS\n * expressions can scope visibility of identity tables (`sys_user`)\n * via `IN (current_user.org_user_ids)` without needing subquery\n * support in the RLS compiler. Populated by the runtime's\n * resolveExecutionContext from `sys_member`.\n */\n org_user_ids: z.array(z.string()).optional(),\n\n /**\n * Pre-resolved dynamic-membership arrays for RLS (§7.3.1). The runtime\n * resolves set-membership that would otherwise need a subquery — team\n * members under a manager, accounts in a sales rep's territories,\n * records shared with the user — and stages each set here under a\n * stable key. RLS policies then reference a key via\n * `field IN (current_user.<key>)`, which the compiler resolves against\n * this bag without any subquery support.\n *\n * `org_user_ids` is the one well-known, always-populated membership set\n * and stays a named field for back-compat; everything else lives here.\n * Keys are arbitrary `current_user.*` names; values are id arrays. A\n * missing or empty array makes the referencing policy drop out and\n * (if it was the only policy) fail closed — never fail open.\n *\n * @example { team_member_ids: ['u2', 'u3'], territory_account_ids: ['a7'] }\n */\n rlsMembership: z.record(z.string(), z.array(z.string())).optional(),\n\n /** Whether this is a system-level operation (bypasses permission checks) */\n isSystem: z.boolean().default(false),\n\n /**\n * Suppress record-change AUTOMATION (autolaunched flow triggers:\n * record-after-insert / -update / -delete) for writes made under this\n * context. Lifecycle HOOKS still run (derived/default fields, validation).\n *\n * Set by bulk/reference loads — notably package metadata SEED replay — where\n * the records are pre-existing END-STATE data, not user events: firing\n * \"on create/update\" automation (notifications, escalations, assignments,\n * approvals) for seed rows is semantically wrong AND dangerous. The\n * 2026-07-06 incident was a seeded critical case whose escalation flow\n * self-triggered into an infinite loop that wedged the whole kernel build.\n */\n skipTriggers: z.boolean().optional(),\n\n /** Raw access token (for external API call pass-through) */\n accessToken: z.string().optional(),\n \n /** Database transaction handle */\n transaction: z.unknown().optional(),\n \n /** Request trace ID (for distributed tracing) */\n traceId: z.string().optional(),\n}));\n\nexport type ExecutionContext = z.infer<typeof ExecutionContextSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FilterConditionSchema } from './filter.zod';\nimport { SortNodeSchema, QuerySchema, FullTextSearchSchema, FieldNodeSchema, AggregationNodeSchema } from './query.zod';\nimport { ExecutionContextSchema } from '../kernel/execution-context.zod';\n\n/**\n * Data Engine Protocol\n * \n * Defines the standard interface for data persistence engines in ObjectStack.\n * This protocol abstracts the underlying storage mechanism (SQL, NoSQL, API, Memory),\n * allowing the ObjectQL engine to execute standardized CRUD and Aggregation operations\n * regardless of where the data resides.\n * \n * The Data Engine acts as the \"Driver\" layer in the Hexagonal Architecture.\n */\n\n// ==========================================================================\n// 1. Shared Definitions\n// ==========================================================================\n\n/**\n * Data Engine Query filter conditions\n * Supports simple key-value map or complex Logic/Field expressions (DSL)\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const DataEngineFilterSchema = lazySchema(() => z.union([\n z.record(z.string(), z.unknown()),\n FilterConditionSchema\n]).describe('Data Engine query filter conditions'));\n\n/**\n * Sort order definition\n * Supports:\n * - { name: 'asc' }\n * - { name: 1 }\n * - [{ field: 'name', order: 'asc' }]\n */\nexport const DataEngineSortSchema = lazySchema(() => z.union([\n z.record(z.string(), z.enum(['asc', 'desc'])), \n z.record(z.string(), z.union([z.literal(1), z.literal(-1)])),\n z.array(SortNodeSchema)\n]).describe('Sort order definition'));\n\n// ==========================================================================\n// 1b. Base Engine Options (shared context)\n// ==========================================================================\n\n/**\n * Base Engine Options\n * \n * All Data Engine operation options extend this schema to carry\n * an optional ExecutionContext for identity, tenant, and transaction propagation.\n */\nexport const BaseEngineOptionsSchema = lazySchema(() => z.object({\n /** Execution context (identity, tenant, transaction) */\n context: ExecutionContextSchema.optional(),\n}));\n\n// ==========================================================================\n// 2. method: FIND (QueryAST-aligned)\n// ==========================================================================\n\n/**\n * Engine Query Options — QueryAST-aligned parameters for IDataEngine.find/findOne.\n * \n * Uses standard QueryAST field names (where/fields/orderBy/limit/offset/expand)\n * so that no mechanical translation is needed between the Engine and Driver layers.\n * \n * @example\n * ```ts\n * engine.find('account', {\n * where: { status: 'active' },\n * fields: ['id', 'name', 'email'],\n * orderBy: [{ field: 'name', order: 'asc' }],\n * limit: 10,\n * offset: 20,\n * expand: { owner: { object: 'user', fields: ['name'] } },\n * });\n * ```\n */\nexport const EngineQueryOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions (WHERE) — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n\n /** Fields to retrieve (SELECT) — standard QueryAST `fields` */\n fields: z.array(FieldNodeSchema).optional(),\n\n /** Sorting instructions (ORDER BY) — standard QueryAST `orderBy` */\n orderBy: z.array(SortNodeSchema).optional(),\n\n /** Max records to return (LIMIT) */\n limit: z.number().optional(),\n\n /** Records to skip (OFFSET) — standard QueryAST `offset` */\n offset: z.number().optional(),\n\n /** Alias for limit (OData compatibility) */\n top: z.number().optional(),\n\n /** Cursor for keyset pagination */\n cursor: z.record(z.string(), z.unknown()).optional(),\n\n /** Full-text search configuration */\n search: FullTextSearchSchema.optional(),\n\n /**\n * Recursive relation loading map (expand).\n * \n * Keys are lookup/master_detail field names; values are nested QueryAST\n * objects that control select, filter, sort, and further expansion on\n * the related object. The engine resolves expand via batch $in queries\n * (driver-agnostic) with a default max depth of 3.\n */\n expand: z.lazy(() => z.record(z.string(), QuerySchema)).optional(),\n\n /** SELECT DISTINCT flag */\n distinct: z.boolean().optional(),\n}).describe('QueryAST-aligned query options for IDataEngine.find() operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineQueryOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineQueryOptionsSchema` instead.\n * This schema uses legacy parameter names (filter/select/sort/skip/populate)\n * that require mechanical translation to QueryAST. Migrate to the\n * QueryAST-aligned `EngineQueryOptionsSchema` (where/fields/orderBy/offset/expand).\n */\nexport const DataEngineQueryOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineQueryOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n /** @deprecated Use `fields` (EngineQueryOptionsSchema) */\n select: z.array(z.string()).optional(),\n /** @deprecated Use `orderBy` (EngineQueryOptionsSchema) */\n sort: DataEngineSortSchema.optional(),\n limit: z.number().int().min(1).optional(),\n /** @deprecated Use `offset` (EngineQueryOptionsSchema) */\n skip: z.number().int().min(0).optional(),\n top: z.number().int().min(1).optional(),\n /** @deprecated Use `expand` (EngineQueryOptionsSchema) */\n populate: z.array(z.string()).optional(),\n}).describe('Query options for IDataEngine.find() operations'));\n\n// ==========================================================================\n// 3. method: INSERT\n// ==========================================================================\n\nexport const DataEngineInsertOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** \n * Return the inserted record(s)? \n * Some drivers support RETURNING clause for efficiency.\n * Default: true\n */\n returning: z.boolean().default(true).optional(),\n}).describe('Options for DataEngine.insert operations'));\n\n// ==========================================================================\n// 4. method: UPDATE (QueryAST-aligned)\n// ==========================================================================\n\nexport const EngineUpdateOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions to identify records to update — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n /** Perform an upsert? If true, insert if not found. */\n upsert: z.boolean().default(false).optional(),\n /** Update multiple records? If false, only the first match is updated. Default: false */\n multi: z.boolean().default(false).optional(),\n /** Return the updated record(s)? Default: false (returns update count/status) */\n returning: z.boolean().default(false).optional(),\n}).describe('QueryAST-aligned options for DataEngine.update operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineUpdateOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineUpdateOptionsSchema` instead.\n * Migrate `filter` → `where`.\n */\nexport const DataEngineUpdateOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineUpdateOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n upsert: z.boolean().default(false).optional(),\n multi: z.boolean().default(false).optional(),\n returning: z.boolean().default(false).optional(),\n}).describe('Options for DataEngine.update operations'));\n\n// ==========================================================================\n// 5. method: DELETE (QueryAST-aligned)\n// ==========================================================================\n\nexport const EngineDeleteOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions to identify records to delete — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n /** Delete multiple records? If false, only the first match is deleted. Default: false */\n multi: z.boolean().default(false).optional(),\n}).describe('QueryAST-aligned options for DataEngine.delete operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineDeleteOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineDeleteOptionsSchema` instead.\n * Migrate `filter` → `where`.\n */\nexport const DataEngineDeleteOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineDeleteOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n multi: z.boolean().default(false).optional(),\n}).describe('Options for DataEngine.delete operations'));\n\n// ==========================================================================\n// 6. method: AGGREGATE (QueryAST-aligned)\n// ==========================================================================\n\nexport const EngineAggregateOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions (WHERE) — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n /** Group By fields */\n groupBy: z.array(z.string()).optional(),\n /**\n * Aggregation definitions — uses standard AggregationNodeSchema (`function` key).\n * e.g. [{ function: 'sum', field: 'amount', alias: 'total' }]\n */\n aggregations: z.array(AggregationNodeSchema).optional(),\n /**\n * Reference timezone (IANA name) for date bucketing (ADR-0053 Phase 2).\n * When set to a non-UTC zone, `groupBy` items carrying a `dateGranularity`\n * bucket on that zone's calendar days. Unset or `'UTC'` keeps the UTC\n * fast path (native driver `date_trunc`).\n */\n timezone: z.string().optional(),\n}).describe('QueryAST-aligned options for DataEngine.aggregate operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineAggregateOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineAggregateOptionsSchema` instead.\n * Migrate `filter` → `where`, aggregation `method` → `function`.\n */\nexport const DataEngineAggregateOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineAggregateOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n groupBy: z.array(z.string()).optional(),\n /** \n * @deprecated Use `EngineAggregateOptionsSchema` with standard AggregationNodeSchema (`function` key).\n */\n aggregations: z.array(z.object({\n field: z.string(),\n method: z.enum(['count', 'sum', 'avg', 'min', 'max', 'count_distinct']),\n alias: z.string().optional()\n })).optional(),\n}).describe('Options for DataEngine.aggregate operations'));\n\n// ==========================================================================\n// 7. method: COUNT (QueryAST-aligned)\n// ==========================================================================\n\nexport const EngineCountOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** Filter conditions — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n}).describe('QueryAST-aligned options for DataEngine.count operations'));\n\n// --------------------------------------------------------------------------\n// Legacy: DataEngineCountOptionsSchema (DEPRECATED)\n// --------------------------------------------------------------------------\n\n/**\n * @deprecated Use `EngineCountOptionsSchema` instead.\n * Migrate `filter` → `where`.\n */\nexport const DataEngineCountOptionsSchema = lazySchema(() => BaseEngineOptionsSchema.extend({\n /** @deprecated Use `where` (EngineCountOptionsSchema) */\n filter: DataEngineFilterSchema.optional(),\n}).describe('Options for DataEngine.count operations'));\n\n// ==========================================================================\n// 8. Definition (Contract)\n// ==========================================================================\n\nexport const DataEngineContractSchema = lazySchema(() => z.object({\n find: z.function()\n .input(z.tuple([z.string(), EngineQueryOptionsSchema.optional()]))\n .output(z.promise(z.array(z.unknown()))),\n \n findOne: z.function()\n .input(z.tuple([z.string(), EngineQueryOptionsSchema.optional()]))\n .output(z.promise(z.unknown())),\n \n insert: z.function()\n .input(z.tuple([z.string(), z.union([z.record(z.string(), z.unknown()), z.array(z.record(z.string(), z.unknown()))]), DataEngineInsertOptionsSchema.optional()]))\n .output(z.promise(z.unknown())),\n \n update: z.function()\n .input(z.tuple([z.string(), z.record(z.string(), z.unknown()), EngineUpdateOptionsSchema.optional()]))\n .output(z.promise(z.unknown())),\n \n delete: z.function()\n .input(z.tuple([z.string(), EngineDeleteOptionsSchema.optional()]))\n .output(z.promise(z.unknown())),\n \n count: z.function()\n .input(z.tuple([z.string(), EngineCountOptionsSchema.optional()]))\n .output(z.promise(z.number())),\n \n aggregate: z.function()\n .input(z.tuple([z.string(), EngineAggregateOptionsSchema]))\n .output(z.promise(z.array(z.unknown())))\n}).describe('Standard Data Engine Contract'));\n\n// ==========================================================================\n// 9. Virtualization & RPC Protocol\n// ==========================================================================\n\n/**\n * Data Engine RPC Request (Virtual ObjectQL)\n * \n * This schema defines the serialized format for executing Data Engine operations\n * via HTTP, Message Queue, or Plugin boundaries.\n * \n * It enables \"Virtual Data Engines\" where the implementation resides in a \n * separate microservice or plugin.\n */\n\n/**\n * RPC backward-compatibility mixin — shared `@deprecated filter` field.\n * When both `filter` and `where` are present, the protocol/engine ignores\n * `filter` in favor of `where`; only one should be provided.\n */\nconst RpcLegacyFilterMixin = {\n /** @deprecated Use `where` */\n filter: DataEngineFilterSchema.optional(),\n};\n\n/**\n * RPC query options that accept BOTH new (where/fields/orderBy) and\n * legacy (filter/select/sort/skip/populate) parameter names.\n * \n * **Precedence:** When both legacy and new keys are present for the same\n * concern, the protocol normalizer uses the new key (`where` > `filter`,\n * `fields` > `select`, `orderBy` > `sort`, `offset` > `skip`,\n * `expand` > `populate`). Callers should not mix vocabularies.\n */\nconst RpcQueryOptionsSchema = EngineQueryOptionsSchema.extend({\n ...RpcLegacyFilterMixin,\n /** @deprecated Use `fields` */\n select: z.array(z.string()).optional(),\n /** @deprecated Use `orderBy` */\n sort: DataEngineSortSchema.optional(),\n /** @deprecated Use `offset` */\n skip: z.number().int().min(0).optional(),\n /** @deprecated Use `expand` */\n populate: z.array(z.string()).optional(),\n});\n\nexport const DataEngineFindRequestSchema = lazySchema(() => z.object({\n method: z.literal('find'),\n object: z.string(),\n query: RpcQueryOptionsSchema.optional()\n}));\n\nexport const DataEngineFindOneRequestSchema = lazySchema(() => z.object({\n method: z.literal('findOne'),\n object: z.string(),\n query: RpcQueryOptionsSchema.optional()\n}));\n\nexport const DataEngineInsertRequestSchema = lazySchema(() => z.object({\n method: z.literal('insert'),\n object: z.string(),\n data: z.union([z.record(z.string(), z.unknown()), z.array(z.record(z.string(), z.unknown()))]),\n options: DataEngineInsertOptionsSchema.optional()\n}));\n\nexport const DataEngineUpdateRequestSchema = lazySchema(() => z.object({\n method: z.literal('update'),\n object: z.string(),\n data: z.record(z.string(), z.unknown()),\n id: z.union([z.string(), z.number()]).optional().describe('ID for single update, or use where in options'),\n options: EngineUpdateOptionsSchema.extend(RpcLegacyFilterMixin).optional()\n}));\n\nexport const DataEngineDeleteRequestSchema = lazySchema(() => z.object({\n method: z.literal('delete'),\n object: z.string(),\n id: z.union([z.string(), z.number()]).optional().describe('ID for single delete, or use where in options'),\n options: EngineDeleteOptionsSchema.extend(RpcLegacyFilterMixin).optional()\n}));\n\nexport const DataEngineCountRequestSchema = lazySchema(() => z.object({\n method: z.literal('count'),\n object: z.string(),\n query: EngineCountOptionsSchema.extend(RpcLegacyFilterMixin).optional()\n}));\n\nexport const DataEngineAggregateRequestSchema = lazySchema(() => z.object({\n method: z.literal('aggregate'),\n object: z.string(),\n query: EngineAggregateOptionsSchema.extend(RpcLegacyFilterMixin)\n}));\n\n/**\n * Data Engine Execute Request (Raw Command)\n * Execute a raw command/query native to the driver (e.g. SQL, Shell, Remote API).\n */\nexport const DataEngineExecuteRequestSchema = lazySchema(() => z.object({\n method: z.literal('execute'),\n /** The abstract command (string SQL, or JSON object) */\n command: z.unknown(),\n /** Optional options */\n options: z.record(z.string(), z.unknown()).optional()\n}));\n\n/**\n * Data Engine Vector Find Request (AI/RAG)\n * Perform a similarity search using vector embeddings.\n */\nexport const DataEngineVectorFindRequestSchema = lazySchema(() => z.object({\n method: z.literal('vectorFind'),\n object: z.string(),\n /** The vector embedding to search for */\n vector: z.array(z.number()),\n /** Optional pre-filter (Metadata filtering) — standard QueryAST `where` */\n where: z.union([z.record(z.string(), z.unknown()), FilterConditionSchema]).optional(),\n /** Fields to retrieve — standard QueryAST `fields` */\n fields: z.array(z.string()).optional(),\n /** Number of results */\n limit: z.number().int().default(5).optional(),\n /** Minimum similarity score (0-1) or distance threshold */\n threshold: z.number().optional()\n}));\n\n/**\n * Data Engine Batch Request\n * Execute multiple operations in a single transaction/request efficiently.\n */\nexport const DataEngineBatchRequestSchema = lazySchema(() => z.object({\n method: z.literal('batch'),\n requests: z.array(z.discriminatedUnion('method', [\n DataEngineFindRequestSchema,\n DataEngineFindOneRequestSchema,\n DataEngineInsertRequestSchema,\n DataEngineUpdateRequestSchema,\n DataEngineDeleteRequestSchema,\n DataEngineCountRequestSchema,\n DataEngineAggregateRequestSchema,\n DataEngineExecuteRequestSchema,\n DataEngineVectorFindRequestSchema\n ])),\n /** \n * Transaction Mode\n * - true: All or nothing (Atomic)\n * - false: Best effort, continue on error\n */\n transaction: z.boolean().default(true).optional()\n}));\n\n/**\n * Unified Data Engine Request Union\n * Use this to validate any incoming \"Virtual ObjectQL\" request.\n */\nexport const DataEngineRequestSchema = lazySchema(() => z.discriminatedUnion('method', [\n DataEngineFindRequestSchema,\n DataEngineFindOneRequestSchema,\n DataEngineInsertRequestSchema,\n DataEngineUpdateRequestSchema,\n DataEngineDeleteRequestSchema,\n DataEngineCountRequestSchema,\n DataEngineAggregateRequestSchema,\n DataEngineBatchRequestSchema,\n DataEngineExecuteRequestSchema,\n DataEngineVectorFindRequestSchema\n]).describe('Virtual ObjectQL Request Protocol'));\n\n// ==========================================================================\n// 10. Type Exports\n// ==========================================================================\n\n// --- New: QueryAST-aligned types (preferred) ---\nexport type EngineQueryOptions = z.infer<typeof EngineQueryOptionsSchema>;\nexport type EngineUpdateOptions = z.infer<typeof EngineUpdateOptionsSchema>;\nexport type EngineDeleteOptions = z.infer<typeof EngineDeleteOptionsSchema>;\nexport type EngineAggregateOptions = z.infer<typeof EngineAggregateOptionsSchema>;\nexport type EngineCountOptions = z.infer<typeof EngineCountOptionsSchema>;\n\n// --- Legacy: deprecated types (kept for backward compatibility) ---\nexport type DataEngineFilter = z.infer<typeof DataEngineFilterSchema>;\n/** @deprecated Use standard `SortNode[]` from QueryAST instead. */\nexport type DataEngineSort = z.infer<typeof DataEngineSortSchema>;\nexport type BaseEngineOptions = z.infer<typeof BaseEngineOptionsSchema>;\n/** @deprecated Use `EngineQueryOptions` instead. */\nexport type DataEngineQueryOptions = z.infer<typeof DataEngineQueryOptionsSchema>;\nexport type DataEngineInsertOptions = z.infer<typeof DataEngineInsertOptionsSchema>;\n/** @deprecated Use `EngineUpdateOptions` instead. */\nexport type DataEngineUpdateOptions = z.infer<typeof DataEngineUpdateOptionsSchema>;\n/** @deprecated Use `EngineDeleteOptions` instead. */\nexport type DataEngineDeleteOptions = z.infer<typeof DataEngineDeleteOptionsSchema>;\n/** @deprecated Use `EngineAggregateOptions` instead. */\nexport type DataEngineAggregateOptions = z.infer<typeof DataEngineAggregateOptionsSchema>;\n/** @deprecated Use `EngineCountOptions` instead. */\nexport type DataEngineCountOptions = z.infer<typeof DataEngineCountOptionsSchema>;\nexport type DataEngineRequest = z.infer<typeof DataEngineRequestSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n// ============================================================================\n// Shared Enumerations\n// ============================================================================\n\n/** Aggregation functions used across query, data-engine, analytics, field */\nimport { lazySchema } from './lazy-schema';\nexport const AggregationFunctionEnum = z.enum([\n 'count', 'sum', 'avg', 'min', 'max',\n 'count_distinct', 'percentile', 'median', 'stddev', 'variance',\n]).describe('Standard aggregation functions');\nexport type AggregationFunction = z.infer<typeof AggregationFunctionEnum>;\n\n/** Sort direction used across query, data-engine, analytics */\nexport const SortDirectionEnum = z.enum(['asc', 'desc'])\n .describe('Sort order direction');\nexport type SortDirection = z.infer<typeof SortDirectionEnum>;\n\n/** Reusable sort item — field + direction pair used across views, data sources, filters */\nexport const SortItemSchema = lazySchema(() => z.object({\n field: z.string().describe('Field name to sort by'),\n order: SortDirectionEnum.describe('Sort direction'),\n}).describe('Sort field and direction pair'));\nexport type SortItem = z.infer<typeof SortItemSchema>;\n\n/** CRUD mutation events used across hook, validation, object CDC */\nexport const MutationEventEnum = z.enum([\n 'insert', 'update', 'delete', 'upsert',\n]).describe('Data mutation event types');\nexport type MutationEvent = z.infer<typeof MutationEventEnum>;\n\n/** Database isolation levels — unified format */\nexport const IsolationLevelEnum = z.enum([\n 'read_uncommitted', 'read_committed', 'repeatable_read', 'serializable', 'snapshot',\n]).describe('Transaction isolation levels (snake_case standard)');\nexport type IsolationLevel = z.infer<typeof IsolationLevelEnum>;\n\n/** Cache eviction strategies */\nexport const CacheStrategyEnum = z.enum(['lru', 'lfu', 'ttl', 'fifo'])\n .describe('Cache eviction strategy');\nexport type CacheStrategy = z.infer<typeof CacheStrategyEnum>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { QuerySchema, DateGranularity } from '../data/query.zod';\nimport { IsolationLevelEnum } from '../shared/enums.zod';\n\n/**\n * Common Driver Options\n * Passed to most driver methods to control behavior (transactions, timeouts, etc.)\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const DriverOptionsSchema = lazySchema(() => z.object({\n /**\n * Transaction handle/identifier.\n * If provided, the operation must run within this transaction.\n */\n transaction: z.unknown().optional().describe('Transaction handle'),\n\n /**\n * Operation timeout in milliseconds.\n */\n timeout: z.number().optional().describe('Timeout in ms'),\n\n /**\n * Whether to bypass cache and force a fresh read.\n */\n skipCache: z.boolean().optional().describe('Bypass cache'),\n\n /**\n * Distributed Tracing Context.\n * Used for passing OpenTelemetry span context or request IDs for observability.\n */\n traceContext: z.record(z.string(), z.string()).optional().describe('OpenTelemetry context or request ID'),\n\n /**\n * Tenant Identifier.\n * For multi-tenant databases (row-level security or schema-per-tenant).\n */\n tenantId: z.string().optional().describe('Tenant Isolation identifier'),\n\n /**\n * Business reference timezone (IANA name, e.g. `Asia/Shanghai`) for the\n * request, threaded from `ExecutionContext.timezone` (ADR-0053). Drivers that\n * generate date-dependent values — notably `autonumber` date tokens\n * (`{YYYYMMDD}`) — resolve the calendar day in this zone, falling back to UTC.\n */\n timezone: z.string().optional().describe('Business reference timezone (IANA) for date-dependent generation, e.g. autonumber date tokens'),\n}));\n\n/**\n * Driver Capabilities Schema\n * \n * Defines what features a database driver supports.\n * This allows ObjectQL to adapt its behavior based on underlying database capabilities.\n * Enhanced with granular capability flags for better feature detection.\n */\nexport const DriverCapabilitiesSchema = lazySchema(() => z.object({\n // ============================================================================\n // Basic CRUD Operations\n // ============================================================================\n \n /**\n * Whether the driver supports create operations.\n */\n create: z.boolean().default(true).describe('Supports CREATE operations'),\n \n /**\n * Whether the driver supports read operations.\n */\n read: z.boolean().default(true).describe('Supports READ operations'),\n \n /**\n * Whether the driver supports update operations.\n */\n update: z.boolean().default(true).describe('Supports UPDATE operations'),\n \n /**\n * Whether the driver supports delete operations.\n */\n delete: z.boolean().default(true).describe('Supports DELETE operations'),\n\n // ============================================================================\n // Bulk Operations\n // ============================================================================\n \n /**\n * Whether the driver supports bulk create operations.\n */\n bulkCreate: z.boolean().default(false).describe('Supports bulk CREATE operations'),\n \n /**\n * Whether the driver supports bulk update operations.\n */\n bulkUpdate: z.boolean().default(false).describe('Supports bulk UPDATE operations'),\n \n /**\n * Whether the driver supports bulk delete operations.\n */\n bulkDelete: z.boolean().default(false).describe('Supports bulk DELETE operations'),\n\n // ============================================================================\n // Transaction & Connection Management\n // ============================================================================\n \n /**\n * Whether the driver supports database transactions.\n * If true, beginTransaction, commit, and rollback must be implemented.\n */\n transactions: z.boolean().default(false).describe('Supports ACID transactions'),\n \n /**\n * Whether the driver supports savepoints within transactions.\n */\n savepoints: z.boolean().default(false).describe('Supports transaction savepoints'),\n \n /**\n * Supported transaction isolation levels.\n */\n isolationLevels: z.array(IsolationLevelEnum).optional().describe('Supported isolation levels'),\n\n // ============================================================================\n // Query Operations\n // ============================================================================\n \n /**\n * Whether the driver supports WHERE clause filters.\n * If false, ObjectQL will fetch all records and filter in memory.\n * \n * Example: Memory driver might not support complex filter conditions.\n */\n queryFilters: z.boolean().default(true).describe('Supports WHERE clause filtering'),\n\n /**\n * Whether the driver supports aggregation functions (COUNT, SUM, AVG, etc.).\n * If false, ObjectQL will compute aggregations in memory.\n */\n queryAggregations: z.boolean().default(false).describe('Supports GROUP BY and aggregation functions'),\n\n /**\n * Per-granularity native SQL date bucketing support.\n *\n * Drivers that can emit `DATE_TRUNC` / `DATE_FORMAT` / `strftime` / `$dateTrunc`\n * for `groupBy` items shaped as `{ field, dateGranularity }` should advertise\n * the granularities they handle here, e.g. `{ day: true, week: false }` for a\n * SQLite build whose `strftime` lacks ISO week (`%V`).\n *\n * When omitted (or a granularity is falsy), the engine falls back to fetching\n * raw rows and bucketing in-memory (`applyInMemoryAggregation`), which is\n * always correct but loads the full row set into Node.\n *\n * **Output contract** (CRITICAL): the native SQL expression MUST produce the\n * same string label as `bucketDateValue()` in `@objectstack/objectql` —\n * `YYYY` / `YYYY-MM` / `YYYY-MM-DD` / `YYYY-Q[1-4]` / `YYYY-W[01-53]` (ISO-8601,\n * weeks start Monday). Any drift will misalign drill `groupKey` filters\n * between the two paths.\n */\n queryDateGranularity: z.record(DateGranularity, z.boolean()).optional()\n .describe('Per-granularity native date bucketing (day/week/month/quarter/year). Missing keys fall back to in-memory bucketing.'),\n\n /**\n * Whether the driver supports ORDER BY sorting.\n * If false, ObjectQL will sort results in memory.\n */\n querySorting: z.boolean().default(true).describe('Supports ORDER BY sorting'),\n\n /**\n * Whether the driver supports LIMIT/OFFSET pagination.\n * If false, ObjectQL will fetch all records and paginate in memory.\n */\n queryPagination: z.boolean().default(true).describe('Supports LIMIT/OFFSET pagination'),\n\n /**\n * Whether the driver supports window functions (ROW_NUMBER, RANK, LAG, LEAD, etc.).\n * If false, ObjectQL will compute window functions in memory.\n */\n queryWindowFunctions: z.boolean().default(false).describe('Supports window functions with OVER clause'),\n\n /**\n * Whether the driver supports subqueries (nested SELECT statements).\n * If false, ObjectQL will execute queries separately and combine results.\n */\n querySubqueries: z.boolean().default(false).describe('Supports subqueries'),\n \n /**\n * Whether the driver supports Common Table Expressions (WITH clause).\n */\n queryCTE: z.boolean().default(false).describe('Supports Common Table Expressions (WITH clause)'),\n\n /**\n * Whether the driver supports SQL-style joins.\n * If false, ObjectQL will fetch related data separately and join in memory.\n */\n joins: z.boolean().default(false).describe('Supports SQL joins'),\n\n // ============================================================================\n // Advanced Features\n // ============================================================================\n \n /**\n * Whether the driver supports full-text search.\n * If true, text search queries can be pushed to the database.\n */\n fullTextSearch: z.boolean().default(false).describe('Supports full-text search'),\n \n /**\n * Whether the driver supports JSON querying capabilities.\n */\n jsonQuery: z.boolean().default(false).describe('Supports JSON field querying'),\n \n /**\n * Whether the driver supports geospatial queries.\n */\n geospatialQuery: z.boolean().default(false).describe('Supports geospatial queries'),\n \n /**\n * Whether the driver supports streaming large result sets.\n */\n streaming: z.boolean().default(false).describe('Supports result streaming (cursors/iterators)'),\n\n /**\n * Whether the driver supports JSON field types.\n * If false, JSON data will be serialized as strings.\n */\n jsonFields: z.boolean().default(false).describe('Supports JSON field types'),\n\n /**\n * Whether the driver supports array field types.\n * If false, arrays will be stored as JSON strings or in separate tables.\n */\n arrayFields: z.boolean().default(false).describe('Supports array field types'),\n\n /**\n * Whether the driver supports vector embeddings and similarity search.\n * Required for RAG (Retrieval-Augmented Generation) and AI features.\n */\n vectorSearch: z.boolean().default(false).describe('Supports vector embeddings and similarity search'),\n\n /**\n * Whether the driver natively generates persistent autonumber / sequence\n * values inside `create()` / `bulkCreate()` / `upsert()` (e.g. a DB-backed\n * `_objectstack_sequences` table that survives restarts and is atomic across\n * concurrent writers / instances).\n *\n * When true, the ObjectQL engine MUST NOT pre-fill `autonumber` fields with\n * its own in-memory counter — the driver owns generation as the single,\n * persistent source of truth, and required-validation exempts the field\n * because the value is assigned after validation. When false/absent (memory,\n * mongodb), the engine falls back to its in-memory generator.\n *\n * Optional so existing driver capability objects need not be updated.\n */\n autonumber: z.boolean().optional().describe('Driver natively generates persistent autonumber/sequence values'),\n\n // ============================================================================\n // Schema Management\n // ============================================================================\n \n /**\n * Whether the driver supports automatic schema synchronization.\n */\n schemaSync: z.boolean().default(false).describe('Supports automatic schema synchronization'),\n\n /**\n * Whether the driver supports batching multiple schema sync operations\n * into a single (or fewer) round-trips for the DDL phase. When true,\n * the engine may call `syncSchemasBatch()` instead of calling\n * `syncSchema()` per object, reducing network round-trips for remote drivers.\n */\n batchSchemaSync: z.boolean().default(false).describe('Supports batched schema sync to reduce schema DDL round-trips'),\n \n /**\n * Whether the driver supports database migrations.\n */\n migrations: z.boolean().default(false).describe('Supports database migrations'),\n \n /**\n * Whether the driver supports index management.\n */\n indexes: z.boolean().default(false).describe('Supports index creation and management'),\n\n // ============================================================================\n // Performance & Optimization\n // ============================================================================\n \n /**\n * Whether the driver supports connection pooling.\n */\n connectionPooling: z.boolean().default(false).describe('Supports connection pooling'),\n \n /**\n * Whether the driver supports prepared statements.\n */\n preparedStatements: z.boolean().default(false).describe('Supports prepared statements (SQL injection prevention)'),\n \n /**\n * Whether the driver supports query result caching.\n */\n queryCache: z.boolean().default(false).describe('Supports query result caching'),\n}));\n\n/**\n * Unified Database Driver Interface\n * \n * This is the contract that all storage adapters (Postgres, Mongo, Excel, Salesforce) must implement.\n * It abstracts the underlying engine, enabling ObjectStack to be \"Database Agnostic\".\n */\nexport const DriverInterfaceSchema = lazySchema(() => z.object({\n /**\n * Driver name (e.g., 'postgresql', 'mongodb', 'rest_api').\n */\n name: z.string().describe('Driver unique name'),\n\n /**\n * Driver version.\n */\n version: z.string().describe('Driver version'),\n\n /**\n * Capabilities descriptor.\n */\n supports: DriverCapabilitiesSchema,\n\n // ============================================================================\n // Lifecycle Management\n // ============================================================================\n\n /**\n * Initialize connection pool or authenticate.\n */\n connect: z.function()\n .input(z.tuple([]))\n .output(z.promise(z.void()))\n .describe('Establish connection'),\n\n /**\n * Close connections and cleanup resources.\n */\n disconnect: z.function()\n .input(z.tuple([]))\n .output(z.promise(z.void()))\n .describe('Close connection'),\n\n /**\n * Check connection health.\n * @returns true if healthy, false otherwise.\n */\n checkHealth: z.function()\n .input(z.tuple([]))\n .output(z.promise(z.boolean()))\n .describe('Health check'),\n \n /**\n * Get Connection Pool Statistics.\n * Useful for monitoring database load.\n */\n getPoolStats: z.function()\n .input(z.tuple([]))\n .output(z.object({\n total: z.number(),\n idle: z.number(),\n active: z.number(),\n waiting: z.number(),\n }).optional())\n .optional()\n .describe('Get connection pool statistics'),\n\n // ============================================================================\n // Raw Execution (Escape Hatch)\n // ============================================================================\n\n /**\n * Execute a raw command/query native to the driver.\n * Useful for complex reports, stored procedures, or DDL not covered by standard sync.\n * \n * @param command - The raw command (e.g., SQL string, shell command, or remote API payload).\n * @param parameters - Optional array of bound parameters for safe execution (prevention of injection).\n * @param options - Driver options (transaction context, timeout).\n * @returns Promise resolving to the raw result from the driver.\n * \n * @example\n * // SQL Driver\n * await driver.execute('SELECT * FROM complex_view WHERE id = ?', [123]);\n * \n * // Mongo Driver\n * await driver.execute({ aggregate: 'orders', pipeline: [...] });\n */\n execute: z.function()\n .input(z.tuple([z.unknown(), z.array(z.unknown()).optional(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.unknown()))\n .describe('Execute raw command'),\n\n // ============================================================================\n // CRUD Operations\n // ============================================================================\n\n /**\n * Find multiple records matching the structured query.\n * Parsing the QueryAST is the responsibility of the driver implementation.\n * \n * @param object - The name of the object/table to query (e.g. 'account').\n * @param query - The structured QueryAST (filters, sorts, joins, pagination).\n * @param options - Driver options.\n * @returns Array of records.\n * \n * @example\n * await driver.find('account', {\n * filters: [['status', '=', 'active'], 'and', ['amount', '>', 500]],\n * sort: [{ field: 'created_at', order: 'desc' }],\n * top: 10\n * });\n * @returns Array of records.\n * MUST return `id` as string. MUST NOT return implementation details like `_id`.\n */\n find: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.promise(z.array(z.record(z.string(), z.unknown()))))\n .describe('Find records'),\n\n /**\n * Stream records matching the structured query.\n * Optimized for large datasets to avoid memory overflow.\n * \n * @param object - The name of the object.\n * @param query - The structured QueryAST.\n * @param options - Driver options.\n * @returns AsyncIterable/ReadableStream of records.\n */\n findStream: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.unknown())\n .describe('Stream records (AsyncIterable)'),\n\n /**\n * Find a single record by query.\n * Similar to find(), but returns only the first match or null.\n * \n * @param object - The name of the object.\n * @param query - QueryAST.\n * @param options - Driver options.\n * @returns The record or null.\n * MUST return `id` as string. MUST NOT return implementation details like `_id`.\n */\n findOne: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.promise(z.record(z.string(), z.unknown()).nullable()))\n .describe('Find one record'),\n\n /**\n * Create a new record.\n * \n * @param object - The object name.\n * @param data - Key-value map of field data.\n * @param options - Driver options.\n * @returns The created record, including server-generated fields (id, created_at, etc.).\n * MUST return `id` as string. MUST NOT return implementation details like `_id`.\n */\n create: z.function()\n .input(z.tuple([z.string(), z.record(z.string(), z.unknown()), DriverOptionsSchema.optional()]))\n .output(z.promise(z.record(z.string(), z.unknown())))\n .describe('Create record'),\n\n /**\n * Update an existing record by ID.\n * \n * @param object - The object name.\n * @param id - The unique identifier of the record.\n * @param data - The fields to update.\n * @param options - Driver options.\n * @returns The updated record.\n * MUST return `id` as string. MUST NOT return implementation details like `_id`.\n */\n update: z.function()\n .input(z.tuple([z.string(), z.string().or(z.number()), z.record(z.string(), z.unknown()), DriverOptionsSchema.optional()]))\n .output(z.promise(z.record(z.string(), z.unknown())))\n .describe('Update record'),\n\n /**\n * Upsert (Update or Insert) a record.\n * \n * @param object - The object name.\n * @param data - The data to upsert.\n * @param conflictKeys - Fields to check for conflict (uniqueness).\n * @param options - Driver options.\n * @returns The created or updated record.\n */\n upsert: z.function()\n .input(z.tuple([z.string(), z.record(z.string(), z.unknown()), z.array(z.string()).optional(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.record(z.string(), z.unknown())))\n .describe('Upsert record'),\n\n /**\n * Delete a record by ID.\n * \n * @param object - The object name.\n * @param id - The unique identifier of the record.\n * @param options - Driver options.\n * @returns True if deleted, false if not found.\n */\n delete: z.function()\n .input(z.tuple([z.string(), z.string().or(z.number()), DriverOptionsSchema.optional()]))\n .output(z.promise(z.boolean()))\n .describe('Delete record'),\n\n /**\n * Count records matching a query.\n * \n * @param object - The object name.\n * @param query - Optional filtering criteria.\n * @param options - Driver options.\n * @returns Total count.\n */\n count: z.function()\n .input(z.tuple([z.string(), QuerySchema.optional(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.number()))\n .describe('Count records'),\n\n // ============================================================================\n // Bulk Operations\n // ============================================================================\n\n /**\n * Create multiple records in a single batch.\n * Optimized for performance.\n * \n * @param object - The object name.\n * @param dataArray - Array of record data.\n * @returns Array of created records.\n */\n bulkCreate: z.function()\n .input(z.tuple([z.string(), z.array(z.record(z.string(), z.unknown())), DriverOptionsSchema.optional()]))\n .output(z.promise(z.array(z.record(z.string(), z.unknown())))),\n\n /**\n * Update multiple records in a single batch.\n * \n * @param object - The object name.\n * @param updates - Array of objects containing {id, data}.\n * @returns Array of updated records.\n */\n bulkUpdate: z.function()\n .input(z.tuple([z.string(), z.array(z.object({ id: z.string().or(z.number()), data: z.record(z.string(), z.unknown()) })), DriverOptionsSchema.optional()]))\n .output(z.promise(z.array(z.record(z.string(), z.unknown())))),\n\n /**\n * Delete multiple records in a single batch.\n * \n * @param object - The object name.\n * @param ids - Array of record IDs.\n */\n bulkDelete: z.function()\n .input(z.tuple([z.string(), z.array(z.string().or(z.number())), DriverOptionsSchema.optional()]))\n .output(z.promise(z.void())),\n\n /**\n * Update multiple records matching a query.\n * Direct database push-down. DOES NOT trigger per-record hooks.\n * \n * @param object - The object name.\n * @param query - The filtering criteria.\n * @param data - The data to update.\n * @returns Count of modified records.\n */\n updateMany: z.function()\n .input(z.tuple([z.string(), QuerySchema, z.record(z.string(), z.unknown()), DriverOptionsSchema.optional()]))\n .output(z.promise(z.number()))\n .optional(),\n\n /**\n * Delete multiple records matching a query.\n * Direct database push-down. DOES NOT trigger per-record hooks.\n * \n * @param object - The object name.\n * @param query - The filtering criteria.\n * @returns Count of deleted records.\n */\n deleteMany: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.promise(z.number()))\n .optional(),\n\n // ============================================================================\n // Transaction Management\n // ============================================================================\n\n /**\n * Begin a new database transaction.\n * @param options - Isolation level and other settings.\n * @returns A transaction handle to be passed to subsequent operations via `options.transaction`.\n */\n beginTransaction: z.function()\n .input(z.tuple([z.object({\n isolationLevel: IsolationLevelEnum.optional()\n }).optional()]))\n .output(z.promise(z.unknown()))\n .describe('Start transaction'),\n\n /**\n * Commit the transaction.\n * @param transaction - The transaction handle.\n */\n commit: z.function()\n .input(z.tuple([z.unknown()]))\n .output(z.promise(z.void()))\n .describe('Commit transaction'),\n\n /**\n * Rollback the transaction.\n * @param transaction - The transaction handle.\n */\n rollback: z.function()\n .input(z.tuple([z.unknown()]))\n .output(z.promise(z.void()))\n .describe('Rollback transaction'),\n\n // ============================================================================\n // Schema Management\n // ============================================================================\n\n /**\n * Synchronize the database schema with the Object definition.\n * This is an idempotent operation: it should create tables if missing, \n * add columns if missing, and update indexes.\n * \n * @param object - The object name.\n * @param schema - The full Object Schema (fields, indexes, etc).\n * @param options - Driver options.\n */\n syncSchema: z.function()\n .input(z.tuple([z.string(), z.unknown(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.void()))\n .describe('Sync object schema to DB'),\n\n /**\n * Batch-synchronize multiple object schemas with fewer round-trips.\n *\n * Drivers that advertise `supports.batchSchemaSync = true` MUST implement\n * this method. The engine will call it once with every\n * `{ object, schema }` pair instead of calling `syncSchema()` N times.\n *\n * @param schemas - Array of `{ object: string; schema: unknown }` pairs.\n * @param options - Driver options.\n */\n syncSchemasBatch: z.function()\n .input(z.tuple([\n z.array(z.object({ object: z.string(), schema: z.unknown() })),\n DriverOptionsSchema.optional(),\n ]))\n .output(z.promise(z.void()))\n .optional()\n .describe('Batch sync multiple schemas in one round-trip'),\n \n /**\n * Drop the underlying table or collection for an object.\n * WARNING: Destructive operation.\n * \n * @param object - The object name.\n */\n dropTable: z.function()\n .input(z.tuple([z.string(), DriverOptionsSchema.optional()]))\n .output(z.promise(z.void())),\n\n /**\n * Analyze query performance.\n * Returns execution plan without executing the query (where possible).\n * \n * @param object - The object name.\n * @param query - The query to explain.\n * @returns The execution plan details.\n */\n explain: z.function()\n .input(z.tuple([z.string(), QuerySchema, DriverOptionsSchema.optional()]))\n .output(z.promise(z.unknown()))\n .optional(),\n}));\n\n/**\n * Connection Pool Configuration Schema\n * Manages database connection pooling for performance\n */\nexport const PoolConfigSchema = lazySchema(() => z.object({\n min: z.number().min(0).default(2).describe('Minimum number of connections in pool'),\n max: z.number().min(1).default(10).describe('Maximum number of connections in pool'),\n idleTimeoutMillis: z.number().min(0).default(30000).describe('Time in ms before idle connection is closed'),\n connectionTimeoutMillis: z.number().min(0).default(5000).describe('Time in ms to wait for available connection'),\n}));\n\n/**\n * Driver Configuration Schema\n * Base configuration for database drivers\n */\nexport const DriverConfigSchema = lazySchema(() => z.object({\n name: z.string().describe('Driver instance name'),\n type: z.enum(['sql', 'nosql', 'cache', 'search', 'graph', 'timeseries']).describe('Driver type category'),\n capabilities: DriverCapabilitiesSchema.describe('Driver capability flags'),\n connectionString: z.string().optional().describe('Database connection string (driver-specific format)'),\n poolConfig: PoolConfigSchema.optional().describe('Connection pool configuration'),\n}));\n\n/**\n * TypeScript types\n */\nexport type DriverOptions = z.infer<typeof DriverOptionsSchema>;\nexport type DriverCapabilities = z.infer<typeof DriverCapabilitiesSchema>;\nexport type DriverInterface = z.infer<typeof DriverInterfaceSchema>;\nexport type DriverConfig = z.infer<typeof DriverConfigSchema>;\nexport type PoolConfig = z.infer<typeof PoolConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { DriverConfigSchema } from './driver.zod';\n\n/**\n * SQL Dialect Enumeration\n * Supported SQL database dialects\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SQLDialectSchema = lazySchema(() => z.enum([\n 'postgresql',\n 'mysql',\n 'sqlite',\n 'mssql',\n 'oracle',\n 'mariadb',\n]));\n\nexport type SQLDialect = z.infer<typeof SQLDialectSchema>;\n\n/**\n * Data Type Mapping Schema\n * Maps ObjectStack field types to SQL-specific data types\n * \n * @example PostgreSQL data type mapping\n * {\n * text: 'VARCHAR(255)',\n * number: 'NUMERIC',\n * boolean: 'BOOLEAN',\n * date: 'DATE',\n * datetime: 'TIMESTAMP',\n * json: 'JSONB',\n * uuid: 'UUID',\n * binary: 'BYTEA'\n * }\n */\nexport const DataTypeMappingSchema = lazySchema(() => z.object({\n text: z.string().describe('SQL type for text fields (e.g., VARCHAR, TEXT)'),\n number: z.string().describe('SQL type for number fields (e.g., NUMERIC, DECIMAL, INT)'),\n boolean: z.string().describe('SQL type for boolean fields (e.g., BOOLEAN, BIT)'),\n date: z.string().describe('SQL type for date fields (e.g., DATE)'),\n datetime: z.string().describe('SQL type for datetime fields (e.g., TIMESTAMP, DATETIME)'),\n json: z.string().optional().describe('SQL type for JSON fields (e.g., JSON, JSONB)'),\n uuid: z.string().optional().describe('SQL type for UUID fields (e.g., UUID, CHAR(36))'),\n binary: z.string().optional().describe('SQL type for binary fields (e.g., BLOB, BYTEA)'),\n}));\n\nexport type DataTypeMapping = z.infer<typeof DataTypeMappingSchema>;\n\n/**\n * SSL Configuration Schema\n * SSL/TLS connection configuration for secure database connections\n * \n * @example PostgreSQL SSL configuration\n * {\n * rejectUnauthorized: true,\n * ca: '/path/to/ca-cert.pem',\n * cert: '/path/to/client-cert.pem',\n * key: '/path/to/client-key.pem'\n * }\n */\nexport const SSLConfigSchema = lazySchema(() => z.object({\n rejectUnauthorized: z.boolean().default(true).describe('Reject connections with invalid certificates'),\n ca: z.string().optional().describe('CA certificate file path or content'),\n cert: z.string().optional().describe('Client certificate file path or content'),\n key: z.string().optional().describe('Client private key file path or content'),\n}).refine((data) => {\n // If cert is provided, key must also be provided, and vice versa\n const hasCert = data.cert !== undefined;\n const hasKey = data.key !== undefined;\n return hasCert === hasKey;\n}, {\n message: 'Client certificate (cert) and private key (key) must be provided together',\n}));\n\nexport type SSLConfig = z.infer<typeof SSLConfigSchema>;\n\n/**\n * SQL Driver Configuration Schema\n * Extended driver configuration specific to SQL databases\n * \n * @example PostgreSQL driver configuration\n * {\n * name: 'primary-db',\n * type: 'sql',\n * dialect: 'postgresql',\n * connectionString: 'postgresql://user:pass@localhost:5432/mydb',\n * dataTypeMapping: {\n * text: 'VARCHAR(255)',\n * number: 'NUMERIC',\n * boolean: 'BOOLEAN',\n * date: 'DATE',\n * datetime: 'TIMESTAMP',\n * json: 'JSONB',\n * uuid: 'UUID',\n * binary: 'BYTEA'\n * },\n * ssl: true,\n * sslConfig: {\n * rejectUnauthorized: true,\n * ca: '/etc/ssl/certs/ca.pem'\n * },\n * poolConfig: {\n * min: 2,\n * max: 10,\n * idleTimeoutMillis: 30000,\n * connectionTimeoutMillis: 5000\n * },\n * capabilities: {\n * create: true,\n * read: true,\n * update: true,\n * delete: true,\n * bulkCreate: true,\n * bulkUpdate: true,\n * bulkDelete: true,\n * transactions: true,\n * savepoints: true,\n * isolationLevels: ['read-committed', 'repeatable-read', 'serializable'],\n * queryFilters: true,\n * queryAggregations: true,\n * querySorting: true,\n * queryPagination: true,\n * queryWindowFunctions: true,\n * querySubqueries: true,\n * queryCTE: true,\n * joins: true,\n * fullTextSearch: true,\n * jsonQuery: true,\n * geospatialQuery: false,\n * streaming: true,\n * jsonFields: true,\n * arrayFields: true,\n * vectorSearch: true,\n * schemaSync: true,\n * migrations: true,\n * indexes: true,\n * connectionPooling: true,\n * preparedStatements: true,\n * queryCache: false\n * }\n * }\n */\nexport const SQLDriverConfigSchema = lazySchema(() => DriverConfigSchema.extend({\n type: z.literal('sql').describe('Driver type must be \"sql\"'),\n dialect: SQLDialectSchema.describe('SQL database dialect'),\n dataTypeMapping: DataTypeMappingSchema.describe('SQL data type mapping configuration'),\n ssl: z.boolean().default(false).describe('Enable SSL/TLS connection'),\n sslConfig: SSLConfigSchema.optional().describe('SSL/TLS configuration (required when ssl is true)'),\n}).refine((data) => {\n // If ssl is enabled, sslConfig must be provided\n if (data.ssl && !data.sslConfig) {\n return false;\n }\n return true;\n}, {\n message: 'sslConfig is required when ssl is true',\n}));\n\nexport type SQLDriverConfig = z.infer<typeof SQLDriverConfigSchema>;\n\n// ==========================================================================\n// SQLite-Specific Constants\n// ==========================================================================\n\n/**\n * Default data type mappings for SQLite/libSQL dialect.\n *\n * SQLite uses a simplified type system with type affinity:\n * - TEXT: strings, dates, UUIDs\n * - REAL: floating-point numbers\n * - INTEGER: integers, booleans\n * - BLOB: binary data\n *\n * @see https://www.sqlite.org/datatype3.html\n */\nexport const SQLiteDataTypeMappingDefaults: DataTypeMapping = {\n text: 'TEXT',\n number: 'REAL',\n boolean: 'INTEGER',\n date: 'TEXT',\n datetime: 'TEXT',\n json: 'TEXT',\n uuid: 'TEXT',\n binary: 'BLOB',\n};\n\n/**\n * SQLite ALTER TABLE Limitations.\n *\n * SQLite has limited ALTER TABLE support compared to other SQL databases.\n * This constant documents the known limitations that affect migration planning.\n * The schema diff service must use the \"table rebuild\" strategy for operations\n * that SQLite cannot perform natively.\n *\n * @see https://www.sqlite.org/lang_altertable.html\n */\nexport const SQLiteAlterTableLimitations = {\n /** SQLite supports ADD COLUMN */\n supportsAddColumn: true,\n /** SQLite supports RENAME COLUMN (3.25.0+) */\n supportsRenameColumn: true,\n /** SQLite supports DROP COLUMN (3.35.0+) */\n supportsDropColumn: true,\n /** SQLite does NOT support MODIFY/ALTER COLUMN type */\n supportsModifyColumn: false,\n /** SQLite does NOT support adding constraints to existing columns */\n supportsAddConstraint: false,\n /**\n * When an unsupported alteration is needed, the migration planner\n * must use the 12-step table rebuild strategy:\n * 1. CREATE new table with desired schema\n * 2. Copy data from old table\n * 3. DROP old table\n * 4. RENAME new table to old name\n */\n rebuildStrategy: 'create_copy_drop_rename',\n} as const;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { DriverConfigSchema } from './driver.zod';\n\n/**\n * NoSQL Database Type Enumeration\n * Supported NoSQL database types\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const NoSQLDatabaseTypeSchema = lazySchema(() => z.enum([\n 'mongodb',\n 'couchdb',\n 'dynamodb',\n 'cassandra',\n 'redis',\n 'elasticsearch',\n 'neo4j',\n 'orientdb',\n]));\n\nexport type NoSQLDatabaseType = z.infer<typeof NoSQLDatabaseTypeSchema>;\n\n/**\n * NoSQL Query Operation Types\n * Different types of operations supported by NoSQL databases\n */\nexport const NoSQLOperationTypeSchema = lazySchema(() => z.enum([\n 'find', // Query documents/records\n 'findOne', // Get single document\n 'insert', // Insert document\n 'update', // Update document\n 'delete', // Delete document\n 'aggregate', // Aggregation pipeline\n 'mapReduce', // MapReduce operation\n 'count', // Count documents\n 'distinct', // Get distinct values\n 'createIndex', // Create index\n 'dropIndex', // Drop index\n]));\n\nexport type NoSQLOperationType = z.infer<typeof NoSQLOperationTypeSchema>;\n\n/**\n * NoSQL Consistency Level\n * Consistency guarantees for distributed NoSQL databases\n * \n * Consistency levels (from strongest to weakest):\n * - **all**: All replicas must respond (strongest consistency, lowest availability)\n * - **quorum**: Majority of replicas must respond (balanced)\n * - **one**: Any single replica responds (weakest consistency, highest availability)\n * - **local_quorum**: Majority of replicas in local datacenter\n * - **each_quorum**: Quorum of replicas in each datacenter\n * - **eventual**: Eventual consistency (highest availability, weakest consistency)\n */\nexport const ConsistencyLevelSchema = lazySchema(() => z.enum([\n 'all',\n 'quorum',\n 'one',\n 'local_quorum',\n 'each_quorum',\n 'eventual',\n]));\n\nexport type ConsistencyLevel = z.infer<typeof ConsistencyLevelSchema>;\n\n/**\n * NoSQL Index Type\n * Types of indexes supported by NoSQL databases\n */\nexport const NoSQLIndexTypeSchema = lazySchema(() => z.enum([\n 'single', // Single field index\n 'compound', // Multiple fields index\n 'unique', // Unique constraint\n 'text', // Full-text search index\n 'geospatial', // Geospatial index (2d, 2dsphere)\n 'hashed', // Hashed index for sharding\n 'ttl', // Time-to-live index (auto-deletion)\n 'sparse', // Sparse index (only indexed documents with field)\n]));\n\nexport type NoSQLIndexType = z.infer<typeof NoSQLIndexTypeSchema>;\n\n/**\n * NoSQL Sharding Configuration\n * Configuration for horizontal partitioning across multiple nodes\n */\nexport const ShardingConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable sharding'),\n shardKey: z.string().optional().describe('Field to use as shard key'),\n shardingStrategy: z.enum(['hash', 'range', 'zone']).optional().describe('Sharding strategy'),\n numShards: z.number().int().positive().optional().describe('Number of shards'),\n}));\n\nexport type ShardingConfig = z.infer<typeof ShardingConfigSchema>;\n\n/**\n * NoSQL Replication Configuration\n * Configuration for data replication across nodes\n */\nexport const ReplicationConfigSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable replication'),\n replicaSetName: z.string().optional().describe('Replica set name'),\n replicas: z.number().int().positive().optional().describe('Number of replicas'),\n readPreference: z.enum(['primary', 'primaryPreferred', 'secondary', 'secondaryPreferred', 'nearest'])\n .optional()\n .describe('Read preference for replica set'),\n writeConcern: z.enum(['majority', 'acknowledged', 'unacknowledged'])\n .optional()\n .describe('Write concern level'),\n}));\n\nexport type ReplicationConfig = z.infer<typeof ReplicationConfigSchema>;\n\n/**\n * Document Schema Validation\n * Schema validation rules for document-based NoSQL databases\n */\nexport const DocumentSchemaValidationSchema = lazySchema(() => z.object({\n enabled: z.boolean().default(false).describe('Enable schema validation'),\n validationLevel: z.enum(['strict', 'moderate', 'off']).optional().describe('Validation strictness'),\n validationAction: z.enum(['error', 'warn']).optional().describe('Action on validation failure'),\n jsonSchema: z.record(z.string(), z.unknown()).optional().describe('JSON Schema for validation'),\n}));\n\nexport type DocumentSchemaValidation = z.infer<typeof DocumentSchemaValidationSchema>;\n\n/**\n * NoSQL Data Type Mapping Schema\n * Maps ObjectStack field types to NoSQL-specific data types\n * \n * @example MongoDB data type mapping\n * {\n * text: 'string',\n * number: 'double',\n * boolean: 'bool',\n * date: 'date',\n * datetime: 'date',\n * json: 'object',\n * uuid: 'string',\n * binary: 'binData',\n * array: 'array',\n * objectId: 'objectId'\n * }\n */\nexport const NoSQLDataTypeMappingSchema = lazySchema(() => z.object({\n text: z.string().describe('NoSQL type for text fields'),\n number: z.string().describe('NoSQL type for number fields'),\n boolean: z.string().describe('NoSQL type for boolean fields'),\n date: z.string().describe('NoSQL type for date fields'),\n datetime: z.string().describe('NoSQL type for datetime fields'),\n json: z.string().optional().describe('NoSQL type for JSON/object fields'),\n uuid: z.string().optional().describe('NoSQL type for UUID fields'),\n binary: z.string().optional().describe('NoSQL type for binary fields'),\n array: z.string().optional().describe('NoSQL type for array fields'),\n objectId: z.string().optional().describe('NoSQL type for ObjectID fields (MongoDB)'),\n geopoint: z.string().optional().describe('NoSQL type for geospatial point fields'),\n}));\n\nexport type NoSQLDataTypeMapping = z.infer<typeof NoSQLDataTypeMappingSchema>;\n\n/**\n * NoSQL Driver Configuration Schema\n * Extended driver configuration specific to NoSQL databases\n * \n * @example MongoDB driver configuration\n * {\n * name: 'primary-mongo',\n * type: 'nosql',\n * databaseType: 'mongodb',\n * connectionString: 'mongodb://user:pass@localhost:27017/mydb',\n * dataTypeMapping: {\n * text: 'string',\n * number: 'double',\n * boolean: 'bool',\n * date: 'date',\n * datetime: 'date',\n * json: 'object',\n * uuid: 'string',\n * binary: 'binData',\n * array: 'array',\n * objectId: 'objectId'\n * },\n * consistency: 'quorum',\n * replication: {\n * enabled: true,\n * replicaSetName: 'rs0',\n * replicas: 3,\n * readPreference: 'primaryPreferred',\n * writeConcern: 'majority'\n * },\n * sharding: {\n * enabled: true,\n * shardKey: '_id',\n * shardingStrategy: 'hash',\n * numShards: 4\n * },\n * capabilities: {\n * create: true,\n * read: true,\n * update: true,\n * delete: true,\n * bulkCreate: true,\n * bulkUpdate: true,\n * bulkDelete: true,\n * transactions: true,\n * savepoints: false,\n * queryFilters: true,\n * queryAggregations: true,\n * querySorting: true,\n * queryPagination: true,\n * queryWindowFunctions: false,\n * querySubqueries: false,\n * queryCTE: false,\n * joins: false,\n * fullTextSearch: true,\n * jsonQuery: true,\n * geospatialQuery: true,\n * streaming: true,\n * jsonFields: true,\n * arrayFields: true,\n * vectorSearch: false,\n * schemaSync: true,\n * migrations: false,\n * indexes: true,\n * connectionPooling: true,\n * preparedStatements: false,\n * queryCache: false\n * }\n * }\n * \n * @example DynamoDB driver configuration\n * {\n * name: 'dynamodb-main',\n * type: 'nosql',\n * databaseType: 'dynamodb',\n * region: 'us-east-1',\n * accessKeyId: 'AKIAIOSFODNN7EXAMPLE',\n * secretAccessKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY',\n * consistency: 'eventual',\n * capabilities: {\n * create: true,\n * read: true,\n * update: true,\n * delete: true,\n * bulkCreate: true,\n * bulkUpdate: false,\n * bulkDelete: false,\n * transactions: true,\n * queryFilters: true,\n * queryAggregations: false,\n * querySorting: true,\n * queryPagination: true,\n * fullTextSearch: false,\n * jsonQuery: true,\n * indexes: true\n * }\n * }\n */\nexport const NoSQLDriverConfigSchema = lazySchema(() => DriverConfigSchema.extend({\n type: z.literal('nosql').describe('Driver type must be \"nosql\"'),\n databaseType: NoSQLDatabaseTypeSchema.describe('Specific NoSQL database type'),\n dataTypeMapping: NoSQLDataTypeMappingSchema.describe('NoSQL data type mapping configuration'),\n \n /**\n * Consistency level for reads/writes\n */\n consistency: ConsistencyLevelSchema.optional().describe('Consistency level for operations'),\n \n /**\n * Replication configuration\n */\n replication: ReplicationConfigSchema.optional().describe('Replication configuration'),\n \n /**\n * Sharding configuration\n */\n sharding: ShardingConfigSchema.optional().describe('Sharding configuration'),\n \n /**\n * Schema validation rules (for document databases)\n */\n schemaValidation: DocumentSchemaValidationSchema.optional().describe('Document schema validation'),\n \n /**\n * AWS Region (for DynamoDB, DocumentDB, etc.)\n */\n region: z.string().optional().describe('AWS region (for managed NoSQL services)'),\n \n /**\n * AWS Access Key ID (for DynamoDB, DocumentDB, etc.)\n */\n accessKeyId: z.string().optional().describe('AWS access key ID'),\n \n /**\n * AWS Secret Access Key (for DynamoDB, DocumentDB, etc.)\n */\n secretAccessKey: z.string().optional().describe('AWS secret access key'),\n \n /**\n * Time-to-live (TTL) field name\n * Automatically delete documents after a specified time\n */\n ttlField: z.string().optional().describe('Field name for TTL (auto-deletion)'),\n \n /**\n * Maximum document size in bytes\n */\n maxDocumentSize: z.number().int().positive().optional().describe('Maximum document size in bytes'),\n \n /**\n * Collection/Table name prefix\n * Useful for multi-tenancy or environment isolation\n */\n collectionPrefix: z.string().optional().describe('Prefix for collection/table names'),\n}));\n\nexport type NoSQLDriverConfig = z.infer<typeof NoSQLDriverConfigSchema>;\n\n/**\n * NoSQL Query Options\n * Additional options for NoSQL queries\n */\nexport const NoSQLQueryOptionsSchema = lazySchema(() => z.object({\n /**\n * Consistency level for this query\n */\n consistency: ConsistencyLevelSchema.optional().describe('Consistency level override'),\n \n /**\n * Read from secondary replicas\n */\n readFromSecondary: z.boolean().optional().describe('Allow reading from secondary replicas'),\n \n /**\n * Projection (fields to include/exclude)\n */\n projection: z.record(z.string(), z.union([z.literal(0), z.literal(1)])).optional().describe('Field projection'),\n \n /**\n * Query timeout in milliseconds\n */\n timeout: z.number().int().positive().optional().describe('Query timeout (ms)'),\n \n /**\n * Use cursor for large result sets\n */\n useCursor: z.boolean().optional().describe('Use cursor instead of loading all results'),\n \n /**\n * Batch size for cursor iteration\n */\n batchSize: z.number().int().positive().optional().describe('Cursor batch size'),\n \n /**\n * Enable query profiling\n */\n profile: z.boolean().optional().describe('Enable query profiling'),\n \n /**\n * Use hinted index\n */\n hint: z.string().optional().describe('Index hint for query optimization'),\n}));\n\nexport type NoSQLQueryOptions = z.infer<typeof NoSQLQueryOptionsSchema>;\n\n/**\n * NoSQL Aggregation Pipeline Stage\n * Represents a single stage in an aggregation pipeline (MongoDB-style)\n */\nexport const AggregationStageSchema = lazySchema(() => z.object({\n /**\n * Stage operator (e.g., $match, $group, $sort, $project)\n */\n operator: z.string().describe('Aggregation operator (e.g., $match, $group, $sort)'),\n \n /**\n * Stage parameters/options\n */\n options: z.record(z.string(), z.unknown()).describe('Stage-specific options'),\n}));\n\nexport type AggregationStage = z.infer<typeof AggregationStageSchema>;\n\n/**\n * NoSQL Aggregation Pipeline\n * Sequence of aggregation stages for complex data transformations\n */\nexport const AggregationPipelineSchema = lazySchema(() => z.object({\n /**\n * Collection/Table to aggregate\n */\n collection: z.string().describe('Collection/table name'),\n \n /**\n * Pipeline stages\n */\n stages: z.array(AggregationStageSchema).describe('Aggregation pipeline stages'),\n \n /**\n * Additional options\n */\n options: NoSQLQueryOptionsSchema.optional().describe('Query options'),\n}));\n\nexport type AggregationPipeline = z.infer<typeof AggregationPipelineSchema>;\n\n/**\n * NoSQL Index Definition\n * Definition for creating indexes in NoSQL databases\n */\nexport const NoSQLIndexSchema = lazySchema(() => z.object({\n /**\n * Index name\n */\n name: z.string().describe('Index name'),\n \n /**\n * Index type\n */\n type: NoSQLIndexTypeSchema.describe('Index type'),\n \n /**\n * Fields to index\n * For compound indexes, order matters\n */\n fields: z.array(z.object({\n field: z.string().describe('Field name'),\n order: z.enum(['asc', 'desc', 'text', '2dsphere']).optional().describe('Index order or type'),\n })).describe('Fields to index'),\n \n /**\n * Unique constraint\n */\n unique: z.boolean().default(false).describe('Enforce uniqueness'),\n \n /**\n * Sparse index (only index documents with the field)\n */\n sparse: z.boolean().default(false).describe('Sparse index'),\n \n /**\n * TTL in seconds (for TTL indexes)\n */\n expireAfterSeconds: z.number().int().positive().optional().describe('TTL in seconds'),\n \n /**\n * Partial index filter\n */\n partialFilterExpression: z.record(z.string(), z.unknown()).optional().describe('Partial index filter'),\n \n /**\n * Background index creation\n */\n background: z.boolean().default(false).describe('Create index in background'),\n}));\n\nexport type NoSQLIndex = z.infer<typeof NoSQLIndexSchema>;\n\n/**\n * NoSQL Transaction Options\n * Options for NoSQL transactions (where supported)\n */\nexport const NoSQLTransactionOptionsSchema = lazySchema(() => z.object({\n /**\n * Read concern level\n */\n readConcern: z.enum(['local', 'majority', 'linearizable', 'snapshot']).optional().describe('Read concern level'),\n \n /**\n * Write concern level\n */\n writeConcern: z.enum(['majority', 'acknowledged', 'unacknowledged']).optional().describe('Write concern level'),\n \n /**\n * Read preference\n */\n readPreference: z.enum(['primary', 'primaryPreferred', 'secondary', 'secondaryPreferred', 'nearest'])\n .optional()\n .describe('Read preference'),\n \n /**\n * Transaction timeout in milliseconds\n */\n maxCommitTimeMS: z.number().int().positive().optional().describe('Transaction commit timeout (ms)'),\n}));\n\nexport type NoSQLTransactionOptions = z.infer<typeof NoSQLTransactionOptionsSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Seed Import Strategy\n * Defines how the engine handles existing records when a seed is applied.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SeedMode = z.enum([\n 'insert', // Try to insert, fail on duplicate\n 'update', // Only update found records, ignore new\n 'upsert', // Create new or Update existing (Standard)\n 'replace', // Delete ALL records in object then insert (Dangerous - use for cache tables)\n 'ignore' // Try to insert, silently skip duplicates\n]);\n\n/**\n * Seed Schema (Seed Data / Fixtures)\n *\n * Standardized format for transporting initialization data. Used for:\n * 1. System Bootstrapping (Admin accounts, Standard Roles)\n * 2. Reference Data (Countries, Currencies)\n * 3. Demo / sample data (incl. AI-authored, applied on publish)\n *\n * This is the shape of the runtime-draftable `seed` metadata type: an author\n * (or the AI metadata assistant) stages a `seed` draft against this schema and\n * its rows load when the draft is published. Named `Seed` (not `Dataset`) so\n * the `dataset` name stays reserved for the ADR-0021 analytics semantic layer.\n */\nexport const SeedSchema = lazySchema(() => z.object({\n /**\n * Target Object\n * The machine name of the object to populate.\n */\n object: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Target Object Name'),\n\n /**\n * Idempotency Key (The \"Upsert\" Key)\n * The field used to check if a record already exists.\n * Best Practice: Use a natural key like 'code', 'slug', 'username' or 'external_id'.\n * Standard: 'id' is rarely used for portable seed data — prefer natural keys.\n */\n externalId: z.string().default('name').describe('Field match for uniqueness check'),\n\n /**\n * Import Strategy\n */\n mode: SeedMode.default('upsert').describe('Conflict resolution strategy'),\n\n /**\n * Environment Scope\n * - 'all': Always load\n * - 'dev': Only for development/demo\n * - 'test': Only for CI/CD tests\n */\n env: z.array(z.enum(['prod', 'dev', 'test'])).default(['prod', 'dev', 'test']).describe('Applicable environments'),\n\n /**\n * The Payload\n * Array of raw JSON objects matching the Object Schema.\n */\n records: z.array(z.record(z.string(), z.unknown())).describe('Data records'),\n}));\n\n/** Parsed/output type — all defaults are applied (env, mode, externalId always present) */\nexport type Seed = z.infer<typeof SeedSchema>;\n\n/** Input type — fields with defaults (env, mode, externalId) are optional */\nexport type SeedInput = z.input<typeof SeedSchema>;\n\nexport type SeedImportMode = z.infer<typeof SeedMode>;\n\n/**\n * Per-field value type for a seed record.\n *\n * Reference fields (`lookup` / `master_detail`) are resolved during seeding by\n * matching the value against the target record's externalId — so the value MUST\n * be the plain natural-key string (e.g. `account: 'Acme Corp'`), or `null`.\n * Passing a wrapper object like `account: { externalId: 'Acme Corp' }` does NOT\n * resolve: the loader skips non-string reference values, the raw object reaches\n * the SQL driver, and on update it crashes with \"SQLite3 can only bind numbers,\n * strings, bigints, buffers, and null\" (silently masked on an always-empty\n * `:memory:` DB, fatal-looking on a persistent one). Constrain those fields to\n * `string | null` at compile time; every other field stays `unknown`.\n */\ntype SeedFieldValue<TFieldDef> =\n TFieldDef extends { type: 'lookup' | 'master_detail' } ? string | null : unknown;\n\n/** Shape of a single seed record, derived from the object's field definitions. */\ntype SeedRecord<TFields> = {\n [K in keyof TFields]?: SeedFieldValue<TFields[K]>;\n};\n\n/**\n * Type-safe factory for creating seed definitions.\n * Infers valid field keys from the object definition passed in,\n * so typos in record field names are caught at compile time. Reference\n * fields (lookup/master_detail) are additionally constrained to the\n * natural-key string the loader resolves — see {@link SeedFieldValue}.\n *\n * @example\n * ```ts\n * export const leadSeed = defineSeed(Lead, {\n * externalId: 'email',\n * records: [\n * { first_name: 'Alice', lead_source: 'web' }, // ✅ type-checked\n * { source: 'web' }, // ❌ compile error (unknown field)\n * { first_name: 'Bob', account: 'Acme Corp' }, // ✅ reference by natural key\n * { first_name: 'Bob', account: { externalId: 'Acme Corp' } }, // ❌ object not allowed\n * ],\n * });\n * ```\n */\nexport function defineSeed<\n const TObj extends { name: string; fields: Record<string, unknown> }\n>(\n objectDef: TObj,\n config: Omit<SeedInput, 'object' | 'records'> & {\n records: Array<SeedRecord<TObj['fields']>>;\n }\n): Seed {\n return SeedSchema.parse({ ...config, object: objectDef.name });\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { defineForm } from '../ui/view.zod';\n\n/**\n * Form Layout for Object Metadata Type\n */\nexport const objectForm = defineForm({\n schemaId: 'object',\n type: 'simple',\n sections: [\n {\n name: 'basics',\n label: 'Basics',\n description: 'Identity, labels, and taxonomy.',\n columns: 2,\n fields: [\n { field: 'name', type: 'text', required: true, immutable: true, colSpan: 1, helpText: 'snake_case unique identifier (immutable after creation)' },\n { field: 'label', type: 'text', colSpan: 1, helpText: 'Singular display name (e.g. \"Account\")' },\n { field: 'pluralLabel', type: 'text', colSpan: 1, helpText: 'Plural display name (e.g. \"Accounts\")' },\n { field: 'icon', type: 'text', colSpan: 1, helpText: 'Lucide icon name (e.g. \"building\", \"users\")' },\n { field: 'description', type: 'textarea', colSpan: 2, helpText: 'Developer documentation' },\n { field: 'tags', type: 'tags', colSpan: 2, helpText: 'Categorization tags (e.g. \"sales\", \"system\")' },\n { field: 'active', type: 'boolean', colSpan: 1, helpText: 'Is the object active and usable' },\n { field: 'isSystem', type: 'boolean', colSpan: 1, helpText: 'System object (protected from deletion)' },\n { field: 'abstract', type: 'boolean', colSpan: 1, helpText: 'Abstract base (cannot be instantiated)' },\n ],\n },\n {\n name: 'fields',\n label: 'Fields',\n description: 'Define the data model — each entry becomes a column in the database table.',\n fields: [\n {\n field: 'fields',\n type: 'record',\n required: true,\n helpText: 'Add the columns this object will store',\n keyField: {\n field: 'name',\n label: 'Name',\n placeholder: 'snake_case_identifier',\n helpText: 'snake_case machine name (used as column name and API key)',\n regex: '^[a-z_][a-z0-9_]*$',\n immutable: true,\n },\n fields: [\n { field: 'label', type: 'text', helpText: 'Display label' },\n {\n field: 'type',\n type: 'select',\n required: true,\n helpText: 'Field type',\n options: [\n { label: 'Text', value: 'text' },\n { label: 'Textarea', value: 'textarea' },\n { label: 'Email', value: 'email' },\n { label: 'URL', value: 'url' },\n { label: 'Phone', value: 'phone' },\n { label: 'Password', value: 'password' },\n { label: 'Markdown', value: 'markdown' },\n { label: 'HTML', value: 'html' },\n { label: 'Rich Text', value: 'richtext' },\n { label: 'Number', value: 'number' },\n { label: 'Currency', value: 'currency' },\n { label: 'Percent', value: 'percent' },\n { label: 'Date', value: 'date' },\n { label: 'Date & Time', value: 'datetime' },\n { label: 'Time', value: 'time' },\n { label: 'Boolean', value: 'boolean' },\n { label: 'Toggle', value: 'toggle' },\n { label: 'Select', value: 'select' },\n { label: 'Multiselect', value: 'multiselect' },\n { label: 'Radio', value: 'radio' },\n { label: 'Checkboxes', value: 'checkboxes' },\n { label: 'Lookup (reference)', value: 'lookup' },\n { label: 'Master–Detail', value: 'master_detail' },\n { label: 'Tree', value: 'tree' },\n { label: 'Image', value: 'image' },\n { label: 'File', value: 'file' },\n { label: 'Avatar', value: 'avatar' },\n { label: 'Video', value: 'video' },\n { label: 'Audio', value: 'audio' },\n { label: 'Formula (computed)', value: 'formula' },\n { label: 'Summary (rollup)', value: 'summary' },\n { label: 'Autonumber', value: 'autonumber' },\n { label: 'Composite (embedded)', value: 'composite' },\n { label: 'Repeater (embedded array)', value: 'repeater' },\n { label: 'Record (keyed map)', value: 'record' },\n { label: 'Location (GPS)', value: 'location' },\n { label: 'Address', value: 'address' },\n { label: 'Code', value: 'code' },\n { label: 'JSON', value: 'json' },\n { label: 'Color', value: 'color' },\n { label: 'Rating', value: 'rating' },\n { label: 'Slider', value: 'slider' },\n { label: 'Signature', value: 'signature' },\n { label: 'QR / Barcode', value: 'qrcode' },\n { label: 'Progress', value: 'progress' },\n { label: 'Tags', value: 'tags' },\n { label: 'Vector embedding', value: 'vector' },\n ],\n },\n { field: 'description', type: 'textarea', helpText: 'Developer documentation for this column' },\n { field: 'required', type: 'boolean', helpText: 'Must be set on every record' },\n { field: 'unique', type: 'boolean', helpText: 'Disallow duplicate values' },\n { field: 'indexed', type: 'boolean', helpText: 'Create a database index for faster querying' },\n { field: 'readonly', type: 'boolean', helpText: 'Visible but never user-editable' },\n { field: 'immutable', type: 'boolean', helpText: 'Editable on create, locked thereafter' },\n { field: 'hidden', type: 'boolean', helpText: 'Hidden from default UI' },\n { field: 'searchable', type: 'boolean', helpText: 'Include in full-text search' },\n { field: 'sortable', type: 'boolean', helpText: 'Allow sorting on this column' },\n { field: 'filterable', type: 'boolean', helpText: 'Allow filtering on this column' },\n { field: 'defaultValue', type: 'text', helpText: 'Default value for new records (JSON literal)' },\n { field: 'placeholder', type: 'text', helpText: 'Placeholder hint' },\n\n // Text constraints\n { field: 'maxLength', type: 'number', helpText: 'Max characters', visibleOn: \"type in ['text','textarea','email','url','phone','password','markdown','html','richtext']\" },\n { field: 'minLength', type: 'number', helpText: 'Min characters', visibleOn: \"type in ['text','textarea','email','url','phone','password','markdown','html','richtext']\" },\n\n // Numeric constraints\n { field: 'min', type: 'number', helpText: 'Minimum value', visibleOn: \"type in ['number','currency','percent','rating','slider','progress']\" },\n { field: 'max', type: 'number', helpText: 'Maximum value', visibleOn: \"type in ['number','currency','percent','rating','slider','progress']\" },\n { field: 'precision', type: 'number', helpText: 'Total digits', visibleOn: \"type in ['number','currency','percent']\" },\n { field: 'scale', type: 'number', helpText: 'Decimal places', visibleOn: \"type in ['number','currency','percent']\" },\n\n // Selection options\n {\n field: 'options',\n type: 'repeater',\n helpText: 'Available choices',\n visibleOn: \"type in ['select','multiselect','radio','checkboxes']\",\n fields: [\n { field: 'label', type: 'text', required: true },\n { field: 'value', type: 'text', required: true },\n { field: 'color', type: 'color' },\n { field: 'icon', type: 'text', helpText: 'Lucide icon name' },\n { field: 'description', type: 'text' },\n ],\n },\n\n // Relational\n { field: 'reference', type: 'text', helpText: 'Target object name', visibleOn: \"type in ['lookup','master_detail','tree']\" },\n { field: 'referenceFilter', type: 'code', language: 'expression', helpText: 'CEL filter applied to the picker', visibleOn: \"type in ['lookup','master_detail']\" },\n { field: 'cascadeDelete', type: 'boolean', helpText: 'Delete children when parent is deleted', visibleOn: \"type == 'master_detail'\" },\n { field: 'multiple', type: 'boolean', helpText: 'Allow selecting multiple records', visibleOn: \"type in ['lookup']\" },\n\n // Formula / summary\n { field: 'formula', type: 'code', language: 'expression', helpText: 'CEL formula expression', visibleOn: \"type == 'formula'\" },\n { field: 'returnType', type: 'select', helpText: 'Result type for formulas', visibleOn: \"type == 'formula'\", options: [\n { label: 'Text', value: 'text' }, { label: 'Number', value: 'number' }, { label: 'Boolean', value: 'boolean' },\n { label: 'Date', value: 'date' }, { label: 'Datetime', value: 'datetime' }, { label: 'Currency', value: 'currency' },\n ] },\n { field: 'summaryType', type: 'select', helpText: 'Aggregation', visibleOn: \"type == 'summary'\", options: [\n { label: 'Count', value: 'count' }, { label: 'Sum', value: 'sum' }, { label: 'Avg', value: 'avg' },\n { label: 'Min', value: 'min' }, { label: 'Max', value: 'max' },\n ] },\n { field: 'summaryField', type: 'text', helpText: 'Field on child object to aggregate', visibleOn: \"type == 'summary'\" },\n\n // Autonumber\n { field: 'displayFormat', type: 'text', helpText: 'e.g. \"INV-{0000}\"', visibleOn: \"type == 'autonumber'\" },\n { field: 'startingNumber', type: 'number', helpText: 'Starting sequence value', visibleOn: \"type == 'autonumber'\" },\n\n // Code language\n { field: 'language', type: 'text', helpText: 'Editor language (e.g. sql, javascript)', visibleOn: \"type == 'code'\" },\n\n // Validation / governance\n { field: 'validation', type: 'code', language: 'expression', helpText: 'CEL predicate — must evaluate true' },\n { field: 'errorMessage', type: 'text', helpText: 'Shown when validation fails' },\n { field: 'audit', type: 'boolean', helpText: 'Audit changes to this field' },\n { field: 'trackHistory', type: 'boolean', helpText: 'Keep change history' },\n { field: 'pii', type: 'boolean', helpText: 'Personally identifiable information' },\n { field: 'encrypted', type: 'boolean', helpText: 'Encrypt at rest' },\n ],\n },\n ],\n },\n {\n name: 'capabilities',\n label: 'Capabilities',\n description: 'System features and API exposure.',\n collapsible: true,\n collapsed: true,\n fields: [\n {\n field: 'capabilities',\n type: 'composite',\n helpText: 'Enable/disable system features',\n fields: [\n { field: 'trackHistory', type: 'boolean' },\n { field: 'searchable', type: 'boolean' },\n { field: 'apiEnabled', type: 'boolean' },\n { field: 'files', type: 'boolean' },\n { field: 'feeds', type: 'boolean' },\n { field: 'activities', type: 'boolean' },\n { field: 'trash', type: 'boolean' },\n { field: 'mru', type: 'boolean' },\n { field: 'clone', type: 'boolean' },\n ],\n },\n ],\n },\n {\n name: 'advanced',\n label: 'Advanced',\n description: 'State machines, actions, and storage.',\n collapsible: true,\n collapsed: true,\n fields: [\n { field: 'datasource', type: 'text', helpText: 'Target datasource ID (default: \"default\")' },\n ],\n },\n ],\n});\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { defineForm } from '../ui/view.zod';\n\n/**\n * Field Metadata Form\n * \n * Form layout for creating/editing field metadata definitions.\n */\nexport const fieldForm = defineForm({\n schemaId: 'field',\n type: 'simple',\n sections: [\n {\n name: 'basics',\n label: 'Basics',\n description: 'Core field identity and constraints.',\n columns: 2,\n fields: [\n { field: 'name', required: true, immutable: true, colSpan: 1, helpText: 'Unique identifier (snake_case, immutable after creation)' },\n { field: 'label', required: true, colSpan: 1, helpText: 'Display name for users' },\n { field: 'type', required: true, colSpan: 1, helpText: 'Data type of this field' },\n { field: 'group', colSpan: 1, helpText: 'Group name for form layout' },\n { field: 'description', widget: 'textarea', colSpan: 2, helpText: 'Help text shown to users' },\n { field: 'required', colSpan: 1, helpText: 'User must provide a value' },\n { field: 'unique', colSpan: 1, helpText: 'No two records can have the same value' },\n { field: 'multiple', colSpan: 1, helpText: 'Allow multiple values (for select/lookup)' },\n ],\n },\n {\n name: 'configuration',\n label: 'Configuration',\n description: 'Field-type specific settings (visible blocks depend on the chosen type).',\n fields: [\n { field: 'defaultValue', helpText: 'Default value for new records' },\n // Text field options\n { field: 'minLength', visibleOn: \"data.type == 'text' || data.type == 'textarea' || data.type == 'email'\", helpText: 'Minimum character length' },\n { field: 'maxLength', visibleOn: \"data.type == 'text' || data.type == 'textarea' || data.type == 'email'\", helpText: 'Maximum character length' },\n // Number field options\n { field: 'min', visibleOn: \"data.type == 'number' || data.type == 'currency'\", helpText: 'Minimum value' },\n { field: 'max', visibleOn: \"data.type == 'number' || data.type == 'currency'\", helpText: 'Maximum value' },\n { field: 'precision', visibleOn: \"data.type == 'currency' || data.type == 'number'\", helpText: 'Decimal places (e.g., 2 for $10.50)' },\n { field: 'scale', visibleOn: \"data.type == 'number'\", helpText: 'Number of decimal digits' },\n // Select field options\n { field: 'options', type: 'repeater', visibleOn: \"data.type == 'select' || data.type == 'multiselect'\", helpText: 'Available options (label/value pairs)' },\n // Reference field options\n { field: 'reference', widget: 'ref:object', visibleOn: \"data.type == 'lookup' || data.type == 'master_detail'\", helpText: 'Referenced object name' },\n { field: 'referenceFilters', widget: 'string-tags', visibleOn: \"data.type == 'lookup' || data.type == 'master_detail'\", helpText: 'Filter expressions (e.g., \"active = true\")' },\n { field: 'deleteBehavior', visibleOn: \"data.type == 'lookup' || data.type == 'master_detail'\", helpText: 'What happens when referenced record is deleted' },\n ],\n },\n {\n name: 'formula',\n label: 'Formula & Computed',\n description: 'Calculated values and roll-up summaries.',\n collapsible: true,\n collapsed: true,\n fields: [\n { field: 'expression', widget: 'textarea', helpText: 'CEL expression to calculate this field (makes it read-only)' },\n { field: 'summaryOperations', type: 'composite', helpText: 'Roll-up summary configuration (for parent-child relationships)' },\n ],\n },\n {\n name: 'advanced',\n label: 'Advanced',\n description: 'Database, UI, audit, and security settings.',\n collapsible: true,\n collapsed: true,\n columns: 2,\n fields: [\n // Database & Performance\n { field: 'columnName', colSpan: 2, helpText: 'Physical column name in database (defaults to field name)' },\n { field: 'index', colSpan: 1, helpText: 'Create database index for faster queries' },\n { field: 'externalId', colSpan: 1, helpText: 'Mark as external ID for upsert operations' },\n // UI & Visibility\n { field: 'readonly', colSpan: 1, helpText: 'Field is read-only in forms' },\n { field: 'hidden', colSpan: 1, helpText: 'Hide field from default UI views' },\n { field: 'searchable', colSpan: 1, helpText: 'Include in global search results' },\n { field: 'sortable', colSpan: 1, helpText: 'Allow sorting lists by this field' },\n ],\n },\n ],\n});\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { defineForm } from '../ui/view.zod';\n\n/**\n * Form Layout for Hook Metadata Type\n *\n * Hooks intercept the data lifecycle. The body field is a composite\n * (`{ language, source, capabilities?, timeoutMs?, memoryMb? }`) whose\n * `source` renders in a Monaco code editor with language-appropriate\n * syntax highlighting.\n */\nexport const hookForm = defineForm({\n schemaId: 'hook',\n type: 'simple',\n sections: [\n {\n label: 'Identity',\n description: 'What this hook is and when it fires.',\n columns: 2,\n fields: [\n { field: 'name', type: 'text', required: true, immutable: true, colSpan: 1, helpText: 'snake_case identifier (immutable after creation)' },\n { field: 'label', type: 'text', colSpan: 1 },\n { field: 'description', type: 'textarea', colSpan: 2 },\n { field: 'object', type: 'text', required: true, colSpan: 1, helpText: 'Target object name (or \"*\" for global)' },\n { field: 'events', type: 'tags', required: true, colSpan: 1, helpText: 'Lifecycle events (e.g. beforeInsert, afterUpdate)' },\n { field: 'priority', type: 'number', colSpan: 1, helpText: 'Lower numbers run first' },\n ],\n },\n {\n label: 'Body',\n description: 'Inline expression or sandboxed JavaScript executed when the hook fires.',\n fields: [\n {\n field: 'body',\n type: 'composite',\n helpText: 'Either an L1 expression or an L2 sandboxed JS body',\n fields: [\n { field: 'language', type: 'select', required: true, helpText: 'expression = pure formula; js = sandboxed JavaScript', options: [\n { label: 'Expression (L1)', value: 'expression' },\n { label: 'JavaScript (L2 sandboxed)', value: 'js' },\n ] },\n { field: 'source', type: 'code', language: 'javascript', required: true, helpText: 'Function body source — no top-level imports' },\n { field: 'capabilities', type: 'tags', helpText: 'Allowed ctx APIs (api.read, api.write, crypto.uuid, log, …)' },\n { field: 'timeoutMs', type: 'number', helpText: 'Per-invocation timeout (ms)' },\n ],\n },\n ],\n },\n {\n label: 'Legacy handler',\n description: 'Function name reference — deprecated in favour of body.',\n collapsible: true,\n collapsed: true,\n fields: [\n { field: 'handler', type: 'text', helpText: 'Handler function name (deprecated — prefer `body`)' },\n ],\n },\n {\n label: 'Execution',\n collapsible: true,\n collapsed: true,\n columns: 2,\n fields: [\n { field: 'async', type: 'boolean', colSpan: 1, helpText: 'Run in background, do not block the transaction' },\n { field: 'onError', type: 'select', colSpan: 1, options: [\n { label: 'Abort', value: 'abort' },\n { label: 'Log', value: 'log' },\n ] },\n { field: 'timeout', type: 'number', colSpan: 1, helpText: 'Abort the hook after N milliseconds' },\n { field: 'condition', type: 'code', language: 'javascript', colSpan: 2, helpText: 'Optional formula — skip the hook when this evaluates to false' },\n {\n field: 'retryPolicy',\n type: 'composite',\n colSpan: 2,\n helpText: 'Retry on failure — most useful for async hooks',\n fields: [\n { field: 'maxRetries', type: 'number', helpText: 'Maximum retry attempts' },\n { field: 'backoffMs', type: 'number', helpText: 'Delay between retries (ms)' },\n ],\n },\n ],\n },\n ],\n});\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { SeedSchema, SeedMode } from './seed.zod';\n\n/**\n * # Seed Loader Protocol\n *\n * Defines the schemas for metadata-driven seed data loading with automatic\n * relationship resolution, dependency ordering, and multi-pass insertion.\n *\n * ## Architecture Alignment\n * - **Salesforce Data Loader**: External ID-based upsert with relationship resolution\n * - **ServiceNow**: Sys ID and display value mapping during import\n * - **Airtable**: Linked record resolution via display names\n *\n * ## Loading Flow\n * ```\n * 1. Build object dependency graph from field metadata (lookup/master_detail)\n * 2. Topological sort → determine insert order (parents before children)\n * 3. Pass 1: Insert/upsert records, resolve references via externalId\n * 4. Pass 2: Fill deferred references (circular/delayed dependencies)\n * 5. Validate & report unresolved references\n * 6. Return structured result with per-object stats\n * ```\n */\n\n// ==========================================================================\n// 1. Reference Resolution\n// ==========================================================================\n\n/**\n * Describes how a single field reference should be resolved during seed loading.\n *\n * When a lookup/master_detail field value is not an internal ID, the loader\n * attempts to match it against the target object's externalId field.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const ReferenceResolutionSchema = lazySchema(() => z.object({\n /** The field name on the source object (e.g., 'account_id') */\n field: z.string().describe('Source field name containing the reference value'),\n\n /** The target object being referenced (e.g., 'account') */\n targetObject: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Target object name (snake_case)'),\n\n /**\n * The field on the target object used to match the reference value.\n * Defaults to the target object's externalId (usually 'name').\n */\n targetField: z.string().default('name').describe('Field on target object used for matching'),\n\n /** The field type that triggered this resolution (lookup, master_detail, or user) */\n fieldType: z.enum(['lookup', 'master_detail', 'user']).describe('Relationship field type'),\n}).describe('Describes how a field reference is resolved during seed loading'));\n\nexport type ReferenceResolution = z.infer<typeof ReferenceResolutionSchema>;\n\n// ==========================================================================\n// 2. Object Dependency Node\n// ==========================================================================\n\n/**\n * Represents a single object in the dependency graph.\n * Built from object metadata by inspecting lookup/master_detail fields.\n */\nexport const ObjectDependencyNodeSchema = lazySchema(() => z.object({\n /** Object machine name */\n object: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Object name (snake_case)'),\n\n /**\n * Objects that this object depends on (via lookup/master_detail fields).\n * These must be loaded before this object.\n */\n dependsOn: z.array(z.string()).describe('Objects this object depends on'),\n\n /**\n * Field-level reference details for each dependency.\n * Maps field name → reference resolution info.\n */\n references: z.array(ReferenceResolutionSchema).describe('Field-level reference details'),\n}).describe('Object node in the seed data dependency graph'));\n\nexport type ObjectDependencyNode = z.infer<typeof ObjectDependencyNodeSchema>;\n\n// ==========================================================================\n// 3. Object Dependency Graph\n// ==========================================================================\n\n/**\n * The complete object dependency graph for seed data loading.\n * Used to determine topological insert order and detect circular dependencies.\n */\nexport const ObjectDependencyGraphSchema = lazySchema(() => z.object({\n /** All object nodes in the graph */\n nodes: z.array(ObjectDependencyNodeSchema).describe('All objects in the dependency graph'),\n\n /**\n * Topologically sorted object names for insertion order.\n * Parent objects appear before child objects.\n */\n insertOrder: z.array(z.string()).describe('Topologically sorted insert order'),\n\n /**\n * Circular dependency chains detected in the graph.\n * Each chain is an array of object names forming a cycle.\n * When present, the loader must use a multi-pass strategy.\n *\n * @example [['project', 'task', 'project']]\n */\n circularDependencies: z.array(z.array(z.string())).default([])\n .describe('Circular dependency chains (e.g., [[\"a\", \"b\", \"a\"]])'),\n}).describe('Complete object dependency graph for seed data loading'));\n\nexport type ObjectDependencyGraph = z.infer<typeof ObjectDependencyGraphSchema>;\n\n// ==========================================================================\n// 4. Reference Resolution Error\n// ==========================================================================\n\n/**\n * Actionable error for a failed reference resolution.\n * Provides all context needed to diagnose and fix the broken reference.\n *\n * Aligns with Salesforce Data Loader error reporting patterns:\n * field name, target object, attempted value, and reason.\n */\nexport const ReferenceResolutionErrorSchema = lazySchema(() => z.object({\n /** The source object containing the broken reference */\n sourceObject: z.string().describe('Object with the broken reference'),\n\n /** The field containing the unresolved value */\n field: z.string().describe('Field name with unresolved reference'),\n\n /** The target object that was searched */\n targetObject: z.string().describe('Target object searched for the reference'),\n\n /** The externalId field used for matching on the target object */\n targetField: z.string().describe('ExternalId field used for matching'),\n\n /** The value that could not be resolved */\n attemptedValue: z.unknown().describe('Value that failed to resolve'),\n\n /** The index of the record in the dataset's records array */\n recordIndex: z.number().int().min(0).describe('Index of the record in the dataset'),\n\n /** Human-readable error message */\n message: z.string().describe('Human-readable error description'),\n}).describe('Actionable error for a failed reference resolution'));\n\nexport type ReferenceResolutionError = z.infer<typeof ReferenceResolutionErrorSchema>;\n\n// ==========================================================================\n// 4b. Seed Identity (os.user / os.org binding)\n// ==========================================================================\n\n/**\n * Identity bound to `os.user` / `os.org` when the loader evaluates CEL\n * expressions embedded in seed records (e.g. `owner_id: cel\\`os.user.id\\``).\n *\n * The seed loader populates the formula evaluation context from this, so\n * identity-derived seed values resolve to the installer/system identity\n * instead of failing. The canonical producer is the runtime's deterministic\n * system user (`usr_system`), ensured before seeding so this always resolves\n * — even on a fresh boot before the first human sign-up.\n *\n * Defined eagerly (only primitive fields, no circular refs) so it can be\n * referenced from the lazily-built config schema below.\n */\nexport const SeedIdentitySchema = z.object({\n /**\n * Subject bound to `os.user` in seed CEL. Typically the deterministic\n * system user (`usr_system`) or the promoted platform admin.\n */\n user: z.object({\n id: z.string().min(1),\n role: z.string().optional(),\n email: z.string().optional(),\n }).optional().describe('Subject bound to os.user in seed CEL expressions'),\n\n /**\n * Organization bound to `os.org` in seed CEL. During per-tenant replay\n * the loader defaults this to `organizationId` when omitted.\n */\n org: z.object({\n id: z.string().min(1),\n tier: z.string().optional(),\n }).optional().describe('Organization bound to os.org in seed CEL expressions'),\n}).describe('Identity context for resolving os.user / os.org in seed CEL values');\n\nexport type SeedIdentity = z.infer<typeof SeedIdentitySchema>;\n\n// ==========================================================================\n// 5. Seed Loader Configuration\n// ==========================================================================\n\n/**\n * Configuration for the seed data loader.\n * Controls behavior for reference resolution, error handling, and validation.\n */\nexport const SeedLoaderConfigSchema = lazySchema(() => z.object({\n /**\n * Dry-run mode: validate all references without writing data.\n * Surfaces broken references before any mutations occur.\n * @default false\n */\n dryRun: z.boolean().default(false)\n .describe('Validate references without writing data'),\n\n /**\n * Whether to halt on the first reference resolution error.\n * When false, collects all errors and continues loading.\n * @default false\n */\n haltOnError: z.boolean().default(false)\n .describe('Stop on first reference resolution error'),\n\n /**\n * Enable multi-pass loading for circular dependencies.\n * Pass 1: Insert records with null for circular references.\n * Pass 2: Update records to fill deferred references.\n * @default true\n */\n multiPass: z.boolean().default(true)\n .describe('Enable multi-pass loading for circular dependencies'),\n\n /**\n * Default dataset mode when not specified per-dataset.\n * @default 'upsert'\n */\n defaultMode: SeedMode.default('upsert')\n .describe('Default conflict resolution strategy'),\n\n /**\n * Maximum number of records to process in a single batch.\n * Controls memory usage for large datasets.\n * @default 1000\n */\n batchSize: z.number().int().min(1).default(1000)\n .describe('Maximum records per batch insert/upsert'),\n\n /**\n * Whether to wrap the entire load operation in a transaction.\n * When true, all-or-nothing semantics apply.\n * @default false\n */\n transaction: z.boolean().default(false)\n .describe('Wrap entire load in a transaction (all-or-nothing)'),\n\n /**\n * Environment filter. Only datasets matching this environment are loaded.\n * When not specified, all datasets are loaded regardless of env scope.\n */\n env: z.enum(['prod', 'dev', 'test']).optional()\n .describe('Only load datasets matching this environment'),\n\n /**\n * Target organization for per-tenant seed loading.\n *\n * When set, the loader:\n * - Injects `organization_id: <id>` into every record before write\n * (unless the record already supplies one).\n * - Scopes existing-record lookups (`loadExistingRecords`,\n * `resolveFromDatabase`) to `organization_id = <id>`, so `upsert`\n * mode finds the per-org copy rather than another tenant's row.\n *\n * Use this from a `sys_organization` insert hook to give every new\n * tenant a private copy of the artifact-shipped demo data (Salesforce\n * sandbox style). Omit for cross-tenant / platform-wide seeds (e.g.\n * `sys_permission_set`) — those rows should have `organization_id`\n * NULL and are not filtered by the default tenant RLS.\n */\n organizationId: z.string().min(1).optional()\n .describe('Target organization id for per-tenant seed replay'),\n\n /**\n * Identity bound to `os.user` / `os.org` when evaluating CEL expressions\n * embedded in seed records (e.g. `owner_id: cel\\`os.user.id\\``,\n * `organization_id: cel\\`os.org.id\\``).\n *\n * When omitted, `os.user` / `os.org` are simply unbound — and any record\n * that references them fails loudly (the record is dropped with an\n * actionable error rather than persisting the raw Expression envelope into\n * the column). The runtime supplies a deterministic system user here so\n * identity-derived seeds resolve even before the first human sign-up.\n */\n identity: SeedIdentitySchema.optional()\n .describe('Identity bound to os.user / os.org when resolving CEL seed values'),\n}).describe('Seed data loader configuration'));\n\nexport type SeedLoaderConfig = z.infer<typeof SeedLoaderConfigSchema>;\n\n/** Input type — all fields with defaults are optional */\nexport type SeedLoaderConfigInput = z.input<typeof SeedLoaderConfigSchema>;\n\n// ==========================================================================\n// 6. Per-Object Load Result\n// ==========================================================================\n\n/**\n * Result of loading a single object's dataset.\n */\nexport const SeedLoadResultSchema = lazySchema(() => z.object({\n /** Target object name */\n object: z.string().describe('Object that was loaded'),\n\n /** Import mode used */\n mode: SeedMode.describe('Import mode used'),\n\n /** Number of records successfully inserted */\n inserted: z.number().int().min(0).describe('Records inserted'),\n\n /** Number of records successfully updated (upsert matched existing) */\n updated: z.number().int().min(0).describe('Records updated'),\n\n /** Number of records skipped (mode: ignore, or already exists) */\n skipped: z.number().int().min(0).describe('Records skipped'),\n\n /** Number of records with errors */\n errored: z.number().int().min(0).describe('Records with errors'),\n\n /** Total records in the dataset */\n total: z.number().int().min(0).describe('Total records in dataset'),\n\n /** Number of references resolved via externalId */\n referencesResolved: z.number().int().min(0).describe('References resolved via externalId'),\n\n /** Number of references deferred to pass 2 (circular dependencies) */\n referencesDeferred: z.number().int().min(0).describe('References deferred to second pass'),\n\n /** Reference resolution errors for this object */\n errors: z.array(ReferenceResolutionErrorSchema).default([])\n .describe('Reference resolution errors'),\n}).describe('Result of loading a single dataset'));\n\nexport type SeedLoadResult = z.infer<typeof SeedLoadResultSchema>;\n\n// ==========================================================================\n// 7. Seed Loader Result\n// ==========================================================================\n\n/**\n * Complete result of a seed loading operation.\n * Aggregates all per-object results and provides summary statistics.\n */\nexport const SeedLoaderResultSchema = lazySchema(() => z.object({\n /** Whether the overall load operation succeeded */\n success: z.boolean().describe('Overall success status'),\n\n /** Was this a dry-run (validation only, no writes)? */\n dryRun: z.boolean().describe('Whether this was a dry-run'),\n\n /** The dependency graph used for ordering */\n dependencyGraph: ObjectDependencyGraphSchema.describe('Object dependency graph'),\n\n /** Per-object load results, in the order they were processed */\n results: z.array(SeedLoadResultSchema).describe('Per-object load results'),\n\n /** All reference resolution errors across all objects */\n errors: z.array(ReferenceResolutionErrorSchema).describe('All reference resolution errors'),\n\n /** Summary statistics */\n summary: z.object({\n /** Total objects processed */\n objectsProcessed: z.number().int().min(0).describe('Total objects processed'),\n\n /** Total records across all objects */\n totalRecords: z.number().int().min(0).describe('Total records across all objects'),\n\n /** Total records inserted */\n totalInserted: z.number().int().min(0).describe('Total records inserted'),\n\n /** Total records updated */\n totalUpdated: z.number().int().min(0).describe('Total records updated'),\n\n /** Total records skipped */\n totalSkipped: z.number().int().min(0).describe('Total records skipped'),\n\n /** Total records with errors */\n totalErrored: z.number().int().min(0).describe('Total records with errors'),\n\n /** Total references resolved via externalId */\n totalReferencesResolved: z.number().int().min(0).describe('Total references resolved'),\n\n /** Total references deferred to second pass */\n totalReferencesDeferred: z.number().int().min(0).describe('Total references deferred'),\n\n /** Number of circular dependency chains detected */\n circularDependencyCount: z.number().int().min(0).describe('Circular dependency chains detected'),\n\n /** Duration of the load operation in milliseconds */\n durationMs: z.number().min(0).describe('Load duration in milliseconds'),\n }).describe('Summary statistics'),\n}).describe('Complete seed loader result'));\n\nexport type SeedLoaderResult = z.infer<typeof SeedLoaderResultSchema>;\n\n// ==========================================================================\n// 8. Seed Loader Request\n// ==========================================================================\n\n/**\n * Input request for the seed loader.\n * Combines datasets with loader configuration.\n */\nexport const SeedLoaderRequestSchema = lazySchema(() => z.object({\n /** Seeds to load */\n seeds: z.array(SeedSchema).min(1).describe('Seeds to load'),\n\n /** Loader configuration */\n config: SeedLoaderConfigSchema.default(() => SeedLoaderConfigSchema.parse({})).describe('Loader configuration'),\n}).describe('Seed loader request with datasets and configuration'));\n\nexport type SeedLoaderRequest = z.infer<typeof SeedLoaderRequestSchema>;\n\n/** Input type — config defaults are optional */\nexport type SeedLoaderRequestInput = z.input<typeof SeedLoaderRequestSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Document Version Schema\n * \n * Represents a single version of a document in a version-controlled system.\n * Each version is immutable and maintains its own metadata and download URL.\n * \n * @example\n * ```json\n * {\n * \"versionNumber\": 2,\n * \"createdAt\": 1704067200000,\n * \"createdBy\": \"user_123\",\n * \"size\": 2048576,\n * \"checksum\": \"a1b2c3d4e5f6\",\n * \"downloadUrl\": \"https://storage.example.com/docs/v2/file.pdf\",\n * \"isLatest\": true\n * }\n * ```\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const DocumentVersionSchema = lazySchema(() => z.object({\n /**\n * Sequential version number (increments with each new version)\n */\n versionNumber: z.number().describe('Version number'),\n\n /**\n * Timestamp when this version was created (Unix milliseconds)\n */\n createdAt: z.number().describe('Creation timestamp'),\n\n /**\n * User ID who created this version\n */\n createdBy: z.string().describe('Creator user ID'),\n\n /**\n * File size in bytes\n */\n size: z.number().describe('File size in bytes'),\n\n /**\n * Checksum/hash of the file content (for integrity verification)\n */\n checksum: z.string().describe('File checksum'),\n\n /**\n * URL to download this specific version\n */\n downloadUrl: z.string().url().describe('Download URL'),\n\n /**\n * Whether this is the latest version\n * @default false\n */\n isLatest: z.boolean().optional().default(false).describe('Is latest version'),\n}));\n\n/**\n * Document Template Schema\n * \n * Defines a reusable document template with dynamic placeholders.\n * Templates can be used to generate documents with variable content.\n * \n * @example\n * ```json\n * {\n * \"id\": \"contract-template\",\n * \"name\": \"Service Agreement\",\n * \"description\": \"Standard service agreement template\",\n * \"fileUrl\": \"https://example.com/templates/contract.docx\",\n * \"fileType\": \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n * \"placeholders\": [\n * {\n * \"key\": \"client_name\",\n * \"label\": \"Client Name\",\n * \"type\": \"text\",\n * \"required\": true\n * },\n * {\n * \"key\": \"contract_date\",\n * \"label\": \"Contract Date\",\n * \"type\": \"date\",\n * \"required\": true\n * }\n * ]\n * }\n * ```\n */\nexport const DocumentTemplateSchema = lazySchema(() => z.object({\n /**\n * Unique identifier for the template\n */\n id: z.string().describe('Template ID'),\n\n /**\n * Human-readable name of the template\n */\n name: z.string().describe('Template name'),\n\n /**\n * Optional description of the template's purpose\n */\n description: z.string().optional().describe('Template description'),\n\n /**\n * URL to the template file\n */\n fileUrl: z.string().url().describe('Template file URL'),\n\n /**\n * MIME type of the template file\n */\n fileType: z.string().describe('File MIME type'),\n\n /**\n * List of dynamic placeholders in the template\n */\n placeholders: z.array(z.object({\n /**\n * Placeholder identifier (used in template)\n */\n key: z.string().describe('Placeholder key'),\n\n /**\n * Human-readable label for the placeholder\n */\n label: z.string().describe('Placeholder label'),\n\n /**\n * Data type of the placeholder value\n */\n type: z.enum(['text', 'number', 'date', 'image']).describe('Placeholder type'),\n\n /**\n * Whether this placeholder must be filled\n * @default false\n */\n required: z.boolean().optional().default(false).describe('Is required'),\n })).describe('Template placeholders'),\n}));\n\n/**\n * E-Signature Configuration Schema\n * \n * Configuration for electronic signature workflows.\n * Supports integration with popular e-signature providers.\n * \n * @example\n * ```json\n * {\n * \"provider\": \"docusign\",\n * \"enabled\": true,\n * \"signers\": [\n * {\n * \"email\": \"client@example.com\",\n * \"name\": \"John Doe\",\n * \"role\": \"Client\",\n * \"order\": 1\n * },\n * {\n * \"email\": \"manager@example.com\",\n * \"name\": \"Jane Smith\",\n * \"role\": \"Manager\",\n * \"order\": 2\n * }\n * ],\n * \"expirationDays\": 30,\n * \"reminderDays\": 7\n * }\n * ```\n */\nexport const ESignatureConfigSchema = lazySchema(() => z.object({\n /**\n * E-signature service provider\n */\n provider: z.enum(['docusign', 'adobe-sign', 'hellosign', 'custom']).describe('E-signature provider'),\n\n /**\n * Whether e-signature is enabled for this document\n * @default false\n */\n enabled: z.boolean().optional().default(false).describe('E-signature enabled'),\n\n /**\n * List of signers in signing order\n */\n signers: z.array(z.object({\n /**\n * Signer's email address\n */\n email: z.string().email().describe('Signer email'),\n\n /**\n * Signer's full name\n */\n name: z.string().describe('Signer name'),\n\n /**\n * Signer's role in the document\n */\n role: z.string().describe('Signer role'),\n\n /**\n * Signing order (lower numbers sign first)\n */\n order: z.number().describe('Signing order'),\n })).describe('Document signers'),\n\n /**\n * Days until signature request expires\n * @default 30\n */\n expirationDays: z.number().optional().default(30).describe('Expiration days'),\n\n /**\n * Days between reminder emails\n * @default 7\n */\n reminderDays: z.number().optional().default(7).describe('Reminder interval days'),\n}));\n\n/**\n * Document Schema\n * \n * Comprehensive document management protocol supporting versioning,\n * templates, e-signatures, and access control.\n * \n * @example\n * ```json\n * {\n * \"id\": \"doc_123\",\n * \"name\": \"Service Agreement 2024\",\n * \"description\": \"Annual service agreement\",\n * \"fileType\": \"application/pdf\",\n * \"fileSize\": 1048576,\n * \"category\": \"contracts\",\n * \"tags\": [\"legal\", \"2024\", \"services\"],\n * \"versioning\": {\n * \"enabled\": true,\n * \"versions\": [\n * {\n * \"versionNumber\": 1,\n * \"createdAt\": 1704067200000,\n * \"createdBy\": \"user_123\",\n * \"size\": 1048576,\n * \"checksum\": \"abc123\",\n * \"downloadUrl\": \"https://example.com/docs/v1.pdf\",\n * \"isLatest\": true\n * }\n * ],\n * \"majorVersion\": 1,\n * \"minorVersion\": 0\n * },\n * \"access\": {\n * \"isPublic\": false,\n * \"sharedWith\": [\"user_456\", \"team_789\"],\n * \"expiresAt\": 1735689600000\n * },\n * \"metadata\": {\n * \"author\": \"John Doe\",\n * \"department\": \"Legal\"\n * }\n * }\n * ```\n */\nexport const DocumentSchema = lazySchema(() => z.object({\n /**\n * Unique document identifier\n */\n id: z.string().describe('Document ID'),\n\n /**\n * Document name\n */\n name: z.string().describe('Document name'),\n\n /**\n * Optional document description\n */\n description: z.string().optional().describe('Document description'),\n\n /**\n * MIME type of the document\n */\n fileType: z.string().describe('File MIME type'),\n\n /**\n * File size in bytes\n */\n fileSize: z.number().describe('File size in bytes'),\n\n /**\n * Document category for organization\n */\n category: z.string().optional().describe('Document category'),\n\n /**\n * Tags for searchability and organization\n */\n tags: z.array(z.string()).optional().describe('Document tags'),\n\n /**\n * Version control configuration\n */\n versioning: z.object({\n /**\n * Whether versioning is enabled\n */\n enabled: z.boolean().describe('Versioning enabled'),\n\n /**\n * List of all document versions\n */\n versions: z.array(DocumentVersionSchema).describe('Version history'),\n\n /**\n * Current major version number\n */\n majorVersion: z.number().describe('Major version'),\n\n /**\n * Current minor version number\n */\n minorVersion: z.number().describe('Minor version'),\n }).optional().describe('Version control'),\n\n /**\n * Template configuration (if document is generated from template)\n */\n template: DocumentTemplateSchema.optional().describe('Document template'),\n\n /**\n * E-signature configuration\n */\n eSignature: ESignatureConfigSchema.optional().describe('E-signature config'),\n\n /**\n * Access control settings\n */\n access: z.object({\n /**\n * Whether document is publicly accessible\n * @default false\n */\n isPublic: z.boolean().optional().default(false).describe('Public access'),\n\n /**\n * List of user/team IDs with access\n */\n sharedWith: z.array(z.string()).optional().describe('Shared with'),\n\n /**\n * Timestamp when access expires (Unix milliseconds)\n */\n expiresAt: z.number().optional().describe('Access expiration'),\n }).optional().describe('Access control'),\n\n /**\n * Custom metadata fields\n */\n metadata: z.record(z.string(), z.unknown()).optional().describe('Custom metadata'),\n}));\n\n// Type exports\nexport type Document = z.infer<typeof DocumentSchema>;\nexport type DocumentVersion = z.infer<typeof DocumentVersionSchema>;\nexport type DocumentTemplate = z.infer<typeof DocumentTemplateSchema>;\nexport type ESignatureConfig = z.infer<typeof ESignatureConfigSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { ExpressionInputSchema } from './expression.zod';\n\n/**\n * Base Field Mapping Protocol\n * \n * Shared by: ETL, Sync, Connector, External Lookup\n * \n * This module provides the canonical field mapping schema used across\n * ObjectStack for data transformation and synchronization.\n * \n * **Use Cases:**\n * - ETL pipelines (data/mapping.zod.ts)\n * - Data synchronization (automation/sync.zod.ts)\n * - Integration connectors (integration/connector.zod.ts)\n * - External lookups (data/external-lookup.zod.ts)\n * \n * @example Basic field mapping\n * ```typescript\n * const mapping: FieldMapping = {\n * source: 'external_user_id',\n * target: 'user_id',\n * };\n * ```\n * \n * @example With transformation\n * ```typescript\n * const mapping: FieldMapping = {\n * source: 'user_name',\n * target: 'name',\n * transform: { type: 'cast', targetType: 'string' },\n * defaultValue: 'Unknown'\n * };\n * ```\n */\n\n/**\n * Transform Type Schema\n * \n * Defines the type of transformation to apply to a field value.\n * Implementations can extend this for domain-specific transforms.\n */\nimport { lazySchema } from './lazy-schema';\nexport const TransformTypeSchema = lazySchema(() => z.discriminatedUnion('type', [\n z.object({\n type: z.literal('constant'),\n value: z.unknown().describe('Constant value to use'),\n }).describe('Set a constant value'),\n \n z.object({\n type: z.literal('cast'),\n targetType: z.enum(['string', 'number', 'boolean', 'date']).describe('Target data type'),\n }).describe('Cast to a specific data type'),\n \n z.object({\n type: z.literal('lookup'),\n table: z.string().describe('Lookup table name'),\n keyField: z.string().describe('Field to match on'),\n valueField: z.string().describe('Field to retrieve'),\n }).describe('Lookup value from another table'),\n \n z.object({\n type: z.literal('javascript'),\n expression: ExpressionInputSchema.describe('JS expression (dialect=\"js\" recommended). e.g. value.toUpperCase()'),\n }).describe('Custom JavaScript transformation'),\n \n z.object({\n type: z.literal('map'),\n mappings: z.record(z.string(), z.unknown()).describe('Value mappings (e.g., {\"Active\": \"active\"})'),\n }).describe('Map values using a dictionary'),\n]));\n\nexport type TransformType = z.infer<typeof TransformTypeSchema>;\n\n/**\n * Field Mapping Schema\n * \n * Base schema for mapping fields between source and target systems.\n * \n * **NAMING CONVENTION:**\n * - source: Field name in the source system\n * - target: Field name in the target system (should be snake_case for ObjectStack)\n * \n * @example\n * ```typescript\n * {\n * source: 'FirstName',\n * target: 'first_name',\n * transform: { type: 'cast', targetType: 'string' },\n * defaultValue: ''\n * }\n * ```\n */\nexport const FieldMappingSchema = lazySchema(() => z.object({\n /**\n * Source field name\n */\n source: z.string().describe('Source field name'),\n \n /**\n * Target field name (should be snake_case for ObjectStack)\n */\n target: z.string().describe('Target field name'),\n \n /**\n * Transformation to apply\n */\n transform: TransformTypeSchema.optional().describe('Transformation to apply'),\n \n /**\n * Default value if source is null/undefined\n */\n defaultValue: z.unknown().optional().describe('Default if source is null/undefined'),\n}));\n\nexport type FieldMapping = z.infer<typeof FieldMappingSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FieldMappingSchema as BaseFieldMappingSchema } from '../shared/mapping.zod';\n\n/**\n * External Data Source Schema\n * \n * Configuration for connecting to external data systems.\n * Similar to Salesforce External Objects for real-time data integration.\n * \n * @example\n * ```json\n * {\n * \"id\": \"salesforce-accounts\",\n * \"name\": \"Salesforce Account Data\",\n * \"type\": \"rest-api\",\n * \"endpoint\": \"https://api.salesforce.com/services/data/v58.0\",\n * \"authentication\": {\n * \"type\": \"oauth2\",\n * \"config\": {\n * \"clientId\": \"...\",\n * \"clientSecret\": \"...\",\n * \"tokenUrl\": \"https://login.salesforce.com/services/oauth2/token\"\n * }\n * }\n * }\n * ```\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const ExternalDataSourceSchema = lazySchema(() => z.object({\n /**\n * Unique identifier for the external data source\n */\n id: z.string().describe('Data source ID'),\n\n /**\n * Human-readable name of the data source\n */\n name: z.string().describe('Data source name'),\n\n /**\n * Protocol type for connecting to the data source\n */\n type: z.enum(['odata', 'rest-api', 'graphql', 'custom']).describe('Protocol type'),\n\n /**\n * Base URL endpoint for the external system\n */\n endpoint: z.string().url().describe('API endpoint URL'),\n\n /**\n * Authentication configuration\n */\n authentication: z.object({\n /**\n * Authentication method\n */\n type: z.enum(['oauth2', 'api-key', 'basic', 'none']).describe('Auth type'),\n\n /**\n * Authentication-specific configuration\n * Structure varies based on auth type\n */\n config: z.record(z.string(), z.unknown()).describe('Auth configuration'),\n }).describe('Authentication'),\n}));\n\n/**\n * Field Mapping Schema for External Lookups\n * \n * Extends the base field mapping with external lookup specific features.\n * Uses the canonical field mapping protocol from shared/mapping.zod.ts.\n * \n * @see {@link BaseFieldMappingSchema} for the base field mapping schema\n * \n * @example\n * ```json\n * {\n * \"source\": \"AccountName\",\n * \"target\": \"name\",\n * \"readonly\": true\n * }\n * ```\n */\nexport const ExternalFieldMappingSchema = lazySchema(() => BaseFieldMappingSchema.extend({\n /**\n * Field data type\n */\n type: z.string().optional().describe('Field type'),\n\n /**\n * Whether the field is read-only\n * @default true\n */\n readonly: z.boolean().optional().default(true).describe('Read-only field'),\n}));\n\n/**\n * External Lookup Schema\n * \n * Real-time data lookup protocol for external systems.\n * Enables querying external data sources without replication.\n * Inspired by Salesforce External Objects and OData protocols.\n * \n * @example\n * ```json\n * {\n * \"fieldName\": \"external_account\",\n * \"dataSource\": {\n * \"id\": \"salesforce-api\",\n * \"name\": \"Salesforce\",\n * \"type\": \"rest-api\",\n * \"endpoint\": \"https://api.salesforce.com/services/data/v58.0\",\n * \"authentication\": {\n * \"type\": \"oauth2\",\n * \"config\": {\"clientId\": \"...\"}\n * }\n * },\n * \"query\": {\n * \"endpoint\": \"/sobjects/Account\",\n * \"method\": \"GET\",\n * \"parameters\": {\"limit\": 100}\n * },\n * \"fieldMappings\": [\n * {\n * \"externalField\": \"Name\",\n * \"localField\": \"account_name\",\n * \"type\": \"text\",\n * \"readonly\": true\n * }\n * ],\n * \"caching\": {\n * \"enabled\": true,\n * \"ttl\": 300,\n * \"strategy\": \"ttl\"\n * },\n * \"fallback\": {\n * \"enabled\": true,\n * \"showError\": true\n * },\n * \"rateLimit\": {\n * \"requestsPerSecond\": 10,\n * \"burstSize\": 20\n * }\n * }\n * ```\n */\nexport const ExternalLookupSchema = lazySchema(() => z.object({\n /**\n * Name of the field that uses external lookup\n */\n fieldName: z.string().describe('Field name'),\n\n /**\n * External data source configuration\n */\n dataSource: ExternalDataSourceSchema.describe('External data source'),\n\n /**\n * Query configuration for fetching external data\n */\n query: z.object({\n /**\n * API endpoint path (relative to base endpoint)\n */\n endpoint: z.string().describe('Query endpoint path'),\n\n /**\n * HTTP method for the query\n * @default 'GET'\n */\n method: z.enum(['GET', 'POST']).optional().default('GET').describe('HTTP method'),\n\n /**\n * Query parameters or request body\n */\n parameters: z.record(z.string(), z.unknown()).optional().describe('Query parameters'),\n }).describe('Query configuration'),\n\n /**\n * Mapping between external and local fields\n */\n fieldMappings: z.array(ExternalFieldMappingSchema).describe('Field mappings'),\n\n /**\n * Cache configuration for external data\n */\n caching: z.object({\n /**\n * Whether caching is enabled\n * @default true\n */\n enabled: z.boolean().optional().default(true).describe('Cache enabled'),\n\n /**\n * Time-to-live in seconds\n * @default 300\n */\n ttl: z.number().optional().default(300).describe('Cache TTL (seconds)'),\n\n /**\n * Cache eviction strategy\n * @default 'ttl'\n */\n strategy: z.enum(['lru', 'lfu', 'ttl']).optional().default('ttl').describe('Cache strategy'),\n }).optional().describe('Caching configuration'),\n\n /**\n * Fallback behavior when external system is unavailable\n */\n fallback: z.object({\n /**\n * Whether fallback is enabled\n * @default true\n */\n enabled: z.boolean().optional().default(true).describe('Fallback enabled'),\n\n /**\n * Default value to use when external system fails\n */\n defaultValue: z.unknown().optional().describe('Default fallback value'),\n\n /**\n * Whether to show error message to user\n * @default true\n */\n showError: z.boolean().optional().default(true).describe('Show error to user'),\n }).optional().describe('Fallback configuration'),\n\n /**\n * Rate limiting to prevent overwhelming external system\n */\n rateLimit: z.object({\n /**\n * Maximum requests per second\n */\n requestsPerSecond: z.number().describe('Requests per second limit'),\n\n /**\n * Burst size for handling spikes\n */\n burstSize: z.number().optional().describe('Burst size'),\n }).optional().describe('Rate limiting'),\n\n /**\n * Retry configuration with exponential backoff\n *\n * @example\n * ```json\n * {\n * \"maxRetries\": 3,\n * \"initialDelayMs\": 1000,\n * \"maxDelayMs\": 30000,\n * \"backoffMultiplier\": 2,\n * \"retryableStatusCodes\": [429, 500, 502, 503, 504]\n * }\n * ```\n */\n retry: z.object({\n /** Maximum number of retry attempts */\n maxRetries: z.number().min(0).default(3).describe('Maximum retry attempts'),\n /** Initial delay before first retry (ms) */\n initialDelayMs: z.number().default(1000).describe('Initial retry delay in milliseconds'),\n /** Maximum delay between retries (ms) */\n maxDelayMs: z.number().default(30000).describe('Maximum retry delay in milliseconds'),\n /** Backoff multiplier for exponential backoff */\n backoffMultiplier: z.number().default(2).describe('Exponential backoff multiplier'),\n /** HTTP status codes that trigger a retry */\n retryableStatusCodes: z.array(z.number()).default([429, 500, 502, 503, 504])\n .describe('HTTP status codes that are retryable'),\n }).optional().describe('Retry configuration with exponential backoff'),\n\n /**\n * Request/response transformation pipeline\n *\n * Allows transforming request parameters and response data\n * before they are processed by the external lookup system.\n */\n transform: z.object({\n /** Transform request parameters before sending */\n request: z.object({\n /** Header transformations (key-value additions) */\n headers: z.record(z.string(), z.string()).optional().describe('Additional request headers'),\n /** Query parameter transformations */\n queryParams: z.record(z.string(), z.string()).optional().describe('Additional query parameters'),\n }).optional().describe('Request transformation'),\n /** Transform response data after receiving */\n response: z.object({\n /** JSONPath expression to extract data from response */\n dataPath: z.string().optional().describe('JSONPath to extract data (e.g., \"$.data.results\")'),\n /** JSONPath expression to extract total count for pagination */\n totalPath: z.string().optional().describe('JSONPath to extract total count (e.g., \"$.meta.total\")'),\n }).optional().describe('Response transformation'),\n }).optional().describe('Request/response transformation pipeline'),\n\n /** Pagination support for external data sources */\n pagination: z.object({\n /** Pagination type */\n type: z.enum(['offset', 'cursor', 'page']).default('offset').describe('Pagination type'),\n /** Page size */\n pageSize: z.number().default(100).describe('Items per page'),\n /** Maximum pages to fetch */\n maxPages: z.number().optional().describe('Maximum number of pages to fetch'),\n }).optional().describe('Pagination configuration for external data'),\n}));\n\n// Type exports\nexport type ExternalLookup = z.infer<typeof ExternalLookupSchema>;\nexport type ExternalDataSource = z.infer<typeof ExternalDataSourceSchema>;\nexport type ExternalFieldMapping = z.infer<typeof ExternalFieldMappingSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n\n/**\n * Driver Identifier\n * Can be a built-in driver or a plugin-contributed driver (e.g., \"com.vendor.snowflake\").\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const DriverType = z.string().describe('Underlying driver identifier');\n\n/**\n * Driver Definition Schema\n * Metadata describing a Database Driver.\n * Plugins use this to register new connectivity options.\n */\nexport const DriverDefinitionSchema = lazySchema(() => z.object({\n id: z.string().describe('Unique driver identifier (e.g. \"postgres\")'),\n label: z.string().describe('Display label (e.g. \"PostgreSQL\")'),\n description: z.string().optional(),\n icon: z.string().optional(),\n \n /**\n * Configuration Schema (JSON Schema)\n * Describes the structure of the `config` object needed for this driver.\n * Used by the UI to generate the connection form.\n */\n configSchema: z.record(z.string(), z.unknown()).describe('JSON Schema for connection configuration'),\n \n /**\n * Default Capabilities\n * What this driver supports out-of-the-box.\n */\n capabilities: z.lazy(() => DatasourceCapabilities).optional(),\n}));\n\n/**\n * Datasource Capabilities Schema\n * Declares what this datasource naturally supports.\n * The ObjectQL engine uses this to determine what logic to push down\n * and what to compute in memory.\n */\nexport const DatasourceCapabilities = z.object({\n // ============================================================================\n // Transaction & Connection Management\n // ============================================================================\n \n /** Can handle ACID transactions? */\n transactions: z.boolean().default(false),\n \n // ============================================================================\n // Query Operations\n // ============================================================================\n \n /** Can execute WHERE clause filters natively? */\n queryFilters: z.boolean().default(false),\n \n /** Can perform aggregation (group by, sum, avg)? */\n queryAggregations: z.boolean().default(false),\n \n /** Can perform ORDER BY sorting? */\n querySorting: z.boolean().default(false),\n \n /** Can perform LIMIT/OFFSET pagination? */\n queryPagination: z.boolean().default(false),\n \n /** Can perform window functions? */\n queryWindowFunctions: z.boolean().default(false),\n \n /** Can perform subqueries? */\n querySubqueries: z.boolean().default(false),\n \n /** Can execute SQL-like joins natively? */\n joins: z.boolean().default(false),\n \n // ============================================================================\n // Advanced Features\n // ============================================================================\n \n /** Can perform full-text search? */\n fullTextSearch: z.boolean().default(false),\n \n /** Is read-only? */\n readOnly: z.boolean().default(false),\n \n /** Is scheme-less (needs schema inference)? */\n dynamicSchema: z.boolean().default(false),\n});\n\n/**\n * Schema Ownership Mode (ADR-0015)\n *\n * Distinguishes \"ObjectStack owns this schema\" from \"this is somebody\n * else's production database — never touch DDL\". Gates migrations,\n * boot-time validation, and writes.\n *\n * - `managed` — ObjectStack owns the schema: DDL + migrations allowed.\n * - `external` — Mature external DB: DDL forbidden; mismatch fails boot.\n * - `validate-only` — Like `external`, but mismatches warn instead of fail.\n */\nexport const SchemaModeSchema = z\n .enum(['managed', 'external', 'validate-only'])\n .describe('Schema ownership mode');\n\nexport type SchemaMode = z.infer<typeof SchemaModeSchema>;\n\n/**\n * External Datasource Settings (ADR-0015)\n *\n * Present only when `schemaMode !== 'managed'`. Carries the federation\n * policy for a mature external database: write gating, schema whitelist,\n * boot/drift validation behaviour, credentials reference, and query caps.\n */\nexport const ExternalDatasourceSettingsSchema = z.object({\n label: z.string().optional()\n .describe('Display label, e.g. \"Snowflake — ANALYTICS / PROD\"'),\n allowedSchemas: z.array(z.string()).optional()\n .describe('Whitelist of remote schemas/databases that may be exposed.'),\n allowWrites: z.boolean().default(false)\n .describe('Global write gate. Individual objects must also opt in via object.external.writable.'),\n validation: z.object({\n onMismatch: z.enum(['fail', 'warn', 'ignore']).default('fail')\n .describe('What to do when a federated object diverges from the remote table.'),\n checkOnBoot: z.boolean().default(true)\n .describe('Validate federated objects against the remote schema at boot.'),\n checkIntervalMs: z.number().optional()\n .describe('Optional background drift-check interval in milliseconds.'),\n }).default({ onMismatch: 'fail', checkOnBoot: true }).describe('Boot/drift validation policy'),\n credentialsRef: z.string().optional()\n .describe('Reference into the secrets store; never inline credentials.'),\n queryTimeoutMs: z.number().default(30_000)\n .describe('Hard cap on per-query execution time.'),\n requirePermission: z.string().optional()\n .describe('Optional convenience: gate the entire datasource behind a single role.'),\n}).describe('External datasource federation settings (schemaMode != \"managed\")');\n\nexport type ExternalDatasourceSettings = z.infer<typeof ExternalDatasourceSettingsSchema>;\n\n/**\n * Datasource Schema\n * Represents a connection to an external data store.\n */\nexport const DatasourceSchema = lazySchema(() => z.object({\n /** Machine Name */\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Unique datasource identifier'),\n \n /** Human Label */\n label: z.string().optional().describe('Display label'),\n \n /** Driver */\n driver: DriverType.describe('Underlying driver type'),\n \n /** \n * Connection Configuration \n * Specific to the driver (e.g., host, port, user, password, bucket, etc.)\n * Stored securely (passwords usually interpolated from ENV).\n */\n config: z.record(z.string(), z.unknown()).describe('Driver specific configuration'),\n \n /**\n * Connection Pool Configuration\n * Standard connection pooling settings.\n */\n pool: z.object({\n min: z.number().default(0).describe('Minimum connections'),\n max: z.number().default(10).describe('Maximum connections'),\n idleTimeoutMillis: z.number().default(30000).describe('Idle timeout'),\n connectionTimeoutMillis: z.number().default(3000).describe('Connection establishment timeout'),\n }).optional().describe('Connection pool settings'),\n\n /**\n * Read Replicas\n * Optional list of duplicate configurations for read-only operations.\n * Useful for scaling read throughput.\n */\n readReplicas: z.array(z.record(z.string(), z.unknown())).optional().describe('Read-only replica configurations'),\n\n /**\n * Capability Overrides\n * Manually override what the driver claims to support.\n */\n capabilities: DatasourceCapabilities.optional().describe('Capability overrides'),\n \n /** Health Check */\n healthCheck: z.object({\n enabled: z.boolean().default(true).describe('Enable health check endpoint'),\n intervalMs: z.number().default(30000).describe('Health check interval in milliseconds'),\n timeoutMs: z.number().default(5000).describe('Health check timeout in milliseconds'),\n }).optional().describe('Datasource health check configuration'),\n\n /** SSL/TLS Configuration */\n ssl: z.object({\n enabled: z.boolean().default(false).describe('Enable SSL/TLS for database connection'),\n rejectUnauthorized: z.boolean().default(true).describe('Reject connections with invalid/self-signed certificates'),\n ca: z.string().optional().describe('CA certificate (PEM format or path to file)'),\n cert: z.string().optional().describe('Client certificate (PEM format or path to file)'),\n key: z.string().optional().describe('Client private key (PEM format or path to file)'),\n }).optional().describe('SSL/TLS configuration for secure database connections'),\n\n /** Retry Policy */\n retryPolicy: z.object({\n maxRetries: z.number().default(3).describe('Maximum number of retry attempts'),\n baseDelayMs: z.number().default(1000).describe('Base delay between retries in milliseconds'),\n maxDelayMs: z.number().default(30000).describe('Maximum delay between retries in milliseconds'),\n backoffMultiplier: z.number().default(2).describe('Exponential backoff multiplier'),\n }).optional().describe('Connection retry policy for transient failures'),\n\n /** Description */\n description: z.string().optional().describe('Internal description'),\n \n /** Is enabled? */\n active: z.boolean().default(true).describe('Is datasource enabled'),\n\n /**\n * Auto-connect opt-in (ADR-0062 D2(c)).\n *\n * Forces the runtime to build a live driver for this datasource at boot even\n * when it is `managed` and nothing routes to it. By default a declared\n * datasource only auto-connects when it is `external` or an object explicitly\n * binds to it via `object.datasource` (see ADR-0062 D2). Set this to opt a\n * managed, unrouted datasource into the live-connection lifecycle.\n */\n autoConnect: z.boolean().default(false)\n .describe('Force a live driver connection at boot even when managed + unrouted (ADR-0062 D2).'),\n\n /**\n * Schema Ownership Mode (ADR-0015)\n * Declares whether ObjectStack owns this schema (`managed`, default) or\n * is a guest in a mature external database (`external` / `validate-only`).\n */\n schemaMode: SchemaModeSchema.default('managed'),\n\n /**\n * External Federation Settings (ADR-0015)\n * Required when `schemaMode !== 'managed'`; forbidden otherwise.\n */\n external: ExternalDatasourceSettingsSchema.optional(),\n\n /**\n * Provenance (ADR-0015 Addendum)\n *\n * Server-managed, read-only. Distinguishes code-defined datasources\n * (`code` — authored as `*.datasource.ts`, GitOps-owned, read-only in the\n * UI) from runtime datasources (`runtime` — created via the Studio wizard,\n * persisted in the runtime metadata store, environment-scoped, editable).\n *\n * Never accepted from client input: the runtime stamps `code` on artefact\n * load and `runtime` on UI create. Defaults to `code` for artefact-defined\n * datasources that predate this field.\n */\n origin: z.enum(['code', 'runtime']).default('code')\n .describe('Datasource provenance (server-managed, read-only)'),\n}).superRefine((ds, ctx) => {\n if (ds.schemaMode !== 'managed' && !ds.external) {\n ctx.addIssue({\n code: 'custom',\n path: ['external'],\n message: `schemaMode='${ds.schemaMode}' requires 'external' settings.`,\n });\n }\n if (ds.schemaMode === 'managed' && ds.external) {\n ctx.addIssue({\n code: 'custom',\n path: ['external'],\n message: `'external' settings only apply when schemaMode != 'managed'.`,\n });\n }\n}));\n\nexport type Datasource = z.infer<typeof DatasourceSchema>;\n/** Authoring input for {@link Datasource} — defaulted fields are optional. */\nexport type DatasourceInput = z.input<typeof DatasourceSchema>;\nexport type DatasourceCapabilitiesType = z.infer<typeof DatasourceCapabilities>;\n\n/**\n * Type-safe factory for an external data connection (datasource). Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: Datasource` literal.\n */\nexport function defineDatasource(config: z.input<typeof DatasourceSchema>): Datasource {\n return DatasourceSchema.parse(config);\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * SQL ⇆ ObjectStack field-type compatibility matrix (ADR-0015 §4.6).\n *\n * A pure, dialect-aware module mapping remote SQL column types\n * (`text`, `varchar(255)`, `numeric(10,2)`, `timestamptz`, `jsonb`, …) to\n * ObjectStack field types, and answering \"can this remote column back this\n * field type?\". Used by `IExternalDatasourceService`:\n *\n * - `generateObjectDraft` → {@link suggestFieldType} to draft `*.object.ts`.\n * - `validateObject` → {@link isCompatible} to diff a declared field\n * against the remote column.\n *\n * No I/O, no driver coupling — operates on raw type strings so it can be\n * unit-tested independently and extended per dialect without touching the\n * runtime.\n */\n\nimport type { FieldType } from './field.zod';\n\n/** SQL dialects whose type vocabularies the matrix understands. */\nexport type SqlDialect =\n | 'postgres'\n | 'mysql'\n | 'sqlite'\n | 'snowflake'\n | 'bigquery'\n | 'mongo';\n\n/**\n * Result of a compatibility check:\n * - `true` — exact / safe mapping.\n * - `'lossy'`— usable but information may be lost (e.g. `jsonb` → `text`,\n * `numeric(38,0)` → JS `number`). Generated drafts flag these `// REVIEW:`.\n * - `false` — incompatible; the validator emits a `type_mismatch` diff.\n */\nexport type Compatibility = boolean | 'lossy';\n\n/**\n * Canonical \"base\" SQL type after stripping parameters/qualifiers and\n * applying dialect aliases. Internal vocabulary the matrix is keyed on.\n */\ntype CanonicalSqlType =\n | 'text'\n | 'integer'\n | 'bigint'\n | 'decimal'\n | 'float'\n | 'boolean'\n | 'date'\n | 'time'\n | 'datetime'\n | 'json'\n | 'uuid'\n | 'binary'\n | 'enum'\n | 'array'\n | 'vector'\n | 'unknown';\n\n/**\n * Per-dialect aliases mapping vendor type names to a {@link CanonicalSqlType}.\n * Only entries that differ from the shared base map (below) need listing.\n */\nconst DIALECT_ALIASES: Partial<Record<SqlDialect, Record<string, CanonicalSqlType>>> = {\n postgres: {\n int2: 'integer', int4: 'integer', int8: 'bigint', serial: 'integer', bigserial: 'bigint',\n float4: 'float', float8: 'float', numeric: 'decimal', bool: 'boolean',\n timestamptz: 'datetime', timestamp: 'datetime', timetz: 'time',\n jsonb: 'json', json: 'json', uuid: 'uuid', bytea: 'binary', bpchar: 'text',\n citext: 'text', vector: 'vector',\n },\n mysql: {\n tinyint: 'integer', smallint: 'integer', mediumint: 'integer', int: 'integer',\n bigint: 'bigint', double: 'float', real: 'float', decimal: 'decimal',\n datetime: 'datetime', timestamp: 'datetime', tinytext: 'text', mediumtext: 'text',\n longtext: 'text', json: 'json', blob: 'binary', longblob: 'binary', enum: 'enum',\n },\n sqlite: {\n integer: 'integer', int: 'integer', real: 'float', numeric: 'decimal',\n text: 'text', blob: 'binary',\n },\n snowflake: {\n number: 'decimal', int: 'integer', integer: 'integer', bigint: 'bigint',\n float: 'float', double: 'float', string: 'text', varchar: 'text', variant: 'json',\n object: 'json', array: 'array', boolean: 'boolean', timestamp_ntz: 'datetime',\n timestamp_tz: 'datetime', timestamp_ltz: 'datetime', binary: 'binary',\n },\n bigquery: {\n int64: 'bigint', float64: 'float', numeric: 'decimal', bignumeric: 'decimal',\n string: 'text', bytes: 'binary', bool: 'boolean', boolean: 'boolean',\n timestamp: 'datetime', datetime: 'datetime', struct: 'json', json: 'json',\n array: 'array', record: 'json',\n },\n mongo: {\n objectid: 'text', string: 'text', double: 'float', int: 'integer', long: 'bigint',\n decimal: 'decimal', bool: 'boolean', boolean: 'boolean', date: 'datetime',\n object: 'json', array: 'array', bindata: 'binary',\n },\n};\n\n/**\n * Dialect-agnostic base map of common ANSI/SQL type names to canonical types.\n * Consulted after dialect aliases.\n */\nconst BASE_ALIASES: Record<string, CanonicalSqlType> = {\n text: 'text', varchar: 'text', char: 'text', character: 'text', string: 'text',\n 'character varying': 'text', nvarchar: 'text', nchar: 'text', clob: 'text',\n integer: 'integer', int: 'integer', smallint: 'integer', tinyint: 'integer',\n bigint: 'bigint',\n decimal: 'decimal', numeric: 'decimal', number: 'decimal', money: 'decimal',\n float: 'float', double: 'float', 'double precision': 'float', real: 'float',\n boolean: 'boolean', bool: 'boolean', bit: 'boolean',\n date: 'date',\n time: 'time',\n datetime: 'datetime', timestamp: 'datetime',\n json: 'json', jsonb: 'json',\n uuid: 'uuid', guid: 'uuid',\n binary: 'binary', varbinary: 'binary', blob: 'binary', bytes: 'binary',\n enum: 'enum',\n array: 'array',\n vector: 'vector',\n};\n\n/**\n * For each canonical SQL type: the suggested ObjectStack field type plus the\n * set of field types it is exactly / lossily compatible with.\n */\nconst CANONICAL_TO_FIELD: Record<\n CanonicalSqlType,\n { suggested: FieldType; exact: FieldType[]; lossy: FieldType[] }\n> = {\n text: { suggested: 'text', exact: ['text', 'textarea', 'email', 'url', 'phone', 'markdown', 'html', 'richtext', 'code', 'select', 'color'], lossy: [] },\n integer: { suggested: 'number', exact: ['number', 'autonumber', 'rating', 'percent'], lossy: ['currency', 'boolean'] },\n bigint: { suggested: 'number', exact: ['number', 'autonumber'], lossy: ['currency'] },\n decimal: { suggested: 'number', exact: ['number', 'currency', 'percent'], lossy: ['rating'] },\n float: { suggested: 'number', exact: ['number', 'currency', 'percent', 'slider'], lossy: [] },\n boolean: { suggested: 'boolean', exact: ['boolean', 'toggle'], lossy: [] },\n date: { suggested: 'date', exact: ['date'], lossy: ['datetime'] },\n time: { suggested: 'time', exact: ['time'], lossy: [] },\n datetime: { suggested: 'datetime', exact: ['datetime'], lossy: ['date'] },\n json: { suggested: 'json', exact: ['json', 'composite', 'repeater', 'record', 'location', 'address', 'tags', 'multiselect'], lossy: ['text'] },\n uuid: { suggested: 'text', exact: ['text', 'lookup', 'master_detail', 'user'], lossy: [] },\n binary: { suggested: 'file', exact: ['file', 'image', 'signature'], lossy: ['text'] },\n enum: { suggested: 'select', exact: ['select', 'radio', 'text'], lossy: [] },\n array: { suggested: 'multiselect', exact: ['multiselect', 'checkboxes', 'tags', 'json'], lossy: ['text'] },\n vector: { suggested: 'vector', exact: ['vector'], lossy: ['json'] },\n unknown: { suggested: 'text', exact: [], lossy: ['text', 'json'] },\n};\n\n/**\n * Reduce a raw SQL type string to its canonical form.\n *\n * Strips length/precision (`varchar(255)` → `varchar`), array suffixes\n * (`text[]` → array), and qualifiers (`timestamp without time zone` →\n * `timestamp`), then applies dialect aliases, then the base map.\n */\nexport function canonicalizeSqlType(rawType: string, dialect?: SqlDialect): CanonicalSqlType {\n if (!rawType) return 'unknown';\n let t = rawType.trim().toLowerCase();\n\n // Postgres / generic array notation: `text[]`, `_int4`.\n const isArray = t.endsWith('[]') || t.startsWith('_');\n if (isArray) return 'array';\n\n // Drop precision/length: `numeric(10,2)` → `numeric`, `varchar(255)` →\n // `varchar`. Linear substring slice (no regex backtracking).\n const paren = t.indexOf('(');\n if (paren !== -1) t = t.slice(0, paren).trim();\n\n // Normalise common trailing qualifiers using literal, anchored suffix\n // checks — avoids polynomial-backtracking regexes on uncontrolled input.\n for (const suffix of [' without time zone', ' with time zone', ' unsigned', ' signed']) {\n if (t.endsWith(suffix)) {\n t = t.slice(0, t.length - suffix.length).trim();\n break;\n }\n }\n\n // `timestamp with time zone` collapsed to `timestamp` above; `timestamptz`\n // handled via alias.\n const dialectMap = dialect ? DIALECT_ALIASES[dialect] : undefined;\n if (dialectMap && dialectMap[t]) return dialectMap[t];\n if (BASE_ALIASES[t]) return BASE_ALIASES[t];\n\n // `timestamp with time zone` may survive as `timestamp` already mapped;\n // anything else is unknown.\n return 'unknown';\n}\n\n/**\n * The ObjectStack field type best suited to back a given remote SQL column.\n * Returns `undefined` only when the type is wholly unrecognised (the caller\n * may fall back to `text` and flag it for review).\n */\nexport function suggestFieldType(rawType: string, dialect?: SqlDialect): FieldType | undefined {\n const canonical = canonicalizeSqlType(rawType, dialect);\n if (canonical === 'unknown') return undefined;\n return CANONICAL_TO_FIELD[canonical].suggested;\n}\n\n/**\n * Whether a remote SQL column type can back the given ObjectStack field type.\n *\n * @returns `true` (exact), `'lossy'` (usable with possible loss), or `false`.\n */\nexport function isCompatible(\n rawType: string,\n fieldType: FieldType,\n dialect?: SqlDialect,\n): Compatibility {\n const canonical = canonicalizeSqlType(rawType, dialect);\n const entry = CANONICAL_TO_FIELD[canonical];\n if (entry.exact.includes(fieldType)) return true;\n if (entry.lossy.includes(fieldType)) return 'lossy';\n // Unknown remote types are permissive-but-lossy against text/json only,\n // already encoded in CANONICAL_TO_FIELD.unknown.\n return false;\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * ExternalCatalog — cached remote-schema snapshot for a federated datasource\n * (ADR-0015 §4.3).\n *\n * Introspecting a mature warehouse on every boot is expensive, so the\n * `IExternalDatasourceService.refreshCatalog` persists a snapshot of the\n * remote tables/columns as an `external_catalog` metadata record. The\n * boot-validation gate (Gate 2) and Studio's schema browser read from it;\n * drift is detected by diffing a fresh introspection against the snapshot.\n */\n\nimport { z } from 'zod';\nimport { lazySchema } from '../shared/lazy-schema';\n\n/** A single remote column captured in a catalog snapshot. */\nexport const ExternalColumnSchema = z.object({\n name: z.string().describe('Remote column name'),\n sqlType: z.string().describe('Raw remote SQL type (e.g. \"numeric(10,2)\")'),\n nullable: z.boolean().describe('Whether the remote column is nullable'),\n primaryKey: z.boolean().default(false).describe('Part of the remote primary key'),\n suggestedFieldType: z.string().optional()\n .describe('ObjectStack field type suggested by the type-compat matrix'),\n});\n\nexport type ExternalColumn = z.infer<typeof ExternalColumnSchema>;\n\n/** A single remote table/view captured in a catalog snapshot. */\nexport const ExternalTableSchema = z.object({\n remoteSchema: z.string().optional().describe('Remote schema/database qualifier'),\n remoteName: z.string().describe('Remote table/view name'),\n columns: z.array(ExternalColumnSchema).describe('Remote columns'),\n indexes: z.array(z.object({\n name: z.string(),\n columns: z.array(z.string()),\n unique: z.boolean(),\n })).optional().describe('Remote indexes, when introspectable'),\n rowCountEstimate: z.number().optional().describe('Approximate row count'),\n});\n\nexport type ExternalTable = z.infer<typeof ExternalTableSchema>;\n\n/**\n * The persisted snapshot of a federated datasource's remote schema.\n * Conventionally named `<datasource>_catalog`.\n */\nexport const ExternalCatalogSchema = lazySchema(() => z.object({\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/)\n .describe('Catalog id, conventionally `<datasource>_catalog`.'),\n datasource: z.string().describe('Datasource.name this catalog snapshots.'),\n snapshotAt: z.string().datetime().describe('When the snapshot was taken (ISO 8601).'),\n dialect: z.string().optional().describe('Remote SQL dialect, when known.'),\n tables: z.array(ExternalTableSchema).describe('Snapshotted remote tables.'),\n}));\n\nexport type ExternalCatalog = z.infer<typeof ExternalCatalogSchema>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\nimport { FilterConditionSchema } from './filter.zod';\n\n/**\n * Analytics/Semantic Layer Protocol\n * \n * Defines the \"Business Logic\" for data analysis.\n * Inspired by Cube.dev, LookML, and dbt MetricFlow.\n * \n * This layer decouples the \"Physical Data\" (Tables/Columns) from the \n * \"Business Data\" (Metrics/Dimensions).\n */\n\n/**\n * Aggregation Metric Type\n * The mathematical operation to perform on a metric.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const AggregationMetricType = z.enum([\n 'count', \n 'sum', \n 'avg', \n 'min', \n 'max', \n 'count_distinct', \n 'number', // Custom SQL expression returning a number\n 'string', // Custom SQL expression returning a string\n 'boolean' // Custom SQL expression returning a boolean\n]);\n\n/**\n * Dimension Type\n * The nature of the grouping field.\n */\nexport const DimensionType = z.enum([\n 'string', \n 'number', \n 'boolean', \n 'time', \n 'geo'\n]);\n\n/**\n * Time Interval for Time Dimensions\n */\nexport const TimeUpdateInterval = z.enum([\n 'second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'\n]);\n\n/**\n * Metric Schema\n * A quantitative measurement (e.g., \"Total Revenue\", \"Average Order Value\").\n */\nexport const MetricSchema = lazySchema(() => z.object({\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Unique metric ID'),\n label: z.string().describe('Human readable label'),\n description: z.string().optional(),\n \n type: AggregationMetricType,\n \n /** Source Calculation */\n sql: z.string().describe('SQL expression or field reference'),\n \n /** Filtering for this specific metric (e.g. \"Revenue from Premium Users\") */\n filters: z.array(z.object({\n sql: z.string()\n })).optional(),\n \n /** Format for display (e.g. \"currency\", \"percent\") */\n format: z.string().optional(),\n}));\n\n/**\n * Dimension Schema\n * A categorical attribute to group by (e.g., \"Product Category\", \"Order Date\").\n */\nexport const DimensionSchema = lazySchema(() => z.object({\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Unique dimension ID'),\n label: z.string().describe('Human readable label'),\n description: z.string().optional(),\n \n type: DimensionType,\n \n /** Source Column */\n sql: z.string().describe('SQL expression or column reference'),\n \n /** For Time Dimensions: Supported Granularities */\n granularities: z.array(TimeUpdateInterval).optional(),\n}));\n\n/**\n * Join Schema\n * Defines how this cube relates to others.\n */\nexport const CubeJoinSchema = lazySchema(() => z.object({\n name: z.string().describe('Target cube name'),\n relationship: z.enum(['one_to_one', 'one_to_many', 'many_to_one']).default('many_to_one'),\n sql: z.string().describe('Join condition (ON clause)'),\n}));\n\n/**\n * Cube Schema\n * A logical data model representing a business entity or process for analysis.\n * Maps physical tables to business metrics and dimensions.\n */\nexport const CubeSchema = lazySchema(() => z.object({\n name: z.string().regex(/^[a-z_][a-z0-9_]*$/).describe('Cube name (snake_case)'),\n title: z.string().optional(),\n description: z.string().optional(),\n \n /** Physical Data Source */\n sql: z.string().describe('Base SQL statement or Table Name'),\n \n /** Semantic Definitions */\n measures: z.record(z.string(), MetricSchema).describe('Quantitative metrics'),\n dimensions: z.record(z.string(), DimensionSchema).describe('Qualitative attributes'),\n \n /** Relationships */\n joins: z.record(z.string(), CubeJoinSchema).optional(),\n \n /** Pre-aggregations / Caching */\n refreshKey: z.object({\n every: z.string().optional(), // e.g. \"1 hour\"\n sql: z.string().optional(), // SQL to check for data changes\n }).optional(),\n \n /** Access Control */\n public: z.boolean().default(false),\n}));\n\n/**\n * Analytics Query Schema\n * The request format for the Analytics API.\n */\nexport const AnalyticsQuerySchema = lazySchema(() => z.object({\n cube: z.string().optional().describe('Target cube name (optional when provided externally, e.g. in API request wrapper)'),\n measures: z.array(z.string()).describe('List of metrics to calculate'),\n dimensions: z.array(z.string()).optional().describe('List of dimensions to group by'),\n\n /**\n * WHERE clause — canonical filter shape per the unified Query DSL\n * (see {@link FilterConditionSchema} in `data/filter.zod.ts` and\n * {@link QuerySchema} in `data/query.zod.ts`). This is the same\n * MongoDB-style filter used by `find()`, dashboard widget `filter`,\n * RLS conditions, etc.\n *\n * @example\n * ```ts\n * { where: { is_active: true, stage: { $nin: ['lost'] } } }\n * ```\n */\n where: FilterConditionSchema.optional().describe('Filtering criteria (canonical Query DSL FilterCondition)'),\n\n timeDimensions: z.array(z.object({\n dimension: z.string(),\n granularity: TimeUpdateInterval.optional(),\n dateRange: z.union([\n z.string(), // \"Last 7 days\"\n z.array(z.string()) // [\"2023-01-01\", \"2023-01-31\"]\n ]).optional(),\n })).optional(),\n\n order: z.record(z.string(), z.enum(['asc', 'desc'])).optional(),\n\n limit: z.number().optional(),\n offset: z.number().optional(),\n\n timezone: z.string().optional().default('UTC'),\n}));\n\nexport type Metric = z.infer<typeof MetricSchema>;\nexport type Dimension = z.infer<typeof DimensionSchema>;\nexport type CubeJoin = z.infer<typeof CubeJoinSchema>;\nexport type Cube = z.infer<typeof CubeSchema>;\n/** Authoring input for {@link Cube} — defaulted fields are optional. */\nexport type CubeInput = z.input<typeof CubeSchema>;\n\n/**\n * Type-safe factory for an analytics semantic-layer cube. Validates at authoring time via\n * `.parse()` and accepts input-shape config (optional defaults, CEL\n * shorthand) — preferred over a bare `: Cube` literal.\n */\nexport function defineCube(config: z.input<typeof CubeSchema>): Cube {\n return CubeSchema.parse(config);\n}\nexport type AnalyticsQuery = z.infer<typeof AnalyticsQuerySchema>;\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * Field → aggregation semantics. The single source of truth for \"how should a\n * numeric field be aggregated into a measure\", shared by authoring (dataset\n * derivation) and validation (build-time coherence checks) so the two cannot\n * drift.\n *\n * The motivating defect: additive amounts (currency/number) SUM correctly, but\n * a RATE — a `percent` field such as a win-probability or conversion rate — must\n * AVG. Summing percentages is meaningless: the total routinely exceeds 100%.\n */\n\n/** Numeric field types that can back a value measure. */\nexport const MEASURE_FIELD_TYPES: ReadonlySet<string> = new Set(['number', 'currency', 'percent']);\n\n/**\n * The aggregation a derived value measure should use for a field of this type:\n * rates (`percent`) AVG, every other additive amount SUMs.\n */\nexport function defaultAggregateFor(fieldType: string | undefined): 'sum' | 'avg' {\n return fieldType === 'percent' ? 'avg' : 'sum';\n}\n\n/**\n * Is applying `aggregate` to a field of `fieldType` semantically incoherent?\n * True only for cases that produce a meaningless number — today: SUM (or\n * COUNT_DISTINCT) of a percentage/rate. Returns false when the field type is\n * unknown (cannot judge) so callers never raise a false positive.\n */\nexport function isIncoherentAggregate(aggregate: string, fieldType: string | undefined): boolean {\n if (fieldType === 'percent' && (aggregate === 'sum' || aggregate === 'count_distinct')) return true;\n return false;\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * ADR-0079 — Record display-name contract.\n *\n * A record's human title is a STRUCTURAL INVARIANT: every object has exactly one\n * primary title field, which is a real STORED field (text / autonumber / formula\n * whose result is text). This module is the single source of truth for:\n * - which field types may back a title (`isTitleEligible` / `TITLE_ELIGIBLE`),\n * - how the primary title field is resolved (`resolveDisplayField`) — explicit\n * pointer first (`nameField`, then the deprecated `displayNameField` alias),\n * then a deterministic derivation,\n * - how a single record's display name is rendered (`resolveRecordDisplayName`)\n * with a stable `Record #<id>` floor — NEVER a bare \"Untitled\",\n * - a pure transform that GUARANTEES a primary exists (`provisionPrimary`),\n * - and a completeness classifier for lint/quality reporting\n * (`objectTitleCompleteness`).\n *\n * Pure + framework-agnostic (no Zod, no engine). Shared by authoring, the\n * approval/notification display-enrichment path, objectql search field\n * resolution, and build-time lint.\n *\n * NOTE on the schema: `nameField` is the canonical pointer (pairs with\n * `recordName` — the Salesforce Name/Record-Name model). `displayNameField` is\n * accepted as a DEPRECATED ALIAS at the schema level (mapped onto `nameField`).\n * Both are still read here so this resolver works against metadata that has not\n * yet been normalized.\n */\n\n/**\n * Minimal structural shape of a field definition this module needs to judge\n * title-eligibility. Intentionally loose — callers pass `Data.Field`,\n * `sys_metadata` rows, or hand-built fakes.\n */\nexport interface TitleEligibleFieldDef {\n type?: string;\n /**\n * For `formula` fields: the declared result type. The framework field schema\n * carries this as `returnType` (number/text/boolean/date); `valueType` is also\n * accepted for forward/cross-repo compatibility. A formula is title-eligible\n * ONLY when this is `text`.\n */\n returnType?: string;\n valueType?: string;\n [k: string]: unknown;\n}\n\n/**\n * Minimal structural shape of an object's metadata this module reads.\n * `fields` is a name-keyed map (declaration order = `Object.keys` order, which\n * the framework preserves for the `record` field type and object materialization).\n */\nexport interface DisplayNameObjectMeta {\n /** Canonical primary-title pointer (ADR-0079). */\n nameField?: string;\n /** Deprecated alias for `nameField`; still honored as a fallback. */\n displayNameField?: string;\n fields?: Record<string, TitleEligibleFieldDef> | undefined;\n [k: string]: unknown;\n}\n\n/**\n * Field types that are NEVER a record title — they carry no human-readable\n * short label (dates, numbers, booleans, media, structured/relational values,\n * choice tokens, and system/auto values). `autonumber` is excluded from\n * *derivation* here: an autonumber is a valid primary only when an author\n * points at it explicitly (it pairs with `recordName.type='autonumber'`), not\n * something we silently pick. `formula` is conditionally eligible — see\n * `isTitleEligible`.\n *\n * `phone` is deliberately excluded (a phone number is not a title); `email` IS\n * eligible (commonly the human handle on identity-ish objects).\n */\nexport const TITLE_INELIGIBLE_TYPES: ReadonlySet<string> = new Set([\n // Date & time\n 'date', 'datetime', 'time',\n // Numbers\n 'number', 'currency', 'percent',\n // Logic\n 'boolean', 'toggle',\n // Media / files / attachments\n 'file', 'image', 'avatar', 'video', 'audio', 'attachment', 'signature', 'qrcode',\n // Structured / untyped\n 'json', 'code', 'composite', 'repeater', 'record', 'address', 'vector',\n // Geo\n 'geolocation', 'location',\n // Choice tokens (machine values, not titles)\n 'select', 'multiselect', 'multi_select', 'radio', 'checkboxes', 'checkbox', 'tags', 'color', 'rating', 'slider', 'progress',\n // Relational\n 'lookup', 'master_detail', 'tree', 'user',\n // System / auto / derived\n 'autonumber', 'password', 'secret',\n // Phone is not a title (email IS — handled in the eligible set)\n 'phone',\n]);\n\n/**\n * Text-ish field types that ARE title-eligible. Used as a positive allowlist so\n * an UNKNOWN/new field type does not accidentally become a title (fail-closed).\n * `formula` is handled separately (eligible only when its result type is text).\n */\nexport const TITLE_ELIGIBLE_TYPES: ReadonlySet<string> = new Set([\n 'text', 'textarea', 'email', 'url', 'markdown', 'html', 'richtext',\n]);\n\n/**\n * Convenience alias for `TITLE_ELIGIBLE_TYPES` named in ADR-0079 as the\n * `TITLE_ELIGIBLE` rule.\n */\nexport const TITLE_ELIGIBLE = TITLE_ELIGIBLE_TYPES;\n\n/**\n * Is `fieldDef` a field that can back a record's human title?\n *\n * Eligible: text-ish types (`text`, `textarea`, `email`, `url`, `markdown`,\n * `html`, `richtext`) and a `formula` whose result type (`returnType`, or\n * `valueType`) is `text`. Everything else — explicitly the\n * {@link TITLE_INELIGIBLE_TYPES} set — is ineligible. Unknown types are\n * ineligible (fail-closed against the positive allowlist).\n */\nexport function isTitleEligible(fieldDef: TitleEligibleFieldDef | undefined | null): boolean {\n if (!fieldDef) return false;\n const type = fieldDef.type;\n if (!type) return false;\n if (type === 'formula') {\n const rt = fieldDef.returnType ?? fieldDef.valueType;\n return rt === 'text';\n }\n if (TITLE_INELIGIBLE_TYPES.has(type)) return false;\n return TITLE_ELIGIBLE_TYPES.has(type);\n}\n\n/** Exact name-ish field names (case-insensitive), highest derivation priority. */\nconst NAME_ISH_EXACT: ReadonlySet<string> = new Set([\n 'name', 'title', 'subject', 'label', 'full_name', 'display_name',\n]);\n\n/** Affix tokens that make a field name \"name-ish\" (e.g. `first_name`, `job_title`, `name_en`). */\nconst NAME_ISH_AFFIX_SUFFIX = ['_name', '_title'];\nconst NAME_ISH_AFFIX_PREFIX = ['name_'];\n\nfunction isNameIshExact(fieldName: string): boolean {\n return NAME_ISH_EXACT.has(fieldName.toLowerCase());\n}\n\nfunction isNameIshAffix(fieldName: string): boolean {\n const lower = fieldName.toLowerCase();\n if (NAME_ISH_EXACT.has(lower)) return false; // exact handled at a higher tier\n return (\n NAME_ISH_AFFIX_SUFFIX.some((s) => lower.endsWith(s)) ||\n NAME_ISH_AFFIX_PREFIX.some((p) => lower.startsWith(p))\n );\n}\n\n/**\n * Derive the title field from the object's fields when no explicit pointer is\n * set. Ranking (highest first), restricted to title-eligible fields:\n * 1. name-ish EXACT — `name`/`title`/`subject`/`label`/`full_name`/`display_name`\n * 2. name-ish AFFIX — `*_name` / `*_title` / `name_*`\n * 3. first title-eligible field by declaration order\n * Returns `undefined` when no field is title-eligible.\n */\nfunction deriveDisplayField(fields: Record<string, TitleEligibleFieldDef> | undefined): string | undefined {\n if (!fields) return undefined;\n const names = Object.keys(fields);\n\n // Tier 1: name-ish exact, in the EXACT priority order (name > title > subject > …)\n // so `name` wins over `title` when both exist, independent of declaration order.\n const exactOrder = ['name', 'title', 'subject', 'label', 'full_name', 'display_name'];\n for (const wanted of exactOrder) {\n for (const fname of names) {\n if (fname.toLowerCase() === wanted && isTitleEligible(fields[fname])) return fname;\n }\n }\n\n // Tier 2: name-ish affix, by declaration order.\n for (const fname of names) {\n if (isNameIshAffix(fname) && isTitleEligible(fields[fname])) return fname;\n }\n\n // Tier 3: first title-eligible field by declaration order.\n for (const fname of names) {\n if (!isNameIshExact(fname) && isTitleEligible(fields[fname])) return fname;\n }\n\n return undefined;\n}\n\n/**\n * Resolve the object's primary title field name:\n * `nameField` (canonical) ?? `displayNameField` (deprecated alias) ?? derived.\n *\n * An explicit pointer is honored even if it is not currently title-eligible\n * (the author asserted it; eligibility gates only DERIVATION). Returns\n * `undefined` when there is no explicit pointer and nothing derivable.\n */\nexport function resolveDisplayField(objectMeta: DisplayNameObjectMeta | undefined | null): string | undefined {\n if (!objectMeta) return undefined;\n const explicit = objectMeta.nameField ?? objectMeta.displayNameField;\n if (explicit) return explicit;\n return deriveDisplayField(objectMeta.fields);\n}\n\n/** Options for {@link resolveRecordDisplayName}. */\nexport interface ResolveRecordDisplayNameOptions {\n /**\n * A view-declared title field that OVERRIDES the object's resolved display\n * field for this render (e.g. a list view choosing a different column as the\n * row label). When set, the record's value at this field is used directly.\n */\n viewTitleField?: string;\n}\n\nfunction isEmptyish(v: unknown): boolean {\n return v == null || (typeof v === 'string' && v.trim() === '');\n}\n\n/**\n * Render a single record's human display name.\n *\n * opts.viewTitleField ? record[viewTitleField] : record[resolveDisplayField(meta)]\n *\n * Falls back to a stable `Record #<id>` floor (using `record.id` or `record._id`)\n * when the resolved value is null/empty. NEVER returns a bare \"Untitled\".\n */\nexport function resolveRecordDisplayName(\n objectMeta: DisplayNameObjectMeta | undefined | null,\n record: Record<string, unknown> | undefined | null,\n opts?: ResolveRecordDisplayNameOptions,\n): string {\n const rec = record ?? {};\n const field = opts?.viewTitleField ?? resolveDisplayField(objectMeta);\n const value = field ? (rec as Record<string, unknown>)[field] : undefined;\n if (!isEmptyish(value)) return String(value);\n const id = (rec as Record<string, unknown>).id ?? (rec as Record<string, unknown>)._id;\n return `Record #${id ?? ''}`.trimEnd();\n}\n\n/** Options for {@link provisionPrimary}. */\nexport interface ProvisionPrimaryOptions {\n /**\n * Whether to SYNTHESIZE a `name` text field when nothing is title-eligible.\n *\n * - `true` (default) — full provisioning: designate a derivable title, else\n * add a `name` text field and point `nameField` at it. GUARANTEES a primary\n * exists. This adds a column, so for an already-materialized table it is a\n * schema-migration-bearing change.\n * - `false` — DESIGNATE-ONLY: set `nameField` when a title can be\n * resolved/derived from an EXISTING field, otherwise return the object\n * unchanged (no `name` field is added, no schema change). Safe to run at the\n * object-materialization seam against title-less system tables.\n */\n synthesize?: boolean;\n}\n\n/**\n * Pure transform that provisions the object's primary title field.\n *\n * - If a title can be resolved/derived from an existing field, set `nameField`\n * to it (idempotent — a second call is a no-op).\n * - Otherwise, when `synthesize !== false` (the default), SYNTHESIZE a `name`\n * text field (added to `fields`) and set `nameField: 'name'` — GUARANTEEING a\n * primary exists. When `synthesize === false`, the object is returned\n * UNCHANGED (no field added, no schema-migration-bearing column).\n *\n * Returns a NEW object when it changes anything (does not mutate the input); in\n * designate-only mode with nothing to designate it returns the input as-is. The\n * deprecated `displayNameField` is left untouched for back-compat; `nameField`\n * becomes the authoritative pointer.\n */\nexport function provisionPrimary<T extends DisplayNameObjectMeta>(\n objectMeta: T,\n opts?: ProvisionPrimaryOptions,\n): T {\n const resolved = resolveDisplayField(objectMeta);\n if (resolved) {\n if (objectMeta.nameField === resolved) return objectMeta; // already canonical — no-op\n return { ...objectMeta, nameField: resolved };\n }\n // Nothing eligible to designate.\n if (opts?.synthesize === false) {\n // Designate-only: leave the object exactly as-is (no synthesized column,\n // no schema migration). The canonical pointer stays resolved on read.\n return objectMeta;\n }\n // Synthesize a primary `name` text field.\n const fields = { ...(objectMeta.fields ?? {}) };\n if (!fields.name) {\n fields.name = { type: 'text', label: 'Name', required: true } as TitleEligibleFieldDef;\n }\n return { ...objectMeta, fields, nameField: 'name' };\n}\n\n/** Result of {@link objectTitleCompleteness}. */\nexport interface ObjectTitleCompleteness {\n /**\n * - `explicit` — an explicit pointer (`nameField`/`displayNameField`) is set.\n * - `derived` — no explicit pointer, but a title-eligible field was derivable.\n * - `synthesized` — `nameField` points at a field NOT present in `fields`\n * (e.g. a synthesized/expected `name`); the runtime must materialize it.\n * - `none` — no pointer and nothing derivable. Lint/quality should flag.\n */\n status: 'explicit' | 'derived' | 'synthesized' | 'none';\n /** The resolved field name when one exists. */\n field?: string;\n}\n\n/**\n * Classify how an object's title is satisfied, for lint / quality reporting.\n * Does not mutate; mirrors `resolveDisplayField` precedence.\n */\nexport function objectTitleCompleteness(objectMeta: DisplayNameObjectMeta | undefined | null): ObjectTitleCompleteness {\n if (!objectMeta) return { status: 'none' };\n const explicit = objectMeta.nameField ?? objectMeta.displayNameField;\n if (explicit) {\n const present = !!objectMeta.fields && Object.prototype.hasOwnProperty.call(objectMeta.fields, explicit);\n return { status: present ? 'explicit' : 'synthesized', field: explicit };\n }\n const derived = deriveDisplayField(objectMeta.fields);\n if (derived) return { status: 'derived', field: derived };\n return { status: 'none' };\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * Field-group layout derivation — the single source of the `fieldGroups`\n * rendering semantics (ADR-0085 §5).\n *\n * An object's `fieldGroups` + each field's `Field.group` membership are a\n * cross-surface semantic role: forms, detail pages, drawers and the designer\n * all render the SAME grouping. The rules live here — a pure, dependency-free\n * helper next to the schema that defines the keys (the ADR-0078 §2\n * shared-predicate pattern) — so renderers consume one implementation instead\n * of re-deriving it (two near-identical copies in `@object-ui` predate this\n * module and are retired by it).\n *\n * Rules (per the ObjectFieldGroupSchema contract):\n * - sections come back in declared-group order;\n * - declared groups no visible field references are dropped;\n * - fields without a (declared) group collect into a trailing untitled\n * bucket, preserving field declaration order — EXCEPT audit/system\n * fields, which only surface when an author EXPLICITLY groups them\n * (explicit listing wins, same as authored page sections);\n * - hidden fields never surface;\n * - `collapse` passes through (deprecated `defaultExpanded` /\n * `collapsible`+`collapsed` aliases are honoured for pre-ADR-0085\n * metadata that reaches consumers un-normalized, e.g. bare DB rows).\n *\n * Returns `null` when grouping does not apply — no declared groups, or no\n * visible field references one — so callers fall back to their existing\n * flat/auto layout.\n */\n\n/** Collapse behaviour of a derived section (mirrors ObjectFieldGroupSchema.collapse). */\nexport type FieldGroupCollapse = 'none' | 'expanded' | 'collapsed';\n\n/** One derived section. `key` is absent on the trailing ungrouped bucket. */\nexport interface FieldGroupSection {\n /** Group machine key; i18n anchor (`…objects.{obj}._sections.{key}.label`). Absent = ungrouped bucket. */\n key?: string;\n /** Group display label (default text; i18n overrides at render time). */\n label?: string;\n /** Optional icon name declared on the group. */\n icon?: string;\n /** Optional description declared on the group. */\n description?: string;\n /** Collapse behaviour; 'none' when the group declared nothing. */\n collapse: FieldGroupCollapse;\n /** Member field NAMES in field-declaration order. Renderers resolve defs themselves. */\n fields: string[];\n}\n\n/**\n * Audit/system fields excluded from the derived UNGROUPED bucket (they carry\n * no business meaning in a default layout). A field an author explicitly\n * assigns to a group is kept. Exported so renderers filtering flat layouts\n * agree with the derivation.\n */\nexport const FIELD_GROUP_SYSTEM_FIELDS: ReadonlySet<string> = new Set([\n 'created_at', 'created_by', 'updated_at', 'updated_by',\n 'organization_id', 'tenant_id', 'is_deleted', 'deleted_at',\n]);\n\ntype AnyRec = Record<string, unknown>;\n\n/** Normalize one declared group entry; null for malformed/keyless entries. */\nfunction readGroup(g: unknown): { key: string; label?: string; icon?: string; description?: string; collapse: FieldGroupCollapse } | null {\n if (!g || typeof g !== 'object' || Array.isArray(g)) return null;\n const grp = g as AnyRec;\n if (typeof grp.key !== 'string' || grp.key.length === 0) return null;\n let collapse: FieldGroupCollapse = 'none';\n if (grp.collapse === 'expanded' || grp.collapse === 'collapsed' || grp.collapse === 'none') {\n collapse = grp.collapse;\n } else if (typeof grp.collapsible === 'boolean' || typeof grp.collapsed === 'boolean') {\n // Deprecated UI-dialect pair (pre-ADR-0085 designer metadata).\n collapse = grp.collapsed === true ? 'collapsed' : grp.collapsible === true ? 'expanded' : 'none';\n } else if (typeof grp.defaultExpanded === 'boolean') {\n // Deprecated spec flag.\n collapse = grp.defaultExpanded ? 'expanded' : 'collapsed';\n }\n return {\n key: grp.key,\n label: typeof grp.label === 'string' ? grp.label : undefined,\n icon: typeof grp.icon === 'string' ? grp.icon : undefined,\n description: typeof grp.description === 'string' ? grp.description : undefined,\n collapse,\n };\n}\n\n/**\n * Derive the grouped layout for an object definition (or any bare metadata\n * record shaped like one — the helper is deliberately tolerant of\n * un-parsed/legacy input so every consumer can call it).\n */\nexport function deriveFieldGroupLayout(def: unknown): FieldGroupSection[] | null {\n if (!def || typeof def !== 'object' || Array.isArray(def)) return null;\n const obj = def as AnyRec;\n\n const declared = (Array.isArray(obj.fieldGroups) ? obj.fieldGroups : [])\n .map(readGroup)\n .filter((g): g is NonNullable<ReturnType<typeof readGroup>> => g !== null);\n if (declared.length === 0) return null;\n\n const declaredKeys = new Set(declared.map((g) => g.key));\n const fields = (obj.fields && typeof obj.fields === 'object' && !Array.isArray(obj.fields))\n ? (obj.fields as Record<string, AnyRec | undefined>)\n : {};\n\n const buckets = new Map<string, string[]>();\n for (const g of declared) buckets.set(g.key, []);\n const ungrouped: string[] = [];\n let anyGrouped = false;\n for (const [name, f] of Object.entries(fields)) {\n if (f?.hidden === true) continue;\n const g = typeof f?.group === 'string' && declaredKeys.has(f.group) ? (f.group as string) : null;\n if (g) {\n buckets.get(g)!.push(name);\n anyGrouped = true;\n } else if (!FIELD_GROUP_SYSTEM_FIELDS.has(name)) {\n ungrouped.push(name);\n }\n }\n // No visible field references a declared group → grouping doesn't apply.\n if (!anyGrouped) return null;\n\n const sections: FieldGroupSection[] = [];\n for (const g of declared) {\n const names = buckets.get(g.key)!;\n if (names.length === 0) continue; // declared-but-empty groups are dropped\n sections.push({\n key: g.key,\n label: g.label ?? g.key,\n ...(g.icon !== undefined ? { icon: g.icon } : {}),\n ...(g.description !== undefined ? { description: g.description } : {}),\n collapse: g.collapse,\n fields: names,\n });\n }\n // Trailing untitled bucket: ungrouped fields render flat (no key/label →\n // renderers show no card chrome) after the declared groups.\n if (ungrouped.length > 0) {\n sections.push({ collapse: 'none', fields: ungrouped });\n }\n return sections.length > 0 ? sections : null;\n}\n","// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.\n\n/**\n * Record-surface derivation — the single source for *how* an object's\n * create / edit / detail record opens by DEFAULT: a full page, or an overlay\n * (drawer / modal). ADR-0085 §5 \"one shared derivation, every surface\".\n *\n * Why this is a derivation and NOT an authored object key\n * ------------------------------------------------------\n * ADR-0085 §2's admission test rejects per-surface presentation toggles on the\n * object: modal-vs-page is not a business fact a machine cannot infer — it is\n * exactly inferable from how heavy the record is. So the platform derives a\n * sensible default here (field-heavy → full page; otherwise a side drawer),\n * and AI authors write nothing in the common case. Explicit control, when a\n * specific object genuinely needs it, is the sanctioned per-page path: an\n * assigned page. The renderer therefore uses this ONLY as the default and lets\n * an explicit form/navigation config win.\n *\n * The rule is deliberately simple and predictable (a single field-count\n * threshold + a mobile override) because an unpredictable heuristic is its own\n * kind of \"silently wrong\" for an AI-authored system.\n *\n * Pure and dependency-free, tolerant of bare/un-parsed metadata records (same\n * contract as {@link deriveFieldGroupLayout}) so every consumer can call it.\n */\n\nimport { FIELD_GROUP_SYSTEM_FIELDS } from './field-group-layout';\n\n/** The presentation surface a record's create/edit/detail opens on. */\nexport type RecordSurface = 'page' | 'modal' | 'drawer';\n\n/** Viewport hint; overlays are cramped on phones, so mobile always pages. */\nexport type RecordSurfaceViewport = 'mobile' | 'desktop';\n\nexport interface RecordSurfaceOptions {\n /** Viewport hint. `'mobile'` forces `'page'` (overlays are cramped). */\n viewport?: RecordSurfaceViewport;\n /**\n * Authorable-field count at/above which the record opens as a full page.\n * Defaults to {@link RECORD_SURFACE_PAGE_THRESHOLD}. Exposed so a host can\n * tune the break point without forking the rule.\n */\n pageThreshold?: number;\n}\n\n/**\n * Default break point: at/above this many authorable (visible, non-system)\n * fields, a record is \"heavy\" enough to warrant a full page rather than an\n * overlay. ~12 fields overflow a comfortable two-column modal; beyond it a\n * page (with its own URL, scroll and back button) reads better.\n */\nexport const RECORD_SURFACE_PAGE_THRESHOLD = 12;\n\ntype AnyRec = Record<string, unknown>;\n\n/**\n * Count the fields a user actually fills on a form: visible (not `hidden`) and\n * not an audit/system field. Mirrors the visibility rules of the field-group\n * layout so the two derivations agree on what \"the fields\" are.\n */\nexport function countAuthorableFields(def: unknown): number {\n if (!def || typeof def !== 'object' || Array.isArray(def)) return 0;\n const fields = (def as AnyRec).fields;\n if (!fields || typeof fields !== 'object' || Array.isArray(fields)) return 0;\n let n = 0;\n for (const [name, f] of Object.entries(fields as Record<string, AnyRec | undefined>)) {\n if (f?.hidden === true) continue;\n if (FIELD_GROUP_SYSTEM_FIELDS.has(name)) continue;\n n++;\n }\n return n;\n}\n\n/**\n * Derive the DEFAULT record surface for an object definition (or any bare\n * metadata record shaped like one).\n *\n * Rule:\n * - `viewport: 'mobile'` → `'page'` (overlays are cramped on phones);\n * - authorable field count ≥ threshold → `'page'` (field-heavy);\n * - otherwise → `'drawer'` (a light side overlay — the historical default).\n *\n * `'modal'` is never emitted by the heuristic; it remains in the return type\n * because an explicit form config can still select it and consumers switch on\n * the full set. Renderers must treat this as a default only — an explicit\n * `formType` / `navigation.mode` wins.\n */\nexport function deriveRecordSurface(def: unknown, opts: RecordSurfaceOptions = {}): RecordSurface {\n if (opts.viewport === 'mobile') return 'page';\n const threshold = opts.pageThreshold ?? RECORD_SURFACE_PAGE_THRESHOLD;\n if (countAuthorableFields(def) >= threshold) return 'page';\n return 'drawer';\n}\n\n/**\n * The record flow being opened. `view` shows state; the other four perform a\n * task (create/change a record). For `child-*` flows — a subtable / related-\n * list child created or edited from its PARENT's detail — pass the CHILD\n * object's def: the overlay sizes to the record being edited, while the\n * return target is always the parent (#2604 D3).\n */\nexport type RecordFlow = 'view' | 'create' | 'edit' | 'child-create' | 'child-edit';\n\n/** How the surface is mounted: a navigated route, or an overlay over the origin. */\nexport type RecordFlowContainer = 'route' | 'overlay';\n\nexport interface RecordFlowSurface {\n /**\n * `'route'` only ever for flow `'view'` (a record is shareable state —\n * deep-linkable, refresh-safe). Every task flow is an `'overlay'`: close\n * returns to the origin with its context (scroll / filters / tab) intact,\n * which is the #2604 return-flow invariant — and a create/edit URL would be\n * a false promise anyway (refresh loses the draft).\n */\n container: RecordFlowContainer;\n surface: RecordSurface;\n /** Maps onto `navigation.size` / `FormView.modalSize`; routes ignore it. */\n size: 'auto' | 'full';\n}\n\n/**\n * Derive the DEFAULT surface for a record FLOW (#2604; extends\n * {@link deriveRecordSurface}, ADR-0085 §5 \"one shared derivation\").\n *\n * Rule — the two axes are independent:\n * - how BIG (field count, via {@link deriveRecordSurface}) is unchanged;\n * - whether it ROUTES is decided by what the flow *is*: viewing a record is\n * state → route-capable; making/changing one is a task → always overlay.\n *\n * So `view` keeps the #2578 behavior verbatim (`'page'` → route), while the\n * task flows map the derived `'page'` to a FULL-SCREEN MODAL — same big\n * canvas, overlay return semantics. This mapping is why `'modal'` exists in\n * {@link RecordSurface} without the base heuristic ever emitting it.\n *\n * Like the base derivation this is a DEFAULT only: explicit `navigation.mode`\n * / `navigation.size`, `FormView.type` / `modalSize`, or an assigned page win\n * (the sanctioned per-object overrides — no new authorable key, ADR-0085 §2).\n */\nexport function deriveRecordFlowSurface(\n def: unknown,\n flow: RecordFlow,\n opts: RecordSurfaceOptions = {},\n): RecordFlowSurface {\n const surface = deriveRecordSurface(def, opts);\n if (flow === 'view') {\n return { container: surface === 'page' ? 'route' : 'overlay', surface, size: 'auto' };\n }\n // Task flows (create / edit / child-*): never a route. Field-heavy (or\n // mobile, where the base derivation says 'page') → full-screen modal.\n if (surface === 'page') return { container: 'overlay', surface: 'modal', size: 'full' };\n return { container: 'overlay', surface, size: 'auto' };\n}\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Feed Item Type\n * Unified activity types for the record timeline.\n * Covers comments, field changes, tasks, events, and system activities.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const FeedItemType = z.enum([\n 'comment',\n 'field_change',\n 'task',\n 'event',\n 'email',\n 'call',\n 'note',\n 'file',\n 'record_create',\n 'record_delete',\n 'approval',\n 'sharing',\n 'system',\n]);\nexport type FeedItemType = z.infer<typeof FeedItemType>;\n\n/**\n * Mention Schema\n * Represents an @mention within comment body text.\n */\nexport const MentionSchema = lazySchema(() => z.object({\n type: z.enum(['user', 'team', 'record']).describe('Mention target type'),\n id: z.string().describe('Target ID'),\n name: z.string().describe('Display name for rendering'),\n offset: z.number().int().min(0).describe('Character offset in body text'),\n length: z.number().int().min(1).describe('Length of mention token in body text'),\n}));\nexport type Mention = z.infer<typeof MentionSchema>;\n\n/**\n * Field Change Entry Schema\n * Represents a single field-level change within a field_change feed item.\n */\nexport const FieldChangeEntrySchema = lazySchema(() => z.object({\n field: z.string().describe('Field machine name'),\n fieldLabel: z.string().optional().describe('Field display label'),\n oldValue: z.unknown().optional().describe('Previous value'),\n newValue: z.unknown().optional().describe('New value'),\n oldDisplayValue: z.string().optional().describe('Human-readable old value'),\n newDisplayValue: z.string().optional().describe('Human-readable new value'),\n}));\nexport type FieldChangeEntry = z.infer<typeof FieldChangeEntrySchema>;\n\n/**\n * Reaction Schema\n * Represents an emoji reaction on a feed item.\n */\nexport const ReactionSchema = lazySchema(() => z.object({\n emoji: z.string().describe('Emoji character or shortcode (e.g., \"👍\", \":thumbsup:\")'),\n userIds: z.array(z.string()).describe('Users who reacted'),\n count: z.number().int().min(1).describe('Total reaction count'),\n}));\nexport type Reaction = z.infer<typeof ReactionSchema>;\n\n/**\n * Feed Actor Schema\n * Represents the actor who performed the action.\n */\nexport const FeedActorSchema = lazySchema(() => z.object({\n type: z.enum(['user', 'system', 'service', 'automation']).describe('Actor type'),\n id: z.string().describe('Actor ID'),\n name: z.string().optional().describe('Actor display name'),\n avatarUrl: z.string().url().optional().describe('Actor avatar URL'),\n source: z.string().optional().describe('Source application (e.g., \"Omni\", \"API\", \"Studio\")'),\n}));\nexport type FeedActor = z.infer<typeof FeedActorSchema>;\n\n/**\n * Feed Item Visibility\n */\nexport const FeedVisibility = z.enum(['public', 'internal', 'private']);\nexport type FeedVisibility = z.infer<typeof FeedVisibility>;\n\n/**\n * Feed Item Schema\n * A single entry in the unified activity timeline.\n *\n * @example Comment\n * {\n * id: 'feed_001',\n * type: 'comment',\n * object: 'account',\n * recordId: 'rec_123',\n * body: 'Great progress! @jane.doe can you follow up?',\n * mentions: [{ type: 'user', id: 'user_123', name: 'Jane Doe', offset: 17, length: 9 }],\n * actor: { type: 'user', id: 'user_456', name: 'John Smith' },\n * createdAt: '2026-01-15T10:30:00Z',\n * }\n *\n * @example Field Change\n * {\n * id: 'feed_002',\n * type: 'field_change',\n * object: 'account',\n * recordId: 'rec_123',\n * changes: [\n * { field: 'status', oldDisplayValue: 'New', newDisplayValue: 'Active' },\n * { field: 'region', oldDisplayValue: '', newDisplayValue: 'Asia-Pacific' },\n * ],\n * actor: { type: 'user', id: 'user_456', name: 'John Smith' },\n * createdAt: '2026-01-15T10:25:00Z',\n * }\n */\nexport const FeedItemSchema = lazySchema(() => z.object({\n /** Unique identifier */\n id: z.string().describe('Feed item ID'),\n\n /** Feed item type */\n type: FeedItemType.describe('Activity type'),\n\n /** Target record reference */\n object: z.string().describe('Object name (e.g., \"account\")'),\n recordId: z.string().describe('Record ID this feed item belongs to'),\n\n /** Actor (who performed the action) */\n actor: FeedActorSchema.describe('Who performed this action'),\n\n /** Content (for comments/notes) */\n body: z.string().optional().describe('Rich text body (Markdown supported)'),\n\n /** @Mentions */\n mentions: z.array(MentionSchema).optional().describe('Mentioned users/teams/records'),\n\n /** Field changes (for field_change type) */\n changes: z.array(FieldChangeEntrySchema).optional().describe('Field-level changes'),\n\n /** Reactions */\n reactions: z.array(ReactionSchema).optional().describe('Emoji reactions on this item'),\n\n /** Reply threading */\n parentId: z.string().optional().describe('Parent feed item ID for threaded replies'),\n replyCount: z.number().int().min(0).default(0).describe('Number of replies'),\n\n /** Pin / Star */\n pinned: z.boolean().default(false).describe('Whether the feed item is pinned to the top of the timeline'),\n pinnedAt: z.string().datetime().optional().describe('Timestamp when the item was pinned'),\n pinnedBy: z.string().optional().describe('User ID who pinned the item'),\n starred: z.boolean().default(false).describe('Whether the feed item is starred/bookmarked by the current user'),\n starredAt: z.string().datetime().optional().describe('Timestamp when the item was starred'),\n\n /** Visibility */\n visibility: FeedVisibility.default('public')\n .describe('Visibility: public (all users), internal (team only), private (author + mentioned)'),\n\n /** Timestamps */\n createdAt: z.string().datetime().describe('Creation timestamp'),\n updatedAt: z.string().datetime().optional().describe('Last update timestamp'),\n editedAt: z.string().datetime().optional().describe('When comment was last edited'),\n isEdited: z.boolean().default(false).describe('Whether comment has been edited'),\n}));\nexport type FeedItem = z.infer<typeof FeedItemSchema>;\n\n/**\n * Feed Filter Mode\n * Controls which feed item types to display in the timeline.\n */\nexport const FeedFilterMode = z.enum([\n 'all',\n 'comments_only',\n 'changes_only',\n 'tasks_only',\n]);\nexport type FeedFilterMode = z.infer<typeof FeedFilterMode>;\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport { z } from 'zod';\n\n/**\n * Subscription Event Type\n * Event types that can be subscribed to for record-level notifications.\n */\nimport { lazySchema } from '../shared/lazy-schema';\nexport const SubscriptionEventType = z.enum([\n 'comment',\n 'mention',\n 'field_change',\n 'task',\n 'approval',\n 'all',\n]);\nexport type SubscriptionEventType = z.infer<typeof SubscriptionEventType>;\n\n/**\n * Notification Channel\n * Delivery channels for record subscription notifications.\n */\nexport const NotificationChannel = z.enum([\n 'in_app',\n 'email',\n 'push',\n 'slack',\n]);\nexport type NotificationChannel = z.infer<typeof NotificationChannel>;\n\n/**\n * Record Subscription Schema\n * Defines a user's subscription to record-level notifications.\n * Enables Airtable-style bell icon for record change notifications.\n */\nexport const RecordSubscriptionSchema = lazySchema(() => z.object({\n /** Target */\n object: z.string().describe('Object name'),\n recordId: z.string().describe('Record ID'),\n\n /** Subscriber */\n userId: z.string().describe('Subscribing user ID'),\n\n /** Events to subscribe to */\n events: z.array(SubscriptionEventType)\n .default(['all'])\n .describe('Event types to receive notifications for'),\n\n /** Notification channels */\n channels: z.array(NotificationChannel)\n .default(['in_app'])\n .describe('Notification delivery channels'),\n\n /** Active */\n active: z.boolean().default(true).describe('Whether the subscription is active'),\n\n /** Timestamps */\n createdAt: z.string().datetime().describe('Subscription creation timestamp'),\n}));\nexport type RecordSubscription = z.infer<typeof RecordSubscriptionSchema>;\n"]}