@objectstack/spec 0.1.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/README.md +127 -5
  2. package/dist/ai/index.d.ts +14 -0
  3. package/dist/ai/index.d.ts.map +1 -0
  4. package/dist/ai/index.js +29 -0
  5. package/dist/ai/model-registry.zod.d.ts +1389 -0
  6. package/dist/ai/model-registry.zod.d.ts.map +1 -0
  7. package/dist/ai/model-registry.zod.js +164 -0
  8. package/dist/ai/nlq.zod.d.ts +1126 -0
  9. package/dist/ai/nlq.zod.d.ts.map +1 -0
  10. package/dist/ai/nlq.zod.js +246 -0
  11. package/dist/ai/rag-pipeline.zod.d.ts +1034 -0
  12. package/dist/ai/rag-pipeline.zod.d.ts.map +1 -0
  13. package/dist/ai/rag-pipeline.zod.js +244 -0
  14. package/dist/api/index.d.ts +9 -0
  15. package/dist/api/index.d.ts.map +1 -0
  16. package/dist/api/index.js +24 -0
  17. package/dist/data/filter.zod.d.ts +295 -0
  18. package/dist/data/filter.zod.d.ts.map +1 -0
  19. package/dist/data/filter.zod.js +226 -0
  20. package/dist/data/index.d.ts +21 -0
  21. package/dist/data/index.d.ts.map +1 -0
  22. package/dist/data/index.js +36 -0
  23. package/dist/data/query.zod.d.ts +386 -3
  24. package/dist/data/query.zod.d.ts.map +1 -1
  25. package/dist/data/query.zod.js +386 -3
  26. package/dist/data/validation.zod.d.ts +349 -0
  27. package/dist/data/validation.zod.d.ts.map +1 -1
  28. package/dist/data/validation.zod.js +395 -0
  29. package/dist/index.d.ts +36 -39
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +64 -47
  32. package/dist/system/auth-protocol.d.ts +175 -0
  33. package/dist/system/auth-protocol.d.ts.map +1 -0
  34. package/dist/system/auth-protocol.js +60 -0
  35. package/dist/system/auth.zod.d.ts +3319 -0
  36. package/dist/system/auth.zod.d.ts.map +1 -0
  37. package/dist/system/auth.zod.js +499 -0
  38. package/dist/system/datasource.zod.d.ts +118 -38
  39. package/dist/system/datasource.zod.d.ts.map +1 -1
  40. package/dist/system/datasource.zod.js +25 -6
  41. package/dist/system/driver.zod.d.ts +106 -0
  42. package/dist/system/driver.zod.d.ts.map +1 -1
  43. package/dist/system/driver.zod.js +47 -0
  44. package/dist/system/identity.zod.d.ts +234 -180
  45. package/dist/system/identity.zod.d.ts.map +1 -1
  46. package/dist/system/identity.zod.js +168 -51
  47. package/dist/system/index.d.ts +28 -0
  48. package/dist/system/index.d.ts.map +1 -0
  49. package/dist/system/index.js +43 -0
  50. package/dist/system/manifest.zod.d.ts +10 -10
  51. package/dist/system/organization.zod.d.ts +179 -0
  52. package/dist/system/organization.zod.d.ts.map +1 -0
  53. package/dist/system/organization.zod.js +129 -0
  54. package/dist/system/policy.zod.d.ts +10 -10
  55. package/dist/ui/action.zod.d.ts +2 -2
  56. package/dist/ui/dashboard.zod.d.ts +10 -10
  57. package/dist/ui/dashboard.zod.d.ts.map +1 -1
  58. package/dist/ui/dashboard.zod.js +3 -2
  59. package/dist/ui/index.d.ts +17 -0
  60. package/dist/ui/index.d.ts.map +1 -0
  61. package/dist/ui/index.js +32 -0
  62. package/dist/ui/report.zod.d.ts +4 -32
  63. package/dist/ui/report.zod.d.ts.map +1 -1
  64. package/dist/ui/report.zod.js +3 -8
  65. package/dist/ui/theme.zod.d.ts +6 -6
  66. package/json-schema/Account.json +87 -0
  67. package/json-schema/AccountLinkingConfig.json +27 -0
  68. package/json-schema/AuthConfig.json +841 -0
  69. package/json-schema/AuthPluginConfig.json +28 -0
  70. package/json-schema/AuthStrategy.json +17 -0
  71. package/json-schema/AuthenticationConfig.json +601 -0
  72. package/json-schema/AuthenticationProvider.json +617 -0
  73. package/json-schema/CSRFConfig.json +31 -0
  74. package/json-schema/ChunkingStrategy.json +133 -0
  75. package/json-schema/ComparisonOperator.json +56 -0
  76. package/json-schema/Dashboard.json +20 -0
  77. package/json-schema/DashboardWidget.json +20 -0
  78. package/json-schema/DatabaseAdapter.json +38 -0
  79. package/json-schema/DatabaseMapping.json +48 -0
  80. package/json-schema/Datasource.json +25 -5
  81. package/json-schema/DatasourceCapabilities.json +25 -5
  82. package/json-schema/DocumentChunk.json +97 -0
  83. package/json-schema/DocumentLoaderConfig.json +69 -0
  84. package/json-schema/DocumentMetadata.json +61 -0
  85. package/json-schema/DriverCapabilities.json +30 -0
  86. package/json-schema/DriverDefinition.json +25 -5
  87. package/json-schema/DriverInterface.json +30 -0
  88. package/json-schema/EmailPasswordConfig.json +43 -0
  89. package/json-schema/EmbeddingModel.json +57 -0
  90. package/json-schema/EnterpriseAuthConfig.json +172 -0
  91. package/json-schema/Entity.json +55 -0
  92. package/json-schema/EqualityOperator.json +14 -0
  93. package/json-schema/FieldOperators.json +108 -0
  94. package/json-schema/FieldSynonymConfig.json +39 -0
  95. package/json-schema/FilterCondition.json +28 -0
  96. package/json-schema/Invitation.json +69 -0
  97. package/json-schema/InvitationStatus.json +15 -0
  98. package/json-schema/LDAPConfig.json +22 -5
  99. package/json-schema/MagicLinkConfig.json +21 -0
  100. package/json-schema/Member.json +46 -0
  101. package/json-schema/ModelCapability.json +47 -0
  102. package/json-schema/ModelConfig.json +181 -0
  103. package/json-schema/ModelLimits.json +45 -0
  104. package/json-schema/ModelPricing.json +28 -0
  105. package/json-schema/ModelProvider.json +19 -0
  106. package/json-schema/ModelRegistry.json +427 -0
  107. package/json-schema/ModelRegistryEntry.json +239 -0
  108. package/json-schema/ModelSelectionCriteria.json +50 -0
  109. package/json-schema/NLQAnalytics.json +106 -0
  110. package/json-schema/NLQFieldMapping.json +40 -0
  111. package/json-schema/NLQModelConfig.json +78 -0
  112. package/json-schema/NLQParseResult.json +252 -0
  113. package/json-schema/NLQRequest.json +110 -0
  114. package/json-schema/NLQResponse.json +288 -0
  115. package/json-schema/NLQTrainingExample.json +120 -0
  116. package/json-schema/NormalizedFilter.json +348 -0
  117. package/json-schema/OAuthProvider.json +66 -0
  118. package/json-schema/OIDCConfig.json +18 -3
  119. package/json-schema/Organization.json +52 -0
  120. package/json-schema/PasskeyConfig.json +54 -0
  121. package/json-schema/PromptTemplate.json +163 -0
  122. package/json-schema/PromptVariable.json +56 -0
  123. package/json-schema/QueryContext.json +72 -0
  124. package/json-schema/QueryFilter.json +34 -0
  125. package/json-schema/QueryIntent.json +21 -0
  126. package/json-schema/QueryTemplate.json +81 -0
  127. package/json-schema/RAGPipelineConfig.json +552 -0
  128. package/json-schema/RAGPipelineStatus.json +66 -0
  129. package/json-schema/RAGQueryRequest.json +64 -0
  130. package/json-schema/RAGQueryResponse.json +108 -0
  131. package/json-schema/RangeOperator.json +41 -0
  132. package/json-schema/RateLimitConfig.json +36 -0
  133. package/json-schema/Report.json +20 -26
  134. package/json-schema/RerankingConfig.json +34 -0
  135. package/json-schema/RetrievalStrategy.json +121 -0
  136. package/json-schema/SAMLConfig.json +17 -3
  137. package/json-schema/Session.json +63 -0
  138. package/json-schema/SessionConfig.json +56 -0
  139. package/json-schema/SetOperator.json +18 -0
  140. package/json-schema/SpecialOperator.json +18 -0
  141. package/json-schema/StandardAuthProvider.json +857 -0
  142. package/json-schema/StringOperator.json +21 -0
  143. package/json-schema/Timeframe.json +68 -0
  144. package/json-schema/TwoFactorConfig.json +40 -0
  145. package/json-schema/User.json +51 -0
  146. package/json-schema/UserFieldMapping.json +47 -0
  147. package/json-schema/VectorStoreConfig.json +82 -0
  148. package/json-schema/VectorStoreProvider.json +21 -0
  149. package/json-schema/VerificationToken.json +36 -0
  150. package/package.json +27 -1
  151. package/json-schema/AuthProtocol.json +0 -17
  152. package/json-schema/AuthProvider.json +0 -171
