@objectstack/spec 0.2.0 → 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 (103) 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/index.d.ts +21 -0
  18. package/dist/data/index.d.ts.map +1 -0
  19. package/dist/data/index.js +36 -0
  20. package/dist/data/query.zod.d.ts +386 -3
  21. package/dist/data/query.zod.d.ts.map +1 -1
  22. package/dist/data/query.zod.js +386 -3
  23. package/dist/data/validation.zod.d.ts +349 -0
  24. package/dist/data/validation.zod.d.ts.map +1 -1
  25. package/dist/data/validation.zod.js +395 -0
  26. package/dist/index.d.ts +36 -41
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +64 -49
  29. package/dist/system/auth-protocol.d.ts +175 -0
  30. package/dist/system/auth-protocol.d.ts.map +1 -0
  31. package/dist/system/auth-protocol.js +60 -0
  32. package/dist/system/auth.zod.d.ts +1097 -65
  33. package/dist/system/auth.zod.d.ts.map +1 -1
  34. package/dist/system/auth.zod.js +135 -1
  35. package/dist/system/identity.zod.d.ts +234 -180
  36. package/dist/system/identity.zod.d.ts.map +1 -1
  37. package/dist/system/identity.zod.js +168 -51
  38. package/dist/system/index.d.ts +28 -0
  39. package/dist/system/index.d.ts.map +1 -0
  40. package/dist/system/index.js +43 -0
  41. package/dist/system/manifest.zod.d.ts +10 -10
  42. package/dist/system/organization.zod.d.ts +179 -0
  43. package/dist/system/organization.zod.d.ts.map +1 -0
  44. package/dist/system/organization.zod.js +129 -0
  45. package/dist/ui/action.zod.d.ts +2 -2
  46. package/dist/ui/index.d.ts +17 -0
  47. package/dist/ui/index.d.ts.map +1 -0
  48. package/dist/ui/index.js +32 -0
  49. package/dist/ui/theme.zod.d.ts +6 -6
  50. package/json-schema/Account.json +87 -0
  51. package/json-schema/AuthConfig.json +235 -0
  52. package/json-schema/ChunkingStrategy.json +133 -0
  53. package/json-schema/DatabaseMapping.json +48 -0
  54. package/json-schema/DocumentChunk.json +97 -0
  55. package/json-schema/DocumentLoaderConfig.json +69 -0
  56. package/json-schema/DocumentMetadata.json +61 -0
  57. package/json-schema/EmbeddingModel.json +57 -0
  58. package/json-schema/EnterpriseAuthConfig.json +172 -0
  59. package/json-schema/Entity.json +55 -0
  60. package/json-schema/FieldSynonymConfig.json +39 -0
  61. package/json-schema/Invitation.json +69 -0
  62. package/json-schema/InvitationStatus.json +15 -0
  63. package/json-schema/LDAPConfig.json +22 -5
  64. package/json-schema/Member.json +46 -0
  65. package/json-schema/ModelCapability.json +47 -0
  66. package/json-schema/ModelConfig.json +181 -0
  67. package/json-schema/ModelLimits.json +45 -0
  68. package/json-schema/ModelPricing.json +28 -0
  69. package/json-schema/ModelProvider.json +19 -0
  70. package/json-schema/ModelRegistry.json +427 -0
  71. package/json-schema/ModelRegistryEntry.json +239 -0
  72. package/json-schema/ModelSelectionCriteria.json +50 -0
  73. package/json-schema/NLQAnalytics.json +106 -0
  74. package/json-schema/NLQFieldMapping.json +40 -0
  75. package/json-schema/NLQModelConfig.json +78 -0
  76. package/json-schema/NLQParseResult.json +252 -0
  77. package/json-schema/NLQRequest.json +110 -0
  78. package/json-schema/NLQResponse.json +288 -0
  79. package/json-schema/NLQTrainingExample.json +120 -0
  80. package/json-schema/OIDCConfig.json +18 -3
  81. package/json-schema/Organization.json +52 -0
  82. package/json-schema/PromptTemplate.json +163 -0
  83. package/json-schema/PromptVariable.json +56 -0
  84. package/json-schema/QueryContext.json +72 -0
  85. package/json-schema/QueryIntent.json +21 -0
  86. package/json-schema/QueryTemplate.json +81 -0
  87. package/json-schema/RAGPipelineConfig.json +552 -0
  88. package/json-schema/RAGPipelineStatus.json +66 -0
  89. package/json-schema/RAGQueryRequest.json +64 -0
  90. package/json-schema/RAGQueryResponse.json +108 -0
  91. package/json-schema/RerankingConfig.json +34 -0
  92. package/json-schema/RetrievalStrategy.json +121 -0
  93. package/json-schema/SAMLConfig.json +17 -3
  94. package/json-schema/Session.json +63 -0
  95. package/json-schema/StandardAuthProvider.json +235 -0
  96. package/json-schema/Timeframe.json +68 -0
  97. package/json-schema/User.json +51 -0
  98. package/json-schema/VectorStoreConfig.json +82 -0
  99. package/json-schema/VectorStoreProvider.json +21 -0
  100. package/json-schema/VerificationToken.json +36 -0
  101. package/package.json +27 -1
  102. package/json-schema/AuthProtocol.json +0 -17
  103. 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
