@stack-spot/portal-network 0.183.0 → 0.184.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 +2412 -2405
- package/dist/api/account.js +1 -1
- package/dist/api/agent-tools.js +1 -1
- package/dist/api/agent.js +1 -1
- package/dist/api/ai.js +1 -1
- package/dist/api/apiManagement.js +1 -1
- package/dist/api/apiRuntime.js +1 -1
- package/dist/api/cloudAccount.js +1 -1
- package/dist/api/cloudPlatform.js +1 -1
- package/dist/api/cloudPlatformHorizon.js +1 -1
- package/dist/api/cloudRuntimes.js +1 -1
- package/dist/api/cloudServices.js +1 -1
- package/dist/api/codeShift.js +1 -1
- package/dist/api/content.js +1 -1
- package/dist/api/dataIntegration.js +1 -1
- package/dist/api/discover.js +1 -1
- package/dist/api/genAiInference.js +1 -1
- package/dist/api/insights.js +1 -1
- package/dist/api/notification.js +1 -1
- package/dist/api/secrets.js +1 -1
- package/dist/api/serviceCatalog.js +1 -1
- package/dist/api/workspace-ai.js +1 -1
- package/dist/api/workspace.js +1 -1
- package/dist/api/workspaceManager.d.ts +16 -10
- package/dist/api/workspaceManager.d.ts.map +1 -1
- package/dist/api/workspaceManager.js +11 -1
- package/dist/api/workspaceManager.js.map +1 -1
- package/dist/api/workspaceSearchEngine.js +1 -1
- package/dist/client/workspace-manager.d.ts +6 -0
- package/dist/client/workspace-manager.d.ts.map +1 -1
- package/dist/client/workspace-manager.js +10 -1
- package/dist/client/workspace-manager.js.map +1 -1
- package/package.json +6 -6
- package/scripts/generate-apis.ts +134 -134
- package/src/api/account.ts +8367 -8367
- package/src/api/agent-tools.ts +2169 -2169
- package/src/api/agent.ts +1083 -1083
- package/src/api/ai.ts +3388 -3388
- package/src/api/apiManagement.ts +570 -570
- package/src/api/apiRuntime.ts +2103 -2103
- package/src/api/cloudAccount.ts +1239 -1239
- package/src/api/cloudPlatform.ts +927 -927
- package/src/api/cloudPlatformHorizon.ts +2655 -2655
- package/src/api/cloudRuntimes.ts +2043 -2043
- package/src/api/cloudServices.ts +1445 -1445
- package/src/api/codeShift.ts +3481 -3481
- package/src/api/content.ts +9785 -9785
- package/src/api/dataIntegration.ts +1657 -1657
- package/src/api/discover.ts +435 -435
- package/src/api/eventBus.ts +171 -171
- package/src/api/genAiInference.ts +603 -603
- package/src/api/insights.ts +310 -310
- package/src/api/notification.ts +334 -334
- package/src/api/secrets.ts +342 -342
- package/src/api/serviceCatalog.ts +2908 -2908
- package/src/api/workflows.ts +1669 -1669
- package/src/api/workspace-ai.ts +677 -677
- package/src/api/workspace.ts +5889 -5889
- package/src/api/workspaceManager.ts +2951 -2936
- package/src/api/workspaceSearchEngine.ts +153 -153
- package/src/api-addresses.ts +120 -120
- package/src/apis-itau.json +225 -225
- package/src/apis.json +225 -225
- package/src/client/account.ts +902 -902
- package/src/client/agent-tools.ts +210 -210
- package/src/client/agent.ts +81 -81
- package/src/client/ai.ts +395 -395
- package/src/client/api-management.ts +40 -40
- package/src/client/cloud-account.ts +70 -70
- package/src/client/cloud-platform-horizon.ts +113 -113
- package/src/client/cloud-platform.ts +163 -163
- package/src/client/cloud-runtimes.ts +129 -129
- package/src/client/cloud-services.ts +94 -94
- package/src/client/code-shift.ts +349 -349
- package/src/client/content.ts +538 -538
- package/src/client/data-integration.ts +191 -191
- package/src/client/discover.ts +89 -89
- package/src/client/event-bus.ts +84 -84
- package/src/client/gen-ai-inference.ts +65 -65
- package/src/client/insights.ts +28 -28
- package/src/client/notification.ts +32 -32
- package/src/client/runtime-manager.ts +76 -76
- package/src/client/secrets.ts +60 -60
- package/src/client/types.ts +377 -377
- package/src/client/workflow.ts +83 -83
- package/src/client/workspace-ai.ts +191 -191
- package/src/client/workspace-manager.ts +564 -560
- package/src/client/workspace-search.ts +39 -39
- package/src/client/workspace.ts +480 -480
- package/src/error/DefaultAPIError.ts +151 -151
- package/src/error/FileUploadError.ts +18 -18
- package/src/error/IgnoredErrorCodes.ts +3 -3
- package/src/error/StackspotAPIError.ts +101 -101
- package/src/error/StreamCanceledError.ts +10 -10
- package/src/error/StreamError.ts +7 -7
- package/src/error/StreamJsonError.ts +10 -10
- package/src/error/dictionary/account.ts +58 -58
- package/src/error/dictionary/action-details.ts +20 -20
- package/src/error/dictionary/action.ts +211 -211
- package/src/error/dictionary/agent-tools.ts +75 -75
- package/src/error/dictionary/ai-inference.ts +28 -28
- package/src/error/dictionary/base.ts +22 -22
- package/src/error/dictionary/cloud-platform.ts +82 -82
- package/src/error/dictionary/cnt-fields.ts +14 -14
- package/src/error/dictionary/cnt.ts +103 -103
- package/src/error/dictionary/code-shift.ts +12 -12
- package/src/error/dictionary/rte.ts +24 -24
- package/src/error/dictionary/rtm.ts +10 -10
- package/src/error/dictionary/secrets.ts +14 -14
- package/src/error/dictionary/workspace-ai.ts +10 -10
- package/src/error/dictionary/workspace-details.ts +15 -15
- package/src/error/dictionary/workspace-fields.ts +10 -10
- package/src/error/dictionary/workspace.ts +209 -209
- package/src/error/types.ts +21 -21
- package/src/index.ts +43 -43
- package/src/network/AutoInfiniteQuery.ts +115 -115
- package/src/network/AutoMutation.ts +27 -27
- package/src/network/AutoOperation.ts +73 -73
- package/src/network/AutoQuery.ts +75 -75
- package/src/network/ManualInfiniteQuery.ts +95 -95
- package/src/network/ManualMutation.ts +40 -40
- package/src/network/ManualOperation.ts +52 -52
- package/src/network/ManualQuery.ts +82 -82
- package/src/network/NetworkClient.ts +167 -167
- package/src/network/ReactQueryNetworkClient.ts +312 -312
- package/src/network/react-query-client.ts +14 -14
- package/src/network/types.ts +294 -294
- package/src/types.ts +1 -1
- package/src/utils/StreamedArray.tsx +146 -146
- package/src/utils/StreamedJson.tsx +166 -166
- package/src/utils/remove-authorization-param.ts +6 -6
- package/src/utils/string.ts +19 -19
- package/src/utils/use-extended-list.ts +80 -80
- package/src/utils/use-streamed-array.ts +17 -17
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +10 -10
package/src/client/types.ts
CHANGED
|
@@ -1,377 +1,377 @@
|
|
|
1
|
-
import { RequestOpts } from '@oazapfts/runtime'
|
|
2
|
-
import { AccountScmInfoSaveRequest, AccountScmInfoUpdateRequest, AccountScmStatusResponse, GroupsFromResourceResponse, MembersFromResourceResponse } from '../api/account'
|
|
3
|
-
import { AgentVisibilityLevelEnum, HttpMethod, ListAgentResponse, VisibilityLevelEnum } from '../api/agent-tools'
|
|
4
|
-
import { ChatRequest, ChatResponse3, ContentDependencyResponse, ConversationHistoryResponse, ConversationResponse, DependencyResponse } from '../api/ai'
|
|
5
|
-
import { ConnectAccountRequestV2, ManagedAccountProvisionRequest } from '../api/cloudAccount'
|
|
6
|
-
import { AllocationCostRequest, AllocationCostResponse, ChargePeriod, getAllocationCostFilters, ManagedService, ServiceResource } from '../api/cloudServices'
|
|
7
|
-
import { Action } from '../api/workspace-ai'
|
|
8
|
-
import { ActivityResponse, FullInputContextResponse, InputConditionResponse, InputValuesContextResponse, PaginatedActivityResponse, PluginForAppCreationV2Response, PluginInputValuesInConsolidatedContextResponse, ValueByEnvResponse, WorkflowForCreationResponse } from '../api/workspaceManager'
|
|
9
|
-
|
|
10
|
-
interface BaseSMCStatus {
|
|
11
|
-
/**
|
|
12
|
-
* Indicates the current status of the SCM credential.
|
|
13
|
-
* - 'valid': the SCM credential is valid.
|
|
14
|
-
* - 'missing-account': the SCM credential is not configured at the account level.
|
|
15
|
-
* - 'missing-user': the SCM credential is configured at the account level, but the SCM access is not configured for the user.
|
|
16
|
-
*/
|
|
17
|
-
status: 'missing-account' | 'missing-user' | 'valid',
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface ValidSCMStatus extends BaseSMCStatus, AccountScmStatusResponse {
|
|
21
|
-
status: 'valid',
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface InvalidSCMStatus extends BaseSMCStatus {
|
|
25
|
-
status: 'missing-account' | 'missing-user',
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export type SCMStatus = InvalidSCMStatus | ValidSCMStatus
|
|
29
|
-
|
|
30
|
-
interface SCMAuthPATValue {
|
|
31
|
-
user: string,
|
|
32
|
-
pass: string,
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface SCMAuthGitValue {
|
|
36
|
-
appId: string,
|
|
37
|
-
installationId: string,
|
|
38
|
-
privateKey: string,
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface CreateSCMRequest {
|
|
42
|
-
accountScmInfoSaveRequest: AccountScmInfoSaveRequest & {
|
|
43
|
-
value: SCMAuthGitValue | SCMAuthPATValue,
|
|
44
|
-
},
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export interface UpdateSCMRequest {
|
|
48
|
-
accountScmInfoUpdateRequest: AccountScmInfoUpdateRequest & {
|
|
49
|
-
value?: SCMAuthGitValue | SCMAuthPATValue,
|
|
50
|
-
},
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export type AllocationCostType = Parameters<typeof getAllocationCostFilters>[0]['$type']
|
|
54
|
-
|
|
55
|
-
export interface CostAllocationVariables {
|
|
56
|
-
allocationCostRequest: Omit<AllocationCostRequest, 'stackSpotAccountId' | 'billingAccountId'> & {
|
|
57
|
-
stackSpotAccountId: string,
|
|
58
|
-
billingAccountId: string[],
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
interface ServiceNameResponse {
|
|
63
|
-
type: 'ServiceNameResponse',
|
|
64
|
-
chargePeriod?: ChargePeriod,
|
|
65
|
-
/** Represents an offering that can be purchased from a cloud provider. */
|
|
66
|
-
serviceName?: string,
|
|
67
|
-
/** Effective cost post discounts and amortizations. */
|
|
68
|
-
effectiveCost?: number,
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
interface TagResponse {
|
|
72
|
-
type: 'TagResponse',
|
|
73
|
-
chargePeriod?: ChargePeriod,
|
|
74
|
-
/** Tag key: Identifies a grouping attribute or category for resources or constructs. */
|
|
75
|
-
tagKey?: string,
|
|
76
|
-
/** Tag value: Specifies the group or category detail that the resource or construct belongs to. */
|
|
77
|
-
tagValue?: string,
|
|
78
|
-
/** Effective cost post discounts and amortizations. */
|
|
79
|
-
effectiveCost?: number,
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
interface UsageUnitResponse {
|
|
83
|
-
type: 'UsageUnitResponse',
|
|
84
|
-
chargePeriod?: ChargePeriod,
|
|
85
|
-
/** Represents an offering that can be purchased from a cloud provider. */
|
|
86
|
-
serviceName?: string,
|
|
87
|
-
/** Represents the volume of a given resource or service used or purchased based on the Usage Unit. */
|
|
88
|
-
usageQuantity?: number,
|
|
89
|
-
/** Defines the unit of measurement for the resource or service. */
|
|
90
|
-
usageUnit?: string,
|
|
91
|
-
/** Effective cost post discounts and amortizations. */
|
|
92
|
-
effectiveCost?: number,
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export type CostAllocationData = ServiceNameResponse | TagResponse | UsageUnitResponse
|
|
96
|
-
|
|
97
|
-
export interface CostAllocationResult extends Omit<AllocationCostResponse, 'data'> {
|
|
98
|
-
data: CostAllocationData[],
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
interface FixedServiceResource extends Omit<ServiceResource, 'id'> {
|
|
102
|
-
id: string,
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface FixedManagedService extends Omit<ManagedService, 'resources'> {
|
|
106
|
-
resources: FixedServiceResource[],
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export interface FixedConnectAccountRequestV2 extends ConnectAccountRequestV2 {
|
|
110
|
-
credential?: {
|
|
111
|
-
iamRole?: string,
|
|
112
|
-
clientId?: string,
|
|
113
|
-
clientSecret?: string,
|
|
114
|
-
tenantId?: string,
|
|
115
|
-
subscriptionId?: string,
|
|
116
|
-
},
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export interface FixedManagedAccountProvisionRequest extends Omit<ManagedAccountProvisionRequest, 'workspaceId'> {
|
|
120
|
-
workspaceId: string,
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export interface FixedPluginForAppCreationV2Response extends Omit<PluginForAppCreationV2Response, 'inputs'> {
|
|
124
|
-
inputs: FixedPluginInputValuesInConsolidatedContextResponse[],
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export type InputType = 'BOOL' | 'INT' | 'MULTISELECT' | 'OBJECT' | 'LIST' | 'REQUIRED-CONNECTION' | 'PASSWORD' |
|
|
128
|
-
'SELECT' | 'TEXT' | 'GENERATED-CONNECTION' | 'TEXTAREA' | 'IMPORT'
|
|
129
|
-
|
|
130
|
-
export interface FixedInputConditionResponse extends Omit<InputConditionResponse, 'value'> {
|
|
131
|
-
value?: any,
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export interface FixedValueByEnvResponse extends Omit<ValueByEnvResponse, 'value'> {
|
|
135
|
-
value: any,
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export interface FixedInputValuesContextResponse extends Omit<InputValuesContextResponse,
|
|
139
|
-
'inputs' | 'input' | 'type' | 'default' | 'condition' | 'valuesByEnv'> {
|
|
140
|
-
inputs: Omit<FixedInputValuesContextResponse, 'valuesByEnv'>[],
|
|
141
|
-
input?: Omit<FixedInputValuesContextResponse, 'valuesByEnv'>,
|
|
142
|
-
type: InputType,
|
|
143
|
-
default?: any,
|
|
144
|
-
condition?: FixedInputConditionResponse,
|
|
145
|
-
valuesByEnv: FixedValueByEnvResponse[],
|
|
146
|
-
scope?: 'default' | 'hidden' | 'env',
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export interface FixedFullInputContextResponse extends Omit<FullInputContextResponse, 'inputs'> {
|
|
150
|
-
inputs: FixedInputValuesContextResponse[],
|
|
151
|
-
}
|
|
152
|
-
export interface FixedWorkflowForCreationResponse extends Omit<WorkflowForCreationResponse, 'inputs'> {
|
|
153
|
-
inputs: FixedInputValuesContextResponse[],
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface FixedPluginInputValuesInConsolidatedContextResponse extends
|
|
157
|
-
Omit<PluginInputValuesInConsolidatedContextResponse, 'inputs' | 'input' | 'type' | 'default' | 'condition'> {
|
|
158
|
-
inputs: FixedInputValuesContextResponse[],
|
|
159
|
-
input?: FixedInputValuesContextResponse,
|
|
160
|
-
type: InputType,
|
|
161
|
-
default?: any,
|
|
162
|
-
condition?: FixedInputConditionResponse,
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export interface FixedActivityResponse extends Omit<ActivityResponse, 'detail'> {
|
|
166
|
-
detail: any,
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export interface FixedPaginatedActivityResponse extends Omit<PaginatedActivityResponse, 'items'> {
|
|
170
|
-
items: FixedActivityResponse[],
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export interface FixedChatRequest extends ChatRequest {
|
|
174
|
-
context?: {
|
|
175
|
-
workspace?: string,
|
|
176
|
-
conversation_id?: string,
|
|
177
|
-
stack_id?: string,
|
|
178
|
-
language?: string,
|
|
179
|
-
project_recent_files?: string,
|
|
180
|
-
knowledge_sources?: string[],
|
|
181
|
-
agent_id?: string,
|
|
182
|
-
agent_built_in?: boolean,
|
|
183
|
-
platform?: string,
|
|
184
|
-
platform_version?: string,
|
|
185
|
-
stackspot_ai_version?: string,
|
|
186
|
-
os?: string,
|
|
187
|
-
upload_ids?: string[],
|
|
188
|
-
},
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export interface FixedConversationHistoryResponse extends ConversationHistoryResponse {
|
|
192
|
-
sources: ChatResponse3['sources'],
|
|
193
|
-
custom_agent?: {
|
|
194
|
-
id: string,
|
|
195
|
-
built_in: boolean,
|
|
196
|
-
},
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export interface FixedConversationResponse extends ConversationResponse {
|
|
200
|
-
history?: FixedConversationHistoryResponse[],
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export interface FixedContentDependencyResponse extends ContentDependencyResponse {
|
|
204
|
-
type: 'agent' | 'knowledge-source' | 'quick-command',
|
|
205
|
-
visibility: 'account' | 'personal' | 'shared',
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export interface FixedDependencyResponse extends DependencyResponse {
|
|
209
|
-
promote_contents?: FixedContentDependencyResponse[] | null,
|
|
210
|
-
promote_error_list?: FixedContentDependencyResponse[] | null,
|
|
211
|
-
missing_list?: FixedContentDependencyResponse[] | null,
|
|
212
|
-
delete_contents?: FixedContentDependencyResponse[] | null,
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export interface WorkspaceAiMembersPermissions {
|
|
216
|
-
items: (MembersFromResourceResponse & { actions: Action[] })[],
|
|
217
|
-
page: number,
|
|
218
|
-
size: number,
|
|
219
|
-
totalPages: number,
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
export interface WorkspaceAiGroupsPermissions extends GroupsFromResourceResponse {
|
|
224
|
-
actions: Action[],
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
export interface FixedWorkspaceAiPermissions {
|
|
228
|
-
members?: WorkspaceAiMembersPermissions,
|
|
229
|
-
groups?: WorkspaceAiGroupsPermissions[],
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export interface FixedAddResourceToWorkspaceAi {
|
|
233
|
-
error_ids: string[],
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
export interface ChatAgentTool {
|
|
237
|
-
id: string,
|
|
238
|
-
executionId?: string,
|
|
239
|
-
/**
|
|
240
|
-
* Duration in seconds.
|
|
241
|
-
*/
|
|
242
|
-
duration?: number,
|
|
243
|
-
name: string,
|
|
244
|
-
description?: string,
|
|
245
|
-
image?: string,
|
|
246
|
-
input?: string,
|
|
247
|
-
output?: string,
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
export interface ChatStepAttempt {
|
|
251
|
-
/**
|
|
252
|
-
* The tools used by this step.
|
|
253
|
-
*/
|
|
254
|
-
tools?: ChatAgentTool[],
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export interface BaseChatStep {
|
|
258
|
-
id: string,
|
|
259
|
-
type: 'planning' | 'step' | 'answer',
|
|
260
|
-
status: 'pending' | 'running' | 'success' | 'error',
|
|
261
|
-
/**
|
|
262
|
-
* Duration in seconds.
|
|
263
|
-
*/
|
|
264
|
-
duration?: number,
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
export interface PlanningChatStep extends BaseChatStep {
|
|
268
|
-
type: 'planning',
|
|
269
|
-
status: 'success',
|
|
270
|
-
steps: string[],
|
|
271
|
-
goal: string,
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export interface StepChatStep extends BaseChatStep {
|
|
275
|
-
type: 'step',
|
|
276
|
-
/**
|
|
277
|
-
* Each step might attempt to run for multiple times, with different inputs and outputs. If first attempt succeeds, this array will have
|
|
278
|
-
* only one element.
|
|
279
|
-
*
|
|
280
|
-
* This array never has less than one element, despite the step's status.
|
|
281
|
-
*/
|
|
282
|
-
attempts: ChatStepAttempt[],
|
|
283
|
-
input?: string,
|
|
284
|
-
output?: string,
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export interface AnswerChatStep extends BaseChatStep {
|
|
288
|
-
type: 'answer',
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
export type ChatStep = PlanningChatStep | StepChatStep | AnswerChatStep
|
|
292
|
-
|
|
293
|
-
export interface BaseAgentInfo {
|
|
294
|
-
type: 'chat' | 'planning' | 'step' | 'tool' | 'final_answer',
|
|
295
|
-
action: 'start' | 'end',
|
|
296
|
-
duration?: number,
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
export interface AgentTool {
|
|
300
|
-
tool_id: string,
|
|
301
|
-
tool_execution_id: string,
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export interface PlanningAgentInfo extends BaseAgentInfo {
|
|
305
|
-
type: 'planning',
|
|
306
|
-
data?: {
|
|
307
|
-
plan_goal: string,
|
|
308
|
-
total_steps: number,
|
|
309
|
-
steps: {
|
|
310
|
-
id: string,
|
|
311
|
-
goal: string,
|
|
312
|
-
tools?: AgentTool[],
|
|
313
|
-
}[],
|
|
314
|
-
},
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
export interface StepAgentInfo extends BaseAgentInfo {
|
|
318
|
-
type: 'step',
|
|
319
|
-
id: string,
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export interface ToolAgentInfo extends BaseAgentInfo {
|
|
323
|
-
type: 'tool',
|
|
324
|
-
id: string,
|
|
325
|
-
data?: {
|
|
326
|
-
input?: any,
|
|
327
|
-
attempt: number,
|
|
328
|
-
output?: string,
|
|
329
|
-
},
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export interface GenericAgentInfo extends BaseAgentInfo {
|
|
333
|
-
type: 'chat' | 'final_answer',
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export type AgentInfo = GenericAgentInfo | PlanningAgentInfo | StepAgentInfo | ToolAgentInfo
|
|
337
|
-
|
|
338
|
-
export interface FixedChatResponse extends ChatResponse3 {
|
|
339
|
-
agent_info: AgentInfo,
|
|
340
|
-
tools?: string[],
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export interface ChatResponseWithSteps extends FixedChatResponse {
|
|
344
|
-
steps: ChatStep[],
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
export type OazapftsFunction<Variables = any, Result = any> = (variables: Variables, opts?: RequestOpts) => Promise<Result>
|
|
348
|
-
|
|
349
|
-
type Unpromisify<T> = T extends Promise<infer R> ? Unpromisify<R> : T
|
|
350
|
-
|
|
351
|
-
export type FixVariables<
|
|
352
|
-
T extends OazapftsFunction,
|
|
353
|
-
Fix extends Record<string, any>,
|
|
354
|
-
> = OazapftsFunction<
|
|
355
|
-
Omit<Parameters<T>[0], keyof Fix> & { [K in keyof Fix as Fix[K] extends never ? never : K]: Fix[K] },
|
|
356
|
-
Unpromisify<ReturnType<T>>
|
|
357
|
-
>
|
|
358
|
-
|
|
359
|
-
export type ReplaceResult<T extends (...args: any[]) => Promise<any>, Fix> = (...args: Parameters<T>) => Promise<Fix>
|
|
360
|
-
|
|
361
|
-
export interface AgentResponseWithBuiltIn extends Omit<ListAgentResponse, 'conversation_starter' | 'avatar'> {
|
|
362
|
-
builtIn?: boolean,
|
|
363
|
-
spaceName?: string,
|
|
364
|
-
conversation_starter?: string[] | null,
|
|
365
|
-
avatar?: string | null | undefined,
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
export type AgentVisibilityLevel = AgentVisibilityLevelEnum | VisibilityLevelEnum
|
|
369
|
-
|
|
370
|
-
export interface AgentToolsOpenAPIPreview {
|
|
371
|
-
name: string,
|
|
372
|
-
description: string,
|
|
373
|
-
method: HttpMethod,
|
|
374
|
-
url: string,
|
|
375
|
-
parameters?: Record<string, any>,
|
|
376
|
-
request_body?: Record<string, any>,
|
|
377
|
-
}
|
|
1
|
+
import { RequestOpts } from '@oazapfts/runtime'
|
|
2
|
+
import { AccountScmInfoSaveRequest, AccountScmInfoUpdateRequest, AccountScmStatusResponse, GroupsFromResourceResponse, MembersFromResourceResponse } from '../api/account'
|
|
3
|
+
import { AgentVisibilityLevelEnum, HttpMethod, ListAgentResponse, VisibilityLevelEnum } from '../api/agent-tools'
|
|
4
|
+
import { ChatRequest, ChatResponse3, ContentDependencyResponse, ConversationHistoryResponse, ConversationResponse, DependencyResponse } from '../api/ai'
|
|
5
|
+
import { ConnectAccountRequestV2, ManagedAccountProvisionRequest } from '../api/cloudAccount'
|
|
6
|
+
import { AllocationCostRequest, AllocationCostResponse, ChargePeriod, getAllocationCostFilters, ManagedService, ServiceResource } from '../api/cloudServices'
|
|
7
|
+
import { Action } from '../api/workspace-ai'
|
|
8
|
+
import { ActivityResponse, FullInputContextResponse, InputConditionResponse, InputValuesContextResponse, PaginatedActivityResponse, PluginForAppCreationV2Response, PluginInputValuesInConsolidatedContextResponse, ValueByEnvResponse, WorkflowForCreationResponse } from '../api/workspaceManager'
|
|
9
|
+
|
|
10
|
+
interface BaseSMCStatus {
|
|
11
|
+
/**
|
|
12
|
+
* Indicates the current status of the SCM credential.
|
|
13
|
+
* - 'valid': the SCM credential is valid.
|
|
14
|
+
* - 'missing-account': the SCM credential is not configured at the account level.
|
|
15
|
+
* - 'missing-user': the SCM credential is configured at the account level, but the SCM access is not configured for the user.
|
|
16
|
+
*/
|
|
17
|
+
status: 'missing-account' | 'missing-user' | 'valid',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface ValidSCMStatus extends BaseSMCStatus, AccountScmStatusResponse {
|
|
21
|
+
status: 'valid',
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface InvalidSCMStatus extends BaseSMCStatus {
|
|
25
|
+
status: 'missing-account' | 'missing-user',
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type SCMStatus = InvalidSCMStatus | ValidSCMStatus
|
|
29
|
+
|
|
30
|
+
interface SCMAuthPATValue {
|
|
31
|
+
user: string,
|
|
32
|
+
pass: string,
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface SCMAuthGitValue {
|
|
36
|
+
appId: string,
|
|
37
|
+
installationId: string,
|
|
38
|
+
privateKey: string,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface CreateSCMRequest {
|
|
42
|
+
accountScmInfoSaveRequest: AccountScmInfoSaveRequest & {
|
|
43
|
+
value: SCMAuthGitValue | SCMAuthPATValue,
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface UpdateSCMRequest {
|
|
48
|
+
accountScmInfoUpdateRequest: AccountScmInfoUpdateRequest & {
|
|
49
|
+
value?: SCMAuthGitValue | SCMAuthPATValue,
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type AllocationCostType = Parameters<typeof getAllocationCostFilters>[0]['$type']
|
|
54
|
+
|
|
55
|
+
export interface CostAllocationVariables {
|
|
56
|
+
allocationCostRequest: Omit<AllocationCostRequest, 'stackSpotAccountId' | 'billingAccountId'> & {
|
|
57
|
+
stackSpotAccountId: string,
|
|
58
|
+
billingAccountId: string[],
|
|
59
|
+
},
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
interface ServiceNameResponse {
|
|
63
|
+
type: 'ServiceNameResponse',
|
|
64
|
+
chargePeriod?: ChargePeriod,
|
|
65
|
+
/** Represents an offering that can be purchased from a cloud provider. */
|
|
66
|
+
serviceName?: string,
|
|
67
|
+
/** Effective cost post discounts and amortizations. */
|
|
68
|
+
effectiveCost?: number,
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
interface TagResponse {
|
|
72
|
+
type: 'TagResponse',
|
|
73
|
+
chargePeriod?: ChargePeriod,
|
|
74
|
+
/** Tag key: Identifies a grouping attribute or category for resources or constructs. */
|
|
75
|
+
tagKey?: string,
|
|
76
|
+
/** Tag value: Specifies the group or category detail that the resource or construct belongs to. */
|
|
77
|
+
tagValue?: string,
|
|
78
|
+
/** Effective cost post discounts and amortizations. */
|
|
79
|
+
effectiveCost?: number,
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
interface UsageUnitResponse {
|
|
83
|
+
type: 'UsageUnitResponse',
|
|
84
|
+
chargePeriod?: ChargePeriod,
|
|
85
|
+
/** Represents an offering that can be purchased from a cloud provider. */
|
|
86
|
+
serviceName?: string,
|
|
87
|
+
/** Represents the volume of a given resource or service used or purchased based on the Usage Unit. */
|
|
88
|
+
usageQuantity?: number,
|
|
89
|
+
/** Defines the unit of measurement for the resource or service. */
|
|
90
|
+
usageUnit?: string,
|
|
91
|
+
/** Effective cost post discounts and amortizations. */
|
|
92
|
+
effectiveCost?: number,
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export type CostAllocationData = ServiceNameResponse | TagResponse | UsageUnitResponse
|
|
96
|
+
|
|
97
|
+
export interface CostAllocationResult extends Omit<AllocationCostResponse, 'data'> {
|
|
98
|
+
data: CostAllocationData[],
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
interface FixedServiceResource extends Omit<ServiceResource, 'id'> {
|
|
102
|
+
id: string,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface FixedManagedService extends Omit<ManagedService, 'resources'> {
|
|
106
|
+
resources: FixedServiceResource[],
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface FixedConnectAccountRequestV2 extends ConnectAccountRequestV2 {
|
|
110
|
+
credential?: {
|
|
111
|
+
iamRole?: string,
|
|
112
|
+
clientId?: string,
|
|
113
|
+
clientSecret?: string,
|
|
114
|
+
tenantId?: string,
|
|
115
|
+
subscriptionId?: string,
|
|
116
|
+
},
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface FixedManagedAccountProvisionRequest extends Omit<ManagedAccountProvisionRequest, 'workspaceId'> {
|
|
120
|
+
workspaceId: string,
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface FixedPluginForAppCreationV2Response extends Omit<PluginForAppCreationV2Response, 'inputs'> {
|
|
124
|
+
inputs: FixedPluginInputValuesInConsolidatedContextResponse[],
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export type InputType = 'BOOL' | 'INT' | 'MULTISELECT' | 'OBJECT' | 'LIST' | 'REQUIRED-CONNECTION' | 'PASSWORD' |
|
|
128
|
+
'SELECT' | 'TEXT' | 'GENERATED-CONNECTION' | 'TEXTAREA' | 'IMPORT'
|
|
129
|
+
|
|
130
|
+
export interface FixedInputConditionResponse extends Omit<InputConditionResponse, 'value'> {
|
|
131
|
+
value?: any,
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface FixedValueByEnvResponse extends Omit<ValueByEnvResponse, 'value'> {
|
|
135
|
+
value: any,
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface FixedInputValuesContextResponse extends Omit<InputValuesContextResponse,
|
|
139
|
+
'inputs' | 'input' | 'type' | 'default' | 'condition' | 'valuesByEnv'> {
|
|
140
|
+
inputs: Omit<FixedInputValuesContextResponse, 'valuesByEnv'>[],
|
|
141
|
+
input?: Omit<FixedInputValuesContextResponse, 'valuesByEnv'>,
|
|
142
|
+
type: InputType,
|
|
143
|
+
default?: any,
|
|
144
|
+
condition?: FixedInputConditionResponse,
|
|
145
|
+
valuesByEnv: FixedValueByEnvResponse[],
|
|
146
|
+
scope?: 'default' | 'hidden' | 'env',
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface FixedFullInputContextResponse extends Omit<FullInputContextResponse, 'inputs'> {
|
|
150
|
+
inputs: FixedInputValuesContextResponse[],
|
|
151
|
+
}
|
|
152
|
+
export interface FixedWorkflowForCreationResponse extends Omit<WorkflowForCreationResponse, 'inputs'> {
|
|
153
|
+
inputs: FixedInputValuesContextResponse[],
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface FixedPluginInputValuesInConsolidatedContextResponse extends
|
|
157
|
+
Omit<PluginInputValuesInConsolidatedContextResponse, 'inputs' | 'input' | 'type' | 'default' | 'condition'> {
|
|
158
|
+
inputs: FixedInputValuesContextResponse[],
|
|
159
|
+
input?: FixedInputValuesContextResponse,
|
|
160
|
+
type: InputType,
|
|
161
|
+
default?: any,
|
|
162
|
+
condition?: FixedInputConditionResponse,
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export interface FixedActivityResponse extends Omit<ActivityResponse, 'detail'> {
|
|
166
|
+
detail: any,
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface FixedPaginatedActivityResponse extends Omit<PaginatedActivityResponse, 'items'> {
|
|
170
|
+
items: FixedActivityResponse[],
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface FixedChatRequest extends ChatRequest {
|
|
174
|
+
context?: {
|
|
175
|
+
workspace?: string,
|
|
176
|
+
conversation_id?: string,
|
|
177
|
+
stack_id?: string,
|
|
178
|
+
language?: string,
|
|
179
|
+
project_recent_files?: string,
|
|
180
|
+
knowledge_sources?: string[],
|
|
181
|
+
agent_id?: string,
|
|
182
|
+
agent_built_in?: boolean,
|
|
183
|
+
platform?: string,
|
|
184
|
+
platform_version?: string,
|
|
185
|
+
stackspot_ai_version?: string,
|
|
186
|
+
os?: string,
|
|
187
|
+
upload_ids?: string[],
|
|
188
|
+
},
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface FixedConversationHistoryResponse extends ConversationHistoryResponse {
|
|
192
|
+
sources: ChatResponse3['sources'],
|
|
193
|
+
custom_agent?: {
|
|
194
|
+
id: string,
|
|
195
|
+
built_in: boolean,
|
|
196
|
+
},
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface FixedConversationResponse extends ConversationResponse {
|
|
200
|
+
history?: FixedConversationHistoryResponse[],
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface FixedContentDependencyResponse extends ContentDependencyResponse {
|
|
204
|
+
type: 'agent' | 'knowledge-source' | 'quick-command',
|
|
205
|
+
visibility: 'account' | 'personal' | 'shared',
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface FixedDependencyResponse extends DependencyResponse {
|
|
209
|
+
promote_contents?: FixedContentDependencyResponse[] | null,
|
|
210
|
+
promote_error_list?: FixedContentDependencyResponse[] | null,
|
|
211
|
+
missing_list?: FixedContentDependencyResponse[] | null,
|
|
212
|
+
delete_contents?: FixedContentDependencyResponse[] | null,
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface WorkspaceAiMembersPermissions {
|
|
216
|
+
items: (MembersFromResourceResponse & { actions: Action[] })[],
|
|
217
|
+
page: number,
|
|
218
|
+
size: number,
|
|
219
|
+
totalPages: number,
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
export interface WorkspaceAiGroupsPermissions extends GroupsFromResourceResponse {
|
|
224
|
+
actions: Action[],
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface FixedWorkspaceAiPermissions {
|
|
228
|
+
members?: WorkspaceAiMembersPermissions,
|
|
229
|
+
groups?: WorkspaceAiGroupsPermissions[],
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export interface FixedAddResourceToWorkspaceAi {
|
|
233
|
+
error_ids: string[],
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
export interface ChatAgentTool {
|
|
237
|
+
id: string,
|
|
238
|
+
executionId?: string,
|
|
239
|
+
/**
|
|
240
|
+
* Duration in seconds.
|
|
241
|
+
*/
|
|
242
|
+
duration?: number,
|
|
243
|
+
name: string,
|
|
244
|
+
description?: string,
|
|
245
|
+
image?: string,
|
|
246
|
+
input?: string,
|
|
247
|
+
output?: string,
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
export interface ChatStepAttempt {
|
|
251
|
+
/**
|
|
252
|
+
* The tools used by this step.
|
|
253
|
+
*/
|
|
254
|
+
tools?: ChatAgentTool[],
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface BaseChatStep {
|
|
258
|
+
id: string,
|
|
259
|
+
type: 'planning' | 'step' | 'answer',
|
|
260
|
+
status: 'pending' | 'running' | 'success' | 'error',
|
|
261
|
+
/**
|
|
262
|
+
* Duration in seconds.
|
|
263
|
+
*/
|
|
264
|
+
duration?: number,
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export interface PlanningChatStep extends BaseChatStep {
|
|
268
|
+
type: 'planning',
|
|
269
|
+
status: 'success',
|
|
270
|
+
steps: string[],
|
|
271
|
+
goal: string,
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface StepChatStep extends BaseChatStep {
|
|
275
|
+
type: 'step',
|
|
276
|
+
/**
|
|
277
|
+
* Each step might attempt to run for multiple times, with different inputs and outputs. If first attempt succeeds, this array will have
|
|
278
|
+
* only one element.
|
|
279
|
+
*
|
|
280
|
+
* This array never has less than one element, despite the step's status.
|
|
281
|
+
*/
|
|
282
|
+
attempts: ChatStepAttempt[],
|
|
283
|
+
input?: string,
|
|
284
|
+
output?: string,
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface AnswerChatStep extends BaseChatStep {
|
|
288
|
+
type: 'answer',
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export type ChatStep = PlanningChatStep | StepChatStep | AnswerChatStep
|
|
292
|
+
|
|
293
|
+
export interface BaseAgentInfo {
|
|
294
|
+
type: 'chat' | 'planning' | 'step' | 'tool' | 'final_answer',
|
|
295
|
+
action: 'start' | 'end',
|
|
296
|
+
duration?: number,
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export interface AgentTool {
|
|
300
|
+
tool_id: string,
|
|
301
|
+
tool_execution_id: string,
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
export interface PlanningAgentInfo extends BaseAgentInfo {
|
|
305
|
+
type: 'planning',
|
|
306
|
+
data?: {
|
|
307
|
+
plan_goal: string,
|
|
308
|
+
total_steps: number,
|
|
309
|
+
steps: {
|
|
310
|
+
id: string,
|
|
311
|
+
goal: string,
|
|
312
|
+
tools?: AgentTool[],
|
|
313
|
+
}[],
|
|
314
|
+
},
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export interface StepAgentInfo extends BaseAgentInfo {
|
|
318
|
+
type: 'step',
|
|
319
|
+
id: string,
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export interface ToolAgentInfo extends BaseAgentInfo {
|
|
323
|
+
type: 'tool',
|
|
324
|
+
id: string,
|
|
325
|
+
data?: {
|
|
326
|
+
input?: any,
|
|
327
|
+
attempt: number,
|
|
328
|
+
output?: string,
|
|
329
|
+
},
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface GenericAgentInfo extends BaseAgentInfo {
|
|
333
|
+
type: 'chat' | 'final_answer',
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
export type AgentInfo = GenericAgentInfo | PlanningAgentInfo | StepAgentInfo | ToolAgentInfo
|
|
337
|
+
|
|
338
|
+
export interface FixedChatResponse extends ChatResponse3 {
|
|
339
|
+
agent_info: AgentInfo,
|
|
340
|
+
tools?: string[],
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export interface ChatResponseWithSteps extends FixedChatResponse {
|
|
344
|
+
steps: ChatStep[],
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export type OazapftsFunction<Variables = any, Result = any> = (variables: Variables, opts?: RequestOpts) => Promise<Result>
|
|
348
|
+
|
|
349
|
+
type Unpromisify<T> = T extends Promise<infer R> ? Unpromisify<R> : T
|
|
350
|
+
|
|
351
|
+
export type FixVariables<
|
|
352
|
+
T extends OazapftsFunction,
|
|
353
|
+
Fix extends Record<string, any>,
|
|
354
|
+
> = OazapftsFunction<
|
|
355
|
+
Omit<Parameters<T>[0], keyof Fix> & { [K in keyof Fix as Fix[K] extends never ? never : K]: Fix[K] },
|
|
356
|
+
Unpromisify<ReturnType<T>>
|
|
357
|
+
>
|
|
358
|
+
|
|
359
|
+
export type ReplaceResult<T extends (...args: any[]) => Promise<any>, Fix> = (...args: Parameters<T>) => Promise<Fix>
|
|
360
|
+
|
|
361
|
+
export interface AgentResponseWithBuiltIn extends Omit<ListAgentResponse, 'conversation_starter' | 'avatar'> {
|
|
362
|
+
builtIn?: boolean,
|
|
363
|
+
spaceName?: string,
|
|
364
|
+
conversation_starter?: string[] | null,
|
|
365
|
+
avatar?: string | null | undefined,
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export type AgentVisibilityLevel = AgentVisibilityLevelEnum | VisibilityLevelEnum
|
|
369
|
+
|
|
370
|
+
export interface AgentToolsOpenAPIPreview {
|
|
371
|
+
name: string,
|
|
372
|
+
description: string,
|
|
373
|
+
method: HttpMethod,
|
|
374
|
+
url: string,
|
|
375
|
+
parameters?: Record<string, any>,
|
|
376
|
+
request_body?: Record<string, any>,
|
|
377
|
+
}
|