@@ -0,0 +1,288 @@
1
+ {
2
+ "$ref": "#/definitions/NLQResponse",
3
+ "definitions": {
4
+ "NLQResponse": {
5
+ "type": "object",
6
+ "properties": {
7
+ "parseResult": {
8
+ "type": "object",
9
+ "properties": {
10
+ "originalQuery": {
11
+ "type": "string"
12
+ },
13
+ "intent": {
14
+ "type": "string",
15
+ "enum": [
16
+ "select",
17
+ "aggregate",
18
+ "filter",
19
+ "sort",
20
+ "compare",
21
+ "trend",
22
+ "insight",
23
+ "create",
24
+ "update",
25
+ "delete"
26
+ ]
27
+ },
28
+ "intentConfidence": {
29
+ "type": "number",
30
+ "minimum": 0,
31
+ "maximum": 1
32
+ },
33
+ "entities": {
34
+ "type": "array",
35
+ "items": {
36
+ "type": "object",
37
+ "properties": {
38
+ "type": {
39
+ "type": "string",
40
+ "enum": [
41
+ "object",
42
+ "field",
43
+ "value",
44
+ "operator",
45
+ "function",
46
+ "timeframe"
47
+ ]
48
+ },
49
+ "text": {
50
+ "type": "string",
51
+ "description": "Original text from query"
52
+ },
53
+ "value": {
54
+ "description": "Normalized value"
55
+ },
56
+ "confidence": {
57
+ "type": "number",
58
+ "minimum": 0,
59
+ "maximum": 1,
60
+ "description": "Confidence score"
61
+ },
62
+ "span": {
63
+ "type": "array",
64
+ "minItems": 2,
65
+ "maxItems": 2,
66
+ "items": [
67
+ {
68
+ "type": "number"
69
+ },
70
+ {
71
+ "type": "number"
72
+ }
73
+ ],
74
+ "description": "Character span in query"
75
+ }
76
+ },
77
+ "required": [
78
+ "type",
79
+ "text",
80
+ "confidence"
81
+ ],
82
+ "additionalProperties": false
83
+ }
84
+ },
85
+ "targetObject": {
86
+ "type": "string",
87
+ "description": "Primary object to query"
88
+ },
89
+ "fields": {
90
+ "type": "array",
91
+ "items": {
92
+ "type": "object",
93
+ "properties": {
94
+ "naturalLanguage": {
95
+ "type": "string",
96
+ "description": "NL field name (e.g., \"customer name\")"
97
+ },
98
+ "objectField": {
99
+ "type": "string",
100
+ "description": "Actual field name (e.g., \"account.name\")"
101
+ },
102
+ "object": {
103
+ "type": "string",
104
+ "description": "Object name"
105
+ },
106
+ "field": {
107
+ "type": "string",
108
+ "description": "Field name"
109
+ },
110
+ "confidence": {
111
+ "type": "number",
112
+ "minimum": 0,
113
+ "maximum": 1
114
+ }
115
+ },
116
+ "required": [
117
+ "naturalLanguage",
118
+ "objectField",
119
+ "object",
120
+ "field",
121
+ "confidence"
122
+ ],
123
+ "additionalProperties": false
124
+ }
125
+ },
126
+ "timeframe": {
127
+ "type": "object",
128
+ "properties": {
129
+ "type": {
130
+ "type": "string",
131
+ "enum": [
132
+ "absolute",
133
+ "relative"
134
+ ]
135
+ },
136
+ "start": {
137
+ "type": "string",
138
+ "description": "Start date (ISO format)"
139
+ },
140
+ "end": {
141
+ "type": "string",
142
+ "description": "End date (ISO format)"
143
+ },
144
+ "relative": {
145
+ "type": "object",
146
+ "properties": {
147
+ "unit": {
148
+ "type": "string",
149
+ "enum": [
150
+ "hour",
151
+ "day",
152
+ "week",
153
+ "month",
154
+ "quarter",
155
+ "year"
156
+ ]
157
+ },
158
+ "value": {
159
+ "type": "integer"
160
+ },
161
+ "direction": {
162
+ "type": "string",
163
+ "enum": [
164
+ "past",
165
+ "future",
166
+ "current"
167
+ ],
168
+ "default": "past"
169
+ }
170
+ },
171
+ "required": [
172
+ "unit",
173
+ "value"
174
+ ],
175
+ "additionalProperties": false
176
+ },
177
+ "text": {
178
+ "type": "string",
179
+ "description": "Original timeframe text"
180
+ }
181
+ },
182
+ "required": [
183
+ "type",
184
+ "text"
185
+ ],
186
+ "additionalProperties": false
187
+ },
188
+ "ast": {
189
+ "description": "Generated ObjectQL AST"
190
+ },
191
+ "confidence": {
192
+ "type": "number",
193
+ "minimum": 0,
194
+ "maximum": 1,
195
+ "description": "Overall confidence"
196
+ },
197
+ "ambiguities": {
198
+ "type": "array",
199
+ "items": {
200
+ "type": "object",
201
+ "properties": {
202
+ "type": {
203
+ "type": "string"
204
+ },
205
+ "description": {
206
+ "type": "string"
207
+ },
208
+ "suggestions": {
209
+ "type": "array",
210
+ "items": {
211
+ "type": "string"
212
+ }
213
+ }
214
+ },
215
+ "required": [
216
+ "type",
217
+ "description"
218
+ ],
219
+ "additionalProperties": false
220
+ },
221
+ "description": "Detected ambiguities requiring clarification"
222
+ },
223
+ "alternatives": {
224
+ "type": "array",
225
+ "items": {
226
+ "type": "object",
227
+ "properties": {
228
+ "interpretation": {
229
+ "type": "string"
230
+ },
231
+ "confidence": {
232
+ "type": "number"
233
+ },
234
+ "ast": {}
235
+ },
236
+ "required": [
237
+ "interpretation",
238
+ "confidence"
239
+ ],
240
+ "additionalProperties": false
241
+ }
242
+ }
243
+ },
244
+ "required": [
245
+ "originalQuery",
246
+ "intent",
247
+ "intentConfidence",
248
+ "entities",
249
+ "confidence"
250
+ ],
251
+ "additionalProperties": false
252
+ },
253
+ "results": {
254
+ "type": "array",
255
+ "items": {
256
+ "type": "object",
257
+ "additionalProperties": {}
258
+ },
259
+ "description": "Query results"
260
+ },
261
+ "totalCount": {
262
+ "type": "integer"
263
+ },
264
+ "executionTime": {
265
+ "type": "number",
266
+ "description": "Execution time in milliseconds"
267
+ },
268
+ "needsClarification": {
269
+ "type": "boolean",
270
+ "description": "Whether query needs clarification"
271
+ },
272
+ "suggestions": {
273
+ "type": "array",
274
+ "items": {
275
+ "type": "string"
276
+ },
277
+ "description": "Query refinement suggestions"
278
+ }
279
+ },
280
+ "required": [
281
+ "parseResult",
282
+ "needsClarification"
283
+ ],
284
+ "additionalProperties": false
285
+ }
286
+ },
287
+ "$schema": "http://json-schema.org/draft-07/schema#"
288
+ }
@@ -0,0 +1,120 @@
1
+ {
2
+ "$ref": "#/definitions/NLQTrainingExample",
3
+ "definitions": {
4
+ "NLQTrainingExample": {
5
+ "type": "object",
6
+ "properties": {
7
+ "query": {
8
+ "type": "string",
9
+ "description": "Natural language query"
10
+ },
11
+ "context": {
12
+ "type": "object",
13
+ "properties": {
14
+ "userId": {
15
+ "type": "string"
16
+ },
17
+ "userRole": {
18
+ "type": "string"
19
+ },
20
+ "currentObject": {
21
+ "type": "string",
22
+ "description": "Current object being viewed"
23
+ },
24
+ "currentRecordId": {
25
+ "type": "string",
26
+ "description": "Current record ID"
27
+ },
28
+ "conversationHistory": {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "object",
32
+ "properties": {
33
+ "query": {
34
+ "type": "string"
35
+ },
36
+ "timestamp": {
37
+ "type": "string"
38
+ },
39
+ "intent": {
40
+ "type": "string",
41
+ "enum": [
42
+ "select",
43
+ "aggregate",
44
+ "filter",
45
+ "sort",
46
+ "compare",
47
+ "trend",
48
+ "insight",
49
+ "create",
50
+ "update",
51
+ "delete"
52
+ ]
53
+ }
54
+ },
55
+ "required": [
56
+ "query",
57
+ "timestamp"
58
+ ],
59
+ "additionalProperties": false
60
+ }
61
+ },
62
+ "defaultLimit": {
63
+ "type": "integer",
64
+ "default": 100
65
+ },
66
+ "timezone": {
67
+ "type": "string",
68
+ "default": "UTC"
69
+ },
70
+ "locale": {
71
+ "type": "string",
72
+ "default": "en-US"
73
+ }
74
+ },
75
+ "additionalProperties": false
76
+ },
77
+ "expectedIntent": {
78
+ "type": "string",
79
+ "enum": [
80
+ "select",
81
+ "aggregate",
82
+ "filter",
83
+ "sort",
84
+ "compare",
85
+ "trend",
86
+ "insight",
87
+ "create",
88
+ "update",
89
+ "delete"
90
+ ]
91
+ },
92
+ "expectedObject": {
93
+ "type": "string"
94
+ },
95
+ "expectedAST": {
96
+ "description": "Expected ObjectQL AST"
97
+ },
98
+ "category": {
99
+ "type": "string",
100
+ "description": "Example category"
101
+ },
102
+ "tags": {
103
+ "type": "array",
104
+ "items": {
105
+ "type": "string"
106
+ }
107
+ },
108
+ "notes": {
109
+ "type": "string"
110
+ }
111
+ },
112
+ "required": [
113
+ "query",
114
+ "expectedIntent"
115
+ ],
116
+ "additionalProperties": false
117
+ }
118
+ },
119
+ "$schema": "http://json-schema.org/draft-07/schema#"
120
+ }