mtxuilib 0.1.126 → 0.1.128

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.
@@ -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: "Send a message.", className: "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
+ }, 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
  }
@@ -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" });
@@ -42,10 +42,14 @@ export const vcDeployTool = {
42
42
  });
43
43
  yield (_jsx(BotCard, { children: _jsx("div", { children: "\u6B63\u5728\u6267\u884C\u672C\u5730 build \uFF0C\u65E5\u5FD7\u8F93\u51FA\u5230\uFF1A .vol/gitProjectLogs/vc_deploy_build.log" }) }));
44
44
  const vcBuildLog = resolve(".vol/gitProjectLogs/vc_deploy_build.log");
45
- await exec(`bash -c "npx vercel build --prod --token=${vercelToken} --local-config vercel.json"`, {
45
+ await exec(`bash -c "env && bun vercel build --prod --token=${vercelToken} --local-config vercel.json"`, {
46
46
  shell: true,
47
47
  cwd: projectDir,
48
48
  logPath: vcBuildLog,
49
+ env: {
50
+ ...process.env,
51
+ NEXT_BUILD_OUTPUT: ".next",
52
+ },
49
53
  });
50
54
  yield (_jsx(BotCard, { children: _jsx("div", { children: "build \u5B8C\u6210\uFF0C\u51C6\u5907\u63A8\u9001\u5230vercel" }) }));
51
55
  await exec(`bunx vercel deploy --prod --prebuilt --token=${vercelToken} --local-config vercel.json`, {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mtxuilib",
3
3
  "private": false,
4
- "version": "0.1.126",
4
+ "version": "0.1.128",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },