Dax Raad 9 месяцев назад
Родитель
Сommit
4880b08b8a
4 измененных файлов с 3 добавлено и 510 удалено
  1. 0 20
      js/schema.json
  2. 1 51
      js/test/tool/__snapshots__/tool.test.ts.snap
  3. 2 2
      js/test/tool/tool.test.ts
  4. 0 437
      opencode-schema.json

+ 0 - 20
js/schema.json

@@ -1,20 +0,0 @@
-{
-  "type": "object",
-  "properties": {
-    "type": {
-      "const": "storage.write"
-    },
-    "properties": {
-      "type": "object",
-      "properties": {
-        "key": {
-          "type": "string"
-        },
-        "body": {}
-      },
-      "required": ["key", "body"]
-    }
-  },
-  "required": ["type", "properties"],
-  "$schema": "https://json-schema.org/draft-2020-12/schema"
-}

+ 1 - 51
js/test/tool/__snapshots__/tool.test.ts.snap

@@ -1,7 +1,7 @@
 // Bun Snapshot v1, https://goo.gl/fbAQLP
 
 exports[`tool.ls basic 1`] = `
-"- /home/thdxr/dev/projects/sst/opencode/js/
+"- /home/thdxr/dev/projects/sst/opencode/js/example/
   - home/
     - thdxr/
       - dev/
@@ -9,58 +9,8 @@ exports[`tool.ls basic 1`] = `
           - sst/
             - opencode/
               - js/
-                - package.json
-                - schema.json
-                - tsconfig.json
-                - test/
-                  - tool/
-                    - tool.test.ts
                 - example/
                   - ink.tsx
                   - cli.ts
