opencode-autognosis 0.1.3 → 0.1.5

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.
@@ -0,0 +1,13 @@
1
+ description = "Initialize or check the Autognosis environment"
2
+
3
+ # The command executes the tool via the agent
4
+ # Or it can just be a prompt that calls the tool
5
+ prompt = """
6
+ Please run the autognosis_init tool with the following arguments:
7
+ mode = "{{mode}}"
8
+ token = "{{token}}"
9
+ """
10
+
11
+ [parameters]
12
+ mode = { type = "string", description = "The mode to run in (plan or apply)", default = "plan" }
13
+ token = { type = "string", description = "The confirmation token for apply mode" }
package/dist/index.js CHANGED
@@ -5,17 +5,17 @@ import { systemTools } from "./system-tools.js";
5
5
  async function main() {
6
6
  const server = new McpServer({
7
7
  name: "opencode-autognosis",
8
- version: "0.1.3",
8
+ version: "0.1.5",
9
9
  });
10
10
  const tools = systemTools();
11
- // Helper to wrap our existing tool execution into MCP format
12
- const wrapTool = (toolName, zodSchema) => {
11
+ const register = (toolName, zodSchema) => {
12
+ const toolDef = tools[toolName];
13
13
  server.registerTool(toolName, {
14
- description: tools[toolName].description,
14
+ description: toolDef.description,
15
15
  inputSchema: zodSchema,
16
16
  }, async (args) => {
17
17
  try {
18
- const result = await tools[toolName].execute(args);
18
+ const result = await toolDef.execute(args);
19
19
  return {
20
20
  content: [{ type: "text", text: typeof result === 'string' ? result : JSON.stringify(result, null, 2) }],
21
21
  };
@@ -28,55 +28,53 @@ async function main() {
28
28
  }
29
29
  });
30
30
  };
31
- // Register tools with proper Zod schemas
32
- wrapTool("autognosis_init", z.object({
33
- mode: z.enum(["plan", "apply"]).optional().default("plan"),
34
- token: z.string().optional()
35
- }).shape);
36
- wrapTool("fast_search", z.object({
31
+ register("fast_search", z.object({
37
32
  query: z.string(),
38
33
  mode: z.enum(["filename", "content"]).optional().default("filename"),
39
- path: z.string().optional()
34
+ path: z.string().optional().default(".")
40
35
  }).shape);
41
- wrapTool("structural_search", z.object({
36
+ register("structural_search", z.object({
42
37
  pattern: z.string(),
43
- path: z.string().optional(),
38
+ path: z.string().optional().default("."),
44
39
  plan_id: z.string().optional()
45
40
  }).shape);
46
- wrapTool("read_slice", z.object({
41
+ register("read_slice", z.object({
47
42
  file: z.string(),
48
43
  start_line: z.number(),
49
44
  end_line: z.number(),
50
45
  plan_id: z.string().optional()
51
46
  }).shape);
52
- wrapTool("symbol_query", z.object({
47
+ register("symbol_query", z.object({
53
48
  symbol: z.string()
54
49
  }).shape);
55
- wrapTool("jump_to_symbol", z.object({
50
+ register("jump_to_symbol", z.object({
56
51
  symbol: z.string(),
57
52
  plan_id: z.string().optional()
58
53
  }).shape);
59
- wrapTool("brief_fix_loop", z.object({
54
+ register("autognosis_init", z.object({
55
+ mode: z.enum(["plan", "apply"]).optional().default("plan"),
56
+ token: z.string().optional()
57
+ }).shape);
58
+ register("brief_fix_loop", z.object({
60
59
  symbol: z.string(),
61
60
  intent: z.string()
62
61
  }).shape);
63
- wrapTool("prepare_patch", z.object({
62
+ register("prepare_patch", z.object({
64
63
  plan_id: z.string().optional(),
65
64
  message: z.string()
66
65
  }).shape);
67
- wrapTool("validate_patch", z.object({
66
+ register("validate_patch", z.object({
68
67
  patch_path: z.string(),
69
- timeout_ms: z.number().optional()
68
+ timeout_ms: z.number().optional().default(30000)
70
69
  }).shape);
71
- wrapTool("finalize_plan", z.object({
70
+ register("finalize_plan", z.object({
72
71
  plan_id: z.string(),
73
72
  outcome: z.string()
74
73
  }).shape);
75
74
  const transport = new StdioServerTransport();
76
75
  await server.connect(transport);
77
- console.error("Autognosis MCP Server running on stdio");
78
76
  }
79
77
  main().catch((error) => {
80
- console.error("Fatal error in main():", error);
78
+ console.error("Fatal error in Autognosis MCP Server:", error);
81
79
  process.exit(1);
82
80
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-autognosis",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
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": {
@@ -10,6 +10,7 @@
10
10
  "files": [
11
11
  "dist",
12
12
  "assets",
13
+ "commands",
13
14
  "LICENSE",
14
15
  "README.md",
15
16
  "gemini-extension.json"