weifuwu 0.24.1 → 0.24.2
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/README.md +818 -712
- package/cli/template/app.ts +5 -1
- package/cli/template/index.ts +4 -1
- package/cli/template/locales/en.json +6 -1
- package/cli/template/locales/zh-CN.json +6 -1
- package/cli/template/locales/zh-TW.json +6 -1
- package/cli/template/locales/zh.json +6 -1
- package/cli/template/ui/app/globals.css +1 -1
- package/cli/template/ui/app/page.tsx +55 -16
- package/cli.ts +148 -104
- package/dist/agent/rest.d.ts +1 -1
- package/dist/agent/run.d.ts +2 -2
- package/dist/ai/workflow.d.ts +1 -1
- package/dist/ai-sdk.d.ts +1 -1
- package/dist/cli.js +135 -97
- package/dist/cookie.d.ts +24 -0
- package/dist/fts.d.ts +5 -5
- package/dist/iii/index.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +787 -346
- package/dist/live.d.ts +2 -3
- package/dist/logdb/rest.d.ts +1 -1
- package/dist/mailer.d.ts +1 -1
- package/dist/messager/agent.d.ts +2 -2
- package/dist/messager/rest.d.ts +3 -3
- package/dist/messager/ws.d.ts +3 -3
- package/dist/opencode/index.d.ts +1 -1
- package/dist/opencode/permissions.d.ts +1 -1
- package/dist/opencode/run.d.ts +1 -1
- package/dist/opencode/session.d.ts +9 -9
- package/dist/opencode/tools/web.d.ts +1 -1
- package/dist/opencode/ws.d.ts +1 -2
- package/dist/permissions.d.ts +2 -2
- package/dist/postgres/module.d.ts +3 -3
- package/dist/postgres/schema/index.d.ts +1 -1
- package/dist/postgres/schema/table.d.ts +22 -20
- package/dist/postgres/types.d.ts +4 -4
- package/dist/queue/types.d.ts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +135 -90
- package/dist/router.d.ts +10 -10
- package/dist/session.d.ts +1 -2
- package/dist/tenant/graphql.d.ts +2 -2
- package/dist/tenant/index.d.ts +1 -1
- package/dist/tenant/rest.d.ts +2 -2
- package/dist/test-utils.d.ts +3 -3
- package/dist/user/index.d.ts +1 -1
- package/dist/user/oauth-login.d.ts +2 -2
- package/dist/vendor.d.ts +4 -0
- package/opencode/ui/app/globals.css +1 -1
- package/opencode/ui/app/layout.tsx +2 -3
- package/opencode/ui/app/page.tsx +302 -73
- package/package.json +26 -3
- package/cli/template/.weifuwu/ssr/2e3a7e60.js +0 -112
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
// cli/template/ui/app/page.tsx
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
import { useWebsocket, useLoaderData, useLocale, useTheme } from "weifuwu/react";
|
|
4
|
-
|
|
5
|
-
// cli/template/ui/components/Greeting.tsx
|
|
6
|
-
import { jsxs } from "react/jsx-runtime";
|
|
7
|
-
function Greeting({ name }) {
|
|
8
|
-
return /* @__PURE__ */ jsxs("span", { className: "text-red-500 font-bold", children: [
|
|
9
|
-
name,
|
|
10
|
-
"!"
|
|
11
|
-
] });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// cli/template/ui/app/page.tsx
|
|
15
|
-
import { jsx, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
16
|
-
function Home() {
|
|
17
|
-
const [input, setInput] = useState("");
|
|
18
|
-
const { send, lastMessage, readyState } = useWebsocket("/ws/echo");
|
|
19
|
-
const { locale, t, setLocale } = useLocale();
|
|
20
|
-
const { theme, resolvedTheme, setTheme } = useTheme();
|
|
21
|
-
const ld = useLoaderData();
|
|
22
|
-
return /* @__PURE__ */ jsxs2("div", { className: "min-h-screen bg-white dark:bg-gray-950 text-gray-900 dark:text-gray-100", children: [
|
|
23
|
-
/* @__PURE__ */ jsx("header", { className: "border-b dark:border-gray-800", children: /* @__PURE__ */ jsxs2("div", { className: "max-w-5xl mx-auto flex items-center justify-between h-14 px-4", children: [
|
|
24
|
-
/* @__PURE__ */ jsx("span", { className: "font-bold text-lg", children: "weifuwu" }),
|
|
25
|
-
/* @__PURE__ */ jsxs2("nav", { className: "hidden sm:flex gap-6 text-sm", children: [
|
|
26
|
-
/* @__PURE__ */ jsx("span", { className: "hover:text-blue-600 transition cursor-pointer", children: t("nav.home") }),
|
|
27
|
-
/* @__PURE__ */ jsx("span", { className: "hover:text-blue-600 transition cursor-pointer", children: t("nav.docs") }),
|
|
28
|
-
/* @__PURE__ */ jsx("span", { className: "hover:text-blue-600 transition cursor-pointer", children: t("nav.api") })
|
|
29
|
-
] }),
|
|
30
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2 text-sm", children: [
|
|
31
|
-
/* @__PURE__ */ jsx(
|
|
32
|
-
"button",
|
|
33
|
-
{
|
|
34
|
-
onClick: () => setLocale(locale === "en" ? "zh-CN" : "en"),
|
|
35
|
-
className: "px-2 py-1 rounded border dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 transition",
|
|
36
|
-
children: locale === "en" ? "\u4E2D\u6587" : "EN"
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
40
|
-
"button",
|
|
41
|
-
{
|
|
42
|
-
onClick: () => setTheme(resolvedTheme === "light" ? "dark" : "light"),
|
|
43
|
-
className: "px-2 py-1 rounded border dark:border-gray-700 hover:bg-gray-100 dark:hover:bg-gray-800 transition",
|
|
44
|
-
children: resolvedTheme === "light" ? "\u{1F319}" : "\u2600\uFE0F"
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
] })
|
|
48
|
-
] }) }),
|
|
49
|
-
/* @__PURE__ */ jsxs2("section", { className: "text-center py-20 px-4", children: [
|
|
50
|
-
/* @__PURE__ */ jsx("h1", { className: "text-5xl font-bold mb-4", children: t("hero.title") }),
|
|
51
|
-
/* @__PURE__ */ jsx("p", { className: "text-xl text-gray-500 dark:text-gray-400 mb-8", children: t("hero.subtitle") }),
|
|
52
|
-
/* @__PURE__ */ jsx(Greeting, { name: "Weifuwu" }),
|
|
53
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex justify-center gap-4 mt-8", children: [
|
|
54
|
-
/* @__PURE__ */ jsx("a", { href: "#", className: "px-6 py-2.5 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition font-medium", children: t("cta.start") }),
|
|
55
|
-
/* @__PURE__ */ jsx("a", { href: "#", className: "px-6 py-2.5 border dark:border-gray-700 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition font-medium", children: t("cta.learn") })
|
|
56
|
-
] })
|
|
57
|
-
] }),
|
|
58
|
-
ld.features && /* @__PURE__ */ jsx("section", { className: "max-w-4xl mx-auto grid grid-cols-1 md:grid-cols-3 gap-6 px-4 pb-20", children: ld.features.map((f, i) => /* @__PURE__ */ jsxs2("div", { className: "p-6 rounded-xl border dark:border-gray-800 bg-gray-50 dark:bg-gray-900", children: [
|
|
59
|
-
/* @__PURE__ */ jsx("h3", { className: "font-semibold mb-2", children: f.title }),
|
|
60
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: f.desc })
|
|
61
|
-
] }, i)) }),
|
|
62
|
-
/* @__PURE__ */ jsx("section", { className: "max-w-xl mx-auto px-4 pb-20", children: /* @__PURE__ */ jsxs2("div", { className: "border dark:border-gray-800 rounded-xl p-6 bg-gray-50 dark:bg-gray-900 space-y-4", children: [
|
|
63
|
-
/* @__PURE__ */ jsx("h2", { className: "font-semibold", children: t("demo.title") }),
|
|
64
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: readyState === 1 ? t("ws.connected") : readyState === 0 ? t("ws.connecting") : t("ws.disconnected") }),
|
|
65
|
-
/* @__PURE__ */ jsxs2("div", { className: "flex gap-2", children: [
|
|
66
|
-
/* @__PURE__ */ jsx(
|
|
67
|
-
"input",
|
|
68
|
-
{
|
|
69
|
-
value: input,
|
|
70
|
-
onChange: (e) => setInput(e.target.value),
|
|
71
|
-
onKeyDown: (e) => {
|
|
72
|
-
if (e.key === "Enter") {
|
|
73
|
-
send(input);
|
|
74
|
-
setInput("");
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
placeholder: t("demo.placeholder"),
|
|
78
|
-
className: "flex-1 border dark:border-gray-700 rounded px-3 py-2 text-sm bg-white dark:bg-gray-950 outline-none focus:border-blue-500 transition"
|
|
79
|
-
}
|
|
80
|
-
),
|
|
81
|
-
/* @__PURE__ */ jsx(
|
|
82
|
-
"button",
|
|
83
|
-
{
|
|
84
|
-
onClick: () => {
|
|
85
|
-
send(input);
|
|
86
|
-
setInput("");
|
|
87
|
-
},
|
|
88
|
-
className: "px-4 py-2 bg-blue-600 text-white rounded text-sm hover:bg-blue-700 transition font-medium",
|
|
89
|
-
children: t("demo.send")
|
|
90
|
-
}
|
|
91
|
-
)
|
|
92
|
-
] }),
|
|
93
|
-
lastMessage && /* @__PURE__ */ jsxs2("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: [
|
|
94
|
-
/* @__PURE__ */ jsxs2("span", { className: "font-medium", children: [
|
|
95
|
-
t("demo.echo"),
|
|
96
|
-
":"
|
|
97
|
-
] }),
|
|
98
|
-
" ",
|
|
99
|
-
lastMessage
|
|
100
|
-
] })
|
|
101
|
-
] }) }),
|
|
102
|
-
/* @__PURE__ */ jsxs2("footer", { className: "border-t dark:border-gray-800 py-8 text-center text-sm text-gray-500", children: [
|
|
103
|
-
"\xA9 2026 MyApp \xB7 ",
|
|
104
|
-
t("footer.privacy"),
|
|
105
|
-
" \xB7 ",
|
|
106
|
-
t("footer.terms")
|
|
107
|
-
] })
|
|
108
|
-
] });
|
|
109
|
-
}
|
|
110
|
-
export {
|
|
111
|
-
Home as default
|
|
112
|
-
};
|