@stack-spot/portal-network 1.0.0-dev.1769117840606 → 1.0.0-dev.1769783915267
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 +42 -0
- package/dist/api/accountAssetManager.d.ts +1 -0
- package/dist/api/accountAssetManager.d.ts.map +1 -1
- package/dist/api/accountAssetManager.js.map +1 -1
- package/dist/api/cloudPlatform.d.ts +79 -33
- package/dist/api/cloudPlatform.d.ts.map +1 -1
- package/dist/api/cloudPlatform.js +86 -76
- package/dist/api/cloudPlatform.js.map +1 -1
- package/dist/api/codeShift.d.ts +7 -3
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +3 -2
- package/dist/api/codeShift.js.map +1 -1
- package/dist/api/genAiInference.d.ts +49 -2
- package/dist/api/genAiInference.d.ts.map +1 -1
- package/dist/api/genAiInference.js +55 -2
- package/dist/api/genAiInference.js.map +1 -1
- package/dist/apis.json +3 -3
- package/dist/client/account.d.ts +16 -0
- package/dist/client/account.d.ts.map +1 -1
- package/dist/client/account.js +9 -0
- package/dist/client/account.js.map +1 -1
- package/dist/client/ai.d.ts +1 -3
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +1 -251
- package/dist/client/ai.js.map +1 -1
- package/dist/client/cloud-platform.d.ts +4 -12
- package/dist/client/cloud-platform.d.ts.map +1 -1
- package/dist/client/cloud-platform.js +5 -14
- package/dist/client/cloud-platform.js.map +1 -1
- package/dist/client/code-shift.d.ts +2 -1
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/discover.d.ts +11 -4
- package/dist/client/discover.d.ts.map +1 -1
- package/dist/client/discover.js +140 -136
- package/dist/client/discover.js.map +1 -1
- package/dist/client/gen-ai-inference.d.ts +4 -0
- package/dist/client/gen-ai-inference.d.ts.map +1 -1
- package/dist/client/gen-ai-inference.js +267 -0
- package/dist/client/gen-ai-inference.js.map +1 -1
- package/dist/client/types.d.ts +35 -14
- package/dist/client/types.d.ts.map +1 -1
- package/dist/utils/StreamedJson.d.ts +7 -1
- package/dist/utils/StreamedJson.d.ts.map +1 -1
- package/dist/utils/StreamedJson.js +10 -2
- package/dist/utils/StreamedJson.js.map +1 -1
- package/dist/utils/string.d.ts +6 -0
- package/dist/utils/string.d.ts.map +1 -1
- package/dist/utils/string.js +10 -0
- package/dist/utils/string.js.map +1 -1
- package/package.json +1 -1
- package/src/api/accountAssetManager.ts +1 -0
- package/src/api/cloudPlatform.ts +170 -111
- package/src/api/codeShift.ts +9 -4
- package/src/api/genAiInference.ts +119 -3
- package/src/apis.json +8 -8
- package/src/client/account.ts +4 -0
- package/src/client/ai.ts +2 -266
- package/src/client/cloud-platform.ts +4 -9
- package/src/client/discover.ts +151 -137
- package/src/client/gen-ai-inference.ts +281 -0
- package/src/client/types.ts +42 -14
- package/src/utils/StreamedJson.tsx +11 -2
- package/src/utils/string.ts +12 -0
package/src/api/codeShift.ts
CHANGED
|
@@ -24,7 +24,7 @@ export type ValidationError = {
|
|
|
24
24
|
export type HttpValidationError = {
|
|
25
25
|
detail?: ValidationError[];
|
|
26
26
|
};
|
|
27
|
-
export type ExceptionType = "CODE_SHIFT_API_0000_UNEXPECTED_ERROR" | "CODE_SHIFT_API_0001_INVALID_VALUE" | "CODE_SHIFT_API_0002_NOT_IMPLEMENTED" | "CODE_SHIFT_API_0003_NOT_FOUND" | "CODE_SHIFT_API_0004_VALIDATION_ERROR" | "CODE_SHIFT_API_0005_CONFLICT" | "CODE_SHIFT_API_0006_INVALID_REPO_URL" | "CODE_SHIFT_API_0007_FORBIDDEN" | "CODE_SHIFT_API_0008_DEFAULT_BRANCH" | "CODE_SHIFT_API_0009_INVALID_SPREADSHEET" | "CODE_SHIFT_API_0010_PR_LINK_NOT_EXISTS" | "CODE_SHIFT_API_0011_EMPTY_SPREADSHEET" | "CODE_SHIFT_API_0012_REPOSITORY_NOT_EXISTS_IN_SCM" | "CODE_SHIFT_API_0013_SCM_BRANCH_NOT_EXISTS_EXCEPTION" | "CODE_SHIFT_API_0014_ACCOUNT_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0015_INVALID_WORKFLOW_URL_EXCEPTION" | "CODE_SHIFT_API_0016_INVALID_ACTION_YAML_EXCEPTION" | "CODE_SHIFT_API_0017_FAIL_READING_ACTION_INPUTS_EXCEPTION" | "CODE_SHIFT_API_0018_MODULE_DISPATCHER_GENERIC_EXCEPTION" | "CODE_SHIFT_API_0019_GITHUB_DISPATCH_WORKFLOW_UNAUTHORIZED_EXCEPTION" | "CODE_SHIFT_API_0020_GITHUB_SAML_EXCEPTION" | "CODE_SHIFT_API_0021_GITHUB_AUTHORIZATION_ENCODING_EXCEPTION" | "CODE_SHIFT_API_0022_GITHUB_DISPATCH_WORKFLOW_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0023_GENERIC_FAILURE_SEARCHING_REPOSITORY_EXCEPTION" | "CODE_SHIFT_API_0024_COMPONENTS_MAX_SIZE_ALLOWED_EXCEPTION" | "CODE_SHIFT_API_0025_INVALID_SEARCH_REPOSITORY_STATUS_SAVE_EXCEPTION" | "CODE_SHIFT_API_0026_SEARCH_REPO_EMPTY_RESULT_EXCEPTION" | "CODE_SHIFT_API_0027_ACCOUNT_SCM_CONFIG_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0028_USER_SCM_CONFIG_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0029_USER_CUSTOMER_RATING_CREATION_FORBIDDEN" | "CODE_SHIFT_API_0030_BROKEN_STACKSPOT_WORKFLOW_SCM_SETUP_BY_INVALID_TRIGGER_EXCEPTION" | "CODE_SHIFT_API_0031_GITHUB_SECONDARY_INDEX" | "CODE_SHIFT_API_0032_GITHUB_MISSING_PAT_SCOPE" | "CODE_SHIFT_API_0033_FEATURE_NOT_IMPLEMENTED_TO_SCM_YET" | "CODE_SHIFT_API_0034_FAILURE_GETTING_READING_CREDENTIALS" | "CODE_SHIFT_API_0035_SCM_MODULE_DOCUMENTATION_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_3000_WORKFLOW_API_DISPATCH_FAILURE" | "CODE_SHIFT_API_3001_WORKFLOW_API_DISPATCH_FORBIDDEN" | "CODE_SHIFT_API_3009_WORKFLOW_API_DISPATCH_PARSE_ERROR" | "CODE_SHIFT_API_3010_AWS_SECRET_MANAGER_GET_SECRET_FAILURE" | "CODE_SHIFT_API_3011_AWS_SECRET_MANAGER_PARSE_SECRET_ERROR" | "CODE_SHIFT_API_3100_SCM_GET_REPOSITORIES_FAILURE" | "CODE_SHIFT_API_3101_SCM_GET_REPOSITORIES_NOT_FOUND" | "CODE_SHIFT_API_3102_SCM_GET_REPOSITORIES_UNAUTHORIZED" | "CODE_SHIFT_API_3103_SCM_GET_REPOSITORIES_FORBIDDEN" | "CODE_SHIFT_API_3104_SCM_GET_REPOSITORIES_SAML_ERROR" | "CODE_SHIFT_API_3110_SCM_GET_PULL_REQUEST_FAILURE" | "CODE_SHIFT_API_3111_SCM_GET_PULL_REQUEST_NOT_FOUND" | "CODE_SHIFT_API_3112_SCM_GET_PULL_REQUEST_UNAUTHORIZED" | "CODE_SHIFT_API_3113_SCM_GET_PULL_REQUEST_FORBIDDEN" | "CODE_SHIFT_API_3114_SCM_GET_PULL_REQUEST_SAML_ERROR" | "CODE_SHIFT_API_3120_SCM_GET_BRANCHES_FAILURE" | "CODE_SHIFT_API_3121_SCM_GET_BRANCHES_NOT_FOUND" | "CODE_SHIFT_API_3122_SCM_GET_BRANCHES_UNAUTHORIZED" | "CODE_SHIFT_API_3123_SCM_GET_BRANCHES_FORBIDDEN" | "CODE_SHIFT_API_3124_SCM_GET_BRANCHES_SAML_ERROR" | "CODE_SHIFT_API_3130_SCM_GET_SCM_REPOSITORY_FETCH_FAILURE" | "CODE_SHIFT_API_3131_SCM_REPOSITORY_NOT_FOUND" | "CODE_SHIFT_API_3132_SCM_REPOSITORY_UNAUTHORIZED" | "CODE_SHIFT_API_3133_SCM_REPOSITORY_FORBIDDEN" | "CODE_SHIFT_API_3134_SCM_REPOSITORY_SAML_ERROR" | "CODE_SHIFT_API_3140_SCM_GET_BRANCH_FAILURE" | "CODE_SHIFT_API_3142_SCM_GET_BRANCH_NOT_FOUND" | "CODE_SHIFT_API_3143_SCM_GET_BRANCH_UNAUTHORIZED" | "CODE_SHIFT_API_3144_SCM_GET_BRANCH_FORBIDDEN" | "CODE_SHIFT_API_3145_SCM_GET_BRANCH_SAML_ERROR" | "CODE_SHIFT_API_3150_SCM_GET_REPOSITORY_FILE_FAILURE" | "CODE_SHIFT_API_3151_SCM_GET_REPOSITORY_FILE_NOT_FOUND" | "CODE_SHIFT_API_3152_SCM_GET_REPOSITORY_FILE_UNAUTHORIZED" | "CODE_SHIFT_API_3153_SCM_GET_REPOSITORY_FILE_FORBIDDEN" | "CODE_SHIFT_API_3154_SCM_GET_REPOSITORY_FILE_SAML_ERROR" | "CODE_SHIFT_API_3160_SCM_GET_REPOSITORY_FILE_FAILURE" | "CODE_SHIFT_API_3161_SCM_GET_REPOSITORY_FILE_NOT_FOUND" | "CODE_SHIFT_API_3162_SCM_GET_REPOSITORY_FILE_UNAUTHORIZED" | "CODE_SHIFT_API_3163_SCM_GET_REPOSITORY_FILE_FORBIDDEN" | "CODE_SHIFT_API_3164_SCM_GET_REPOSITORY_FILE_SAML_ERROR" | "CODE_SHIFT_API_3170_SCM_GET_OWNER_FAILURE" | "CODE_SHIFT_API_3172_SCM_GET_OWNER_NOT_FOUND" | "CODE_SHIFT_API_3173_SCM_GET_OWNER_UNAUTHORIZED" | "CODE_SHIFT_API_3174_SCM_GET_OWNER_FORBIDDEN" | "CODE_SHIFT_API_3175_SCM_GET_OWNER_SAML_ERROR" | "CODE_SHIFT_API_3500_CONTENT_API_GET_WORKFLOW_VERSION_FAILURE" | "CODE_SHIFT_API_3501_CONTENT_API_GET_WORKFLOW_VERSION_NOT_FOUND" | "CODE_SHIFT_API_3502_CONTENT_API_GET_WORKFLOW_VERSION_FORBIDDEN" | "CODE_SHIFT_API_3503_CONTENT_API_GET_WORKFLOW_VERSION_UNAUTHORIZED" | "CODE_SHIFT_API_3510_CONTENT_API_GET_WORKFLOW_FAILURE" | "CODE_SHIFT_API_3511_CONTENT_API_GET_WORKFLOW_NOT_FOUND" | "CODE_SHIFT_API_3512_CONTENT_API_GET_WORKFLOW_FORBIDDEN" | "CODE_SHIFT_API_3513_CONTENT_API_GET_WORKFLOW_UNAUTHORIZED" | "CODE_SHIFT_API_3520_CONTENT_API_GET_WORKFLOW_INPUTS_FAILURE" | "CODE_SHIFT_API_3521_CONTENT_API_GET_WORKFLOW_INPUTS_NOT_FOUND" | "CODE_SHIFT_API_3522_CONTENT_API_GET_WORKFLOW_INPUTS_FORBIDDEN" | "CODE_SHIFT_API_3523_CONTENT_API_GET_WORKFLOW_INPUTS_UNAUTHORIZED" | "CODE_SHIFT_API_3530_CONTENT_API_GET_WORKFLOW_DOCUMENTATION_FAILURE" | "CODE_SHIFT_API_3531_CONTENT_API_GET_WORKFLOW_DOCUMENTATION_NOT_FOUND" | "CODE_SHIFT_API_3532_CONTENT_API_GET_WORKFLOW_DOCUMENTATION_FORBIDDEN" | "CODE_SHIFT_API_3533_CONTENT_API_GET_WORKFLOW_DOCUMENTATION_UNAUTHORIZED" | "CODE_SHIFT_API_4010_GET_SCM_CREDENTIALS_FAILURE" | "CODE_SHIFT_API_4011_GET_SCM_CREDENTIALS_FORBIDDEN" | "CODE_SHIFT_API_4012_GET_SCM_CREDENTIALS_NOT_FOUND" | "CODE_SHIFT_API_4019_GET_SCM_CREDENTIALS_PARSE_ERROR" | "CODE_SHIFT_API_6000_IAM_GENERATE_TOKEN_FAILURE" | "CODE_SHIFT_API_6000_IAM_INTROSPECT_TOKEN_FAILURE";
|
|
27
|
+
export type ExceptionType = "CODE_SHIFT_API_0000_UNEXPECTED_ERROR" | "CODE_SHIFT_API_0001_INVALID_VALUE" | "CODE_SHIFT_API_0002_NOT_IMPLEMENTED" | "CODE_SHIFT_API_0003_NOT_FOUND" | "CODE_SHIFT_API_0004_VALIDATION_ERROR" | "CODE_SHIFT_API_0005_CONFLICT" | "CODE_SHIFT_API_0006_INVALID_REPO_URL" | "CODE_SHIFT_API_0007_FORBIDDEN" | "CODE_SHIFT_API_0008_DEFAULT_BRANCH" | "CODE_SHIFT_API_0009_INVALID_SPREADSHEET" | "CODE_SHIFT_API_0010_PR_LINK_NOT_EXISTS" | "CODE_SHIFT_API_0011_EMPTY_SPREADSHEET" | "CODE_SHIFT_API_0012_REPOSITORY_NOT_EXISTS_IN_SCM" | "CODE_SHIFT_API_0013_SCM_BRANCH_NOT_EXISTS_EXCEPTION" | "CODE_SHIFT_API_0014_ACCOUNT_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0015_INVALID_WORKFLOW_URL_EXCEPTION" | "CODE_SHIFT_API_0016_INVALID_ACTION_YAML_EXCEPTION" | "CODE_SHIFT_API_0017_FAIL_READING_ACTION_INPUTS_EXCEPTION" | "CODE_SHIFT_API_0018_MODULE_DISPATCHER_GENERIC_EXCEPTION" | "CODE_SHIFT_API_0019_GITHUB_DISPATCH_WORKFLOW_UNAUTHORIZED_EXCEPTION" | "CODE_SHIFT_API_0020_GITHUB_SAML_EXCEPTION" | "CODE_SHIFT_API_0021_GITHUB_AUTHORIZATION_ENCODING_EXCEPTION" | "CODE_SHIFT_API_0022_GITHUB_DISPATCH_WORKFLOW_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0023_GENERIC_FAILURE_SEARCHING_REPOSITORY_EXCEPTION" | "CODE_SHIFT_API_0024_COMPONENTS_MAX_SIZE_ALLOWED_EXCEPTION" | "CODE_SHIFT_API_0025_INVALID_SEARCH_REPOSITORY_STATUS_SAVE_EXCEPTION" | "CODE_SHIFT_API_0026_SEARCH_REPO_EMPTY_RESULT_EXCEPTION" | "CODE_SHIFT_API_0027_ACCOUNT_SCM_CONFIG_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0028_USER_SCM_CONFIG_NOT_FOUND_EXCEPTION" | "CODE_SHIFT_API_0029_USER_CUSTOMER_RATING_CREATION_FORBIDDEN" | "CODE_SHIFT_API_0030_BROKEN_STACKSPOT_WORKFLOW_SCM_SETUP_BY_INVALID_TRIGGER_EXCEPTION" | "CODE_SHIFT_API_0031_GITHUB_SECONDARY_INDEX" | "CODE_SHIFT_API_0032_GITHUB_MISSING_PAT_SCOPE" | "CODE_SHIFT_API_0033_FEATURE_NOT_IMPLEMENTED_TO_SCM_YET" | "CODE_SHIFT_API_0034_FAILURE_GETTING_READING_CREDENTIALS" | "CODE_SHIFT_API_0035_SCM_MODULE_DOCUMENTATION_NOT_FOUND_EXCEPTION" | "CODESHIFT_API_0036_AZURE_LIST_PIPELINE_NOT_FOUND" | "CODESHIFT_API_0037_AZURE_LIST_PIPELINE_UNAUTHORIZED" | "CODESHIFT_API_0038_AZURE_LIST_PIPELINE_FAILURE" | "CODESHIFT_API_0039_AZURE_LIST_PIPELINE_RESPONSE_PARSE_ERROR" | "CODESHIFT_API_0040_AZURE_RUN_PIPELINE_NOT_FOUND" | "CODESHIFT_API_0041_AZURE_RUN_PIPELINE_UNAUTHORIZED" | "CODESHIFT_API_0042_AZURE_RUN_PIPELINE_FAILURE" | "CODESHIFT_API_0043_AZURE_RUN_PIPELINE_RESPONSE_PARSE_ERROR" | "CODE_SHIFT_API_3000_WORKFLOW_API_DISPATCH_FAILURE" | "CODE_SHIFT_API_3001_WORKFLOW_API_DISPATCH_FORBIDDEN" | "CODE_SHIFT_API_3009_WORKFLOW_API_DISPATCH_PARSE_ERROR" | "CODE_SHIFT_API_3010_AWS_SECRET_MANAGER_GET_SECRET_FAILURE" | "CODE_SHIFT_API_3011_AWS_SECRET_MANAGER_PARSE_SECRET_ERROR" | "CODE_SHIFT_API_3100_SCM_GET_REPOSITORIES_FAILURE" | "CODE_SHIFT_API_3101_SCM_GET_REPOSITORIES_NOT_FOUND" | "CODE_SHIFT_API_3102_SCM_GET_REPOSITORIES_UNAUTHORIZED" | "CODE_SHIFT_API_3103_SCM_GET_REPOSITORIES_FORBIDDEN" | "CODE_SHIFT_API_3104_SCM_GET_REPOSITORIES_SAML_ERROR" | "CODE_SHIFT_API_3110_SCM_GET_PULL_REQUEST_FAILURE" | "CODE_SHIFT_API_3111_SCM_GET_PULL_REQUEST_NOT_FOUND" | "CODE_SHIFT_API_3112_SCM_GET_PULL_REQUEST_UNAUTHORIZED" | "CODE_SHIFT_API_3113_SCM_GET_PULL_REQUEST_FORBIDDEN" | "CODE_SHIFT_API_3114_SCM_GET_PULL_REQUEST_SAML_ERROR" | "CODE_SHIFT_API_3120_SCM_GET_BRANCHES_FAILURE" | "CODE_SHIFT_API_3121_SCM_GET_BRANCHES_NOT_FOUND" | "CODE_SHIFT_API_3122_SCM_GET_BRANCHES_UNAUTHORIZED" | "CODE_SHIFT_API_3123_SCM_GET_BRANCHES_FORBIDDEN" | "CODE_SHIFT_API_3124_SCM_GET_BRANCHES_SAML_ERROR" | "CODE_SHIFT_API_3130_SCM_GET_SCM_REPOSITORY_FETCH_FAILURE" | "CODE_SHIFT_API_3131_SCM_REPOSITORY_NOT_FOUND" | "CODE_SHIFT_API_3132_SCM_REPOSITORY_UNAUTHORIZED" | "CODE_SHIFT_API_3133_SCM_REPOSITORY_FORBIDDEN" | "CODE_SHIFT_API_3134_SCM_REPOSITORY_SAML_ERROR" | "CODE_SHIFT_API_3140_SCM_GET_BRANCH_FAILURE" | "CODE_SHIFT_API_3142_SCM_GET_BRANCH_NOT_FOUND" | "CODE_SHIFT_API_3143_SCM_GET_BRANCH_UNAUTHORIZED" | "CODE_SHIFT_API_3144_SCM_GET_BRANCH_FORBIDDEN" | "CODE_SHIFT_API_3145_SCM_GET_BRANCH_SAML_ERROR" | "CODE_SHIFT_API_3150_SCM_GET_REPOSITORY_FILE_FAILURE" | "CODE_SHIFT_API_3151_SCM_GET_REPOSITORY_FILE_NOT_FOUND" | "CODE_SHIFT_API_3152_SCM_GET_REPOSITORY_FILE_UNAUTHORIZED" | "CODE_SHIFT_API_3153_SCM_GET_REPOSITORY_FILE_FORBIDDEN" | "CODE_SHIFT_API_3154_SCM_GET_REPOSITORY_FILE_SAML_ERROR" | "CODE_SHIFT_API_3160_SCM_GET_REPOSITORY_FILE_FAILURE" | "CODE_SHIFT_API_3161_SCM_GET_REPOSITORY_FILE_NOT_FOUND" | "CODE_SHIFT_API_3162_SCM_GET_REPOSITORY_FILE_UNAUTHORIZED" | "CODE_SHIFT_API_3163_SCM_GET_REPOSITORY_FILE_FORBIDDEN" | "CODE_SHIFT_API_3164_SCM_GET_REPOSITORY_FILE_SAML_ERROR" | "CODE_SHIFT_API_3170_SCM_GET_OWNER_FAILURE" | "CODE_SHIFT_API_3172_SCM_GET_OWNER_NOT_FOUND" | "CODE_SHIFT_API_3173_SCM_GET_OWNER_UNAUTHORIZED" | "CODE_SHIFT_API_3174_SCM_GET_OWNER_FORBIDDEN" | "CODE_SHIFT_API_3175_SCM_GET_OWNER_SAML_ERROR" | "CODE_SHIFT_API_3500_CONTENT_API_GET_WORKFLOW_VERSION_FAILURE" | "CODE_SHIFT_API_3501_CONTENT_API_GET_WORKFLOW_VERSION_NOT_FOUND" | "CODE_SHIFT_API_3502_CONTENT_API_GET_WORKFLOW_VERSION_FORBIDDEN" | "CODE_SHIFT_API_3503_CONTENT_API_GET_WORKFLOW_VERSION_UNAUTHORIZED" | "CODE_SHIFT_API_3510_CONTENT_API_GET_WORKFLOW_FAILURE" | "CODE_SHIFT_API_3511_CONTENT_API_GET_WORKFLOW_NOT_FOUND" | "CODE_SHIFT_API_3512_CONTENT_API_GET_WORKFLOW_FORBIDDEN" | "CODE_SHIFT_API_3513_CONTENT_API_GET_WORKFLOW_UNAUTHORIZED" | "CODE_SHIFT_API_3520_CONTENT_API_GET_WORKFLOW_INPUTS_FAILURE" | "CODE_SHIFT_API_3521_CONTENT_API_GET_WORKFLOW_INPUTS_NOT_FOUND" | "CODE_SHIFT_API_3522_CONTENT_API_GET_WORKFLOW_INPUTS_FORBIDDEN" | "CODE_SHIFT_API_3523_CONTENT_API_GET_WORKFLOW_INPUTS_UNAUTHORIZED" | "CODE_SHIFT_API_3530_CONTENT_API_GET_WORKFLOW_DOCUMENTATION_FAILURE" | "CODE_SHIFT_API_3531_CONTENT_API_GET_WORKFLOW_DOCUMENTATION_NOT_FOUND" | "CODE_SHIFT_API_3532_CONTENT_API_GET_WORKFLOW_DOCUMENTATION_FORBIDDEN" | "CODE_SHIFT_API_3533_CONTENT_API_GET_WORKFLOW_DOCUMENTATION_UNAUTHORIZED" | "CODE_SHIFT_API_4010_GET_SCM_CREDENTIALS_FAILURE" | "CODE_SHIFT_API_4011_GET_SCM_CREDENTIALS_FORBIDDEN" | "CODE_SHIFT_API_4012_GET_SCM_CREDENTIALS_NOT_FOUND" | "CODE_SHIFT_API_4019_GET_SCM_CREDENTIALS_PARSE_ERROR" | "CODE_SHIFT_API_6000_IAM_GENERATE_TOKEN_FAILURE" | "CODE_SHIFT_API_6000_IAM_INTROSPECT_TOKEN_FAILURE";
|
|
28
28
|
export type BadRequestExceptionTypes = "CODE_SHIFT_API_1001_DECODE_JWT_ERROR" | "CODE_SHIFT_API_2001_BAD_REQUEST_REQUIRED_FIELD" | "CODE_SHIFT_API_2002_BAD_REQUEST_EMPTY_FIELD_NOT_ALLOWED" | "CODE_SHIFT_API_2003_BAD_REQUEST_TYPE_FIELD_NOT_ALLOWED" | "CODE_SHIFT_API_2004_BAD_REQUEST_VALUE_FIELD_NOT_ALLOWED" | "CODE_SHIFT_API_2005_BAD_REQUEST_VALUE_FIELD_MAX_LENGTH" | "CODE_SHIFT_API_2006_BAD_REQUEST_VALUE_FIELD_MIN_LENGTH" | "CODE_SHIFT_API_2007_BAD_REQUEST_VALUE_REGEX_DOESNT_MATCH" | "CODE_SHIFT_API_2008_BAD_REQUEST_VALUE_FIELD_NUMBER_NOT_LT" | "CODE_SHIFT_API_2100_CREATE_BODY_REPO_AND_REPO_CREATE_ACTION" | "CODE_SHIFT_API_2101_CREATE_BODY_NOT_REPO_AND_NOT_REPO_CREATE_ACTION" | "CODE_SHIFT_API_2102_BAD_REQUEST_DATE_MAX_INTERVAL" | "CODE_SHIFT_API_2103_BAD_REQUEST_INVALID_PAGE" | "CODE_SHIFT_API_2104_BAD_REQUEST_DUPLICATED_ALIAS" | "CODE_SHIFT_API_2105_BAD_REQUEST_INVALID_REPO_URL" | "CODE_SHIFT_API_2110_BAD_REQUEST_PUT_STEP_STATUS_COMPLETED_WITHOUT_CONCLUSION" | "CODE_SHIFT_API_2112_BAD_REQUEST_PUT_STEP_STATUS_NOT_COMPLETED_AND_CONCLUSION_DEFINED" | "CODE_SHIFT_API_2113_BAD_REQUEST_PUT_STEP_STATUS_COMPLETED_AND_COMPLETED_AT_NOT_DEFINED" | "CODE_SHIFT_API_2114_BAD_REQUEST_PUT_STEP_STATUS_IN_PROGRESS_AND_STARTED_AT_NOT_DEFINED" | "CODE_SHIFT_API_2115_BAD_REQUEST_PUT_STEP_COMPLETED_AT_DEFINED_AND_STATUS_NOT_COMPLETED" | "CODE_SHIFT_API_2116_BAD_REQUEST_PUT_STEP_STARTED_AT_DEFINED_AND_STATUS_PENDING" | "CODE_SHIFT_API_2117_BAD_REQUEST_PUT_STEP_LOG_DEFINED_AND_CONCLUSION_IS_NOT_FAILURE" | "CODE_SHIFT_API_2120_BAD_REQUEST_MULTIPLE_INTEGRATION" | "CODE_SHIFT_API_2121_BAD_REQUEST_EMPTY_INTEGRATION" | "CODE_SHIFT_API_2121_BAD_REQUEST_EMPTY_TARGET" | "CODE_SHIFT_API_2121_BAD_REQUEST_FILLED_TARGET" | "CODE_SHIFT_API_2999_BAD_REQUEST_UNMAPPED";
|
|
29
29
|
export type InvalidPayloadDetails = {
|
|
30
30
|
code: BadRequestExceptionTypes | ExceptionType;
|
|
@@ -161,6 +161,9 @@ export type ListModuleResponse = {
|
|
|
161
161
|
/** Last evaluated key */
|
|
162
162
|
lastEvaluatedKey: string | null;
|
|
163
163
|
};
|
|
164
|
+
export type CreateModuleResponse = {
|
|
165
|
+
id: string;
|
|
166
|
+
};
|
|
164
167
|
export type PutModuleRequest = {
|
|
165
168
|
/** Module name */
|
|
166
169
|
name?: string | null;
|
|
@@ -1490,7 +1493,7 @@ export function createModuleServiceV1ModulesPost({ authorization, xAccountSlug,
|
|
|
1490
1493
|
/**
|
|
1491
1494
|
* List Modules Service
|
|
1492
1495
|
*/
|
|
1493
|
-
export function listModulesServiceV1ModulesGet({ pageSize, moduleType, page, lastEvaluatedKey, sharedWith, createdBy, visibility, name, tags, xAccountSlug, authorization }: {
|
|
1496
|
+
export function listModulesServiceV1ModulesGet({ pageSize, moduleType, page, lastEvaluatedKey, sharedWith, createdBy, visibility, name, tags, showDeleted, xAccountSlug, authorization }: {
|
|
1494
1497
|
pageSize?: number;
|
|
1495
1498
|
moduleType?: ModuleType | null;
|
|
1496
1499
|
page?: number;
|
|
@@ -1500,6 +1503,7 @@ export function listModulesServiceV1ModulesGet({ pageSize, moduleType, page, las
|
|
|
1500
1503
|
visibility?: ModuleVisibility | null;
|
|
1501
1504
|
name?: string | null;
|
|
1502
1505
|
tags?: string[] | null;
|
|
1506
|
+
showDeleted?: boolean | null;
|
|
1503
1507
|
xAccountSlug?: string;
|
|
1504
1508
|
authorization: string;
|
|
1505
1509
|
}, opts?: Oazapfts.RequestOpts) {
|
|
@@ -1532,7 +1536,8 @@ export function listModulesServiceV1ModulesGet({ pageSize, moduleType, page, las
|
|
|
1532
1536
|
createdBy,
|
|
1533
1537
|
visibility,
|
|
1534
1538
|
name,
|
|
1535
|
-
tags
|
|
1539
|
+
tags,
|
|
1540
|
+
showDeleted
|
|
1536
1541
|
}))}`, {
|
|
1537
1542
|
...opts,
|
|
1538
1543
|
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
@@ -1551,7 +1556,7 @@ export function deleteModuleServiceV1ModulesModuleIdDelete({ moduleId, authoriza
|
|
|
1551
1556
|
}, opts?: Oazapfts.RequestOpts) {
|
|
1552
1557
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
1553
1558
|
status: 200;
|
|
1554
|
-
data:
|
|
1559
|
+
data: CreateModuleResponse;
|
|
1555
1560
|
} | {
|
|
1556
1561
|
status: 400;
|
|
1557
1562
|
data: HttpErrorResponseRead;
|
|
@@ -252,7 +252,23 @@ export type ChatRequest = {
|
|
|
252
252
|
return_ks_in_response?: boolean;
|
|
253
253
|
upload_ids?: string[];
|
|
254
254
|
execution_id?: string | null;
|
|
255
|
+
conversation_id?: string | null;
|
|
256
|
+
use_conversation?: boolean;
|
|
255
257
|
selected_model?: string | null;
|
|
258
|
+
workspace_id?: string | null;
|
|
259
|
+
stack_id?: string | null;
|
|
260
|
+
knowledge_sources?: string[];
|
|
261
|
+
deep_search_ks?: boolean;
|
|
262
|
+
show_chat_processing_state?: boolean;
|
|
263
|
+
};
|
|
264
|
+
export type PromptTokensCurrentUsageResponse = {
|
|
265
|
+
used: number;
|
|
266
|
+
limit: number;
|
|
267
|
+
renewal_date: string;
|
|
268
|
+
};
|
|
269
|
+
export type PromptTokensMonthlyUsageResponse = {
|
|
270
|
+
used: number;
|
|
271
|
+
month: number;
|
|
256
272
|
};
|
|
257
273
|
/**
|
|
258
274
|
* Health Check
|
|
@@ -582,7 +598,7 @@ export function listLlmProvidersV1LlmProvidersGet({ acceptsSelfHosted, xAccountI
|
|
|
582
598
|
/**
|
|
583
599
|
* Handle completions requests
|
|
584
600
|
*/
|
|
585
|
-
export function createCompletionsV1ChatCompletionsPost({ xAccountId, authorization, xRequestOrigin, xConversationId, xMessageId, xQcExecutionId, xQcSlug,
|
|
601
|
+
export function createCompletionsV1ChatCompletionsPost({ xAccountId, authorization, xRequestOrigin, xConversationId, xMessageId, xQcExecutionId, xQcSlug, xStackspotAiVersion, chatCompletion }: {
|
|
586
602
|
xAccountId?: string | null;
|
|
587
603
|
authorization: string;
|
|
588
604
|
xRequestOrigin?: string | null;
|
|
@@ -590,7 +606,7 @@ export function createCompletionsV1ChatCompletionsPost({ xAccountId, authorizati
|
|
|
590
606
|
xMessageId?: string | null;
|
|
591
607
|
xQcExecutionId?: string | null;
|
|
592
608
|
xQcSlug?: string | null;
|
|
593
|
-
|
|
609
|
+
xStackspotAiVersion?: string | null;
|
|
594
610
|
chatCompletion: ChatCompletion;
|
|
595
611
|
}, opts?: Oazapfts.RequestOpts) {
|
|
596
612
|
return oazapfts.ok(oazapfts.fetchJson<{
|
|
@@ -613,7 +629,7 @@ export function createCompletionsV1ChatCompletionsPost({ xAccountId, authorizati
|
|
|
613
629
|
"x-message-id": xMessageId,
|
|
614
630
|
"x-qc-execution-id": xQcExecutionId,
|
|
615
631
|
"x-qc-slug": xQcSlug,
|
|
616
|
-
"x-
|
|
632
|
+
"x-stackspot-ai-version": xStackspotAiVersion
|
|
617
633
|
})
|
|
618
634
|
})));
|
|
619
635
|
}
|
|
@@ -644,3 +660,103 @@ export function agentChatV1AgentAgentIdChatPost({ agentId, xAccountId, authoriza
|
|
|
644
660
|
})
|
|
645
661
|
})));
|
|
646
662
|
}
|
|
663
|
+
/**
|
|
664
|
+
* Total
|
|
665
|
+
*/
|
|
666
|
+
export function totalV1PromptTokensUsageTotalGet({ xAccountId, authorization }: {
|
|
667
|
+
xAccountId?: string | null;
|
|
668
|
+
authorization: string;
|
|
669
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
670
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
671
|
+
status: 200;
|
|
672
|
+
data: PromptTokensCurrentUsageResponse;
|
|
673
|
+
} | {
|
|
674
|
+
status: 404;
|
|
675
|
+
} | {
|
|
676
|
+
status: 422;
|
|
677
|
+
data: HttpValidationError;
|
|
678
|
+
}>("/v1/prompt-tokens-usage/total", {
|
|
679
|
+
...opts,
|
|
680
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
681
|
+
"x-account-id": xAccountId,
|
|
682
|
+
authorization
|
|
683
|
+
})
|
|
684
|
+
}));
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Current
|
|
688
|
+
*/
|
|
689
|
+
export function currentV1PromptTokensUsageCurrentGet({ xAccountId, authorization }: {
|
|
690
|
+
xAccountId?: string | null;
|
|
691
|
+
authorization: string;
|
|
692
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
693
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
694
|
+
status: 200;
|
|
695
|
+
data: PromptTokensCurrentUsageResponse;
|
|
696
|
+
} | {
|
|
697
|
+
status: 404;
|
|
698
|
+
} | {
|
|
699
|
+
status: 422;
|
|
700
|
+
data: HttpValidationError;
|
|
701
|
+
}>("/v1/prompt-tokens-usage/current", {
|
|
702
|
+
...opts,
|
|
703
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
704
|
+
"x-account-id": xAccountId,
|
|
705
|
+
authorization
|
|
706
|
+
})
|
|
707
|
+
}));
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Monthly
|
|
711
|
+
*/
|
|
712
|
+
export function monthlyV1PromptTokensUsageMonthlyGet({ year, xAccountId, authorization }: {
|
|
713
|
+
year: number;
|
|
714
|
+
xAccountId?: string | null;
|
|
715
|
+
authorization: string;
|
|
716
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
717
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
718
|
+
status: 200;
|
|
719
|
+
data: PromptTokensMonthlyUsageResponse[];
|
|
720
|
+
} | {
|
|
721
|
+
status: 404;
|
|
722
|
+
} | {
|
|
723
|
+
status: 422;
|
|
724
|
+
data: HttpValidationError;
|
|
725
|
+
}>(`/v1/prompt-tokens-usage/monthly${QS.query(QS.explode({
|
|
726
|
+
year
|
|
727
|
+
}))}`, {
|
|
728
|
+
...opts,
|
|
729
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
730
|
+
"x-account-id": xAccountId,
|
|
731
|
+
authorization
|
|
732
|
+
})
|
|
733
|
+
}));
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Top Users
|
|
737
|
+
*/
|
|
738
|
+
export function topUsersV1PromptTokensUsageTopUsersGet({ year, month, xAccountId, authorization }: {
|
|
739
|
+
year: number;
|
|
740
|
+
month: number;
|
|
741
|
+
xAccountId?: string | null;
|
|
742
|
+
authorization: string;
|
|
743
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
744
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
745
|
+
status: 200;
|
|
746
|
+
data: any;
|
|
747
|
+
} | {
|
|
748
|
+
status: 404;
|
|
749
|
+
} | {
|
|
750
|
+
status: 422;
|
|
751
|
+
data: HttpValidationError;
|
|
752
|
+
}>(`/v1/prompt-tokens-usage/top-users${QS.query(QS.explode({
|
|
753
|
+
year,
|
|
754
|
+
month
|
|
755
|
+
}))}`, {
|
|
756
|
+
...opts,
|
|
757
|
+
headers: oazapfts.mergeHeaders(opts?.headers, {
|
|
758
|
+
"x-account-id": xAccountId,
|
|
759
|
+
authorization
|
|
760
|
+
})
|
|
761
|
+
}));
|
|
762
|
+
}
|
package/src/apis.json
CHANGED
|
@@ -177,12 +177,12 @@
|
|
|
177
177
|
"cloudPlatform": {
|
|
178
178
|
"url": {
|
|
179
179
|
"dev": "https://cloud-cloud-platform-api.dev.stackspot.com",
|
|
180
|
-
"stg": "https://cloud-cloud-
|
|
181
|
-
"prd": "https://cloud-cloud-
|
|
180
|
+
"stg": "https://cloud-cloud-foundation-api.stg.stackspot.com",
|
|
181
|
+
"prd": "https://cloud-cloud-foundation-api.prd.stackspot.com"
|
|
182
182
|
},
|
|
183
|
-
"docs": "/v3/api-docs"
|
|
183
|
+
"docs": "/v3/api-docs/portal"
|
|
184
184
|
},
|
|
185
|
-
|
|
185
|
+
"cloudRuntimes": {
|
|
186
186
|
"url": {
|
|
187
187
|
"dev": "https://cloud-cloud-runtime-api.dev.stackspot.com",
|
|
188
188
|
"stg": "https://cloud-cloud-runtime-api.stg.stackspot.com",
|
|
@@ -222,13 +222,13 @@
|
|
|
222
222
|
},
|
|
223
223
|
"docs": "/v3/api-docs"
|
|
224
224
|
},
|
|
225
|
-
"accountAssetManager"
|
|
225
|
+
"accountAssetManager": {
|
|
226
226
|
"url": {
|
|
227
227
|
"dev": "https://account-asset-manager.dev.stackspot.com",
|
|
228
228
|
"stg": "https://account-asset-manager.stg.stackspot.com",
|
|
229
|
-
"prd": "https://account-asset-manager.stackspot.com"
|
|
229
|
+
"prd": "https://account-asset-manager.stackspot.com"
|
|
230
230
|
},
|
|
231
|
-
"docs": "/v3/api-docs"
|
|
231
|
+
"docs": "/v3/api-docs"
|
|
232
232
|
},
|
|
233
233
|
"edpBfa": {
|
|
234
234
|
"url": {
|
|
@@ -238,4 +238,4 @@
|
|
|
238
238
|
},
|
|
239
239
|
"docs": "/openapi.json"
|
|
240
240
|
}
|
|
241
|
-
}
|
|
241
|
+
}
|
package/src/client/account.ts
CHANGED
|
@@ -644,6 +644,10 @@ class AccountClient extends ReactQueryNetworkClient {
|
|
|
644
644
|
* Get all account groups with pagination
|
|
645
645
|
*/
|
|
646
646
|
allGroupsWithPagination = this.query(getGroups1)
|
|
647
|
+
/**
|
|
648
|
+
* Get groups with infinite query
|
|
649
|
+
*/
|
|
650
|
+
groups = this.infiniteQuery(getGroups1, { accumulator: 'items' })
|
|
647
651
|
/**
|
|
648
652
|
* Get all members by group with pagination
|
|
649
653
|
*/
|
package/src/client/ai.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpError } from '@oazapfts/runtime'
|
|
2
|
-
import {
|
|
2
|
+
import { isArray } from 'lodash'
|
|
3
3
|
import { getApiAddresses } from '../api-addresses'
|
|
4
4
|
import {
|
|
5
5
|
addFavoriteV1AiStacksStackIdFavoritePost,
|
|
@@ -67,18 +67,10 @@ import { StackspotAPIError } from '../error/StackspotAPIError'
|
|
|
67
67
|
import { ReactQueryNetworkClient } from '../network/ReactQueryNetworkClient'
|
|
68
68
|
import { removeAuthorizationParam } from '../utils/remove-authorization-param'
|
|
69
69
|
import { StreamedJson } from '../utils/StreamedJson'
|
|
70
|
-
import { formatJson } from '../utils/string'
|
|
71
|
-
import { agentToolsClient } from './agent-tools'
|
|
72
70
|
import {
|
|
73
|
-
AgentInfo,
|
|
74
|
-
ChatAgentTool,
|
|
75
|
-
ChatResponseWithSteps,
|
|
76
|
-
FixedChatRequest,
|
|
77
|
-
FixedChatResponse,
|
|
78
71
|
FixedConversationResponse,
|
|
79
72
|
FixedDependencyResponse,
|
|
80
73
|
ReplaceResult,
|
|
81
|
-
StepChatStep,
|
|
82
74
|
} from './types'
|
|
83
75
|
|
|
84
76
|
const listQAV3WithoutAuthorization = removeAuthorizationParam(listAllV3QuickCommandsGet)
|
|
@@ -374,269 +366,13 @@ class AIClient extends ReactQueryNetworkClient {
|
|
|
374
366
|
deleteReviewComment = this.mutation(
|
|
375
367
|
removeAuthorizationParam(deleteReviewCommentV1ResourcesResourceTypeSlugResourceSlugReviewsReviewIdAnswersAnswerIdDelete))
|
|
376
368
|
|
|
377
|
-
private static async toolsOfAgent(agentId?: string, agent_version_number?: number) {
|
|
378
|
-
try {
|
|
379
|
-
const agent = agentId ? await agentToolsClient.agentV2.query({
|
|
380
|
-
agentCoreId: agentId, versionNumber: agent_version_number }) : undefined
|
|
381
|
-
if (!agent) return []
|
|
382
|
-
const tools: (Omit<ChatAgentTool, 'duration' | 'prompt' | 'output'>)[] = []
|
|
383
|
-
agent.version?.toolkits?.builtin_toolkits?.forEach(kit => kit.tools?.forEach(({ id, name, description }) => {
|
|
384
|
-
if (id) tools.push({ image: kit.image_url, id, name: name || id, description })
|
|
385
|
-
}))
|
|
386
|
-
agent.version?.toolkits?.custom_toolkits?.forEach(kit => kit.tools?.forEach(({ id, name, description }) => {
|
|
387
|
-
if (id) tools.push({ image: kit.avatar ?? undefined, id, name: name || id, description })
|
|
388
|
-
}))
|
|
389
|
-
return tools
|
|
390
|
-
} catch {
|
|
391
|
-
return []
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
sendChatMessage(request: FixedChatRequest, minChangeIntervalMS?: number): StreamedJson<ChatResponseWithSteps> {
|
|
396
|
-
const abortController = new AbortController()
|
|
397
|
-
const headers = {
|
|
398
|
-
'Content-Type': 'application/json',
|
|
399
|
-
'Accept': 'text/event-stream',
|
|
400
|
-
}
|
|
401
|
-
const events = this.stream(
|
|
402
|
-
this.resolveURL('v3/chat'),
|
|
403
|
-
{ method: 'post', body: JSON.stringify(request), headers, signal: abortController.signal },
|
|
404
|
-
)
|
|
405
|
-
|
|
406
|
-
const DYNAMIC_TOOL_ID = 'dynamic'
|
|
407
|
-
function isDynamicTool(info: AgentInfo) {
|
|
408
|
-
return info.type === 'tool' && info.id === DYNAMIC_TOOL_ID
|
|
409
|
-
}
|
|
410
|
-
/**
|
|
411
|
-
* This function treats events in the streaming that deals with the execution of tools. Since these events are not concatenated like
|
|
412
|
-
* normal streamings of data, we need this separate function to deal with them. It transforms the internal data model of the
|
|
413
|
-
* StreamedJson object whenever an event is triggered.
|
|
414
|
-
*/
|
|
415
|
-
async function transform(event: Partial<FixedChatResponse>, data: Partial<ChatResponseWithSteps>) {
|
|
416
|
-
const info = event.agent_info
|
|
417
|
-
if (!info) return
|
|
418
|
-
const tools = await AIClient.toolsOfAgent(request.context?.agent_id, request.agent_version_number ?? undefined)
|
|
419
|
-
data.steps = data.steps ? [...data.steps] : []
|
|
420
|
-
|
|
421
|
-
if (info.type === 'planning' && info.action === 'end') {
|
|
422
|
-
data.steps.push({
|
|
423
|
-
id: 'planning',
|
|
424
|
-
type: 'planning',
|
|
425
|
-
status: 'success',
|
|
426
|
-
duration: info.duration || 0,
|
|
427
|
-
steps: info.data?.steps?.map(s => s.goal) ?? [],
|
|
428
|
-
goal: info.data?.plan_goal ?? '',
|
|
429
|
-
})
|
|
430
|
-
|
|
431
|
-
info.data?.steps.forEach(s => data.steps?.push({
|
|
432
|
-
id: s.id,
|
|
433
|
-
type: 'step',
|
|
434
|
-
status: 'pending',
|
|
435
|
-
input: s.goal,
|
|
436
|
-
attempts: [{
|
|
437
|
-
tools: s.tools?.map(t => ({
|
|
438
|
-
...(tools.find(({ id }) => id === t.tool_id) ?? { id: t.tool_id, name: t.tool_id }),
|
|
439
|
-
executionId: t.tool_execution_id,
|
|
440
|
-
goal: t.goal,
|
|
441
|
-
})),
|
|
442
|
-
}],
|
|
443
|
-
}))
|
|
444
|
-
data.steps.push({ id: 'answer', type: 'answer', status: 'pending' })
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
if (info.type === 'planning' && info.action === 'awaiting_approval') {
|
|
448
|
-
data.steps.push({
|
|
449
|
-
id: 'planning',
|
|
450
|
-
type: 'planning',
|
|
451
|
-
status: 'awaiting_approval',
|
|
452
|
-
user_question: info.data?.user_question,
|
|
453
|
-
duration: info.duration || 0,
|
|
454
|
-
steps: info.data?.steps?.map(s => s.goal) ?? [],
|
|
455
|
-
goal: info.data?.plan_goal ?? '',
|
|
456
|
-
})
|
|
457
|
-
info.data?.steps.forEach(s => data.steps?.push({
|
|
458
|
-
id: s.id,
|
|
459
|
-
type: 'step',
|
|
460
|
-
status: 'pending',
|
|
461
|
-
input: s.goal,
|
|
462
|
-
attempts: [{
|
|
463
|
-
tools: s.tools?.map(t => ({
|
|
464
|
-
...(tools.find(({ id }) => id === t.tool_id) ?? { id: t.tool_id, name: t.tool_id }),
|
|
465
|
-
executionId: t.tool_execution_id,
|
|
466
|
-
goal: t.goal,
|
|
467
|
-
})),
|
|
468
|
-
}],
|
|
469
|
-
}))
|
|
470
|
-
data.steps.push({ id: 'answer', type: 'answer', status: 'pending' })
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
if (info.type === 'step' && info.action === 'start') {
|
|
474
|
-
const step = data.steps.find(s => s.id === info.id)
|
|
475
|
-
if (step) step.status = 'running'
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
if (info.type === 'step' && info.action === 'end') {
|
|
479
|
-
const step = data.steps.find(s => s.id === info.id) as StepChatStep
|
|
480
|
-
if (step) {
|
|
481
|
-
step.status = 'success'
|
|
482
|
-
step.duration = info.duration
|
|
483
|
-
const lastToolId = last(step.attempts[0].tools)?.id
|
|
484
|
-
const lastAttemptOfLastTool = findLast(step.attempts.map(a => a.tools).flat(), t => t?.id === lastToolId)
|
|
485
|
-
step.output = lastAttemptOfLastTool?.output
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
if (info.type === 'tool_calls' && info.action === 'start') {
|
|
490
|
-
const hasPlanning = data.steps.find(s => s.type === 'planning')
|
|
491
|
-
// On the first tool_calls:start, create the synthetic planning ("dynamic") step.
|
|
492
|
-
if (!hasPlanning) {
|
|
493
|
-
const userPrompt = request.user_prompt === 'string' ? request.user_prompt : JSON.stringify(request.user_prompt)
|
|
494
|
-
data.steps.push({
|
|
495
|
-
id: 'dynamic',
|
|
496
|
-
type: 'planning',
|
|
497
|
-
status: 'success',
|
|
498
|
-
steps: [],
|
|
499
|
-
goal: userPrompt,
|
|
500
|
-
user_question: userPrompt,
|
|
501
|
-
})
|
|
502
|
-
}
|
|
503
|
-
const toolsStepId = data.steps.filter(s => s.id === 'tools' || s.id.startsWith('tools-')).length + 1
|
|
504
|
-
data.steps.push({
|
|
505
|
-
id: `tools-${toolsStepId.toString()}`,
|
|
506
|
-
type: 'step',
|
|
507
|
-
status: 'running',
|
|
508
|
-
attempts: [{ tools: [] }],
|
|
509
|
-
} as StepChatStep)
|
|
510
|
-
}
|
|
511
|
-
|
|
512
|
-
if (info.type === 'tool_calls' && info.action === 'end') {
|
|
513
|
-
const lastStep = findLast(data.steps, s => s.id === 'tools' || s.id.startsWith('tools-')) as StepChatStep
|
|
514
|
-
if (lastStep) {
|
|
515
|
-
lastStep.status = 'success'
|
|
516
|
-
lastStep.duration = info.duration
|
|
517
|
-
const lastAttemptOfLastTool = last(lastStep.attempts.map(a => a.tools).flat())
|
|
518
|
-
lastStep.output = lastAttemptOfLastTool?.output
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
if (info.type === 'tool' && info.action === 'awaiting_approval') {
|
|
523
|
-
const tool = tools.find(({ id }) => id === info.data?.tool_id)
|
|
524
|
-
data.steps.push({
|
|
525
|
-
id: info.id,
|
|
526
|
-
type: 'tool',
|
|
527
|
-
status: 'awaiting_approval',
|
|
528
|
-
duration: info.duration || 0,
|
|
529
|
-
input: info.data?.input,
|
|
530
|
-
user_question: info.data?.user_question,
|
|
531
|
-
attempts: [{
|
|
532
|
-
tools: [{
|
|
533
|
-
executionId: info.id,
|
|
534
|
-
id: info.data?.tool_id ?? '',
|
|
535
|
-
name: tool?.name ?? '',
|
|
536
|
-
goal: tool?.goal,
|
|
537
|
-
...tool,
|
|
538
|
-
}],
|
|
539
|
-
}],
|
|
540
|
-
})
|
|
541
|
-
data.steps.push({ id: 'answer', type: 'answer', status: 'pending' })
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
if (info.type === 'tool' && info.action === 'start') {
|
|
545
|
-
if (!info.data) return
|
|
546
|
-
const input = formatJson(info.data.input)
|
|
547
|
-
const tool = findLast(tools, ({ id }) => id === info.data?.tool_id) ?? { id: info.data?.tool_id, name: info.data?.tool_id }
|
|
548
|
-
|
|
549
|
-
const currentStep = findLast(data.steps, s => s.status === 'running') as StepChatStep
|
|
550
|
-
|
|
551
|
-
//There might be a tool with status awaiting_approval, so we want to inform tool has already started
|
|
552
|
-
if (!currentStep || !currentStep?.attempts?.[0]?.tools) {
|
|
553
|
-
data.steps.push({
|
|
554
|
-
id: info.id,
|
|
555
|
-
type: 'tool',
|
|
556
|
-
status: 'running',
|
|
557
|
-
duration: info.duration || 0,
|
|
558
|
-
input: info.data?.input,
|
|
559
|
-
user_question: info.data?.user_question,
|
|
560
|
-
attempts: [{
|
|
561
|
-
tools: [{ ...tool, executionId: info.id, input }],
|
|
562
|
-
}],
|
|
563
|
-
})
|
|
564
|
-
} else {
|
|
565
|
-
const toolInFirstAttempt = findLast(currentStep?.attempts?.[0]?.tools, t => t.executionId === info.id)
|
|
566
|
-
//One step might have multiple tools. When in an approval mode, we might not have all the tools in the array yet.
|
|
567
|
-
//For dynamic tools (id === 'dynamic'), we always push a new tool, since dynamic executions can trigger
|
|
568
|
-
//multiple tool runs in the same step and do not follow the planned tool structure.
|
|
569
|
-
//So we make sure to add any tools that are not in there, or always add for dynamic tools.
|
|
570
|
-
if (!toolInFirstAttempt || isDynamicTool(info)) {
|
|
571
|
-
currentStep.attempts?.[0].tools?.push({
|
|
572
|
-
...tool,
|
|
573
|
-
executionId: info.id,
|
|
574
|
-
input,
|
|
575
|
-
status: 'running',
|
|
576
|
-
})
|
|
577
|
-
} else {
|
|
578
|
-
const input = formatJson(info.data.input)
|
|
579
|
-
if (info.data.attempt === 1) {
|
|
580
|
-
toolInFirstAttempt.input = input
|
|
581
|
-
} else {
|
|
582
|
-
currentStep.attempts[info.data.attempt - 1] ??= { tools: [] }
|
|
583
|
-
currentStep.attempts[info.data.attempt - 1].tools?.push({
|
|
584
|
-
...tool,
|
|
585
|
-
executionId: info.id,
|
|
586
|
-
input,
|
|
587
|
-
})
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
if (info.type === 'tool' && info.action === 'end') {
|
|
594
|
-
const currentStep = data.steps.find(s => s.status === 'running') as StepChatStep
|
|
595
|
-
if (!currentStep || !info.data) return
|
|
596
|
-
|
|
597
|
-
// attempt index for tool execution starts at 0 for dynamically executed tools,while for planned tools it starts at 1
|
|
598
|
-
const attempt = isDynamicTool(info) ? info.data.attempt : info.data.attempt - 1
|
|
599
|
-
const tool = last(currentStep?.attempts?.[attempt]?.tools)
|
|
600
|
-
if (tool) {
|
|
601
|
-
tool.output = formatJson(info.data.output)
|
|
602
|
-
tool.duration = info.duration
|
|
603
|
-
tool.status = 'success'
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
if (info.type === 'final_answer' && info.action === 'start') {
|
|
608
|
-
const answerStep = last(data.steps)
|
|
609
|
-
if (answerStep) answerStep.status = 'running'
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
if (info.type === 'chat' && info.action === 'end') {
|
|
614
|
-
const lastStep = last(data.steps)
|
|
615
|
-
if (lastStep?.type === 'answer') {
|
|
616
|
-
lastStep.status = 'success'
|
|
617
|
-
lastStep.duration = info.duration
|
|
618
|
-
} else {
|
|
619
|
-
data.steps.push({ id: 'answer', type: 'answer', status: 'success' })
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
return new StreamedJson({
|
|
625
|
-
eventsPromise: events,
|
|
626
|
-
abortController,
|
|
627
|
-
minChangeIntervalMS,
|
|
628
|
-
ignoreKeys: ['agent_info'],
|
|
629
|
-
transform,
|
|
630
|
-
textFromErrorEvent: data => data.answer ?? 'Unknown error',
|
|
631
|
-
})
|
|
632
|
-
}
|
|
633
|
-
|
|
634
369
|
contentDependencies = this.query(removeAuthorizationParam(
|
|
635
370
|
getContentDependenciesV1ContentContentTypeContentIdDependenciesGet as ReplaceResult<
|
|
636
371
|
typeof getContentDependenciesV1ContentContentTypeContentIdDependenciesGet,
|
|
637
372
|
FixedDependencyResponse
|
|
638
373
|
>,
|
|
639
374
|
))
|
|
375
|
+
|
|
640
376
|
}
|
|
641
377
|
|
|
642
378
|
export const aiClient = new AIClient()
|
|
@@ -36,7 +36,6 @@ import {
|
|
|
36
36
|
listRuntime,
|
|
37
37
|
listTenant,
|
|
38
38
|
listVpns,
|
|
39
|
-
providers,
|
|
40
39
|
putCertificateTags,
|
|
41
40
|
putCidrTags,
|
|
42
41
|
putDnsZoneTags,
|
|
@@ -72,10 +71,6 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
|
|
|
72
71
|
* Get list of foundations folders or folder by id
|
|
73
72
|
*/
|
|
74
73
|
getFolder = this.query(removeAuthorizationParam(getFolder))
|
|
75
|
-
/**
|
|
76
|
-
* Get list of providers for a foundation
|
|
77
|
-
*/
|
|
78
|
-
listProviders = this.query(removeAuthorizationParam(providers))
|
|
79
74
|
/**
|
|
80
75
|
* Create a foundation
|
|
81
76
|
*/
|
|
@@ -225,12 +220,12 @@ class CloudPlatformClient extends ReactQueryNetworkClient {
|
|
|
225
220
|
*/
|
|
226
221
|
deleteDnsRecord = this.mutation(removeAuthorizationParam(deleteDnsRecord))
|
|
227
222
|
/**
|
|
228
|
-
* Delete a VPN
|
|
229
|
-
*/
|
|
223
|
+
* Delete a VPN
|
|
224
|
+
*/
|
|
230
225
|
deleteVPN = this.mutation(removeAuthorizationParam(deleteVpn))
|
|
231
226
|
/**
|
|
232
|
-
* Delete a CIDR
|
|
233
|
-
*/
|
|
227
|
+
* Delete a CIDR
|
|
228
|
+
*/
|
|
234
229
|
deleteCidr = this.mutation(removeAuthorizationParam(deleteCidr))
|
|
235
230
|
}
|
|
236
231
|
|