@exulu/backend 1.48.2 → 1.49.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 (164) hide show
  1. package/dist/index.cjs +351 -42
  2. package/dist/index.d.cts +96 -1
  3. package/dist/index.d.ts +96 -1
  4. package/dist/index.js +340 -38
  5. package/ee/{markdown.ts → chunking/markdown.ts} +2 -2
  6. package/ee/python/README.md +295 -0
  7. package/ee/python/documents/processing/README.md +155 -0
  8. package/ee/{documents → python/documents}/processing/doc_processor.ts +25 -17
  9. package/ee/{documents/processing/pdf_to_markdown.py → python/documents/processing/document_to_markdown.py} +3 -10
  10. package/ee/python/setup.sh +180 -0
  11. package/package.json +14 -3
  12. package/scripts/postinstall.cjs +149 -0
  13. package/.agents/skills/mintlify/SKILL.md +0 -347
  14. package/.editorconfig +0 -15
  15. package/.eslintrc.json +0 -52
  16. package/.github/workflows/release-backend.yml +0 -38
  17. package/.husky/commit-msg +0 -1
  18. package/.jscpd.json +0 -18
  19. package/.mcp.json +0 -25
  20. package/.nvmrc +0 -1
  21. package/.prettierignore +0 -5
  22. package/.prettierrc.json +0 -12
  23. package/CHANGELOG.md +0 -8
  24. package/SECURITY.md +0 -5
  25. package/commitlint.config.js +0 -4
  26. package/devops/documentation/patch-older-releases.md +0 -42
  27. package/ee/documents/processing/build_pdf_processor.sh +0 -35
  28. package/ee/documents/processing/chunk_markdown.py +0 -263
  29. package/ee/documents/processing/pdf_processor.spec +0 -115
  30. package/eslint.config.js +0 -88
  31. package/jest.config.ts +0 -25
  32. package/mintlify-docs/.mintignore +0 -7
  33. package/mintlify-docs/AGENTS.md +0 -33
  34. package/mintlify-docs/CLAUDE.MD +0 -50
  35. package/mintlify-docs/CONTRIBUTING.md +0 -32
  36. package/mintlify-docs/LICENSE +0 -21
  37. package/mintlify-docs/README.md +0 -55
  38. package/mintlify-docs/ai-tools/claude-code.mdx +0 -43
  39. package/mintlify-docs/ai-tools/cursor.mdx +0 -39
  40. package/mintlify-docs/ai-tools/windsurf.mdx +0 -39
  41. package/mintlify-docs/api-reference/core-types/agent-types.mdx +0 -110
  42. package/mintlify-docs/api-reference/core-types/analytics-types.mdx +0 -95
  43. package/mintlify-docs/api-reference/core-types/configuration-types.mdx +0 -83
  44. package/mintlify-docs/api-reference/core-types/evaluation-types.mdx +0 -106
  45. package/mintlify-docs/api-reference/core-types/job-types.mdx +0 -135
  46. package/mintlify-docs/api-reference/core-types/overview.mdx +0 -73
  47. package/mintlify-docs/api-reference/core-types/prompt-types.mdx +0 -102
  48. package/mintlify-docs/api-reference/core-types/rbac-types.mdx +0 -163
  49. package/mintlify-docs/api-reference/core-types/session-types.mdx +0 -77
  50. package/mintlify-docs/api-reference/core-types/user-management.mdx +0 -112
  51. package/mintlify-docs/api-reference/core-types/workflow-types.mdx +0 -88
  52. package/mintlify-docs/api-reference/core-types.mdx +0 -585
  53. package/mintlify-docs/api-reference/dynamic-types.mdx +0 -851
  54. package/mintlify-docs/api-reference/endpoint/create.mdx +0 -4
  55. package/mintlify-docs/api-reference/endpoint/delete.mdx +0 -4
  56. package/mintlify-docs/api-reference/endpoint/get.mdx +0 -4
  57. package/mintlify-docs/api-reference/endpoint/webhook.mdx +0 -4
  58. package/mintlify-docs/api-reference/introduction.mdx +0 -661
  59. package/mintlify-docs/api-reference/mutations.mdx +0 -1012
  60. package/mintlify-docs/api-reference/openapi.json +0 -217
  61. package/mintlify-docs/api-reference/queries.mdx +0 -1154
  62. package/mintlify-docs/backend/introduction.mdx +0 -218
  63. package/mintlify-docs/changelog.mdx +0 -387
  64. package/mintlify-docs/community-edition.mdx +0 -304
  65. package/mintlify-docs/core/exulu-agent/api-reference.mdx +0 -894
  66. package/mintlify-docs/core/exulu-agent/configuration.mdx +0 -690
  67. package/mintlify-docs/core/exulu-agent/introduction.mdx +0 -552
  68. package/mintlify-docs/core/exulu-app/api-reference.mdx +0 -481
  69. package/mintlify-docs/core/exulu-app/configuration.mdx +0 -319
  70. package/mintlify-docs/core/exulu-app/introduction.mdx +0 -117
  71. package/mintlify-docs/core/exulu-authentication.mdx +0 -810
  72. package/mintlify-docs/core/exulu-chunkers/api-reference.mdx +0 -1011
  73. package/mintlify-docs/core/exulu-chunkers/configuration.mdx +0 -596
  74. package/mintlify-docs/core/exulu-chunkers/introduction.mdx +0 -403
  75. package/mintlify-docs/core/exulu-context/api-reference.mdx +0 -911
  76. package/mintlify-docs/core/exulu-context/configuration.mdx +0 -648
  77. package/mintlify-docs/core/exulu-context/introduction.mdx +0 -394
  78. package/mintlify-docs/core/exulu-database.mdx +0 -811
  79. package/mintlify-docs/core/exulu-default-agents.mdx +0 -545
  80. package/mintlify-docs/core/exulu-eval/api-reference.mdx +0 -772
  81. package/mintlify-docs/core/exulu-eval/configuration.mdx +0 -680
  82. package/mintlify-docs/core/exulu-eval/introduction.mdx +0 -459
  83. package/mintlify-docs/core/exulu-logging.mdx +0 -464
  84. package/mintlify-docs/core/exulu-otel.mdx +0 -670
  85. package/mintlify-docs/core/exulu-queues/api-reference.mdx +0 -648
  86. package/mintlify-docs/core/exulu-queues/configuration.mdx +0 -650
  87. package/mintlify-docs/core/exulu-queues/introduction.mdx +0 -474
  88. package/mintlify-docs/core/exulu-reranker/api-reference.mdx +0 -630
  89. package/mintlify-docs/core/exulu-reranker/configuration.mdx +0 -663
  90. package/mintlify-docs/core/exulu-reranker/introduction.mdx +0 -516
  91. package/mintlify-docs/core/exulu-tool/api-reference.mdx +0 -723
  92. package/mintlify-docs/core/exulu-tool/configuration.mdx +0 -805
  93. package/mintlify-docs/core/exulu-tool/introduction.mdx +0 -539
  94. package/mintlify-docs/core/exulu-variables/api-reference.mdx +0 -699
  95. package/mintlify-docs/core/exulu-variables/configuration.mdx +0 -736
  96. package/mintlify-docs/core/exulu-variables/introduction.mdx +0 -511
  97. package/mintlify-docs/development.mdx +0 -94
  98. package/mintlify-docs/docs.json +0 -248
  99. package/mintlify-docs/enterprise-edition.mdx +0 -538
  100. package/mintlify-docs/essentials/code.mdx +0 -35
  101. package/mintlify-docs/essentials/images.mdx +0 -59
  102. package/mintlify-docs/essentials/markdown.mdx +0 -88
  103. package/mintlify-docs/essentials/navigation.mdx +0 -87
  104. package/mintlify-docs/essentials/reusable-snippets.mdx +0 -110
  105. package/mintlify-docs/essentials/settings.mdx +0 -318
  106. package/mintlify-docs/favicon.svg +0 -3
  107. package/mintlify-docs/frontend/introduction.mdx +0 -39
  108. package/mintlify-docs/getting-started.mdx +0 -267
  109. package/mintlify-docs/guides/custom-agent.mdx +0 -608
  110. package/mintlify-docs/guides/first-agent.mdx +0 -315
  111. package/mintlify-docs/images/admin_ui.png +0 -0
  112. package/mintlify-docs/images/contexts.png +0 -0
  113. package/mintlify-docs/images/create_agents.png +0 -0
  114. package/mintlify-docs/images/evals.png +0 -0
  115. package/mintlify-docs/images/graphql.png +0 -0
  116. package/mintlify-docs/images/graphql_api.png +0 -0
  117. package/mintlify-docs/images/hero-dark.png +0 -0
  118. package/mintlify-docs/images/hero-light.png +0 -0
  119. package/mintlify-docs/images/hero.png +0 -0
  120. package/mintlify-docs/images/knowledge_sources.png +0 -0
  121. package/mintlify-docs/images/mcp.png +0 -0
  122. package/mintlify-docs/images/scaling.png +0 -0
  123. package/mintlify-docs/index.mdx +0 -411
  124. package/mintlify-docs/logo/dark.svg +0 -9
  125. package/mintlify-docs/logo/light.svg +0 -9
  126. package/mintlify-docs/partners.mdx +0 -558
  127. package/mintlify-docs/products.mdx +0 -77
  128. package/mintlify-docs/snippets/snippet-intro.mdx +0 -4
  129. package/mintlify-docs/styles.css +0 -207
  130. package/ngrok.bash +0 -1
  131. package/ngrok.md +0 -6
  132. package/ngrok.yml +0 -10
  133. package/release.config.cjs +0 -15
  134. package/skills-lock.json +0 -10
  135. package/types/context-processor.ts +0 -45
  136. package/types/enums/eval-types.ts +0 -5
  137. package/types/enums/field-types.ts +0 -1
  138. package/types/enums/jobs.ts +0 -11
  139. package/types/enums/statistics.ts +0 -13
  140. package/types/exulu-table-definition.ts +0 -79
  141. package/types/file-types.ts +0 -18
  142. package/types/models/agent-session.ts +0 -27
  143. package/types/models/agent.ts +0 -68
  144. package/types/models/context.ts +0 -53
  145. package/types/models/embedding.ts +0 -17
  146. package/types/models/eval-run.ts +0 -40
  147. package/types/models/exulu-agent-tool-config.ts +0 -11
  148. package/types/models/item.ts +0 -21
  149. package/types/models/job.ts +0 -8
  150. package/types/models/project.ts +0 -16
  151. package/types/models/rate-limiter-rules.ts +0 -7
  152. package/types/models/test-case.ts +0 -25
  153. package/types/models/tool.ts +0 -9
  154. package/types/models/user-role.ts +0 -12
  155. package/types/models/user.ts +0 -20
  156. package/types/models/variable.ts +0 -8
  157. package/types/models/vector-methods.ts +0 -7
  158. package/types/provider-config.ts +0 -21
  159. package/types/queue-config.ts +0 -16
  160. package/types/rbac-rights-modes.ts +0 -1
  161. package/types/statistics.ts +0 -20
  162. package/types/workflow.ts +0 -31
  163. /package/ee/{documents → python/documents}/THIRD_PARTY_LICENSES/docling.txt +0 -0
  164. /package/ee/{documents/processing → python}/requirements.txt +0 -0
