opencode-agent-ghost-panel 0.1.0 → 0.1.1
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/index.js +21 -21
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -60,7 +60,7 @@ export const agpDiff = tool({
|
|
|
60
60
|
args: {
|
|
61
61
|
file: z.string().optional().describe("文件路径(可选,默认当前目录)")
|
|
62
62
|
},
|
|
63
|
-
execute: async (args) => {
|
|
63
|
+
execute: async (args, context) => {
|
|
64
64
|
try {
|
|
65
65
|
const fileArg = args.file ? ` --file ${args.file}` : "";
|
|
66
66
|
const result = await executeAgp(["diff" + fileArg]);
|
|
@@ -76,7 +76,7 @@ export const agpLogs = tool({
|
|
|
76
76
|
args: {
|
|
77
77
|
file: z.string().describe("日志文件路径")
|
|
78
78
|
},
|
|
79
|
-
execute: async (args) => {
|
|
79
|
+
execute: async (args, context) => {
|
|
80
80
|
try {
|
|
81
81
|
const result = await executeAgp(["logs", args.file]);
|
|
82
82
|
return `✅ ${result}`;
|
|
@@ -91,7 +91,7 @@ export const agpInteractive = tool({
|
|
|
91
91
|
args: {
|
|
92
92
|
command: z.string().optional().describe("初始命令(可选)")
|
|
93
93
|
},
|
|
94
|
-
execute: async (args) => {
|
|
94
|
+
execute: async (args, context) => {
|
|
95
95
|
try {
|
|
96
96
|
const cmdArg = args.command ? ` ${args.command}` : "";
|
|
97
97
|
const result = await executeAgp(["interactive" + cmdArg]);
|
|
@@ -105,7 +105,7 @@ export const agpInteractive = tool({
|
|
|
105
105
|
export const agpStatus = tool({
|
|
106
106
|
description: "查看 AGP 守护进程状态",
|
|
107
107
|
args: {},
|
|
108
|
-
execute: async () => {
|
|
108
|
+
execute: async (args, context) => {
|
|
109
109
|
try {
|
|
110
110
|
const result = await executeAgp(["status"]);
|
|
111
111
|
return result;
|
|
@@ -118,7 +118,7 @@ export const agpStatus = tool({
|
|
|
118
118
|
export const agpSessions = tool({
|
|
119
119
|
description: "列出所有 tmux 会话",
|
|
120
120
|
args: {},
|
|
121
|
-
execute: async () => {
|
|
121
|
+
execute: async (args, context) => {
|
|
122
122
|
try {
|
|
123
123
|
const result = await executeAgp(["sessions"]);
|
|
124
124
|
return result;
|
|
@@ -131,7 +131,7 @@ export const agpSessions = tool({
|
|
|
131
131
|
export const agpStart = tool({
|
|
132
132
|
description: "启动 AGP 守护进程",
|
|
133
133
|
args: {},
|
|
134
|
-
execute: async () => {
|
|
134
|
+
execute: async (args, context) => {
|
|
135
135
|
try {
|
|
136
136
|
const result = await executeAgp(["start"]);
|
|
137
137
|
return result;
|
|
@@ -144,7 +144,7 @@ export const agpStart = tool({
|
|
|
144
144
|
export const agpStop = tool({
|
|
145
145
|
description: "停止 AGP 守护进程",
|
|
146
146
|
args: {},
|
|
147
|
-
execute: async () => {
|
|
147
|
+
execute: async (args, context) => {
|
|
148
148
|
try {
|
|
149
149
|
const result = await executeAgp(["stop"]);
|
|
150
150
|
return result;
|
|
@@ -154,17 +154,17 @@ export const agpStop = tool({
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
|
|
157
|
-
//
|
|
158
|
-
export default {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
}
|
|
157
|
+
// OpenCode 插件入口 - 必须是 async function
|
|
158
|
+
export default async function(input) {
|
|
159
|
+
return {
|
|
160
|
+
tool: {
|
|
161
|
+
"agp-diff": agpDiff,
|
|
162
|
+
"agp-logs": agpLogs,
|
|
163
|
+
"agp-interactive": agpInteractive,
|
|
164
|
+
"agp-status": agpStatus,
|
|
165
|
+
"agp-sessions": agpSessions,
|
|
166
|
+
"agp-start": agpStart,
|
|
167
|
+
"agp-stop": agpStop
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|