mirror of
https://github.com/langgenius/dify.git
synced 2026-09-24 23:22:26 +08:00
feat: Unify Agent v2 console routes (#37465)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
parent
a18635e566
commit
1e8329f02c
@@ -0,0 +1,582 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
|
||||
import {
|
||||
zDeleteAgentByAgentIdFilesPath,
|
||||
zDeleteAgentByAgentIdFilesQuery,
|
||||
zDeleteAgentByAgentIdFilesResponse,
|
||||
zDeleteAgentByAgentIdPath,
|
||||
zDeleteAgentByAgentIdResponse,
|
||||
zDeleteAgentByAgentIdSkillsBySlugPath,
|
||||
zDeleteAgentByAgentIdSkillsBySlugResponse,
|
||||
zGetAgentByAgentIdComposerCandidatesPath,
|
||||
zGetAgentByAgentIdComposerCandidatesResponse,
|
||||
zGetAgentByAgentIdComposerPath,
|
||||
zGetAgentByAgentIdComposerResponse,
|
||||
zGetAgentByAgentIdDriveFilesDownloadPath,
|
||||
zGetAgentByAgentIdDriveFilesDownloadQuery,
|
||||
zGetAgentByAgentIdDriveFilesDownloadResponse,
|
||||
zGetAgentByAgentIdDriveFilesPath,
|
||||
zGetAgentByAgentIdDriveFilesPreviewPath,
|
||||
zGetAgentByAgentIdDriveFilesPreviewQuery,
|
||||
zGetAgentByAgentIdDriveFilesPreviewResponse,
|
||||
zGetAgentByAgentIdDriveFilesQuery,
|
||||
zGetAgentByAgentIdDriveFilesResponse,
|
||||
zGetAgentByAgentIdPath,
|
||||
zGetAgentByAgentIdReferencingWorkflowsPath,
|
||||
zGetAgentByAgentIdReferencingWorkflowsResponse,
|
||||
zGetAgentByAgentIdResponse,
|
||||
zGetAgentByAgentIdSandboxFilesPath,
|
||||
zGetAgentByAgentIdSandboxFilesQuery,
|
||||
zGetAgentByAgentIdSandboxFilesReadPath,
|
||||
zGetAgentByAgentIdSandboxFilesReadQuery,
|
||||
zGetAgentByAgentIdSandboxFilesReadResponse,
|
||||
zGetAgentByAgentIdSandboxFilesResponse,
|
||||
zGetAgentByAgentIdVersionsByVersionIdPath,
|
||||
zGetAgentByAgentIdVersionsByVersionIdResponse,
|
||||
zGetAgentByAgentIdVersionsPath,
|
||||
zGetAgentByAgentIdVersionsResponse,
|
||||
zGetAgentInviteOptionsQuery,
|
||||
zGetAgentInviteOptionsResponse,
|
||||
zGetAgentQuery,
|
||||
zGetAgentResponse,
|
||||
zPostAgentBody,
|
||||
zPostAgentByAgentIdComposerValidateBody,
|
||||
zPostAgentByAgentIdComposerValidatePath,
|
||||
zPostAgentByAgentIdComposerValidateResponse,
|
||||
zPostAgentByAgentIdFeaturesBody,
|
||||
zPostAgentByAgentIdFeaturesPath,
|
||||
zPostAgentByAgentIdFeaturesResponse,
|
||||
zPostAgentByAgentIdFilesBody,
|
||||
zPostAgentByAgentIdFilesPath,
|
||||
zPostAgentByAgentIdFilesResponse,
|
||||
zPostAgentByAgentIdSandboxFilesUploadBody,
|
||||
zPostAgentByAgentIdSandboxFilesUploadPath,
|
||||
zPostAgentByAgentIdSandboxFilesUploadResponse,
|
||||
zPostAgentByAgentIdSkillsBySlugInferToolsPath,
|
||||
zPostAgentByAgentIdSkillsBySlugInferToolsResponse,
|
||||
zPostAgentByAgentIdSkillsStandardizePath,
|
||||
zPostAgentByAgentIdSkillsStandardizeResponse,
|
||||
zPostAgentByAgentIdSkillsUploadPath,
|
||||
zPostAgentByAgentIdSkillsUploadResponse,
|
||||
zPostAgentResponse,
|
||||
zPutAgentByAgentIdBody,
|
||||
zPutAgentByAgentIdComposerBody,
|
||||
zPutAgentByAgentIdComposerPath,
|
||||
zPutAgentByAgentIdComposerResponse,
|
||||
zPutAgentByAgentIdPath,
|
||||
zPutAgentByAgentIdResponse,
|
||||
} from './zod.gen'
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentInviteOptions',
|
||||
path: '/agent/invite-options',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetAgentInviteOptionsQuery.optional() }))
|
||||
.output(zGetAgentInviteOptionsResponse)
|
||||
|
||||
export const inviteOptions = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdComposerCandidates',
|
||||
path: '/agent/{agent_id}/composer/candidates',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentByAgentIdComposerCandidatesPath }))
|
||||
.output(zGetAgentByAgentIdComposerCandidatesResponse)
|
||||
|
||||
export const candidates = {
|
||||
get: get2,
|
||||
}
|
||||
|
||||
export const post = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAgentByAgentIdComposerValidate',
|
||||
path: '/agent/{agent_id}/composer/validate',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostAgentByAgentIdComposerValidateBody,
|
||||
params: zPostAgentByAgentIdComposerValidatePath,
|
||||
}),
|
||||
)
|
||||
.output(zPostAgentByAgentIdComposerValidateResponse)
|
||||
|
||||
export const validate = {
|
||||
post,
|
||||
}
|
||||
|
||||
export const get3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdComposer',
|
||||
path: '/agent/{agent_id}/composer',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentByAgentIdComposerPath }))
|
||||
.output(zGetAgentByAgentIdComposerResponse)
|
||||
|
||||
export const put = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PUT',
|
||||
operationId: 'putAgentByAgentIdComposer',
|
||||
path: '/agent/{agent_id}/composer',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPutAgentByAgentIdComposerBody, params: zPutAgentByAgentIdComposerPath }))
|
||||
.output(zPutAgentByAgentIdComposerResponse)
|
||||
|
||||
export const composer = {
|
||||
get: get3,
|
||||
put,
|
||||
candidates,
|
||||
validate,
|
||||
}
|
||||
|
||||
/**
|
||||
* Time-limited external signed URL for one Agent App drive value
|
||||
*/
|
||||
export const get4 = oc
|
||||
.route({
|
||||
description: 'Time-limited external signed URL for one Agent App drive value',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdDriveFilesDownload',
|
||||
path: '/agent/{agent_id}/drive/files/download',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetAgentByAgentIdDriveFilesDownloadPath,
|
||||
query: zGetAgentByAgentIdDriveFilesDownloadQuery,
|
||||
}),
|
||||
)
|
||||
.output(zGetAgentByAgentIdDriveFilesDownloadResponse)
|
||||
|
||||
export const download = {
|
||||
get: get4,
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncated text preview of one Agent App drive value
|
||||
*/
|
||||
export const get5 = oc
|
||||
.route({
|
||||
description: 'Truncated text preview of one Agent App drive value',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdDriveFilesPreview',
|
||||
path: '/agent/{agent_id}/drive/files/preview',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetAgentByAgentIdDriveFilesPreviewPath,
|
||||
query: zGetAgentByAgentIdDriveFilesPreviewQuery,
|
||||
}),
|
||||
)
|
||||
.output(zGetAgentByAgentIdDriveFilesPreviewResponse)
|
||||
|
||||
export const preview = {
|
||||
get: get5,
|
||||
}
|
||||
|
||||
/**
|
||||
* List agent drive entries for an Agent App
|
||||
*/
|
||||
export const get6 = oc
|
||||
.route({
|
||||
description: 'List agent drive entries for an Agent App',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdDriveFiles',
|
||||
path: '/agent/{agent_id}/drive/files',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetAgentByAgentIdDriveFilesPath,
|
||||
query: zGetAgentByAgentIdDriveFilesQuery.optional(),
|
||||
}),
|
||||
)
|
||||
.output(zGetAgentByAgentIdDriveFilesResponse)
|
||||
|
||||
export const files = {
|
||||
get: get6,
|
||||
download,
|
||||
preview,
|
||||
}
|
||||
|
||||
export const drive = {
|
||||
files,
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an Agent App's presentation features (opener, follow-up, citations, ...)
|
||||
*/
|
||||
export const post2 = oc
|
||||
.route({
|
||||
description: 'Update an Agent App\'s presentation features (opener, follow-up, citations, ...)',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAgentByAgentIdFeatures',
|
||||
path: '/agent/{agent_id}/features',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({ body: zPostAgentByAgentIdFeaturesBody, params: zPostAgentByAgentIdFeaturesPath }),
|
||||
)
|
||||
.output(zPostAgentByAgentIdFeaturesResponse)
|
||||
|
||||
export const features = {
|
||||
post: post2,
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete one Agent App drive file by key
|
||||
*/
|
||||
export const delete_ = oc
|
||||
.route({
|
||||
description: 'Delete one Agent App drive file by key',
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteAgentByAgentIdFiles',
|
||||
path: '/agent/{agent_id}/files',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({ params: zDeleteAgentByAgentIdFilesPath, query: zDeleteAgentByAgentIdFilesQuery }),
|
||||
)
|
||||
.output(zDeleteAgentByAgentIdFilesResponse)
|
||||
|
||||
/**
|
||||
* Commit an uploaded file into the Agent App drive under files/<name>
|
||||
*/
|
||||
export const post3 = oc
|
||||
.route({
|
||||
description: 'Commit an uploaded file into the Agent App drive under files/<name>',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAgentByAgentIdFiles',
|
||||
path: '/agent/{agent_id}/files',
|
||||
successStatus: 201,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAgentByAgentIdFilesBody, params: zPostAgentByAgentIdFilesPath }))
|
||||
.output(zPostAgentByAgentIdFilesResponse)
|
||||
|
||||
export const files2 = {
|
||||
delete: delete_,
|
||||
post: post3,
|
||||
}
|
||||
|
||||
/**
|
||||
* List workflow apps that reference this Agent App's bound Agent (read-only)
|
||||
*/
|
||||
export const get7 = oc
|
||||
.route({
|
||||
description: 'List workflow apps that reference this Agent App\'s bound Agent (read-only)',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdReferencingWorkflows',
|
||||
path: '/agent/{agent_id}/referencing-workflows',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentByAgentIdReferencingWorkflowsPath }))
|
||||
.output(zGetAgentByAgentIdReferencingWorkflowsResponse)
|
||||
|
||||
export const referencingWorkflows = {
|
||||
get: get7,
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a text/binary preview file in an Agent App conversation sandbox
|
||||
*/
|
||||
export const get8 = oc
|
||||
.route({
|
||||
description: 'Read a text/binary preview file in an Agent App conversation sandbox',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdSandboxFilesRead',
|
||||
path: '/agent/{agent_id}/sandbox/files/read',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetAgentByAgentIdSandboxFilesReadPath,
|
||||
query: zGetAgentByAgentIdSandboxFilesReadQuery,
|
||||
}),
|
||||
)
|
||||
.output(zGetAgentByAgentIdSandboxFilesReadResponse)
|
||||
|
||||
export const read = {
|
||||
get: get8,
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload one Agent App sandbox file as a Dify ToolFile mapping
|
||||
*/
|
||||
export const post4 = oc
|
||||
.route({
|
||||
description: 'Upload one Agent App sandbox file as a Dify ToolFile mapping',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAgentByAgentIdSandboxFilesUpload',
|
||||
path: '/agent/{agent_id}/sandbox/files/upload',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
body: zPostAgentByAgentIdSandboxFilesUploadBody,
|
||||
params: zPostAgentByAgentIdSandboxFilesUploadPath,
|
||||
}),
|
||||
)
|
||||
.output(zPostAgentByAgentIdSandboxFilesUploadResponse)
|
||||
|
||||
export const upload = {
|
||||
post: post4,
|
||||
}
|
||||
|
||||
/**
|
||||
* List a directory in an Agent App conversation sandbox
|
||||
*/
|
||||
export const get9 = oc
|
||||
.route({
|
||||
description: 'List a directory in an Agent App conversation sandbox',
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdSandboxFiles',
|
||||
path: '/agent/{agent_id}/sandbox/files',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(
|
||||
z.object({
|
||||
params: zGetAgentByAgentIdSandboxFilesPath,
|
||||
query: zGetAgentByAgentIdSandboxFilesQuery,
|
||||
}),
|
||||
)
|
||||
.output(zGetAgentByAgentIdSandboxFilesResponse)
|
||||
|
||||
export const files3 = {
|
||||
get: get9,
|
||||
read,
|
||||
upload,
|
||||
}
|
||||
|
||||
export const sandbox = {
|
||||
files: files3,
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate + standardize a Skill into an Agent App drive
|
||||
*/
|
||||
export const post5 = oc
|
||||
.route({
|
||||
description: 'Validate + standardize a Skill into an Agent App drive',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAgentByAgentIdSkillsStandardize',
|
||||
path: '/agent/{agent_id}/skills/standardize',
|
||||
successStatus: 201,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostAgentByAgentIdSkillsStandardizePath }))
|
||||
.output(zPostAgentByAgentIdSkillsStandardizeResponse)
|
||||
|
||||
export const standardize = {
|
||||
post: post5,
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload + validate a Skill package for an Agent App
|
||||
*/
|
||||
export const post6 = oc
|
||||
.route({
|
||||
description: 'Upload + validate a Skill package for an Agent App',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAgentByAgentIdSkillsUpload',
|
||||
path: '/agent/{agent_id}/skills/upload',
|
||||
successStatus: 201,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostAgentByAgentIdSkillsUploadPath }))
|
||||
.output(zPostAgentByAgentIdSkillsUploadResponse)
|
||||
|
||||
export const upload2 = {
|
||||
post: post6,
|
||||
}
|
||||
|
||||
/**
|
||||
* Infer CLI tool + ENV suggestions from a standardized Agent App skill
|
||||
*/
|
||||
export const post7 = oc
|
||||
.route({
|
||||
description: 'Infer CLI tool + ENV suggestions from a standardized Agent App skill',
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAgentByAgentIdSkillsBySlugInferTools',
|
||||
path: '/agent/{agent_id}/skills/{slug}/infer-tools',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zPostAgentByAgentIdSkillsBySlugInferToolsPath }))
|
||||
.output(zPostAgentByAgentIdSkillsBySlugInferToolsResponse)
|
||||
|
||||
export const inferTools = {
|
||||
post: post7,
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a standardized skill from an Agent App drive
|
||||
*/
|
||||
export const delete2 = oc
|
||||
.route({
|
||||
description: 'Delete a standardized skill from an Agent App drive',
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteAgentByAgentIdSkillsBySlug',
|
||||
path: '/agent/{agent_id}/skills/{slug}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteAgentByAgentIdSkillsBySlugPath }))
|
||||
.output(zDeleteAgentByAgentIdSkillsBySlugResponse)
|
||||
|
||||
export const bySlug = {
|
||||
delete: delete2,
|
||||
inferTools,
|
||||
}
|
||||
|
||||
export const skills = {
|
||||
standardize,
|
||||
upload: upload2,
|
||||
bySlug,
|
||||
}
|
||||
|
||||
export const get10 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdVersionsByVersionId',
|
||||
path: '/agent/{agent_id}/versions/{version_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentByAgentIdVersionsByVersionIdPath }))
|
||||
.output(zGetAgentByAgentIdVersionsByVersionIdResponse)
|
||||
|
||||
export const byVersionId = {
|
||||
get: get10,
|
||||
}
|
||||
|
||||
export const get11 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentIdVersions',
|
||||
path: '/agent/{agent_id}/versions',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentByAgentIdVersionsPath }))
|
||||
.output(zGetAgentByAgentIdVersionsResponse)
|
||||
|
||||
export const versions = {
|
||||
get: get11,
|
||||
byVersionId,
|
||||
}
|
||||
|
||||
export const delete3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'DELETE',
|
||||
operationId: 'deleteAgentByAgentId',
|
||||
path: '/agent/{agent_id}',
|
||||
successStatus: 204,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zDeleteAgentByAgentIdPath }))
|
||||
.output(zDeleteAgentByAgentIdResponse)
|
||||
|
||||
export const get12 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentByAgentId',
|
||||
path: '/agent/{agent_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentByAgentIdPath }))
|
||||
.output(zGetAgentByAgentIdResponse)
|
||||
|
||||
export const put2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'PUT',
|
||||
operationId: 'putAgentByAgentId',
|
||||
path: '/agent/{agent_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPutAgentByAgentIdBody, params: zPutAgentByAgentIdPath }))
|
||||
.output(zPutAgentByAgentIdResponse)
|
||||
|
||||
export const byAgentId = {
|
||||
delete: delete3,
|
||||
get: get12,
|
||||
put: put2,
|
||||
composer,
|
||||
drive,
|
||||
features,
|
||||
files: files2,
|
||||
referencingWorkflows,
|
||||
sandbox,
|
||||
skills,
|
||||
versions,
|
||||
}
|
||||
|
||||
export const get13 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgent',
|
||||
path: '/agent',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetAgentQuery.optional() }))
|
||||
.output(zGetAgentResponse)
|
||||
|
||||
export const post8 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'POST',
|
||||
operationId: 'postAgent',
|
||||
path: '/agent',
|
||||
successStatus: 201,
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ body: zPostAgentBody }))
|
||||
.output(zPostAgentResponse)
|
||||
|
||||
export const agent = {
|
||||
get: get13,
|
||||
post: post8,
|
||||
inviteOptions,
|
||||
byAgentId,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
agent,
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,100 +0,0 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import { oc } from '@orpc/contract'
|
||||
import * as z from 'zod'
|
||||
|
||||
import {
|
||||
zGetAgentsByAgentIdPath,
|
||||
zGetAgentsByAgentIdResponse,
|
||||
zGetAgentsByAgentIdVersionsByVersionIdPath,
|
||||
zGetAgentsByAgentIdVersionsByVersionIdResponse,
|
||||
zGetAgentsByAgentIdVersionsPath,
|
||||
zGetAgentsByAgentIdVersionsResponse,
|
||||
zGetAgentsInviteOptionsQuery,
|
||||
zGetAgentsInviteOptionsResponse,
|
||||
zGetAgentsQuery,
|
||||
zGetAgentsResponse,
|
||||
} from './zod.gen'
|
||||
|
||||
export const get = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentsInviteOptions',
|
||||
path: '/agents/invite-options',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetAgentsInviteOptionsQuery.optional() }))
|
||||
.output(zGetAgentsInviteOptionsResponse)
|
||||
|
||||
export const inviteOptions = {
|
||||
get,
|
||||
}
|
||||
|
||||
export const get2 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentsByAgentIdVersionsByVersionId',
|
||||
path: '/agents/{agent_id}/versions/{version_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentsByAgentIdVersionsByVersionIdPath }))
|
||||
.output(zGetAgentsByAgentIdVersionsByVersionIdResponse)
|
||||
|
||||
export const byVersionId = {
|
||||
get: get2,
|
||||
}
|
||||
|
||||
export const get3 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentsByAgentIdVersions',
|
||||
path: '/agents/{agent_id}/versions',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentsByAgentIdVersionsPath }))
|
||||
.output(zGetAgentsByAgentIdVersionsResponse)
|
||||
|
||||
export const versions = {
|
||||
get: get3,
|
||||
byVersionId,
|
||||
}
|
||||
|
||||
export const get4 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgentsByAgentId',
|
||||
path: '/agents/{agent_id}',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ params: zGetAgentsByAgentIdPath }))
|
||||
.output(zGetAgentsByAgentIdResponse)
|
||||
|
||||
export const byAgentId = {
|
||||
get: get4,
|
||||
versions,
|
||||
}
|
||||
|
||||
export const get5 = oc
|
||||
.route({
|
||||
inputStructure: 'detailed',
|
||||
method: 'GET',
|
||||
operationId: 'getAgents',
|
||||
path: '/agents',
|
||||
tags: ['console'],
|
||||
})
|
||||
.input(z.object({ query: zGetAgentsQuery.optional() }))
|
||||
.output(zGetAgentsResponse)
|
||||
|
||||
export const agents = {
|
||||
get: get5,
|
||||
inviteOptions,
|
||||
byAgentId,
|
||||
}
|
||||
|
||||
export const contract = {
|
||||
agents,
|
||||
}
|
||||
@@ -1,587 +0,0 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type ClientOptions = {
|
||||
baseUrl: `${string}://${string}/console/api` | (string & {})
|
||||
}
|
||||
|
||||
export type AgentRosterListResponse = {
|
||||
data: Array<AgentRosterResponse>
|
||||
has_more: boolean
|
||||
limit: number
|
||||
page: number
|
||||
total: number
|
||||
}
|
||||
|
||||
export type AgentInviteOptionsResponse = {
|
||||
data: Array<AgentInviteOptionResponse>
|
||||
has_more: boolean
|
||||
limit: number
|
||||
page: number
|
||||
total: number
|
||||
}
|
||||
|
||||
export type AgentRosterResponse = {
|
||||
active_config_snapshot?: AgentConfigSnapshotSummaryResponse | null
|
||||
active_config_snapshot_id?: string | null
|
||||
agent_kind: AgentKind
|
||||
app_id?: string | null
|
||||
archived_at?: number | null
|
||||
archived_by?: string | null
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
description: string
|
||||
icon?: string | null
|
||||
icon_background?: string | null
|
||||
icon_type?: AgentIconType | null
|
||||
id: string
|
||||
name: string
|
||||
published_node_reference_count?: number
|
||||
published_reference_count?: number
|
||||
published_references?: Array<AgentPublishedReferenceResponse>
|
||||
role?: string
|
||||
scope: AgentScope
|
||||
source: AgentSource
|
||||
status: AgentStatus
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
workflow_id?: string | null
|
||||
workflow_node_id?: string | null
|
||||
}
|
||||
|
||||
export type AgentConfigSnapshotListResponse = {
|
||||
data: Array<AgentConfigSnapshotSummaryResponse>
|
||||
}
|
||||
|
||||
export type AgentConfigSnapshotDetailResponse = {
|
||||
agent_id?: string | null
|
||||
config_snapshot: AgentSoulConfig
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
id: string
|
||||
revisions?: Array<AgentConfigRevisionResponse>
|
||||
summary?: string | null
|
||||
version: number
|
||||
version_note?: string | null
|
||||
}
|
||||
|
||||
export type AgentInviteOptionResponse = {
|
||||
active_config_snapshot?: AgentConfigSnapshotSummaryResponse | null
|
||||
active_config_snapshot_id?: string | null
|
||||
agent_kind: AgentKind
|
||||
app_id?: string | null
|
||||
archived_at?: number | null
|
||||
archived_by?: string | null
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
description: string
|
||||
existing_node_ids?: Array<string>
|
||||
icon?: string | null
|
||||
icon_background?: string | null
|
||||
icon_type?: AgentIconType | null
|
||||
id: string
|
||||
in_current_workflow_count?: number
|
||||
is_in_current_workflow?: boolean
|
||||
name: string
|
||||
published_node_reference_count?: number
|
||||
published_reference_count?: number
|
||||
published_references?: Array<AgentPublishedReferenceResponse>
|
||||
role?: string
|
||||
scope: AgentScope
|
||||
source: AgentSource
|
||||
status: AgentStatus
|
||||
updated_at?: number | null
|
||||
updated_by?: string | null
|
||||
workflow_id?: string | null
|
||||
workflow_node_id?: string | null
|
||||
}
|
||||
|
||||
export type AgentConfigSnapshotSummaryResponse = {
|
||||
agent_id?: string | null
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
id: string
|
||||
summary?: string | null
|
||||
version: number
|
||||
version_note?: string | null
|
||||
}
|
||||
|
||||
export type AgentKind = 'dify_agent'
|
||||
|
||||
export type AgentIconType = 'emoji' | 'image' | 'link'
|
||||
|
||||
export type AgentPublishedReferenceResponse = {
|
||||
app_id: string
|
||||
app_mode: string
|
||||
app_name: string
|
||||
node_ids?: Array<string>
|
||||
workflow_id: string
|
||||
workflow_version: string
|
||||
}
|
||||
|
||||
export type AgentScope = 'roster' | 'workflow_only'
|
||||
|
||||
export type AgentSource = 'agent_app' | 'imported' | 'roster' | 'system' | 'workflow'
|
||||
|
||||
export type AgentStatus = 'active' | 'archived'
|
||||
|
||||
export type AgentSoulConfig = {
|
||||
app_features?: AgentSoulAppFeaturesConfig
|
||||
app_variables?: Array<AppVariableConfig>
|
||||
env?: AgentSoulEnvConfig
|
||||
human?: AgentSoulHumanConfig
|
||||
knowledge?: AgentSoulKnowledgeConfig
|
||||
memory?: AgentSoulMemoryConfig
|
||||
misc_legacy?: AgentSoulAppFeaturesConfig
|
||||
model?: AgentSoulModelConfig | null
|
||||
prompt?: AgentSoulPromptConfig
|
||||
sandbox?: AgentSoulSandboxConfig
|
||||
schema_version?: number
|
||||
skills_files?: AgentSoulSkillsFilesConfig
|
||||
tools?: AgentSoulToolsConfig
|
||||
}
|
||||
|
||||
export type AgentConfigRevisionResponse = {
|
||||
created_at?: number | null
|
||||
created_by?: string | null
|
||||
current_snapshot_id: string
|
||||
id: string
|
||||
operation: AgentConfigRevisionOperation
|
||||
previous_snapshot_id?: string | null
|
||||
revision: number
|
||||
summary?: string | null
|
||||
version_note?: string | null
|
||||
}
|
||||
|
||||
export type AgentSoulAppFeaturesConfig = {
|
||||
opening_statement?: string | null
|
||||
retriever_resource?: AgentFeatureToggleConfig | null
|
||||
sensitive_word_avoidance?: AgentSensitiveWordAvoidanceFeatureConfig | null
|
||||
speech_to_text?: AgentFeatureToggleConfig | null
|
||||
suggested_questions?: Array<string> | null
|
||||
suggested_questions_after_answer?: AgentSuggestedQuestionsAfterAnswerFeatureConfig | null
|
||||
text_to_speech?: AgentTextToSpeechFeatureConfig | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AppVariableConfig = {
|
||||
default?: unknown
|
||||
name: string
|
||||
required?: boolean
|
||||
type: string
|
||||
}
|
||||
|
||||
export type AgentSoulEnvConfig = {
|
||||
secret_refs?: Array<AgentSecretRefConfig>
|
||||
variables?: Array<AgentEnvVariableConfig>
|
||||
}
|
||||
|
||||
export type AgentSoulHumanConfig = {
|
||||
contacts?: Array<AgentHumanContactConfig>
|
||||
tools?: Array<AgentHumanToolConfig>
|
||||
}
|
||||
|
||||
export type AgentSoulKnowledgeConfig = {
|
||||
datasets?: Array<AgentKnowledgeDatasetConfig>
|
||||
query_config?: AgentKnowledgeQueryConfig
|
||||
query_mode?: AgentKnowledgeQueryMode | null
|
||||
}
|
||||
|
||||
export type AgentSoulMemoryConfig = {
|
||||
artifacts?: Array<AgentMemoryArtifactConfig>
|
||||
budget?: string | null
|
||||
scope?: string | null
|
||||
}
|
||||
|
||||
export type AgentSoulModelConfig = {
|
||||
credential_ref?: AgentSoulModelCredentialRef | null
|
||||
model: string
|
||||
model_provider: string
|
||||
model_settings?: AgentSoulModelSettings
|
||||
plugin_id: string
|
||||
}
|
||||
|
||||
export type AgentSoulPromptConfig = {
|
||||
system_prompt?: string
|
||||
}
|
||||
|
||||
export type AgentSoulSandboxConfig = {
|
||||
config?: AgentSandboxProviderConfig
|
||||
provider?: string | null
|
||||
}
|
||||
|
||||
export type AgentSoulSkillsFilesConfig = {
|
||||
files?: Array<AgentFileRefConfig>
|
||||
skills?: Array<AgentSkillRefConfig>
|
||||
}
|
||||
|
||||
export type AgentSoulToolsConfig = {
|
||||
cli_tools?: Array<AgentCliToolConfig>
|
||||
dify_tools?: Array<AgentSoulDifyToolConfig>
|
||||
}
|
||||
|
||||
export type AgentConfigRevisionOperation
|
||||
= | 'create_version'
|
||||
| 'save_current_version'
|
||||
| 'save_new_agent'
|
||||
| 'save_new_version'
|
||||
| 'save_to_roster'
|
||||
|
||||
export type AgentFeatureToggleConfig = {
|
||||
enabled?: boolean
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentSensitiveWordAvoidanceFeatureConfig = {
|
||||
config?: AgentModerationProviderConfig | null
|
||||
enabled?: boolean
|
||||
type?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentSuggestedQuestionsAfterAnswerFeatureConfig = {
|
||||
enabled?: boolean
|
||||
model?: AgentSoulModelConfig | null
|
||||
prompt?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentTextToSpeechFeatureConfig = {
|
||||
autoPlay?: string | null
|
||||
enabled?: boolean
|
||||
language?: string | null
|
||||
voice?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentSecretRefConfig = {
|
||||
credential_id?: string | null
|
||||
env_name?: string | null
|
||||
id?: string | null
|
||||
key?: string | null
|
||||
name?: string | null
|
||||
permission?: AgentPermissionConfig | null
|
||||
permission_status?: string | null
|
||||
provider?: string | null
|
||||
provider_credential_id?: string | null
|
||||
ref?: string | null
|
||||
type?: string | null
|
||||
variable?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentEnvVariableConfig = {
|
||||
default?:
|
||||
| string
|
||||
| number
|
||||
| number
|
||||
| boolean
|
||||
| Array<string>
|
||||
| Array<number>
|
||||
| Array<number>
|
||||
| Array<boolean>
|
||||
| null
|
||||
env_name?: string | null
|
||||
key?: string | null
|
||||
name?: string | null
|
||||
required?: boolean
|
||||
type?: string | null
|
||||
value?:
|
||||
| string
|
||||
| number
|
||||
| number
|
||||
| boolean
|
||||
| Array<string>
|
||||
| Array<number>
|
||||
| Array<number>
|
||||
| Array<boolean>
|
||||
| null
|
||||
variable?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentHumanContactConfig = {
|
||||
channel?: string | null
|
||||
contact_id?: string | null
|
||||
contact_method?: string | null
|
||||
email?: string | null
|
||||
human_id?: string | null
|
||||
id?: string | null
|
||||
method?: string | null
|
||||
name?: string | null
|
||||
tenant_id?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentHumanToolConfig = {
|
||||
description?: string | null
|
||||
enabled?: boolean
|
||||
name?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentKnowledgeDatasetConfig = {
|
||||
description?: string | null
|
||||
id?: string | null
|
||||
name?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentKnowledgeQueryConfig = {
|
||||
query?: string | null
|
||||
score_threshold?: number | null
|
||||
score_threshold_enabled?: boolean | null
|
||||
top_k?: number | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentKnowledgeQueryMode = 'generated_query' | 'user_query'
|
||||
|
||||
export type AgentMemoryArtifactConfig = {
|
||||
id?: string | null
|
||||
name?: string | null
|
||||
type?: string | null
|
||||
url?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentSoulModelCredentialRef = {
|
||||
id?: string | null
|
||||
provider?: string | null
|
||||
type: string
|
||||
}
|
||||
|
||||
export type AgentSoulModelSettings = {
|
||||
frequency_penalty?: number | null
|
||||
max_tokens?: number | null
|
||||
presence_penalty?: number | null
|
||||
response_format?: AgentModelResponseFormatConfig | null
|
||||
stop?: Array<string> | null
|
||||
temperature?: number | null
|
||||
top_p?: number | null
|
||||
}
|
||||
|
||||
export type AgentSandboxProviderConfig = {
|
||||
cpu?: number | null
|
||||
env?: Array<AgentEnvVariableConfig>
|
||||
image?: string | null
|
||||
working_dir?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentFileRefConfig = {
|
||||
drive_key?: string | null
|
||||
file_id?: string | null
|
||||
id?: string | null
|
||||
name?: string | null
|
||||
reference?: string | null
|
||||
remote_url?: string | null
|
||||
tenant_id?: string | null
|
||||
transfer_method?: string | null
|
||||
type?: string | null
|
||||
upload_file_id?: string | null
|
||||
url?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentSkillRefConfig = {
|
||||
description?: string | null
|
||||
file_id?: string | null
|
||||
full_archive_file_id?: string | null
|
||||
full_archive_key?: string | null
|
||||
id?: string | null
|
||||
manifest_files?: Array<string> | null
|
||||
name?: string | null
|
||||
path?: string | null
|
||||
skill_md_file_id?: string | null
|
||||
skill_md_key?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentCliToolConfig = {
|
||||
approved?: boolean
|
||||
authorization_status?: AgentCliToolAuthorizationStatus | null
|
||||
command?: string | null
|
||||
dangerous?: boolean
|
||||
dangerous_accepted?: boolean
|
||||
dangerous_acknowledged?: boolean
|
||||
dangerous_command?: boolean
|
||||
description?: string | null
|
||||
enabled?: boolean
|
||||
env?: AgentCliToolEnvConfig
|
||||
id?: string | null
|
||||
inferred_from?: string | null
|
||||
install?: string | null
|
||||
install_command?: string | null
|
||||
install_commands?: Array<string>
|
||||
invoke_metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
label?: string | null
|
||||
name?: string | null
|
||||
permission?: AgentPermissionConfig | null
|
||||
pre_authorized?: boolean | null
|
||||
requires_confirmation?: boolean
|
||||
risk_accepted?: boolean
|
||||
risk_level?: AgentCliToolRiskLevel | null
|
||||
setup_command?: string | null
|
||||
tool_name?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentSoulDifyToolConfig = {
|
||||
credential_ref?: AgentSoulDifyToolCredentialRef | null
|
||||
credential_type?: 'api-key' | 'oauth2' | 'unauthorized'
|
||||
description?: string | null
|
||||
enabled?: boolean
|
||||
name?: string | null
|
||||
plugin_id?: string | null
|
||||
provider?: string | null
|
||||
provider_id?: string | null
|
||||
provider_type?: string
|
||||
runtime_parameters?: {
|
||||
[key: string]:
|
||||
| string
|
||||
| number
|
||||
| number
|
||||
| boolean
|
||||
| Array<string>
|
||||
| Array<number>
|
||||
| Array<number>
|
||||
| Array<boolean>
|
||||
| null
|
||||
}
|
||||
tool_name?: string | null
|
||||
}
|
||||
|
||||
export type AgentModerationProviderConfig = {
|
||||
api_based_extension_id?: string | null
|
||||
inputs_config?: AgentModerationIoConfig | null
|
||||
keywords?: string | null
|
||||
outputs_config?: AgentModerationIoConfig | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentPermissionConfig = {
|
||||
allowed?: boolean | null
|
||||
state?: string | null
|
||||
status?: string | null
|
||||
}
|
||||
|
||||
export type AgentModelResponseFormatConfig = {
|
||||
type?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type AgentCliToolAuthorizationStatus
|
||||
= | 'allowed'
|
||||
| 'authorized'
|
||||
| 'denied'
|
||||
| 'forbidden'
|
||||
| 'not_required'
|
||||
| 'pending'
|
||||
| 'pre_authorized'
|
||||
| 'unauthorized'
|
||||
|
||||
export type AgentCliToolEnvConfig = {
|
||||
secret_refs?: Array<AgentSecretRefConfig>
|
||||
variables?: Array<AgentEnvVariableConfig>
|
||||
}
|
||||
|
||||
export type AgentCliToolRiskLevel = 'dangerous' | 'safe' | 'unknown'
|
||||
|
||||
export type AgentSoulDifyToolCredentialRef = {
|
||||
id?: string | null
|
||||
provider?: string | null
|
||||
type?: 'provider' | 'tool'
|
||||
}
|
||||
|
||||
export type AgentModerationIoConfig = {
|
||||
enabled?: boolean
|
||||
preset_response?: string | null
|
||||
[key: string]: unknown
|
||||
}
|
||||
|
||||
export type GetAgentsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
keyword?: string
|
||||
limit?: number
|
||||
page?: number
|
||||
}
|
||||
url: '/agents'
|
||||
}
|
||||
|
||||
export type GetAgentsResponses = {
|
||||
200: AgentRosterListResponse
|
||||
}
|
||||
|
||||
export type GetAgentsResponse = GetAgentsResponses[keyof GetAgentsResponses]
|
||||
|
||||
export type GetAgentsInviteOptionsData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: {
|
||||
app_id?: string
|
||||
keyword?: string
|
||||
limit?: number
|
||||
page?: number
|
||||
}
|
||||
url: '/agents/invite-options'
|
||||
}
|
||||
|
||||
export type GetAgentsInviteOptionsResponses = {
|
||||
200: AgentInviteOptionsResponse
|
||||
}
|
||||
|
||||
export type GetAgentsInviteOptionsResponse
|
||||
= GetAgentsInviteOptionsResponses[keyof GetAgentsInviteOptionsResponses]
|
||||
|
||||
export type GetAgentsByAgentIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
agent_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/agents/{agent_id}'
|
||||
}
|
||||
|
||||
export type GetAgentsByAgentIdResponses = {
|
||||
200: AgentRosterResponse
|
||||
}
|
||||
|
||||
export type GetAgentsByAgentIdResponse
|
||||
= GetAgentsByAgentIdResponses[keyof GetAgentsByAgentIdResponses]
|
||||
|
||||
export type GetAgentsByAgentIdVersionsData = {
|
||||
body?: never
|
||||
path: {
|
||||
agent_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/agents/{agent_id}/versions'
|
||||
}
|
||||
|
||||
export type GetAgentsByAgentIdVersionsResponses = {
|
||||
200: AgentConfigSnapshotListResponse
|
||||
}
|
||||
|
||||
export type GetAgentsByAgentIdVersionsResponse
|
||||
= GetAgentsByAgentIdVersionsResponses[keyof GetAgentsByAgentIdVersionsResponses]
|
||||
|
||||
export type GetAgentsByAgentIdVersionsByVersionIdData = {
|
||||
body?: never
|
||||
path: {
|
||||
agent_id: string
|
||||
version_id: string
|
||||
}
|
||||
query?: never
|
||||
url: '/agents/{agent_id}/versions/{version_id}'
|
||||
}
|
||||
|
||||
export type GetAgentsByAgentIdVersionsByVersionIdResponses = {
|
||||
200: AgentConfigSnapshotDetailResponse
|
||||
}
|
||||
|
||||
export type GetAgentsByAgentIdVersionsByVersionIdResponse
|
||||
= GetAgentsByAgentIdVersionsByVersionIdResponses[keyof GetAgentsByAgentIdVersionsByVersionIdResponses]
|
||||
@@ -1,743 +0,0 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
import * as z from 'zod'
|
||||
|
||||
/**
|
||||
* AgentConfigSnapshotSummaryResponse
|
||||
*/
|
||||
export const zAgentConfigSnapshotSummaryResponse = z.object({
|
||||
agent_id: z.string().nullish(),
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
id: z.string(),
|
||||
summary: z.string().nullish(),
|
||||
version: z.int(),
|
||||
version_note: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentConfigSnapshotListResponse
|
||||
*/
|
||||
export const zAgentConfigSnapshotListResponse = z.object({
|
||||
data: z.array(zAgentConfigSnapshotSummaryResponse),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentKind
|
||||
*
|
||||
* Agent implementation family.
|
||||
*
|
||||
* This leaves room for future non-Dify agent implementations while keeping
|
||||
* the current roster/workflow APIs scoped to Dify Agent.
|
||||
*/
|
||||
export const zAgentKind = z.enum(['dify_agent'])
|
||||
|
||||
/**
|
||||
* AgentIconType
|
||||
*
|
||||
* Supported icon storage formats for Agent roster entries.
|
||||
*/
|
||||
export const zAgentIconType = z.enum(['emoji', 'image', 'link'])
|
||||
|
||||
/**
|
||||
* AgentPublishedReferenceResponse
|
||||
*/
|
||||
export const zAgentPublishedReferenceResponse = z.object({
|
||||
app_id: z.string(),
|
||||
app_mode: z.string(),
|
||||
app_name: z.string(),
|
||||
node_ids: z.array(z.string()).optional(),
|
||||
workflow_id: z.string(),
|
||||
workflow_version: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentScope
|
||||
*
|
||||
* Visibility and lifecycle scope of an Agent record.
|
||||
*/
|
||||
export const zAgentScope = z.enum(['roster', 'workflow_only'])
|
||||
|
||||
/**
|
||||
* AgentSource
|
||||
*
|
||||
* Origin that created or imported the Agent.
|
||||
*/
|
||||
export const zAgentSource = z.enum(['agent_app', 'imported', 'roster', 'system', 'workflow'])
|
||||
|
||||
/**
|
||||
* AgentStatus
|
||||
*
|
||||
* Soft lifecycle state for Agent records.
|
||||
*/
|
||||
export const zAgentStatus = z.enum(['active', 'archived'])
|
||||
|
||||
/**
|
||||
* AgentRosterResponse
|
||||
*/
|
||||
export const zAgentRosterResponse = z.object({
|
||||
active_config_snapshot: zAgentConfigSnapshotSummaryResponse.nullish(),
|
||||
active_config_snapshot_id: z.string().nullish(),
|
||||
agent_kind: zAgentKind,
|
||||
app_id: z.string().nullish(),
|
||||
archived_at: z.int().nullish(),
|
||||
archived_by: z.string().nullish(),
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
description: z.string(),
|
||||
icon: z.string().nullish(),
|
||||
icon_background: z.string().nullish(),
|
||||
icon_type: zAgentIconType.nullish(),
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
published_node_reference_count: z.int().optional().default(0),
|
||||
published_reference_count: z.int().optional().default(0),
|
||||
published_references: z.array(zAgentPublishedReferenceResponse).optional(),
|
||||
role: z.string().optional().default(''),
|
||||
scope: zAgentScope,
|
||||
source: zAgentSource,
|
||||
status: zAgentStatus,
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
workflow_id: z.string().nullish(),
|
||||
workflow_node_id: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentRosterListResponse
|
||||
*/
|
||||
export const zAgentRosterListResponse = z.object({
|
||||
data: z.array(zAgentRosterResponse),
|
||||
has_more: z.boolean(),
|
||||
limit: z.int(),
|
||||
page: z.int(),
|
||||
total: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentInviteOptionResponse
|
||||
*/
|
||||
export const zAgentInviteOptionResponse = z.object({
|
||||
active_config_snapshot: zAgentConfigSnapshotSummaryResponse.nullish(),
|
||||
active_config_snapshot_id: z.string().nullish(),
|
||||
agent_kind: zAgentKind,
|
||||
app_id: z.string().nullish(),
|
||||
archived_at: z.int().nullish(),
|
||||
archived_by: z.string().nullish(),
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
description: z.string(),
|
||||
existing_node_ids: z.array(z.string()).optional(),
|
||||
icon: z.string().nullish(),
|
||||
icon_background: z.string().nullish(),
|
||||
icon_type: zAgentIconType.nullish(),
|
||||
id: z.string(),
|
||||
in_current_workflow_count: z.int().optional().default(0),
|
||||
is_in_current_workflow: z.boolean().optional().default(false),
|
||||
name: z.string(),
|
||||
published_node_reference_count: z.int().optional().default(0),
|
||||
published_reference_count: z.int().optional().default(0),
|
||||
published_references: z.array(zAgentPublishedReferenceResponse).optional(),
|
||||
role: z.string().optional().default(''),
|
||||
scope: zAgentScope,
|
||||
source: zAgentSource,
|
||||
status: zAgentStatus,
|
||||
updated_at: z.int().nullish(),
|
||||
updated_by: z.string().nullish(),
|
||||
workflow_id: z.string().nullish(),
|
||||
workflow_node_id: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentInviteOptionsResponse
|
||||
*/
|
||||
export const zAgentInviteOptionsResponse = z.object({
|
||||
data: z.array(zAgentInviteOptionResponse),
|
||||
has_more: z.boolean(),
|
||||
limit: z.int(),
|
||||
page: z.int(),
|
||||
total: z.int(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AppVariableConfig
|
||||
*/
|
||||
export const zAppVariableConfig = z.object({
|
||||
default: z.unknown().optional(),
|
||||
name: z.string().min(1).max(255),
|
||||
required: z.boolean().optional().default(false),
|
||||
type: z.string().min(1).max(64),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulPromptConfig
|
||||
*/
|
||||
export const zAgentSoulPromptConfig = z.object({
|
||||
system_prompt: z.string().optional().default(''),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentConfigRevisionOperation
|
||||
*
|
||||
* Audit operation recorded for Agent Soul version/revision changes.
|
||||
*/
|
||||
export const zAgentConfigRevisionOperation = z.enum([
|
||||
'create_version',
|
||||
'save_current_version',
|
||||
'save_new_agent',
|
||||
'save_new_version',
|
||||
'save_to_roster',
|
||||
])
|
||||
|
||||
/**
|
||||
* AgentConfigRevisionResponse
|
||||
*/
|
||||
export const zAgentConfigRevisionResponse = z.object({
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
current_snapshot_id: z.string(),
|
||||
id: z.string(),
|
||||
operation: zAgentConfigRevisionOperation,
|
||||
previous_snapshot_id: z.string().nullish(),
|
||||
revision: z.int(),
|
||||
summary: z.string().nullish(),
|
||||
version_note: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentFeatureToggleConfig
|
||||
*/
|
||||
export const zAgentFeatureToggleConfig = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentTextToSpeechFeatureConfig
|
||||
*/
|
||||
export const zAgentTextToSpeechFeatureConfig = z.object({
|
||||
autoPlay: z.string().nullish(),
|
||||
enabled: z.boolean().optional().default(false),
|
||||
language: z.string().nullish(),
|
||||
voice: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentEnvVariableConfig
|
||||
*/
|
||||
export const zAgentEnvVariableConfig = z.object({
|
||||
default: z
|
||||
.union([
|
||||
z.string(),
|
||||
z.int(),
|
||||
z.number(),
|
||||
z.boolean(),
|
||||
z.array(z.string()),
|
||||
z.array(z.int()),
|
||||
z.array(z.number()),
|
||||
z.array(z.boolean()),
|
||||
])
|
||||
.nullish(),
|
||||
env_name: z.string().max(255).nullish(),
|
||||
key: z.string().max(255).nullish(),
|
||||
name: z.string().max(255).nullish(),
|
||||
required: z.boolean().optional().default(false),
|
||||
type: z.string().max(64).nullish(),
|
||||
value: z
|
||||
.union([
|
||||
z.string(),
|
||||
z.int(),
|
||||
z.number(),
|
||||
z.boolean(),
|
||||
z.array(z.string()),
|
||||
z.array(z.int()),
|
||||
z.array(z.number()),
|
||||
z.array(z.boolean()),
|
||||
])
|
||||
.nullish(),
|
||||
variable: z.string().max(255).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentHumanContactConfig
|
||||
*/
|
||||
export const zAgentHumanContactConfig = z.object({
|
||||
channel: z.string().max(64).nullish(),
|
||||
contact_id: z.string().max(255).nullish(),
|
||||
contact_method: z.string().max(64).nullish(),
|
||||
email: z.string().max(255).nullish(),
|
||||
human_id: z.string().max(255).nullish(),
|
||||
id: z.string().max(255).nullish(),
|
||||
method: z.string().max(64).nullish(),
|
||||
name: z.string().max(255).nullish(),
|
||||
tenant_id: z.string().max(255).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentHumanToolConfig
|
||||
*/
|
||||
export const zAgentHumanToolConfig = z.object({
|
||||
description: z.string().nullish(),
|
||||
enabled: z.boolean().optional().default(true),
|
||||
name: z.string().max(255).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulHumanConfig
|
||||
*/
|
||||
export const zAgentSoulHumanConfig = z.object({
|
||||
contacts: z.array(zAgentHumanContactConfig).optional(),
|
||||
tools: z.array(zAgentHumanToolConfig).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentKnowledgeDatasetConfig
|
||||
*/
|
||||
export const zAgentKnowledgeDatasetConfig = z.object({
|
||||
description: z.string().nullish(),
|
||||
id: z.string().max(255).nullish(),
|
||||
name: z.string().max(255).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentKnowledgeQueryConfig
|
||||
*/
|
||||
export const zAgentKnowledgeQueryConfig = z.object({
|
||||
query: z.string().nullish(),
|
||||
score_threshold: z.number().gte(0).lte(1).nullish(),
|
||||
score_threshold_enabled: z.boolean().nullish(),
|
||||
top_k: z.int().gte(1).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentKnowledgeQueryMode
|
||||
*/
|
||||
export const zAgentKnowledgeQueryMode = z.enum(['generated_query', 'user_query'])
|
||||
|
||||
/**
|
||||
* AgentSoulKnowledgeConfig
|
||||
*/
|
||||
export const zAgentSoulKnowledgeConfig = z.object({
|
||||
datasets: z.array(zAgentKnowledgeDatasetConfig).optional(),
|
||||
query_config: zAgentKnowledgeQueryConfig.optional(),
|
||||
query_mode: zAgentKnowledgeQueryMode.nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentMemoryArtifactConfig
|
||||
*/
|
||||
export const zAgentMemoryArtifactConfig = z.object({
|
||||
id: z.string().max(255).nullish(),
|
||||
name: z.string().max(255).nullish(),
|
||||
type: z.string().max(64).nullish(),
|
||||
url: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulMemoryConfig
|
||||
*/
|
||||
export const zAgentSoulMemoryConfig = z.object({
|
||||
artifacts: z.array(zAgentMemoryArtifactConfig).optional(),
|
||||
budget: z.string().nullish(),
|
||||
scope: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulModelCredentialRef
|
||||
*
|
||||
* Reference to model credentials resolved only at runtime.
|
||||
*/
|
||||
export const zAgentSoulModelCredentialRef = z.object({
|
||||
id: z.string().max(255).nullish(),
|
||||
provider: z.string().max(255).nullish(),
|
||||
type: z.string().min(1).max(64),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSandboxProviderConfig
|
||||
*/
|
||||
export const zAgentSandboxProviderConfig = z.object({
|
||||
cpu: z.int().gte(1).nullish(),
|
||||
env: z.array(zAgentEnvVariableConfig).optional(),
|
||||
image: z.string().nullish(),
|
||||
working_dir: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulSandboxConfig
|
||||
*/
|
||||
export const zAgentSoulSandboxConfig = z.object({
|
||||
config: zAgentSandboxProviderConfig.optional(),
|
||||
provider: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentFileRefConfig
|
||||
*/
|
||||
export const zAgentFileRefConfig = z.object({
|
||||
drive_key: z.string().max(512).nullish(),
|
||||
file_id: z.string().max(255).nullish(),
|
||||
id: z.string().max(255).nullish(),
|
||||
name: z.string().max(255).nullish(),
|
||||
reference: z.string().max(255).nullish(),
|
||||
remote_url: z.string().nullish(),
|
||||
tenant_id: z.string().max(255).nullish(),
|
||||
transfer_method: z.string().max(64).nullish(),
|
||||
type: z.string().max(64).nullish(),
|
||||
upload_file_id: z.string().max(255).nullish(),
|
||||
url: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSkillRefConfig
|
||||
*/
|
||||
export const zAgentSkillRefConfig = z.object({
|
||||
description: z.string().nullish(),
|
||||
file_id: z.string().max(255).nullish(),
|
||||
full_archive_file_id: z.string().max(255).nullish(),
|
||||
full_archive_key: z.string().max(512).nullish(),
|
||||
id: z.string().max(255).nullish(),
|
||||
manifest_files: z.array(z.string()).nullish(),
|
||||
name: z.string().max(255).nullish(),
|
||||
path: z.string().nullish(),
|
||||
skill_md_file_id: z.string().max(255).nullish(),
|
||||
skill_md_key: z.string().max(512).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulSkillsFilesConfig
|
||||
*/
|
||||
export const zAgentSoulSkillsFilesConfig = z.object({
|
||||
files: z.array(zAgentFileRefConfig).optional(),
|
||||
skills: z.array(zAgentSkillRefConfig).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentPermissionConfig
|
||||
*/
|
||||
export const zAgentPermissionConfig = z.object({
|
||||
allowed: z.boolean().nullish(),
|
||||
state: z.string().max(64).nullish(),
|
||||
status: z.string().max(64).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSecretRefConfig
|
||||
*/
|
||||
export const zAgentSecretRefConfig = z.object({
|
||||
credential_id: z.string().max(255).nullish(),
|
||||
env_name: z.string().max(255).nullish(),
|
||||
id: z.string().max(255).nullish(),
|
||||
key: z.string().max(255).nullish(),
|
||||
name: z.string().max(255).nullish(),
|
||||
permission: zAgentPermissionConfig.nullish(),
|
||||
permission_status: z.string().max(64).nullish(),
|
||||
provider: z.string().max(255).nullish(),
|
||||
provider_credential_id: z.string().max(255).nullish(),
|
||||
ref: z.string().max(255).nullish(),
|
||||
type: z.string().max(64).nullish(),
|
||||
variable: z.string().max(255).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulEnvConfig
|
||||
*/
|
||||
export const zAgentSoulEnvConfig = z.object({
|
||||
secret_refs: z.array(zAgentSecretRefConfig).optional(),
|
||||
variables: z.array(zAgentEnvVariableConfig).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentModelResponseFormatConfig
|
||||
*/
|
||||
export const zAgentModelResponseFormatConfig = z.object({
|
||||
type: z.string().max(64).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulModelSettings
|
||||
*/
|
||||
export const zAgentSoulModelSettings = z.object({
|
||||
frequency_penalty: z.number().nullish(),
|
||||
max_tokens: z.int().nullish(),
|
||||
presence_penalty: z.number().nullish(),
|
||||
response_format: zAgentModelResponseFormatConfig.nullish(),
|
||||
stop: z.array(z.string()).nullish(),
|
||||
temperature: z.number().nullish(),
|
||||
top_p: z.number().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulModelConfig
|
||||
*
|
||||
* Stable model selection for Agent runtime without storing secret values.
|
||||
*/
|
||||
export const zAgentSoulModelConfig = z.object({
|
||||
credential_ref: zAgentSoulModelCredentialRef.nullish(),
|
||||
model: z.string().min(1).max(255),
|
||||
model_provider: z.string().min(1).max(255),
|
||||
model_settings: zAgentSoulModelSettings.optional(),
|
||||
plugin_id: z.string().min(1).max(255),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSuggestedQuestionsAfterAnswerFeatureConfig
|
||||
*/
|
||||
export const zAgentSuggestedQuestionsAfterAnswerFeatureConfig = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
model: zAgentSoulModelConfig.nullish(),
|
||||
prompt: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentCliToolAuthorizationStatus
|
||||
*
|
||||
* Authorization state for Agent-scoped CLI tools.
|
||||
*
|
||||
* Missing status keeps backward compatibility with draft rows and CLI tools that
|
||||
* do not need pre-authorization. Explicit denied-like states are blocked by the
|
||||
* composer/publish validators and skipped by runtime request builders.
|
||||
*/
|
||||
export const zAgentCliToolAuthorizationStatus = z.enum([
|
||||
'allowed',
|
||||
'authorized',
|
||||
'denied',
|
||||
'forbidden',
|
||||
'not_required',
|
||||
'pending',
|
||||
'pre_authorized',
|
||||
'unauthorized',
|
||||
])
|
||||
|
||||
/**
|
||||
* AgentCliToolEnvConfig
|
||||
*/
|
||||
export const zAgentCliToolEnvConfig = z.object({
|
||||
secret_refs: z.array(zAgentSecretRefConfig).optional(),
|
||||
variables: z.array(zAgentEnvVariableConfig).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentCliToolRiskLevel
|
||||
*
|
||||
* Risk marker for CLI tool bootstrap commands.
|
||||
*/
|
||||
export const zAgentCliToolRiskLevel = z.enum(['dangerous', 'safe', 'unknown'])
|
||||
|
||||
/**
|
||||
* AgentCliToolConfig
|
||||
*/
|
||||
export const zAgentCliToolConfig = z.object({
|
||||
approved: z.boolean().optional().default(false),
|
||||
authorization_status: zAgentCliToolAuthorizationStatus.nullish(),
|
||||
command: z.string().nullish(),
|
||||
dangerous: z.boolean().optional().default(false),
|
||||
dangerous_accepted: z.boolean().optional().default(false),
|
||||
dangerous_acknowledged: z.boolean().optional().default(false),
|
||||
dangerous_command: z.boolean().optional().default(false),
|
||||
description: z.string().nullish(),
|
||||
enabled: z.boolean().optional().default(true),
|
||||
env: zAgentCliToolEnvConfig.optional(),
|
||||
id: z.string().max(255).nullish(),
|
||||
inferred_from: z.string().max(255).nullish(),
|
||||
install: z.string().nullish(),
|
||||
install_command: z.string().nullish(),
|
||||
install_commands: z.array(z.string()).optional(),
|
||||
invoke_metadata: z.record(z.string(), z.unknown()).optional(),
|
||||
label: z.string().max(255).nullish(),
|
||||
name: z.string().max(255).nullish(),
|
||||
permission: zAgentPermissionConfig.nullish(),
|
||||
pre_authorized: z.boolean().nullish(),
|
||||
requires_confirmation: z.boolean().optional().default(false),
|
||||
risk_accepted: z.boolean().optional().default(false),
|
||||
risk_level: zAgentCliToolRiskLevel.nullish(),
|
||||
setup_command: z.string().nullish(),
|
||||
tool_name: z.string().max(255).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulDifyToolCredentialRef
|
||||
*
|
||||
* Reference to a stored Dify Plugin Tool credential.
|
||||
*
|
||||
* Secret values are resolved only at runtime. The legacy ``credential_id``
|
||||
* field is accepted by :class:`AgentSoulDifyToolConfig` and normalized here so
|
||||
* old Agent tool payloads can be read while new payloads stay explicit.
|
||||
*/
|
||||
export const zAgentSoulDifyToolCredentialRef = z.object({
|
||||
id: z.string().max(255).nullish(),
|
||||
provider: z.string().max(255).nullish(),
|
||||
type: z.enum(['provider', 'tool']).optional().default('tool'),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulDifyToolConfig
|
||||
*
|
||||
* One Dify Plugin Tool configured on Agent Soul.
|
||||
*
|
||||
* The API backend prepares this persisted product shape into
|
||||
* ``DifyPluginToolConfig`` before sending a run request to Agent backend.
|
||||
* ``provider_id`` keeps compatibility with existing Agent tool config payloads;
|
||||
* new callers should send ``plugin_id`` + ``provider`` when available.
|
||||
*/
|
||||
export const zAgentSoulDifyToolConfig = z.object({
|
||||
credential_ref: zAgentSoulDifyToolCredentialRef.nullish(),
|
||||
credential_type: z.enum(['api-key', 'oauth2', 'unauthorized']).optional().default('api-key'),
|
||||
description: z.string().nullish(),
|
||||
enabled: z.boolean().optional().default(true),
|
||||
name: z.string().max(255).nullish(),
|
||||
plugin_id: z.string().max(255).nullish(),
|
||||
provider: z.string().max(255).nullish(),
|
||||
provider_id: z.string().max(255).nullish(),
|
||||
provider_type: z.string().optional().default('plugin'),
|
||||
runtime_parameters: z
|
||||
.record(
|
||||
z.string(),
|
||||
z
|
||||
.union([
|
||||
z.string(),
|
||||
z.int(),
|
||||
z.number(),
|
||||
z.boolean(),
|
||||
z.array(z.string()),
|
||||
z.array(z.int()),
|
||||
z.array(z.number()),
|
||||
z.array(z.boolean()),
|
||||
])
|
||||
.nullable(),
|
||||
)
|
||||
.optional(),
|
||||
tool_name: z.string().min(1).max(255).nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulToolsConfig
|
||||
*/
|
||||
export const zAgentSoulToolsConfig = z.object({
|
||||
cli_tools: z.array(zAgentCliToolConfig).optional(),
|
||||
dify_tools: z.array(zAgentSoulDifyToolConfig).optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentModerationIOConfig
|
||||
*/
|
||||
export const zAgentModerationIoConfig = z.object({
|
||||
enabled: z.boolean().optional().default(false),
|
||||
preset_response: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentModerationProviderConfig
|
||||
*/
|
||||
export const zAgentModerationProviderConfig = z.object({
|
||||
api_based_extension_id: z.string().nullish(),
|
||||
inputs_config: zAgentModerationIoConfig.nullish(),
|
||||
keywords: z.string().nullish(),
|
||||
outputs_config: zAgentModerationIoConfig.nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSensitiveWordAvoidanceFeatureConfig
|
||||
*/
|
||||
export const zAgentSensitiveWordAvoidanceFeatureConfig = z.object({
|
||||
config: zAgentModerationProviderConfig.nullish(),
|
||||
enabled: z.boolean().optional().default(false),
|
||||
type: z.string().nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulAppFeaturesConfig
|
||||
*/
|
||||
export const zAgentSoulAppFeaturesConfig = z.object({
|
||||
opening_statement: z.string().nullish(),
|
||||
retriever_resource: zAgentFeatureToggleConfig.nullish(),
|
||||
sensitive_word_avoidance: zAgentSensitiveWordAvoidanceFeatureConfig.nullish(),
|
||||
speech_to_text: zAgentFeatureToggleConfig.nullish(),
|
||||
suggested_questions: z.array(z.string()).nullish(),
|
||||
suggested_questions_after_answer: zAgentSuggestedQuestionsAfterAnswerFeatureConfig.nullish(),
|
||||
text_to_speech: zAgentTextToSpeechFeatureConfig.nullish(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentSoulConfig
|
||||
*/
|
||||
export const zAgentSoulConfig = z.object({
|
||||
app_features: zAgentSoulAppFeaturesConfig.optional(),
|
||||
app_variables: z.array(zAppVariableConfig).optional(),
|
||||
env: zAgentSoulEnvConfig.optional(),
|
||||
human: zAgentSoulHumanConfig.optional(),
|
||||
knowledge: zAgentSoulKnowledgeConfig.optional(),
|
||||
memory: zAgentSoulMemoryConfig.optional(),
|
||||
misc_legacy: zAgentSoulAppFeaturesConfig.optional(),
|
||||
model: zAgentSoulModelConfig.nullish(),
|
||||
prompt: zAgentSoulPromptConfig.optional(),
|
||||
sandbox: zAgentSoulSandboxConfig.optional(),
|
||||
schema_version: z.int().optional().default(1),
|
||||
skills_files: zAgentSoulSkillsFilesConfig.optional(),
|
||||
tools: zAgentSoulToolsConfig.optional(),
|
||||
})
|
||||
|
||||
/**
|
||||
* AgentConfigSnapshotDetailResponse
|
||||
*/
|
||||
export const zAgentConfigSnapshotDetailResponse = z.object({
|
||||
agent_id: z.string().nullish(),
|
||||
config_snapshot: zAgentSoulConfig,
|
||||
created_at: z.int().nullish(),
|
||||
created_by: z.string().nullish(),
|
||||
id: z.string(),
|
||||
revisions: z.array(zAgentConfigRevisionResponse).optional(),
|
||||
summary: z.string().nullish(),
|
||||
version: z.int(),
|
||||
version_note: z.string().nullish(),
|
||||
})
|
||||
|
||||
export const zGetAgentsQuery = z.object({
|
||||
keyword: z.string().optional(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
page: z.int().gte(1).optional().default(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* Agent roster list
|
||||
*/
|
||||
export const zGetAgentsResponse = zAgentRosterListResponse
|
||||
|
||||
export const zGetAgentsInviteOptionsQuery = z.object({
|
||||
app_id: z.string().optional(),
|
||||
keyword: z.string().optional(),
|
||||
limit: z.int().gte(1).lte(100).optional().default(20),
|
||||
page: z.int().gte(1).optional().default(1),
|
||||
})
|
||||
|
||||
/**
|
||||
* Agent invite options
|
||||
*/
|
||||
export const zGetAgentsInviteOptionsResponse = zAgentInviteOptionsResponse
|
||||
|
||||
export const zGetAgentsByAgentIdPath = z.object({
|
||||
agent_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Agent detail
|
||||
*/
|
||||
export const zGetAgentsByAgentIdResponse = zAgentRosterResponse
|
||||
|
||||
export const zGetAgentsByAgentIdVersionsPath = z.object({
|
||||
agent_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Agent versions
|
||||
*/
|
||||
export const zGetAgentsByAgentIdVersionsResponse = zAgentConfigSnapshotListResponse
|
||||
|
||||
export const zGetAgentsByAgentIdVersionsByVersionIdPath = z.object({
|
||||
agent_id: z.string(),
|
||||
version_id: z.string(),
|
||||
})
|
||||
|
||||
/**
|
||||
* Agent version detail
|
||||
*/
|
||||
export const zGetAgentsByAgentIdVersionsByVersionIdResponse = zAgentConfigSnapshotDetailResponse
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
|
||||
import { account } from './account/orpc.gen'
|
||||
import { activate } from './activate/orpc.gen'
|
||||
import { agents } from './agents/orpc.gen'
|
||||
import { agent } from './agent/orpc.gen'
|
||||
import { allWorkspaces } from './all-workspaces/orpc.gen'
|
||||
import { apiBasedExtension } from './api-based-extension/orpc.gen'
|
||||
import { apiKeyAuth } from './api-key-auth/orpc.gen'
|
||||
@@ -53,7 +53,7 @@ import { workspaces } from './workspaces/orpc.gen'
|
||||
export const contract = {
|
||||
account,
|
||||
activate,
|
||||
agents,
|
||||
agent,
|
||||
allWorkspaces,
|
||||
apiBasedExtension,
|
||||
apiKeyAuth,
|
||||
|
||||
Reference in New Issue
Block a user