opencode-autognosis 0.1.2 → 0.1.4
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/dist/index.d.ts +9 -306
- package/dist/index.js +21 -28
- package/gemini-extension.json +12 -0
- package/package.json +8 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,312 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenCode Plugin Entry Point
|
|
3
|
+
*/
|
|
1
4
|
export default function plugin(): {
|
|
2
|
-
tools:
|
|
3
|
-
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
parameters: {
|
|
7
|
-
type: string;
|
|
8
|
-
properties: {
|
|
9
|
-
mode: {
|
|
10
|
-
type: string;
|
|
11
|
-
enum: string[];
|
|
12
|
-
default: string;
|
|
13
|
-
};
|
|
14
|
-
token: {
|
|
15
|
-
type: string;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
required: string[];
|
|
19
|
-
};
|
|
20
|
-
execute: (args: any) => Promise<string | undefined>;
|
|
21
|
-
};
|
|
22
|
-
autognosis_init: {
|
|
23
|
-
description: string;
|
|
24
|
-
parameters: {
|
|
25
|
-
type: string;
|
|
26
|
-
properties: {
|
|
27
|
-
mode: {
|
|
28
|
-
type: string;
|
|
29
|
-
enum: string[];
|
|
30
|
-
default: string;
|
|
31
|
-
};
|
|
32
|
-
token: {
|
|
33
|
-
type: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
required: string[];
|
|
37
|
-
};
|
|
38
|
-
execute: ({ mode, token }: {
|
|
39
|
-
mode: string;
|
|
40
|
-
token?: string;
|
|
41
|
-
}) => Promise<string | undefined>;
|
|
42
|
-
};
|
|
43
|
-
fast_search: {
|
|
44
|
-
description: string;
|
|
45
|
-
parameters: {
|
|
46
|
-
type: string;
|
|
47
|
-
properties: {
|
|
48
|
-
query: {
|
|
49
|
-
type: string;
|
|
50
|
-
};
|
|
51
|
-
mode: {
|
|
52
|
-
type: string;
|
|
53
|
-
enum: string[];
|
|
54
|
-
default: string;
|
|
55
|
-
};
|
|
56
|
-
path: {
|
|
57
|
-
type: string;
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
|
-
required: string[];
|
|
61
|
-
};
|
|
62
|
-
execute: ({ query, mode, path: searchPath }: {
|
|
63
|
-
query: string;
|
|
64
|
-
mode?: string;
|
|
65
|
-
path?: string;
|
|
66
|
-
}) => Promise<string>;
|
|
67
|
-
};
|
|
68
|
-
structural_search: {
|
|
69
|
-
description: string;
|
|
70
|
-
parameters: {
|
|
71
|
-
type: string;
|
|
72
|
-
properties: {
|
|
73
|
-
pattern: {
|
|
74
|
-
type: string;
|
|
75
|
-
};
|
|
76
|
-
path: {
|
|
77
|
-
type: string;
|
|
78
|
-
default: string;
|
|
79
|
-
};
|
|
80
|
-
plan_id: {
|
|
81
|
-
type: string;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
required: string[];
|
|
85
|
-
};
|
|
86
|
-
execute: ({ pattern, path: searchPath, plan_id }: {
|
|
87
|
-
pattern: string;
|
|
88
|
-
path?: string;
|
|
89
|
-
plan_id?: string;
|
|
90
|
-
}) => Promise<string>;
|
|
91
|
-
};
|
|
92
|
-
read_slice: {
|
|
93
|
-
description: string;
|
|
94
|
-
parameters: {
|
|
95
|
-
type: string;
|
|
96
|
-
properties: {
|
|
97
|
-
file: {
|
|
98
|
-
type: string;
|
|
99
|
-
};
|
|
100
|
-
start_line: {
|
|
101
|
-
type: string;
|
|
102
|
-
};
|
|
103
|
-
end_line: {
|
|
104
|
-
type: string;
|
|
105
|
-
};
|
|
106
|
-
plan_id: {
|
|
107
|
-
type: string;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
required: string[];
|
|
111
|
-
};
|
|
112
|
-
execute: ({ file, start_line, end_line, plan_id }: {
|
|
113
|
-
file: string;
|
|
114
|
-
start_line: number;
|
|
115
|
-
end_line: number;
|
|
116
|
-
plan_id?: string;
|
|
117
|
-
}) => Promise<string>;
|
|
118
|
-
};
|
|
119
|
-
symbol_query: {
|
|
120
|
-
description: string;
|
|
121
|
-
parameters: {
|
|
122
|
-
type: string;
|
|
123
|
-
properties: {
|
|
124
|
-
symbol: {
|
|
125
|
-
type: string;
|
|
126
|
-
};
|
|
127
|
-
};
|
|
128
|
-
required: string[];
|
|
129
|
-
};
|
|
130
|
-
execute: ({ symbol }: {
|
|
131
|
-
symbol: string;
|
|
132
|
-
}) => Promise<string>;
|
|
133
|
-
};
|
|
134
|
-
jump_to_symbol: {
|
|
135
|
-
description: string;
|
|
136
|
-
parameters: {
|
|
137
|
-
type: string;
|
|
138
|
-
properties: {
|
|
139
|
-
symbol: {
|
|
140
|
-
type: string;
|
|
141
|
-
};
|
|
142
|
-
plan_id: {
|
|
143
|
-
type: string;
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
required: string[];
|
|
147
|
-
};
|
|
148
|
-
execute: ({ symbol, plan_id }: {
|
|
149
|
-
symbol: string;
|
|
150
|
-
plan_id?: string;
|
|
151
|
-
}) => Promise<string>;
|
|
152
|
-
};
|
|
153
|
-
brief_fix_loop: {
|
|
154
|
-
description: string;
|
|
155
|
-
parameters: {
|
|
156
|
-
type: string;
|
|
157
|
-
properties: {
|
|
158
|
-
symbol: {
|
|
159
|
-
type: string;
|
|
160
|
-
};
|
|
161
|
-
intent: {
|
|
162
|
-
type: string;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
required: string[];
|
|
166
|
-
};
|
|
167
|
-
execute: ({ symbol, intent }: {
|
|
168
|
-
symbol: string;
|
|
169
|
-
intent: string;
|
|
170
|
-
}) => Promise<string>;
|
|
171
|
-
};
|
|
172
|
-
prepare_patch: {
|
|
173
|
-
description: string;
|
|
174
|
-
parameters: {
|
|
175
|
-
type: string;
|
|
176
|
-
properties: {
|
|
177
|
-
plan_id: {
|
|
178
|
-
type: string;
|
|
179
|
-
};
|
|
180
|
-
message: {
|
|
181
|
-
type: string;
|
|
182
|
-
};
|
|
183
|
-
};
|
|
184
|
-
required: string[];
|
|
185
|
-
};
|
|
186
|
-
execute: ({ plan_id, message }: {
|
|
187
|
-
plan_id?: string;
|
|
188
|
-
message: string;
|
|
189
|
-
}) => Promise<string>;
|
|
190
|
-
};
|
|
191
|
-
validate_patch: {
|
|
192
|
-
description: string;
|
|
193
|
-
parameters: {
|
|
194
|
-
type: string;
|
|
195
|
-
properties: {
|
|
196
|
-
patch_path: {
|
|
197
|
-
type: string;
|
|
198
|
-
};
|
|
199
|
-
timeout_ms: {
|
|
200
|
-
type: string;
|
|
201
|
-
default: number;
|
|
202
|
-
};
|
|
203
|
-
};
|
|
204
|
-
required: string[];
|
|
205
|
-
};
|
|
206
|
-
execute: ({ patch_path, timeout_ms }: {
|
|
207
|
-
patch_path: string;
|
|
208
|
-
timeout_ms?: number;
|
|
209
|
-
}) => Promise<string>;
|
|
210
|
-
};
|
|
211
|
-
finalize_plan: {
|
|
212
|
-
description: string;
|
|
213
|
-
parameters: {
|
|
214
|
-
type: string;
|
|
215
|
-
properties: {
|
|
216
|
-
plan_id: {
|
|
217
|
-
type: string;
|
|
218
|
-
};
|
|
219
|
-
outcome: {
|
|
220
|
-
type: string;
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
required: string[];
|
|
224
|
-
};
|
|
225
|
-
execute: ({ plan_id, outcome }: {
|
|
226
|
-
plan_id: string;
|
|
227
|
-
outcome: string;
|
|
228
|
-
}) => Promise<string>;
|
|
229
|
-
};
|
|
230
|
-
};
|
|
231
|
-
commands: {
|
|
232
|
-
autognosis_init: {
|
|
233
|
-
name: string;
|
|
234
|
-
description: string;
|
|
235
|
-
parameters: {
|
|
236
|
-
type: string;
|
|
237
|
-
properties: {
|
|
238
|
-
mode: {
|
|
239
|
-
type: string;
|
|
240
|
-
enum: string[];
|
|
241
|
-
default: string;
|
|
242
|
-
};
|
|
243
|
-
token: {
|
|
244
|
-
type: string;
|
|
245
|
-
};
|
|
246
|
-
};
|
|
247
|
-
required: string[];
|
|
248
|
-
};
|
|
249
|
-
execute: (args: any) => Promise<string | undefined>;
|
|
250
|
-
};
|
|
251
|
-
};
|
|
5
|
+
tools: any;
|
|
6
|
+
commands: any;
|
|
252
7
|
slashCommands: {
|
|
253
8
|
name: string;
|
|
254
9
|
description: string;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
type: string;
|
|
260
|
-
enum: string[];
|
|
261
|
-
default: string;
|
|
262
|
-
};
|
|
263
|
-
token: {
|
|
264
|
-
type: string;
|
|
265
|
-
};
|
|
266
|
-
};
|
|
267
|
-
required: string[];
|
|
268
|
-
};
|
|
269
|
-
execute: (args: any) => Promise<string | undefined>;
|
|
270
|
-
}[];
|
|
271
|
-
chatCommands: {
|
|
272
|
-
autognosis_init: {
|
|
273
|
-
name: string;
|
|
274
|
-
description: string;
|
|
275
|
-
parameters: {
|
|
276
|
-
type: string;
|
|
277
|
-
properties: {
|
|
278
|
-
mode: {
|
|
279
|
-
type: string;
|
|
280
|
-
enum: string[];
|
|
281
|
-
default: string;
|
|
282
|
-
};
|
|
283
|
-
token: {
|
|
284
|
-
type: string;
|
|
285
|
-
};
|
|
286
|
-
};
|
|
287
|
-
required: string[];
|
|
288
|
-
};
|
|
289
|
-
execute: (args: any) => Promise<string | undefined>;
|
|
290
|
-
};
|
|
291
|
-
};
|
|
292
|
-
intentions: {
|
|
293
|
-
intent: string;
|
|
294
|
-
name: string;
|
|
295
|
-
description: string;
|
|
296
|
-
parameters: {
|
|
297
|
-
type: string;
|
|
298
|
-
properties: {
|
|
299
|
-
mode: {
|
|
300
|
-
type: string;
|
|
301
|
-
enum: string[];
|
|
302
|
-
default: string;
|
|
303
|
-
};
|
|
304
|
-
token: {
|
|
305
|
-
type: string;
|
|
306
|
-
};
|
|
307
|
-
};
|
|
308
|
-
required: string[];
|
|
309
|
-
};
|
|
310
|
-
execute: (args: any) => Promise<string | undefined>;
|
|
10
|
+
execute: ({ mode, token }: {
|
|
11
|
+
mode: string;
|
|
12
|
+
token?: string;
|
|
13
|
+
}) => Promise<string | undefined>;
|
|
311
14
|
}[];
|
|
312
15
|
};
|
package/dist/index.js
CHANGED
|
@@ -1,36 +1,29 @@
|
|
|
1
1
|
import { systemTools } from "./system-tools.js";
|
|
2
|
+
/**
|
|
3
|
+
* OpenCode Plugin Entry Point
|
|
4
|
+
*/
|
|
2
5
|
export default function plugin() {
|
|
3
6
|
const tools = systemTools();
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
7
|
+
// Map our internal tool definitions to the format OpenCode expects
|
|
8
|
+
const opencodeTools = Object.entries(tools).reduce((acc, [name, tool]) => {
|
|
9
|
+
acc[name] = {
|
|
10
|
+
description: tool.description,
|
|
11
|
+
parameters: tool.parameters,
|
|
12
|
+
execute: tool.execute,
|
|
13
|
+
};
|
|
14
|
+
return acc;
|
|
15
|
+
}, {});
|
|
13
16
|
return {
|
|
14
|
-
tools
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
commands: {
|
|
21
|
-
autognosis_init: initMetadata
|
|
22
|
-
},
|
|
23
|
-
// Pattern 2: Array-based commands
|
|
24
|
-
slashCommands: [initMetadata],
|
|
25
|
-
// Pattern 3: Chat-specific commands
|
|
26
|
-
chatCommands: {
|
|
27
|
-
autognosis_init: initMetadata
|
|
28
|
-
},
|
|
29
|
-
// Pattern 4: Intentions (common in some agent frameworks)
|
|
30
|
-
intentions: [
|
|
17
|
+
// This is the primary key OpenCode looks for to register custom tools
|
|
18
|
+
tools: opencodeTools,
|
|
19
|
+
// Fallback/Slash command support
|
|
20
|
+
commands: opencodeTools,
|
|
21
|
+
// Explicit slash command registration for /autognosis_init
|
|
22
|
+
slashCommands: [
|
|
31
23
|
{
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
name: "autognosis_init",
|
|
25
|
+
description: "Initialize or check the Autognosis environment",
|
|
26
|
+
execute: tools.autognosis_init.execute
|
|
34
27
|
}
|
|
35
28
|
]
|
|
36
29
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "opencode-autognosis",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Autognosis extension for Gemini CLI",
|
|
5
|
+
"mcpServers": {
|
|
6
|
+
"autognosis": {
|
|
7
|
+
"command": "node",
|
|
8
|
+
"args": ["${extensionPath}/dist/index.js"],
|
|
9
|
+
"cwd": "${extensionPath}"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-autognosis",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Transforms OpenCode agents into 'miniature engineers' with deep codebase awareness. Includes fast structural search (ast-grep), instant symbol navigation (ctags), and a disciplined 'Plan → Execute → Patch' workflow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -11,14 +11,19 @@
|
|
|
11
11
|
"dist",
|
|
12
12
|
"assets",
|
|
13
13
|
"LICENSE",
|
|
14
|
-
"README.md"
|
|
14
|
+
"README.md",
|
|
15
|
+
"gemini-extension.json"
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"build": "tsc -p tsconfig.json",
|
|
18
19
|
"prepublishOnly": "npm run build"
|
|
19
20
|
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
23
|
+
"zod": "^3.0.0"
|
|
24
|
+
},
|
|
20
25
|
"devDependencies": {
|
|
21
|
-
"@types/node": "^
|
|
26
|
+
"@types/node": "^20.0.0",
|
|
22
27
|
"typescript": "^5.0.0"
|
|
23
28
|
}
|
|
24
29
|
}
|