@stack-spot/portal-network 0.146.2-beta.0 → 0.147.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.
- package/CHANGELOG.md +7 -0
- package/dist/api/agent-tools.d.ts +524 -29
- package/dist/api/agent-tools.d.ts.map +1 -1
- package/dist/api/agent-tools.js +276 -11
- package/dist/api/agent-tools.js.map +1 -1
- package/dist/client/agent-tools.d.ts +92 -51
- package/dist/client/agent-tools.d.ts.map +1 -1
- package/dist/client/agent-tools.js +44 -72
- package/dist/client/agent-tools.js.map +1 -1
- package/dist/client/agent.d.ts +49 -2
- package/dist/client/agent.d.ts.map +1 -1
- package/dist/client/agent.js +63 -0
- package/dist/client/agent.js.map +1 -1
- package/dist/client/ai.d.ts +30 -37
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +1 -10
- package/dist/client/ai.js.map +1 -1
- package/dist/client/cloud-account.d.ts +5 -5
- package/dist/client/cloud-platform-horizon.d.ts +20 -20
- package/dist/client/cloud-platform.d.ts +28 -28
- package/dist/client/cloud-runtimes.d.ts +21 -21
- package/dist/client/code-shift.d.ts +37 -37
- package/dist/client/content.d.ts +6 -6
- package/dist/client/data-integration.d.ts +19 -8
- package/dist/client/data-integration.d.ts.map +1 -1
- package/dist/client/data-integration.js +13 -4
- package/dist/client/data-integration.js.map +1 -1
- package/dist/client/discovery.d.ts +6 -6
- package/dist/client/gen-ai-inference.d.ts +9 -9
- package/dist/client/types.d.ts +12 -5
- package/dist/client/types.d.ts.map +1 -1
- package/dist/client/workflow.d.ts +10 -10
- package/dist/client/workspace-ai.d.ts +15 -15
- package/dist/utils/StreamedJson.js +2 -2
- package/dist/utils/StreamedJson.js.map +1 -1
- package/package.json +1 -1
- package/src/api/agent-tools.ts +843 -30
- package/src/client/agent-tools.ts +41 -86
- package/src/client/agent.ts +67 -1
- package/src/client/ai.ts +0 -5
- package/src/client/data-integration.ts +27 -19
- package/src/client/types.ts +14 -7
- package/src/utils/StreamedJson.tsx +2 -2
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
-
import {
|
|
2
|
+
import { createToolkitToolsV1ToolkitsToolkitIdToolsPost, createToolkitV1ToolkitsPost, defaults, deleteToolkitToolsV1ToolkitsToolkitIdToolsDelete, deleteToolkitV1ToolkitsToolkitIdDelete, editToolkitToolV1ToolkitsToolkitIdToolsToolIdPut, getPublicToolKitsV1BuiltinToolkitGet, getToolkitToolV1ToolkitsToolkitIdToolsToolIdGet, getToolkitV1ToolkitsToolkitIdGet, HttpValidationError, listToolkitsV1ToolkitsGet, updateToolkitV1ToolkitsToolkitIdPatch } from '../api/agent-tools'
|
|
3
3
|
import apis from '../apis.json'
|
|
4
4
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
5
5
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
6
6
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
7
|
-
import {
|
|
8
|
-
import { workspaceAiClient } from './workspace-ai'
|
|
9
|
-
|
|
10
|
-
const AGENT_DEFAULT_SLUG = 'stk_code_buddy'
|
|
7
|
+
import { AgentToolsOpenAPIPreview } from './types'
|
|
11
8
|
|
|
12
9
|
class AgentToolsClient extends ReactQueryNetworkClient {
|
|
13
10
|
constructor() {
|
|
@@ -19,106 +16,64 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
19
16
|
status: error.status,
|
|
20
17
|
headers: error.headers,
|
|
21
18
|
stack: error.stack,
|
|
22
|
-
|
|
19
|
+
// @ts-ignore API documentation is wrong
|
|
20
|
+
message: (error.data as HttpValidationError | undefined)?.details?.map(d => d.msg)?.join('\n'),
|
|
23
21
|
})
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
tools = this.query(getPublicToolKitsV1BuiltinToolkitGet)
|
|
27
25
|
|
|
28
26
|
/**
|
|
29
|
-
*
|
|
27
|
+
* Get list of Toolkits
|
|
30
28
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
toolkits = this.query(removeAuthorizationParam(listToolkitsV1ToolkitsGet))
|
|
33
30
|
/**
|
|
34
|
-
*
|
|
31
|
+
* Get a toolkit by Id
|
|
35
32
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
toolkitById = this.query(removeAuthorizationParam(getToolkitV1ToolkitsToolkitIdGet))
|
|
38
34
|
/**
|
|
39
|
-
*
|
|
35
|
+
* Create a toolkit
|
|
40
36
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
createToolkit = this.mutation(removeAuthorizationParam(createToolkitV1ToolkitsPost))
|
|
43
38
|
/**
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
* Update a toolkit
|
|
40
|
+
*/
|
|
41
|
+
updateToolkit = this.mutation(removeAuthorizationParam(updateToolkitV1ToolkitsToolkitIdPatch))
|
|
48
42
|
/**
|
|
49
|
-
|
|
50
|
-
*/
|
|
51
|
-
publishAgent = this.mutation(publishAgentV1AgentsAgentIdPublishPost)
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* List agents
|
|
43
|
+
* Delete a toolkit
|
|
55
44
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
* Gets agent by id
|
|
45
|
+
deleteToolkit = this.mutation(removeAuthorizationParam(deleteToolkitV1ToolkitsToolkitIdDelete))
|
|
46
|
+
/**
|
|
47
|
+
* Get Tool from Toolkit
|
|
60
48
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
* Gets agents by ids
|
|
49
|
+
toolFromToolkit = this.query(removeAuthorizationParam(getToolkitToolV1ToolkitsToolkitIdToolsToolIdGet))
|
|
50
|
+
/**
|
|
51
|
+
* Add tool on Toolkit
|
|
65
52
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* Gets the default agent slug
|
|
53
|
+
addToolOnToolkit = this.mutation(removeAuthorizationParam(createToolkitToolsV1ToolkitsToolkitIdToolsPost))
|
|
54
|
+
/**
|
|
55
|
+
* Edit tool on Toolkit
|
|
70
56
|
*/
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
* Gets the default agent
|
|
57
|
+
editToolOnToolkit = this.mutation(removeAuthorizationParam(editToolkitToolV1ToolkitsToolkitIdToolsToolIdPut))
|
|
58
|
+
/**
|
|
59
|
+
* Delete tool from Toolkit
|
|
75
60
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const agentDefault = await listAgentsV1AgentsGet(
|
|
80
|
-
{ visibility: 'built_in', slug: this.agentDefaultSlug, authorization: '' }, { signal },
|
|
81
|
-
)
|
|
82
|
-
|
|
83
|
-
const agentId = agentDefault.at(0)?.id
|
|
84
|
-
const agent = agentId ? await this.agent.query({ agentId }) : undefined
|
|
85
|
-
return agent
|
|
86
|
-
},
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* List agents filtered by visibility.
|
|
61
|
+
deleteToolFromToolkit = this.mutation(removeAuthorizationParam(deleteToolkitToolsV1ToolkitsToolkitIdToolsDelete))
|
|
62
|
+
/**
|
|
63
|
+
* Previews an uploaded open api file.
|
|
91
64
|
*/
|
|
92
|
-
|
|
93
|
-
name: '
|
|
94
|
-
request: async (signal,
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
: Promise.resolve([])
|
|
105
|
-
|
|
106
|
-
const [workspaceAgents, ...agentsByVisibility] = await Promise.all([
|
|
107
|
-
workspaceAgentsPromise,
|
|
108
|
-
...visibilities.map((visibility) => listAgentsV1AgentsGet({ visibility, authorization: '' }, { signal })),
|
|
109
|
-
])
|
|
110
|
-
|
|
111
|
-
const workspaceAgentsWithSpaceName = workspaceAgents.flatMap(({ agents, space_name }) =>
|
|
112
|
-
agents?.map((agent) => ({ ...agent, spaceName: space_name, builtIn: false }))) as AgentResponseWithBuiltIn[]
|
|
113
|
-
|
|
114
|
-
const allAgents: AgentResponseWithBuiltIn[] = workspaceAgentsWithSpaceName ?? []
|
|
115
|
-
|
|
116
|
-
agentsByVisibility.forEach(agents => allAgents.push(...agents.map(agent => ({
|
|
117
|
-
...agent,
|
|
118
|
-
builtIn: agent?.visibility_level === 'built_in',
|
|
119
|
-
}))))
|
|
120
|
-
|
|
121
|
-
return allAgents
|
|
65
|
+
previewUploadedAPI = this.query({
|
|
66
|
+
name: 'previewUploadedAPI',
|
|
67
|
+
request: async (signal, params: { fileUploadId: string }) => {
|
|
68
|
+
const url = `/v1/toolkits/tools/preview/${encodeURIComponent(params.fileUploadId)}`
|
|
69
|
+
const events = await this.stream(url, { signal })
|
|
70
|
+
const result: AgentToolsOpenAPIPreview[] = []
|
|
71
|
+
for await (const event of events) {
|
|
72
|
+
if (event.data) {
|
|
73
|
+
result.push(JSON.parse(event.data))
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return result
|
|
122
77
|
},
|
|
123
78
|
})
|
|
124
79
|
}
|
package/src/client/agent.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
-
import { defaults, deleteV1AgentByAgentIdFavorite, getV1AgentByAgentId, getV1Agents, getV1PublicAgentByAgentId, getV1PublicAgents, postV1AgentByAgentIdFavorite, postV1AgentsTrial, putV1AgentByAgentId } from '../api/agent'
|
|
2
|
+
import { defaults, deleteV1AgentByAgentIdFavorite, getV1AgentByAgentId, getV1Agents, getV1PublicAgentByAgentId, getV1PublicAgents, postV1AgentByAgentIdFavorite, postV1AgentsTrial, putV1AgentByAgentId, VisibilityLevel } from '../api/agent'
|
|
3
3
|
import apis from '../apis.json'
|
|
4
4
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
5
5
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
6
|
+
import { AgentResponseWithBuiltIn, AgentVisibilityLevel } from './types'
|
|
7
|
+
import { workspaceAiClient } from './workspace-ai'
|
|
8
|
+
|
|
9
|
+
export const isAgentDefault = (agentSlug?: string) => agentSlug === 'stk_code_buddy'
|
|
6
10
|
|
|
7
11
|
interface AgentError {
|
|
8
12
|
code?: string,
|
|
@@ -28,6 +32,56 @@ class AgentClient extends ReactQueryNetworkClient {
|
|
|
28
32
|
})
|
|
29
33
|
}
|
|
30
34
|
|
|
35
|
+
/**
|
|
36
|
+
* List agents filtered by visibility.
|
|
37
|
+
*/
|
|
38
|
+
allAgents = this.query({
|
|
39
|
+
name: 'allAgents',
|
|
40
|
+
request: async (signal, variables: { visibilities: AgentVisibilityLevel[] }) => {
|
|
41
|
+
const visibilities: VisibilityLevel[] = variables.visibilities.includes('ALL')
|
|
42
|
+
? ['PERSONAL', 'SHARED', 'WORKSPACE', 'ACCOUNT', 'FAVORITE']
|
|
43
|
+
: variables.visibilities.filter((visibility) => visibility !== 'BUILT-IN' && visibility !== 'ALL') as VisibilityLevel[]
|
|
44
|
+
|
|
45
|
+
const shouldIncludeBuiltInAgent = variables.visibilities.includes('ALL') || variables.visibilities.includes('BUILT-IN')
|
|
46
|
+
const shouldFetchBuiltInAgent = shouldIncludeBuiltInAgent || variables.visibilities.includes('FAVORITE')
|
|
47
|
+
const shouldFetchWorkspaceAgents = variables.visibilities.includes('ALL') || variables.visibilities.includes('WORKSPACE')
|
|
48
|
+
|
|
49
|
+
const publicAgentsPromise = shouldFetchBuiltInAgent ? getV1PublicAgents({}, { signal }) : Promise.resolve([])
|
|
50
|
+
const workspaceAgentsPromise = shouldFetchWorkspaceAgents
|
|
51
|
+
? workspaceAiClient.workspacesContentsByType.query({ contentType: 'agent' })
|
|
52
|
+
: Promise.resolve([])
|
|
53
|
+
|
|
54
|
+
const [publicAgents, workspaceAgents, ...agentsByVisibility] = await Promise.all([
|
|
55
|
+
publicAgentsPromise,
|
|
56
|
+
workspaceAgentsPromise,
|
|
57
|
+
...visibilities.map((visibility) => getV1Agents({ visibility }, { signal })),
|
|
58
|
+
])
|
|
59
|
+
|
|
60
|
+
const workspaceAgentsWithSpaceName = workspaceAgents?.flatMap(({ agents, space_name }) =>
|
|
61
|
+
agents?.map((agent) => ({
|
|
62
|
+
...agent,
|
|
63
|
+
spaceName: space_name,
|
|
64
|
+
builtIn: publicAgents?.some(publicAgent => publicAgent.id === agent.id),
|
|
65
|
+
}))) as AgentResponseWithBuiltIn[]
|
|
66
|
+
|
|
67
|
+
const allAgents: AgentResponseWithBuiltIn[] = workspaceAgentsWithSpaceName || []
|
|
68
|
+
|
|
69
|
+
if (shouldIncludeBuiltInAgent) {
|
|
70
|
+
const builtInsAgents = publicAgents?.map((agent) => ({ ...agent, builtIn: true, visibility_level: 'BUILT-IN' }))
|
|
71
|
+
allAgents.push(...builtInsAgents)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
agentsByVisibility.forEach(agents => {
|
|
75
|
+
allAgents.push(...agents.map(agent => ({
|
|
76
|
+
...agent,
|
|
77
|
+
builtIn: publicAgents?.some(publicAgent => publicAgent.id === agent.id),
|
|
78
|
+
})))
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
return allAgents
|
|
82
|
+
},
|
|
83
|
+
})
|
|
84
|
+
|
|
31
85
|
/**
|
|
32
86
|
* Gets an agent by id
|
|
33
87
|
*/
|
|
@@ -38,6 +92,18 @@ class AgentClient extends ReactQueryNetworkClient {
|
|
|
38
92
|
: getV1AgentByAgentId({ ...variables }, { signal }),
|
|
39
93
|
})
|
|
40
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Gets the default agent
|
|
97
|
+
*/
|
|
98
|
+
agentDefault = this.query({
|
|
99
|
+
name: 'agentDefault',
|
|
100
|
+
request: async (signal) => {
|
|
101
|
+
const publicAgents = await getV1PublicAgents({}, { signal })
|
|
102
|
+
const agentDefault = publicAgents.find((agent) => isAgentDefault(agent.slug))
|
|
103
|
+
return agentDefault ? { ...agentDefault, builtIn: true } : undefined
|
|
104
|
+
},
|
|
105
|
+
})
|
|
106
|
+
|
|
41
107
|
/**
|
|
42
108
|
* List commons agents
|
|
43
109
|
*/
|
package/src/client/ai.ts
CHANGED
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
quickCommandsRunV2V2QuickCommandsSlugStepsStepSlugRunPost,
|
|
34
34
|
resetKnowledgeObjectsV1KnowledgeSourcesSlugObjectsDelete,
|
|
35
35
|
runFetchStepV1QuickCommandsSlugStepsStepSlugFetchRunPost,
|
|
36
|
-
searchKnowledgeSourcesV1KnowledgeSourcesSearchPost,
|
|
37
36
|
updateQuickCommandV1QuickCommandsSlugPatch,
|
|
38
37
|
updateTitleV1ConversationsConversationIdPatch,
|
|
39
38
|
vectorizeCustomKnowledgeSourceV1KnowledgeSourcesSlugCustomPost,
|
|
@@ -135,10 +134,6 @@ class AIClient extends ReactQueryNetworkClient {
|
|
|
135
134
|
* Gets a knowledge source document by the slug of the parent knowledge source and the document id.
|
|
136
135
|
*/
|
|
137
136
|
knowledgeSourceDocument = this.query(removeAuthorizationParam(findKnowledgeObjectByCustomIdV1KnowledgeSourcesSlugObjectsCustomIdGet))
|
|
138
|
-
/**
|
|
139
|
-
* Lists knowledge sources matching the provided IDs.
|
|
140
|
-
*/
|
|
141
|
-
searchKnowledgeSources = this.query(removeAuthorizationParam(searchKnowledgeSourcesV1KnowledgeSourcesSearchPost))
|
|
142
137
|
/**
|
|
143
138
|
* Gets the chat history. This is a paginated resource.
|
|
144
139
|
*/
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
listKsV1KnowledgeSourcesGet,
|
|
10
10
|
saveChunkedFilesDeprecatedV1FileUploadFileUploadIdPost,
|
|
11
11
|
saveChunkedFilesV1FileUploadFileUploadIdKnowledgeObjectsPost,
|
|
12
|
+
splitUploadedFilePreviewV1FileUploadFileUploadIdSplitPreviewSplitStrategyGet,
|
|
12
13
|
splitUploadedFileV1FileUploadFileUploadIdSplitPost,
|
|
13
14
|
} from '../api/dataIntegration'
|
|
14
15
|
import apis from '../apis.json'
|
|
@@ -65,7 +66,12 @@ class DataIntegrationClient extends ReactQueryNetworkClient {
|
|
|
65
66
|
'Accept': 'text/event-stream',
|
|
66
67
|
},
|
|
67
68
|
signal: options?.signal,
|
|
68
|
-
})
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Generate a preview with splitted objects
|
|
73
|
+
*/
|
|
74
|
+
previewFromSplit = this.query(removeAuthorizationParam(splitUploadedFilePreviewV1FileUploadFileUploadIdSplitPreviewSplitStrategyGet))
|
|
69
75
|
/**
|
|
70
76
|
* List of knowledge sources
|
|
71
77
|
*/
|
|
@@ -81,24 +87,26 @@ class DataIntegrationClient extends ReactQueryNetworkClient {
|
|
|
81
87
|
|
|
82
88
|
uploadFiles = this.mutation({
|
|
83
89
|
name: 'uploadFiles',
|
|
84
|
-
request: (abortSignal, params: { files: File[], type: FileUploadType }) =>
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
90
|
+
request: (abortSignal, params: { files: File[], type: FileUploadType, targetId?: string }) => (
|
|
91
|
+
Promise.all(params.files.map(async (f) => {
|
|
92
|
+
try {
|
|
93
|
+
const { id, url, form } = await getUploadFormV2V2FileUploadFormPost({
|
|
94
|
+
authorization: '',
|
|
95
|
+
newFileUploadRequest: { file_name: f.name, target_type: params.type, target_id: params.targetId ?? '' },
|
|
96
|
+
}, { signal: abortSignal })
|
|
97
|
+
const formData = new FormData()
|
|
98
|
+
Object.entries(form).forEach(([key, value]) => {
|
|
99
|
+
formData.append(key, value)
|
|
100
|
+
})
|
|
101
|
+
formData.append('file', f)
|
|
102
|
+
const response = await fetch(url, { method: 'post', body: formData, signal: abortSignal })
|
|
103
|
+
if (!response.ok) throw new StackspotAPIError({ status: response.status, headers: response.headers, message: 'Failed to upload' })
|
|
104
|
+
return id
|
|
105
|
+
} catch (e: any) {
|
|
106
|
+
throw new FileUploadError(f.name, e)
|
|
107
|
+
}
|
|
108
|
+
}))
|
|
109
|
+
),
|
|
102
110
|
})
|
|
103
111
|
}
|
|
104
112
|
|
package/src/client/types.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RequestOpts } from '@oazapfts/runtime'
|
|
2
2
|
import { AccountScmInfoSaveRequest, AccountScmInfoUpdateRequest, AccountScmStatusResponse, GroupsFromResourceResponse, MembersFromResourceResponse } from '../api/account'
|
|
3
|
-
import {
|
|
3
|
+
import { AgentResponse, VisibilityLevel } from '../api/agent'
|
|
4
|
+
import { HttpMethod } from '../api/agent-tools'
|
|
4
5
|
import { ChatRequest, ChatResponse3, ContentDependencyResponse, ConversationHistoryResponse, ConversationResponse, DependencyResponse } from '../api/ai'
|
|
5
6
|
import { ConnectAccountRequestV2, ManagedAccountProvisionRequest } from '../api/cloudAccount'
|
|
6
7
|
import { AllocationCostRequest, AllocationCostResponse, ChargePeriod, getAllocationCostFilters, ManagedService, ServiceResource } from '../api/cloudServices'
|
|
@@ -219,7 +220,6 @@ export interface WorkspaceAiMembersPermissions {
|
|
|
219
220
|
totalPages: number,
|
|
220
221
|
}
|
|
221
222
|
|
|
222
|
-
|
|
223
223
|
export interface WorkspaceAiGroupsPermissions extends GroupsFromResourceResponse {
|
|
224
224
|
actions: Action[],
|
|
225
225
|
}
|
|
@@ -358,11 +358,18 @@ export type FixVariables<
|
|
|
358
358
|
|
|
359
359
|
export type ReplaceResult<T extends (...args: any[]) => Promise<any>, Fix> = (...args: Parameters<T>) => Promise<Fix>
|
|
360
360
|
|
|
361
|
-
export interface AgentResponseWithBuiltIn extends
|
|
361
|
+
export interface AgentResponseWithBuiltIn extends AgentResponse {
|
|
362
362
|
builtIn?: boolean,
|
|
363
363
|
spaceName?: string,
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export type AgentVisibilityLevel = VisibilityLevel | 'BUILT-IN' | 'ALL'
|
|
367
367
|
|
|
368
|
-
export
|
|
368
|
+
export interface AgentToolsOpenAPIPreview {
|
|
369
|
+
name: string,
|
|
370
|
+
description: string,
|
|
371
|
+
method: HttpMethod,
|
|
372
|
+
url: string,
|
|
373
|
+
parameters?: Record<string, any>,
|
|
374
|
+
request_body?: Record<string, any>,
|
|
375
|
+
}
|
|
@@ -92,8 +92,8 @@ export class StreamedJson<T> {
|
|
|
92
92
|
else if (typeof source[k] === 'string') target[k] += source[k]
|
|
93
93
|
else if (Array.isArray(source[k])) target[k].push(...source[k])
|
|
94
94
|
else if (typeof source[k] === 'number') parseFloat(target[k] + source[k])
|
|
95
|
-
else if (typeof source[k] === 'object') this.merge(source[k], target[k])
|
|
96
|
-
else target[k] = source[k]
|
|
95
|
+
else if (source[k] && typeof source[k] === 'object') this.merge(source[k], target[k])
|
|
96
|
+
else if (source[k]) target[k] = source[k]
|
|
97
97
|
})
|
|
98
98
|
}
|
|
99
99
|
|