-                - scrap.ts
-                - README.md
-                - bun.lock
-                - src/
-                  - lsp/
-                    - client.ts
-                    - index.ts
-                    - language.ts
-                  - server/
-                    - server.ts
-                  - storage/
-                    - storage.ts
-                  - app/
-                    - index.ts
-                    - path.ts
-                    - config.ts
-                  - share/
-                    - share.ts
-                  - tool/
-                    - bash.ts
-                    - glob.ts
-                    - tool.ts
-                    - ls.ts
-                    - util/
-                      - file-times.ts
-                    - view.ts
-                    - index.ts
-                    - edit.ts
-                  - llm/
-                    - llm.ts
-                  - util/
-                    - context.ts
-                    - scrap.ts
-                    - event.ts
-                    - log.ts
-                  - index.ts
-                  - id/
-                    - id.ts
-                  - bus/
-                    - index.ts
-                  - session/
-                    - session.ts
-                    - prompt/
-                      - anthropic.txt
 "
 `;

+ 2 - 2
js/test/tool/tool.test.ts

@@ -31,7 +31,7 @@ describe("tool.glob", () => {
       );
       expect(result.metadata).toMatchObject({
         truncated: false,
-        count: 3,
+        count: 2,
       });
     });
   });
@@ -42,7 +42,7 @@ describe("tool.ls", () => {
     const result = await App.provide({ directory: process.cwd() }, async () => {
       return await ls.execute(
         {
-          path: ".",
+          path: "./example",
         },
         {
           toolCallId: "test",

+ 0 - 437
opencode-schema.json

@@ -1,437 +0,0 @@
-{
-  "$schema": "http://json-schema.org/draft-07/schema#",
-  "definitions": {
-    "agent": {
-      "description": "Agent configuration",
-      "properties": {
-        "maxTokens": {
-          "description": "Maximum tokens for the agent",
-          "minimum": 1,
-          "type": "integer"
-        },
-        "model": {
-          "description": "Model ID for the agent",
-          "enum": [
-            "gpt-4.1",
-            "openrouter.o3",
-            "openrouter.gpt-4.1",
-            "meta-llama/llama-4-scout-17b-16e-instruct",
-            "openrouter.gpt-4o",
-            "o1-pro",
-            "claude-3-haiku",
-            "o1",
-            "gemini-2.5-flash",
-            "vertexai.gemini-2.5-flash",
-            "claude-3.5-haiku",
-            "gpt-4o-mini",
-            "o3-mini",
-            "gpt-4.5-preview",
-            "azure.gpt-4o",
-            "azure.o4-mini",
-            "openrouter.claude-3.5-sonnet",
-            "gpt-4o",
-            "o3",
-            "gpt-4.1-mini",
-            "llama-3.3-70b-versatile",
-            "azure.gpt-4o-mini",
-            "gpt-4.1-nano",
-            "o4-mini",
-            "qwen-qwq",
-            "openrouter.claude-3.5-haiku",
-            "openrouter.qwen-3-14b",
-            "vertexai.gemini-2.5",
-            "gemini-2.5",
-            "azure.gpt-4.1-nano",
-            "openrouter.o1-mini",
-            "openrouter.qwen-3-30b",
-            "claude-3.7-sonnet",
-            "claude-3.5-sonnet",
-            "gemini-2.0-flash",
-            "meta-llama/llama-4-maverick-17b-128e-instruct",
-            "openrouter.o3-mini",
-            "openrouter.o4-mini",
-            "openrouter.gpt-4.1-mini",
-            "openrouter.o1",
-            "o1-mini",
-            "azure.gpt-4.1-mini",
-            "openrouter.o1-pro",
-            "grok-3-beta",
-            "grok-3-mini-fast-beta",
-            "openrouter.claude-3.7-sonnet",
-            "openrouter.claude-3-opus",
-            "openrouter.qwen-3-235b",
-            "openrouter.gpt-4.1-nano",
-            "bedrock.claude-3.7-sonnet",
-            "openrouter.qwen-3-8b",
-            "claude-3-opus",
-            "azure.o1-mini",
-            "deepseek-r1-distill-llama-70b",
-            "gemini-2.0-flash-lite",
-            "openrouter.qwen-3-32b",
-            "openrouter.gpt-4.5-preview",
-            "grok-3-mini-beta",
-            "grok-3-fast-beta",
-            "azure.o3-mini",
-            "openrouter.claude-3-haiku",
-            "azure.gpt-4.1",
-            "azure.o1",
-            "azure.o3",
-            "azure.gpt-4.5-preview",
-            "openrouter.gemini-2.5-flash",
-            "openrouter.gpt-4o-mini",
-            "openrouter.gemini-2.5"
-          ],
-          "type": "string"
-        },
-        "reasoningEffort": {
-          "description": "Reasoning effort for models that support it (OpenAI, Anthropic)",
-          "enum": [
-            "low",
-            "medium",
-            "high"
-          ],
-          "type": "string"
-        }
-      },
-      "required": [
-        "model"
-      ],
-      "type": "object"
-    }
-  },
-  "description": "Configuration schema for the OpenCode application",
-  "properties": {
-    "agents": {
-      "additionalProperties": {
-        "description": "Agent configuration",
-        "properties": {
-          "maxTokens": {
-            "description": "Maximum tokens for the agent",
-            "minimum": 1,
-            "type": "integer"
-          },
-          "model": {
-            "description": "Model ID for the agent",
-            "enum": [
-              "gpt-4.1",
-              "openrouter.o3",
-              "openrouter.gpt-4.1",
-              "meta-llama/llama-4-scout-17b-16e-instruct",
-              "openrouter.gpt-4o",
-              "o1-pro",
-              "claude-3-haiku",
-              "o1",
-              "gemini-2.5-flash",
-              "vertexai.gemini-2.5-flash",
-              "claude-3.5-haiku",
-              "gpt-4o-mini",
-              "o3-mini",
-              "gpt-4.5-preview",
-              "azure.gpt-4o",
-              "azure.o4-mini",
-              "openrouter.claude-3.5-sonnet",
-              "gpt-4o",
-              "o3",
-              "gpt-4.1-mini",
-              "llama-3.3-70b-versatile",
-              "azure.gpt-4o-mini",
-              "gpt-4.1-nano",
-              "o4-mini",
-              "qwen-qwq",
-              "openrouter.claude-3.5-haiku",
-              "openrouter.qwen-3-14b",
-              "vertexai.gemini-2.5",
-              "gemini-2.5",
-              "azure.gpt-4.1-nano",
-              "openrouter.o1-mini",
-              "openrouter.qwen-3-30b",
-              "claude-3.7-sonnet",
-              "claude-3.5-sonnet",
-              "gemini-2.0-flash",
-              "meta-llama/llama-4-maverick-17b-128e-instruct",
-              "openrouter.o3-mini",
-              "openrouter.o4-mini",
-              "openrouter.gpt-4.1-mini",
-              "openrouter.o1",
-              "o1-mini",
-              "azure.gpt-4.1-mini",
-              "openrouter.o1-pro",
-              "grok-3-beta",
-              "grok-3-mini-fast-beta",
-              "openrouter.claude-3.7-sonnet",
-              "openrouter.claude-3-opus",
-              "openrouter.qwen-3-235b",
-              "openrouter.gpt-4.1-nano",
-              "bedrock.claude-3.7-sonnet",
-              "openrouter.qwen-3-8b",
-              "claude-3-opus",
-              "azure.o1-mini",
-              "deepseek-r1-distill-llama-70b",
-              "gemini-2.0-flash-lite",
-              "openrouter.qwen-3-32b",
-              "openrouter.gpt-4.5-preview",
-              "grok-3-mini-beta",
-              "grok-3-fast-beta",
-              "azure.o3-mini",
-              "openrouter.claude-3-haiku",
-              "azure.gpt-4.1",
-              "azure.o1",
-              "azure.o3",
-              "azure.gpt-4.5-preview",
-              "openrouter.gemini-2.5-flash",
-              "openrouter.gpt-4o-mini",
-              "openrouter.gemini-2.5"
-            ],
-            "type": "string"
-          },
-          "reasoningEffort": {
-            "description": "Reasoning effort for models that support it (OpenAI, Anthropic)",
-            "enum": [
-              "low",
-              "medium",
-              "high"
-            ],
-            "type": "string"
-          }
-        },
-        "required": [
-          "model"
-        ],
-        "type": "object"
-      },
-      "description": "Agent configurations",
-      "properties": {
-        "primary": {
-          "$ref": "#/definitions/agent"
-        },
-        "task": {
-          "$ref": "#/definitions/agent"
-        },
-        "title": {
-          "$ref": "#/definitions/agent"
-        }
-      },
-      "type": "object"
-    },
-    "contextPaths": {
-      "default": [
-        ".github/copilot-instructions.md",
-        ".cursorrules",
-        ".cursor/rules/",
-        "CLAUDE.md",
-        "CLAUDE.local.md",
-        "opencode.md",
-        "opencode.local.md",
-        "OpenCode.md",
-        "OpenCode.local.md",
-        "OPENCODE.md",
-        "OPENCODE.local.md"
-      ],
-      "description": "Context paths for the application",
-      "items": {
-        "type": "string"
-      },
-      "type": "array"
-    },
-    "data": {
-      "description": "Storage configuration",
-      "properties": {
-        "directory": {
-          "default": ".opencode",
-          "description": "Directory where application data is stored",
-          "type": "string"
-        }
-      },
-      "required": [
-        "directory"
-      ],
-      "type": "object"
-    },
-    "debug": {
-      "default": false,
-      "description": "Enable debug mode",
-      "type": "boolean"
-    },
-    "debugLSP": {
-      "default": false,
-      "description": "Enable LSP debug mode",
-      "type": "boolean"
-    },
-    "lsp": {
-      "additionalProperties": {
-        "description": "LSP configuration for a language",
-        "properties": {
-          "args": {
-            "description": "Command arguments for the LSP server",
-            "items": {
-              "type": "string"
-            },
-            "type": "array"
-          },
-          "command": {
-            "description": "Command to execute for the LSP server",
-            "type": "string"
-          },
-          "disabled": {
-            "default": false,
-            "description": "Whether the LSP is disabled",
-            "type": "boolean"
-          },
-          "options": {
-            "description": "Additional options for the LSP server",
-            "type": "object"
-          }
-        },
-        "required": [
-          "command"
-        ],
-        "type": "object"
-      },
-      "description": "Language Server Protocol configurations",
-      "type": "object"
-    },
-    "mcpServers": {
-      "additionalProperties": {
-        "description": "MCP server configuration",
-        "properties": {
-          "args": {
-            "description": "Command arguments for the MCP server",
-            "items": {
-              "type": "string"
-            },
-            "type": "array"
-          },
-          "command": {
-            "description": "Command to execute for the MCP server",
-            "type": "string"
-          },
-          "env": {
-            "description": "Environment variables for the MCP server",
-            "items": {
-              "type": "string"
-            },
-            "type": "array"
-          },
-          "headers": {
-            "additionalProperties": {
-              "type": "string"
-            },
-            "description": "HTTP headers for SSE type MCP servers",
-            "type": "object"
-          },
-          "type": {
-            "default": "stdio",
-            "description": "Type of MCP server",
-            "enum": [
-              "stdio",
-              "sse"
-            ],
-            "type": "string"
-          },
-          "url": {
-            "description": "URL for SSE type MCP servers",
-            "type": "string"
-          }
-        },
-        "required": [
-          "command"
-        ],
-        "type": "object"
-      },
-      "description": "Model Control Protocol server configurations",
-      "type": "object"
-    },
-    "providers": {
-      "additionalProperties": {
-        "description": "Provider configuration",
-        "properties": {
-          "apiKey": {
-            "description": "API key for the provider",
-            "type": "string"
-          },
-          "disabled": {
-            "default": false,
-            "description": "Whether the provider is disabled",
-            "type": "boolean"
-          },
-          "provider": {
-            "description": "Provider type",
-            "enum": [
-              "anthropic",
-              "openai",
-              "gemini",
-              "groq",
-              "openrouter",
-              "bedrock",
-              "azure",
-              "vertexai"
-            ],
-            "type": "string"
-          }
-        },
-        "type": "object"
-      },
-      "description": "LLM provider configurations",
-      "type": "object"
-    },
-    "tui": {
-      "description": "Terminal User Interface configuration",
-      "properties": {
-        "customTheme": {
-          "additionalProperties": {
-            "oneOf": [
-              {
-                "pattern": "^#[0-9a-fA-F]{6}$",
-                "type": "string"
-              },
-              {
-                "additionalProperties": false,
-                "properties": {
-                  "dark": {
-                    "pattern": "^#[0-9a-fA-F]{6}$",
-                    "type": "string"
-                  },
-                  "light": {
-                    "pattern": "^#[0-9a-fA-F]{6}$",
-                    "type": "string"
-                  }
-                },
-                "required": [
-                  "dark",
-                  "light"
-                ],
-                "type": "object"
-              }
-            ]
-          },
-          "description": "Custom theme color definitions",
-          "type": "object"
-        },
-        "theme": {
-          "default": "opencode",
-          "description": "TUI theme name",
-          "enum": [
-            "opencode",
-            "catppuccin",
-            "dracula",
-            "flexoki",
-            "gruvbox",
-            "monokai",
-            "onedark",
-            "tokyonight",
-            "tron",
-            "custom"
-          ],
-          "type": "string"
-        }
-      },
-      "type": "object"
-    },
-    "wd": {
-      "description": "Working directory for the application",
-      "type": "string"
-    }
-  },
-  "title": "OpenCode Configuration",
-  "type": "object"
-}