+
{t}
@@ -286,8 +286,8 @@ function SourceEditor({
自定义路径
{customPaths.length > 0 && (
- {customPaths.map((p, i) => (
-
+ {customPaths.map((p) => (
+
{p}
diff --git a/web/src/hooks/useChat.ts b/web/src/hooks/useChat.ts
index 4cb6522..5eb7ff8 100644
--- a/web/src/hooks/useChat.ts
+++ b/web/src/hooks/useChat.ts
@@ -236,7 +236,7 @@ export function useChat(): UseChatReturn {
id: msg.id,
role: role as ChatMessage['role'],
content: msg.content,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: msg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'message',
attachments: msg.attachments,
subagentTaskId: msg.subagent_task_id,
@@ -249,7 +249,7 @@ export function useChat(): UseChatReturn {
id: msg.id,
role: 'tool',
content: msg.content,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: msg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'tool_call',
toolName: msg.tool_name,
toolCallId: msg.tool_call_id,
@@ -264,7 +264,7 @@ export function useChat(): UseChatReturn {
id: msg.id,
role: 'tool',
content: msg.content,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: msg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'tool_result',
toolName: msg.tool_name,
toolCallId: msg.tool_call_id,
@@ -278,7 +278,7 @@ export function useChat(): UseChatReturn {
id: msg.id,
role: 'tool',
content: `${msg.content}\n\n${msg.resume_hint}`,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: msg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'tool_pending',
toolName: msg.tool_name,
toolCallId: msg.tool_call_id,
@@ -302,7 +302,7 @@ export function useChat(): UseChatReturn {
id: generateMessageId(),
role: 'assistant',
content: `Error: ${message.message}`,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: message.timestamp ?? Math.floor(Date.now() / 1000),
type: 'message',
}
}
@@ -362,7 +362,7 @@ export function useChat(): UseChatReturn {
id: generateMessageId(),
role: 'assistant',
content: `Error: ${errMsg.message}`,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: errMsg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'message',
}
setSubAgentStack((prev) => {
@@ -423,7 +423,7 @@ export function useChat(): UseChatReturn {
id: generateMessageId(),
role: 'assistant',
content: `Error: ${errMsg.message}`,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: errMsg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'message',
}
const newStack = [...prev]
@@ -800,7 +800,7 @@ export function useChat(): UseChatReturn {
id: msg.id,
role,
content: msg.content,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: msg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'message',
attachments: msg.attachments,
reasoningContent: msg.reasoning_content,
@@ -833,7 +833,7 @@ export function useChat(): UseChatReturn {
id: msg.id,
role: 'tool',
content: msg.content,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: msg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'tool_call',
toolName: msg.tool_name,
toolCallId: msg.tool_call_id,
@@ -856,7 +856,7 @@ export function useChat(): UseChatReturn {
id: msg.id,
role: 'tool',
content: msg.content,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: msg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'tool_result',
toolName: msg.tool_name,
toolCallId: msg.tool_call_id,
@@ -877,7 +877,7 @@ export function useChat(): UseChatReturn {
id: msg.id,
role: 'tool',
content: `${msg.content}\n\n${msg.resume_hint}`,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: msg.timestamp ?? Math.floor(Date.now() / 1000),
type: 'tool_pending',
toolName: msg.tool_name,
toolCallId: msg.tool_call_id,
@@ -893,7 +893,7 @@ export function useChat(): UseChatReturn {
id: generateMessageId(),
role: 'assistant',
content: (message as { type: 'execution_cancelled'; message: string }).message,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: message.timestamp ?? Math.floor(Date.now() / 1000),
type: 'message',
},
])
@@ -910,7 +910,7 @@ export function useChat(): UseChatReturn {
id: generateMessageId(),
role: 'assistant',
content: `Error: ${message.message}`,
- timestamp: (message as any).timestamp ?? Math.floor(Date.now() / 1000),
+ timestamp: message.timestamp ?? Math.floor(Date.now() / 1000),
type: 'message',
},
])
diff --git a/web/src/types/protocol.ts b/web/src/types/protocol.ts
index 1822ea5..a21a7a7 100644
--- a/web/src/types/protocol.ts
+++ b/web/src/types/protocol.ts
@@ -260,6 +260,7 @@ export interface TaskMessagesLoaded {
export interface ExecutionCancelled {
type: 'execution_cancelled'
message: string
+ timestamp?: number
}
export interface StreamDelta {