+ }
@@ -4,16 +4,22 @@
4
4
  "OIDCConfig": {
5
5
  "type": "object",
6
6
  "properties": {
7
+ "enabled": {
8
+ "type": "boolean",
9
+ "default": false
10
+ },
7
11
  "issuer": {
8
12
  "type": "string",
9
13
  "format": "uri",
10
14
  "description": "OIDC Issuer URL (.well-known/openid-configuration)"
11
15
  },
12
16
  "clientId": {
13
- "type": "string"
17
+ "type": "string",
18
+ "description": "OIDC client ID"
14
19
  },
15
20
  "clientSecret": {
16
- "type": "string"
21
+ "type": "string",
22
+ "description": "OIDC client secret"
17
23
  },
18
24
  "scopes": {
19
25
  "type": "array",
@@ -24,7 +30,8 @@
24
30
  "openid",
25
31
  "profile",
26
32
  "email"
27
- ]
33
+ ],
34
+ "description": "OIDC scopes"
28
35
  },
29
36
  "attributeMapping": {
30
37
  "type": "object",
@@ -32,6 +39,14 @@
32
39
  "type": "string"
33
40
  },
34
41
  "description": "Map IdP claims to User fields"
42
+ },
43
+ "displayName": {
44
+ "type": "string",
45
+ "description": "Display name for the provider button"
46
+ },
47
+ "icon": {
48
+ "type": "string",
49
+ "description": "Icon URL or identifier"
35
50
  }
36
51
  },
