@objectstack/spec 0.3.3 → 0.4.2

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 (304) hide show
  1. package/dist/ai/conversation.zod.d.ts +14 -14
  2. package/dist/ai/cost.zod.d.ts +112 -112
  3. package/dist/ai/model-registry.zod.d.ts +44 -44
  4. package/dist/ai/nlq.zod.d.ts +2 -2
  5. package/dist/ai/orchestration.zod.d.ts +6 -6
  6. package/dist/ai/predictive.zod.d.ts +8 -8
  7. package/dist/ai/rag-pipeline.zod.d.ts +62 -62
  8. package/dist/api/contract.zod.d.ts +92 -92
  9. package/dist/api/discovery.zod.d.ts +2 -2
  10. package/dist/api/index.d.ts +2 -0
  11. package/dist/api/index.d.ts.map +1 -1
  12. package/dist/api/index.js +2 -0
  13. package/dist/api/odata.zod.d.ts +482 -0
  14. package/dist/api/odata.zod.d.ts.map +1 -0
  15. package/dist/api/odata.zod.js +401 -0
  16. package/dist/api/router.zod.d.ts +4 -4
  17. package/dist/auth/config.zod.d.ts +21 -21
  18. package/dist/auth/index.d.ts +1 -0
  19. package/dist/auth/index.d.ts.map +1 -1
  20. package/dist/auth/index.js +1 -0
  21. package/dist/auth/organization.zod.d.ts +2 -2
  22. package/dist/auth/role.zod.d.ts +14 -0
  23. package/dist/auth/role.zod.d.ts.map +1 -1
  24. package/dist/auth/role.zod.js +16 -1
  25. package/dist/auth/scim.zod.d.ts +2732 -0
  26. package/dist/auth/scim.zod.d.ts.map +1 -0
  27. package/dist/auth/scim.zod.js +811 -0
  28. package/dist/automation/approval.zod.d.ts +643 -0
  29. package/dist/automation/approval.zod.d.ts.map +1 -0
  30. package/dist/automation/approval.zod.js +84 -0
  31. package/dist/automation/connector.zod.d.ts +1284 -0
  32. package/dist/automation/connector.zod.d.ts.map +1 -0
  33. package/dist/automation/connector.zod.js +500 -0
  34. package/dist/automation/etl.zod.d.ts +623 -0
  35. package/dist/automation/etl.zod.d.ts.map +1 -0
  36. package/dist/automation/etl.zod.js +359 -0
  37. package/dist/automation/flow.zod.d.ts +6 -6
  38. package/dist/automation/index.d.ts +4 -0
  39. package/dist/automation/index.d.ts.map +1 -1
  40. package/dist/automation/index.js +4 -0
  41. package/dist/automation/sync.zod.d.ts +854 -0
  42. package/dist/automation/sync.zod.d.ts.map +1 -0
  43. package/dist/automation/sync.zod.js +444 -0
  44. package/dist/automation/webhook.zod.d.ts +24 -1
  45. package/dist/automation/webhook.zod.d.ts.map +1 -1
  46. package/dist/automation/webhook.zod.js +27 -3
  47. package/dist/automation/workflow.zod.d.ts +14 -0
  48. package/dist/automation/workflow.zod.d.ts.map +1 -1
  49. package/dist/automation/workflow.zod.js +16 -1
  50. package/dist/data/field.zod.d.ts +338 -8
  51. package/dist/data/field.zod.d.ts.map +1 -1
  52. package/dist/data/field.zod.js +100 -16
  53. package/dist/data/mapping.zod.d.ts +22 -10
  54. package/dist/data/mapping.zod.d.ts.map +1 -1
  55. package/dist/data/mapping.zod.js +16 -3
  56. package/dist/data/object.zod.d.ts +116 -22
  57. package/dist/data/object.zod.d.ts.map +1 -1
  58. package/dist/data/object.zod.js +4 -4
  59. package/dist/data/validation.zod.d.ts +18 -18
  60. package/dist/hub/composer.zod.d.ts +43 -1940
  61. package/dist/hub/composer.zod.d.ts.map +1 -1
  62. package/dist/hub/composer.zod.js +1 -1
  63. package/dist/hub/license.zod.d.ts +2 -2
  64. package/dist/hub/marketplace.zod.d.ts +6 -6
  65. package/dist/index.d.ts +2 -2
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +6 -3
  68. package/dist/permission/index.d.ts +7 -5
  69. package/dist/permission/index.d.ts.map +1 -1
  70. package/dist/permission/index.js +7 -5
  71. package/dist/permission/permission.zod.d.ts +14 -0
  72. package/dist/permission/permission.zod.d.ts.map +1 -1
  73. package/dist/permission/permission.zod.js +16 -1
  74. package/dist/permission/rls.zod.d.ts +605 -0
  75. package/dist/permission/rls.zod.d.ts.map +1 -0
  76. package/dist/permission/rls.zod.js +615 -0
  77. package/dist/permission/territory.zod.d.ts +13 -0
  78. package/dist/permission/territory.zod.d.ts.map +1 -1
  79. package/dist/permission/territory.zod.js +15 -1
  80. package/dist/shared/identifiers.zod.d.ts +87 -0
  81. package/dist/shared/identifiers.zod.d.ts.map +1 -0
  82. package/dist/shared/identifiers.zod.js +101 -0
  83. package/dist/shared/index.d.ts +6 -0
  84. package/dist/shared/index.d.ts.map +1 -0
  85. package/dist/{driver → shared}/index.js +5 -4
  86. package/dist/stack.zod.d.ts +19869 -0
  87. package/dist/stack.zod.d.ts.map +1 -0
  88. package/dist/stack.zod.js +248 -0
  89. package/dist/system/audit.zod.d.ts +12 -12
  90. package/dist/{kernel → system}/context.zod.d.ts.map +1 -1
  91. package/dist/{driver → system}/datasource.zod.d.ts +2 -2
  92. package/dist/{driver → system}/datasource.zod.d.ts.map +1 -1
  93. package/dist/{driver → system/driver}/mongo.zod.d.ts +2 -2
  94. package/dist/system/driver/mongo.zod.d.ts.map +1 -0
  95. package/dist/{driver → system/driver}/postgres.zod.d.ts +4 -4
  96. package/dist/system/driver/postgres.zod.d.ts.map +1 -0
  97. package/dist/{driver → system}/driver.zod.d.ts +14 -14
  98. package/dist/{driver → system}/driver.zod.d.ts.map +1 -1
  99. package/dist/system/events.zod.d.ts +15 -12
  100. package/dist/system/events.zod.d.ts.map +1 -1
  101. package/dist/system/events.zod.js +5 -1
  102. package/dist/system/feature.zod.d.ts +131 -0
  103. package/dist/system/feature.zod.d.ts.map +1 -0
  104. package/dist/system/feature.zod.js +45 -0
  105. package/dist/system/index.d.ts +10 -0
  106. package/dist/system/index.d.ts.map +1 -1
  107. package/dist/system/index.js +12 -0
  108. package/dist/system/job.zod.d.ts +8 -8
  109. package/dist/{kernel → system}/logger.zod.d.ts +4 -4
  110. package/dist/{kernel → system}/logger.zod.d.ts.map +1 -1
  111. package/dist/system/manifest.zod.d.ts +518 -0
  112. package/dist/system/manifest.zod.d.ts.map +1 -0
  113. package/dist/{kernel → system}/manifest.zod.js +8 -17
  114. package/dist/{kernel → system}/plugin.zod.d.ts.map +1 -1
  115. package/dist/{kernel → system}/scoped-storage.zod.d.ts +2 -2
  116. package/dist/{kernel → system}/scoped-storage.zod.d.ts.map +1 -1
  117. package/dist/ui/action.zod.d.ts +35 -10
  118. package/dist/ui/action.zod.d.ts.map +1 -1
  119. package/dist/ui/action.zod.js +30 -1
  120. package/dist/ui/app.zod.d.ts +23 -8
  121. package/dist/ui/app.zod.d.ts.map +1 -1
  122. package/dist/ui/app.zod.js +32 -4
  123. package/dist/ui/block.zod.d.ts +265 -0
  124. package/dist/ui/block.zod.d.ts.map +1 -0
  125. package/dist/ui/block.zod.js +90 -0
  126. package/dist/ui/component.zod.d.ts +265 -0
  127. package/dist/ui/component.zod.d.ts.map +1 -0
  128. package/dist/ui/component.zod.js +90 -0
  129. package/dist/ui/dashboard.zod.d.ts +15 -15
  130. package/dist/ui/dashboard.zod.d.ts.map +1 -1
  131. package/dist/ui/dashboard.zod.js +18 -8
  132. package/dist/ui/index.d.ts +1 -0
  133. package/dist/ui/index.d.ts.map +1 -1
  134. package/dist/ui/index.js +1 -0
  135. package/dist/ui/page.zod.d.ts +21 -3
  136. package/dist/ui/page.zod.d.ts.map +1 -1
  137. package/dist/ui/page.zod.js +37 -4
  138. package/dist/ui/report.zod.d.ts +7 -7
  139. package/dist/ui/view.zod.d.ts +252 -240
  140. package/dist/ui/view.zod.d.ts.map +1 -1
  141. package/dist/ui/view.zod.js +32 -3
  142. package/dist/ui/widget.zod.d.ts +673 -5
  143. package/dist/ui/widget.zod.d.ts.map +1 -1
  144. package/dist/ui/widget.zod.js +294 -1
  145. package/json-schema/api/ODataError.json +65 -0
  146. package/json-schema/api/ODataFilterFunction.json +39 -0
  147. package/json-schema/api/ODataFilterOperator.json +24 -0
  148. package/json-schema/api/ODataMetadata.json +115 -0
  149. package/json-schema/api/ODataQuery.json +89 -0
  150. package/json-schema/api/ODataResponse.json +37 -0
  151. package/json-schema/auth/Role.json +3 -2
  152. package/json-schema/auth/SCIMAddress.json +50 -0
  153. package/json-schema/auth/SCIMEmail.json +38 -0
  154. package/json-schema/auth/SCIMEnterpriseUser.json +55 -0
  155. package/json-schema/auth/SCIMError.json +52 -0
  156. package/json-schema/auth/SCIMGroup.json +102 -0
  157. package/json-schema/auth/SCIMGroupReference.json +36 -0
  158. package/json-schema/auth/SCIMListResponse.json +606 -0
  159. package/json-schema/auth/SCIMMemberReference.json +36 -0
  160. package/json-schema/auth/SCIMMeta.json +35 -0
  161. package/json-schema/auth/SCIMName.json +36 -0
  162. package/json-schema/auth/SCIMPatchOperation.json +31 -0
  163. package/json-schema/auth/SCIMPatchRequest.json +56 -0
  164. package/json-schema/auth/SCIMPhoneNumber.json +40 -0
  165. package/json-schema/auth/SCIMUser.json +462 -0
  166. package/json-schema/automation/ApprovalAction.json +35 -0
  167. package/json-schema/automation/ApprovalActionType.json +15 -0
  168. package/json-schema/automation/ApprovalProcess.json +326 -0
  169. package/json-schema/automation/ApprovalStep.json +147 -0
  170. package/json-schema/automation/ApproverType.json +16 -0
  171. package/json-schema/automation/AuthField.json +73 -0
  172. package/json-schema/automation/Authentication.json +159 -0
  173. package/json-schema/automation/AuthenticationType.json +18 -0
  174. package/json-schema/automation/ConflictResolution.json +16 -0
  175. package/json-schema/automation/Connector.json +440 -0
  176. package/json-schema/automation/ConnectorCategory.json +26 -0
  177. package/json-schema/automation/ConnectorInstance.json +69 -0
  178. package/json-schema/automation/ConnectorOperation.json +117 -0
  179. package/json-schema/automation/ConnectorTrigger.json +54 -0
  180. package/json-schema/automation/DataDestinationConfig.json +89 -0
  181. package/json-schema/automation/DataSourceConfig.json +34 -0
  182. package/json-schema/automation/DataSyncConfig.json +355 -0
  183. package/json-schema/automation/ETLDestination.json +57 -0
  184. package/json-schema/automation/ETLEndpointType.json +19 -0
  185. package/json-schema/automation/ETLPipeline.json +252 -0
  186. package/json-schema/automation/ETLPipelineRun.json +107 -0
  187. package/json-schema/automation/ETLRunStatus.json +17 -0
  188. package/json-schema/automation/ETLSource.json +60 -0
  189. package/json-schema/automation/ETLSyncMode.json +14 -0
  190. package/json-schema/automation/ETLTransformation.json +46 -0
  191. package/json-schema/automation/ETLTransformationType.json +21 -0
  192. package/json-schema/automation/FieldMapping.json +36 -0
  193. package/json-schema/automation/OAuth2Config.json +43 -0
  194. package/json-schema/automation/OperationParameter.json +59 -0
  195. package/json-schema/automation/OperationType.json +17 -0
  196. package/json-schema/automation/SyncDirection.json +14 -0
  197. package/json-schema/automation/SyncExecutionResult.json +135 -0
  198. package/json-schema/automation/SyncExecutionStatus.json +17 -0
  199. package/json-schema/automation/SyncMode.json +14 -0
  200. package/json-schema/automation/Webhook.json +3 -1
  201. package/json-schema/automation/WebhookReceiver.json +3 -1
  202. package/json-schema/automation/WorkflowRule.json +3 -2
  203. package/json-schema/data/Field.json +62 -4
  204. package/json-schema/data/FieldType.json +12 -2
  205. package/json-schema/data/Object.json +62 -4
  206. package/json-schema/data/SelectOption.json +4 -2
  207. package/json-schema/data/VectorConfig.json +51 -0
  208. package/json-schema/hub/ComposerResponse.json +4 -2163
  209. package/json-schema/permission/PermissionSet.json +3 -1
  210. package/json-schema/permission/RLSConfig.json +59 -0
  211. package/json-schema/permission/RLSEvaluationResult.json +40 -0
  212. package/json-schema/permission/RLSOperation.json +16 -0
  213. package/json-schema/permission/RLSUserContext.json +51 -0
  214. package/json-schema/permission/RowLevelSecurityPolicy.json +77 -0
  215. package/json-schema/permission/Territory.json +3 -1
  216. package/json-schema/shared/EventName.json +12 -0
  217. package/json-schema/shared/SnakeCaseIdentifier.json +12 -0
  218. package/json-schema/shared/SystemIdentifier.json +12 -0
  219. package/json-schema/system/Event.json +3 -2
  220. package/json-schema/system/FeatureFlag.json +87 -0
  221. package/json-schema/system/FeatureStrategy.json +16 -0
  222. package/json-schema/system/Manifest.json +398 -0
  223. package/json-schema/ui/Action.json +25 -4
  224. package/json-schema/ui/ActionParam.json +12 -2
  225. package/json-schema/ui/App.json +18 -7
  226. package/json-schema/ui/ChartType.json +9 -1
  227. package/json-schema/ui/Dashboard.json +9 -1
  228. package/json-schema/ui/DashboardNavItem.json +3 -1
  229. package/json-schema/ui/DashboardWidget.json +9 -1
  230. package/json-schema/ui/FieldWidgetProps.json +62 -4
  231. package/json-schema/ui/FormView.json +4 -1
  232. package/json-schema/ui/GroupNavItem.json +3 -1
  233. package/json-schema/ui/ListView.json +7 -1
  234. package/json-schema/ui/NavigationItem.json +15 -5
  235. package/json-schema/ui/ObjectNavItem.json +3 -1
  236. package/json-schema/ui/Page.json +36 -4
  237. package/json-schema/ui/PageCardProps.json +32 -0
  238. package/json-schema/ui/PageComponent.json +33 -3
  239. package/json-schema/ui/PageComponentType.json +32 -0
  240. package/json-schema/ui/PageHeaderProps.json +39 -0
  241. package/json-schema/ui/PageNavItem.json +3 -1
  242. package/json-schema/ui/PageRegion.json +33 -3
  243. package/json-schema/ui/PageTabsProps.json +55 -0
  244. package/json-schema/ui/RecordDetailsProps.json +37 -0
  245. package/json-schema/ui/RecordHighlightsProps.json +24 -0
  246. package/json-schema/ui/RecordRelatedListProps.json +39 -0
  247. package/json-schema/ui/UrlNavItem.json +3 -1
  248. package/json-schema/ui/View.json +22 -4
  249. package/json-schema/ui/WidgetEvent.json +42 -0
  250. package/json-schema/ui/WidgetLifecycle.json +40 -0
  251. package/json-schema/ui/WidgetManifest.json +262 -0
  252. package/json-schema/ui/WidgetProperty.json +58 -0
  253. package/package.json +1 -1
  254. package/prompts/architecture.md +5 -5
  255. package/prompts/create-new-project.md +85 -0
  256. package/dist/driver/index.d.ts +0 -5
  257. package/dist/driver/index.d.ts.map +0 -1
  258. package/dist/driver/mongo.zod.d.ts.map +0 -1
  259. package/dist/driver/postgres.zod.d.ts.map +0 -1
  260. package/dist/kernel/index.d.ts +0 -12
  261. package/dist/kernel/index.d.ts.map +0 -1
  262. package/dist/kernel/index.js +0 -27
  263. package/dist/kernel/manifest.zod.d.ts +0 -2153
  264. package/dist/kernel/manifest.zod.d.ts.map +0 -1
  265. package/json-schema/kernel/Manifest.json +0 -2557
  266. /package/dist/{kernel → system}/context.zod.d.ts +0 -0
  267. /package/dist/{kernel → system}/context.zod.js +0 -0
  268. /package/dist/{driver → system}/datasource.zod.js +0 -0
  269. /package/dist/{driver → system/driver}/mongo.zod.js +0 -0
  270. /package/dist/{driver → system/driver}/postgres.zod.js +0 -0
  271. /package/dist/{driver → system}/driver.zod.js +0 -0
  272. /package/dist/{kernel → system}/logger.zod.js +0 -0
  273. /package/dist/{kernel → system}/plugin.zod.d.ts +0 -0
  274. /package/dist/{kernel → system}/plugin.zod.js +0 -0
  275. /package/dist/{kernel → system}/scoped-storage.zod.js +0 -0
  276. /package/json-schema/{driver → system}/Datasource.json +0 -0
  277. /package/json-schema/{driver → system}/DatasourceCapabilities.json +0 -0
  278. /package/json-schema/{driver → system}/DriverCapabilities.json +0 -0
  279. /package/json-schema/{driver → system}/DriverDefinition.json +0 -0
  280. /package/json-schema/{driver → system}/DriverInterface.json +0 -0
  281. /package/json-schema/{driver → system}/DriverOptions.json +0 -0
  282. /package/json-schema/{driver → system}/DriverType.json +0 -0
  283. /package/json-schema/{kernel → system}/FileMetadata.json +0 -0
  284. /package/json-schema/{kernel → system}/I18nContext.json +0 -0
  285. /package/json-schema/{kernel → system}/KernelContext.json +0 -0
  286. /package/json-schema/{kernel → system}/LogEntry.json +0 -0
  287. /package/json-schema/{kernel → system}/LogFormat.json +0 -0
  288. /package/json-schema/{kernel → system}/LogLevel.json +0 -0
  289. /package/json-schema/{kernel → system}/Logger.json +0 -0
  290. /package/json-schema/{kernel → system}/LoggerConfig.json +0 -0
  291. /package/json-schema/{driver → system}/MongoConfig.json +0 -0
  292. /package/json-schema/{kernel → system}/ObjectQLClient.json +0 -0
  293. /package/json-schema/{kernel → system}/Plugin.json +0 -0
  294. /package/json-schema/{kernel → system}/PluginContext.json +0 -0
  295. /package/json-schema/{kernel → system}/PluginLifecycle.json +0 -0
  296. /package/json-schema/{driver → system}/PostgresConfig.json +0 -0
  297. /package/json-schema/{kernel → system}/Router.json +0 -0
  298. /package/json-schema/{kernel → system}/RuntimeMode.json +0 -0
  299. /package/json-schema/{kernel → system}/Scheduler.json +0 -0
  300. /package/json-schema/{kernel → system}/ScopedStorage.json +0 -0
  301. /package/json-schema/{kernel → system}/ScopedStorageConfig.json +0 -0
  302. /package/json-schema/{kernel → system}/StorageAdapterType.json +0 -0
  303. /package/json-schema/{kernel → system}/StorageScope.json +0 -0
  304. /package/json-schema/{kernel → system}/SystemAPI.json +0 -0
