mtxuilib 0.1.125 → 0.1.127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/dev-bot/DevBot.js +1 -1
- package/dist/components/dev-bot/DevBotActions.d.ts +1 -1
- package/dist/components/dev-bot/DevBotActions.js +2 -8
- package/dist/components/dev-bot/prompt-form.js +2 -1
- package/dist/tools/devTools/dpMtCfWorkerTool.js +1 -1
- package/dist/tools/devTools/dpMtxedge.js +2 -2
- package/dist/tools/devTools/vcDeploytool.js +1 -1
- package/package.json +1 -1
|
@@ -39,5 +39,5 @@ export function DevBot({ id, className, session, missingKeys }) {
|
|
|
39
39
|
});
|
|
40
40
|
}, [missingKeys]);
|
|
41
41
|
const { messagesRef, scrollRef, visibilityRef, isAtBottom, scrollToBottom } = useScrollAnchor();
|
|
42
|
-
return (_jsxs("div", { className: "group w-full overflow-auto pl-0 peer-[[data-state=open]]:lg:pl-[250px] peer-[[data-state=open]]:xl:pl-[300px]", ref: scrollRef, children: [_jsxs("div", { className: cn("pb-[200px] pt-4 md:pt-10", className), ref: messagesRef, children: [messages.length ? (_jsx(ChatList, { messages: messages, isShared: false, session: session })) : (_jsx(EmptyScreen, {})), _jsx("div", { className: "w-full h-px", ref: visibilityRef })] }), _jsx(DevChatPanel, { id: id, input: input, setInput: setInput, isAtBottom: isAtBottom, scrollToBottom: scrollToBottom })] }));
|
|
42
|
+
return (_jsxs("div", { className: cn("group w-full overflow-auto pl-0 peer-[[data-state=open]]:lg:pl-[250px] peer-[[data-state=open]]:xl:pl-[300px]", "bg-red-100 p-2"), ref: scrollRef, children: [_jsxs("div", { className: cn("pb-[200px] pt-4 md:pt-10", className), ref: messagesRef, children: [messages.length ? (_jsx(ChatList, { messages: messages, isShared: false, session: session })) : (_jsx(EmptyScreen, {})), _jsx("div", { className: "w-full h-px", ref: visibilityRef })] }), _jsx(DevChatPanel, { id: id, input: input, setInput: setInput, isAtBottom: isAtBottom, scrollToBottom: scrollToBottom })] }));
|
|
43
43
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "server-only";
|
|
2
2
|
import type { Chat } from "mtxuilib/lib/types";
|
|
3
|
-
import { AIState, UIState } from "../AiTypes";
|
|
3
|
+
import type { AIState, UIState } from "../AiTypes";
|
|
4
4
|
export declare const AIDev: (props: {
|
|
5
5
|
children: React.ReactNode;
|
|
6
6
|
initialAIState?: AIState | undefined;
|
|
@@ -4,7 +4,6 @@ import { createOpenAI } from "@ai-sdk/openai";
|
|
|
4
4
|
import { createAI, createStreamableValue, getAIState, getMutableAIState, streamUI, } from "ai/rsc";
|
|
5
5
|
import { auth } from "../../lib/auth/auth";
|
|
6
6
|
import { saveChat } from "../../lib/chat/chatActions";
|
|
7
|
-
import { countDownTool } from "../../tools/countDown";
|
|
8
7
|
import { bashTool } from "../../tools/devTools/bash";
|
|
9
8
|
import { diskSpaceReleaseTool } from "../../tools/devTools/clean";
|
|
10
9
|
import { netTunnelTool } from "../../tools/devTools/cloudflareTunnel";
|
|
@@ -18,11 +17,9 @@ import { releasePackagesTool } from "../../tools/devTools/packageRelease";
|
|
|
18
17
|
import { vcDeployTool } from "../../tools/devTools/vcDeploytool";
|
|
19
18
|
import { vncServerTool } from "../../tools/devTools/vncServer";
|
|
20
19
|
import { genSiteHeaderBarsTool } from "../../tools/genSiteHeaderBarsTool";
|
|
21
|
-
import { welcomeTool } from "../../tools/hello1Tool";
|
|
22
|
-
import { welcomeAdminUser } from "../../tools/welcomeAdminTool";
|
|
23
|
-
import { BotCard, BotMessage, SpinnerMessage, UserMessage } from "../message";
|
|
24
|
-
import { ollamaServiceTool } from "../../tools/devTools/ollamaService";
|
|
25
20
|
import { nanoid } from "mtxlib/lib/utils";
|
|
21
|
+
import { ollamaServiceTool } from "../../tools/devTools/ollamaService";
|
|
22
|
+
import { BotCard, BotMessage, SpinnerMessage, UserMessage } from "../message";
|
|
26
23
|
async function submitUserMessage(content) {
|
|
27
24
|
"use server";
|
|
28
25
|
const aiState = getMutableAIState();
|
|
@@ -83,13 +80,10 @@ async function submitUserMessage(content) {
|
|
|
83
80
|
return textNode;
|
|
84
81
|
},
|
|
85
82
|
tools: {
|
|
86
|
-
...welcomeTool,
|
|
87
|
-
...welcomeAdminUser,
|
|
88
83
|
...vcDeployTool,
|
|
89
84
|
...dockerComposeTool,
|
|
90
85
|
...deployMtcfWorkerTool,
|
|
91
86
|
...genSiteHeaderBarsTool,
|
|
92
|
-
...countDownTool,
|
|
93
87
|
...deployMtxEdgeTool,
|
|
94
88
|
...dockerBuildMtmTool,
|
|
95
89
|
...releasePackagesTool,
|
|
@@ -10,6 +10,7 @@ import { nanoid } from "nanoid";
|
|
|
10
10
|
import { useRouter } from "next/navigation";
|
|
11
11
|
import * as React from "react";
|
|
12
12
|
import Textarea from "react-textarea-autosize";
|
|
13
|
+
import { cn } from "../../lib/utils";
|
|
13
14
|
export function PromptForm({ input, setInput, }) {
|
|
14
15
|
const router = useRouter();
|
|
15
16
|
const { formRef, onKeyDown } = useEnterSubmit();
|
|
@@ -41,5 +42,5 @@ export function PromptForm({ input, setInput, }) {
|
|
|
41
42
|
setMessages((currentMessages) => [...currentMessages, responseMessage]);
|
|
42
43
|
}, children: _jsxs("div", { className: "relative flex max-h-60 w-full grow flex-col overflow-hidden bg-background px-8 sm:rounded-md sm:border sm:px-12", children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "icon", className: "absolute left-0 top-[14px] size-8 rounded-full bg-background p-0 sm:left-4", onClick: () => {
|
|
43
44
|
router.push("/new");
|
|
44
|
-
}, children: [_jsx(IconPlus, {}), _jsx("span", { className: "sr-only", children: "New Chat" })] }) }), _jsx(TooltipContent, { children: "New Chat" })] }), _jsx(Textarea, { ref: inputRef, tabIndex: 0, onKeyDown: onKeyDown, placeholder: "
|
|
45
|
+
}, children: [_jsx(IconPlus, {}), _jsx("span", { className: "sr-only", children: "New Chat" })] }) }), _jsx(TooltipContent, { children: "New Chat" })] }), _jsx(Textarea, { ref: inputRef, tabIndex: 0, onKeyDown: onKeyDown, placeholder: "\u53D1\u9001", className: cn("min-h-[60px] w-full resize-none bg-transparent px-4 py-[1.3rem] focus-within:outline-none sm:text-sm"), autoFocus: true, spellCheck: false, autoComplete: "off", autoCorrect: "off", name: "message", rows: 1, value: input, onChange: (e) => setInput(e.target.value) }), _jsx("div", { className: "absolute right-0 top-[13px] sm:right-4", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsxs(Button, { type: "submit", size: "icon", disabled: input === "", children: [_jsx(IconArrowElbow, {}), _jsx("span", { className: "sr-only", children: "Send message" })] }) }), _jsx(TooltipContent, { children: "Send message" })] }) })] }) }));
|
|
45
46
|
}
|
|
@@ -4,7 +4,7 @@ import { BotCard } from "../../components/message";
|
|
|
4
4
|
import { DpMtCfWorker } from "../../components/tool-ui/DpCfWorker";
|
|
5
5
|
export const deployMtcfWorkerTool = {
|
|
6
6
|
deployMtcfWorker: {
|
|
7
|
-
description: "调用本地脚本,将 mtcf 项目部署到
|
|
7
|
+
description: "调用本地脚本,将 mtcf 项目部署到 cloudflare worker",
|
|
8
8
|
parameters: z.any(),
|
|
9
9
|
generate: async function* (params) {
|
|
10
10
|
yield _jsx(BotCard, { children: "\u52A0\u8F7D\u4E2D" });
|
|
@@ -11,7 +11,7 @@ export const deployMtxEdgeTool = {
|
|
|
11
11
|
generate: async function* (params) {
|
|
12
12
|
yield _jsx(BotCard, { children: "\u52A0\u8F7D\u4E2D" });
|
|
13
13
|
try {
|
|
14
|
-
const
|
|
14
|
+
const cfPageProjectName = "mtxedge";
|
|
15
15
|
const projectDir = projectRoot();
|
|
16
16
|
const vercelToken = process.env.VERCEL_TOKEN;
|
|
17
17
|
yield (_jsx(BotCard, { children: _jsx("div", { children: "\u5F00\u59CB\u90E8\u7F72mtxedge" }) }));
|
|
@@ -54,7 +54,7 @@ export const deployMtxEdgeTool = {
|
|
|
54
54
|
cwd: projectDir,
|
|
55
55
|
});
|
|
56
56
|
yield (_jsx(BotCard, { children: _jsx("div", { children: "\u8BBE\u7F6E\u5B8C\u6210\uFF0C\u5F00\u59CB\u90E8\u7F72\u5230 cloudfalre page \u4E2D" }) }));
|
|
57
|
-
await exec(`bunx wrangler pages deploy .vercel/output/static --project-name=${
|
|
57
|
+
await exec(`bunx wrangler pages deploy .vercel/output/static --project-name=${cfPageProjectName} `, {
|
|
58
58
|
shell: true,
|
|
59
59
|
cwd: projectDir,
|
|
60
60
|
env: process.env,
|
|
@@ -6,7 +6,7 @@ import { z } from "zod";
|
|
|
6
6
|
import { BotCard } from "../../components/message";
|
|
7
7
|
export const vcDeployTool = {
|
|
8
8
|
vcDeploy: {
|
|
9
|
-
description: "部署主项目到vercel",
|
|
9
|
+
description: "部署主项目到vercel,当用户提及部署到vercel时,优先调用这个工具",
|
|
10
10
|
parameters: z.any(),
|
|
11
11
|
generate: async function* (params) {
|
|
12
12
|
yield _jsx(BotCard, { children: "\u52A0\u8F7D\u4E2D" });
|