d25d482dc2
CI / Migrate Dev DB (push) Has been skipped
CI / Detect Version (push) Has been cancelled
CI / Migrate DB (push) Has been cancelled
CI / Build Dev ECR (./docker/app.Dockerfile, ECR_APP) (push) Has been cancelled
CI / Build Dev ECR (./docker/db.Dockerfile, ECR_MIGRATIONS) (push) Has been cancelled
CI / Build Dev ECR (./docker/pii.Dockerfile, ECR_PII) (push) Has been cancelled
CI / Build Dev ECR (./docker/realtime.Dockerfile, ECR_REALTIME) (push) Has been cancelled
CI / Deploy Trigger.dev (Dev) (push) Has been cancelled
CI / Build AMD64 (./docker/app.Dockerfile, ECR_APP, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build AMD64 (./docker/db.Dockerfile, ECR_MIGRATIONS, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build AMD64 (./docker/pii.Dockerfile, ECR_PII, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build AMD64 (./docker/realtime.Dockerfile, ECR_REALTIME, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/app.Dockerfile, ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/db.Dockerfile, ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/pii.Dockerfile, ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Build ARM64 (GHCR Only) (./docker/realtime.Dockerfile, ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/migrations) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/pii) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/realtime) (push) Has been cancelled
CI / Create GHCR Manifests (ghcr.io/simstudioai/simstudio) (push) Has been cancelled
CI / Check Docs Changes (push) Has been cancelled
CI / Process Docs (push) Has been cancelled
CI / Create GitHub Release (push) Has been cancelled
CI / Test and Build (push) Has been cancelled
Publish CLI Package / publish-npm (push) Has been cancelled
Publish Python SDK / publish-pypi (push) Has been cancelled
Publish TypeScript SDK / publish-npm (push) Has been cancelled
114 lines
3.7 KiB
TypeScript
114 lines
3.7 KiB
TypeScript
import type { KnowledgeListConnectorsResponse } from '@/tools/knowledge/types'
|
|
import type { ToolConfig } from '@/tools/types'
|
|
|
|
export const knowledgeListConnectorsTool: ToolConfig<any, KnowledgeListConnectorsResponse> = {
|
|
id: 'knowledge_list_connectors',
|
|
name: 'Knowledge List Connectors',
|
|
description:
|
|
'List all connectors for a knowledge base, showing sync status, type, and document counts',
|
|
version: '1.0.0',
|
|
|
|
params: {
|
|
knowledgeBaseId: {
|
|
type: 'string',
|
|
required: true,
|
|
visibility: 'user-or-llm',
|
|
description: 'ID of the knowledge base to list connectors for',
|
|
},
|
|
},
|
|
|
|
request: {
|
|
url: (params) => `/api/knowledge/${params.knowledgeBaseId}/connectors`,
|
|
method: 'GET',
|
|
headers: () => ({
|
|
'Content-Type': 'application/json',
|
|
}),
|
|
},
|
|
|
|
transformResponse: async (response, params): Promise<KnowledgeListConnectorsResponse> => {
|
|
const result = await response.json()
|
|
const connectors = result.data || []
|
|
|
|
return {
|
|
success: result.success ?? true,
|
|
output: {
|
|
knowledgeBaseId: params?.knowledgeBaseId ?? '',
|
|
connectors: connectors.map(
|
|
(c: {
|
|
id: string
|
|
connectorType: string
|
|
status: string
|
|
syncIntervalMinutes: number
|
|
lastSyncAt: string | null
|
|
lastSyncError: string | null
|
|
lastSyncDocCount: number | null
|
|
nextSyncAt: string | null
|
|
consecutiveFailures: number
|
|
createdAt: string | null
|
|
updatedAt: string | null
|
|
}) => ({
|
|
id: c.id,
|
|
connectorType: c.connectorType,
|
|
status: c.status,
|
|
syncIntervalMinutes: c.syncIntervalMinutes,
|
|
lastSyncAt: c.lastSyncAt ?? null,
|
|
lastSyncError: c.lastSyncError ?? null,
|
|
lastSyncDocCount: c.lastSyncDocCount ?? null,
|
|
nextSyncAt: c.nextSyncAt ?? null,
|
|
consecutiveFailures: c.consecutiveFailures ?? 0,
|
|
createdAt: c.createdAt ?? null,
|
|
updatedAt: c.updatedAt ?? null,
|
|
})
|
|
),
|
|
totalConnectors: connectors.length,
|
|
},
|
|
}
|
|
},
|
|
|
|
outputs: {
|
|
knowledgeBaseId: {
|
|
type: 'string',
|
|
description: 'ID of the knowledge base',
|
|
},
|
|
connectors: {
|
|
type: 'array',
|
|
description: 'Array of connectors for the knowledge base',
|
|
items: {
|
|
type: 'object',
|
|
properties: {
|
|
id: { type: 'string', description: 'Connector ID' },
|
|
connectorType: {
|
|
type: 'string',
|
|
description: 'Type of connector (e.g. notion, github, confluence)',
|
|
},
|
|
status: {
|
|
type: 'string',
|
|
description: 'Connector status (active, paused, syncing)',
|
|
},
|
|
syncIntervalMinutes: {
|
|
type: 'number',
|
|
description: 'Sync interval in minutes (0 = manual only)',
|
|
},
|
|
lastSyncAt: { type: 'string', description: 'Timestamp of last sync' },
|
|
lastSyncError: { type: 'string', description: 'Error from last sync if failed' },
|
|
lastSyncDocCount: {
|
|
type: 'number',
|
|
description: 'Number of documents synced in last sync',
|
|
},
|
|
nextSyncAt: { type: 'string', description: 'Timestamp of next scheduled sync' },
|
|
consecutiveFailures: {
|
|
type: 'number',
|
|
description: 'Number of consecutive sync failures',
|
|
},
|
|
createdAt: { type: 'string', description: 'Creation timestamp' },
|
|
updatedAt: { type: 'string', description: 'Last update timestamp' },
|
|
},
|
|
},
|
|
},
|
|
totalConnectors: {
|
|
type: 'number',
|
|
description: 'Total number of connectors',
|
|
},
|
|
},
|
|
}
|