feat: 添加插件增加source参数

This commit is contained in:
yuwenbinjie
2025-10-11 21:26:01 +08:00
committed by lijunwen.gigoo
parent 5eca4bfa2a
commit 9f760a59f4
28 changed files with 1169 additions and 72 deletions

View File

@ -69,6 +69,8 @@ import {
PluginType,
} from '@coze-arch/bot-api/plugin_develop';
import { type Int64 } from '@coze-arch/bot-api/developer_api';
import { ProductEntityType } from '@coze-arch/bot-api/product_api';
import { PluginSource } from '@coze-arch/bot-api/playground_api';
import s from './index.module.less';
import { type SimplifyProductInfo } from '../../service/fetch-plugin';
@ -249,14 +251,14 @@ export const PluginPanel: React.FC<PluginPanelProps> = ({
const timePrefixText = showPublishTime
? I18n.t('mkl_plugin_publish')
: showCreateTime
? I18n.t('mkl_plugin_created')
: I18n.t('mkl_plugin_updated');
? I18n.t('mkl_plugin_created')
: I18n.t('mkl_plugin_updated');
const timeToShow =
(showPublishTime
? Number(listed_at)
: showCreateTime
? Number(create_time)
: Number(update_time)) || 0;
? Number(create_time)
: Number(update_time)) || 0;
const renderAuthStatus = () => {
if (isUndefined(auth_mode) || auth_mode === PluginAuthMode.NoAuth) {
@ -531,6 +533,10 @@ export const PluginPanel: React.FC<PluginPanelProps> = ({
project_id,
version_name,
version_ts,
plugin_source:
productInfo?.entity_type === ProductEntityType.SaasPlugin
? PluginSource.FromSaas
: PluginSource.Default,
};
// Check whether the name of the Plugins currently to be added has a duplicate name in the added list (the model does not support it, so this is added)
if (
@ -559,6 +565,10 @@ export const PluginPanel: React.FC<PluginPanelProps> = ({
PluginType.PLUGIN,
PluginType.APP,
PluginType.LOCAL,
...(productInfo?.entity_type ===
ProductEntityType.SaasPlugin
? [ProductEntityType.SaasPlugin]
: []),
],
space_id: useSpaceStore.getState().getSpaceId(),
});

View File

@ -22,6 +22,7 @@ import {
type SortType,
} from '@coze-arch/bot-api/product_api';
import { type PluginInfoForPlayground } from '@coze-arch/bot-api/plugin_develop';
import { type PluginSource } from '@coze-arch/bot-api/playground_api';
import { type OrderBy, type PluginApi } from '@coze-arch/bot-api/developer_api';
import { type MineActiveEnum } from '../constants/plugin-modal-constants';
@ -97,6 +98,7 @@ export interface PluginModalModeProps {
project_id?: string;
version_name?: string;
version_ts?: string;
plugin_source?: PluginSource;
},
) => void;
showButton?: boolean;

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
@ -26,6 +25,7 @@ import * as bot_task_common from './namespaces/bot_task_common';
import * as douyin_fenshen from './namespaces/douyin_fenshen';
import * as frontier from './namespaces/frontier';
import * as long_term_memory from './namespaces/long_term_memory';
import * as model from './namespaces/model';
import * as op from './namespaces/op';
import * as open_api_playground from './namespaces/open_api_playground';
import * as playground from './namespaces/playground';
@ -45,6 +45,7 @@ export {
douyin_fenshen,
frontier,
long_term_memory,
model,
op,
open_api_playground,
playground,
@ -63,6 +64,7 @@ export * from './namespaces/bot_task_common';
export * from './namespaces/douyin_fenshen';
export * from './namespaces/frontier';
export * from './namespaces/long_term_memory';
export * from './namespaces/model';
export * from './namespaces/op';
export * from './namespaces/open_api_playground';
export * from './namespaces/playground';
@ -1388,6 +1390,24 @@ export default class PlaygroundApiService<T> {
return this.request({ url, method, data }, options);
}
/** POST /v1/workspaces */
OpenCreateSpace(
req?: open_api_playground.OpenCreateSpaceRequest,
options?: T,
): Promise<open_api_playground.OpenCreateSpaceResponse> {
const _req = req || {};
const url = this.genBaseURL('/v1/workspaces');
const method = 'POST';
const data = {
name: _req['name'],
description: _req['description'],
icon_file_id: _req['icon_file_id'],
coze_account_id: _req['coze_account_id'],
owner_uid: _req['owner_uid'],
};
return this.request({ url, method, data }, options);
}
/** POST /api/playground_api/notice/mark_read */
NoticeMarkRead(
req?: playground.NoticeMarkReadRequest,
@ -1448,6 +1468,7 @@ export default class PlaygroundApiService<T> {
enterprise_id: _req['enterprise_id'],
user_id: _req['user_id'],
coze_account_id: _req['coze_account_id'],
scope: _req['scope'],
};
return this.request({ url, method, params }, options);
}
@ -2214,6 +2235,8 @@ export default class PlaygroundApiService<T> {
tags: _req['tags'],
time_capsule_item_type: _req['time_capsule_item_type'],
iid: _req['iid'],
meta_type: _req['meta_type'],
memory_type: _req['memory_type'],
};
return this.request({ url, method, data }, options);
}
@ -2250,6 +2273,7 @@ export default class PlaygroundApiService<T> {
biz_ids: _req['biz_ids'],
time_capsule_item_type: _req['time_capsule_item_type'],
iids: _req['iids'],
memory_meta_type_map: _req['memory_meta_type_map'],
};
return this.request({ url, method, data }, options);
}
@ -2352,5 +2376,114 @@ export default class PlaygroundApiService<T> {
};
return this.request({ url, method, params }, options);
}
/** POST /v1/workspaces/:workspace_id/members/apply */
OpenApplyJoinSpace(
req?: open_api_playground.OpenApplyJoinSpaceRequest,
options?: T,
): Promise<open_api_playground.OpenApplyJoinSpaceResponse> {
const _req = req || {};
const url = this.genBaseURL(
`/v1/workspaces/${_req['workspace_id']}/members/apply`,
);
const method = 'POST';
const data = { user_ids: _req['user_ids'] };
return this.request({ url, method, data }, options);
}
/** DELETE /v1/workspaces/:workspace_id */
OpenRemoveSpace(
req?: open_api_playground.OpenRemoveSpaceRequest,
options?: T,
): Promise<open_api_playground.OpenRemoveSpaceResponse> {
const _req = req || {};
const url = this.genBaseURL(`/v1/workspaces/${_req['workspace_id']}`);
const method = 'DELETE';
return this.request({ url, method }, options);
}
/**
* POST /api/playground_api/get_type_list
*
* 获取空间下的模型列表从develpper_api迁移过来
*/
GetTypeList(
req?: playground.GetTypeListRequest,
options?: T,
): Promise<playground.GetTypeListResponse> {
const _req = req || {};
const url = this.genBaseURL('/api/playground_api/get_type_list');
const method = 'POST';
const data = {
model: _req['model'],
voice: _req['voice'],
raw_model: _req['raw_model'],
space_id: _req['space_id'],
cur_model_id: _req['cur_model_id'],
cur_model_ids: _req['cur_model_ids'],
model_scene: _req['model_scene'],
tag_filters: _req['tag_filters'],
};
return this.request({ url, method, data }, options);
}
/**
* POST /api/playground_api/get_coze_lane_info
*
* 根据用户信息、权益信息等获取泳道信息并设置到cookie
*/
GetCozeLaneInfo(
req?: playground.GetCozeLaneInfoRequest,
options?: T,
): Promise<playground.GetCozeLaneInfoResponse> {
const url = this.genBaseURL('/api/playground_api/get_coze_lane_info');
const method = 'POST';
return this.request({ url, method }, options);
}
/** PUT /v1/workspaces/:workspace_id/members/:user_id */
OpenUpdateSpaceMember(
req?: open_api_playground.OpenUpdateSpaceMemberRequest,
options?: T,
): Promise<open_api_playground.OpenUpdateSpaceMemberResponse> {
const _req = req || {};
const url = this.genBaseURL(
`/v1/workspaces/${_req['workspace_id']}/members/${_req['user_id']}`,
);
const method = 'PUT';
const data = { role_type: _req['role_type'] };
return this.request({ url, method, data }, options);
}
/** GET /v1/bots/:bot_id/versions */
OpenListBotVersions(
req?: open_api_playground.OpenListBotVersionsRequest,
options?: T,
): Promise<open_api_playground.OpenListBotVersionsResponse> {
const _req = req || {};
const url = this.genBaseURL(`/v1/bots/${_req['bot_id']}/versions`);
const method = 'GET';
const params = {
page_num: _req['page_num'],
page_size: _req['page_size'],
publish_status: _req['publish_status'],
connector_id: _req['connector_id'],
};
return this.request({ url, method, params }, options);
}
/** POST /v1/bots/:bot_id/collaboration_mode */
OpenSwitchBotDevelopMode(
req?: open_api_playground.OpenSwitchBotDevelopModeRequest,
options?: T,
): Promise<open_api_playground.OpenSwitchBotDevelopModeResponse> {
const _req = req || {};
const url = this.genBaseURL(
`/v1/bots/${_req['bot_id']}/collaboration_mode`,
);
const method = 'POST';
const data = { collaboration_mode: _req['collaboration_mode'] };
return this.request({ url, method, data }, options);
}
}
/* eslint-enable */

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
@ -295,6 +294,11 @@ export enum ParamSource {
Variable = 1,
}
export enum PluginSource {
Default = 0,
FromSaas = 1,
}
export enum PromptMode {
Standard = 0,
/** 前缀提示词 */
@ -414,6 +418,11 @@ export enum TimeCapsuleMode {
On = 1,
}
export enum TimeCapsuleType {
CozeOldTimeCapsule = 0,
VolcanoTimeCapsule = 1,
}
export enum WorkflowMode {
Workflow = 0,
Imageflow = 1,
@ -645,6 +654,8 @@ export interface BotInfo {
/** workflow模式的编排信息 */
layout_info?: LayoutInfo;
business_type?: BusinessType;
time_capsule_type?: TimeCapsuleType;
time_capsule_info?: TimeCapsuleInfo;
}
/** bot信息 for 更新 */
@ -699,7 +710,7 @@ export interface BotInfoForUpdate {
agents?: Array<AgentForUpdate>;
/** Bot种类 */
bot_species?: BotSpecies;
/** bot tag 信息,用户新增字段 */
/** bot tag 信息,用户新增字段存量长期记忆的Bot用这个字段 */
bot_tag_info?: BotTagInfo;
/** filebox 信息 */
filebox_info?: FileboxInfo;
@ -713,6 +724,10 @@ export interface BotInfoForUpdate {
user_query_collect_conf?: UserQueryCollectConf;
/** workflow模式的编排信息 */
layout_info?: LayoutInfo;
/** Bot的长期记忆类型 */
time_capsule_type?: TimeCapsuleType;
/** 新版长期记忆Bot的长期记忆用这个配置 */
time_capsule_info?: TimeCapsuleInfo;
}
export interface BotTagInfo {
@ -1019,6 +1034,8 @@ export interface PluginInfo {
api_id?: string;
/** api name O项目用 */
api_name?: string;
/** 区分插件来源,开源版本使用字段 */
plugin_source?: PluginSource;
}
export interface PluginParameter {
@ -1192,6 +1209,12 @@ export interface TimeCapsuleInfo {
disable_prompt_calling?: DisablePromptCalling;
/** 时间胶囊过期时间单位天0表示永久有效 */
time_capsule_time_to_live?: string;
/** 记忆库id */
memorybase_id?: string;
/** 记忆库名称 */
memorybase_name?: string;
/** 记忆库简介 */
memorybase_desc?: string;
}
export interface Usage {

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
@ -109,6 +108,8 @@ export interface BotInfo {
/** owner_id */
owner_user_id?: string;
folder_id?: string;
/** tts配置 */
media_config?: MediaConfig;
}
export interface BotOnboardingReq {
@ -241,6 +242,10 @@ export interface ChatV3Request {
/** key=参数名 value=值 传递给 workflows parameters 参数 */
parameters?: string;
enable_card?: boolean;
/** 发布状态published_online / unpublished_draft。默认 published_online不传等同 published_online */
publish_status?: string;
/** 指定 bot 版本不传取最新版本publish_status=unpublished_draft 时此参数无效 */
bot_version?: string;
}
/** no stream */
@ -405,6 +410,11 @@ export interface KnowledgeInfo {
name?: string;
}
export interface MediaConfig {
/** 是否关闭语音通话true:关闭 false:开启 默认为false */
is_voice_call_closed?: boolean;
}
export interface MetaData {
img?: Array<Image>;
file?: Array<File>;
@ -578,6 +588,7 @@ export interface PublishDraftBotData {
export interface PublishDraftBotRequest {
bot_id: string;
connector_ids: Array<string>;
connectors?: Record<string, Record<string, string>>;
}
export interface PublishDraftBotResponse {

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
@ -159,7 +158,7 @@ export interface PresetWebhookTriggerData {
}
/** bot 新增自动化
*/
https://bytedance.larkoffice.com/docx/WQNadMk9HoSuGgxuMNZcfTvTnOh */
export interface TaskInfo {
id: Int64;
id_str: string;

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -14,13 +14,19 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
export type Int64 = string | number;
export enum MetaType {
/** 事件记忆元信息 */
EventMeta = 1,
/** 画像记忆元信息 */
ProfileMeta = 2,
}
export interface LongTermMemoryClearAllRequest {
bot_id: string;
connector_id: string;
@ -36,8 +42,10 @@ export interface LongTermMemoryDeleteRequest {
biz_ids: Array<string>;
/** xmemory使用 1: 原始对话 2: 总结后的话题 3: 精华记忆 */
time_capsule_item_type?: number;
/** xmemory使用 */
/** xmemory使用(如果是火山记忆就是其记忆id) */
iids?: Array<string>;
/** 火山记忆具体类型key:iids, val: meta_type */
memory_meta_type_map?: Record<string, MetaType>;
}
export interface LongTermMemoryDeleteResponse {}
@ -57,6 +65,10 @@ export interface LongTermMemoryItem {
time_capsule_item_type?: number;
/** xmemory记忆的Iid */
iid?: string;
/** 火山记忆元数据类型 */
meta_type?: MetaType;
/** 火山记忆具体类型 */
memory_type?: string;
}
export interface LongTermMemoryListRequest {
@ -91,6 +103,10 @@ export interface LongTermMemoryUpdateRequest {
time_capsule_item_type?: number;
/** xmemory记忆的Iid */
iid?: string;
/** 火山记忆元数据类型 */
meta_type?: MetaType;
/** 火山记忆具体类型 */
memory_type?: string;
}
export interface LongTermMemoryUpdateResponse {}

View File

@ -0,0 +1,290 @@
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
import * as bot_common from './bot_common';
export type Int64 = string | number;
export enum ModelClass {
GPT = 1,
SEED = 2,
Claude = 3,
/** name: MiniMax */
MiniMax = 4,
Plugin = 5,
StableDiffusion = 6,
ByteArtist = 7,
Maas = 9,
/** 废弃:千帆(百度云) */
QianFan = 10,
/** nameGoogle Gemini */
Gemini = 11,
/** name: Moonshot */
Moonshot = 12,
/** name智谱 */
GLM = 13,
/** name: 火山方舟 */
MaaSAutoSync = 14,
/** name通义千问 */
QWen = 15,
/** name: Cohere */
Cohere = 16,
/** name: 百川智能 */
Baichuan = 17,
/** name文心一言 */
Ernie = 18,
/** name: 幻方 */
DeekSeek = 19,
/** name: Llama */
Llama = 20,
StepFun = 23,
Custom = 24,
Other = 999,
}
export enum ModelParamType {
Float = 1,
Int = 2,
Boolean = 3,
String = 4,
}
export enum ModelTagClass {
ModelType = 1,
ModelUserRight = 2,
ModelFeature = 3,
ModelFunction = 4,
ModelPaid = 15,
/** 模型运行时能力 */
ModelAbility = 16,
/** 模型状态 */
ModelStatus = 17,
/** 本期不做 */
Custom = 20,
Others = 100,
}
export enum ModelTagValue {
Flagship = 1,
HighSpeed = 2,
ToolInvocation = 3,
RolePlaying = 4,
LongText = 5,
ImageUnderstanding = 6,
Reasoning = 7,
VideoUnderstanding = 8,
CostPerformance = 9,
CodeSpecialization = 10,
AudioUnderstanding = 11,
}
export enum VideoGenType {
/** 文生视频 */
Text = 1,
/** 首帧 */
ImageFirstFrame = 2,
/** 首尾帧 */
ImageFirstLastFrame = 3,
/** 参考图 */
ReferencePicture = 4,
}
export interface Model {
name?: string;
model_type?: Int64;
model_class?: ModelClass;
/** model icon的url */
model_icon?: string;
model_input_price?: number;
model_output_price?: number;
model_quota?: ModelQuota;
/** model真实名前端计算token用 */
model_name?: string;
model_class_name?: string;
is_offline?: boolean;
model_params?: Array<ModelParameter>;
model_desc?: Array<ModelDescGroup>;
/** 模型功能配置 */
func_config?: Record<
bot_common.ModelFuncConfigType,
bot_common.ModelFuncConfigStatus
>;
/** 方舟模型节点名称 */
endpoint_name?: string;
/** 模型标签 */
model_tag_list?: Array<ModelTag>;
/** user prompt是否必须有且不能为空 */
is_up_required?: boolean;
/** 模型简要描述 */
model_brief_desc?: string;
/** 模型系列 */
model_series?: ModelSeriesInfo;
/** 模型状态 */
model_status_details?: ModelStatusDetails;
/** 模型能力 */
model_ability?: ModelAbility;
model_show_family_id?: string;
hot_flag?: number;
hot_ranking?: number;
online_time?: Int64;
/** 0-用户可见 1-用户不可见 */
config_type?: number;
offline_time?: Int64;
volc_account_id?: string;
/** 秒级时间戳 */
terminate_time?: Int64;
}
export interface ModelAbility {
/** 是否展示cot */
cot_display?: boolean;
/** 是否支持function call */
function_call?: boolean;
/** 是否支持图片理解 */
image_understanding?: boolean;
/** 是否支持视频理解 */
video_understanding?: boolean;
/** 是否支持音频理解 */
audio_understanding?: boolean;
/** 是否支持多模态 */
support_multi_modal?: boolean;
/** 是否支持续写 */
prefill_resp?: boolean;
/** 是否支持视频理解 */
video_gen?: Array<VideoGenType>;
}
export interface ModelDescGroup {
group_name?: string;
desc?: Array<string>;
}
export interface ModelParamClass {
/** 1="Generation diversity", 2="Input and output length", 3="Output format" */
class_id?: number;
label?: string;
}
export interface ModelParamDefaultValue {
default_val: string;
creative?: string;
balance?: string;
precise?: string;
}
export interface ModelParameter {
/** 配置字段如max_tokens */
name: string;
/** 配置字段展示名称 */
label?: string;
/** 配置字段详情描述 */
desc?: string;
/** 类型 */
type: ModelParamType;
/** 数值类型参数,允许设置的最小值 */
min?: string;
/** 数值类型参数,允许设置的最大值 */
max?: string;
/** float类型参数的精度 */
precision?: number;
/** 参数默认值{"default": xx, "creative":xx} */
default_val: ModelParamDefaultValue;
/** 枚举值如response_format支持text,markdown,json */
options?: Array<Option>;
/** 参数分类,"Generation diversity", "Input and output length", "Output format" */
param_class?: ModelParamClass;
custom_flag?: boolean;
}
export interface ModelQuota {
/** 最大总 token 数量 */
token_limit?: number;
/** 最终回复最大 token 数量 */
token_resp?: number;
/** Prompt 系统最大 token 数量 */
token_system?: number;
/** Prompt 用户输入最大 token 数量 */
token_user_in?: number;
/** Prompt 工具输入最大 token 数量 */
token_tools_in?: number;
/** Prompt 工具输出最大 token 数量 */
token_tools_out?: number;
/** Prompt 数据最大 token 数量 */
token_data?: number;
/** Prompt 历史最大 token 数量 */
token_history?: number;
/** Prompt 历史最大 token 数量 */
token_cut_switch?: boolean;
/** 输入成本 */
price_in?: number;
/** 输出成本 */
price_out?: number;
/** systemprompt输入限制如果没有传对输入不做限制 */
system_prompt_limit?: number;
}
export interface ModelSeriesInfo {
series_name?: string;
icon_url?: string;
model_vendor?: string;
model_tips?: string;
}
export interface ModelShowFamily {
id?: Int64;
icon?: string;
iconUrl?: string;
name?: string;
ranking?: number;
}
export interface ModelStatusDetails {
/** 是否为新模型 */
is_new_model?: boolean;
/** 是否是高级模型 */
is_advanced_model?: boolean;
/** 是否是免费模型 */
is_free_model?: boolean;
/** 是否即将下架 */
is_upcoming_deprecated?: boolean;
/** 下架日期 */
deprecated_date?: string;
/** 下架替换的模型 */
replace_model_name?: string;
/** 最近更新信息 */
update_info?: string;
/** 模型特色 */
model_feature?: ModelTagValue;
}
export interface ModelTag {
tag_name?: string;
tag_class?: ModelTagClass;
tag_icon?: string;
tag_descriptions?: string;
}
export interface Option {
/** option展示的值 */
label?: string;
/** 填入的值 */
value?: string;
}
/* eslint-enable */

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
@ -23,6 +22,11 @@ import * as bot_open_api from './bot_open_api';
export type Int64 = string | number;
export interface ListBotVersionsData {
items?: Array<OpenBotVersionInfo>;
has_more?: boolean;
}
export interface OpenAddSpaceMemberData {
/** 成功添加的成员列表 */
added_success_user_ids?: Array<string>;
@ -49,6 +53,65 @@ export interface OpenAddSpaceMemberResponse {
msg: string;
}
export interface OpenApplyJoinSpaceData {
/** 成功申请的用户列表 */
applied_success_user_ids?: Array<string>;
/** 申请失败的用户列表 */
applied_failed_user_ids?: Array<string>;
}
export interface OpenApplyJoinSpaceRequest {
/** 空间ID */
workspace_id?: string;
/** 用户ID列表 */
user_ids?: Array<string>;
}
export interface OpenApplyJoinSpaceResponse {
data?: OpenApplyJoinSpaceData;
code: Int64;
msg: string;
}
export interface OpenBotVersionInfo {
version?: string;
created_at?: Int64;
creator?: OpenCreatorInfo;
publish_status?: string;
/** 发布时用户输入的记录信息 */
changelog?: string;
}
export interface OpenCreateSpaceRequest {
/** 空间名称 */
name?: string;
/** 空间描述 */
description?: string;
/** 空间图标通过上传接口https://www.coze.cn/open/docs/developer_guides/upload_files未指定文件ID则使用默认头像 */
icon_file_id?: string;
/** 组织id */
coze_account_id?: string;
/** 空间所有者id不传则为当前用户 */
owner_uid?: string;
}
export interface OpenCreateSpaceResponse {
data?: OpenCreateSpaceRet;
code: Int64;
msg: string;
}
export interface OpenCreateSpaceRet {
/** 空间id */
id?: string;
}
export interface OpenCreatorInfo {
id?: string;
/** 昵称 */
name?: string;
}
export interface OpenGetBotInfoRequest {
bot_id?: string;
is_published?: boolean;
@ -62,6 +125,20 @@ export interface OpenGetBotInfoResponse {
msg?: string;
}
export interface OpenListBotVersionsRequest {
bot_id?: string;
page_num?: number;
page_size?: number;
publish_status?: string;
connector_id?: string;
}
export interface OpenListBotVersionsResponse {
data?: ListBotVersionsData;
code?: Int64;
msg?: string;
}
export interface OpenRemoveSpaceMemberData {
/** 成功移除的成员列表 */
removed_success_user_ids?: Array<string>;
@ -84,6 +161,16 @@ export interface OpenRemoveSpaceMemberResponse {
msg: string;
}
export interface OpenRemoveSpaceRequest {
/** 空间ID */
workspace_id?: string;
}
export interface OpenRemoveSpaceResponse {
code: Int64;
msg: string;
}
export interface OpenSpace {
/** 空间 id */
id?: string;
@ -97,6 +184,12 @@ export interface OpenSpace {
workspace_type?: string;
/** 企业 id */
enterprise_id?: string;
joined_status?: string;
/** 空间描述 */
description?: string;
owner_uid?: string;
/** 空间管理员 id 列表 */
admin_uids?: Array<string>;
}
export interface OpenSpaceData {
@ -113,6 +206,8 @@ export interface OpenSpaceListRequest {
enterprise_id?: string;
user_id?: string;
coze_account_id?: string;
/** 不传默认 "joined" */
scope?: string;
}
export interface OpenSpaceListResponse {
@ -154,4 +249,28 @@ export interface OpenSpaceMemberListResponse {
code: Int64;
msg: string;
}
export interface OpenSwitchBotDevelopModeRequest {
bot_id?: string;
collaboration_mode?: string;
}
export interface OpenSwitchBotDevelopModeResponse {
code?: Int64;
msg?: string;
}
export interface OpenUpdateSpaceMemberRequest {
/** 空间id */
workspace_id?: string;
/** 更新用户id */
user_id?: string;
/** 更新的用户角色(不允许修改owner只允许变更member/admin -> member/admin) */
role_type?: string;
}
export interface OpenUpdateSpaceMemberResponse {
code?: Int64;
msg?: string;
}
/* eslint-enable */

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
@ -22,6 +21,7 @@
import * as bot_common from './bot_common';
import * as bot_task_common from './bot_task_common';
import * as shortcut_command from './shortcut_command';
import * as model from './model';
import * as user_delete_base from './user_delete_base';
export type Int64 = string | number;
@ -313,6 +313,15 @@ export enum CozeAccountType {
Organization = 2,
}
export enum CreateResourceType {
Agent = 1,
Project = 2,
Knowledge = 3,
Dataset = 4,
Plugin = 5,
Memorybase = 6,
}
export enum DataSetType {
/** 文本 */
Text = 0,
@ -1326,6 +1335,11 @@ export interface BannerConfig {
style?: StyleStatus;
}
export interface BasicSpaceInfo {
SpaceId?: string;
SpaceName?: string;
}
export interface BatchCreateAgentRequest {
space_id: string;
/** draftbotid */
@ -1622,7 +1636,7 @@ export interface BotOptionData {
}
export interface BotPopupInfoData {
bot_popup_count_info: Partial<Record<BotPopupType, Int64>>;
bot_popup_count_info: Record<BotPopupType, Int64>;
}
export interface BotPrompt {
@ -2627,6 +2641,7 @@ export interface DraftBotInfo {
/** 草稿bot状态 */
status?: DraftBotStatus;
BusinessType?: bot_common.BusinessType;
TimeCapsuleType?: bot_common.TimeCapsuleType;
}
/** home_banner end */
@ -3429,6 +3444,13 @@ export interface GetCozeInnerTokenResponse {
token?: string;
}
export interface GetCozeLaneInfoRequest {}
export interface GetCozeLaneInfoResponse {
/** 设置一个泳道cookie */
'set-cookie'?: Array<string>;
}
export interface GetCozeMessageListData {
MessageList: Array<ChatMessage>;
Cursor?: string;
@ -3514,6 +3536,8 @@ export interface GetDraftBotInfoAgwData {
latest_audit_info?: AuditInfo;
/** 抖音分身的bot会有appId */
app_id?: string;
/** 是否有海外下掉功能标记 */
has_overseas_remove_feature?: boolean;
}
export interface GetDraftBotInfoAgwRequest {
@ -4166,6 +4190,14 @@ export interface GetSpaceInviteManageListResponse {
msg?: string;
}
export interface GetSpaceListByAccountIdReq {
AccountId: string;
}
export interface GetSpaceListByAccountIdResp {
Result?: SpaceListResult;
}
export interface GetSpaceListRequest {
/** user_id */
UserId: Int64;
@ -4258,6 +4290,34 @@ export interface GetTaskListByResourceIdResponse {
data?: Record<Int64, GetBotListByResourceIdData>;
}
export interface GetTypeListData {
model_list?: Array<model.Model>;
voice_list?: Array<VoiceType>;
raw_model_list?: Array<model.Model>;
model_show_family_list?: Array<model.ModelShowFamily>;
default_model_id?: Int64;
}
export interface GetTypeListRequest {
model?: boolean;
voice?: boolean;
raw_model?: boolean;
space_id?: string;
/** 当前bot使用的模型ID用于处理cici/doubao同步过来的bot模型不能展示的问题 */
cur_model_id?: string;
/** 兼容MultiAgent有多个cur_model_id */
cur_model_ids?: Array<string>;
/** 模型场景 */
model_scene?: ModelScene;
tag_filters?: Record<model.ModelTagClass, Array<string>>;
}
export interface GetTypeListResponse {
data?: GetTypeListData;
code: Int64;
msg: string;
}
export interface GetUploadAuthTokenData {
ServiceId?: string;
UploadPathPrefix?: string;
@ -4583,6 +4643,8 @@ export interface ImportSpaceUserInfo {
user_id?: string;
/** 用户禁止加入外部团队,只有是外部用户才返回该字段 */
forbid_join_external_space?: boolean;
/** 是否在组织中 */
is_in_organization?: boolean;
}
/** 导入空间用户列表 */
@ -4929,6 +4991,16 @@ export interface MGetObjectDataRsp {
object_data_map: Record<string, string>;
}
export interface MGetOrgSpaceListRequest {
/** 组织id列表 */
organization_ids?: Array<Int64>;
}
export interface MGetOrgSpaceListResponse {
/** key为组织id */
data?: Record<Int64, OrgSpaceListData>;
}
export interface MGetSpaceInfoRequest {
SpaceIds: Array<Int64>;
}
@ -5015,15 +5087,6 @@ export interface MigrateDraftBotRequest {
export interface MigrateDraftBotResponse {}
export interface Model {
name?: string;
model_type?: Int64;
/** 3: ModelClass model_class
4: string model_icon //model icon的url */
model_input_price?: number;
model_output_price?: number;
}
export interface ModelCapability {
/** 上下文长度 */
token_limit?: Int64;
@ -5340,6 +5403,19 @@ export interface OperateSpaceApplyResponse {
msg?: string;
}
export interface OrganizationInfo {
organization_id?: string;
name?: string;
icon_url?: string;
}
export interface OrgSpaceListData {
/** 组织下空间数量 */
space_num?: number;
/** 目前只返回空间数量,后续有需要增加参数返回详情 */
space_list?: Array<BotSpace>;
}
export interface PackResourceRequest {
ResourceList: Array<Resource>;
}
@ -5371,7 +5447,7 @@ export interface Parameter {
}
export interface PicOperationPrompt {
PicOpPrompt?: Partial<Record<PicType, GeneratePicPrompt>>;
PicOpPrompt?: Record<PicType, GeneratePicPrompt>;
}
export interface PicStyleInfo {
@ -6198,6 +6274,10 @@ export interface SpaceConfig {
PublishMemberList?: Array<string>;
/** 是否允许所有成员发布 */
IsAllMemberCanPublish?: boolean;
/** 是否允许创建空间资源(应用、智能体、插件、知识库、数据库) */
CreateResourcePermissionSetting?: Record<CreateResourceType, boolean>;
/** 是否禁止成员创建/修改文件夹不传默认为true */
ForbidMemberUpsertFolder?: boolean;
}
/** 团队设置详情 */
@ -6210,6 +6290,10 @@ export interface SpaceConfigDetails {
is_support_external_users_join_space?: boolean;
/** 是否支持所有成员发布 */
is_support_all_member_publish?: boolean;
/** 是否支持创建资源的开关 */
create_resource_switch?: Record<CreateResourceType, boolean>;
/** 是否禁止创建/编辑文件夹 */
forbid_member_upsert_folder?: boolean;
}
/** 空间配置信息 */
@ -6218,6 +6302,10 @@ export interface SpaceConfigV2 {
is_support_external_users_join_space?: boolean;
/** 是否所有成员都具备发布权限 */
is_all_member_can_publish?: boolean;
/** 空间成员创建资源的开关配置 */
create_resource_switch?: Record<CreateResourceType, boolean>;
/** 是否禁止创建/编辑文件夹 */
forbid_member_upsert_folder?: boolean;
}
export interface SpaceInfo {
@ -6265,6 +6353,10 @@ export interface SpaceInfoForInviteData {
space_id?: string;
/** 企业中创建的空间才有值 */
enterprise_info?: EnterpriseInfo;
/** 若是组织空间,判断是否在组织中 */
is_in_organization?: boolean;
/** 组织中创建的空间才有值 */
organization_info?: OrganizationInfo;
}
export interface SpaceInviteManageInfo {
@ -6316,6 +6408,10 @@ export interface SpaceItem {
member_limit?: Int64;
}
export interface SpaceListResult {
Spaces?: Array<BasicSpaceInfo>;
}
export interface SpaceMemberDetailData {
/** 空间id */
SpaceId: Int64;
@ -6349,6 +6445,8 @@ export interface SpaceMemberDetailData {
OrganizationId?: Int64;
/** 是否可在空间内发布 */
CanPublishInSpace?: boolean;
/** 组织id str */
OrganizationIdStr?: string;
}
export interface SpaceMemberDetailRequest {
@ -6407,6 +6505,8 @@ export interface SpaceMemberDetailV2Data {
member_num_strategy?: ResourceStrategy;
/** 是否可在空间内发布 */
can_publish_in_space?: boolean;
/** 组织id */
organization_id_str?: string;
}
export interface SpaceMemberDetailV2Request {
@ -6629,6 +6729,11 @@ export interface TimeCapsuleInfo {
disable_prompt_calling?: DisablePromptCalling;
/** 时间胶囊过期时间单位天0表示永久有效 */
time_capsule_time_to_live?: Int64;
memorybase_id?: Int64;
/** 记忆库名称 */
memorybase_name?: string;
/** 记忆库简介 */
memorybase_desc?: string;
}
export interface TimeCapsuleInvokeEventRequest {
@ -6932,6 +7037,7 @@ export interface UpdateDraftBotRequest {
BotTagInfos?: Array<BotTagInfo>;
FileboxInfo?: FileboxInfo;
VersionCompat?: bot_common.AgentVersionCompat;
TimeCapsuleType?: bot_common.TimeCapsuleType;
}
export interface UpdateDraftBotResponse {
@ -7101,7 +7207,7 @@ export interface UpdateUserLabelResponse {}
export interface UpdateUserRiskAlertInfoRequest {
risk_alert_type?: RiskAlertType;
switch_info?: Partial<Record<SwitchType, SwitchStatus>>;
switch_info?: Record<SwitchType, SwitchStatus>;
}
export interface UpdateUserRiskAlertInfoResponse {
@ -7210,8 +7316,8 @@ export interface UserLabelInfo {
}
export interface UserRiskAlertInfoData {
RiskAlertInfo?: Partial<Record<RiskAlertType, boolean>>;
SwitchInfo?: Partial<Record<SwitchType, SwitchStatus>>;
RiskAlertInfo?: Record<RiskAlertType, boolean>;
SwitchInfo?: Record<SwitchType, SwitchStatus>;
}
export interface Variable {
@ -7457,6 +7563,8 @@ export interface WorkInfo {
UserQueryCollectConf?: bot_common.UserQueryCollectConf;
/** workflow模式编排数据 */
LayoutInfo?: bot_common.LayoutInfo;
/** 新版火山长期记忆Bot的记忆配置 */
TimeCapsuleInfo?: bot_common.TimeCapsuleInfo;
}
export interface WorkInfoApi {

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
@ -23,12 +22,23 @@ import * as resource_common from './resource_common';
export type Int64 = string | number;
export interface AuthData {
/** 资源类型 */
res_type?: resource_common.ResType;
/** 节点鉴权信息 */
auth_data?: string;
/** 资源ID */
res_id?: Int64;
}
export interface BatchResourceCopyDoRequest {
/** 环境参数 */
ResourceCopyEnv?: resource_common.ResourceCopyEnv;
ResourceLocators?: Array<resource_common.ResourceLocator>;
/** 该资源引用的子资源映射 */
ChildrenCopyResults?: Array<resource_common.ResourceCopyResult>;
/** 导入导出的版本 */
export_version?: resource_common.ExportVersion;
}
export interface BatchResourceCopyDoResponse {
@ -42,6 +52,67 @@ export interface BatchSyncResourceRequest {
export interface BatchSyncResourceResponse {}
export interface ExportPreCheckRequest {
/** 资源类型 */
res_type: resource_common.ResType;
/** 资源ID */
id: Int64;
/** 用户ID */
user_id: Int64;
/** 工作流的commit版本号 */
commitId?: string;
}
export interface ExportPreCheckResponse {
/** 鉴权信息 */
auth_data_list?: Array<AuthData>;
/** 依赖的子资源列表 */
dep_resource_list?: Array<resource_common.ResourceMetaInfo>;
}
export interface GetUploadAuthTokenData {
service_id?: string;
upload_path_prefix?: string;
auth?: UploadAuthTokenInfo;
upload_host?: string;
}
export interface GetUploadAuthTokenRequest {
/** 上传场景,可选值:"export" */
scene?: string;
}
export interface GetUploadAuthTokenResponse {
data?: GetUploadAuthTokenData;
code: Int64;
msg: string;
}
export interface ImportPreCheckRequest {
package_uri: string;
/** 用户ID */
user_id: Int64;
}
export interface ImportPreCheckResponse {
/** 资源的ID */
res_id?: Int64;
/** 资源类型 */
res_type?: resource_common.ResType;
name?: string;
desc?: string;
/** icon的url */
icon_url?: string;
/** icon的uri */
icon_uri?: string;
/** 对话流还是资源流 */
flow_mode?: number;
/** 校验文件的url */
check_file_url?: string;
/** 错误数量 */
error_count?: Int64;
}
export interface LibraryResourceListRequest {
/** 是否由当前用户创建0-不筛选1-当前用户 */
user_filter?: number;
@ -53,8 +124,9 @@ export interface LibraryResourceListRequest {
publish_status_filter?: number;
/** 用户所在空间ID */
space_id: string;
/** 6 : optional i32 page, // 页数首页是1。默认1。
一次读取的数据条数默认10最大100. */
/** 页数首页是1。默认1。 */
page?: number;
/** 一次读取的数据条数默认10最大100. */
size?: number;
/** 8 : optional i32 offset, // 数据记录偏移,含义是从第(offset+1)条记录开始读
游标用于分页默认0第一次请求可以不传后续请求需要带上上次返回的cursor */
@ -69,8 +141,8 @@ export interface LibraryResourceListResponse {
code?: Int64;
msg?: string;
resource_list?: Array<resource_common.ResourceInfo>;
/** 4 : i32 total,
游标用于下次请求的cursor */
total?: number;
/** 游标用于下次请求的cursor */
cursor?: string;
/** 是否还有数据待拉取 */
has_more?: boolean;
@ -104,17 +176,30 @@ export interface LibraryResourceListRpcRequest {
export interface LibraryResourceListRpcResponse {
resource_list?: Array<resource_common.ResourceInfo>;
total?: number;
/** 游标用于下次请求的cursor */
cursor?: string;
/** 是否还有数据待拉取 */
has_more?: boolean;
}
export interface LibraryResourceRecycleRequest {
space_id?: string;
}
export interface LibraryResourceRecycleResponse {
code?: Int64;
msg?: string;
recycle_time_map?: Record<resource_common.ResType, Int64>;
}
export interface MGetDisplayResourceInfoRequest {
/** 最大传一页的数量实现方可以限制最大100个 */
ResIDs?: Array<Int64>;
/** 当前的用户,实现方用于判断权限 */
CurrentUserID?: Int64;
/** 资源类型(为了支持一个服务可以多种资源) */
ResTypeMap?: Record<Int64, resource_common.ResType>;
}
export interface MGetDisplayResourceInfoResponse {
@ -214,6 +299,16 @@ export interface ResourceCopyDispatchRequest {
res_name?: string;
/** 跨空间复制的目标space id */
target_space_id?: string;
/** 资源的元信息 */
res_info?: resource_common.ResourceMetaInfo;
/** 包的地址 */
package_uri?: string;
/** 清理鉴权的节点列表 */
clear_auth_node_list?: Array<string>;
/** 导出的子资源列表 */
export_sub_resource?: Array<resource_common.ResourceMetaInfo>;
/** 导出的资源包的版本 */
export_version?: resource_common.ExportVersion;
}
export interface ResourceCopyDispatchResponse {
@ -235,6 +330,16 @@ export interface ResourceCopyDispatchRpcRequest {
ResName?: string;
/** 跨空间复制的目标space id */
TargetSpaceID?: Int64;
/** 资源的元信息 */
res_info?: resource_common.ResourceMetaInfo;
/** 包的地址 */
package_uri?: string;
/** 清理鉴权的节点列表 */
clear_auth_node_list?: Array<string>;
/** 导出的子资源列表 */
export_sub_resource?: Array<resource_common.ResourceMetaInfo>;
/** 导出的资源包的版本 */
export_version?: resource_common.ExportVersion;
}
export interface ResourceCopyDispatchRpcResponse {
@ -355,6 +460,40 @@ export interface ResourceCopyVisibleRequest {
export interface ResourceCopyVisibleResponse {}
export interface ResourceExportPreCheckRequest {
/** 资源类型 */
res_type: resource_common.ResType;
/** 资源ID */
id: Int64;
/** 用户ID */
user_id: Int64;
/** 工作流的commit版本号 */
commitId?: string;
}
export interface ResourceExportPreCheckResponse {
/** 鉴权信息 */
auth_data_list?: Array<AuthData>;
/** 依赖的子资源列表 */
dep_resource_list?: Array<resource_common.ResourceMetaInfo>;
}
export interface ResourceImportPreCheckRequest {
/** 资源元信息 */
res_meta_info_list: Array<resource_common.ResourceMetaInfo>;
/** 资源列表 */
res_list?: Array<resource_common.ResourceLocator>;
/** 导入导出的版本 */
export_version?: resource_common.ExportVersion;
}
export interface ResourceImportPreCheckResponse {
/** 资源元信息 */
res_meta_info_list: Array<resource_common.ResourceMetaInfo>;
/** 每个资源校验失败的原因 */
fail_reasons?: Record<Int64, Array<resource_common.FailedReasonDetail>>;
}
export interface ResourceRefTreeInProjectRequest {
/** 项目ID */
ProjectID: Int64;
@ -379,4 +518,12 @@ export interface ResourceTaskPreCheckResponse {
export interface SyncResourceCompensateRequest {}
export interface SyncResourceCompensateResponse {}
export interface UploadAuthTokenInfo {
access_key_id?: string;
secret_access_key?: string;
session_token?: string;
expired_time?: string;
current_time?: string;
}
/* eslint-enable */

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
@ -36,6 +35,8 @@ export enum ActionKey {
SwitchToChatflow = 9,
/** 跨空间复制 */
CrossSpaceCopy = 10,
/** 导出 */
Export = 11,
}
export enum CopyStatus {
@ -48,6 +49,11 @@ export enum CopyStatus {
Deleted = 5,
}
export enum ExportVersion {
V1 = 0,
V2 = 1,
}
export enum ProjectResourceActionKey {
/** 重命名 */
Rename = 1,
@ -111,6 +117,12 @@ export enum ResourceCopyScene {
CrossSpaceCopy = 12,
/** 项目跨空间复制 */
CrossSpaceCopyProject = 13,
/** 导出 */
Export = 14,
/** 导入 */
Import = 15,
/** 复制同空间资源库资源 */
CopyResource = 17,
}
export enum ResType {
@ -123,6 +135,7 @@ export enum ResType {
Database = 7,
Variable = 8,
Voice = 9,
Memorybase = 10,
}
export enum SyncOperation {
@ -173,6 +186,12 @@ export interface DisplayResourceInfo {
EditTime?: Int64;
}
/** DSL校验失败原因 */
export interface FailedReasonDetail {
/** 失败原因 */
failed_reason?: string;
}
export interface ProjectResourceAction {
/** 一个操作对应一个唯一的keykey由资源侧约束 */
key: ProjectResourceActionKey;
@ -253,6 +272,8 @@ export interface ResourceCopyEnv {
OriginProjectVersion?: Int64;
/** 0/default-app默认是app也就是之前的project; 1-bot或者叫agent */
ProjectType?: number;
/** 导入导出的版本 */
ExportVersion?: ExportVersion;
}
export interface ResourceCopyFailedReason {
@ -277,6 +298,12 @@ export interface ResourceCopyResult {
TargetResInfo?: string;
/** 复制不成功的原因 */
FailedReason?: string;
/** 资源的IDL */
IDL?: string;
/** 资源的元数据信息 */
ResourceMetaInfo?: ResourceMetaInfo;
/** 包的地址 */
PackageUrl?: string;
}
export interface ResourceCopyTaskDetail {
@ -343,6 +370,31 @@ export interface ResourceLocator {
PublishVersion?: Int64;
/** 资源的当前版本为nil或空字符串都看作是最新版本。项目发布版本或Library发布版本。 */
PublishVersionStr?: string;
/** 工作流可以操作已提交的版本 */
CommitId?: string;
/** 清空鉴权信息 */
ClearAuthNodeIdList?: Array<string>;
/** 资源的基本信息 */
ResourceMetaInfo?: ResourceMetaInfo;
/** 资源的IDL */
IDL?: string;
/** 是不是主资源 */
IsMainResource?: boolean;
}
/** 资源的基本信息 */
export interface ResourceMetaInfo {
res_id?: string;
name?: string;
desc?: string;
icon?: string;
clear_node_id?: Array<string>;
commit_id?: string;
flow_mode?: number;
version?: string;
res_type?: ResType;
icon_url?: string;
auth_data?: string;
}
/** 同步用给ES的关键信息 */

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -14,11 +14,12 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck
import * as resource_common from './resource_common';
export type Int64 = string | number;
export enum IntelligenceTaskActionEventMsgEventType {
@ -31,6 +32,7 @@ export enum IntelligenceTaskActionType {
Copy = 1,
Move = 2,
Publish = 3,
ImportExport = 4,
}
export enum IntelligenceTaskEntityLocationType {
@ -54,6 +56,8 @@ export enum IntelligenceTaskEntityType {
Agent = 10,
Prompt = 11,
Shortcut = 12,
Chux = 13,
Memorybase = 14,
}
export enum IntelligenceTaskStatus {
@ -90,6 +94,14 @@ export enum IntelligenceTaskType {
CrossSpaceCopy = 12,
/** 项目跨空间复制 */
CrossSpaceCopyProject = 13,
/** 导出 */
Export = 14,
/** 导入 */
Import = 15,
/** 发布初见项目 */
PublishChuxProject = 16,
/** 同空间复制资源 */
CopyResource = 17,
}
export interface ExtraInfo {
@ -103,6 +115,16 @@ export interface ExtraInfo {
Icon?: string;
/** agent复制映射关系 */
OldAgentIdToNewIdMap?: Record<Int64, Int64>;
/** 包地址 */
PackageUri?: string;
/** 资源的元数据信息 */
ResInfo?: string;
/** 清理节点鉴权信息的列表 */
ClearAuthNodeList?: string;
/** 导出的子资源信息 */
ExportSubResource?: string;
/** 导入导出包的版本 */
ExportVersion?: string;
}
export interface FailedReasonDetail {
@ -167,6 +189,12 @@ export interface IntelligenceTaskInfo {
CreateTime?: Int64;
/** 更新时间 */
UpdateTime?: Int64;
/** 资源的基本信息 */
ResourceMetaInfo?: resource_common.ResourceMetaInfo;
/** 包地址 */
packageUrl?: string;
/** 目标实体id */
TargetEntityId?: string;
}
export interface IntelligenceTaskLog {}
@ -177,6 +205,8 @@ export interface SourceMapping {
TargetId: Int64;
/** 其他的信息比如plugin的tool映射信息 */
TargetResInfo?: string;
/** 包地址 */
PackageUrl?: string;
}
export interface SubSourceInfo {

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
/* eslint-disable */
/* tslint:disable */
// @ts-nocheck

View File

@ -0,0 +1,5 @@
.explore-list-container {
.spin {
height: 200px;
}
}

View File

@ -0,0 +1,123 @@
/* eslint-disable @coze-arch/tsx-no-leaked-render */
/*
* Copyright 2025 coze-dev Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type FC, useState, useRef, useEffect } from 'react';
import { useInfiniteScroll, useInViewport } from 'ahooks';
import { type ProductInfo } from '@coze-studio/api-schema/marketplace';
import { type explore } from '@coze-studio/api-schema';
import { I18n } from '@coze-arch/i18n';
import { IconCozIllusError } from '@coze-arch/coze-design/illustrations';
import { EmptyState } from '@coze-arch/coze-design';
import styles from './index.module.less';
export enum PluginCateTab {
Local = 'local',
Coze = 'coze',
}
export interface TaskListServiceRes {
list: explore.ProductInfo[];
page: number;
has_more: boolean;
}
function LoadMoreTrigger({ onLoadMore }: { onLoadMore: () => void }) {
const divRef = useRef<HTMLDivElement>(null);
const [isInView] = useInViewport(divRef);
useEffect(() => {
if (!isInView) {
return;
}
onLoadMore?.();
}, [isInView]);
return <div ref={divRef} style={{ height: 1 }} />;
}
export const PageList: FC<{
title: React.ReactNode;
type?: PluginCateTab;
renderCard: (cardData: ProductInfo) => React.ReactNode;
renderCardSkeleton: () => React.ReactNode;
getDataList: (
type?: PluginCateTab,
curData?: TaskListServiceRes,
) => Promise<TaskListServiceRes>;
customFilters?: React.ReactNode;
}> = ({
title,
type,
renderCard,
getDataList,
renderCardSkeleton,
customFilters,
}) => {
const [loadFailed, setLoadFailed] = useState(false);
const {
data: cardList,
loading,
loadMore,
reload,
} = useInfiniteScroll(
async (curData?: TaskListServiceRes) => await getDataList(type, curData),
{
reloadDeps: [type],
isNoMore: d => !d?.has_more,
onFinally: d => {
setLoadFailed(!d?.list.length);
},
},
);
return (
<div className={styles['explore-list-container']}>
{title}
{customFilters}
{loadFailed && !loading ? (
<EmptyState
size="full_screen"
icon={<IconCozIllusError className="coz-fg-dim text-32px" />}
title={I18n.t('inifinit_list_load_fail')}
buttonText={I18n.t('inifinit_list_retry')}
onButtonClick={() => {
reload();
}}
/>
) : (
<div className="grid grid-cols-3 auto-rows-min gap-[20px] [@media(min-width:1600px)]:grid-cols-4 pl-[24px] pr-[24px] pb-[8px]">
{loading
? new Array(20).fill(0).map((_, index) => renderCardSkeleton?.())
: cardList?.list?.map(item => renderCard(item as ProductInfo))}
{cardList?.has_more && (
<LoadMoreTrigger
onLoadMore={() => {
if (!loading) {
loadMore();
}
}}
/>
)}
</div>
)}
</div>
);
};

View File

@ -26,7 +26,11 @@ import { TabBar, Button } from '@coze-arch/coze-design';
import { ProductEntityType } from '@coze-arch/bot-api/product_api';
import useUrlState from '@ahooksjs/use-url-state';
import { PageList, PluginCateTab } from '../../components/page-list';
import {
PageList,
PluginCateTab,
type TaskListServiceRes,
} from '../../components/plugin-page-list';
const { TabPanel } = TabBar;
@ -50,18 +54,38 @@ export const PluginPage = () => {
);
const customFilters = (
<TabBar
className="mt-[24px] mx-[24px]"
tabBarClassName="mb-[20px]"
type="button"
activeKey={tab}
onChange={newTab => {
setState({ tab: newTab as PluginCateTab });
}}
>
<TabPanel tab="本地插件" itemKey={PluginCateTab.Local} />
<TabPanel tab="Coze插件" itemKey={PluginCateTab.Coze} />
</TabBar>
<div className="flex justify-between items-center mt-[12px] mx-[24px]">
<TabBar
tabBarClassName="mb-[20px]"
type="button"
activeKey={tab}
onChange={newTab => {
setState({ tab: newTab as PluginCateTab });
}}
>
<TabPanel tab="本地插件" itemKey={PluginCateTab.Local} />
<TabPanel tab="Coze插件" itemKey={PluginCateTab.Coze} />
</TabBar>
{tab === PluginCateTab.Coze ? (
<Button
className="mx-[24px]"
onClick={() => {
openUsageInvokeModal();
}}
>
</Button>
) : (
<Button
className="mx-[24px]"
onClick={() => {
window.open('https://www.coze.cn/open/docs/guides', '_blank');
}}
>
coze.cn
</Button>
)}
</div>
);
return (
@ -75,14 +99,7 @@ export const PluginPage = () => {
{tab === PluginCateTab.Coze && (
<>
<SearchInput border entityType={ProductEntityType.Plugin} />
<Button
className="mx-[24px]"
onClick={() => {
openUsageInvokeModal();
}}
>
</Button>
<div className="w-[88px]" />
</>
)}
</div>
@ -98,12 +115,26 @@ export const PluginPage = () => {
);
};
const getPluginData = async (type?: PluginCateTab) => {
const result = await explore.PublicGetProductList({
entity_type: entityTypeMap[type || PluginCateTab.Local],
const PAGE_SIZE = 20;
// 滚动加载
const getPluginData = async (
tab?: PluginCateTab,
curData?: TaskListServiceRes,
): Promise<TaskListServiceRes> => {
const reqPageNum = curData ? curData.page + 1 : 1;
const res = await explore.PublicGetProductList({
entity_type: entityTypeMap[tab || PluginCateTab.Local],
sort_type: explore.product_common.SortType.Newest,
page_num: 0,
page_size: 1000,
page_num: reqPageNum,
page_size: PAGE_SIZE,
});
return result.data?.products || [];
const { products = [], has_more = false } = res.data || {};
return {
list: products,
page: reqPageNum,
has_more,
};
};

View File

@ -318,6 +318,7 @@ export const transformVo2Dto = {
api_id: plugin.api_id,
plugin_id: plugin.plugin_id,
api_name: plugin.name,
plugin_source: plugin.plugin_source,
})),
workflow: (
@ -331,7 +332,7 @@ export const transformVo2Dto = {
flow_mode: w.flow_mode,
workflow_name: w.name,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} as any),
}) as any,
),
knowledge: (knowledge: KnowledgeConfig): BotInfoForUpdate['knowledge'] => ({

View File

@ -14,7 +14,6 @@
* limitations under the License.
*/
import { type ShortCutStruct } from '@coze-agent-ide/tool-config/src/shortcut-config/type';
import {
type PluginStatus,
type PluginType,
@ -28,6 +27,7 @@ import {
type DisablePromptCalling,
type RecallStrategy,
type DefaultUserInputType,
type PluginSource,
} from '@coze-arch/bot-api/playground_api';
import { type BotTableRWMode, type FieldItem } from '@coze-arch/bot-api/memory';
import { type Dataset } from '@coze-arch/bot-api/knowledge';
@ -39,6 +39,7 @@ import type {
TaskInfo,
SuggestReplyMode,
} from '@coze-arch/bot-api/developer_api';
import { type ShortCutStruct } from '@coze-agent-ide/tool-config/src/shortcut-config/type';
interface DefaultPluginApi extends PluginApi {
isAuto?: boolean;
@ -47,6 +48,7 @@ interface DefaultPluginApi extends PluginApi {
plugin_type?: PluginType;
is_official?: boolean;
plugin_icon?: string;
plugin_source?: PluginSource;
status?: PluginStatus;
// #endregion
}

View File

@ -102,6 +102,7 @@ export const SkillModal: FC<SkillModalProps> = props => {
api_name: val.name as string,
plugin_version: val.version_ts || '',
is_draft: isDraftByProjectId(val.project_id),
plugin_source: val.plugin_source,
},
]);
},

View File

@ -20,6 +20,7 @@ import {
type APIParameter,
type FCWorkflowSetting,
} from '@coze-arch/idl/workflow_api';
import { type PluginSource } from '@coze-arch/idl/playground_api';
export enum SkillType {
Plugin = 'plugin',
@ -58,6 +59,7 @@ export interface BoundPluginItem {
// Fill in true if it is project, false for resource library
is_draft: boolean;
fc_setting?: PluginFCSetting;
plugin_source?: PluginSource;
}
export interface BoundKnowledgeItem {