37
52
  "required": [
@@ -0,0 +1,52 @@
1
+ {
2
+ "$ref": "#/definitions/Organization",
3
+ "definitions": {
4
+ "Organization": {
5
+ "type": "object",
6
+ "properties": {
7
+ "id": {
8
+ "type": "string",
9
+ "description": "Unique organization identifier"
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "description": "Organization display name"
14
+ },
15
+ "slug": {
16
+ "type": "string",
17
+ "pattern": "^[a-z0-9_-]+$",
18
+ "description": "Unique URL-friendly slug (lowercase alphanumeric, hyphens, underscores)"
19
+ },
20
+ "logo": {
21
+ "type": "string",
22
+ "format": "uri",
23
+ "description": "Organization logo URL"
24
+ },
25
+ "metadata": {
26
+ "type": "object",
27
+ "additionalProperties": {},
28
+ "description": "Custom metadata"
29
+ },
30
+ "createdAt": {
31
+ "type": "string",
32
+ "format": "date-time",
33
+ "description": "Organization creation timestamp"
34
+ },
35
+ "updatedAt": {
36
+ "type": "string",
37
+ "format": "date-time",
38
+ "description": "Last update timestamp"
39
+ }
40
+ },
41
+ "required": [
42
+ "id",
43
+ "name",
44
+ "slug",
45
+ "createdAt",
46
+ "updatedAt"
47
+ ],
48
+ "additionalProperties": false
49
+ }
50
+ },
51
+ "$schema": "http://json-schema.org/draft-07/schema#"
52
+ }
@@ -0,0 +1,163 @@
1
+ {
2
+ "$ref": "#/definitions/PromptTemplate",
3
+ "definitions": {
4
+ "PromptTemplate": {
5
+ "type": "object",
6
+ "properties": {
7
+ "id": {
8
+ "type": "string",
9
+ "description": "Unique template identifier"
10
+ },
11
+ "name": {
12
+ "type": "string",
13
+ "pattern": "^[a-z_][a-z0-9_]*$",
14
+ "description": "Template name (snake_case)"
15
+ },
16
+ "label": {
17
+ "type": "string",
18
+ "description": "Display name"
19
+ },
20
+ "system": {
21
+ "type": "string",
22
+ "description": "System prompt"
23
+ },
24
+ "user": {
25
+ "type": "string",
26
+ "description": "User prompt template with variables"
27
+ },
28
+ "assistant": {
29
+ "type": "string",
30
+ "description": "Assistant message prefix"
31
+ },
32
+ "variables": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "object",
36
+ "properties": {
37
+ "name": {
38
+ "type": "string",
39
+ "description": "Variable name (e.g., \"user_name\", \"context\")"
40
+ },
41
+ "type": {
42
+ "type": "string",
43
+ "enum": [
44
+ "string",
45
+ "number",
46
+ "boolean",
47
+ "object",
48
+ "array"
49
+ ],
50
+ "default": "string"
51
+ },
52
+ "required": {
53
+ "type": "boolean",
54
+ "default": false
55
+ },
56
+ "defaultValue": {},
57
+ "description": {
58
+ "type": "string"
59
+ },
60
+ "validation": {
61
+ "type": "object",
62
+ "properties": {
63
+ "minLength": {
64
+ "type": "number"
65
+ },
66
+ "maxLength": {
67
+ "type": "number"
68
+ },
69
+ "pattern": {
70
+ "type": "string"
71
+ },
72
+ "enum": {
73
+ "type": "array"
74
+ }
75
+ },
76
+ "additionalProperties": false
77
+ }
78
+ },
79
+ "required": [
80
+ "name"
81
+ ],
82
+ "additionalProperties": false
83
+ },
84
+ "description": "Template variables"
85
+ },
86
+ "modelId": {
87
+ "type": "string",
88
+ "description": "Recommended model ID"
89
+ },
90
+ "temperature": {
91
+ "type": "number",
92
+ "minimum": 0,
93
+ "maximum": 2
94
+ },
95
+ "maxTokens": {
96
+ "type": "number"
97
+ },
98
+ "topP": {
99
+ "type": "number"
100
+ },
101
+ "frequencyPenalty": {
102
+ "type": "number"
103
+ },
104
+ "presencePenalty": {
105
+ "type": "number"
106
+ },
107
+ "stopSequences": {
108
+ "type": "array",
109
+ "items": {
110
+ "type": "string"
111
+ }
112
+ },
113
+ "version": {
114
+ "type": "string",
115
+ "default": "1.0.0"
116
+ },
117
+ "description": {
118
+ "type": "string"
119
+ },
120
+ "category": {
121
+ "type": "string",
122
+ "description": "Template category (e.g., \"code_generation\", \"support\")"
123
+ },
124
+ "tags": {
125
+ "type": "array",
126
+ "items": {
127
+ "type": "string"
128
+ }
129
+ },
130
+ "examples": {
131
+ "type": "array",
132
+ "items": {
133
+ "type": "object",
134
+ "properties": {
135
+ "input": {
136
+ "type": "object",
137
+ "additionalProperties": {},
138
+ "description": "Example variable values"
139
+ },
140
+ "output": {
141
+ "type": "string",
142
+ "description": "Expected output"
143
+ }
144
+ },
145
+ "required": [
146
+ "input",
147
+ "output"
148
+ ],
149
+ "additionalProperties": false
150
+ }
151
+ }
152
+ },
153
+ "required": [
154
+ "id",
155
+ "name",
156
+ "label",
157
+ "user"
158
+ ],
159
+ "additionalProperties": false
160
+ }
161
+ },
162
+ "$schema": "http://json-schema.org/draft-07/schema#"
163
+ }