feat: 完善 Agent 标准交互与安全运行时
- 接入 AG-UI 运行投影、Turn 时间线和审批隔离 - 增加 Agent Skill 冻结绑定与运行时消费闭环 - 增加受控工作区、内置工具和私有 Artifact 生命周期
This commit is contained in:
@@ -166,6 +166,32 @@ export interface SseOptions {
|
||||
onError?: (err: any) => void;
|
||||
onFinished?: () => void;
|
||||
}
|
||||
|
||||
export function resolveApiUrl(url: string) {
|
||||
return apiURL + url;
|
||||
}
|
||||
|
||||
export function createEventStreamHeaders(
|
||||
requestUrl: string,
|
||||
extraHeaders?: HeadersInit,
|
||||
) {
|
||||
const accessStore = useAccessStore();
|
||||
const headers: Record<string, string> = {
|
||||
Accept: 'text/event-stream',
|
||||
'Content-Type': 'application/json',
|
||||
'easyflow-token': accessStore.accessToken || '',
|
||||
};
|
||||
if (extraHeaders) {
|
||||
new Headers(extraHeaders).forEach((value, key) => {
|
||||
headers[key] = value;
|
||||
});
|
||||
}
|
||||
return withWorkflowShareHeader(headers, {
|
||||
requestMethod: 'POST',
|
||||
requestUrl,
|
||||
});
|
||||
}
|
||||
|
||||
export class SseClient {
|
||||
private controller: AbortController | null = null;
|
||||
private currentRequestId = 0;
|
||||
@@ -270,21 +296,7 @@ export class SseClient {
|
||||
}
|
||||
|
||||
private getHeaders(requestUrl: string, extraHeaders?: HeadersInit) {
|
||||
const accessStore = useAccessStore();
|
||||
const headers: Record<string, string> = {
|
||||
Accept: 'text/event-stream',
|
||||
'Content-Type': 'application/json',
|
||||
'easyflow-token': accessStore.accessToken || '',
|
||||
};
|
||||
if (extraHeaders) {
|
||||
new Headers(extraHeaders).forEach((value, key) => {
|
||||
headers[key] = value;
|
||||
});
|
||||
}
|
||||
return withWorkflowShareHeader(headers, {
|
||||
requestMethod: 'POST',
|
||||
requestUrl,
|
||||
});
|
||||
return createEventStreamHeaders(requestUrl, extraHeaders);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user