build:lint
This commit is contained in:
parent
1c4a4525b3
commit
0ad91e1bab
|
|
@ -8,6 +8,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|||
|
||||
import { ConversationEmptyState } from "@/components/ai-elements/conversation";
|
||||
import { usePromptInputController } from "@/components/ai-elements/prompt-input";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import {
|
||||
DevDialog,
|
||||
|
|
@ -27,18 +28,16 @@ import {
|
|||
ArtifactFileList,
|
||||
useArtifacts,
|
||||
} from "@/components/workspace/artifacts";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { DevTodoList } from "@/components/workspace/dev-todo-list";
|
||||
import { IframeTestPanel } from "@/components/workspace/iframe-test-panel";
|
||||
import { InputBox } from "@/components/workspace/input-box";
|
||||
import { MessageList } from "@/components/workspace/messages";
|
||||
import { ThreadContext } from "@/components/workspace/messages/context";
|
||||
import { ThreadTitle } from "@/components/workspace/thread-title";
|
||||
import { TodoList } from "@/components/workspace/todo-list";
|
||||
import { Tooltip } from "@/components/workspace/tooltip";
|
||||
import { Welcome } from "@/components/workspace/welcome";
|
||||
import { useSpecificChatMode } from "@/components/workspace/use-chat-mode";
|
||||
import { IframeTestPanel } from "@/components/workspace/iframe-test-panel";
|
||||
import { useSelectedSkillListener } from "@/hooks/use-selected-skill-listener";
|
||||
import { Welcome } from "@/components/workspace/welcome";
|
||||
import { useI18n } from "@/core/i18n/hooks";
|
||||
import { useNotification } from "@/core/notification/hooks";
|
||||
import { useLocalSettings } from "@/core/settings";
|
||||
|
|
@ -52,6 +51,7 @@ import {
|
|||
} from "@/core/threads/utils";
|
||||
import { uuid } from "@/core/utils/uuid";
|
||||
import { env } from "@/env";
|
||||
import { useSelectedSkillListener } from "@/hooks/use-selected-skill-listener";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
export default function ChatPage() {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
"use client";
|
||||
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { useCallback, useEffect, useLayoutEffect, useState } from "react";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import { Toaster } from "@/components/ui/sonner";
|
||||
import { useCallback, useEffect, useLayoutEffect, useState } from "react";
|
||||
|
||||
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";
|
||||
import { Toaster } from "@/components/ui/sonner";
|
||||
import { WorkspaceSidebar } from "@/components/workspace/workspace-sidebar";
|
||||
import { getLocalSettings, useLocalSettings } from "@/core/settings";
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import {
|
|||
} from "react";
|
||||
import { toast } from "sonner";
|
||||
import { Streamdown } from "streamdown";
|
||||
import { DropdownSelector } from "@/components/ui/dropdown-selector";
|
||||
|
||||
import {
|
||||
Artifact,
|
||||
|
|
@ -31,6 +30,7 @@ import {
|
|||
ArtifactHeader,
|
||||
ArtifactTitle,
|
||||
} from "@/components/ai-elements/artifact";
|
||||
import { DropdownSelector } from "@/components/ui/dropdown-selector";
|
||||
import { Select, SelectItem } from "@/components/ui/select";
|
||||
import {
|
||||
SelectContent,
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
"use client";
|
||||
|
||||
import { useState } from "react";
|
||||
import { useSearchParams, useRouter } from "next/navigation";
|
||||
import { useIframeSkill } from "@/hooks/use-iframe-skill";
|
||||
import { useState } from "react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { useIframeSkill } from "@/hooks/use-iframe-skill";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ export function InputBox({
|
|||
const searchParams = useSearchParams();
|
||||
const iframeSkill = useIframeSkill();
|
||||
|
||||
const params = useParams() as Record<string, string>;
|
||||
const params = useParams();
|
||||
const threadId = params?.thread_id;
|
||||
const { textInput } = usePromptInputController();
|
||||
const attachments = usePromptInputAttachments();
|
||||
|
|
@ -140,7 +140,7 @@ export function InputBox({
|
|||
const [isFocused, setIsFocused] = useState(false);
|
||||
|
||||
// isNewThread 时禁用收缩,始终保持展开
|
||||
const effectiveIsFocused = isNewThread || isFocused;
|
||||
const effectiveIsFocused = (isNewThread ?? false) || isFocused;
|
||||
|
||||
// 点击外部区域时收起输入框
|
||||
useEffect(() => {
|
||||
|
|
@ -257,7 +257,7 @@ export function InputBox({
|
|||
setFollowupsLoading(true);
|
||||
setFollowups([]);
|
||||
|
||||
fetch(`/api/threads/${threadId}/suggestions`, {
|
||||
fetch(`/api/threads/${String(threadId)}/suggestions`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ messages: [], n: 3 }),
|
||||
|
|
@ -268,7 +268,7 @@ export function InputBox({
|
|||
return await res.json();
|
||||
})
|
||||
.then((data) => {
|
||||
const suggestions = (data.suggestions || [])
|
||||
const suggestions = (data.suggestions ?? [])
|
||||
.filter(Boolean)
|
||||
.slice(0, 5);
|
||||
setFollowups(suggestions);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ export const enUS: Translations = {
|
|||
placeholder: "How can I assist you today?",
|
||||
createSkillPrompt:
|
||||
"We're going to build a new skill step by step with `skill-creator`. To start, what do you want this skill to do?",
|
||||
sendMessagePrice:
|
||||
"Please note, this feature will consume tokens. Ensure your account balance is greater than 200 credits.",
|
||||
addAttachments: "Add attachments",
|
||||
selectSkill: "Select Skill",
|
||||
mode: "Mode",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { useSearchParams } from "next/navigation";
|
||||
import { useEffect, useCallback, useState, useRef } from "react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
import { bootstrapRemoteSkill } from "@/core/skills/api";
|
||||
|
||||
/** 宿主页发过来的 selectedSkill 消息结构 */
|
||||
|
|
@ -121,9 +122,9 @@ export function useSelectedSkillListener({
|
|||
}, [threadId, searchParams, performBootstrap]);
|
||||
|
||||
const handleMessage = useCallback(
|
||||
async (event: MessageEvent) => {
|
||||
(event: MessageEvent) => {
|
||||
const data = event.data as SelectedSkillMessage;
|
||||
if (!data || data.type !== "selectedSkill") return;
|
||||
if (data?.type !== "selectedSkill") return;
|
||||
|
||||
const { id, title } = data;
|
||||
console.log("[useSelectedSkillListener] 收到 postMessage selectedSkill:", data);
|
||||
|
|
|
|||
Loading…
Reference in New Issue