This commit is contained in:
2026-01-11 23:21:57 +08:00
parent 704a02f217
commit 7840cbd746
14 changed files with 151 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
import { tool, type Plugin } from "@opencode-ai/plugin"
export const MyPlugin: Plugin = async ({ project, client, $, directory, worktree }) => {
console.log("Plugin initialized!")
return {
// Hook implementations go here
tool: {
mytool: tool({
description: "获取foo的问候语",
args: {
foo: tool.schema.string(),
},
async execute(args, ctx) {
return `Hello ${args.foo}!`
},
}),
}
}
}

View File

@@ -0,0 +1,12 @@
---
name: '启动项目'
description: '使用 pnpm 启动项目'
tags:
- 'pnpm'
---
# 启动项目
在使用 pnpm 进行项目管理时,启动项目通常是通过运行定义在 `package.json` 文件中的脚本来完成的。以下是使用 pnpm 启动项目的基本步骤:
pnpm dev

11
.opencode/tool/project.ts Normal file
View File

@@ -0,0 +1,11 @@
import { tool } from "@opencode-ai/plugin"
export default tool({
description: "获取当前会话信息",
args: {},
async execute(args, context) {
// Access context information
const { agent, sessionID, messageID } = context
return `智能体: ${agent}, 会话ID: ${sessionID}, 消息ID: ${messageID}`
},
})

60
AGENTS.md Normal file
View File

@@ -0,0 +1,60 @@
# 项目概览
## 项目名称
next-simple-template
## 包名/作用域
@kevisual/next-simple-template
## 项目描述
Light Code - 一个直觉、高效的代码编辑器前端界面
## 技术栈
- **框架**: Next.js 16.1.1 (App Router)
- **语言**: TypeScript 5
- **UI库**: React 19.2.3
- **样式**: Tailwind CSS 4
- **组件库**: Radix UI (Dialog, Slot)
- **状态管理**: Zustand 5.0.9
- **图标**: Lucide React
- **工具库**:
- class-variance-authority (组件变体)
- clsx + tailwind-merge (样式处理)
- react-toastify (通知)
## 项目结构
```
src/
├── app/
│ ├── layout.tsx # 根布局,配置字体和元数据
│ ├── page.tsx # 首页组件
│ └── globals.css # 全局样式
├── components/
│ └── ui/
│ ├── button.tsx # 按钮组件 (支持多种变体)
│ └── dialog.tsx # 对话框组件
├── lib/
│ └── utils.ts # 工具函数 (cn类名合并)
└── proxy.ts # 代理配置
```
## 核心配置
- **路径别名**: `@/*` 映射到 `./src/*`
- **构建输出**:
- 开发环境: 标准Next.js
- 生产环境: 静态导出到 `dist` 目录
- **Base Path**: 生产环境使用 `basename` 路径
## 可用命令
- `pnpm dev` - 启动开发服务器
- `pnpm build` - 构建生产版本
- `pnpm start` - 启动生产服务器
- `pnpm pub` - 部署到远程
- `pnpm ui` - 添加shadcn组件
## 特性
- 深色模式支持
- 响应式设计
- TypeScript严格模式
- 可访问性组件 (Radix UI)
- 静态导出支持

46
managed-settings.json Normal file
View File

@@ -0,0 +1,46 @@
{
"permissions": {
"allow": [
"Read(*)",
"Write(*)",
"Edit(*)",
"Glob(*)",
"Grep(*)",
"Bash(node:*)",
"Bash(npm:*)",
"Bash(npx:*)",
"Bash(pnpm:*)",
"Bash(deno:*)",
"Bash(bun:*)",
"Bash(kubectl:*)",
"Bash(git:*)",
"Bash(git:*:*)",
"Bash(python:*)",
"Bash(pip:*)",
"Bash(mkdir:*)",
"Bash(rm:*)",
"Bash(cp:*)",
"Bash(mv:*)",
"Bash(ls:*)",
"Bash(cat:*)",
"Bash(rm:*)",
"Bash(du:*)",
"Bash(df:*)",
"Bash(pwd:*)",
"Bash(whoami:*)",
"Bash(test:*)",
"Bash(echo:*)",
"Bash(timeout:*:*)",
"Bash(touch:*)",
"Bash(file:*)",
"Bash(type:*)",
"Bash(ev:*)"
],
"deny": [],
"ask": [
"Bash(rm:-rf)",
"Bash(rm:-R)",
"Bash(rm:-r)"
]
}
}

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -50,7 +50,7 @@ export async function proxy(request: NextRequest) {
return proxyRequest(request, API_URL);
}
// 代理 /root/home 或 /root/home/ 请求 (第二个路径段后可以为空或以 / 结尾)
if (pathname.match(/^\/root\/\w+(\/)?$/)) {
if (pathname.startsWith('/root')) {
return proxyRequest(request, API_URL);
}

View File

@@ -24,7 +24,7 @@
],
"paths": {
"@/*": [
"./*"
"./src/*"
]
}
},