@swiss-ai-hub/web 0.320.0 → 0.321.1
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.
- package/components/FormKit/AgentSelector.vue +20 -7
- package/components/FormKit/Repeater.vue +1 -4
- package/components/FormKit/VectorStoreInput.vue +43 -6
- package/components/Knowledge/Database/CreateModal.vue +315 -0
- package/components/Knowledge/Database/EmptyCard.vue +34 -0
- package/components/Knowledge/DeleteConfirmModal.vue +87 -0
- package/components/Knowledge/Namespace/Card.vue +18 -0
- package/components/Knowledge/Namespace/CreateModal.vue +11 -3
- package/components/Role/AccessCapabilities.vue +4 -4
- package/components/Role/AccessCapabilityGroup.vue +22 -6
- package/components/Role/AccessRulesEditor.vue +15 -12
- package/composables/app/useAppVersion.ts +31 -33
- package/composables/auth/useAuth.ts +3 -11
- package/composables/document/useCreateDatabase.ts +21 -0
- package/composables/document/useDeleteDatabase.ts +29 -0
- package/composables/document/useDeleteDocument.ts +1 -1
- package/composables/document/useDeleteDocuments.ts +1 -1
- package/composables/document/useDeleteNamespace.ts +30 -0
- package/composables/document/useIngestors.ts +23 -0
- package/composables/form/useCreateInstanceForm.ts +2 -2
- package/composables/form/useFormKitTransform.ts +44 -15
- package/formkit.config.ts +24 -1
- package/i18n/locales/de.yaml +60 -5
- package/i18n/locales/en.yaml +57 -3
- package/i18n/locales/fr.yaml +58 -3
- package/i18n/locales/it.yaml +60 -3
- package/middleware/agent-admin.ts +31 -0
- package/package.json +1 -1
- package/pages/[tenant]/service/agents.vue +3 -0
- package/pages/[tenant]/service/knowledge/[db]/[namespace]/[document_id].vue +12 -5
- package/pages/[tenant]/service/knowledge.vue +138 -0
- package/plugins/0.runtime-config.client.ts +5 -0
- package/plugins/oidc-client.ts +1 -1
- package/sdk/client/index.ts +29 -2
- package/sdk/client/schemas.gen.ts +641 -77
- package/sdk/client/sdk.gen.ts +159 -1
- package/sdk/client/types.gen.ts +543 -75
- package/plugins/keycloak-client.ts +0 -41
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:loading="databasesAreLoading"
|
|
6
6
|
>
|
|
7
7
|
<div class="flex flex-col gap-12">
|
|
8
|
+
<KnowledgeDatabaseEmptyCard @add="openNewDatabaseModal" />
|
|
8
9
|
<div
|
|
9
10
|
v-for="database in databases"
|
|
10
11
|
:key="database.name"
|
|
@@ -21,6 +22,19 @@
|
|
|
21
22
|
class="pi pi-lock-open text-surface-400 dark:text-surface-500"
|
|
22
23
|
:title="t('knowledge.manual_management.description')"
|
|
23
24
|
/>
|
|
25
|
+
<span class="text-xs text-surface-500 dark:text-surface-400">
|
|
26
|
+
{{ t('knowledge.pipeline', { name: capitalCase(database.ingestor) }) }}
|
|
27
|
+
</span>
|
|
28
|
+
<Button
|
|
29
|
+
v-if="database.deletable"
|
|
30
|
+
v-tooltip.top="t('knowledge.delete_database')"
|
|
31
|
+
icon="pi pi-trash"
|
|
32
|
+
rounded
|
|
33
|
+
text
|
|
34
|
+
size="small"
|
|
35
|
+
severity="danger"
|
|
36
|
+
@click="openDeleteDatabaseModal(database)"
|
|
37
|
+
/>
|
|
24
38
|
</div>
|
|
25
39
|
<div class="grid grid-cols-2 gap-4 2xl:grid-cols-2">
|
|
26
40
|
<KnowledgeNamespaceCard
|
|
@@ -31,6 +45,7 @@
|
|
|
31
45
|
@click="toNamespace(database.name, namespace)"
|
|
32
46
|
@upload="openUploadModal(database, namespace)"
|
|
33
47
|
@edit="openEditNamespaceModal(namespace)"
|
|
48
|
+
@delete="openDeleteNamespaceModal(database, namespace)"
|
|
34
49
|
/>
|
|
35
50
|
<KnowledgeNamespaceEmptyCard
|
|
36
51
|
v-if="!database.auto_sync"
|
|
@@ -63,6 +78,20 @@
|
|
|
63
78
|
:namespace="editingNamespace"
|
|
64
79
|
@success="handleUpdateSuccess"
|
|
65
80
|
/>
|
|
81
|
+
|
|
82
|
+
<KnowledgeDatabaseCreateModal
|
|
83
|
+
v-model="newDatabaseModalVisible"
|
|
84
|
+
@success="handleDatabaseCreationSuccess"
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<KnowledgeDeleteConfirmModal
|
|
88
|
+
v-model:visible="deleteModalVisible"
|
|
89
|
+
:title="deleteTitle"
|
|
90
|
+
:warning="deleteWarning"
|
|
91
|
+
:expected-name="deleteExpectedName"
|
|
92
|
+
:is-deleting="isDeleting"
|
|
93
|
+
@confirm="handleConfirmDelete"
|
|
94
|
+
/>
|
|
66
95
|
</StructuralScreen>
|
|
67
96
|
</template>
|
|
68
97
|
|
|
@@ -71,12 +100,18 @@ import { capitalCase } from 'change-case'
|
|
|
71
100
|
|
|
72
101
|
import type { DatabaseDto, NamespaceDto } from '@core/sdk/client'
|
|
73
102
|
|
|
103
|
+
const route = useRoute()
|
|
74
104
|
const router = useRouter()
|
|
75
105
|
const tenantPath = useTenantPath()
|
|
76
106
|
const { t } = useI18n()
|
|
107
|
+
const toast = useToast()
|
|
108
|
+
const { tenantId } = useTenant()
|
|
77
109
|
|
|
78
110
|
const { databases, databasesAreLoading } = useDatabases()
|
|
79
111
|
|
|
112
|
+
const { deleteDatabase, isDeleting: isDeletingDatabase } = useDeleteDatabase()
|
|
113
|
+
const { deleteNamespace, isDeleting: isDeletingNamespace } = useDeleteNamespace()
|
|
114
|
+
|
|
80
115
|
const uploadModalVisible = ref(false)
|
|
81
116
|
const selectedDatabaseForUpload = ref('')
|
|
82
117
|
const selectedNamespaceForUpload = ref('')
|
|
@@ -89,6 +124,8 @@ const selectedDatabaseForNewNamespace = ref('')
|
|
|
89
124
|
const editNamespaceModalVisible = ref(false)
|
|
90
125
|
const editingNamespace = ref<NamespaceDto | null>(null)
|
|
91
126
|
|
|
127
|
+
const newDatabaseModalVisible = ref(false)
|
|
128
|
+
|
|
92
129
|
const toNamespace = (database_name: string, namespace: NamespaceDto) => {
|
|
93
130
|
router.push(tenantPath(`/service/knowledge/${database_name}/${namespace.name}`))
|
|
94
131
|
}
|
|
@@ -123,4 +160,105 @@ const openEditNamespaceModal = (namespace: NamespaceDto) => {
|
|
|
123
160
|
const handleUpdateSuccess = () => {
|
|
124
161
|
editingNamespace.value = null
|
|
125
162
|
}
|
|
163
|
+
|
|
164
|
+
const openNewDatabaseModal = () => {
|
|
165
|
+
newDatabaseModalVisible.value = true
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const handleDatabaseCreationSuccess = () => {
|
|
169
|
+
newDatabaseModalVisible.value = false
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
type PendingDeletion
|
|
173
|
+
= | { type: 'database', database: string, name: string, count: number }
|
|
174
|
+
| { type: 'namespace', database: string, namespace: string, name: string, count: number }
|
|
175
|
+
|
|
176
|
+
const deleteModalVisible = ref(false)
|
|
177
|
+
const pendingDeletion = ref<PendingDeletion | null>(null)
|
|
178
|
+
|
|
179
|
+
const isDeleting = computed(() => isDeletingDatabase.value || isDeletingNamespace.value)
|
|
180
|
+
|
|
181
|
+
const deleteExpectedName = computed(() => pendingDeletion.value?.name ?? '')
|
|
182
|
+
|
|
183
|
+
const deleteTitle = computed(() =>
|
|
184
|
+
pendingDeletion.value?.type === 'database'
|
|
185
|
+
? t('knowledge.delete.database.title')
|
|
186
|
+
: t('knowledge.delete.namespace.title'),
|
|
187
|
+
)
|
|
188
|
+
|
|
189
|
+
const deleteWarning = computed(() => {
|
|
190
|
+
const pending = pendingDeletion.value
|
|
191
|
+
if (!pending) return ''
|
|
192
|
+
const params = { name: pending.name, count: pending.count }
|
|
193
|
+
return pending.type === 'database'
|
|
194
|
+
? t('knowledge.delete.database.warning', params)
|
|
195
|
+
: t('knowledge.delete.namespace.warning', params)
|
|
196
|
+
})
|
|
197
|
+
|
|
198
|
+
const documentCountFor = (database: DatabaseDto) =>
|
|
199
|
+
(database.namespaces ?? []).reduce((sum, namespace) => sum + (namespace.number_of_documents ?? 0), 0)
|
|
200
|
+
|
|
201
|
+
const openDeleteDatabaseModal = (database: DatabaseDto) => {
|
|
202
|
+
pendingDeletion.value = {
|
|
203
|
+
type: 'database',
|
|
204
|
+
database: database.name,
|
|
205
|
+
name: database.name,
|
|
206
|
+
count: documentCountFor(database),
|
|
207
|
+
}
|
|
208
|
+
deleteModalVisible.value = true
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const openDeleteNamespaceModal = (database: DatabaseDto, namespace: NamespaceDto) => {
|
|
212
|
+
pendingDeletion.value = {
|
|
213
|
+
type: 'namespace',
|
|
214
|
+
database: database.name,
|
|
215
|
+
namespace: namespace.name,
|
|
216
|
+
name: namespace.name,
|
|
217
|
+
count: namespace.number_of_documents ?? 0,
|
|
218
|
+
}
|
|
219
|
+
deleteModalVisible.value = true
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// The nested document route renders inside this page, so deleting what it points at leaves it mounted on a
|
|
223
|
+
// dead URL. Leave for the nearest surviving ancestor first: navigating deactivates the child's queries, so the
|
|
224
|
+
// delete's invalidation only marks them stale instead of refetching a resource the teardown job is purging.
|
|
225
|
+
// Both cases land on the database list — there is no /service/knowledge/[db] route.
|
|
226
|
+
const isViewingPendingDeletion = (pending: PendingDeletion) => {
|
|
227
|
+
if (route.params.db !== pending.database) return false
|
|
228
|
+
return pending.type === 'database' || route.params.namespace === pending.namespace
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const handleConfirmDelete = async () => {
|
|
232
|
+
const pending = pendingDeletion.value
|
|
233
|
+
if (!pending) return
|
|
234
|
+
|
|
235
|
+
try {
|
|
236
|
+
if (isViewingPendingDeletion(pending)) {
|
|
237
|
+
await router.push(tenantPath('/service/knowledge'))
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (pending.type === 'database') {
|
|
241
|
+
await deleteDatabase({ tenantId: tenantId.value!, database: pending.database })
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
await deleteNamespace({ tenantId: tenantId.value!, database: pending.database, namespace: pending.namespace })
|
|
245
|
+
}
|
|
246
|
+
toast.add({
|
|
247
|
+
severity: 'success',
|
|
248
|
+
summary: t('knowledge.delete.scheduled.summary'),
|
|
249
|
+
detail: t('knowledge.delete.scheduled.detail'),
|
|
250
|
+
life: 4000,
|
|
251
|
+
})
|
|
252
|
+
deleteModalVisible.value = false
|
|
253
|
+
pendingDeletion.value = null
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
toast.add({
|
|
257
|
+
severity: 'error',
|
|
258
|
+
summary: t('knowledge.delete.error.summary'),
|
|
259
|
+
detail: t('knowledge.delete.error.detail'),
|
|
260
|
+
life: 4000,
|
|
261
|
+
})
|
|
262
|
+
}
|
|
263
|
+
}
|
|
126
264
|
</script>
|
|
@@ -50,6 +50,11 @@ export default defineNuxtPlugin(() => {
|
|
|
50
50
|
assign(group('sysadmin'), 'url', injected.SYSADMIN_URL)
|
|
51
51
|
assign(group('mainApp'), 'url', injected.MAIN_APP_URL)
|
|
52
52
|
if (injected.API_BASE_URL) publicConfig.apiBaseUrl = injected.API_BASE_URL
|
|
53
|
+
// The version actually deployed. A release is promoted by retagging the exact
|
|
54
|
+
// `-rc.N` build that was tested, so whatever was baked into the bundle at build
|
|
55
|
+
// time keeps the candidate's name — the deployment is the only party that knows
|
|
56
|
+
// the tag it pulled. Falls back to the baked value when nothing is injected.
|
|
57
|
+
if (injected.APP_VERSION) publicConfig.appVersion = injected.APP_VERSION
|
|
53
58
|
|
|
54
59
|
isConfigLoaded.value = true
|
|
55
60
|
})
|
package/plugins/oidc-client.ts
CHANGED
|
@@ -12,7 +12,7 @@ export default defineNuxtPlugin(async ({ $i18n, $router }) => {
|
|
|
12
12
|
client_id: config.public.oidc.clientId,
|
|
13
13
|
redirect_uri: `${globalThis.location.origin}/${$i18n.locale.value}/auth/callback`,
|
|
14
14
|
silent_redirect_uri: `${globalThis.location.origin}/${$i18n.locale.value}/auth/renew`,
|
|
15
|
-
post_logout_redirect_uri: globalThis.location.origin
|
|
15
|
+
post_logout_redirect_uri: `${globalThis.location.origin}/${$i18n.locale.value}/auth/login`,
|
|
16
16
|
response_type: 'code',
|
|
17
17
|
scope: 'openid profile email',
|
|
18
18
|
filterProtocolClaims: true,
|
package/sdk/client/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export {
|
|
|
7
7
|
batchDeleteDocuments,
|
|
8
8
|
chatCompletionWithAssistants,
|
|
9
9
|
createAgentInstance,
|
|
10
|
+
createDatabase,
|
|
10
11
|
createDataset,
|
|
11
12
|
createNamespace,
|
|
12
13
|
createProcessInstance,
|
|
@@ -18,7 +19,9 @@ export {
|
|
|
18
19
|
deleteAgentInstance,
|
|
19
20
|
deleteAllOrganizationMemories,
|
|
20
21
|
deleteAllUserMemories,
|
|
22
|
+
deleteDatabase,
|
|
21
23
|
deleteDocument,
|
|
24
|
+
deleteNamespace,
|
|
22
25
|
deleteOrganizationMemory,
|
|
23
26
|
deleteProcessInstance,
|
|
24
27
|
deleteRole,
|
|
@@ -41,12 +44,14 @@ export {
|
|
|
41
44
|
getDatabases,
|
|
42
45
|
getDataset,
|
|
43
46
|
getDatasets,
|
|
47
|
+
getDefaultTenantRules,
|
|
44
48
|
getDocumentById,
|
|
45
49
|
getDocumentsForNamespace,
|
|
46
50
|
getDocumentUrl,
|
|
47
51
|
getEmbeddings,
|
|
48
52
|
getFileUrl,
|
|
49
53
|
getHealth,
|
|
54
|
+
getIngestors,
|
|
50
55
|
getLitellmModel,
|
|
51
56
|
getLitellmModels,
|
|
52
57
|
getLitellmModelsByMode,
|
|
@@ -141,7 +146,6 @@ export {
|
|
|
141
146
|
type AgentClassDtoWritable,
|
|
142
147
|
type AgentConfigDto,
|
|
143
148
|
type AgentConfigDtoWritable,
|
|
144
|
-
type AgentConfigSpecs,
|
|
145
149
|
type AgentEvent,
|
|
146
150
|
type AgentEventWritable,
|
|
147
151
|
type AgentFileUploadRequest,
|
|
@@ -254,6 +258,7 @@ export {
|
|
|
254
258
|
type ColorPickerWritable,
|
|
255
259
|
type CompletionTokensDetails,
|
|
256
260
|
type CompletionUsage,
|
|
261
|
+
type ConfigSpecs,
|
|
257
262
|
type ContextInsufficientRejectEvent,
|
|
258
263
|
type ContextInsufficientRejectEventWritable,
|
|
259
264
|
type ContextSufficientAcceptEvent,
|
|
@@ -270,6 +275,12 @@ export {
|
|
|
270
275
|
type CreateAgentInstanceRequest,
|
|
271
276
|
type CreateAgentInstanceResponse,
|
|
272
277
|
type CreateAgentInstanceResponses,
|
|
278
|
+
type CreateDatabaseData,
|
|
279
|
+
type CreateDatabaseError,
|
|
280
|
+
type CreateDatabaseErrors,
|
|
281
|
+
type CreateDatabaseRequest,
|
|
282
|
+
type CreateDatabaseResponse,
|
|
283
|
+
type CreateDatabaseResponses,
|
|
273
284
|
type CreateDatasetData,
|
|
274
285
|
type CreateDatasetError,
|
|
275
286
|
type CreateDatasetErrors,
|
|
@@ -323,6 +334,7 @@ export {
|
|
|
323
334
|
type DashboardDto,
|
|
324
335
|
type DashboardItemDto,
|
|
325
336
|
type DatabaseDto,
|
|
337
|
+
type DatabaseResponse,
|
|
326
338
|
type Dataset,
|
|
327
339
|
type DatasetCreate,
|
|
328
340
|
type DatasetItem,
|
|
@@ -342,11 +354,19 @@ export {
|
|
|
342
354
|
type DeleteAllUserMemoriesData,
|
|
343
355
|
type DeleteAllUserMemoriesResponse,
|
|
344
356
|
type DeleteAllUserMemoriesResponses,
|
|
357
|
+
type DeleteDatabaseData,
|
|
358
|
+
type DeleteDatabaseError,
|
|
359
|
+
type DeleteDatabaseErrors,
|
|
360
|
+
type DeleteDatabaseResponses,
|
|
345
361
|
type DeleteDocumentData,
|
|
346
362
|
type DeleteDocumentError,
|
|
347
363
|
type DeleteDocumentErrors,
|
|
348
364
|
type DeleteDocumentResponses,
|
|
349
365
|
type DeleteMemoryResponse,
|
|
366
|
+
type DeleteNamespaceData,
|
|
367
|
+
type DeleteNamespaceError,
|
|
368
|
+
type DeleteNamespaceErrors,
|
|
369
|
+
type DeleteNamespaceResponses,
|
|
350
370
|
type DeleteOrganizationMemoryData,
|
|
351
371
|
type DeleteOrganizationMemoryError,
|
|
352
372
|
type DeleteOrganizationMemoryErrors,
|
|
@@ -489,6 +509,9 @@ export {
|
|
|
489
509
|
type GetDatasetsData,
|
|
490
510
|
type GetDatasetsResponse,
|
|
491
511
|
type GetDatasetsResponses,
|
|
512
|
+
type GetDefaultTenantRulesData,
|
|
513
|
+
type GetDefaultTenantRulesResponse,
|
|
514
|
+
type GetDefaultTenantRulesResponses,
|
|
492
515
|
type GetDocumentByIdData,
|
|
493
516
|
type GetDocumentByIdError,
|
|
494
517
|
type GetDocumentByIdErrors,
|
|
@@ -517,6 +540,9 @@ export {
|
|
|
517
540
|
type GetHealthData,
|
|
518
541
|
type GetHealthResponse,
|
|
519
542
|
type GetHealthResponses,
|
|
543
|
+
type GetIngestorsData,
|
|
544
|
+
type GetIngestorsResponse,
|
|
545
|
+
type GetIngestorsResponses,
|
|
520
546
|
type GetLitellmModelData,
|
|
521
547
|
type GetLitellmModelError,
|
|
522
548
|
type GetLitellmModelErrors,
|
|
@@ -712,6 +738,8 @@ export {
|
|
|
712
738
|
type ImagesResponse,
|
|
713
739
|
type ImageUrl,
|
|
714
740
|
type IngestedNode,
|
|
741
|
+
type IngestorDto,
|
|
742
|
+
type IngestorDtoWritable,
|
|
715
743
|
type InitiateDocumentUploadData,
|
|
716
744
|
type InitiateDocumentUploadError,
|
|
717
745
|
type InitiateDocumentUploadErrors,
|
|
@@ -827,7 +855,6 @@ export {
|
|
|
827
855
|
type ProcessClassDto,
|
|
828
856
|
type ProcessClassDtoWritable,
|
|
829
857
|
type ProcessConfigDto,
|
|
830
|
-
type ProcessConfigSpecs,
|
|
831
858
|
type ProcessDocumentData,
|
|
832
859
|
type ProcessDocumentError,
|
|
833
860
|
type ProcessDocumentErrors,
|