@@ -8,7 +8,10 @@
8
8
  "type": "object",
9
9
  "properties": {
10
10
  "name": {
11
- "type": "string"
11
+ "type": "string",
12
+ "minLength": 2,
13
+ "pattern": "^[a-z][a-z0-9_]*$",
14
+ "description": "Internal view name (lowercase snake_case)"
12
15
  },
13
16
  "label": {
14
17
  "type": "string"
@@ -17,8 +20,11 @@
17
20
  "type": "string",
18
21
  "enum": [
19
22
  "grid",
23
+ "spreadsheet",
20
24
  "kanban",
25
+ "gallery",
21
26
  "calendar",
27
+ "timeline",
22
28
  "gantt",
23
29
  "map"
24
30
  ],
@@ -404,7 +410,10 @@
404
410
  "enum": [
405
411
  "simple",
406
412
  "tabbed",
407
- "wizard"
413
+ "wizard",
414
+ "split",
415
+ "drawer",
416
+ "modal"
408
417
  ],
409
418
  "default": "simple"
410
419
  },
@@ -750,7 +759,10 @@
750
759
  "type": "object",
751
760
  "properties": {
752
761
  "name": {
753
- "type": "string"
762
+ "type": "string",
763
+ "minLength": 2,
764
+ "pattern": "^[a-z][a-z0-9_]*$",
765
+ "description": "Internal view name (lowercase snake_case)"
754
766
  },
755
767
  "label": {
756
768
  "type": "string"
@@ -759,8 +771,11 @@
759
771
  "type": "string",
760
772
  "enum": [
761
773
  "grid",
774
+ "spreadsheet",
762
775
  "kanban",
776
+ "gallery",
763
777
  "calendar",
778
+ "timeline",
764
779
  "gantt",
765
780
  "map"
766
781
  ],
@@ -1150,7 +1165,10 @@
1150
1165
  "enum": [
1151
1166
  "simple",
1152
1167
  "tabbed",
1153
- "wizard"
1168
+ "wizard",
1169
+ "split",
1170
+ "drawer",
1171
+ "modal"
1154
1172
  ],
1155
1173
  "default": "simple"
1156
1174
  },
@@ -0,0 +1,42 @@
1
+ {
2
+ "$ref": "#/definitions/WidgetEvent",
3
+ "definitions": {
4
+ "WidgetEvent": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "Event name"
10
+ },
11
+ "label": {
12
+ "type": "string",
13
+ "description": "Human-readable event label"
14
+ },
15
+ "description": {
16
+ "type": "string",
17
+ "description": "Event description and usage"
18
+ },
19
+ "bubbles": {
20
+ "type": "boolean",
21
+ "default": false,
22
+ "description": "Whether event bubbles"
23
+ },
24
+ "cancelable": {
25
+ "type": "boolean",
26
+ "default": false,
27
+ "description": "Whether event is cancelable"
28
+ },
29
+ "payload": {
30
+ "type": "object",
31
+ "additionalProperties": {},
32
+ "description": "Event payload schema"
33
+ }
34
+ },
35
+ "required": [
36
+ "name"
37
+ ],
38
+ "additionalProperties": false
39
+ }
40
+ },
41
+ "$schema": "http://json-schema.org/draft-07/schema#"
42
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "$ref": "#/definitions/WidgetLifecycle",
3
+ "definitions": {
4
+ "WidgetLifecycle": {
5
+ "type": "object",
6
+ "properties": {
7
+ "onMount": {
8
+ "type": "string",
9
+ "description": "Initialization code when widget mounts"
10
+ },
11
+ "onUpdate": {
12
+ "type": "string",
13
+ "description": "Code to run when props change"
14
+ },
15
+ "onUnmount": {
16
+ "type": "string",
17
+ "description": "Cleanup code when widget unmounts"
18
+ },
19
+ "onValidate": {
20
+ "type": "string",
21
+ "description": "Custom validation logic"
22
+ },
23
+ "onFocus": {
24
+ "type": "string",
25
+ "description": "Code to run on focus"
26
+ },
27
+ "onBlur": {
28
+ "type": "string",
29
+ "description": "Code to run on blur"
30
+ },
31
+ "onError": {
32
+ "type": "string",
33
+ "description": "Error handling code"
34
+ }
35
+ },
36
+ "additionalProperties": false
37
+ }
38
+ },
39
+ "$schema": "http://json-schema.org/draft-07/schema#"
40
+ }
@@ -0,0 +1,262 @@
1
+ {
2
+ "$ref": "#/definitions/WidgetManifest",
3
+ "definitions": {
4
+ "WidgetManifest": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "pattern": "^[a-z_][a-z0-9_]*$",
10
+ "description": "Widget identifier (snake_case)"
11
+ },
12
+ "label": {
13
+ "type": "string",
14
+ "description": "Widget display name"
15
+ },
16
+ "description": {
17
+ "type": "string",
18
+ "description": "Widget description"
19
+ },
20
+ "version": {
21
+ "type": "string",
22
+ "description": "Widget version (semver)"
23
+ },
24
+ "author": {
25
+ "type": "string",
26
+ "description": "Widget author"
27
+ },
28
+ "icon": {
29
+ "type": "string",
30
+ "description": "Widget icon"
31
+ },
32
+ "fieldTypes": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "string"
36
+ },
37
+ "description": "Supported field types"
38
+ },
39
+ "category": {
40
+ "type": "string",
41
+ "enum": [
42
+ "input",
43
+ "display",
44
+ "picker",
45
+ "editor",
46
+ "custom"
47
+ ],
48
+ "default": "custom",
49
+ "description": "Widget category"
50
+ },
51
+ "lifecycle": {
52
+ "type": "object",
53
+ "properties": {
54
+ "onMount": {
55
+ "type": "string",
56
+ "description": "Initialization code when widget mounts"
57
+ },
58
+ "onUpdate": {
59
+ "type": "string",
60
+ "description": "Code to run when props change"
61
+ },
62
+ "onUnmount": {
63
+ "type": "string",
64
+ "description": "Cleanup code when widget unmounts"
65
+ },
66
+ "onValidate": {
67
+ "type": "string",
68
+ "description": "Custom validation logic"
69
+ },
70
+ "onFocus": {
71
+ "type": "string",
72
+ "description": "Code to run on focus"
73
+ },
74
+ "onBlur": {
75
+ "type": "string",
76
+ "description": "Code to run on blur"
77
+ },
78
+ "onError": {
79
+ "type": "string",
80
+ "description": "Error handling code"
81
+ }
82
+ },
83
+ "additionalProperties": false,
84
+ "description": "Lifecycle hooks"
85
+ },
86
+ "events": {
87
+ "type": "array",
88
+ "items": {
89
+ "type": "object",
90
+ "properties": {
91
+ "name": {
92
+ "type": "string",
93
+ "description": "Event name"
94
+ },
95
+ "label": {
96
+ "type": "string",
97
+ "description": "Human-readable event label"
98
+ },
99
+ "description": {
100
+ "type": "string",
101
+ "description": "Event description and usage"
102
+ },
103
+ "bubbles": {
104
+ "type": "boolean",
105
+ "default": false,
106
+ "description": "Whether event bubbles"
107
+ },
108
+ "cancelable": {
109
+ "type": "boolean",
110
+ "default": false,
111
+ "description": "Whether event is cancelable"
112
+ },
113
+ "payload": {
114
+ "type": "object",
115
+ "additionalProperties": {},
116
+ "description": "Event payload schema"
117
+ }
118
+ },
119
+ "required": [
120
+ "name"
121
+ ],
122
+ "additionalProperties": false
123
+ },
124
+ "description": "Custom events"
125
+ },
126
+ "properties": {
127
+ "type": "array",
128
+ "items": {
129
+ "type": "object",
130
+ "properties": {
131
+ "name": {
132
+ "type": "string",
133
+ "description": "Property name (camelCase)"
134
+ },
135
+ "label": {
136
+ "type": "string",
137
+ "description": "Human-readable label"
138
+ },
139
+ "type": {
140
+ "type": "string",
141
+ "enum": [
142
+ "string",
143
+ "number",
144
+ "boolean",
145
+ "array",
146
+ "object",
147
+ "function",
148
+ "any"
149
+ ],
150
+ "description": "TypeScript type"
151
+ },
152
+ "required": {
153
+ "type": "boolean",
154
+ "default": false,
155
+ "description": "Whether property is required"
156
+ },
157
+ "default": {
158
+ "description": "Default value"
159
+ },
160
+ "description": {
161
+ "type": "string",
162
+ "description": "Property description"
163
+ },
164
+ "validation": {
165
+ "type": "object",
166
+ "additionalProperties": {},
167
+ "description": "Validation rules"
168
+ },
169
+ "category": {
170
+ "type": "string",
171
+ "description": "Property category"
172
+ }
173
+ },
174
+ "required": [
175
+ "name",
176
+ "type"
177
+ ],
178
+ "additionalProperties": false
179
+ },
180
+ "description": "Configuration properties"
181
+ },
182
+ "implementation": {
183
+ "type": "object",
184
+ "properties": {
185
+ "type": {
186
+ "type": "string",
187
+ "enum": [
188
+ "url",
189
+ "inline",
190
+ "module"
191
+ ],
192
+ "description": "Implementation type"
193
+ },
194
+ "source": {
195
+ "type": "string",
196
+ "description": "Source URL, inline code, or module path"
197
+ }
198
+ },
199
+ "required": [
200
+ "type",
201
+ "source"
202
+ ],
203
+ "additionalProperties": false,
204
+ "description": "Widget implementation"
205
+ },
206
+ "dependencies": {
207
+ "type": "array",
208
+ "items": {
209
+ "type": "object",
210
+ "properties": {
211
+ "name": {
212
+ "type": "string"
213
+ },
214
+ "version": {
215
+ "type": "string"
216
+ },
217
+ "url": {
218
+ "type": "string",
219
+ "format": "uri"
220
+ }
221
+ },
222
+ "required": [
223
+ "name"
224
+ ],
225
+ "additionalProperties": false
226
+ },
227
+ "description": "Widget dependencies"
228
+ },
229
+ "screenshots": {
230
+ "type": "array",
231
+ "items": {
232
+ "type": "string",
233
+ "format": "uri"
234
+ },
235
+ "description": "Screenshot URLs"
236
+ },
237
+ "documentation": {
238
+ "type": "string",
239
+ "format": "uri",
240
+ "description": "Documentation URL"
241
+ },
242
+ "license": {
243
+ "type": "string",
244
+ "description": "License (SPDX identifier)"
245
+ },
246
+ "tags": {
247
+ "type": "array",
248
+ "items": {
249
+ "type": "string"
250
+ },
251
+ "description": "Tags for categorization"
252
+ }
253
+ },
254
+ "required": [
255
+ "name",
256
+ "label"
257
+ ],
258
+ "additionalProperties": false
259
+ }
260
+ },
261
+ "$schema": "http://json-schema.org/draft-07/schema#"
262
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$ref": "#/definitions/WidgetProperty",
3
+ "definitions": {
4
+ "WidgetProperty": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "Property name (camelCase)"
10
+ },
11
+ "label": {
12
+ "type": "string",
13
+ "description": "Human-readable label"
14
+ },
15
+ "type": {
16
+ "type": "string",
17
+ "enum": [
18
+ "string",
19
+ "number",
20
+ "boolean",
21
+ "array",
22
+ "object",
23
+ "function",
24
+ "any"
25
+ ],
26
+ "description": "TypeScript type"
27
+ },
28
+ "required": {
29
+ "type": "boolean",
30
+ "default": false,
31
+ "description": "Whether property is required"
32
+ },
33
+ "default": {
34
+ "description": "Default value"
35
+ },
36
+ "description": {
37
+ "type": "string",
38
+ "description": "Property description"
39
+ },
40
+ "validation": {
41
+ "type": "object",
42
+ "additionalProperties": {},
43
+ "description": "Validation rules"
44
+ },
45
+ "category": {
46
+ "type": "string",
47
+ "description": "Property category"
48
+ }
49
+ },
50
+ "required": [
51
+ "name",
52
+ "type"
53
+ ],
54
+ "additionalProperties": false
55
+ }
56
+ },
57
+ "$schema": "http://json-schema.org/draft-07/schema#"
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/spec",
3
- "version": "0.3.3",
3
+ "version": "0.4.2",
4
4
  "description": "ObjectStack Protocol & Specification - TypeScript Interfaces, JSON Schemas, and Convention Configurations",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -6,7 +6,7 @@ Mission: Build the "Post-SaaS Operating System" — an open-core, local-first ec
