diff --git a/.vscode-test.mjs b/.vscode-test.mjs index b62ba25..2734c51 100644 --- a/.vscode-test.mjs +++ b/.vscode-test.mjs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import { defineConfig } from '@vscode/test-cli'; export default defineConfig({ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..c25866d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,30 @@ +# Agent Guidelines for DebugMCP + +## File Header +Include the following header in each source file (adjust comment syntax as needed). +`// Copyright (c) Microsoft Corporation.` + +## Build/Lint/Test Commands +- **Compile**: `npm run compile` - Compiles TypeScript to JavaScript in `out/` directory +- **Lint**: `npm run lint` - Runs ESLint on `src/` directory +- **Test**: `npm test` - Runs all tests (compiles + lints first via pretest) +- **Single Test**: Use VSCode Test Explorer or `npm test` (no CLI test filtering available) +- **Watch Mode**: `npm run watch` - Compiles TypeScript in watch mode + +## Code Style & Conventions +- **TypeScript**: Strict mode enabled, target ES2022, Node16 modules +- **Imports**: Use camelCase/PascalCase naming. Import order: vscode → external → internal (e.g., `./utils/logger`) +- **Naming**: camelCase for variables/functions, PascalCase for classes/interfaces, prefix interfaces with `I` (e.g., `IDebuggingHandler`) +- **Types**: Explicit types preferred, use strict null checks, avoid `any` unless necessary +- **Error Handling**: Use try-catch with descriptive error messages, throw `Error` objects (not literals) +- **Formatting**: Use semicolons, curly braces for all control structures, consistent indentation (tabs) +- **Async**: Use async/await, handle promises properly, implement exponential backoff for retries +- **VSCode API**: Import as `import * as vscode from 'vscode'`, use proper disposal in `context.subscriptions` +- **Logging**: Use `logger` from `./utils/logger` for all logging (info/error/warn) +- **Dependencies**: fastmcp (MCP server), express (HTTP), zod (validation), @modelcontextprotocol/sdk + +## Architecture Notes +- VSCode extension with MCP server for AI agent debugging capabilities +- Main entry: `extension.ts` → activates MCP server and registers commands +- Core: `debuggingHandler.ts` handles debug operations, `debuggingExecutor.ts` executes VSCode debug API calls +- State: `debugState.ts` tracks current debugging session state diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c282e9a..ebf23ac 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,4 +11,4 @@ instructions provided by the bot. You will only need to do this once across all This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) -or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file +or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 9e841e7..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - MIT License - - Copyright (c) Microsoft Corporation. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..b2f52a2 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +Copyright (c) Microsoft Corporation. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 6bfca19..3821186 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,33 @@ npm install npm run compile ``` +## Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us +the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. + +When you submit a pull request, a CLA bot will automatically determine whether you need to provide +a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions +provided by the bot. You will only need to do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). +For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or +contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. + +## Security + +Security vulnerabilities should be reported following the guidance at [https://aka.ms/SECURITY.md](https://aka.ms/SECURITY.md). +Please do not report security vulnerabilities through public GitHub issues. + +## Trademarks + +This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft +trademarks or logos is subject to and must follow +[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). +Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. +Any use of third-party trademarks or logos are subject to those third-party's policies. + ## License MIT License - See [LICENSE](LICENSE.txt) for details diff --git a/eslint.config.mjs b/eslint.config.mjs index d5c0b53..5fd47d6 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import typescriptEslint from "@typescript-eslint/eslint-plugin"; import tsParser from "@typescript-eslint/parser"; diff --git a/package-lock.json b/package-lock.json index 4267e61..e9bdec1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "debugmcpextension", - "version": "0.0.6", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "debugmcpextension", - "version": "0.0.6", + "version": "0.1.1", "dependencies": { "@modelcontextprotocol/sdk": "^0.5.0", "@types/express": "^5.0.3", diff --git a/src/debugMCPServer.ts b/src/debugMCPServer.ts index ce45153..8bc7a95 100644 --- a/src/debugMCPServer.ts +++ b/src/debugMCPServer.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as vscode from 'vscode'; import { z } from 'zod'; import * as path from 'path'; diff --git a/src/debugState.ts b/src/debugState.ts index 230f19c..eed9160 100644 --- a/src/debugState.ts +++ b/src/debugState.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + /** * Represents the current state of a debugging session */ diff --git a/src/debuggingExecutor.ts b/src/debuggingExecutor.ts index db4bf3f..fb355e5 100644 --- a/src/debuggingExecutor.ts +++ b/src/debuggingExecutor.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as vscode from 'vscode'; import { DebugState } from './debugState'; diff --git a/src/debuggingHandler.ts b/src/debuggingHandler.ts index f7f8dff..b6be5a1 100644 --- a/src/debuggingHandler.ts +++ b/src/debuggingHandler.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as vscode from 'vscode'; import { IDebugConfigurationManager } from './utils/debugConfigurationManager'; import { DebugState } from './debugState'; diff --git a/src/extension.ts b/src/extension.ts index 1355269..f6938ef 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as vscode from 'vscode'; import { DebugMCPServer } from './debugMCPServer'; import { AgentConfigurationManager } from './utils/agentConfigurationManager'; diff --git a/src/index.ts b/src/index.ts index 30fded3..3e93f6d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + // Export all debugging-related classes and interfaces export { DebugState } from './debugState'; export { DebuggingExecutor, IDebuggingExecutor } from './debuggingExecutor'; diff --git a/src/test/debuggingHandler.test.ts b/src/test/debuggingHandler.test.ts index 0c0f739..cea59db 100644 --- a/src/test/debuggingHandler.test.ts +++ b/src/test/debuggingHandler.test.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as assert from 'assert'; import { DebugState } from '../debugState'; import { DebuggingHandler } from '../debuggingHandler'; diff --git a/src/test/extension.test.ts b/src/test/extension.test.ts index 4ca0ab4..4607308 100644 --- a/src/test/extension.test.ts +++ b/src/test/extension.test.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as assert from 'assert'; // You can import and use all API from the 'vscode' module diff --git a/src/utils/agentConfigurationManager.ts b/src/utils/agentConfigurationManager.ts index c6be4a5..e0b2399 100644 --- a/src/utils/agentConfigurationManager.ts +++ b/src/utils/agentConfigurationManager.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as vscode from 'vscode'; import * as fs from 'fs'; import * as path from 'path'; diff --git a/src/utils/debugConfigurationManager.ts b/src/utils/debugConfigurationManager.ts index f21beb3..28ccbc6 100644 --- a/src/utils/debugConfigurationManager.ts +++ b/src/utils/debugConfigurationManager.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as vscode from 'vscode'; import * as path from 'path'; diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 371fa79..6f7ea62 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. + import * as fs from 'fs'; import * as path from 'path'; import * as os from 'os';