@objectstack/spec 2.0.5 → 2.0.7

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 (293) hide show
  1. package/dist/ai/index.d.mts +1 -1
  2. package/dist/ai/index.d.ts +1 -1
  3. package/dist/ai/index.js +230 -3
  4. package/dist/ai/index.js.map +1 -1
  5. package/dist/ai/index.mjs +218 -3
  6. package/dist/ai/index.mjs.map +1 -1
  7. package/dist/api/index.d.mts +2 -2
  8. package/dist/api/index.d.ts +2 -2
  9. package/dist/api/index.js +3409 -2841
  10. package/dist/api/index.js.map +1 -1
  11. package/dist/api/index.mjs +3386 -2841
  12. package/dist/api/index.mjs.map +1 -1
  13. package/dist/automation/index.d.mts +1 -1
  14. package/dist/automation/index.d.ts +1 -1
  15. package/dist/contracts/index.d.mts +2 -2
  16. package/dist/contracts/index.d.ts +2 -2
  17. package/dist/contracts/index.js.map +1 -1
  18. package/dist/data/index.d.mts +2 -2
  19. package/dist/data/index.d.ts +2 -2
  20. package/dist/data/index.js +58 -1
  21. package/dist/data/index.js.map +1 -1
  22. package/dist/data/index.mjs +58 -1
  23. package/dist/data/index.mjs.map +1 -1
  24. package/dist/{driver.zod-E3C6n0W-.d.ts → driver.zod-B3Q0oLlF.d.ts} +1 -1
  25. package/dist/{driver.zod-DnOPgUGi.d.mts → driver.zod-Bf2z72WQ.d.mts} +1 -1
  26. package/dist/{index-DyawwLFZ.d.ts → index-B3C8s_DZ.d.ts} +307 -29
  27. package/dist/{index-DTCkpGMm.d.mts → index-BliYpI46.d.mts} +879 -52
  28. package/dist/{index-BbtSaxHm.d.ts → index-BpE_xfkc.d.ts} +3289 -229
  29. package/dist/{index-E1mP_eoE.d.mts → index-C3cFLYII.d.mts} +307 -29
  30. package/dist/{index-BpP0MwlW.d.ts → index-CXtgLAue.d.ts} +879 -52
  31. package/dist/{index-D-tf4nDV.d.mts → index-CYbdd-mL.d.mts} +27 -1
  32. package/dist/index-CeUUI-ym.d.mts +2102 -0
  33. package/dist/{index-BPhGHW32.d.ts → index-CfvdYFyf.d.ts} +27 -1
  34. package/dist/{index-CDN6TRx9.d.mts → index-ClHj1Tbo.d.mts} +71 -2
  35. package/dist/{index-CDN6TRx9.d.ts → index-ClHj1Tbo.d.ts} +71 -2
  36. package/dist/index-CmY8tgpL.d.ts +2102 -0
  37. package/dist/{index-DRCh2NTZ.d.mts → index-CqDMk0T6.d.mts} +3289 -229
  38. package/dist/{index-d9wYlv-g.d.ts → index-DNKiU_-x.d.mts} +684 -18
  39. package/dist/{index-d9wYlv-g.d.mts → index-DNKiU_-x.d.ts} +684 -18
  40. package/dist/{index-CisfSmuF.d.ts → index-Dm4UfDKG.d.ts} +451 -19
  41. package/dist/index-KhvhiesR.d.mts +6902 -0
  42. package/dist/{index-BV0xBoer.d.mts → index-Onf8hbkX.d.mts} +451 -19
  43. package/dist/index-OqCqQSaH.d.ts +6902 -0
  44. package/dist/index.d.mts +2519 -222
  45. package/dist/index.d.ts +2519 -222
  46. package/dist/index.js +9957 -8069
  47. package/dist/index.js.map +1 -1
  48. package/dist/index.mjs +9957 -8069
  49. package/dist/index.mjs.map +1 -1
  50. package/dist/integration/index.d.mts +1 -1
  51. package/dist/integration/index.d.ts +1 -1
  52. package/dist/integration/index.js +67 -0
  53. package/dist/integration/index.js.map +1 -1
  54. package/dist/integration/index.mjs +61 -0
  55. package/dist/integration/index.mjs.map +1 -1
  56. package/dist/kernel/index.d.mts +2 -2
  57. package/dist/kernel/index.d.ts +2 -2
  58. package/dist/kernel/index.js +1698 -1474
  59. package/dist/kernel/index.js.map +1 -1
  60. package/dist/kernel/index.mjs +1690 -1474
  61. package/dist/kernel/index.mjs.map +1 -1
  62. package/dist/{package-registry.zod-CbS9FKeH.d.mts → package-registry.zod-BJQSiICj.d.mts} +78 -43
  63. package/dist/{package-registry.zod-CbS9FKeH.d.ts → package-registry.zod-BJQSiICj.d.ts} +78 -43
  64. package/dist/security/index.d.mts +1 -1
  65. package/dist/security/index.d.ts +1 -1
  66. package/dist/security/index.js +47 -1
  67. package/dist/security/index.js.map +1 -1
  68. package/dist/security/index.mjs +45 -1
  69. package/dist/security/index.mjs.map +1 -1
  70. package/dist/system/index.d.mts +1 -1
  71. package/dist/system/index.d.ts +1 -1
  72. package/dist/system/index.js +2189 -1821
  73. package/dist/system/index.js.map +1 -1
  74. package/dist/system/index.mjs +2168 -1821
  75. package/dist/system/index.mjs.map +1 -1
  76. package/dist/ui/index.d.mts +1 -1
  77. package/dist/ui/index.d.ts +1 -1
  78. package/dist/ui/index.js +1414 -767
  79. package/dist/ui/index.js.map +1 -1
  80. package/dist/ui/index.mjs +1354 -767
  81. package/dist/ui/index.mjs.map +1 -1
  82. package/json-schema/ai/Agent.json +203 -0
  83. package/json-schema/ai/AgentCommunicationProtocol.json +9 -0
  84. package/json-schema/ai/AgentGroupMember.json +45 -0
  85. package/json-schema/ai/AgentGroupRole.json +10 -0
  86. package/json-schema/ai/DevOpsAgent.json +203 -0
  87. package/json-schema/ai/MCPClientConfig.json +168 -0
  88. package/json-schema/ai/MCPRootEntry.json +23 -0
  89. package/json-schema/ai/MCPRootsConfig.json +49 -0
  90. package/json-schema/ai/MCPSamplingConfig.json +46 -0
  91. package/json-schema/ai/MCPServerConfig.json +120 -0
  92. package/json-schema/ai/MCPStreamingConfig.json +38 -0
  93. package/json-schema/ai/MCPToolApproval.json +39 -0
  94. package/json-schema/ai/MultiAgentGroup.json +137 -0
  95. package/json-schema/ai/StructuredOutputConfig.json +75 -0
  96. package/json-schema/ai/StructuredOutputFormat.json +12 -0
  97. package/json-schema/ai/TransformPipelineStep.json +11 -0
  98. package/json-schema/api/AppDefinitionResponse.json +285 -7
  99. package/json-schema/api/BasePresence.json +40 -0
  100. package/json-schema/api/BatchLoadingStrategy.json +40 -0
  101. package/json-schema/api/Callback.json +39 -0
  102. package/json-schema/api/DataLoaderConfig.json +55 -0
  103. package/json-schema/api/DisablePackageResponse.json +26 -0
  104. package/json-schema/api/Discovery.json +4 -62
  105. package/json-schema/api/EnablePackageResponse.json +26 -0
  106. package/json-schema/api/FederationEntity.json +110 -0
  107. package/json-schema/api/FederationEntityKey.json +20 -0
  108. package/json-schema/api/FederationExternalField.json +18 -0
  109. package/json-schema/api/FederationGateway.json +327 -0
  110. package/json-schema/api/FederationProvides.json +19 -0
  111. package/json-schema/api/FederationRequires.json +19 -0
  112. package/json-schema/api/GetDiscoveryResponse.json +1 -60
  113. package/json-schema/api/GetPackageResponse.json +26 -0
  114. package/json-schema/api/GraphQLConfig.json +327 -0
  115. package/json-schema/api/GraphQLQueryAdapter.json +84 -0
  116. package/json-schema/api/InstallPackageRequest.json +26 -0
  117. package/json-schema/api/InstallPackageResponse.json +26 -0
  118. package/json-schema/api/ListPackagesResponse.json +26 -0
  119. package/json-schema/api/ODataQueryAdapter.json +66 -0
  120. package/json-schema/api/OpenApi31Extensions.json +139 -0
  121. package/json-schema/api/OperatorMapping.json +26 -0
  122. package/json-schema/api/PresenceStatus.json +10 -0
  123. package/json-schema/api/QueryAdapterConfig.json +272 -0
  124. package/json-schema/api/QueryAdapterTarget.json +9 -0
  125. package/json-schema/api/QueryOptimizationConfig.json +126 -0
  126. package/json-schema/api/RealtimeRecordAction.json +9 -0
  127. package/json-schema/api/RestQueryAdapter.json +86 -0
  128. package/json-schema/api/RestServerConfig.json +139 -0
  129. package/json-schema/api/SubgraphConfig.json +183 -0
  130. package/json-schema/api/WebhookConfig.json +129 -0
  131. package/json-schema/api/WebhookEvent.json +64 -0
  132. package/json-schema/data/ExternalLookup.json +128 -0
  133. package/json-schema/identity/SCIMBulkOperation.json +41 -0
  134. package/json-schema/identity/SCIMBulkRequest.json +73 -0
  135. package/json-schema/identity/SCIMBulkResponse.json +61 -0
  136. package/json-schema/identity/SCIMBulkResponseOperation.json +36 -0
  137. package/json-schema/integration/CircuitBreakerConfig.json +49 -0
  138. package/json-schema/integration/Connector.json +223 -0
  139. package/json-schema/integration/ConnectorHealth.json +113 -0
  140. package/json-schema/integration/DatabaseConnector.json +223 -0
  141. package/json-schema/integration/ErrorCategory.json +15 -0
  142. package/json-schema/integration/ErrorMappingConfig.json +112 -0
  143. package/json-schema/integration/ErrorMappingRule.json +66 -0
  144. package/json-schema/integration/FileStorageConnector.json +223 -0
  145. package/json-schema/integration/GitHubConnector.json +223 -0
  146. package/json-schema/integration/HealthCheckConfig.json +58 -0
  147. package/json-schema/integration/MessageQueueConnector.json +223 -0
  148. package/json-schema/integration/SaasConnector.json +223 -0
  149. package/json-schema/integration/VercelConnector.json +223 -0
  150. package/json-schema/kernel/CLICommandContribution.json +23 -0
  151. package/json-schema/kernel/CLIExtensionExport.json +22 -0
  152. package/json-schema/kernel/DevFixtureConfig.json +35 -0
  153. package/json-schema/kernel/DevPluginConfig.json +170 -0
  154. package/json-schema/kernel/DevPluginPreset.json +10 -0
  155. package/json-schema/kernel/DevServiceOverride.json +41 -0
  156. package/json-schema/kernel/DevToolsConfig.json +45 -0
  157. package/json-schema/kernel/DisablePackageResponse.json +26 -0
  158. package/json-schema/kernel/EnablePackageResponse.json +26 -0
  159. package/json-schema/kernel/GetPackageResponse.json +26 -0
  160. package/json-schema/kernel/InstallPackageRequest.json +26 -0
  161. package/json-schema/kernel/InstallPackageResponse.json +26 -0
  162. package/json-schema/kernel/InstalledPackage.json +26 -0
  163. package/json-schema/kernel/ListPackagesResponse.json +26 -0
  164. package/json-schema/kernel/Manifest.json +26 -0
  165. package/json-schema/kernel/MetadataFallbackStrategy.json +9 -0
  166. package/json-schema/kernel/MetadataLoaderContract.json +7 -0
  167. package/json-schema/kernel/MetadataManagerConfig.json +21 -0
  168. package/json-schema/security/RLSAuditConfig.json +62 -0
  169. package/json-schema/security/RLSAuditEvent.json +66 -0
  170. package/json-schema/security/RLSConfig.json +62 -0
  171. package/json-schema/system/AuthConfig.json +83 -0
  172. package/json-schema/system/BackupConfig.json +148 -0
  173. package/json-schema/system/BackupRetention.json +27 -0
  174. package/json-schema/system/BackupStrategy.json +10 -0
  175. package/json-schema/system/CacheAvalanchePrevention.json +77 -0
  176. package/json-schema/system/CacheConsistency.json +11 -0
  177. package/json-schema/system/CacheWarmup.json +44 -0
  178. package/json-schema/system/ComplianceAuditRequirement.json +43 -0
  179. package/json-schema/system/ComplianceEncryptionRequirement.json +58 -0
  180. package/json-schema/system/DataClassificationPolicy.json +46 -0
  181. package/json-schema/system/DisasterRecoveryPlan.json +414 -0
  182. package/json-schema/system/DistributedCacheConfig.json +269 -0
  183. package/json-schema/system/FailoverConfig.json +102 -0
  184. package/json-schema/system/FailoverMode.json +11 -0
  185. package/json-schema/system/MaskingVisibilityRule.json +56 -0
  186. package/json-schema/system/MetadataFallbackStrategy.json +9 -0
  187. package/json-schema/system/MetadataLoaderContract.json +9 -1
  188. package/json-schema/system/MetadataManagerConfig.json +52 -11
  189. package/json-schema/system/MetadataRecord.json +32 -1
  190. package/json-schema/system/MetadataSource.json +10 -0
  191. package/json-schema/system/MutualTLSConfig.json +83 -0
  192. package/json-schema/system/RPO.json +27 -0
  193. package/json-schema/system/RTO.json +27 -0
  194. package/json-schema/system/SecurityContextConfig.json +288 -0
  195. package/json-schema/system/SecurityEventCorrelation.json +40 -0
  196. package/json-schema/ui/Action.json +200 -5
  197. package/json-schema/ui/ActionParam.json +62 -2
  198. package/json-schema/ui/AnimationTrigger.json +14 -0
  199. package/json-schema/ui/App.json +285 -7
  200. package/json-schema/ui/AriaProps.json +49 -0
  201. package/json-schema/ui/BreakpointColumnMap.json +38 -0
  202. package/json-schema/ui/BreakpointName.json +12 -0
  203. package/json-schema/ui/BreakpointOrderMap.json +26 -0
  204. package/json-schema/ui/ChartAnnotation.json +31 -1
  205. package/json-schema/ui/ChartAxis.json +30 -1
  206. package/json-schema/ui/ChartConfig.json +259 -7
  207. package/json-schema/ui/ChartSeries.json +30 -1
  208. package/json-schema/ui/ColumnSummary.json +18 -0
  209. package/json-schema/ui/ComponentAnimation.json +246 -0
  210. package/json-schema/ui/ConflictResolution.json +11 -0
  211. package/json-schema/ui/Dashboard.json +627 -11
  212. package/json-schema/ui/DashboardNavItem.json +30 -1
  213. package/json-schema/ui/DashboardWidget.json +433 -8
  214. package/json-schema/ui/DateFormat.json +36 -0
  215. package/json-schema/ui/DensityMode.json +9 -0
  216. package/json-schema/ui/DndConfig.json +306 -0
  217. package/json-schema/ui/DragConstraint.json +44 -0
  218. package/json-schema/ui/DragHandle.json +10 -0
  219. package/json-schema/ui/DragItem.json +160 -0
  220. package/json-schema/ui/DropEffect.json +11 -0
  221. package/json-schema/ui/DropZone.json +114 -0
  222. package/json-schema/ui/EasingFunction.json +13 -0
  223. package/json-schema/ui/EvictionPolicy.json +10 -0
  224. package/json-schema/ui/FocusManagement.json +69 -0
  225. package/json-schema/ui/FocusTrapConfig.json +32 -0
  226. package/json-schema/ui/FormField.json +90 -3
  227. package/json-schema/ui/GalleryConfig.json +46 -0
  228. package/json-schema/ui/GestureConfig.json +128 -0
  229. package/json-schema/ui/GestureType.json +14 -0
  230. package/json-schema/ui/GroupNavItem.json +30 -1
  231. package/json-schema/ui/GroupingConfig.json +45 -0
  232. package/json-schema/ui/GroupingField.json +30 -0
  233. package/json-schema/ui/I18nLabel.json +34 -0
  234. package/json-schema/ui/I18nObject.json +26 -0
  235. package/json-schema/ui/KeyboardNavigationConfig.json +194 -0
  236. package/json-schema/ui/KeyboardShortcut.json +66 -0
  237. package/json-schema/ui/ListColumn.json +55 -1
  238. package/json-schema/ui/ListView.json +435 -4
  239. package/json-schema/ui/LocaleConfig.json +108 -0
  240. package/json-schema/ui/LongPressGestureConfig.json +20 -0
  241. package/json-schema/ui/MotionConfig.json +405 -0
  242. package/json-schema/ui/NavigationItem.json +150 -5
  243. package/json-schema/ui/Notification.json +232 -0
  244. package/json-schema/ui/NotificationAction.json +60 -0
  245. package/json-schema/ui/NotificationConfig.json +52 -0
  246. package/json-schema/ui/NotificationPosition.json +13 -0
  247. package/json-schema/ui/NotificationSeverity.json +11 -0
  248. package/json-schema/ui/NotificationType.json +12 -0
  249. package/json-schema/ui/NumberFormat.json +42 -0
  250. package/json-schema/ui/ObjectNavItem.json +30 -1
  251. package/json-schema/ui/OfflineCacheConfig.json +40 -0
  252. package/json-schema/ui/OfflineConfig.json +157 -0
  253. package/json-schema/ui/OfflineStrategy.json +12 -0
  254. package/json-schema/ui/Page.json +285 -3
  255. package/json-schema/ui/PageCardProps.json +79 -1
  256. package/json-schema/ui/PageComponent.json +175 -1
  257. package/json-schema/ui/PageHeaderProps.json +108 -2
  258. package/json-schema/ui/PageNavItem.json +30 -1
  259. package/json-schema/ui/PageRegion.json +175 -1
  260. package/json-schema/ui/PageTabsProps.json +79 -1
  261. package/json-schema/ui/PageTransition.json +53 -0
  262. package/json-schema/ui/PerformanceConfig.json +57 -0
  263. package/json-schema/ui/PersistStorage.json +10 -0
  264. package/json-schema/ui/PinchGestureConfig.json +16 -0
  265. package/json-schema/ui/PluralRule.json +40 -0
  266. package/json-schema/ui/Report.json +490 -8
  267. package/json-schema/ui/ReportChart.json +199 -5
  268. package/json-schema/ui/ReportColumn.json +126 -1
  269. package/json-schema/ui/ResponsiveConfig.json +97 -0
  270. package/json-schema/ui/RowColorConfig.json +25 -0
  271. package/json-schema/ui/RowHeight.json +12 -0
  272. package/json-schema/ui/SwipeDirection.json +10 -0
  273. package/json-schema/ui/SwipeGestureConfig.json +32 -0
  274. package/json-schema/ui/SyncConfig.json +47 -0
  275. package/json-schema/ui/Theme.json +137 -0
  276. package/json-schema/ui/TimelineConfig.json +46 -0
  277. package/json-schema/ui/TouchInteraction.json +232 -0
  278. package/json-schema/ui/TouchTargetConfig.json +49 -0
  279. package/json-schema/ui/TransitionConfig.json +47 -0
  280. package/json-schema/ui/TransitionPreset.json +16 -0
  281. package/json-schema/ui/UrlNavItem.json +30 -1
  282. package/json-schema/ui/ViewSharing.json +24 -0
  283. package/json-schema/ui/WcagContrastLevel.json +8 -0
  284. package/json-schema/ui/WidgetEvent.json +60 -2
  285. package/json-schema/ui/WidgetManifest.json +284 -6
  286. package/json-schema/ui/WidgetProperty.json +60 -2
  287. package/package.json +1 -1
  288. package/dist/index-C6p-2KXV.d.ts +0 -767
  289. package/dist/index-CVnGe2b8.d.mts +0 -767
  290. package/dist/index-CZjkpp75.d.mts +0 -3867
  291. package/dist/index-CgkjUheS.d.ts +0 -3867
  292. package/dist/{index-B08s7rEU.d.mts → index-DmhxH5jy.d.mts} +8 -8
  293. package/dist/{index-DqnBqATx.d.ts → index-y5JJvyML.d.ts} +8 -8
