@stack-spot/portal-network 1.0.0-dev.1768593954453 → 1.0.0-dev.1768944806600
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/dist/api/agent-tools.d.ts +154 -616
- package/dist/api/agent-tools.d.ts.map +1 -1
- package/dist/api/agent-tools.js +45 -168
- package/dist/api/agent-tools.js.map +1 -1
- package/dist/api/ai.d.ts +2 -3
- package/dist/api/ai.d.ts.map +1 -1
- package/dist/api/ai.js +2 -1
- package/dist/api/ai.js.map +1 -1
- package/dist/api/workspace-ai.d.ts +0 -41
- package/dist/api/workspace-ai.d.ts.map +1 -1
- package/dist/api/workspace-ai.js +0 -34
- package/dist/api/workspace-ai.js.map +1 -1
- package/dist/client/agent-tools.d.ts +3 -130
- package/dist/client/agent-tools.d.ts.map +1 -1
- package/dist/client/agent-tools.js +2 -105
- package/dist/client/agent-tools.js.map +1 -1
- package/dist/client/ai.d.ts +1 -72
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +6 -71
- package/dist/client/ai.js.map +1 -1
- package/dist/client/workspace-ai.d.ts +4 -15
- package/dist/client/workspace-ai.d.ts.map +1 -1
- package/dist/client/workspace-ai.js +3 -17
- package/dist/client/workspace-ai.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +0 -1
- package/src/api/agent-tools.ts +199 -815
- package/src/api/ai.ts +3 -3
- package/src/api/workspace-ai.ts +0 -83
- package/src/client/agent-tools.ts +2 -55
- package/src/client/ai.ts +6 -42
- package/src/client/workspace-ai.ts +7 -23
package/src/api/ai.ts
CHANGED
|
@@ -384,7 +384,6 @@ export type QuickCommandsStepPromptRequest = {
|
|
|
384
384
|
allow_use_current_workspace?: boolean;
|
|
385
385
|
knowledge_source_slugs?: string[] | null;
|
|
386
386
|
agent_id?: string | null;
|
|
387
|
-
agent_version_number?: number | null;
|
|
388
387
|
use_uploaded_files?: boolean;
|
|
389
388
|
agent_built_in?: boolean | null;
|
|
390
389
|
next_step_slug?: string | null;
|
|
@@ -872,7 +871,6 @@ export type ChatRequest = {
|
|
|
872
871
|
} | null;
|
|
873
872
|
user_prompt: string;
|
|
874
873
|
project_id?: string | null;
|
|
875
|
-
agent_version_number?: number | null;
|
|
876
874
|
};
|
|
877
875
|
export type SourceProjectFile3 = {
|
|
878
876
|
"type": "project_file";
|
|
@@ -4063,13 +4061,14 @@ export function devAssistantV3V3ChatPost({ authorization, xAccountId, xMemberId,
|
|
|
4063
4061
|
/**
|
|
4064
4062
|
* List All
|
|
4065
4063
|
*/
|
|
4066
|
-
export function listAllV3QuickCommandsGet({ name, slug, size, page, visibilityList, order, types, authorization, xAccountId, xMemberId, xUsername }: {
|
|
4064
|
+
export function listAllV3QuickCommandsGet({ name, slug, size, page, visibilityList, order, isRemote, types, authorization, xAccountId, xMemberId, xUsername }: {
|
|
4067
4065
|
name?: string | null;
|
|
4068
4066
|
slug?: string | null;
|
|
4069
4067
|
size?: number;
|
|
4070
4068
|
page?: number;
|
|
4071
4069
|
visibilityList?: VisibilityLevelEnum[] | null;
|
|
4072
4070
|
order?: OrderEnum | null;
|
|
4071
|
+
isRemote?: boolean;
|
|
4073
4072
|
types?: QuickCommandTypeRequest[] | null;
|
|
4074
4073
|
authorization: string;
|
|
4075
4074
|
xAccountId?: string | null;
|
|
@@ -4091,6 +4090,7 @@ export function listAllV3QuickCommandsGet({ name, slug, size, page, visibilityLi
|
|
|
4091
4090
|
page,
|
|
4092
4091
|
visibility_list: visibilityList,
|
|
4093
4092
|
order,
|
|
4093
|
+
is_remote: isRemote,
|
|
4094
4094
|
types
|
|
4095
4095
|
}))}`, {
|
|
4096
4096
|
...opts,
|
package/src/api/workspace-ai.ts
CHANGED
|
@@ -84,13 +84,6 @@ export type ListWksContentsResponse = {
|
|
|
84
84
|
[key: string]: any;
|
|
85
85
|
}[] | null;
|
|
86
86
|
};
|
|
87
|
-
export type ContentVersion = {
|
|
88
|
-
core_id: string;
|
|
89
|
-
version_number?: number | null;
|
|
90
|
-
};
|
|
91
|
-
export type AddWorkspaceContentRequestV2 = {
|
|
92
|
-
content_identifier: ContentVersion[];
|
|
93
|
-
};
|
|
94
87
|
export type ActionShared = "VIEW" | "EDIT" | "GRANT_ACESS";
|
|
95
88
|
export type PermissionForSharedRequest = {
|
|
96
89
|
userId: string;
|
|
@@ -107,12 +100,6 @@ export type ResourceMembersResponse = {
|
|
|
107
100
|
name: string;
|
|
108
101
|
actions: string[];
|
|
109
102
|
};
|
|
110
|
-
export type ResourceMembersPaginatedResponse = {
|
|
111
|
-
items: ResourceMembersResponse[];
|
|
112
|
-
page: number;
|
|
113
|
-
size: number;
|
|
114
|
-
total_pages: number;
|
|
115
|
-
};
|
|
116
103
|
/**
|
|
117
104
|
* Create Workspace
|
|
118
105
|
*/
|
|
@@ -547,36 +534,6 @@ export function listAllContentsV1WorkspacesWorkspaceIdContentsGet({ workspaceId,
|
|
|
547
534
|
})
|
|
548
535
|
}));
|
|
549
536
|
}
|
|
550
|
-
/**
|
|
551
|
-
* Add Content
|
|
552
|
-
*/
|
|
553
|
-
export function addContentV2WorkspacesWorkspaceIdContentTypePost({ workspaceId, contentType, authorization, xAccountId, addWorkspaceContentRequestV2 }: {
|
|
554
|
-
workspaceId: string;
|
|
555
|
-
contentType: ContentType;
|
|
556
|
-
authorization: string;
|
|
557
|
-
xAccountId?: string | null;
|
|
558
|
-
addWorkspaceContentRequestV2: AddWorkspaceContentRequestV2;
|
|
559
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
560
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
561
|
-
status: 200;
|
|
562
|
-
data: {
|
|
563
|
-
[key: string]: any;
|
|
564
|
-
};
|
|
565
|
-
} | {
|
|
566
|
-
status: 404;
|
|
567
|
-
} | {
|
|
568
|
-
status: 422;
|
|
569
|
-
data: HttpValidationError;
|
|
570
|
-
}>(`/v2/workspaces/${encodeURIComponent(workspaceId)}/${encodeURIComponent(contentType)}`, oazapfts.json({
|
|
571
|
-
...opts,
|
|
572
|
-
method: "POST",
|
|
573
|
-
body: addWorkspaceContentRequestV2,
|
|
574
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
575
|
-
authorization,
|
|
576
|
-
"x-account-id": xAccountId
|
|
577
|
-
})
|
|
578
|
-
})));
|
|
579
|
-
}
|
|
580
537
|
/**
|
|
581
538
|
* Use Shareable Link
|
|
582
539
|
*/
|
|
@@ -696,46 +653,6 @@ export function listMembersV1ResourceTypeResourceTypeResourcesResourceIdentifier
|
|
|
696
653
|
})
|
|
697
654
|
}));
|
|
698
655
|
}
|
|
699
|
-
/**
|
|
700
|
-
* List Members
|
|
701
|
-
*/
|
|
702
|
-
export function listMembersV2ResourceTypeResourceTypeResourcesResourceIdentifierMembersGet({ resourceType, resourceIdentifier, search, filterBy, filterValue, sortBy, page, size, order, authorization, xAccountId }: {
|
|
703
|
-
resourceType: ContentType;
|
|
704
|
-
resourceIdentifier: string;
|
|
705
|
-
search?: string | null;
|
|
706
|
-
filterBy?: string | null;
|
|
707
|
-
filterValue?: string | null;
|
|
708
|
-
sortBy?: SortBy | null;
|
|
709
|
-
page?: number;
|
|
710
|
-
size?: number;
|
|
711
|
-
order?: OrderEnum;
|
|
712
|
-
authorization: string;
|
|
713
|
-
xAccountId?: string | null;
|
|
714
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
715
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
716
|
-
status: 200;
|
|
717
|
-
data: ResourceMembersPaginatedResponse;
|
|
718
|
-
} | {
|
|
719
|
-
status: 404;
|
|
720
|
-
} | {
|
|
721
|
-
status: 422;
|
|
722
|
-
data: HttpValidationError;
|
|
723
|
-
}>(`/v2/resource-type/${encodeURIComponent(resourceType)}/resources/${encodeURIComponent(resourceIdentifier)}/members${QS.query(QS.explode({
|
|
724
|
-
search,
|
|
725
|
-
filter_by: filterBy,
|
|
726
|
-
filter_value: filterValue,
|
|
727
|
-
sort_by: sortBy,
|
|
728
|
-
page,
|
|
729
|
-
size,
|
|
730
|
-
order
|
|
731
|
-
}))}`, {
|
|
732
|
-
...opts,
|
|
733
|
-
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
734
|
-
authorization,
|
|
735
|
-
"x-account-id": xAccountId
|
|
736
|
-
})
|
|
737
|
-
}));
|
|
738
|
-
}
|
|
739
656
|
/**
|
|
740
657
|
* Healthz
|
|
741
658
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
2
|
import { getApiAddresses } from '../api-addresses'
|
|
3
|
-
import { addFavoriteV1AgentsAgentIdFavoritePost, AgentVisibilityLevelEnum, createAgentV1AgentsPost,
|
|
3
|
+
import { addFavoriteV1AgentsAgentIdFavoritePost, AgentVisibilityLevelEnum, createAgentV1AgentsPost, createToolkitToolsV1ToolkitsToolkitIdToolsPost, createToolkitV1ToolkitsPost, defaults, deleteAgentV1AgentsAgentIdDelete, deleteFavoriteV1AgentsAgentIdFavoriteDelete, deleteToolkitToolsV1ToolkitsToolkitIdToolsDelete, deleteToolkitV1ToolkitsToolkitIdDelete, editToolkitToolV1ToolkitsToolkitIdToolsToolIdPut, forkAgentV1AgentsAgentIdForkPost, forkToolkitV1ToolkitsToolkitIdForkPost, getAgentV1AgentsAgentIdGet, getPublicToolKitsV1BuiltinToolkitGet, getToolkitToolV1ToolkitsToolkitIdToolsToolIdGet, getToolkitV1ToolkitsToolkitIdGet, listAgentsUsingToolsV1ToolkitsToolkitIdToolsAgentsPost, listAgentsV1AgentsGet, listAgentsV3AgentsGet, listMcpToolsV1McpToolsToolkitIdGet, listMultiAgentsV1AgentsMultiAgentsGet, listToolkitsV1ToolkitsGet, listToolkitsV2ToolkitsGet, publishAgentV1AgentsAgentIdPublishPost, searchAgentsV1AgentsSearchPost, shareV1AgentsAgentIdSharePost, updateAgentV1AgentsAgentIdPatch, updateToolkitV1ToolkitsToolkitIdPatch, VisibilityLevelEnum } from '../api/agent-tools'
|
|
4
4
|
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
5
5
|
import { agentToolsDictionary } from '../error/dictionary/agent-tools'
|
|
6
6
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
@@ -13,7 +13,6 @@ import { workspaceAiClient } from './workspace-ai'
|
|
|
13
13
|
|
|
14
14
|
const AGENT_DEFAULT_SLUG = 'stk_flex'
|
|
15
15
|
const listAgentsV3AgentsWithoutAuthorization = removeAuthorizationParam(listAgentsV3AgentsGet)
|
|
16
|
-
const listAgentsV4 = removeAuthorizationParam(listAgentsV4AgentsGet)
|
|
17
16
|
const listToolkitsAuthorization = removeAuthorizationParam(listToolkitsV2ToolkitsGet)
|
|
18
17
|
|
|
19
18
|
class AgentToolsClient extends ReactQueryNetworkClient {
|
|
@@ -31,7 +30,6 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
31
30
|
tools = this.query(removeAuthorizationParam(getPublicToolKitsV1BuiltinToolkitGet))
|
|
32
31
|
|
|
33
32
|
/**
|
|
34
|
-
* @deprecated
|
|
35
33
|
* Create agent
|
|
36
34
|
*/
|
|
37
35
|
createAgent = this.mutation(removeAuthorizationParam(createAgentV1AgentsPost))
|
|
@@ -42,7 +40,6 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
42
40
|
deleteAgent = this.mutation(removeAuthorizationParam(deleteAgentV1AgentsAgentIdDelete))
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
|
-
* @deprecated
|
|
46
43
|
* Updates an agent
|
|
47
44
|
*/
|
|
48
45
|
updateAgent = this.mutation(removeAuthorizationParam(updateAgentV1AgentsAgentIdPatch))
|
|
@@ -81,16 +78,14 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
81
78
|
availableAgentsForMultiAgentAddition = this.query(removeAuthorizationParam(listMultiAgentsV1AgentsMultiAgentsGet))
|
|
82
79
|
|
|
83
80
|
/**
|
|
84
|
-
* @deprecated
|
|
85
81
|
* Gets agent by id
|
|
86
82
|
*/
|
|
87
83
|
agent = this.query(removeAuthorizationParam(getAgentV1AgentsAgentIdGet))
|
|
88
84
|
|
|
89
85
|
/**
|
|
90
|
-
* @deprecated
|
|
91
86
|
* Gets agents by ids
|
|
92
87
|
*/
|
|
93
|
-
agentsByIds = this.query(removeAuthorizationParam(
|
|
88
|
+
agentsByIds = this.query(removeAuthorizationParam(searchAgentsV1AgentsSearchPost))
|
|
94
89
|
|
|
95
90
|
/**
|
|
96
91
|
* Gets the default agent slug
|
|
@@ -243,54 +238,6 @@ class AgentToolsClient extends ReactQueryNetworkClient {
|
|
|
243
238
|
* remove an agent from favorites
|
|
244
239
|
*/
|
|
245
240
|
removeFavorite = this.mutation(removeAuthorizationParam(deleteFavoriteV1AgentsAgentIdFavoriteDelete))
|
|
246
|
-
/**
|
|
247
|
-
* Creates an agent version
|
|
248
|
-
*/
|
|
249
|
-
createAgentVersion = this.mutation(removeAuthorizationParam(createVersionV1AgentsAgentCoreIdVersionsPost))
|
|
250
|
-
/**
|
|
251
|
-
* V2 of agent creation
|
|
252
|
-
*/
|
|
253
|
-
createAgentV2 = this.mutation(removeAuthorizationParam(createAgentV2AgentsPost))
|
|
254
|
-
/**
|
|
255
|
-
* V2 of agent update
|
|
256
|
-
*/
|
|
257
|
-
updateAgentV2 = this.mutation(removeAuthorizationParam(updateAgentV2AgentsAgentIdPatch))
|
|
258
|
-
/**
|
|
259
|
-
* Update agent recommended version
|
|
260
|
-
*/
|
|
261
|
-
updateRecommendedVersion = this.mutation(removeAuthorizationParam(patchVersionRecommendedV1AgentsAgentCoreIdVersionsVersionNumberPatch))
|
|
262
|
-
/**
|
|
263
|
-
* V2 of get agent by id
|
|
264
|
-
*/
|
|
265
|
-
agentV2 = this.query(removeAuthorizationParam(findByAgentCoreIdV2AgentsAgentCoreIdGet))
|
|
266
|
-
/**
|
|
267
|
-
* Deletes an agent version
|
|
268
|
-
*/
|
|
269
|
-
deleteVersion = this.mutation(removeAuthorizationParam(deleteVersionV1AgentsAgentCoreIdVersionsVersionNumberDelete))
|
|
270
|
-
/**
|
|
271
|
-
* Gets agent versions
|
|
272
|
-
*/
|
|
273
|
-
listAgentVersions = this.query(removeAuthorizationParam(listVersionsOfAgentCoreV1AgentsAgentCoreIdVersionsGet))
|
|
274
|
-
/**
|
|
275
|
-
* Get agents by list of ids using api v2
|
|
276
|
-
*/
|
|
277
|
-
agentsByIdsV2 = this.query(removeAuthorizationParam(searchAgentsV2AgentsSearchPost))
|
|
278
|
-
/**
|
|
279
|
-
* Deletes an agent version
|
|
280
|
-
*/
|
|
281
|
-
forkAgentVersion = this.mutation(removeAuthorizationParam(forkAgentVersionV1AgentsAgentCoreIdVersionsVersionNumberForkPost))
|
|
282
|
-
/**
|
|
283
|
-
* Get agents v4
|
|
284
|
-
*/
|
|
285
|
-
agentsV4 = this.infiniteQuery(listAgentsV4, {
|
|
286
|
-
pageParamName: 'filters.page',
|
|
287
|
-
accumulator: 'items',
|
|
288
|
-
getNextPageParam: ({ variables, lastPage, lastPageParam }) => {
|
|
289
|
-
const size = variables.filters.size ?? 1
|
|
290
|
-
const parsedLastPageParam = (lastPageParam as number) ?? variables.filters.page ?? 1
|
|
291
|
-
return lastPage.items && lastPage.items.length < size ? undefined : parsedLastPageParam + 1
|
|
292
|
-
},
|
|
293
|
-
})
|
|
294
241
|
}
|
|
295
242
|
|
|
296
243
|
export const agentToolsClient = new AgentToolsClient()
|
package/src/client/ai.ts
CHANGED
|
@@ -6,11 +6,9 @@ import {
|
|
|
6
6
|
addFavoriteV1QuickCommandsSlugFavoritePost,
|
|
7
7
|
calculateNextStepV1QuickCommandsSlugStepsStepSlugCalculateNextStepPost,
|
|
8
8
|
callbackV1QuickCommandsCallbackExecutionIdGet,
|
|
9
|
-
checkQuickCommandExistsV1QuickCommandsSlugExistsGet,
|
|
10
9
|
conversationHistoryV1ConversationsConversationIdGet,
|
|
11
10
|
createAnswerForReviewV1ResourcesResourceTypeSlugResourceSlugReviewsReviewIdAnswersPost,
|
|
12
11
|
createExecutionV1QuickCommandsCreateExecutionSlugPost,
|
|
13
|
-
createQuickCommandV1QuickCommandsPost,
|
|
14
12
|
createResourceReviewV1ResourcesResourceTypeSlugResourceSlugReviewsPost,
|
|
15
13
|
currentV1TokensUsageCurrentGet,
|
|
16
14
|
defaults,
|
|
@@ -18,15 +16,11 @@ import {
|
|
|
18
16
|
deleteFavoriteV1AiStacksStackIdFavoriteDelete,
|
|
19
17
|
deleteFavoriteV1QuickCommandsSlugFavoriteDelete,
|
|
20
18
|
deleteKnowledgeObjectByCustomIdV1KnowledgeSourcesSlugObjectsCustomIdDelete,
|
|
21
|
-
deleteKnowledgeSourceV1KnowledgeSourcesSlugDelete,
|
|
22
|
-
deleteQuickCommandV1QuickCommandsSlugDelete,
|
|
23
19
|
deleteResourceReviewV1ResourcesResourceTypeSlugResourceSlugReviewsReviewIdDelete,
|
|
24
20
|
deleteReviewCommentV1ResourcesResourceTypeSlugResourceSlugReviewsReviewIdAnswersAnswerIdDelete,
|
|
25
21
|
downloadConversationV1ConversationsConversationIdDownloadGet,
|
|
26
22
|
findKnowledgeObjectByCustomIdV1KnowledgeSourcesSlugObjectsCustomIdGet,
|
|
27
|
-
findKnowledgeSourceDependenciesV1KnowledgeSourcesSlugDependenciesGet,
|
|
28
23
|
findKnowledgeSourceV1KnowledgeSourcesSlugGet,
|
|
29
|
-
forkV1QuickCommandsSlugForkPost,
|
|
30
24
|
formatFetchStepV1QuickCommandsSlugStepsStepSlugFetchFormatPost,
|
|
31
25
|
formatResultV1QuickCommandsSlugResultFormatPost,
|
|
32
26
|
getContentDependenciesV1ContentContentTypeContentIdDependenciesGet,
|
|
@@ -44,7 +38,6 @@ import {
|
|
|
44
38
|
listConversationsV1ConversationsGet,
|
|
45
39
|
listKnowledgeSourcesV1KnowledgeSourcesGet,
|
|
46
40
|
postEventV1EventsPost,
|
|
47
|
-
publishV1QuickCommandsSlugPublishPost,
|
|
48
41
|
quickActionsV1QuickActionsPost,
|
|
49
42
|
QuickCommandPromptResponse2,
|
|
50
43
|
QuickCommandsExecutionRequest,
|
|
@@ -60,7 +53,7 @@ import {
|
|
|
60
53
|
updateResourceReviewV1ResourcesResourceTypeSlugResourceSlugReviewsReviewIdPatch,
|
|
61
54
|
updateReviewCommentV1ResourcesResourceTypeSlugResourceSlugReviewsReviewIdAnswersAnswerIdPatch,
|
|
62
55
|
updateTitleV1ConversationsConversationIdPatch,
|
|
63
|
-
vectorizeCustomKnowledgeSourceV1KnowledgeSourcesSlugCustomPost
|
|
56
|
+
vectorizeCustomKnowledgeSourceV1KnowledgeSourcesSlugCustomPost,
|
|
64
57
|
} from '../api/ai'
|
|
65
58
|
|
|
66
59
|
|
|
@@ -124,10 +117,6 @@ class AIClient extends ReactQueryNetworkClient {
|
|
|
124
117
|
*/
|
|
125
118
|
vectorizeCustomKS = this.mutation(
|
|
126
119
|
removeAuthorizationParam(vectorizeCustomKnowledgeSourceV1KnowledgeSourcesSlugCustomPost))
|
|
127
|
-
/**
|
|
128
|
-
* Deletes a KS
|
|
129
|
-
*/
|
|
130
|
-
deleteKS = this.mutation(removeAuthorizationParam(deleteKnowledgeSourceV1KnowledgeSourcesSlugDelete))
|
|
131
120
|
/**
|
|
132
121
|
* Lists the AI Stacks according to their visibilities.
|
|
133
122
|
*/
|
|
@@ -169,26 +158,6 @@ class AIClient extends ReactQueryNetworkClient {
|
|
|
169
158
|
* Gets the execution status and result of a quick command by its execution ID.
|
|
170
159
|
*/
|
|
171
160
|
quickCommandCallbackExecutionId = this.query(removeAuthorizationParam(callbackV1QuickCommandsCallbackExecutionIdGet))
|
|
172
|
-
/**
|
|
173
|
-
* Creates a QC
|
|
174
|
-
*/
|
|
175
|
-
createQuickCommand = this.mutation(removeAuthorizationParam(createQuickCommandV1QuickCommandsPost))
|
|
176
|
-
/**
|
|
177
|
-
* Creates a QC
|
|
178
|
-
*/
|
|
179
|
-
deleteQuickCommand = this.mutation(removeAuthorizationParam(deleteQuickCommandV1QuickCommandsSlugDelete))
|
|
180
|
-
/**
|
|
181
|
-
* Forks a QC
|
|
182
|
-
*/
|
|
183
|
-
forkQuickCommand = this.mutation(removeAuthorizationParam(forkV1QuickCommandsSlugForkPost))
|
|
184
|
-
/**
|
|
185
|
-
* Publishes a QC
|
|
186
|
-
*/
|
|
187
|
-
publishQuickCommand = this.mutation(removeAuthorizationParam(publishV1QuickCommandsSlugPublishPost))
|
|
188
|
-
/**
|
|
189
|
-
* Check Quick Command Available slug
|
|
190
|
-
*/
|
|
191
|
-
checkAvailableQuickCommandSlug = this.query(removeAuthorizationParam(checkQuickCommandExistsV1QuickCommandsSlugExistsGet))
|
|
192
161
|
/**
|
|
193
162
|
* Lists the knowledge sources according to filters passed as parameter.
|
|
194
163
|
*/
|
|
@@ -205,10 +174,6 @@ class AIClient extends ReactQueryNetworkClient {
|
|
|
205
174
|
* Lists knowledge sources matching the provided IDs.
|
|
206
175
|
*/
|
|
207
176
|
searchKnowledgeSources = this.query(removeAuthorizationParam(searchKnowledgeSourcesV1KnowledgeSourcesSearchPost))
|
|
208
|
-
/**
|
|
209
|
-
* Finds Knowledge Source Dependencies
|
|
210
|
-
*/
|
|
211
|
-
dependenciesKnowledgeSources = this.query(removeAuthorizationParam(findKnowledgeSourceDependenciesV1KnowledgeSourcesSlugDependenciesGet))
|
|
212
177
|
/**
|
|
213
178
|
* Gets the chat history. This is a paginated resource.
|
|
214
179
|
*/
|
|
@@ -375,16 +340,15 @@ class AIClient extends ReactQueryNetworkClient {
|
|
|
375
340
|
deleteReviewComment = this.mutation(
|
|
376
341
|
removeAuthorizationParam(deleteReviewCommentV1ResourcesResourceTypeSlugResourceSlugReviewsReviewIdAnswersAnswerIdDelete))
|
|
377
342
|
|
|
378
|
-
private static async toolsOfAgent(agentId?: string
|
|
343
|
+
private static async toolsOfAgent(agentId?: string) {
|
|
379
344
|
try {
|
|
380
|
-
const agent = agentId ? await agentToolsClient.
|
|
381
|
-
agentCoreId: agentId, versionNumber: agent_version_number }) : undefined
|
|
345
|
+
const agent = agentId ? await agentToolsClient.agent.query({ agentId }) : undefined
|
|
382
346
|
if (!agent) return []
|
|
383
347
|
const tools: (Omit<ChatAgentTool, 'duration' | 'prompt' | 'output'>)[] = []
|
|
384
|
-
agent.
|
|
348
|
+
agent.toolkits?.builtin_toolkits?.forEach(kit => kit.tools?.forEach(({ id, name, description }) => {
|
|
385
349
|
if (id) tools.push({ image: kit.image_url, id, name: name || id, description })
|
|
386
350
|
}))
|
|
387
|
-
agent.
|
|
351
|
+
agent.toolkits?.custom_toolkits?.forEach(kit => kit.tools?.forEach(({ id, name, description }) => {
|
|
388
352
|
if (id) tools.push({ image: kit.avatar ?? undefined, id, name: name || id, description })
|
|
389
353
|
}))
|
|
390
354
|
return tools
|
|
@@ -416,7 +380,7 @@ class AIClient extends ReactQueryNetworkClient {
|
|
|
416
380
|
async function transform(event: Partial<FixedChatResponse>, data: Partial<ChatResponseWithSteps>) {
|
|
417
381
|
const info = event.agent_info
|
|
418
382
|
if (!info) return
|
|
419
|
-
const tools = await AIClient.toolsOfAgent(request.context?.agent_id
|
|
383
|
+
const tools = await AIClient.toolsOfAgent(request.context?.agent_id)
|
|
420
384
|
data.steps = data.steps ? [...data.steps] : []
|
|
421
385
|
|
|
422
386
|
if (info.type === 'planning' && info.action === 'end') {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
-
import {
|
|
2
|
+
import { AgentResponse } from '../api/agent'
|
|
3
3
|
import { CustomToolkitResponse } from '../api/agent-tools'
|
|
4
|
-
import { GetAiStackResponse, QuickCommandResponse } from '../api/ai'
|
|
5
|
-
import { KnowledgeSourceItemResponse } from '../api/dataIntegration'
|
|
4
|
+
import { GetAiStackResponse, KnowledgeSourceItemResponse, QuickCommandResponse } from '../api/ai'
|
|
6
5
|
import {
|
|
7
6
|
addContentV1WorkspacesWorkspaceIdContentTypePost,
|
|
8
|
-
addContentV2WorkspacesWorkspaceIdContentTypePost,
|
|
9
7
|
addFavoriteV1WorkspacesWorkspaceIdFavoritePost,
|
|
10
8
|
addPermissionV1ResourceTypeResourceTypeResourcesResourceIdentifierPatch,
|
|
11
9
|
addPermissionV1WorkspacesWorkspaceIdPermissionsPatch,
|
|
@@ -26,12 +24,13 @@ import {
|
|
|
26
24
|
updateWorkspaceV1WorkspacesWorkspaceIdPatch,
|
|
27
25
|
useShareableLinkV1ShareShareIdPatch,
|
|
28
26
|
} from '../api/workspace-ai'
|
|
29
|
-
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
30
|
-
import { wksAiDictionary } from '../error/dictionary/workspace-ai'
|
|
31
27
|
import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
32
28
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
33
29
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
34
|
-
import {
|
|
30
|
+
import { getApiAddresses } from '../api-addresses'
|
|
31
|
+
import { DefaultAPIError } from '../error/DefaultAPIError'
|
|
32
|
+
import { wksAiDictionary } from '../error/dictionary/workspace-ai'
|
|
33
|
+
import { FixedAddResourceToWorkspaceAi, FixedWorkspaceAiPermissions, ReplaceResult } from './types'
|
|
35
34
|
|
|
36
35
|
class WorkspaceAiClient extends ReactQueryNetworkClient {
|
|
37
36
|
constructor() {
|
|
@@ -49,7 +48,6 @@ class WorkspaceAiClient extends ReactQueryNetworkClient {
|
|
|
49
48
|
deleteWorkspaceAi = this.mutation(removeAuthorizationParam(deleteWorkspaceV1WorkspacesWorkspaceIdDelete))
|
|
50
49
|
|
|
51
50
|
/**
|
|
52
|
-
* @deprecated
|
|
53
51
|
* Adds a resource to the Spot.
|
|
54
52
|
*/
|
|
55
53
|
addResourceTypeToWorkspaceAi = this.mutation({
|
|
@@ -63,20 +61,6 @@ class WorkspaceAiClient extends ReactQueryNetworkClient {
|
|
|
63
61
|
permission: this.createPermissionFunctionFor(addContentV1WorkspacesWorkspaceIdContentTypePost),
|
|
64
62
|
})
|
|
65
63
|
|
|
66
|
-
/**
|
|
67
|
-
* V2 for adding a resource to the Spot.
|
|
68
|
-
*/
|
|
69
|
-
addResourceTypeV2ToSpot = this.mutation({
|
|
70
|
-
name: 'addResourceTypeToWorkspaceAi',
|
|
71
|
-
request: (
|
|
72
|
-
signal,
|
|
73
|
-
variables: Omit<Parameters<typeof addContentV2WorkspacesWorkspaceIdContentTypePost>[0], 'authorization'>,
|
|
74
|
-
) =>
|
|
75
|
-
addContentV2WorkspacesWorkspaceIdContentTypePost({ ...variables, authorization: '' },
|
|
76
|
-
{ signal }) as unknown as Promise<FixedAddResourceToWorkspaceAi>,
|
|
77
|
-
permission: this.createPermissionFunctionFor(addContentV2WorkspacesWorkspaceIdContentTypePost),
|
|
78
|
-
})
|
|
79
|
-
|
|
80
64
|
/**
|
|
81
65
|
* Lists all the knowledge sources in a Spot.
|
|
82
66
|
*/
|
|
@@ -133,7 +117,7 @@ class WorkspaceAiClient extends ReactQueryNetworkClient {
|
|
|
133
117
|
'authorization' | 'contentType'>,
|
|
134
118
|
) =>
|
|
135
119
|
listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet({ ...variables, contentType: 'agent', authorization: '' },
|
|
136
|
-
{ signal }) as unknown as Promise<
|
|
120
|
+
{ signal }) as unknown as Promise<AgentResponse[]>,
|
|
137
121
|
permission: this.createPermissionFunctionFor(listAllByContentTypeV1WorkspacesWorkspaceIdContentTypeGet),
|
|
138
122
|
})
|
|
139
123
|
|