@@ -1,1012 +0,0 @@
1
- ---
2
- title: 'Mutations'
3
- description: 'Complete reference for all GraphQL mutation operations'
4
- ---
5
-
6
- ## Overview
7
-
8
- Mutations modify data in Exulu IMP. All mutations follow consistent patterns and return both the modified resource and optional job IDs for background processing.
9
-
10
- ## Mutation patterns
11
-
12
- Every resource type (core and dynamic) gets these mutation operations:
13
-
14
- | Operation | Purpose | Returns job ID |
15
- |-----------|---------|----------------|
16
- | `{typePlural}CreateOne` | Create new resource | Sometimes |
17
- | `{typePlural}CopyOneById` | Duplicate resource | Sometimes |
18
- | `{typePlural}UpdateOne` | Update by filter | Sometimes |
19
- | `{typePlural}UpdateOneById` | Update by ID | Sometimes |
20
- | `{typePlural}RemoveOne` | Delete by filter | No |
21
- | `{typePlural}RemoveOneById` | Delete by ID | No |
22
-
23
- <Info>
24
- Mutations return a `job` field when background processing is triggered (e.g., embedding generation, chunk processing).
25
- </Info>
26
-
27
- ## Create mutations
28
-
29
- ### Pattern
30
-
31
- ```graphql
32
- {typePlural}CreateOne(
33
- input: {type}Input!
34
- upsert: Boolean
35
- ): {type}MutationPayload
36
-
37
- type {type}MutationPayload {
38
- item: {type}!
39
- job: String # Job ID if background processing triggered
40
- }
41
- ```
42
-
43
- ### Basic create
44
-
45
- ```graphql
46
- mutation {
47
- agentsCreateOne(
48
- input: {
49
- name: "Customer Support Agent"
50
- description: "Handles customer inquiries"
51
- backend: "anthropic_claude"
52
- type: "agent"
53
- }
54
- ) {
55
- item {
56
- id
57
- name
58
- createdAt
59
- }
60
- }
61
- }
62
- ```
63
-
64
- ### With upsert
65
-
66
- Upsert creates or updates based on unique constraints:
67
-
68
- ```graphql
69
- mutation {
70
- variablesCreateOne(
71
- input: {
72
- name: "openai_api_key"
73
- value: "sk-..."
74
- encrypted: true
75
- }
76
- upsert: true
77
- ) {
78
- item {
79
- id
80
- name
81
- }
82
- }
83
- }
84
- ```
85
-
86
- ### With RBAC
87
-
88
- ```graphql
89
- mutation {
90
- agentsCreateOne(
91
- input: {
92
- name: "Private Agent"
93
- description: "Only accessible by specific users"
94
- backend: "anthropic_claude"
95
- type: "agent"
96
- RBAC: {
97
- users: [
98
- { id: "user-123", rights: "write" }
99
- { id: "user-456", rights: "read" }
100
- ]
101
- roles: [
102
- { id: "developer", rights: "write" }
103
- ]
104
- }
105
- }
106
- ) {
107
- item {
108
- id
109
- name
110
- RBAC {
111
- type
112
- users {
113
- id
114
- rights
115
- }
116
- }
117
- }
118
- }
119
- }
120
- ```
121
-
122
- ### With job triggering
123
-
124
- For contexts with embedders, creating items triggers chunk generation:
125
-
126
- ```graphql
127
- mutation {
128
- documentationCreateOne(
129
- input: {
130
- title: "Getting Started Guide"
131
- url: "https://docs.example.com/start"
132
- content: "Welcome to our platform..."
133
- category: "tutorials"
134
- }
135
- ) {
136
- item {
137
- id
138
- title
139
- }
140
- job # Job ID for chunk generation
141
- }
142
- }
143
- ```
144
-
145
- ## Copy mutations
146
-
147
- Duplicate an existing resource.
148
-
149
- ### Pattern
150
-
151
- ```graphql
152
- {typePlural}CopyOneById(id: ID!): {type}MutationPayload
153
- ```
154
-
155
- ### Example
156
-
157
- ```graphql
158
- mutation {
159
- agentsCopyOneById(id: "agent-123") {
160
- item {
161
- id
162
- name # Will be "Original Name (Copy)"
163
- description
164
- }
165
- }
166
- }
167
- ```
168
-
169
- <Note>
170
- Copied resources get "(Copy)" appended to their name and are set to private mode with `created_by` set to the current user.
171
- </Note>
172
-
173
- ## Update mutations
174
-
175
- ### Update by ID pattern
176
-
177
- ```graphql
178
- {typePlural}UpdateOneById(
179
- id: ID!
180
- input: {type}Input!
181
- ): {type}MutationPayload
182
- ```
183
-
184
- ### Basic update
185
-
186
- ```graphql
187
- mutation {
188
- agentsUpdateOneById(
189
- id: "agent-123"
190
- input: {
191
- name: "Updated Agent Name"
192
- description: "New description"
193
- }
194
- ) {
195
- item {
196
- id
197
- name
198
- description
199
- updatedAt
200
- }
201
- }
202
- }
203
- ```
204
-
205
- ### Update with job triggering
206
-
207
- For contexts with embedders set to `calculateVectors: "onUpdate"`:
208
-
209
- ```graphql
210
- mutation {
211
- documentationUpdateOneById(
212
- id: "doc-123"
213
- input: {
214
- content: "Updated documentation content..."
215
- }
216
- ) {
217
- item {
218
- id
219
- title
220
- }
221
- job # Chunk regeneration job ID
222
- }
223
- }
224
- ```
225
-
226
- ### Update by filter pattern
227
-
228
- ```graphql
229
- {typePlural}UpdateOne(
230
- where: [Filter{Type}]
231
- input: {type}Input!
232
- ): {type}MutationPayload
233
- ```
234
-
235
- ### Example
236
-
237
- ```graphql
238
- mutation {
239
- agentsUpdateOne(
240
- where: [
241
- { name: { eq: "Old Agent Name" } }
242
- ]
243
- input: {
244
- name: "New Agent Name"
245
- }
246
- ) {
247
- item {
248
- id
249
- name
250
- }
251
- }
252
- }
253
- ```
254
-
255
- ### Update RBAC
256
-
257
- ```graphql
258
- mutation {
259
- agentsUpdateOneById(
260
- id: "agent-123"
261
- input: {
262
- RBAC: {
263
- users: [
264
- { id: "user-789", rights: "write" }
265
- ]
266
- roles: [
267
- { id: "admin", rights: "write" }
268
- ]
269
- }
270
- }
271
- ) {
272
- item {
273
- id
274
- RBAC {
275
- users {
276
- id
277
- rights
278
- }
279
- roles {
280
- id
281
- rights
282
- }
283
- }
284
- }
285
- }
286
- }
287
- ```
288
-
289
- ## Delete mutations
290
-
291
- ### Delete by ID pattern
292
-
293
- ```graphql
294
- {typePlural}RemoveOneById(id: ID!): {type}
295
- ```
296
-
297
- ### Example
298
-
299
- ```graphql
300
- mutation {
301
- agentsRemoveOneById(id: "agent-123") {
302
- id
303
- name
304
- }
305
- }
306
- ```
307
-
308
- <Warning>
309
- For contexts with embedders, deleting an item also deletes all associated chunks automatically.
310
- </Warning>
311
-
312
- ### Delete by filter pattern
313
-
314
- ```graphql
315
- {typePlural}RemoveOne(where: JSON!): {type}
316
- ```
317
-
318
- ### Example
319
-
320
- ```graphql
321
- mutation {
322
- agent_sessionsRemoveOne(
323
- where: { agent: "agent-123" }
324
- ) {
325
- id
326
- name
327
- }
328
- }
329
- ```
330
-
331
- ## Context-specific mutations
332
-
333
- Contexts with embedders, sources, or processors get additional mutations.
334
-
335
- ### Generate chunks
336
-
337
- Create vector embeddings for context items.
338
-
339
- ```graphql
340
- {contextId}GenerateChunks(
341
- where: [Filter{Context}]
342
- limit: Int
343
- ): {contextId}GenerateChunksReturnPayload
344
-
345
- type {contextId}GenerateChunksReturnPayload {
346
- message: String!
347
- items: Int!
348
- jobs: [String!]
349
- }
350
- ```
351
-
352
- **Generate for filtered items:**
353
-
354
- ```graphql
355
- mutation {
356
- documentationGenerateChunks(
357
- where: [{ category: { eq: "tutorials" } }]
358
- limit: 50
359
- ) {
360
- message
361
- items # Number of items processed
362
- jobs # Job IDs
363
- }
364
- }
365
- ```
366
-
367
- **Generate for all items:**
368
-
369
- ```graphql
370
- mutation {
371
- documentationGenerateChunks {
372
- message
373
- items
374
- jobs
375
- }
376
- }
377
- ```
378
-
379
- <Note>
380
- Generating all chunks requires `super_admin` permission.
381
- </Note>
382
-
383
- ### Delete chunks
384
-
385
- Remove vector embeddings while keeping items.
386
-
387
- ```graphql
388
- {contextId}DeleteChunks(
389
- where: [Filter{Context}]
390
- limit: Int
391
- ): {contextId}DeleteChunksReturnPayload
392
-
393
- type {contextId}DeleteChunksReturnPayload {
394
- message: String!
395
- items: Int!
396
- jobs: [String!]
397
- }
398
- ```
399
-
400
- **Example:**
401
-
402
- ```graphql
403
- mutation {
404
- documentationDeleteChunks(
405
- where: [{ category: { eq: "deprecated" } }]
406
- ) {
407
- message
408
- items
409
- }
410
- }
411
- ```
412
-
413
- ### Execute source
414
-
415
- Manually trigger a context source to fetch data.
416
-
417
- ```graphql
418
- {contextId}ExecuteSource(
419
- source: ID!
420
- inputs: JSON!
421
- ): {contextId}ExecuteSourceReturnPayload
422
-
423
- type {contextId}ExecuteSourceReturnPayload {
424
- message: String!
425
- jobs: [String!]
426
- items: [String!]
427
- }
428
- ```
429
-
430
- **Example:**
431
-
432
- ```graphql
433
- mutation {
434
- documentationExecuteSource(
435
- source: "github_docs_sync"
436
- inputs: {
437
- repository: "myorg/myrepo"
438
- branch: "main"
439
- path: "/docs"
440
- }
441
- ) {
442
- message
443
- items # Created item IDs
444
- jobs # Job IDs if queued
445
- }
446
- }
447
- ```
448
-
449
- <Note>
450
- Requires `super_admin` permission.
451
- </Note>
452
-
453
- ### Process item
454
-
455
- Execute a context processor on a single item.
456
-
457
- ```graphql
458
- {contextId}ProcessItem(
459
- item: ID!
460
- ): {contextId}ProcessItemFieldReturnPayload
461
-
462
- type {contextId}ProcessItemFieldReturnPayload {
463
- message: String!
464
- results: [String]
465
- jobs: [String]
466
- }
467
- ```
468
-
469
- **Example:**
470
-
471
- ```graphql
472
- mutation {
473
- documentationProcessItem(item: "doc-123") {
474
- message
475
- results
476
- jobs
477
- }
478
- }
479
- ```
480
-
481
- ### Process items (batch)
482
-
483
- Execute processor on multiple items.
484
-
485
- ```graphql
486
- {contextId}ProcessItems(
487
- limit: Int
488
- filters: [Filter{Context}]
489
- sort: SortBy
490
- ): {contextId}ProcessItemFieldReturnPayload
491
- ```
492
-
493
- **Example:**
494
-
495
- ```graphql
496
- mutation {
497
- documentationProcessItems(
498
- limit: 10
499
- filters: [{ category: { eq: "api" } }]
500
- ) {
501
- message
502
- results
503
- jobs
504
- }
505
- }
506
- ```
507
-
508
- <Note>
509
- Processing mutations require `super_admin` permission.
510
- </Note>
511
-
512
- ## Workflow mutations
513
-
514
- ### Run workflow
515
-
516
- Execute a workflow template with variables.
517
-
518
- ```graphql
519
- mutation {
520
- runWorkflow(
521
- id: "workflow-123"
522
- variables: {
523
- customerName: "John Doe"
524
- orderId: "12345"
525
- priority: "high"
526
- }
527
- ) {
528
- result # Last message from workflow
529
- job # Job ID if queued
530
- metadata # Execution metadata (tokens, duration)
531
- }
532
- }
533
- ```
534
-
535
- **Response:**
536
-
537
- ```json
538
- {
539
- "data": {
540
- "runWorkflow": {
541
- "result": {
542
- "role": "assistant",
543
- "content": "Order #12345 has been processed for John Doe."
544
- },
545
- "job": "job-abc-123",
546
- "metadata": {
547
- "tokens": {
548
- "totalTokens": 1234,
549
- "inputTokens": 234,
550
- "outputTokens": 1000
551
- },
552
- "duration": 2345
553
- }
554
- }
555
- }
556
- }
557
- ```
558
-
559
- ### Schedule workflow
560
-
561
- Create a cron-based workflow schedule.
562
-
563
- ```graphql
564
- mutation {
565
- upsertWorkflowSchedule(
566
- workflow: "workflow-123"
567
- schedule: "0 9 * * *" # Daily at 9 AM
568
- ) {
569
- status
570
- job
571
- }
572
- }
573
- ```
574
-
575
- **Cron schedule examples:**
576
-
577
- - `0 9 * * *` - Daily at 9:00 AM
578
- - `*/15 * * * *` - Every 15 minutes
579
- - `0 0 * * 0` - Weekly on Sunday at midnight
580
- - `0 0 1 * *` - Monthly on the 1st at midnight
581
-
582
- ### Delete workflow schedule
583
-
584
- ```graphql
585
- mutation {
586
- deleteWorkflowSchedule(workflow: "workflow-123") {
587
- status
588
- }
589
- }
590
- ```
591
-
592
- ## Evaluation mutations
593
-
594
- ### Run evaluation
595
-
596
- Execute an evaluation set on an agent.
597
-
598
- ```graphql
599
- mutation {
600
- runEval(
601
- id: "eval-run-123"
602
- test_case_ids: ["test-1", "test-2", "test-3"]
603
- ) {
604
- jobs # Job IDs for each test case
605
- count # Number of jobs created
606
- }
607
- }
608
- ```
609
-
610
- **Run all test cases in eval set:**
611
-
612
- ```graphql
613
- mutation {
614
- runEval(id: "eval-run-123") {
615
- jobs
616
- count
617
- }
618
- }
619
- ```
620
-
621
- <Note>
622
- Evaluations are always run as background jobs using BullMQ.
623
- </Note>
624
-
625
- ## Queue management mutations
626
-
627
- ### Pause queue
628
-
629
- ```graphql
630
- mutation {
631
- pauseQueue(queue: eval_runs) {
632
- success
633
- }
634
- }
635
- ```
636
-
637
- ### Resume queue
638
-
639
- ```graphql
640
- mutation {
641
- resumeQueue(queue: eval_runs) {
642
- success
643
- }
644
- }
645
- ```
646
-
647
- ### Drain queue
648
-
649
- Remove all waiting/delayed jobs from queue.
650
-
651
- ```graphql
652
- mutation {
653
- drainQueue(queue: eval_runs) {
654
- success
655
- }
656
- }
657
- ```
658
-
659
- <Warning>
660
- Draining a queue removes jobs that haven't started yet. Active jobs continue running.
661
- </Warning>
662
-
663
- ### Delete job
664
-
665
- Remove a specific job from queue.
666
-
667
- ```graphql
668
- mutation {
669
- deleteJob(
670
- queue: eval_runs
671
- id: "job-abc-123"
672
- ) {
673
- success
674
- }
675
- }
676
- ```
677
-
678
- ## User management mutations
679
-
680
- ### Create user
681
-
682
- ```graphql
683
- mutation {
684
- usersCreateOne(
685
- input: {
686
- name: "John Doe"
687
- email: "john@example.com"
688
- password: "secure-password"
689
- role: "role-id-123"
690
- type: "user"
691
- }
692
- ) {
693
- item {
694
- id
695
- name
696
- email
697
- role
698
- }
699
- }
700
- }
701
- ```
702
-
703
- <Warning>
704
- Creating users requires `super_admin` permission. Passwords are automatically hashed with bcrypt.
705
- </Warning>
706
-
707
- ### Create API user
708
-
709
- ```graphql
710
- mutation {
711
- usersCreateOne(
712
- input: {
713
- email: "api@example.com"
714
- type: "api"
715
- apikey: "sk_abc123def456.../production-api-key"
716
- role: "api-role-id"
717
- }
718
- ) {
719
- item {
720
- id
721
- email
722
- type
723
- }
724
- }
725
- }
726
- ```
727
-
728
- <Note>
729
- API keys must be generated using [`ExuluDatabase.api.key.generate()`](/core/exulu-database#api-key-generation) and are stored as bcrypt hashes.
730
- </Note>
731
-
732
- ### Update user role
733
-
734
- ```graphql
735
- mutation {
736
- usersUpdateOneById(
737
- id: "user-123"
738
- input: {
739
- role: "new-role-id"
740
- }
741
- ) {
742
- item {
743
- id
744
- name
745
- role
746
- }
747
- }
748
- }
749
- ```
750
-
751
- ### Grant super admin
752
-
753
- ```graphql
754
- mutation {
755
- usersUpdateOneById(
756
- id: "user-123"
757
- input: {
758
- super_admin: true
759
- }
760
- ) {
761
- item {
762
- id
763
- name
764
- super_admin
765
- }
766
- }
767
- }
768
- ```
769
-
770
- <Warning>
771
- Granting or revoking `super_admin` requires existing `super_admin` permission.
772
- </Warning>
773
-
774
- ## Role management mutations
775
-
776
- ### Create role
777
-
778
- ```graphql
779
- mutation {
780
- rolesCreateOne(
781
- input: {
782
- name: "Developer"
783
- agents: "write"
784
- evals: "write"
785
- workflows: "read"
786
- variables: "read"
787
- users: "read"
788
- api: "read"
789
- }
790
- ) {
791
- item {
792
- id
793
- name
794
- }
795
- }
796
- }
797
- ```
798
-
799
- **Permission levels:**
800
- - `"read"` - Can view resources
801
- - `"write"` - Can view and modify resources
802
-
803
- ### Update role permissions
804
-
805
- ```graphql
806
- mutation {
807
- rolesUpdateOneById(
808
- id: "role-123"
809
- input: {
810
- agents: "write"
811
- workflows: "write"
812
- }
813
- ) {
814
- item {
815
- id
816
- name
817
- agents
818
- workflows
819
- }
820
- }
821
- }
822
- ```
823
-
824
- ## Advanced mutation patterns
825
-
826
- ### Mutation with variables
827
-
828
- ```graphql
829
- mutation CreateAgent(
830
- $name: String!
831
- $description: String
832
- $backend: String!
833
- ) {
834
- agentsCreateOne(
835
- input: {
836
- name: $name
837
- description: $description
838
- backend: $backend
839
- type: "agent"
840
- }
841
- ) {
842
- item {
843
- id
844
- name
845
- }
846
- }
847
- }
848
- ```
849
-
850
- **Variables:**
851
-
852
- ```json
853
- {
854
- "name": "Support Agent",
855
- "description": "Handles customer support",
856
- "backend": "anthropic_claude"
857
- }
858
- ```
859
-
860
- ### Multiple mutations in one request
861
-
862
- ```graphql
863
- mutation {
864
- agent1: agentsCreateOne(
865
- input: {
866
- name: "Agent 1"
867
- backend: "openai"
868
- type: "agent"
869
- }
870
- ) {
871
- item {
872
- id
873
- name
874
- }
875
- }
876
-
877
- agent2: agentsCreateOne(
878
- input: {
879
- name: "Agent 2"
880
- backend: "anthropic"
881
- type: "agent"
882
- }
883
- ) {
884
- item {
885
- id
886
- name
887
- }
888
- }
889
- }
890
- ```
891
-
892
- ### Mutation with fragment
893
-
894
- ```graphql
895
- fragment AgentResult on agent {
896
- id
897
- name
898
- description
899
- provider
900
- modelName
901
- createdAt
902
- }
903
-
904
- mutation {
905
- agentsCreateOne(
906
- input: {
907
- name: "New Agent"
908
- backend: "anthropic"
909
- type: "agent"
910
- }
911
- ) {
912
- item {
913
- ...AgentResult
914
- }
915
- }
916
- }
917
- ```
918
-
919
- ## Error handling
920
-
921
- ### Validation errors
922
-
923
- ```json
924
- {
925
- "errors": [
926
- {
927
- "message": "Field 'name' is required",
928
- "path": ["agentsCreateOne"]
929
- }
930
- ]
931
- }
932
- ```
933
-
934
- ### Permission errors
935
-
936
- ```json
937
- {
938
- "errors": [
939
- {
940
- "message": "Insufficient permissions to edit this record",
941
- "path": ["agentsUpdateOneById"]
942
- }
943
- ]
944
- }
945
- ```
946
-
947
- ### Not found errors
948
-
949
- ```json
950
- {
951
- "errors": [
952
- {
953
- "message": "Record not found",
954
- "path": ["agentsUpdateOneById"]
955
- }
956
- ]
957
- }
958
- ```
959
-
960
- ### RBAC errors
961
-
962
- ```json
963
- {
964
- "errors": [
965
- {
966
- "message": "Only the creator can edit this private record",
967
- "path": ["agentsUpdateOneById"]
968
- }
969
- ]
970
- }
971
- ```
972
-
973
- ## Transaction handling
974
-
975
- <Note>
976
- GraphQL mutations in Exulu IMP are not wrapped in database transactions by default. If you need transactional behavior, implement it at the application level.
977
- </Note>
978
-
979
- ## Best practices
980
-
981
- <Tip>
982
- **Check job status** - When mutations return a `job` field, use the `jobs` query to monitor background processing status
983
- </Tip>
984
-
985
- <Note>
986
- **Handle RBAC carefully** - When updating RBAC, provide the complete desired state. Partial updates replace existing permissions.
987
- </Note>
988
-
989
- <Warning>
990
- **Never expose API keys** - API keys and passwords are write-only. They're hashed and cannot be retrieved.
991
- </Warning>
992
-
993
- <Info>
994
- **Use upsert for idempotency** - When you need idempotent operations, use `upsert: true` with unique constraints
995
- </Info>
996
-
997
- ## Next steps
998
-
999
- <CardGroup cols={2}>
1000
- <Card title="Queries" icon="magnifying-glass" href="/api-reference/queries">
1001
- Learn about query operations
1002
- </Card>
1003
- <Card title="Core types" icon="database" href="/api-reference/core-types">
1004
- Explore predefined types
1005
- </Card>
1006
- <Card title="Dynamic types" icon="wand-magic-sparkles" href="/api-reference/dynamic-types">
1007
- Learn about context types
1008
- </Card>
1009
- <Card title="Introduction" icon="book" href="/api-reference/introduction">
1010
- Back to API overview
1011
- </Card>
1012
- </CardGroup>