@@ -0,0 +1,2102 @@
1
+ import { Q as QueryAST, a as FieldSchema } from './field.zod-DuaF0Lcl.js';
2
+ import { D as DataEngineQueryOptions, a as DataEngineInsertOptions, b as DataEngineUpdateOptions, c as DataEngineDeleteOptions, d as DataEngineCountOptions, e as DataEngineAggregateOptions, f as DataEngineRequest, g as DriverOptions, h as DriverCapabilities, O as ObjectSchema } from './driver.zod-B3Q0oLlF.js';
3
+ import { z } from 'zod';
4
+
5
+ /**
6
+ * Logger Contract
7
+ *
8
+ * Defines the interface for logging in ObjectStack.
9
+ * Compatible with both browser console and structured logging systems.
10
+ */
11
+ interface Logger {
12
+ /**
13
+ * Log a debug message
14
+ * @param message - The message to log
15
+ * @param meta - Optional metadata to include
16
+ */
17
+ debug(message: string, meta?: Record<string, any>): void;
18
+ /**
19
+ * Log an informational message
20
+ * @param message - The message to log
21
+ * @param meta - Optional metadata to include
22
+ */
23
+ info(message: string, meta?: Record<string, any>): void;
24
+ /**
25
+ * Log a warning message
26
+ * @param message - The message to log
27
+ * @param meta - Optional metadata to include
28
+ */
29
+ warn(message: string, meta?: Record<string, any>): void;
30
+ /**
31
+ * Log an error message
32
+ * @param message - The message to log
33
+ * @param error - Optional error object
34
+ * @param meta - Optional metadata to include
35
+ */
36
+ error(message: string, error?: Error, meta?: Record<string, any>): void;
37
+ /**
38
+ * Log a fatal error message
39
+ * @param message - The message to log
40
+ * @param error - Optional error object
41
+ * @param meta - Optional metadata to include
42
+ */
43
+ fatal?(message: string, error?: Error, meta?: Record<string, any>): void;
44
+ /**
45
+ * Create a child logger with additional context
46
+ * @param context - Context to add to all logs from this child
47
+ */
48
+ child?(context: Record<string, any>): Logger;
49
+ /**
50
+ * Set trace context for distributed tracing
51
+ * @param traceId - Trace identifier
52
+ * @param spanId - Span identifier
53
+ */
54
+ withTrace?(traceId: string, spanId?: string): Logger;
55
+ /**
56
+ * Compatibility method for console.log usage
57
+ * @param message - The message to log
58
+ * @param args - Additional arguments
59
+ */
60
+ log?(message: string, ...args: any[]): void;
61
+ /**
62
+ * Cleanup resources (close file streams, etc.)
63
+ * Should be called when the logger is no longer needed
64
+ */
65
+ destroy?(): Promise<void>;
66
+ }
67
+
68
+ /**
69
+ * IDataEngine - Standard Data Engine Interface
70
+ *
71
+ * Abstract interface for data persistence capabilities.
72
+ * Following the Dependency Inversion Principle - plugins depend on this interface,
73
+ * not on concrete database implementations.
74
+ *
75
+ * Aligned with 'src/data/data-engine.zod.ts' in @objectstack/spec.
76
+ */
77
+ interface IDataEngine {
78
+ find(objectName: string, query?: DataEngineQueryOptions): Promise<any[]>;
79
+ findOne(objectName: string, query?: DataEngineQueryOptions): Promise<any>;
80
+ insert(objectName: string, data: any | any[], options?: DataEngineInsertOptions): Promise<any>;
81
+ update(objectName: string, data: any, options?: DataEngineUpdateOptions): Promise<any>;
82
+ delete(objectName: string, options?: DataEngineDeleteOptions): Promise<any>;
83
+ count(objectName: string, query?: DataEngineCountOptions): Promise<number>;
84
+ aggregate(objectName: string, query: DataEngineAggregateOptions): Promise<any[]>;
85
+ /**
86
+ * Vector Search (AI/RAG)
87
+ */
88
+ vectorFind?(objectName: string, vector: number[], options?: {
89
+ filter?: any;
90
+ limit?: number;
91
+ select?: string[];
92
+ threshold?: number;
93
+ }): Promise<any[]>;
94
+ /**
95
+ * Batch Operations (Transactional)
96
+ */
97
+ batch?(requests: DataEngineRequest[], options?: {
98
+ transaction?: boolean;
99
+ }): Promise<any[]>;
100
+ /**
101
+ * Execute raw command (Escape hatch)
102
+ */
103
+ execute?(command: any, options?: Record<string, any>): Promise<any>;
104
+ }
105
+ interface DriverInterface {
106
+ name: string;
107
+ version: string;
108
+ connect(): Promise<void>;
109
+ disconnect(): Promise<void>;
110
+ find(object: string, query: QueryAST, options?: DriverOptions): Promise<any[]>;
111
+ findOne(object: string, query: QueryAST, options?: DriverOptions): Promise<any>;
112
+ create(object: string, data: any, options?: DriverOptions): Promise<any>;
113
+ update(object: string, id: any, data: any, options?: DriverOptions): Promise<any>;
114
+ delete(object: string, id: any, options?: DriverOptions): Promise<any>;
115
+ /**
116
+ * Bulk & Batch Operations
117
+ */
118
+ bulkCreate?(object: string, data: any[], options?: DriverOptions): Promise<any>;
119
+ updateMany?(object: string, query: QueryAST, data: any, options?: DriverOptions): Promise<any>;
120
+ deleteMany?(object: string, query: QueryAST, options?: DriverOptions): Promise<any>;
121
+ count?(object: string, query: QueryAST, options?: DriverOptions): Promise<number>;
122
+ /**
123
+ * Raw Execution
124
+ */
125
+ execute?(command: any, params?: any, options?: DriverOptions): Promise<any>;
126
+ }
127
+
128
+ /**
129
+ * IDataDriver - Comprehensive Database Driver Interface
130
+ *
131
+ * Pure TypeScript interface for all storage adapters (Postgres, Mongo, Excel, Salesforce).
132
+ * Mirrors the capabilities described in `data/driver.zod.ts` (DriverInterfaceSchema) but
133
+ * expressed as a TypeScript interface for type-safe implementation contracts.
134
+ *
135
+ * This is the contract that all ObjectStack database drivers MUST implement.
136
+ * Use `DriverCapabilitiesSchema` / `DriverConfigSchema` from `data/driver.zod.ts` for
137
+ * runtime capability detection and configuration validation.
138
+ *
139
+ * @see DriverCapabilitiesSchema for runtime capability flags
140
+ * @see DriverConfigSchema for driver configuration validation
141
+ */
142
+ interface IDataDriver {
143
+ /** Driver unique name (e.g., 'postgresql', 'mongodb', 'rest_api') */
144
+ readonly name: string;
145
+ /** Driver version */
146
+ readonly version: string;
147
+ /** Capabilities descriptor */
148
+ readonly supports: DriverCapabilities;
149
+ /** Initialize connection pool or authenticate */
150
+ connect(): Promise<void>;
151
+ /** Close connections and cleanup resources */
152
+ disconnect(): Promise<void>;
153
+ /** Check connection health */
154
+ checkHealth(): Promise<boolean>;
155
+ /** Get connection pool statistics (optional) */
156
+ getPoolStats?(): {
157
+ total: number;
158
+ idle: number;
159
+ active: number;
160
+ waiting: number;
161
+ } | undefined;
162
+ /**
163
+ * Execute a raw command/query native to the driver.
164
+ *
165
+ * @param command - Raw command (SQL string, shell command, or API payload)
166
+ * @param parameters - Bound parameters for safe execution
167
+ * @param options - Driver options (transaction context, timeout)
168
+ * @returns Raw result from the driver
169
+ */
170
+ execute(command: unknown, parameters?: unknown[], options?: DriverOptions): Promise<unknown>;
171
+ /**
172
+ * Find multiple records matching the structured query.
173
+ * MUST return `id` as string. MUST NOT return implementation details like `_id`.
174
+ */
175
+ find(object: string, query: QueryAST, options?: DriverOptions): Promise<Record<string, unknown>[]>;
176
+ /**
177
+ * Stream records matching the structured query.
178
+ * Optimized for large datasets to avoid memory overflow.
179
+ * Returns an AsyncIterable or ReadableStream.
180
+ */
181
+ findStream(object: string, query: QueryAST, options?: DriverOptions): unknown;
182
+ /**
183
+ * Find a single record by query.
184
+ * MUST return `id` as string. MUST NOT return implementation details like `_id`.
185
+ */
186
+ findOne(object: string, query: QueryAST, options?: DriverOptions): Promise<Record<string, unknown> | null>;
187
+ /**
188
+ * Create a new record.
189
+ * MUST return `id` as string. MUST NOT return implementation details like `_id`.
190
+ */
191
+ create(object: string, data: Record<string, unknown>, options?: DriverOptions): Promise<Record<string, unknown>>;
192
+ /**
193
+ * Update an existing record by ID.
194
+ * MUST return `id` as string. MUST NOT return implementation details like `_id`.
195
+ */
196
+ update(object: string, id: string | number, data: Record<string, unknown>, options?: DriverOptions): Promise<Record<string, unknown>>;
197
+ /**
198
+ * Upsert (Update or Insert) a record.
199
+ */
200
+ upsert(object: string, data: Record<string, unknown>, conflictKeys?: string[], options?: DriverOptions): Promise<Record<string, unknown>>;
201
+ /**
202
+ * Delete a record by ID.
203
+ * @returns True if deleted, false if not found.
204
+ */
205
+ delete(object: string, id: string | number, options?: DriverOptions): Promise<boolean>;
206
+ /**
207
+ * Count records matching a query.
208
+ */
209
+ count(object: string, query?: QueryAST, options?: DriverOptions): Promise<number>;
210
+ /** Create multiple records in a single batch */
211
+ bulkCreate(object: string, dataArray: Record<string, unknown>[], options?: DriverOptions): Promise<Record<string, unknown>[]>;
212
+ /** Update multiple records in a single batch */
213
+ bulkUpdate(object: string, updates: Array<{
214
+ id: string | number;
215
+ data: Record<string, unknown>;
216
+ }>, options?: DriverOptions): Promise<Record<string, unknown>[]>;
217
+ /** Delete multiple records in a single batch */
218
+ bulkDelete(object: string, ids: Array<string | number>, options?: DriverOptions): Promise<void>;
219
+ /** Update multiple records matching a query (optional) */
220
+ updateMany?(object: string, query: QueryAST, data: Record<string, unknown>, options?: DriverOptions): Promise<number>;
221
+ /** Delete multiple records matching a query (optional) */
222
+ deleteMany?(object: string, query: QueryAST, options?: DriverOptions): Promise<number>;
223
+ /**
224
+ * Begin a new database transaction.
225
+ * @returns A transaction handle to pass via `options.transaction`.
226
+ */
227
+ beginTransaction(options?: {
228
+ isolationLevel?: string;
229
+ }): Promise<unknown>;
230
+ /** Commit the transaction */
231
+ commit(transaction: unknown): Promise<void>;
232
+ /** Rollback the transaction */
233
+ rollback(transaction: unknown): Promise<void>;
234
+ /**
235
+ * Synchronize the database schema with the Object definition.
236
+ * Idempotent: creates tables if missing, adds columns, updates indexes.
237
+ */
238
+ syncSchema(object: string, schema: unknown, options?: DriverOptions): Promise<void>;
239
+ /** Drop the underlying table or collection (destructive) */
240
+ dropTable(object: string, options?: DriverOptions): Promise<void>;
241
+ /**
242
+ * Analyze query performance.
243
+ * Returns execution plan without executing the query (optional).
244
+ */
245
+ explain?(object: string, query: QueryAST, options?: DriverOptions): Promise<unknown>;
246
+ }
247
+
248
+ /**
249
+ * IHttpServer - Standard HTTP Server Interface
250
+ *
251
+ * Abstract interface for HTTP server capabilities.
252
+ * This allows plugins to interact with HTTP servers without knowing
253
+ * the underlying implementation (Express, Fastify, Hono, etc.).
254
+ *
255
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
256
+ * not on concrete HTTP framework implementations.
257
+ */
258
+ /**
259
+ * Generic HTTP Request type
260
+ * Abstraction over framework-specific request objects
261
+ */
262
+ interface IHttpRequest {
263
+ /** Request path parameters */
264
+ params: Record<string, string>;
265
+ /** Request query parameters */
266
+ query: Record<string, string | string[]>;
267
+ /** Request body */
268
+ body?: any;
269
+ /** Request headers */
270
+ headers: Record<string, string | string[]>;
271
+ /** HTTP method */
272
+ method: string;
273
+ /** Request path */
274
+ path: string;
275
+ }
276
+ /**
277
+ * Generic HTTP Response type
278
+ * Abstraction over framework-specific response objects
279
+ */
280
+ interface IHttpResponse {
281
+ /**
282
+ * Send a JSON response
283
+ * @param data - Data to send
284
+ */
285
+ json(data: any): void | Promise<void>;
286
+ /**
287
+ * Send a text/html response
288
+ * @param data - Data to send
289
+ */
290
+ send(data: string): void | Promise<void>;
291
+ /**
292
+ * Set HTTP status code
293
+ * @param code - HTTP status code
294
+ */
295
+ status(code: number): IHttpResponse;
296
+ /**
297
+ * Set response header
298
+ * @param name - Header name
299
+ * @param value - Header value (string or array of strings for multi-value headers)
300
+ */
301
+ header(name: string, value: string | string[]): IHttpResponse;
302
+ }
303
+ /**
304
+ * Route handler function
305
+ */
306
+ type RouteHandler = (req: IHttpRequest, res: IHttpResponse) => void | Promise<void>;
307
+ /**
308
+ * Middleware function
309
+ */
310
+ type Middleware = (req: IHttpRequest, res: IHttpResponse, next: () => void | Promise<void>) => void | Promise<void>;
311
+ /**
312
+ * IHttpServer - HTTP Server capability interface
313
+ *
314
+ * Defines the contract for HTTP server implementations.
315
+ * Concrete implementations (Express, Fastify, Hono) should implement this interface.
316
+ */
317
+ interface IHttpServer {
318
+ /**
319
+ * Register a GET route handler
320
+ * @param path - Route path (e.g., '/api/users/:id')
321
+ * @param handler - Route handler function
322
+ */
323
+ get(path: string, handler: RouteHandler): void;
324
+ /**
325
+ * Register a POST route handler
326
+ * @param path - Route path
327
+ * @param handler - Route handler function
328
+ */
329
+ post(path: string, handler: RouteHandler): void;
330
+ /**
331
+ * Register a PUT route handler
332
+ * @param path - Route path
333
+ * @param handler - Route handler function
334
+ */
335
+ put(path: string, handler: RouteHandler): void;
336
+ /**
337
+ * Register a DELETE route handler
338
+ * @param path - Route path
339
+ * @param handler - Route handler function
340
+ */
341
+ delete(path: string, handler: RouteHandler): void;
342
+ /**
343
+ * Register a PATCH route handler
344
+ * @param path - Route path
345
+ * @param handler - Route handler function
346
+ */
347
+ patch(path: string, handler: RouteHandler): void;
348
+ /**
349
+ * Register middleware
350
+ * @param path - Optional path to apply middleware to (if omitted, applies globally)
351
+ * @param handler - Middleware function
352
+ */
353
+ use(path: string | Middleware, handler?: Middleware): void;
354
+ /**
355
+ * Start the HTTP server
356
+ * @param port - Port number to listen on
357
+ * @returns Promise that resolves when server is ready
358
+ */
359
+ listen(port: number): Promise<void>;
360
+ /**
361
+ * Stop the HTTP server
362
+ * @returns Promise that resolves when server is stopped
363
+ */
364
+ close?(): Promise<void>;
365
+ }
366
+
367
+ /**
368
+ * IServiceRegistry - Service Registry Interface
369
+ *
370
+ * Abstract interface for managing service registration and lookup.
371
+ * This provides a single source of truth for all services in the system.
372
+ *
373
+ * Following the Dependency Inversion Principle - both kernel implementations
374
+ * and plugins depend on this interface, not on concrete implementations.
375
+ */
376
+ interface IServiceRegistry {
377
+ /**
378
+ * Register a service with a unique name
379
+ * @param name - Unique service identifier
380
+ * @param service - The service instance to register
381
+ * @throws Error if service name is already registered
382
+ */
383
+ register<T>(name: string, service: T): void;
384
+ /**
385
+ * Get a registered service by name (synchronous)
386
+ * @param name - Service identifier
387
+ * @returns The registered service
388
+ * @throws Error if service is not found
389
+ */
390
+ get<T>(name: string): T;
391
+ /**
392
+ * Get a registered service by name (asynchronous)
393
+ * Useful for lazy-loaded or async-initialized services
394
+ * @param name - Service identifier
395
+ * @param scopeId - Optional scope identifier for scoped services
396
+ * @returns Promise resolving to the registered service
397
+ * @throws Error if service is not found
398
+ */
399
+ getAsync<T>(name: string, scopeId?: string): Promise<T>;
400
+ /**
401
+ * Check if a service is registered
402
+ * @param name - Service identifier
403
+ * @returns True if service is registered, false otherwise
404
+ */
405
+ has(name: string): boolean;
406
+ /**
407
+ * Unregister a service
408
+ * @param name - Service identifier
409
+ * @returns True if service was unregistered, false if it wasn't registered
410
+ */
411
+ unregister(name: string): boolean;
412
+ /**
413
+ * Get all registered service names
414
+ * @returns Array of service names
415
+ */
416
+ getServiceNames?(): string[];
417
+ /**
418
+ * Clear all registered services
419
+ * Useful for cleanup in tests or during shutdown
420
+ */
421
+ clear?(): void;
422
+ }
423
+ /**
424
+ * BasicServiceRegistry - Simple synchronous implementation
425
+ * Used by ObjectKernel for basic service management
426
+ */
427
+ interface IBasicServiceRegistry extends IServiceRegistry {
428
+ }
429
+ /**
430
+ * AdvancedServiceRegistry - Enhanced implementation with additional features
431
+ * Used by ObjectKernel for advanced service management
432
+ */
433
+ interface IAdvancedServiceRegistry extends IServiceRegistry {
434
+ /**
435
+ * Register a factory function that creates services on-demand
436
+ * @param name - Service identifier
437
+ * @param factory - Factory function that creates the service
438
+ * @param singleton - If true, factory is called once and result is cached
439
+ */
440
+ registerFactory?<T>(name: string, factory: () => T | Promise<T>, singleton?: boolean): void;
441
+ /**
442
+ * Register a scoped service (per-request, per-session, etc.)
443
+ * @param name - Service identifier
444
+ * @param factory - Factory function that creates the service
445
+ * @param scopeType - Type of scope ('request', 'session', 'transaction', etc.)
446
+ */
447
+ registerScoped?<T>(name: string, factory: (scopeId: string) => T | Promise<T>, scopeType: string): void;
448
+ /**
449
+ * Create a new scope for scoped services
450
+ * @param scopeType - Type of scope
451
+ * @returns Scope identifier
452
+ */
453
+ createScope?(scopeType: string): string;
454
+ /**
455
+ * Dispose a scope and cleanup scoped services
456
+ * @param scopeId - Scope identifier
457
+ */
458
+ disposeScope?(scopeId: string): Promise<void>;
459
+ }
460
+
461
+ /**
462
+ * IPluginValidator - Plugin Validator Interface
463
+ *
464
+ * Abstract interface for validating plugins before registration and startup.
465
+ * Extracted from PluginLoader to follow Single Responsibility Principle.
466
+ */
467
+ /**
468
+ * Validation result for a plugin
469
+ */
470
+ interface ValidationResult {
471
+ /**
472
+ * Whether the plugin passed validation
473
+ */
474
+ valid: boolean;
475
+ /**
476
+ * Validation errors (if any)
477
+ */
478
+ errors?: Array<{
479
+ field: string;
480
+ message: string;
481
+ code?: string;
482
+ }>;
483
+ /**
484
+ * Validation warnings (non-fatal issues)
485
+ */
486
+ warnings?: Array<{
487
+ field: string;
488
+ message: string;
489
+ code?: string;
490
+ }>;
491
+ }
492
+ /**
493
+ * Plugin metadata for validation
494
+ */
495
+ interface Plugin {
496
+ /**
497
+ * Unique plugin identifier
498
+ */
499
+ name: string;
500
+ /**
501
+ * Plugin version (semver)
502
+ */
503
+ version?: string;
504
+ /**
505
+ * Plugin dependencies
506
+ */
507
+ dependencies?: string[];
508
+ /**
509
+ * Plugin initialization function
510
+ */
511
+ init?: (context: any) => void | Promise<void>;
512
+ /**
513
+ * Plugin startup function
514
+ */
515
+ start?: (context: any) => void | Promise<void>;
516
+ /**
517
+ * Plugin destruction function
518
+ */
519
+ destroy?: (context: any) => void | Promise<void>;
520
+ /**
521
+ * Plugin signature for verification (optional)
522
+ */
523
+ signature?: string;
524
+ /**
525
+ * Additional plugin metadata
526
+ */
527
+ [key: string]: any;
528
+ }
529
+ /**
530
+ * IPluginValidator - Plugin validation interface
531
+ */
532
+ interface IPluginValidator {
533
+ /**
534
+ * Validate a plugin object structure
535
+ * @param plugin - Plugin to validate
536
+ * @returns Validation result
537
+ */
538
+ validate(plugin: unknown): ValidationResult;
539
+ /**
540
+ * Validate plugin version format (semver)
541
+ * @param version - Version string to validate
542
+ * @returns True if version is valid, false otherwise
543
+ */
544
+ validateVersion(version: string): boolean;
545
+ /**
546
+ * Validate plugin cryptographic signature (optional)
547
+ * Used for plugin security verification
548
+ * @param plugin - Plugin to validate
549
+ * @returns Promise resolving to true if signature is valid
550
+ */
551
+ validateSignature?(plugin: Plugin): Promise<boolean>;
552
+ /**
553
+ * Validate plugin dependencies are satisfied
554
+ * @param plugin - Plugin to validate
555
+ * @param registry - Map of already registered plugins
556
+ * @throws Error if dependencies are not satisfied
557
+ */
558
+ validateDependencies(plugin: Plugin, registry: Map<string, Plugin>): void;
559
+ /**
560
+ * Validate plugin has required lifecycle methods
561
+ * @param plugin - Plugin to validate
562
+ * @returns True if plugin has valid lifecycle methods
563
+ */
564
+ validateLifecycle?(plugin: Plugin): boolean;
565
+ }
566
+
567
+ /**
568
+ * IStartupOrchestrator - Startup Orchestrator Interface
569
+ *
570
+ * Abstract interface for orchestrating plugin startup with advanced features:
571
+ * - Timeout handling
572
+ * - Rollback on failure
573
+ * - Health checks
574
+ * - Startup metrics
575
+ *
576
+ * Extracted from PluginLoader to follow Single Responsibility Principle.
577
+ */
578
+ /**
579
+ * Startup options for orchestration
580
+ */
581
+ interface StartupOptions {
582
+ /**
583
+ * Maximum time (ms) to wait for each plugin to start
584
+ * @default 30000 (30 seconds)
585
+ */
586
+ timeout?: number;
587
+ /**
588
+ * Whether to rollback (destroy) already-started plugins on failure
589
+ * @default true
590
+ */
591
+ rollbackOnFailure?: boolean;
592
+ /**
593
+ * Whether to run health checks after startup
594
+ * @default false
595
+ */
596
+ healthCheck?: boolean;
597
+ /**
598
+ * Whether to run plugins in parallel (if dependencies allow)
599
+ * @default false (sequential startup)
600
+ */
601
+ parallel?: boolean;
602
+ /**
603
+ * Custom context to pass to plugin lifecycle methods
604
+ */
605
+ context?: any;
606
+ }
607
+ /**
608
+ * Plugin startup result
609
+ */
610
+ interface PluginStartupResult {
611
+ /**
612
+ * Plugin that was started
613
+ */
614
+ plugin: Plugin;
615
+ /**
616
+ * Whether startup was successful
617
+ */
618
+ success: boolean;
619
+ /**
620
+ * Time taken to start (milliseconds)
621
+ */
622
+ duration: number;
623
+ /**
624
+ * Error if startup failed
625
+ */
626
+ error?: Error;
627
+ /**
628
+ * Health status after startup (if healthCheck enabled)
629
+ */
630
+ health?: HealthStatus;
631
+ }
632
+ /**
633
+ * Health status for a plugin
634
+ */
635
+ interface HealthStatus {
636
+ /**
637
+ * Whether the plugin is healthy
638
+ */
639
+ healthy: boolean;
640
+ /**
641
+ * Health check timestamp
642
+ */
643
+ timestamp: number;
644
+ /**
645
+ * Optional health details
646
+ */
647
+ details?: Record<string, any>;
648
+ /**
649
+ * Optional error message if unhealthy
650
+ */
651
+ message?: string;
652
+ }
653
+ /**
654
+ * IStartupOrchestrator - Plugin startup orchestration interface
655
+ */
656
+ interface IStartupOrchestrator {
657
+ /**
658
+ * Orchestrate startup of multiple plugins
659
+ * Handles timeout, rollback, and health checks
660
+ * @param plugins - Array of plugins to start (in dependency order)
661
+ * @param options - Startup options
662
+ * @returns Promise resolving to startup results for each plugin
663
+ */
664
+ orchestrateStartup(plugins: Plugin[], options: StartupOptions): Promise<PluginStartupResult[]>;
665
+ /**
666
+ * Rollback (destroy) a set of plugins
667
+ * Used when startup fails and rollback is enabled
668
+ * @param startedPlugins - Plugins that were successfully started
669
+ * @returns Promise that resolves when rollback is complete
670
+ */
671
+ rollback(startedPlugins: Plugin[]): Promise<void>;
672
+ /**
673
+ * Check health of a single plugin
674
+ * @param plugin - Plugin to check
675
+ * @returns Promise resolving to health status
676
+ */
677
+ checkHealth(plugin: Plugin): Promise<HealthStatus>;
678
+ /**
679
+ * Wait for a plugin to start with timeout
680
+ * @param plugin - Plugin to start
681
+ * @param context - Plugin context
682
+ * @param timeoutMs - Maximum time to wait (milliseconds)
683
+ * @returns Promise resolving when plugin starts or rejecting on timeout
684
+ */
685
+ startWithTimeout?(plugin: Plugin, context: any, timeoutMs: number): Promise<void>;
686
+ }
687
+
688
+ /**
689
+ * IPluginLifecycleEvents - Typed Plugin Lifecycle Events
690
+ *
691
+ * Type-safe event definitions for plugin and kernel lifecycle.
692
+ * Provides strong typing for event emitters and listeners.
693
+ *
694
+ * This replaces the generic Map<string, any[]> approach with typed events.
695
+ */
696
+ /**
697
+ * Plugin lifecycle event types and their payloads
698
+ */
699
+ interface IPluginLifecycleEvents {
700
+ /**
701
+ * Emitted when kernel is ready (all plugins initialized)
702
+ * Payload: []
703
+ */
704
+ 'kernel:ready': [];
705
+ /**
706
+ * Emitted when kernel is shutting down
707
+ * Payload: []
708
+ */
709
+ 'kernel:shutdown': [];
710
+ /**
711
+ * Emitted before kernel initialization starts
712
+ * Payload: []
713
+ */
714
+ 'kernel:before-init': [];
715
+ /**
716
+ * Emitted after kernel initialization completes
717
+ * Payload: [duration: number (milliseconds)]
718
+ */
719
+ 'kernel:after-init': [duration: number];
720
+ /**
721
+ * Emitted when a plugin is registered
722
+ * Payload: [pluginName: string]
723
+ */
724
+ 'plugin:registered': [pluginName: string];
725
+ /**
726
+ * Emitted before a plugin's init method is called
727
+ * Payload: [pluginName: string]
728
+ */
729
+ 'plugin:before-init': [pluginName: string];
730
+ /**
731
+ * Emitted when a plugin has been initialized
732
+ * Payload: [pluginName: string]
733
+ */
734
+ 'plugin:init': [pluginName: string];
735
+ /**
736
+ * Emitted after a plugin's init method completes
737
+ * Payload: [pluginName: string, duration: number (milliseconds)]
738
+ */
739
+ 'plugin:after-init': [pluginName: string, duration: number];
740
+ /**
741
+ * Emitted before a plugin's start method is called
742
+ * Payload: [pluginName: string]
743
+ */
744
+ 'plugin:before-start': [pluginName: string];
745
+ /**
746
+ * Emitted when a plugin has started successfully
747
+ * Payload: [pluginName: string, duration: number (milliseconds)]
748
+ */
749
+ 'plugin:started': [pluginName: string, duration: number];
750
+ /**
751
+ * Emitted after a plugin's start method completes
752
+ * Payload: [pluginName: string, duration: number (milliseconds)]
753
+ */
754
+ 'plugin:after-start': [pluginName: string, duration: number];
755
+ /**
756
+ * Emitted before a plugin's destroy method is called
757
+ * Payload: [pluginName: string]
758
+ */
759
+ 'plugin:before-destroy': [pluginName: string];
760
+ /**
761
+ * Emitted when a plugin has been destroyed
762
+ * Payload: [pluginName: string]
763
+ */
764
+ 'plugin:destroyed': [pluginName: string];
765
+ /**
766
+ * Emitted after a plugin's destroy method completes
767
+ * Payload: [pluginName: string, duration: number (milliseconds)]
768
+ */
769
+ 'plugin:after-destroy': [pluginName: string, duration: number];
770
+ /**
771
+ * Emitted when a plugin encounters an error
772
+ * Payload: [pluginName: string, error: Error, phase: 'init' | 'start' | 'destroy']
773
+ */
774
+ 'plugin:error': [pluginName: string, error: Error, phase: 'init' | 'start' | 'destroy'];
775
+ /**
776
+ * Emitted when a service is registered
777
+ * Payload: [serviceName: string]
778
+ */
779
+ 'service:registered': [serviceName: string];
780
+ /**
781
+ * Emitted when a service is unregistered
782
+ * Payload: [serviceName: string]
783
+ */
784
+ 'service:unregistered': [serviceName: string];
785
+ /**
786
+ * Emitted when a hook is registered
787
+ * Payload: [hookName: string, handlerCount: number]
788
+ */
789
+ 'hook:registered': [hookName: string, handlerCount: number];
790
+ /**
791
+ * Emitted when a hook is triggered
792
+ * Payload: [hookName: string, args: any[]]
793
+ */
794
+ 'hook:triggered': [hookName: string, args: any[]];
795
+ }
796
+ /**
797
+ * Type-safe event emitter interface
798
+ * Provides compile-time type checking for event names and payloads
799
+ */
800
+ interface ITypedEventEmitter<Events extends Record<string, any[]>> {
801
+ /**
802
+ * Register an event listener
803
+ * @param event - Event name (type-checked)
804
+ * @param handler - Event handler (type-checked against event payload)
805
+ */
806
+ on<K extends keyof Events>(event: K, handler: (...args: Events[K]) => void | Promise<void>): void;
807
+ /**
808
+ * Unregister an event listener
809
+ * @param event - Event name (type-checked)
810
+ * @param handler - Event handler to remove
811
+ */
812
+ off<K extends keyof Events>(event: K, handler: (...args: Events[K]) => void | Promise<void>): void;
813
+ /**
814
+ * Emit an event with type-checked payload
815
+ * @param event - Event name (type-checked)
816
+ * @param args - Event payload (type-checked)
817
+ */
818
+ emit<K extends keyof Events>(event: K, ...args: Events[K]): Promise<void>;
819
+ /**
820
+ * Register a one-time event listener
821
+ * @param event - Event name (type-checked)
822
+ * @param handler - Event handler (type-checked against event payload)
823
+ */
824
+ once?<K extends keyof Events>(event: K, handler: (...args: Events[K]) => void | Promise<void>): void;
825
+ /**
826
+ * Get the number of listeners for an event
827
+ * @param event - Event name
828
+ * @returns Number of registered listeners
829
+ */
830
+ listenerCount?<K extends keyof Events>(event: K): number;
831
+ /**
832
+ * Remove all listeners for an event (or all events if not specified)
833
+ * @param event - Optional event name
834
+ */
835
+ removeAllListeners?<K extends keyof Events>(event?: K): void;
836
+ }
837
+
838
+ type DataField = z.infer<typeof FieldSchema>;
839
+ type DataObject = z.infer<typeof ObjectSchema>;
840
+ /**
841
+ * Interface for Data Definition Language (DDL) operations.
842
+ * Drivers should implement this to support automatic migrations.
843
+ */
844
+ interface ISchemaDriver {
845
+ createCollection(objectName: string, schema?: DataObject): Promise<void>;
846
+ dropCollection(objectName: string): Promise<void>;
847
+ addColumn(objectName: string, fieldName: string, field: DataField): Promise<void>;
848
+ modifyColumn(objectName: string, fieldName: string, field: DataField): Promise<void>;
849
+ dropColumn(objectName: string, fieldName: string): Promise<void>;
850
+ createIndex(objectName: string, indexName: string, fields: string[]): Promise<void>;
851
+ dropIndex(objectName: string, indexName: string): Promise<void>;
852
+ executeRaw(statement: string): Promise<any>;
853
+ }
854
+
855
+ /**
856
+ * ICacheService - Cache Service Contract
857
+ *
858
+ * Defines the interface for cache operations in ObjectStack.
859
+ * Concrete implementations (Redis, Memory, etc.) should implement this interface.
860
+ *
861
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
862
+ * not on concrete cache implementations.
863
+ *
864
+ * Aligned with CoreServiceName 'cache' in core-services.zod.ts.
865
+ */
866
+ /**
867
+ * Cache statistics for monitoring and observability
868
+ */
869
+ interface CacheStats {
870
+ /** Total number of cache hits */
871
+ hits: number;
872
+ /** Total number of cache misses */
873
+ misses: number;
874
+ /** Number of keys currently stored */
875
+ keyCount: number;
876
+ /** Memory usage in bytes (if available) */
877
+ memoryUsage?: number;
878
+ }
879
+ interface ICacheService {
880
+ /**
881
+ * Get a cached value by key
882
+ * @param key - Cache key
883
+ * @returns The cached value, or undefined if not found
884
+ */
885
+ get<T = unknown>(key: string): Promise<T | undefined>;
886
+ /**
887
+ * Set a value in the cache
888
+ * @param key - Cache key
889
+ * @param value - Value to cache
890
+ * @param ttl - Optional time-to-live in seconds
891
+ */
892
+ set<T = unknown>(key: string, value: T, ttl?: number): Promise<void>;
893
+ /**
894
+ * Delete a cached value by key
895
+ * @param key - Cache key
896
+ * @returns True if the key was deleted, false if it did not exist
897
+ */
898
+ delete(key: string): Promise<boolean>;
899
+ /**
900
+ * Check if a key exists in the cache
901
+ * @param key - Cache key
902
+ * @returns True if the key exists
903
+ */
904
+ has(key: string): Promise<boolean>;
905
+ /**
906
+ * Clear all entries from the cache
907
+ */
908
+ clear(): Promise<void>;
909
+ /**
910
+ * Get cache statistics
911
+ * @returns Cache stats including hits, misses, and key count
912
+ */
913
+ stats(): Promise<CacheStats>;
914
+ }
915
+
916
+ /**
917
+ * ISearchService - Search Service Contract
918
+ *
919
+ * Defines the interface for full-text search capabilities in ObjectStack.
920
+ * Concrete implementations (Elasticsearch, MeiliSearch, Typesense, etc.)
921
+ * should implement this interface.
922
+ *
923
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
924
+ * not on concrete search engine implementations.
925
+ *
926
+ * Aligned with CoreServiceName 'search' in core-services.zod.ts.
927
+ */
928
+ /**
929
+ * Options for search queries
930
+ */
931
+ interface SearchOptions {
932
+ /** Filter conditions to narrow results */
933
+ filter?: Record<string, unknown>;
934
+ /** Maximum number of results to return */
935
+ limit?: number;
936
+ /** Offset for pagination */
937
+ offset?: number;
938
+ /** Fields to sort by */
939
+ sort?: string[];
940
+ /** Fields to include in results */
941
+ select?: string[];
942
+ /** Facet fields to aggregate */
943
+ facets?: string[];
944
+ /** Enable highlighting of matching terms */
945
+ highlight?: boolean;
946
+ }
947
+ /**
948
+ * A single search result hit
949
+ */
950
+ interface SearchHit {
951
+ /** Document ID */
952
+ id: string;
953
+ /** Relevance score */
954
+ score: number;
955
+ /** The matched document */
956
+ document: Record<string, unknown>;
957
+ /** Highlighted fields (if requested) */
958
+ highlights?: Record<string, string[]>;
959
+ }
960
+ /**
961
+ * Search result set
962
+ */
963
+ interface SearchResult {
964
+ /** Matched documents */
965
+ hits: SearchHit[];
966
+ /** Total number of matching documents */
967
+ totalHits: number;
968
+ /** Query processing time in milliseconds */
969
+ processingTimeMs?: number;
970
+ /** Facet counts (if requested) */
971
+ facets?: Record<string, Record<string, number>>;
972
+ }
973
+ interface ISearchService {
974
+ /**
975
+ * Index a document for search
976
+ * @param object - Object/collection name
977
+ * @param id - Document identifier
978
+ * @param document - Document data to index
979
+ */
980
+ index(object: string, id: string, document: Record<string, unknown>): Promise<void>;
981
+ /**
982
+ * Remove a document from the search index
983
+ * @param object - Object/collection name
984
+ * @param id - Document identifier
985
+ */
986
+ remove(object: string, id: string): Promise<void>;
987
+ /**
988
+ * Search for documents
989
+ * @param object - Object/collection name
990
+ * @param query - Search query string
991
+ * @param options - Search options (filters, pagination, etc.)
992
+ * @returns Search results with hits, total count, and optional facets
993
+ */
994
+ search(object: string, query: string, options?: SearchOptions): Promise<SearchResult>;
995
+ /**
996
+ * Bulk index multiple documents at once
997
+ * @param object - Object/collection name
998
+ * @param documents - Array of documents with id and data
999
+ */
1000
+ bulkIndex?(object: string, documents: Array<{
1001
+ id: string;
1002
+ document: Record<string, unknown>;
1003
+ }>): Promise<void>;
1004
+ /**
1005
+ * Delete all documents in an index
1006
+ * @param object - Object/collection name
1007
+ */
1008
+ deleteIndex?(object: string): Promise<void>;
1009
+ }
1010
+
1011
+ /**
1012
+ * IQueueService - Message Queue Service Contract
1013
+ *
1014
+ * Defines the interface for asynchronous message queue operations in ObjectStack.
1015
+ * Concrete implementations (BullMQ, Redis Pub/Sub, Kafka, etc.)
1016
+ * should implement this interface.
1017
+ *
1018
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1019
+ * not on concrete queue implementations.
1020
+ *
1021
+ * Aligned with CoreServiceName 'queue' in core-services.zod.ts.
1022
+ */
1023
+ /**
1024
+ * Options for publishing a message to a queue
1025
+ */
1026
+ interface QueuePublishOptions {
1027
+ /** Delay before the message becomes available (in milliseconds) */
1028
+ delay?: number;
1029
+ /** Message priority (lower = higher priority) */
1030
+ priority?: number;
1031
+ /** Number of retry attempts on failure */
1032
+ retries?: number;
1033
+ }
1034
+ /**
1035
+ * A message received from a queue
1036
+ */
1037
+ interface QueueMessage<T = unknown> {
1038
+ /** Unique message identifier */
1039
+ id: string;
1040
+ /** The message payload */
1041
+ data: T;
1042
+ /** Number of times this message has been attempted */
1043
+ attempts: number;
1044
+ /** Timestamp when the message was published */
1045
+ timestamp: number;
1046
+ }
1047
+ /**
1048
+ * Handler function for processing queue messages
1049
+ */
1050
+ type QueueHandler<T = unknown> = (message: QueueMessage<T>) => Promise<void>;
1051
+ interface IQueueService {
1052
+ /**
1053
+ * Publish a message to a named queue
1054
+ * @param queue - Queue name
1055
+ * @param data - Message payload
1056
+ * @param options - Publish options (delay, priority, retries)
1057
+ * @returns The message identifier
1058
+ */
1059
+ publish<T = unknown>(queue: string, data: T, options?: QueuePublishOptions): Promise<string>;
1060
+ /**
1061
+ * Subscribe to messages from a named queue
1062
+ * @param queue - Queue name
1063
+ * @param handler - Message handler function
1064
+ */
1065
+ subscribe<T = unknown>(queue: string, handler: QueueHandler<T>): Promise<void>;
1066
+ /**
1067
+ * Unsubscribe from a named queue
1068
+ * @param queue - Queue name
1069
+ */
1070
+ unsubscribe(queue: string): Promise<void>;
1071
+ /**
1072
+ * Get the number of messages waiting in a queue
1073
+ * @param queue - Queue name
1074
+ * @returns Number of pending messages
1075
+ */
1076
+ getQueueSize?(queue: string): Promise<number>;
1077
+ /**
1078
+ * Purge all messages from a queue
1079
+ * @param queue - Queue name
1080
+ */
1081
+ purge?(queue: string): Promise<void>;
1082
+ }
1083
+
1084
+ /**
1085
+ * INotificationService - Notification Service Contract
1086
+ *
1087
+ * Defines the interface for sending notifications in ObjectStack.
1088
+ * Concrete implementations (Email, Push, SMS, Slack, etc.)
1089
+ * should implement this interface.
1090
+ *
1091
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1092
+ * not on concrete notification provider implementations.
1093
+ *
1094
+ * Aligned with CoreServiceName 'notification' in core-services.zod.ts.
1095
+ */
1096
+ /**
1097
+ * Supported notification delivery channels
1098
+ */
1099
+ type NotificationChannel = 'email' | 'sms' | 'push' | 'in-app' | 'slack' | 'teams' | 'webhook';
1100
+ /**
1101
+ * A notification message to be sent
1102
+ */
1103
+ interface NotificationMessage {
1104
+ /** Notification channel to use */
1105
+ channel: NotificationChannel;
1106
+ /** Recipient identifier (email, phone, user ID, etc.) */
1107
+ to: string | string[];
1108
+ /** Notification subject/title */
1109
+ subject?: string;
1110
+ /** Notification body content */
1111
+ body: string;
1112
+ /** Template identifier (if using a pre-defined template) */
1113
+ templateId?: string;
1114
+ /** Template variable values */
1115
+ templateData?: Record<string, unknown>;
1116
+ /** Additional metadata */
1117
+ metadata?: Record<string, unknown>;
1118
+ }
1119
+ /**
1120
+ * Result of sending a notification
1121
+ */
1122
+ interface NotificationResult {
1123
+ /** Whether the notification was sent successfully */
1124
+ success: boolean;
1125
+ /** Unique identifier for tracking */
1126
+ messageId?: string;
1127
+ /** Error message if sending failed */
1128
+ error?: string;
1129
+ }
1130
+ interface INotificationService {
1131
+ /**
1132
+ * Send a notification
1133
+ * @param message - The notification message to send
1134
+ * @returns Result indicating success or failure
1135
+ */
1136
+ send(message: NotificationMessage): Promise<NotificationResult>;
1137
+ /**
1138
+ * Send multiple notifications in a batch
1139
+ * @param messages - Array of notification messages
1140
+ * @returns Array of results for each message
1141
+ */
1142
+ sendBatch?(messages: NotificationMessage[]): Promise<NotificationResult[]>;
1143
+ /**
1144
+ * List available notification channels
1145
+ * @returns Array of supported channel names
1146
+ */
1147
+ getChannels?(): NotificationChannel[];
1148
+ }
1149
+
1150
+ /**
1151
+ * IStorageService - File Storage Service Contract
1152
+ *
1153
+ * Defines the interface for file/object storage in ObjectStack.
1154
+ * Concrete implementations (S3, Azure Blob, Local FS, etc.)
1155
+ * should implement this interface.
1156
+ *
1157
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1158
+ * not on concrete storage implementations.
1159
+ *
1160
+ * Aligned with CoreServiceName 'file-storage' in core-services.zod.ts.
1161
+ */
1162
+ /**
1163
+ * Options for uploading a file
1164
+ */
1165
+ interface StorageUploadOptions {
1166
+ /** MIME content type */
1167
+ contentType?: string;
1168
+ /** Custom metadata key-value pairs */
1169
+ metadata?: Record<string, string>;
1170
+ /** Access control level */
1171
+ acl?: 'private' | 'public-read';
1172
+ }
1173
+ /**
1174
+ * Metadata about a stored file
1175
+ */
1176
+ interface StorageFileInfo {
1177
+ /** File key/path */
1178
+ key: string;
1179
+ /** File size in bytes */
1180
+ size: number;
1181
+ /** MIME content type */
1182
+ contentType?: string;
1183
+ /** Last modified timestamp */
1184
+ lastModified: Date;
1185
+ /** Custom metadata */
1186
+ metadata?: Record<string, string>;
1187
+ }
1188
+ interface IStorageService {
1189
+ /**
1190
+ * Upload a file to storage
1191
+ * @param key - Storage key/path for the file
1192
+ * @param data - File content as Buffer or readable stream
1193
+ * @param options - Upload options (content type, metadata, ACL)
1194
+ */
1195
+ upload(key: string, data: Buffer | ReadableStream, options?: StorageUploadOptions): Promise<void>;
1196
+ /**
1197
+ * Download a file from storage
1198
+ * @param key - Storage key/path
1199
+ * @returns File content as Buffer
1200
+ */
1201
+ download(key: string): Promise<Buffer>;
1202
+ /**
1203
+ * Delete a file from storage
1204
+ * @param key - Storage key/path
1205
+ */
1206
+ delete(key: string): Promise<void>;
1207
+ /**
1208
+ * Check if a file exists in storage
1209
+ * @param key - Storage key/path
1210
+ * @returns True if the file exists
1211
+ */
1212
+ exists(key: string): Promise<boolean>;
1213
+ /**
1214
+ * Get metadata about a stored file
1215
+ * @param key - Storage key/path
1216
+ * @returns File info including size, content type, and last modified date
1217
+ */
1218
+ getInfo(key: string): Promise<StorageFileInfo>;
1219
+ /**
1220
+ * List files in a directory/prefix
1221
+ * @param prefix - Key prefix to list
1222
+ * @returns Array of file info objects
1223
+ */
1224
+ list?(prefix: string): Promise<StorageFileInfo[]>;
1225
+ /**
1226
+ * Generate a pre-signed URL for temporary access
1227
+ * @param key - Storage key/path
1228
+ * @param expiresIn - URL expiration time in seconds
1229
+ * @returns Pre-signed URL string
1230
+ */
1231
+ getSignedUrl?(key: string, expiresIn: number): Promise<string>;
1232
+ }
1233
+
1234
+ /**
1235
+ * IMetadataService - Metadata Service Contract
1236
+ *
1237
+ * Defines the async interface for managing object/field definitions in ObjectStack.
1238
+ * Concrete implementations (SchemaRegistry, Database-backed, etc.)
1239
+ * should implement this interface.
1240
+ *
1241
+ * All methods are async to support database-backed persistence via datasource.
1242
+ *
1243
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1244
+ * not on concrete metadata storage implementations.
1245
+ *
1246
+ * Aligned with CoreServiceName 'metadata' in core-services.zod.ts.
1247
+ */
1248
+ interface IMetadataService {
1249
+ /**
1250
+ * Register/save a metadata item by type
1251
+ * @param type - Metadata type (e.g. 'object', 'view', 'flow')
1252
+ * @param name - Item name/identifier (snake_case)
1253
+ * @param data - The metadata definition to register
1254
+ */
1255
+ register(type: string, name: string, data: unknown): Promise<void>;
1256
+ /**
1257
+ * Get a metadata item by type and name
1258
+ * @param type - Metadata type
1259
+ * @param name - Item name/identifier
1260
+ * @returns The metadata definition, or undefined if not found
1261
+ */
1262
+ get(type: string, name: string): Promise<unknown | undefined>;
1263
+ /**
1264
+ * List all metadata items of a given type
1265
+ * @param type - Metadata type
1266
+ * @returns Array of metadata definitions
1267
+ */
1268
+ list(type: string): Promise<unknown[]>;
1269
+ /**
1270
+ * Unregister/remove a metadata item by type and name
1271
+ * @param type - Metadata type
1272
+ * @param name - Item name/identifier
1273
+ */
1274
+ unregister(type: string, name: string): Promise<void>;
1275
+ /**
1276
+ * Check if a metadata item exists
1277
+ * @param type - Metadata type
1278
+ * @param name - Item name/identifier
1279
+ * @returns True if the item exists
1280
+ */
1281
+ exists(type: string, name: string): Promise<boolean>;
1282
+ /**
1283
+ * List all names of metadata items of a given type
1284
+ * @param type - Metadata type
1285
+ * @returns Array of item names
1286
+ */
1287
+ listNames(type: string): Promise<string[]>;
1288
+ /**
1289
+ * Convenience: get an object definition by name
1290
+ * @param name - Object name (snake_case)
1291
+ * @returns The object definition, or undefined if not found
1292
+ */
1293
+ getObject(name: string): Promise<unknown | undefined>;
1294
+ /**
1295
+ * Convenience: list all object definitions
1296
+ * @returns Array of object definitions
1297
+ */
1298
+ listObjects(): Promise<unknown[]>;
1299
+ /**
1300
+ * Unregister all metadata items from a specific package
1301
+ * @param packageName - The package name whose items should be removed
1302
+ */
1303
+ unregisterPackage?(packageName: string): Promise<void>;
1304
+ }
1305
+
1306
+ /**
1307
+ * IAuthService - Authentication Service Contract
1308
+ *
1309
+ * Defines the interface for authentication and session management in ObjectStack.
1310
+ * Concrete implementations (better-auth, custom, LDAP, etc.)
1311
+ * should implement this interface.
1312
+ *
1313
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1314
+ * not on concrete auth provider implementations.
1315
+ *
1316
+ * Aligned with CoreServiceName 'auth' in core-services.zod.ts.
1317
+ */
1318
+ /**
1319
+ * Authenticated session user information
1320
+ */
1321
+ interface AuthUser {
1322
+ /** User identifier */
1323
+ id: string;
1324
+ /** Email address */
1325
+ email: string;
1326
+ /** Display name */
1327
+ name: string;
1328
+ /** Assigned role identifiers */
1329
+ roles?: string[];
1330
+ /** Current tenant identifier (multi-tenant) */
1331
+ tenantId?: string;
1332
+ }
1333
+ /**
1334
+ * Active session information
1335
+ */
1336
+ interface AuthSession {
1337
+ /** Session identifier */
1338
+ id: string;
1339
+ /** Associated user identifier */
1340
+ userId: string;
1341
+ /** Session expiry (ISO 8601) */
1342
+ expiresAt: string;
1343
+ /** Bearer token (if not using cookies) */
1344
+ token?: string;
1345
+ }
1346
+ /**
1347
+ * Authentication result returned by login/verify operations
1348
+ */
1349
+ interface AuthResult {
1350
+ /** Whether authentication succeeded */
1351
+ success: boolean;
1352
+ /** Authenticated user (if success) */
1353
+ user?: AuthUser;
1354
+ /** Active session (if success) */
1355
+ session?: AuthSession;
1356
+ /** Error message (if failure) */
1357
+ error?: string;
1358
+ }
1359
+ interface IAuthService {
1360
+ /**
1361
+ * Handle an incoming HTTP authentication request
1362
+ * @param request - Standard Request object
1363
+ * @returns Standard Response object
1364
+ */
1365
+ handleRequest(request: Request): Promise<Response>;
1366
+ /**
1367
+ * Verify a session token or cookie and return the user
1368
+ * @param token - Bearer token or session identifier
1369
+ * @returns Auth result with user and session if valid
1370
+ */
1371
+ verify(token: string): Promise<AuthResult>;
1372
+ /**
1373
+ * Invalidate a session (logout)
1374
+ * @param sessionId - Session identifier to invalidate
1375
+ */
1376
+ logout?(sessionId: string): Promise<void>;
1377
+ /**
1378
+ * Get the current user from a request
1379
+ * @param request - Standard Request object
1380
+ * @returns Authenticated user or undefined
1381
+ */
1382
+ getCurrentUser?(request: Request): Promise<AuthUser | undefined>;
1383
+ }
1384
+
1385
+ /**
1386
+ * IAutomationService - Automation Service Contract
1387
+ *
1388
+ * Defines the interface for flow/script execution in ObjectStack.
1389
+ * Concrete implementations (Flow Engine, Script Runner, etc.)
1390
+ * should implement this interface.
1391
+ *
1392
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1393
+ * not on concrete automation engine implementations.
1394
+ *
1395
+ * Aligned with CoreServiceName 'automation' in core-services.zod.ts.
1396
+ */
1397
+ /**
1398
+ * Context passed to a flow/script execution
1399
+ */
1400
+ interface AutomationContext {
1401
+ /** Record that triggered the automation (if applicable) */
1402
+ record?: Record<string, unknown>;
1403
+ /** Object name the record belongs to */
1404
+ object?: string;
1405
+ /** Trigger event type (e.g. 'on_create', 'on_update') */
1406
+ event?: string;
1407
+ /** User who triggered the automation */
1408
+ userId?: string;
1409
+ /** Additional contextual data */
1410
+ params?: Record<string, unknown>;
1411
+ }
1412
+ /**
1413
+ * Result of an automation execution
1414
+ */
1415
+ interface AutomationResult {
1416
+ /** Whether the automation completed successfully */
1417
+ success: boolean;
1418
+ /** Output data from the automation */
1419
+ output?: unknown;
1420
+ /** Error message if execution failed */
1421
+ error?: string;
1422
+ /** Execution duration in milliseconds */
1423
+ durationMs?: number;
1424
+ }
1425
+ interface IAutomationService {
1426
+ /**
1427
+ * Execute a named flow or script
1428
+ * @param flowName - Flow/script identifier (snake_case)
1429
+ * @param context - Execution context with trigger data
1430
+ * @returns Automation result
1431
+ */
1432
+ execute(flowName: string, context?: AutomationContext): Promise<AutomationResult>;
1433
+ /**
1434
+ * List all registered automation flows
1435
+ * @returns Array of flow names
1436
+ */
1437
+ listFlows(): Promise<string[]>;
1438
+ /**
1439
+ * Register a flow definition
1440
+ * @param name - Flow name (snake_case)
1441
+ * @param definition - Flow definition object
1442
+ */
1443
+ registerFlow?(name: string, definition: unknown): void;
1444
+ /**
1445
+ * Unregister a flow by name
1446
+ * @param name - Flow name (snake_case)
1447
+ */
1448
+ unregisterFlow?(name: string): void;
1449
+ }
1450
+
1451
+ /**
1452
+ * IGraphQLService - GraphQL Service Contract
1453
+ *
1454
+ * Defines the interface for GraphQL schema and query execution in ObjectStack.
1455
+ * Concrete implementations (Apollo, Yoga, Mercurius, etc.)
1456
+ * should implement this interface.
1457
+ *
1458
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1459
+ * not on concrete GraphQL server implementations.
1460
+ *
1461
+ * Aligned with CoreServiceName 'graphql' in core-services.zod.ts.
1462
+ */
1463
+ /**
1464
+ * A GraphQL execution request
1465
+ */
1466
+ interface GraphQLRequest {
1467
+ /** GraphQL query or mutation string */
1468
+ query: string;
1469
+ /** Operation name (when document contains multiple operations) */
1470
+ operationName?: string;
1471
+ /** Variables for the operation */
1472
+ variables?: Record<string, unknown>;
1473
+ }
1474
+ /**
1475
+ * A GraphQL execution response
1476
+ */
1477
+ interface GraphQLResponse {
1478
+ /** Query result data */
1479
+ data?: Record<string, unknown> | null;
1480
+ /** Errors encountered during execution */
1481
+ errors?: Array<{
1482
+ message: string;
1483
+ locations?: Array<{
1484
+ line: number;
1485
+ column: number;
1486
+ }>;
1487
+ path?: Array<string | number>;
1488
+ extensions?: Record<string, unknown>;
1489
+ }>;
1490
+ }
1491
+ interface IGraphQLService {
1492
+ /**
1493
+ * Execute a GraphQL query or mutation
1494
+ * @param request - The GraphQL request
1495
+ * @param context - Optional execution context (e.g. auth user)
1496
+ * @returns GraphQL response with data and/or errors
1497
+ */
1498
+ execute(request: GraphQLRequest, context?: Record<string, unknown>): Promise<GraphQLResponse>;
1499
+ /**
1500
+ * Handle an incoming HTTP request for GraphQL
1501
+ * @param request - Standard Request object
1502
+ * @returns Standard Response object
1503
+ */
1504
+ handleRequest?(request: Request): Promise<Response>;
1505
+ /**
1506
+ * Get the current GraphQL schema as SDL string
1507
+ * @returns SDL schema string
1508
+ */
1509
+ getSchema?(): string;
1510
+ }
1511
+
1512
+ /**
1513
+ * IAnalyticsService - Analytics / BI Service Contract
1514
+ *
1515
+ * Defines the interface for analytical query execution and semantic layer
1516
+ * metadata discovery in ObjectStack. Concrete implementations (Cube.js, custom, etc.)
1517
+ * should implement this interface.
1518
+ *
1519
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1520
+ * not on concrete analytics engine implementations.
1521
+ *
1522
+ * Aligned with CoreServiceName 'analytics' in core-services.zod.ts.
1523
+ */
1524
+ /**
1525
+ * An analytical query definition
1526
+ */
1527
+ interface AnalyticsQuery {
1528
+ /** Target cube name */
1529
+ cube: string;
1530
+ /** Measures to compute (e.g. ['orders.count', 'orders.totalRevenue']) */
1531
+ measures?: string[];
1532
+ /** Dimensions to group by (e.g. ['orders.status', 'orders.createdAt']) */
1533
+ dimensions?: string[];
1534
+ /** Filter conditions */
1535
+ filters?: Array<{
1536
+ member: string;
1537
+ operator: string;
1538
+ values?: string[];
1539
+ }>;
1540
+ /** Time dimension configuration */
1541
+ timeDimensions?: Array<{
1542
+ dimension: string;
1543
+ granularity?: string;
1544
+ dateRange?: string | string[];
1545
+ }>;
1546
+ /** Result limit */
1547
+ limit?: number;
1548
+ /** Result offset */
1549
+ offset?: number;
1550
+ }
1551
+ /**
1552
+ * Analytics query result
1553
+ */
1554
+ interface AnalyticsResult {
1555
+ /** Result rows */
1556
+ rows: Record<string, unknown>[];
1557
+ /** Column metadata */
1558
+ fields: Array<{
1559
+ name: string;
1560
+ type: string;
1561
+ }>;
1562
+ /** Generated SQL (if available) */
1563
+ sql?: string;
1564
+ }
1565
+ /**
1566
+ * Cube metadata for discovery
1567
+ */
1568
+ interface CubeMeta {
1569
+ /** Cube name */
1570
+ name: string;
1571
+ /** Human-readable title */
1572
+ title?: string;
1573
+ /** Available measures */
1574
+ measures: Array<{
1575
+ name: string;
1576
+ type: string;
1577
+ title?: string;
1578
+ }>;
1579
+ /** Available dimensions */
1580
+ dimensions: Array<{
1581
+ name: string;
1582
+ type: string;
1583
+ title?: string;
1584
+ }>;
1585
+ }
1586
+ interface IAnalyticsService {
1587
+ /**
1588
+ * Execute an analytical query
1589
+ * @param query - The analytics query definition
1590
+ * @returns Query results with rows and field metadata
1591
+ */
1592
+ query(query: AnalyticsQuery): Promise<AnalyticsResult>;
1593
+ /**
1594
+ * Get available cube metadata for discovery
1595
+ * @param cubeName - Optional cube name to filter (returns all if omitted)
1596
+ * @returns Array of cube metadata definitions
1597
+ */
1598
+ getMeta(cubeName?: string): Promise<CubeMeta[]>;
1599
+ /**
1600
+ * Generate SQL for a query without executing it (dry-run)
1601
+ * @param query - The analytics query definition
1602
+ * @returns Generated SQL string and parameters
1603
+ */
1604
+ generateSql?(query: AnalyticsQuery): Promise<{
1605
+ sql: string;
1606
+ params: unknown[];
1607
+ }>;
1608
+ }
1609
+
1610
+ /**
1611
+ * IRealtimeService - Realtime / PubSub Service Contract
1612
+ *
1613
+ * Defines the interface for realtime event subscription and publishing
1614
+ * in ObjectStack. Concrete implementations (WebSocket, SSE, Socket.IO, etc.)
1615
+ * should implement this interface.
1616
+ *
1617
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1618
+ * not on concrete realtime transport implementations.
1619
+ *
1620
+ * Aligned with CoreServiceName 'realtime' in core-services.zod.ts.
1621
+ */
1622
+ /**
1623
+ * A realtime event payload
1624
+ */
1625
+ interface RealtimeEventPayload {
1626
+ /** Event type (e.g. 'record.created', 'record.updated') */
1627
+ type: string;
1628
+ /** Object name the event relates to */
1629
+ object?: string;
1630
+ /** Event data */
1631
+ payload: Record<string, unknown>;
1632
+ /** Timestamp (ISO 8601) */
1633
+ timestamp: string;
1634
+ }
1635
+ /**
1636
+ * Handler function for realtime event subscriptions
1637
+ */
1638
+ type RealtimeEventHandler = (event: RealtimeEventPayload) => void | Promise<void>;
1639
+ /**
1640
+ * Subscription options for filtering events
1641
+ */
1642
+ interface RealtimeSubscriptionOptions {
1643
+ /** Object name to filter events for */
1644
+ object?: string;
1645
+ /** Event types to listen for */
1646
+ eventTypes?: string[];
1647
+ /** Additional filter conditions */
1648
+ filter?: Record<string, unknown>;
1649
+ }
1650
+ interface IRealtimeService {
1651
+ /**
1652
+ * Publish an event to all subscribers
1653
+ * @param event - The event to publish
1654
+ */
1655
+ publish(event: RealtimeEventPayload): Promise<void>;
1656
+ /**
1657
+ * Subscribe to realtime events
1658
+ * @param channel - Channel/topic name
1659
+ * @param handler - Event handler function
1660
+ * @param options - Optional subscription filters
1661
+ * @returns Subscription identifier for unsubscribing
1662
+ */
1663
+ subscribe(channel: string, handler: RealtimeEventHandler, options?: RealtimeSubscriptionOptions): Promise<string>;
1664
+ /**
1665
+ * Unsubscribe from a channel
1666
+ * @param subscriptionId - Subscription identifier returned by subscribe()
1667
+ */
1668
+ unsubscribe(subscriptionId: string): Promise<void>;
1669
+ /**
1670
+ * Handle an incoming HTTP upgrade request (WebSocket handshake)
1671
+ * @param request - Standard Request object
1672
+ * @returns Standard Response object
1673
+ */
1674
+ handleUpgrade?(request: Request): Promise<Response>;
1675
+ }
1676
+
1677
+ /**
1678
+ * IJobService - Background Job Service Contract
1679
+ *
1680
+ * Defines the interface for scheduling and managing background jobs
1681
+ * in ObjectStack. Concrete implementations (BullMQ, node-cron, etc.)
1682
+ * should implement this interface.
1683
+ *
1684
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1685
+ * not on concrete job scheduler implementations.
1686
+ *
1687
+ * Aligned with CoreServiceName 'job' in core-services.zod.ts.
1688
+ */
1689
+ /**
1690
+ * Schedule definition for a job
1691
+ */
1692
+ interface JobSchedule {
1693
+ /** Schedule type */
1694
+ type: 'cron' | 'interval' | 'once';
1695
+ /** Cron expression (when type is 'cron') */
1696
+ expression?: string;
1697
+ /** Timezone for cron (when type is 'cron') */
1698
+ timezone?: string;
1699
+ /** Interval in milliseconds (when type is 'interval') */
1700
+ intervalMs?: number;
1701
+ /** ISO 8601 datetime (when type is 'once') */
1702
+ at?: string;
1703
+ }
1704
+ /**
1705
+ * Job handler function
1706
+ */
1707
+ type JobHandler = (context: {
1708
+ jobId: string;
1709
+ data?: unknown;
1710
+ }) => Promise<void>;
1711
+ /**
1712
+ * Status of a job execution
1713
+ */
1714
+ interface JobExecution {
1715
+ /** Job identifier */
1716
+ jobId: string;
1717
+ /** Execution status */
1718
+ status: 'running' | 'success' | 'failed' | 'timeout';
1719
+ /** Start time (ISO 8601) */
1720
+ startedAt: string;
1721
+ /** Completion time (ISO 8601) */
1722
+ completedAt?: string;
1723
+ /** Error message if failed */
1724
+ error?: string;
1725
+ /** Duration in milliseconds */
1726
+ durationMs?: number;
1727
+ }
1728
+ interface IJobService {
1729
+ /**
1730
+ * Schedule a recurring or one-time job
1731
+ * @param name - Job name (snake_case)
1732
+ * @param schedule - Schedule configuration
1733
+ * @param handler - Job handler function
1734
+ */
1735
+ schedule(name: string, schedule: JobSchedule, handler: JobHandler): Promise<void>;
1736
+ /**
1737
+ * Cancel a scheduled job
1738
+ * @param name - Job name
1739
+ */
1740
+ cancel(name: string): Promise<void>;
1741
+ /**
1742
+ * Trigger a job to run immediately (outside its normal schedule)
1743
+ * @param name - Job name
1744
+ * @param data - Optional data to pass to the handler
1745
+ */
1746
+ trigger(name: string, data?: unknown): Promise<void>;
1747
+ /**
1748
+ * Get the status of recent job executions
1749
+ * @param name - Job name
1750
+ * @param limit - Maximum number of executions to return
1751
+ * @returns Array of job execution records
1752
+ */
1753
+ getExecutions?(name: string, limit?: number): Promise<JobExecution[]>;
1754
+ /**
1755
+ * List all registered job names
1756
+ * @returns Array of job names
1757
+ */
1758
+ listJobs?(): Promise<string[]>;
1759
+ }
1760
+
1761
+ /**
1762
+ * IAIService - AI Engine Service Contract
1763
+ *
1764
+ * Defines the interface for AI capabilities (NLQ, chat, suggestions, embeddings)
1765
+ * in ObjectStack. Concrete implementations (OpenAI, Anthropic, Ollama, etc.)
1766
+ * should implement this interface.
1767
+ *
1768
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1769
+ * not on concrete AI/LLM provider implementations.
1770
+ *
1771
+ * Aligned with CoreServiceName 'ai' in core-services.zod.ts.
1772
+ */
1773
+ /**
1774
+ * A chat message in a conversation
1775
+ */
1776
+ interface AIMessage {
1777
+ /** Message role */
1778
+ role: 'system' | 'user' | 'assistant';
1779
+ /** Message content */
1780
+ content: string;
1781
+ }
1782
+ /**
1783
+ * Options for AI completion/chat requests
1784
+ */
1785
+ interface AIRequestOptions {
1786
+ /** Model identifier to use */
1787
+ model?: string;
1788
+ /** Sampling temperature (0-2) */
1789
+ temperature?: number;
1790
+ /** Maximum tokens to generate */
1791
+ maxTokens?: number;
1792
+ /** Stop sequences */
1793
+ stop?: string[];
1794
+ }
1795
+ /**
1796
+ * Result of an AI completion/chat request
1797
+ */
1798
+ interface AIResult {
1799
+ /** Generated text content */
1800
+ content: string;
1801
+ /** Model used for generation */
1802
+ model?: string;
1803
+ /** Token usage statistics */
1804
+ usage?: {
1805
+ promptTokens: number;
1806
+ completionTokens: number;
1807
+ totalTokens: number;
1808
+ };
1809
+ }
1810
+ interface IAIService {
1811
+ /**
1812
+ * Generate a chat completion from a conversation
1813
+ * @param messages - Array of conversation messages
1814
+ * @param options - Optional request configuration
1815
+ * @returns AI-generated response
1816
+ */
1817
+ chat(messages: AIMessage[], options?: AIRequestOptions): Promise<AIResult>;
1818
+ /**
1819
+ * Generate a text completion from a prompt
1820
+ * @param prompt - Input prompt string
1821
+ * @param options - Optional request configuration
1822
+ * @returns AI-generated response
1823
+ */
1824
+ complete(prompt: string, options?: AIRequestOptions): Promise<AIResult>;
1825
+ /**
1826
+ * Generate embeddings for a text input
1827
+ * @param input - Text or array of texts to embed
1828
+ * @param model - Optional embedding model identifier
1829
+ * @returns Array of embedding vectors
1830
+ */
1831
+ embed?(input: string | string[], model?: string): Promise<number[][]>;
1832
+ /**
1833
+ * List available models
1834
+ * @returns Array of model identifiers
1835
+ */
1836
+ listModels?(): Promise<string[]>;
1837
+ }
1838
+
1839
+ /**
1840
+ * II18nService - Internationalization Service Contract
1841
+ *
1842
+ * Defines the interface for translation and locale management in ObjectStack.
1843
+ * Concrete implementations (i18next, custom, etc.)
1844
+ * should implement this interface.
1845
+ *
1846
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1847
+ * not on concrete i18n library implementations.
1848
+ *
1849
+ * Aligned with CoreServiceName 'i18n' in core-services.zod.ts.
1850
+ */
1851
+ interface II18nService {
1852
+ /**
1853
+ * Translate a message key for a given locale
1854
+ * @param key - Translation key (e.g. 'objects.account.label')
1855
+ * @param locale - BCP-47 locale code (e.g. 'en-US', 'zh-CN')
1856
+ * @param params - Optional interpolation parameters
1857
+ * @returns Translated string, or the key itself if not found
1858
+ */
1859
+ t(key: string, locale: string, params?: Record<string, unknown>): string;
1860
+ /**
1861
+ * Get all translations for a locale
1862
+ * @param locale - BCP-47 locale code
1863
+ * @returns Translation data map
1864
+ */
1865
+ getTranslations(locale: string): Record<string, unknown>;
1866
+ /**
1867
+ * Load translations for a locale
1868
+ * @param locale - BCP-47 locale code
1869
+ * @param translations - Translation key-value data
1870
+ */
1871
+ loadTranslations(locale: string, translations: Record<string, unknown>): void;
1872
+ /**
1873
+ * List available locales
1874
+ * @returns Array of BCP-47 locale codes
1875
+ */
1876
+ getLocales(): string[];
1877
+ /**
1878
+ * Get the current default locale
1879
+ * @returns BCP-47 locale code
1880
+ */
1881
+ getDefaultLocale?(): string;
1882
+ /**
1883
+ * Set the default locale
1884
+ * @param locale - BCP-47 locale code
1885
+ */
1886
+ setDefaultLocale?(locale: string): void;
1887
+ }
1888
+
1889
+ /**
1890
+ * IUIService - UI Metadata Service Contract
1891
+ *
1892
+ * Defines the interface for managing UI metadata (views, dashboards, layouts)
1893
+ * in ObjectStack. Concrete implementations (database-backed, in-memory, etc.)
1894
+ * should implement this interface.
1895
+ *
1896
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1897
+ * not on concrete UI metadata storage implementations.
1898
+ *
1899
+ * Aligned with CoreServiceName 'ui' in core-services.zod.ts.
1900
+ */
1901
+ interface IUIService {
1902
+ /**
1903
+ * Get a view definition by name
1904
+ * @param name - View name (snake_case)
1905
+ * @returns View definition, or undefined if not found
1906
+ */
1907
+ getView(name: string): unknown | undefined;
1908
+ /**
1909
+ * List view definitions, optionally filtered by object
1910
+ * @param object - Optional object name to filter views for
1911
+ * @returns Array of view definitions
1912
+ */
1913
+ listViews(object?: string): unknown[];
1914
+ /**
1915
+ * Get a dashboard definition by name
1916
+ * @param name - Dashboard name (snake_case)
1917
+ * @returns Dashboard definition, or undefined if not found
1918
+ */
1919
+ getDashboard?(name: string): unknown | undefined;
1920
+ /**
1921
+ * List all dashboard definitions
1922
+ * @returns Array of dashboard definitions
1923
+ */
1924
+ listDashboards?(): unknown[];
1925
+ /**
1926
+ * Register a view definition
1927
+ * @param name - View name (snake_case)
1928
+ * @param definition - View definition object
1929
+ */
1930
+ registerView?(name: string, definition: unknown): void;
1931
+ /**
1932
+ * Register a dashboard definition
1933
+ * @param name - Dashboard name (snake_case)
1934
+ * @param definition - Dashboard definition object
1935
+ */
1936
+ registerDashboard?(name: string, definition: unknown): void;
1937
+ }
1938
+
1939
+ /**
1940
+ * IWorkflowService - Workflow State Machine Service Contract
1941
+ *
1942
+ * Defines the interface for workflow state management and approval processes
1943
+ * in ObjectStack. Concrete implementations (state machine engines, BPMN, etc.)
1944
+ * should implement this interface.
1945
+ *
1946
+ * Follows Dependency Inversion Principle - plugins depend on this interface,
1947
+ * not on concrete workflow engine implementations.
1948
+ *
1949
+ * Aligned with CoreServiceName 'workflow' in core-services.zod.ts.
1950
+ */
1951
+ /**
1952
+ * A state transition request
1953
+ */
1954
+ interface WorkflowTransition {
1955
+ /** Record identifier */
1956
+ recordId: string;
1957
+ /** Object name the record belongs to */
1958
+ object: string;
1959
+ /** Target state to transition to */
1960
+ targetState: string;
1961
+ /** Optional comment for the transition */
1962
+ comment?: string;
1963
+ /** User performing the transition */
1964
+ userId?: string;
1965
+ }
1966
+ /**
1967
+ * Result of a transition attempt
1968
+ */
1969
+ interface WorkflowTransitionResult {
1970
+ /** Whether the transition succeeded */
1971
+ success: boolean;
1972
+ /** The new current state (if success) */
1973
+ currentState?: string;
1974
+ /** Error or rejection reason (if failure) */
1975
+ error?: string;
1976
+ }
1977
+ /**
1978
+ * Status of a workflow instance
1979
+ */
1980
+ interface WorkflowStatus {
1981
+ /** Record identifier */
1982
+ recordId: string;
1983
+ /** Object name */
1984
+ object: string;
1985
+ /** Current state */
1986
+ currentState: string;
1987
+ /** Available transitions from the current state */
1988
+ availableTransitions: string[];
1989
+ }
1990
+ interface IWorkflowService {
1991
+ /**
1992
+ * Transition a record to a new workflow state
1993
+ * @param transition - Transition request details
1994
+ * @returns Transition result
1995
+ */
1996
+ transition(transition: WorkflowTransition): Promise<WorkflowTransitionResult>;
1997
+ /**
1998
+ * Get the current workflow status of a record
1999
+ * @param object - Object name
2000
+ * @param recordId - Record identifier
2001
+ * @returns Current workflow status with available transitions
2002
+ */
2003
+ getStatus(object: string, recordId: string): Promise<WorkflowStatus>;
2004
+ /**
2005
+ * Get transition history for a record
2006
+ * @param object - Object name
2007
+ * @param recordId - Record identifier
2008
+ * @returns Array of historical transitions
2009
+ */
2010
+ getHistory?(object: string, recordId: string): Promise<Array<{
2011
+ fromState: string;
2012
+ toState: string;
2013
+ userId?: string;
2014
+ comment?: string;
2015
+ timestamp: string;
2016
+ }>>;
2017
+ }
2018
+
2019
+ /**
2020
+ * ObjectStack Contracts
2021
+ *
2022
+ * Core interface definitions following "Protocol First" principle.
2023
+ * All interfaces should be defined in @objectstack/spec to avoid circular dependencies.
2024
+ */
2025
+
2026
+ type index_AIMessage = AIMessage;
2027
+ type index_AIRequestOptions = AIRequestOptions;
2028
+ type index_AIResult = AIResult;
2029
+ type index_AnalyticsQuery = AnalyticsQuery;
2030
+ type index_AnalyticsResult = AnalyticsResult;
2031
+ type index_AuthResult = AuthResult;
2032
+ type index_AuthSession = AuthSession;
2033
+ type index_AuthUser = AuthUser;
2034
+ type index_AutomationContext = AutomationContext;
2035
+ type index_AutomationResult = AutomationResult;
2036
+ type index_CacheStats = CacheStats;
2037
+ type index_CubeMeta = CubeMeta;
2038
+ type index_DriverInterface = DriverInterface;
2039
+ type index_GraphQLRequest = GraphQLRequest;
2040
+ type index_GraphQLResponse = GraphQLResponse;
2041
+ type index_HealthStatus = HealthStatus;
2042
+ type index_IAIService = IAIService;
2043
+ type index_IAdvancedServiceRegistry = IAdvancedServiceRegistry;
2044
+ type index_IAnalyticsService = IAnalyticsService;
2045
+ type index_IAuthService = IAuthService;
2046
+ type index_IAutomationService = IAutomationService;
2047
+ type index_IBasicServiceRegistry = IBasicServiceRegistry;
2048
+ type index_ICacheService = ICacheService;
2049
+ type index_IDataDriver = IDataDriver;
2050
+ type index_IDataEngine = IDataEngine;
2051
+ type index_IGraphQLService = IGraphQLService;
2052
+ type index_IHttpRequest = IHttpRequest;
2053
+ type index_IHttpResponse = IHttpResponse;
2054
+ type index_IHttpServer = IHttpServer;
2055
+ type index_II18nService = II18nService;
2056
+ type index_IJobService = IJobService;
2057
+ type index_IMetadataService = IMetadataService;
2058
+ type index_INotificationService = INotificationService;
2059
+ type index_IPluginLifecycleEvents = IPluginLifecycleEvents;
2060
+ type index_IPluginValidator = IPluginValidator;
2061
+ type index_IQueueService = IQueueService;
2062
+ type index_IRealtimeService = IRealtimeService;
2063
+ type index_ISchemaDriver = ISchemaDriver;
2064
+ type index_ISearchService = ISearchService;
2065
+ type index_IServiceRegistry = IServiceRegistry;
2066
+ type index_IStartupOrchestrator = IStartupOrchestrator;
2067
+ type index_IStorageService = IStorageService;
2068
+ type index_ITypedEventEmitter<Events extends Record<string, any[]>> = ITypedEventEmitter<Events>;
2069
+ type index_IUIService = IUIService;
2070
+ type index_IWorkflowService = IWorkflowService;
2071
+ type index_JobExecution = JobExecution;
2072
+ type index_JobHandler = JobHandler;
2073
+ type index_JobSchedule = JobSchedule;
2074
+ type index_Logger = Logger;
2075
+ type index_Middleware = Middleware;
2076
+ type index_NotificationChannel = NotificationChannel;
2077
+ type index_NotificationMessage = NotificationMessage;
2078
+ type index_NotificationResult = NotificationResult;
2079
+ type index_Plugin = Plugin;
2080
+ type index_PluginStartupResult = PluginStartupResult;
2081
+ type index_QueueHandler<T = unknown> = QueueHandler<T>;
2082
+ type index_QueueMessage<T = unknown> = QueueMessage<T>;
2083
+ type index_QueuePublishOptions = QueuePublishOptions;
2084
+ type index_RealtimeEventHandler = RealtimeEventHandler;
2085
+ type index_RealtimeEventPayload = RealtimeEventPayload;
2086
+ type index_RealtimeSubscriptionOptions = RealtimeSubscriptionOptions;
2087
+ type index_RouteHandler = RouteHandler;
2088
+ type index_SearchHit = SearchHit;
2089
+ type index_SearchOptions = SearchOptions;
2090
+ type index_SearchResult = SearchResult;
2091
+ type index_StartupOptions = StartupOptions;
2092
+ type index_StorageFileInfo = StorageFileInfo;
2093
+ type index_StorageUploadOptions = StorageUploadOptions;
2094
+ type index_ValidationResult = ValidationResult;
2095
+ type index_WorkflowStatus = WorkflowStatus;
2096
+ type index_WorkflowTransition = WorkflowTransition;
2097
+ type index_WorkflowTransitionResult = WorkflowTransitionResult;
2098
+ declare namespace index {
2099
+ export type { index_AIMessage as AIMessage, index_AIRequestOptions as AIRequestOptions, index_AIResult as AIResult, index_AnalyticsQuery as AnalyticsQuery, index_AnalyticsResult as AnalyticsResult, index_AuthResult as AuthResult, index_AuthSession as AuthSession, index_AuthUser as AuthUser, index_AutomationContext as AutomationContext, index_AutomationResult as AutomationResult, index_CacheStats as CacheStats, index_CubeMeta as CubeMeta, index_DriverInterface as DriverInterface, index_GraphQLRequest as GraphQLRequest, index_GraphQLResponse as GraphQLResponse, index_HealthStatus as HealthStatus, index_IAIService as IAIService, index_IAdvancedServiceRegistry as IAdvancedServiceRegistry, index_IAnalyticsService as IAnalyticsService, index_IAuthService as IAuthService, index_IAutomationService as IAutomationService, index_IBasicServiceRegistry as IBasicServiceRegistry, index_ICacheService as ICacheService, index_IDataDriver as IDataDriver, index_IDataEngine as IDataEngine, index_IGraphQLService as IGraphQLService, index_IHttpRequest as IHttpRequest, index_IHttpResponse as IHttpResponse, index_IHttpServer as IHttpServer, index_II18nService as II18nService, index_IJobService as IJobService, index_IMetadataService as IMetadataService, index_INotificationService as INotificationService, index_IPluginLifecycleEvents as IPluginLifecycleEvents, index_IPluginValidator as IPluginValidator, index_IQueueService as IQueueService, index_IRealtimeService as IRealtimeService, index_ISchemaDriver as ISchemaDriver, index_ISearchService as ISearchService, index_IServiceRegistry as IServiceRegistry, index_IStartupOrchestrator as IStartupOrchestrator, index_IStorageService as IStorageService, index_ITypedEventEmitter as ITypedEventEmitter, index_IUIService as IUIService, index_IWorkflowService as IWorkflowService, index_JobExecution as JobExecution, index_JobHandler as JobHandler, index_JobSchedule as JobSchedule, index_Logger as Logger, index_Middleware as Middleware, index_NotificationChannel as NotificationChannel, index_NotificationMessage as NotificationMessage, index_NotificationResult as NotificationResult, index_Plugin as Plugin, index_PluginStartupResult as PluginStartupResult, index_QueueHandler as QueueHandler, index_QueueMessage as QueueMessage, index_QueuePublishOptions as QueuePublishOptions, index_RealtimeEventHandler as RealtimeEventHandler, index_RealtimeEventPayload as RealtimeEventPayload, index_RealtimeSubscriptionOptions as RealtimeSubscriptionOptions, index_RouteHandler as RouteHandler, index_SearchHit as SearchHit, index_SearchOptions as SearchOptions, index_SearchResult as SearchResult, index_StartupOptions as StartupOptions, index_StorageFileInfo as StorageFileInfo, index_StorageUploadOptions as StorageUploadOptions, index_ValidationResult as ValidationResult, index_WorkflowStatus as WorkflowStatus, index_WorkflowTransition as WorkflowTransition, index_WorkflowTransitionResult as WorkflowTransitionResult };
2100
+ }
2101
+
2102
+ export { type CubeMeta as $, type StorageFileInfo as A, type IStorageService as B, type CacheStats as C, type DriverInterface as D, type IMetadataService as E, type AuthUser as F, type AuthSession as G, type HealthStatus as H, type IDataEngine as I, type AuthResult as J, type IAuthService as K, type Logger as L, type Middleware as M, type NotificationChannel as N, type AutomationContext as O, type Plugin as P, type QueuePublishOptions as Q, type RouteHandler as R, type StartupOptions as S, type AutomationResult as T, type IAutomationService as U, type ValidationResult as V, type GraphQLRequest as W, type GraphQLResponse as X, type IGraphQLService as Y, type AnalyticsQuery as Z, type AnalyticsResult as _, type IDataDriver as a, type IAnalyticsService as a0, type RealtimeEventPayload as a1, type RealtimeEventHandler as a2, type RealtimeSubscriptionOptions as a3, type IRealtimeService as a4, type JobSchedule as a5, type JobHandler as a6, type JobExecution as a7, type IJobService as a8, type AIMessage as a9, type AIRequestOptions as aa, type AIResult as ab, type IAIService as ac, type II18nService as ad, type IUIService as ae, type WorkflowTransition as af, type WorkflowTransitionResult as ag, type WorkflowStatus as ah, type IWorkflowService as ai, type IHttpRequest as b, type IHttpResponse as c, type IHttpServer as d, type IServiceRegistry as e, type IBasicServiceRegistry as f, type IAdvancedServiceRegistry as g, type IPluginValidator as h, index as i, type PluginStartupResult as j, type IStartupOrchestrator as k, type IPluginLifecycleEvents as l, type ITypedEventEmitter as m, type ISchemaDriver as n, type ICacheService as o, type SearchOptions as p, type SearchHit as q, type SearchResult as r, type ISearchService as s, type QueueMessage as t, type QueueHandler as u, type IQueueService as v, type NotificationMessage as w, type NotificationResult as x, type INotificationService as y, type StorageUploadOptions as z };