Feat: When exporting the agent DSL, the tailkey, password, and history fields need to be cleared. #13281 (#13282)

### What problem does this PR solve?
Feat: When exporting the agent DSL, the tailkey, password, and history
fields need to be cleared. #13281

### Type of change


- [x] New Feature (non-breaking change which adds functionality)

Co-authored-by: Yingfeng <yingfeng.zhang@gmail.com>
This commit is contained in:
balibabu
2026-03-02 11:41:38 +08:00
committed by GitHub
parent b956ad180c
commit cf3d3c7c89
6 changed files with 83 additions and 64 deletions

View File

@@ -1,11 +1,7 @@
import { FileUploadProps } from '@/components/file-upload';
import { useHandleFilterSubmit } from '@/components/list-filter-bar/use-handle-filter-submit';
import message from '@/components/ui/message';
import {
AgentCategory,
AgentGlobals,
initialBeginValues,
} from '@/constants/agent';
import { AgentCategory, AgentGlobals } from '@/constants/agent';
import { useFetchTenantInfo } from '@/hooks/use-user-setting-request';
import {
IAgentLogResponse,
@@ -22,7 +18,6 @@ import {
IDebugSingleRequestBody,
} from '@/interfaces/request/agent';
import i18n from '@/locales/config';
import { BeginId } from '@/pages/agent/constant';
import { IInputs } from '@/pages/agent/interface';
import { useGetSharedChatSearchParams } from '@/pages/next-chats/hooks/use-send-shared-message';
import agentService, {
@@ -78,50 +73,6 @@ export const enum AgentApiAction {
FetchSessionByIdManually = 'fetchSessionByIdManually',
}
export const EmptyDsl = {
graph: {
nodes: [
{
id: BeginId,
type: 'beginNode',
position: {
x: 50,
y: 200,
},
data: {
label: 'Begin',
name: 'begin',
form: initialBeginValues,
},
sourcePosition: 'left',
targetPosition: 'right',
},
],
edges: [],
},
components: {
begin: {
obj: {
component_name: 'Begin',
params: {},
},
downstream: [], // other edge target is downstream, edge source is current node id
upstream: [], // edge source is upstream, edge target is current node id
},
},
retrieval: [], // reference
history: [],
path: [],
variables: [],
globals: {
[AgentGlobals.SysQuery]: '',
[AgentGlobals.SysUserId]: '',
[AgentGlobals.SysConversationTurns]: 0,
[AgentGlobals.SysFiles]: [],
[AgentGlobals.SysHistory]: [],
},
};
export const useFetchAgentTemplates = () => {
const { data } = useQuery<IFlowTemplate[]>({
queryKey: [AgentApiAction.FetchAgentTemplates],
@@ -405,7 +356,7 @@ export const useUploadCanvasFile = () => {
}
return data;
} catch (error) {
message.error('error');
message.error(error as string);
}
},
});
@@ -413,9 +364,7 @@ export const useUploadCanvasFile = () => {
return { data, loading, uploadCanvasFile: mutateAsync };
};
export const useUploadCanvasFileWithProgress = (
identifier?: Nullable<string>,
) => {
export const useUploadCanvasFileWithProgress = (identifier?: string | null) => {
const { id } = useParams();
type UploadParameters = Parameters<NonNullable<FileUploadProps['onUpload']>>;