6
6
  1. The "Galaxy" Architecture (Monorepo Structure)
7
7
  We use a Monorepo (pnpm + Turborepo) to manage the ecosystem, but components are designed to be published independently.
8
8
  Directory Structure & Responsibilities
9
- * packages/protocol (The Constitution) [Apache 2.0]
9
+ * packages/spec (The Constitution) [Apache 2.0]
10
10
  * CRITICAL: Contains the shared manifest.schema.json, TypeScript interfaces, and plugin lifecycle hooks (onInstall, onEnable).
11
11
  * Rule: All other packages depend on this. No circular dependencies.
12
12
  * packages/objectql (Data Engine) [Apache 2.0]
@@ -20,7 +20,7 @@ Directory Structure & Responsibilities
20
20
  * Tools for third-party developers to build Marketplace plugins.
21
21
  * drivers/* [Apache 2.0]
22
22
  * driver-postgres, driver-redis, driver-excel.
23
- * Must implement interfaces defined in packages/protocol.
23
+ * Must implement interfaces defined in packages/spec.
24
24
  Commercial & Apps
25
25
  * apps/www (Official Website): Marketing, Landing Pages, "Platform" Showcase.
26
26
  * apps/marketplace (Public Storefront): SEO-optimized Registry for plugins/drivers.
@@ -50,7 +50,7 @@ Top Navbar Layout:
50
50
 
51
51
  We do not rely solely on package.json. We use a strict ObjectStack Manifest standard.
52
52
  File: objectstack.config.ts (or strict JSON inside package.json)
53
- Schema Location: packages/protocol/schemas/manifest.schema.json
53
+ Schema Location: spec/protocol/schemas/manifest.schema.json
54
54
  Key Fields:
55
55
  * type: app | plugin | driver
56
56
  * navigation: Structured navigation menu tree.
@@ -68,7 +68,7 @@ B. Terminology
68
68
  * ALWAYS emphasize "Polyglot Data". We are not just a SQL wrapper; we handle Redis and Excel native files.
69
69
  * Studio vs. Cloud: Studio is for "Local Data & Development". Cloud is for "Deployment & Collaboration".
70
70
  C. Coding Style
71
- * Monorepo: Use generic imports (e.g., import { User } from '@objectstack/protocol') instead of relative paths like ../../packages/protocol.
71
+ * Monorepo: Use generic imports (e.g., import { User } from '@objectstack/protocol') instead of relative paths like ../../packages/spec.
72
72
  * UI: Use Shadcn UI + Tailwind CSS. Dark mode default for developer tools (Studio/Console).
73
73
  * Data Fetching: All UI components must be Server-Driven or strongly typed against the Schema.
74
74
  5. Execution Context
@@ -78,4 +78,4 @@ When I ask you to build a feature, first determine:
78
78
  * Does it require updating the Protocol Manifest?
79
79
  Example:
80
80
  User: "Add a CRM plugin."
81
- AI: "I will define the CRM data structure in packages/protocol, create a crm-plugin package implementing the manifest.json standard, and register the 'Customer' menu item."
81
+ AI: "I will define the CRM data structure in packages/spec, create a crm-plugin package implementing the manifest.json standard, and register the 'Customer' menu item."
@@ -0,0 +1,85 @@
1
+ # Role
2
+ You are an expert **ObjectStack Application Developer**.
3
+ Your mission is to build metadata-driven business applications using the `@objectstack/spec` protocol.
4
+
5
+ # Context
6
+ We are building a new application based on the ObjectStack Standard Protocol.
7
+ The core philosophy is **"Data as Code"** — all business logic (Objects, Fields, UI, Permissions) is defined as strictly typed TypeScript objects using Zod schemas.
8
+
9
+ # Tech Stack & Imports
10
+ - **Protocol Package:** `@objectstack/spec`
11
+ - **Data Definition:** `import { Object, Field, Hook, Validation } from '@objectstack/spec/data'`
12
+ - **UI Definition:** `import { App, View, Dashboard, Layout } from '@objectstack/spec/ui'`
13
+ - **Configuration:** `objectstack.config.ts` (Application Entry)
14
+
15
+ # Project Structure (Best Practice)
16
+ Organize the code by **Domains** (Functional Modules) rather than technical layers.
17
+
18
+ ```text
19
+ my-app/
20
+ ├── objectstack.config.ts # App Entry (App.create({...}))
21
+ ├── package.json
22
+ ├── tsconfig.json
23
+ └── src/
24
+ ├── domains/
25
+ │ ├── sales/ # Domain: Sales
26
+ │ │ ├── account.object.ts
27
+ │ │ ├── account.trigger.ts
28
+ │ │ └── opportunity.object.ts
29
+ │ └── support/ # Domain: Support
30
+ │ └── case.object.ts
31
+ └── ui/ # Global UI Assets
32
+ ├── dashboards/
33
+ └── layouts/
34
+ ```
35
+
36
+ # Implementation Rules
37
+
38
+ 1. **Strict Typing:** Always explicit types.
39
+ * BAD: `const MyObject = { ... }`
40
+ * GOOD: `export const MyObject: Object = { ... }`
41
+
42
+ 2. **Naming Conventions:**
43
+ * **File Names:** `snake_case` or `domain.feature.ts` (e.g., `account.object.ts`).
44
+ * **Machine Names (Inside Code):** `snake_case` (e.g., `name: 'customer_grade'`).
45
+ * **Config Properties:** `camelCase` (e.g., `label: 'Customer Grade'`).
46
+
47
+ 3. **Code Pattern (Object Definition):**
48
+ ```typescript
49
+ import { Object } from '@objectstack/spec/data';
50
+
51
+ export const AccountObject: Object = {
52
+ name: 'account',
53
+ label: 'Corporate Account',
54
+ enable: {
55
+ audit: true,
56
+ workflow: true
57
+ },
58
+ fields: {
59
+ name: { type: 'text', label: 'Account Name', required: true },
60
+ type: {
61
+ type: 'select',
62
+ options: [{ label: 'Customer', value: 'customer' }]
63
+ },
64
+ owner: { type: 'lookup', reference: 'user' }
65
+ }
66
+ };
67
+ ```
68
+
69
+ 4. **Code Pattern (App Config):**
70
+ ```typescript
71
+ // objectstack.config.ts
72
+ import { App } from '@objectstack/spec/ui';
73
+ import { AccountObject } from './src/domains/sales/account.object';
74
+
75
+ export default App.create({
76
+ name: 'my_erp_app',
77
+ version: '1.0.0',
78
+ objects: [AccountObject],
79
+ menus: [ ... ]
80
+ });
81
+ ```
82
+
83
+ # Your Task
84
+ Please assist me in implementing the following requirements for my new ObjectStack project.
85
+ Focus on creating the `object.ts` definitions and the `objectstack.config.ts` integration.
@@ -1,5 +0,0 @@
1
- export * from './driver.zod';
2
- export * from './datasource.zod';
3
- export * from './mongo.zod';
4
- export * from './postgres.zod';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/driver/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mongo.zod.d.ts","sourceRoot":"","sources":["../../src/driver/mongo.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,iBAAiB;IAC5B;;;;OAIG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAKH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"postgres.zod.d.ts","sourceRoot":"","sources":["../../src/driver/postgres.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,oBAAoB;IAC/B;;;;OAIG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;;;;;;;;;;;;;;;;IAWH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;OAGG;;IAGH;;;;OAIG;;IAGH;;;OAGG;;IAGF;;;MAGE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- /**
2
- * Kernel Protocol Exports
3
- *
4
- * The Core Architecture of ObjectStack.
5
- * Defines the Bootloader, Package Management, and Plugin Lifecycle.
6
- */
7
- export * from './manifest.zod';
8
- export * from './plugin.zod';
9
- export * from './logger.zod';
10
- export * from './context.zod';
11
- export * from './scoped-storage.zod';
12
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kernel/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- /**
3
- * Kernel Protocol Exports
4
- *
5
- * The Core Architecture of ObjectStack.
6
- * Defines the Bootloader, Package Management, and Plugin Lifecycle.
7
- */
8
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
- if (k2 === undefined) k2 = k;
10
- var desc = Object.getOwnPropertyDescriptor(m, k);
11
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
- desc = { enumerable: true, get: function() { return m[k]; } };
13
- }
14
- Object.defineProperty(o, k2, desc);
15
- }) : (function(o, m, k, k2) {
16
- if (k2 === undefined) k2 = k;
17
- o[k2] = m[k];
18
- }));
19
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
- };
22
- Object.defineProperty(exports, "__esModule", { value: true });
23
- __exportStar(require("./manifest.zod"), exports);
24
- __exportStar(require("./plugin.zod"), exports);
25
- __exportStar(require("./logger.zod"), exports);
26
- __exportStar(require("./context.zod"), exports);
27
- __exportStar(require("./scoped-storage.zod"), exports);