temp
This commit is contained in:
20
.opencode/plugin/example.ts
Normal file
20
.opencode/plugin/example.ts
Normal 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}!`
|
||||
},
|
||||
}),
|
||||
}
|
||||
}
|
||||
}
|
||||
12
.opencode/skill/pnpm-start/SKILL.md
Normal file
12
.opencode/skill/pnpm-start/SKILL.md
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
name: '启动项目'
|
||||
description: '使用 pnpm 启动项目'
|
||||
tags:
|
||||
- 'pnpm'
|
||||
---
|
||||
|
||||
# 启动项目
|
||||
|
||||
在使用 pnpm 进行项目管理时,启动项目通常是通过运行定义在 `package.json` 文件中的脚本来完成的。以下是使用 pnpm 启动项目的基本步骤:
|
||||
|
||||
pnpm dev
|
||||
11
.opencode/tool/project.ts
Normal file
11
.opencode/tool/project.ts
Normal 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}`
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user