diff --git a/README.md b/README.md index 21caaa5..edc2db4 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,8 @@ Fluent (ServiceNow SDK) MCP bridges ServiceNow development tools with modern AI- Key capabilities include: -- All ServiceNow SDK CLI commands: `version`, `help`, `debug`, `upgrade`, `auth`, `init`, `build`, `install`, `transform`, `dependencies` -- ServiceNow authentication via `@servicenow/sdk auth --add ` +- All ServiceNow SDK CLI commands: `version`, `help`, `auth`, `init`, `build`, `install`, `upgrade`, `dependencies`, `transform` +- ServiceNow instance authentication via `npx now-sdk auth --add ` - API specifications for metadata types like `acl`, `business-rule`, `client-script`, `table`, `ui-action` and more - Code snippets and examples for different metadata types - Instructions for creating and modifying metadata types @@ -30,7 +30,6 @@ Note: Use `init` command to switch to a working directory for existing Fluent pr | -------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `version` | Get ServiceNow SDK version information | None | | `help` | Get help information about ServiceNow SDK commands | `command`: (Optional) The specific command to get help for | -| `debug` | Enable debug mode for ServiceNow SDK commands | `command`: The command to run with debug mode enabled | | `upgrade` | Upgrade ServiceNow SDK to the latest version | `check`: (Optional) Only check for updates without upgrading, `debug`: (Optional) Enable debug - **disabled for now** | | `auth` | Authenticate to a ServiceNow instance | `add`: (Optional) Instance URL to add, `type`: (Optional) Authentication method, `alias`: (Optional) Alias for the instance | | `init` | Initialize a new ServiceNow application | `from`: (Optional) sys_id or path, `appName`: App name, `packageName`: Package name, `scopeName`: Scope name, `auth`: (Optional) Authentication alias | diff --git a/package-lock.json b/package-lock.json index bb2a003..035a865 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@modesty/fluent-mcp", - "version": "0.0.11", + "version": "0.0.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@modesty/fluent-mcp", - "version": "0.0.11", + "version": "0.0.13", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "1.17.3", @@ -26,11 +26,11 @@ "@rollup/plugin-typescript": "^12.1.4", "@types/jest": "^30.0.0", "@types/node": "^24.3.0", - "@typescript-eslint/eslint-plugin": "^8.39.1", - "@typescript-eslint/parser": "^8.39.1", + "@typescript-eslint/eslint-plugin": "^8.40.0", + "@typescript-eslint/parser": "^8.40.0", "eslint": "^9.33.0", "jest": "^30.0.5", - "rollup": "^4.46.2", + "rollup": "^4.46.3", "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-sourcemaps": "^0.6.3", "ts-jest": "^29.4.1", @@ -1557,9 +1557,9 @@ } }, "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://artifact.devsnc.com/repository/npm-all/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "version": "6.2.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/ansi-regex/-/ansi-regex-6.2.0.tgz", + "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==", "license": "MIT", "engines": { "node": ">=12" @@ -2723,9 +2723,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.2.tgz", - "integrity": "sha512-Zj3Hl6sN34xJtMv7Anwb5Gu01yujyE/cLBDB2gnHTAHaWS1Z38L7kuSG+oAh0giZMqG060f/YBStXtMH6FvPMA==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.46.3.tgz", + "integrity": "sha512-UmTdvXnLlqQNOCJnyksjPs1G4GqXNGW1LrzCe8+8QoaLhhDeTXYBgJ3k6x61WIhlHX2U+VzEJ55TtIjR/HTySA==", "cpu": [ "arm" ], @@ -2736,9 +2736,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.2.tgz", - "integrity": "sha512-nTeCWY83kN64oQ5MGz3CgtPx8NSOhC5lWtsjTs+8JAJNLcP3QbLCtDDgUKQc/Ro/frpMq4SHUaHN6AMltcEoLQ==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.46.3.tgz", + "integrity": "sha512-8NoxqLpXm7VyeI0ocidh335D6OKT0UJ6fHdnIxf3+6oOerZZc+O7r+UhvROji6OspyPm+rrIdb1gTXtVIqn+Sg==", "cpu": [ "arm64" ], @@ -2749,9 +2749,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.2.tgz", - "integrity": "sha512-HV7bW2Fb/F5KPdM/9bApunQh68YVDU8sO8BvcW9OngQVN3HHHkw99wFupuUJfGR9pYLLAjcAOA6iO+evsbBaPQ==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.46.3.tgz", + "integrity": "sha512-csnNavqZVs1+7/hUKtgjMECsNG2cdB8F7XBHP6FfQjqhjF8rzMzb3SLyy/1BG7YSfQ+bG75Ph7DyedbUqwq1rA==", "cpu": [ "arm64" ], @@ -2762,9 +2762,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.2.tgz", - "integrity": "sha512-SSj8TlYV5nJixSsm/y3QXfhspSiLYP11zpfwp6G/YDXctf3Xkdnk4woJIF5VQe0of2OjzTt8EsxnJDCdHd2xMA==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.46.3.tgz", + "integrity": "sha512-r2MXNjbuYabSIX5yQqnT8SGSQ26XQc8fmp6UhlYJd95PZJkQD1u82fWP7HqvGUf33IsOC6qsiV+vcuD4SDP6iw==", "cpu": [ "x64" ], @@ -2775,9 +2775,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-arm64": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.2.tgz", - "integrity": "sha512-ZyrsG4TIT9xnOlLsSSi9w/X29tCbK1yegE49RYm3tu3wF1L/B6LVMqnEWyDB26d9Ecx9zrmXCiPmIabVuLmNSg==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.46.3.tgz", + "integrity": "sha512-uluObTmgPJDuJh9xqxyr7MV61Imq+0IvVsAlWyvxAaBSNzCcmZlhfYcRhCdMaCsy46ccZa7vtDDripgs9Jkqsw==", "cpu": [ "arm64" ], @@ -2788,9 +2788,9 @@ ] }, "node_modules/@rollup/rollup-freebsd-x64": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.2.tgz", - "integrity": "sha512-pCgHFoOECwVCJ5GFq8+gR8SBKnMO+xe5UEqbemxBpCKYQddRQMgomv1104RnLSg7nNvgKy05sLsY51+OVRyiVw==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.46.3.tgz", + "integrity": "sha512-AVJXEq9RVHQnejdbFvh1eWEoobohUYN3nqJIPI4mNTMpsyYN01VvcAClxflyk2HIxvLpRcRggpX1m9hkXkpC/A==", "cpu": [ "x64" ], @@ -2801,9 +2801,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.2.tgz", - "integrity": "sha512-EtP8aquZ0xQg0ETFcxUbU71MZlHaw9MChwrQzatiE8U/bvi5uv/oChExXC4mWhjiqK7azGJBqU0tt5H123SzVA==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.46.3.tgz", + "integrity": "sha512-byyflM+huiwHlKi7VHLAYTKr67X199+V+mt1iRgJenAI594vcmGGddWlu6eHujmcdl6TqSNnvqaXJqZdnEWRGA==", "cpu": [ "arm" ], @@ -2814,9 +2814,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.2.tgz", - "integrity": "sha512-qO7F7U3u1nfxYRPM8HqFtLd+raev2K137dsV08q/LRKRLEc7RsiDWihUnrINdsWQxPR9jqZ8DIIZ1zJJAm5PjQ==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.46.3.tgz", + "integrity": "sha512-aLm3NMIjr4Y9LklrH5cu7yybBqoVCdr4Nvnm8WB7PKCn34fMCGypVNpGK0JQWdPAzR/FnoEoFtlRqZbBBLhVoQ==", "cpu": [ "arm" ], @@ -2827,9 +2827,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.2.tgz", - "integrity": "sha512-3dRaqLfcOXYsfvw5xMrxAk9Lb1f395gkoBYzSFcc/scgRFptRXL9DOaDpMiehf9CO8ZDRJW2z45b6fpU5nwjng==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.46.3.tgz", + "integrity": "sha512-VtilE6eznJRDIoFOzaagQodUksTEfLIsvXymS+UdJiSXrPW7Ai+WG4uapAc3F7Hgs791TwdGh4xyOzbuzIZrnw==", "cpu": [ "arm64" ], @@ -2840,9 +2840,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.2.tgz", - "integrity": "sha512-fhHFTutA7SM+IrR6lIfiHskxmpmPTJUXpWIsBXpeEwNgZzZZSg/q4i6FU4J8qOGyJ0TR+wXBwx/L7Ho9z0+uDg==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.46.3.tgz", + "integrity": "sha512-dG3JuS6+cRAL0GQ925Vppafi0qwZnkHdPeuZIxIPXqkCLP02l7ka+OCyBoDEv8S+nKHxfjvjW4OZ7hTdHkx8/w==", "cpu": [ "arm64" ], @@ -2853,9 +2853,9 @@ ] }, "node_modules/@rollup/rollup-linux-loongarch64-gnu": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.2.tgz", - "integrity": "sha512-i7wfGFXu8x4+FRqPymzjD+Hyav8l95UIZ773j7J7zRYc3Xsxy2wIn4x+llpunexXe6laaO72iEjeeGyUFmjKeA==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.46.3.tgz", + "integrity": "sha512-iU8DxnxEKJptf8Vcx4XvAUdpkZfaz0KWfRrnIRrOndL0SvzEte+MTM7nDH4A2Now4FvTZ01yFAgj6TX/mZl8hQ==", "cpu": [ "loong64" ], @@ -2879,9 +2879,9 @@ ] }, "node_modules/@rollup/rollup-linux-ppc64-gnu": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.2.tgz", - "integrity": "sha512-B/l0dFcHVUnqcGZWKcWBSV2PF01YUt0Rvlurci5P+neqY/yMKchGU8ullZvIv5e8Y1C6wOn+U03mrDylP5q9Yw==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.46.3.tgz", + "integrity": "sha512-VrQZp9tkk0yozJoQvQcqlWiqaPnLM6uY1qPYXvukKePb0fqaiQtOdMJSxNFUZFsGw5oA5vvVokjHrx8a9Qsz2A==", "cpu": [ "ppc64" ], @@ -2892,9 +2892,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.2.tgz", - "integrity": "sha512-32k4ENb5ygtkMwPMucAb8MtV8olkPT03oiTxJbgkJa7lJ7dZMr0GCFJlyvy+K8iq7F/iuOr41ZdUHaOiqyR3iQ==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.46.3.tgz", + "integrity": "sha512-uf2eucWSUb+M7b0poZ/08LsbcRgaDYL8NCGjUeFMwCWFwOuFcZ8D9ayPl25P3pl+D2FH45EbHdfyUesQ2Lt9wA==", "cpu": [ "riscv64" ], @@ -2905,9 +2905,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-musl": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.2.tgz", - "integrity": "sha512-t5B2loThlFEauloaQkZg9gxV05BYeITLvLkWOkRXogP4qHXLkWSbSHKM9S6H1schf/0YGP/qNKtiISlxvfmmZw==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.46.3.tgz", + "integrity": "sha512-7tnUcDvN8DHm/9ra+/nF7lLzYHDeODKKKrh6JmZejbh1FnCNZS8zMkZY5J4sEipy2OW1d1Ncc4gNHUd0DLqkSg==", "cpu": [ "riscv64" ], @@ -2918,9 +2918,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.2.tgz", - "integrity": "sha512-YKjekwTEKgbB7n17gmODSmJVUIvj8CX7q5442/CK80L8nqOUbMtf8b01QkG3jOqyr1rotrAnW6B/qiHwfcuWQA==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.46.3.tgz", + "integrity": "sha512-MUpAOallJim8CsJK+4Lc9tQzlfPbHxWDrGXZm2z6biaadNpvh3a5ewcdat478W+tXDoUiHwErX/dOql7ETcLqg==", "cpu": [ "s390x" ], @@ -2931,9 +2931,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.46.2.tgz", - "integrity": "sha512-Jj5a9RUoe5ra+MEyERkDKLwTXVu6s3aACP51nkfnK9wJTraCC8IMe3snOfALkrjTYd2G1ViE1hICj0fZ7ALBPA==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.46.3.tgz", + "integrity": "sha512-F42IgZI4JicE2vM2PWCe0N5mR5vR0gIdORPqhGQ32/u1S1v3kLtbZ0C/mi9FFk7C5T0PgdeyWEPajPjaUpyoKg==", "cpu": [ "x64" ], @@ -2944,9 +2944,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.2.tgz", - "integrity": "sha512-7kX69DIrBeD7yNp4A5b81izs8BqoZkCIaxQaOpumcJ1S/kmqNFjPhDu1LHeVXv0SexfHQv5cqHsxLOjETuqDuA==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.46.3.tgz", + "integrity": "sha512-oLc+JrwwvbimJUInzx56Q3ujL3Kkhxehg7O1gWAYzm8hImCd5ld1F2Gry5YDjR21MNb5WCKhC9hXgU7rRlyegQ==", "cpu": [ "x64" ], @@ -2957,9 +2957,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.2.tgz", - "integrity": "sha512-wiJWMIpeaak/jsbaq2HMh/rzZxHVW1rU6coyeNNpMwk5isiPjSTx0a4YLSlYDwBH/WBvLz+EtsNqQScZTLJy3g==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.46.3.tgz", + "integrity": "sha512-lOrQ+BVRstruD1fkWg9yjmumhowR0oLAAzavB7yFSaGltY8klttmZtCLvOXCmGE9mLIn8IBV/IFrQOWz5xbFPg==", "cpu": [ "arm64" ], @@ -2970,9 +2970,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.2.tgz", - "integrity": "sha512-gBgaUDESVzMgWZhcyjfs9QFK16D8K6QZpwAaVNJxYDLHWayOta4ZMjGm/vsAEy3hvlS2GosVFlBlP9/Wb85DqQ==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.46.3.tgz", + "integrity": "sha512-vvrVKPRS4GduGR7VMH8EylCBqsDcw6U+/0nPDuIjXQRbHJc6xOBj+frx8ksfZAh6+Fptw5wHrN7etlMmQnPQVg==", "cpu": [ "ia32" ], @@ -2983,9 +2983,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.2.tgz", - "integrity": "sha512-CvUo2ixeIQGtF6WvuB87XWqPQkoFAFqW+HUo/WzHwuHDvIwZCtjdWXoYCcr06iKGydiqTclC4jU/TNObC/xKZg==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.46.3.tgz", + "integrity": "sha512-fi3cPxCnu3ZeM3EwKZPgXbWoGzm2XHgB/WShKI81uj8wG0+laobmqy5wbgEwzstlbLu4MyO8C19FyhhWseYKNQ==", "cpu": [ "x64" ], @@ -4035,9 +4035,9 @@ } }, "node_modules/@sinclair/typebox": { - "version": "0.34.39", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@sinclair/typebox/-/typebox-0.34.39.tgz", - "integrity": "sha512-keEoFsevmLwAedzacnTVmra66GViRH3fhWO1M+nZ8rUgpPJyN4mcvqlGr3QMrQXx4L8KNwW0q9/BeHSEoO4teg==", + "version": "0.34.40", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@sinclair/typebox/-/typebox-0.34.40.tgz", + "integrity": "sha512-gwBNIP8ZAYev/ORDWW0QvxdwPXwxBtLsdsJgSc7eDIRt8ubP+rxUBzPsrwnu16fgEF8Bx4lh/+mvQvJzcTM6Kw==", "dev": true, "license": "MIT" }, @@ -4294,17 +4294,17 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.39.1.tgz", - "integrity": "sha512-yYegZ5n3Yr6eOcqgj2nJH8cH/ZZgF+l0YIdKILSDjYFRjgYQMgv/lRjV5Z7Up04b9VYUondt8EPMqg7kTWgJ2g==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.40.0.tgz", + "integrity": "sha512-w/EboPlBwnmOBtRbiOvzjD+wdiZdgFeo17lkltrtn7X37vagKKWJABvyfsJXTlHe6XBzugmYgd4A4nW+k8Mixw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/type-utils": "8.39.1", - "@typescript-eslint/utils": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/scope-manager": "8.40.0", + "@typescript-eslint/type-utils": "8.40.0", + "@typescript-eslint/utils": "8.40.0", + "@typescript-eslint/visitor-keys": "8.40.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -4318,22 +4318,22 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.39.1", + "@typescript-eslint/parser": "^8.40.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/parser/-/parser-8.39.1.tgz", - "integrity": "sha512-pUXGCuHnnKw6PyYq93lLRiZm3vjuslIy7tus1lIQTYVK9bL8XBgJnCWm8a0KcTtHC84Yya1Q6rtll+duSMj0dg==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/parser/-/parser-8.40.0.tgz", + "integrity": "sha512-jCNyAuXx8dr5KJMkecGmZ8KI61KBUhkCob+SD+C+I5+Y1FWI2Y3QmY4/cxMCC5WAsZqoEtEETVhUiUMIGCf6Bw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/scope-manager": "8.40.0", + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/typescript-estree": "8.40.0", + "@typescript-eslint/visitor-keys": "8.40.0", "debug": "^4.3.4" }, "engines": { @@ -4349,14 +4349,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/project-service/-/project-service-8.39.1.tgz", - "integrity": "sha512-8fZxek3ONTwBu9ptw5nCKqZOSkXshZB7uAxuFF0J/wTMkKydjXCzqqga7MlFMpHi9DoG4BadhmTkITBcg8Aybw==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/project-service/-/project-service-8.40.0.tgz", + "integrity": "sha512-/A89vz7Wf5DEXsGVvcGdYKbVM9F7DyFXj52lNYUDS1L9yJfqjW/fIp5PgMuEJL/KeqVTe2QSbXAGUZljDUpArw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.39.1", - "@typescript-eslint/types": "^8.39.1", + "@typescript-eslint/tsconfig-utils": "^8.40.0", + "@typescript-eslint/types": "^8.40.0", "debug": "^4.3.4" }, "engines": { @@ -4371,14 +4371,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/scope-manager/-/scope-manager-8.39.1.tgz", - "integrity": "sha512-RkBKGBrjgskFGWuyUGz/EtD8AF/GW49S21J8dvMzpJitOF1slLEbbHnNEtAHtnDAnx8qDEdRrULRnWVx27wGBw==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/scope-manager/-/scope-manager-8.40.0.tgz", + "integrity": "sha512-y9ObStCcdCiZKzwqsE8CcpyuVMwRouJbbSrNuThDpv16dFAj429IkM6LNb1dZ2m7hK5fHyzNcErZf7CEeKXR4w==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1" + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/visitor-keys": "8.40.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4389,9 +4389,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.39.1.tgz", - "integrity": "sha512-ePUPGVtTMR8XMU2Hee8kD0Pu4NDE1CN9Q1sxGSGd/mbOtGZDM7pnhXNJnzW63zk/q+Z54zVzj44HtwXln5CvHA==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.40.0.tgz", + "integrity": "sha512-jtMytmUaG9d/9kqSl/W3E3xaWESo4hFDxAIHGVW/WKKtQhesnRIJSAJO6XckluuJ6KDB5woD1EiqknriCtAmcw==", "dev": true, "license": "MIT", "engines": { @@ -4406,15 +4406,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/type-utils/-/type-utils-8.39.1.tgz", - "integrity": "sha512-gu9/ahyatyAdQbKeHnhT4R+y3YLtqqHyvkfDxaBYk97EcbfChSJXyaJnIL3ygUv7OuZatePHmQvuH5ru0lnVeA==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/type-utils/-/type-utils-8.40.0.tgz", + "integrity": "sha512-eE60cK4KzAc6ZrzlJnflXdrMqOBaugeukWICO2rB0KNvwdIMaEaYiywwHMzA1qFpTxrLhN9Lp4E/00EgWcD3Ow==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1", - "@typescript-eslint/utils": "8.39.1", + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/typescript-estree": "8.40.0", + "@typescript-eslint/utils": "8.40.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -4431,9 +4431,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/types/-/types-8.39.1.tgz", - "integrity": "sha512-7sPDKQQp+S11laqTrhHqeAbsCfMkwJMrV7oTDvtDds4mEofJYir414bYKUEb8YPUm9QL3U+8f6L6YExSoAGdQw==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/types/-/types-8.40.0.tgz", + "integrity": "sha512-ETdbFlgbAmXHyFPwqUIYrfc12ArvpBhEVgGAxVYSwli26dn8Ko+lIo4Su9vI9ykTZdJn+vJprs/0eZU0YMAEQg==", "dev": true, "license": "MIT", "engines": { @@ -4445,16 +4445,16 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/typescript-estree/-/typescript-estree-8.39.1.tgz", - "integrity": "sha512-EKkpcPuIux48dddVDXyQBlKdeTPMmALqBUbEk38McWv0qVEZwOpVJBi7ugK5qVNgeuYjGNQxrrnoM/5+TI/BPw==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/typescript-estree/-/typescript-estree-8.40.0.tgz", + "integrity": "sha512-k1z9+GJReVVOkc1WfVKs1vBrR5MIKKbdAjDTPvIK3L8De6KbFfPFt6BKpdkdk7rZS2GtC/m6yI5MYX+UsuvVYQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.39.1", - "@typescript-eslint/tsconfig-utils": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/visitor-keys": "8.39.1", + "@typescript-eslint/project-service": "8.40.0", + "@typescript-eslint/tsconfig-utils": "8.40.0", + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/visitor-keys": "8.40.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -4487,16 +4487,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/utils/-/utils-8.39.1.tgz", - "integrity": "sha512-VF5tZ2XnUSTuiqZFXCZfZs1cgkdd3O/sSYmdo2EpSyDlC86UM/8YytTmKnehOW3TGAlivqTDT6bS87B/GQ/jyg==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/utils/-/utils-8.40.0.tgz", + "integrity": "sha512-Cgzi2MXSZyAUOY+BFwGs17s7ad/7L+gKt6Y8rAVVWS+7o6wrjeFN4nVfTpbE25MNcxyJ+iYUXflbs2xR9h4UBg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.39.1", - "@typescript-eslint/types": "8.39.1", - "@typescript-eslint/typescript-estree": "8.39.1" + "@typescript-eslint/scope-manager": "8.40.0", + "@typescript-eslint/types": "8.40.0", + "@typescript-eslint/typescript-estree": "8.40.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -4530,13 +4530,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.39.1", - "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/visitor-keys/-/visitor-keys-8.39.1.tgz", - "integrity": "sha512-W8FQi6kEh2e8zVhQ0eeRnxdvIoOkAp/CPAahcNio6nO9dsIwb9b34z90KOlheoyuVf6LSOEdjlkxSkapNEc+4A==", + "version": "8.40.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/@typescript-eslint/visitor-keys/-/visitor-keys-8.40.0.tgz", + "integrity": "sha512-8CZ47QwalyRjsypfwnbI3hKy5gJDPmrkLjkgMxhi0+DZZ2QNx2naS6/hWoVYUHU7LU2zleF68V9miaVZvhFfTA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.39.1", + "@typescript-eslint/types": "8.40.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -5699,9 +5699,9 @@ "license": "MIT" }, "node_modules/browserslist": { - "version": "4.25.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/browserslist/-/browserslist-4.25.2.tgz", - "integrity": "sha512-0si2SJK3ooGzIawRu61ZdPCO1IncZwS8IzuX73sPZsXW6EQ/w/DAfPyKI8l1ETTCr2MnvqWitmlCUxgdul45jA==", + "version": "4.25.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/browserslist/-/browserslist-4.25.3.tgz", + "integrity": "sha512-cDGv1kkDI4/0e5yON9yM5G/0A5u8sf5TnmdX5C9qHzI9PPu++sQ9zjm1k9NiOrf3riY4OkK0zSGqfvJyJsgCBQ==", "dev": true, "funding": [ { @@ -5719,8 +5719,8 @@ ], "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001733", - "electron-to-chromium": "^1.5.199", + "caniuse-lite": "^1.0.30001735", + "electron-to-chromium": "^1.5.204", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -6798,9 +6798,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.202", - "resolved": "https://artifact.devsnc.com/repository/npm-all/electron-to-chromium/-/electron-to-chromium-1.5.202.tgz", - "integrity": "sha512-NxbYjRmiHcHXV1Ws3fWUW+SLb62isauajk45LUJ/HgIOkUA7jLZu/X2Iif+X9FBNK8QkF9Zb4Q2mcwXCcY30mg==", + "version": "1.5.207", + "resolved": "https://artifact.devsnc.com/repository/npm-all/electron-to-chromium/-/electron-to-chromium-1.5.207.tgz", + "integrity": "sha512-mryFrrL/GXDTmAtIVMVf+eIXM09BBPlO5IQ7lUyKmK8d+A4VpRGG+M3ofoVef6qyF8s60rJei8ymlJxjUA8Faw==", "dev": true, "license": "ISC" }, @@ -7348,9 +7348,9 @@ } }, "node_modules/eventsource-parser": { - "version": "3.0.3", - "resolved": "https://artifact.devsnc.com/repository/npm-all/eventsource-parser/-/eventsource-parser-3.0.3.tgz", - "integrity": "sha512-nVpZkTMM9rF6AQ9gPJpFsNAMt48wIzB5TQgiTLdHiuO8XEDhUgZEhqKlZWXbIzo9VmJ/HvysHqEaVeD5v9TPvA==", + "version": "3.0.5", + "resolved": "https://artifact.devsnc.com/repository/npm-all/eventsource-parser/-/eventsource-parser-3.0.5.tgz", + "integrity": "sha512-bSRG85ZrMdmWtm7qkF9He9TNRzc/Bm99gEJMaQoHJ9E6Kv9QBbsldh2oMj7iXmYNEAVvNgvv5vPorG6W+XtBhQ==", "license": "MIT", "engines": { "node": ">=20.0.0" @@ -8812,9 +8812,9 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.7", - "resolved": "https://artifact.devsnc.com/repository/npm-all/istanbul-reports/-/istanbul-reports-3.1.7.tgz", - "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", + "version": "3.2.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { @@ -11695,9 +11695,9 @@ } }, "node_modules/rollup": { - "version": "4.46.2", - "resolved": "https://artifact.devsnc.com/repository/npm-all/rollup/-/rollup-4.46.2.tgz", - "integrity": "sha512-WMmLFI+Boh6xbop+OAGo9cQ3OgX9MIg7xOQjn+pTCwOkk+FNDAeAemXkJ3HzDJrVXleLOFVa1ipuc1AmEx1Dwg==", + "version": "4.46.3", + "resolved": "https://artifact.devsnc.com/repository/npm-all/rollup/-/rollup-4.46.3.tgz", + "integrity": "sha512-RZn2XTjXb8t5g13f5YclGoilU/kwT696DIkY3sywjdZidNSi3+vseaQov7D7BZXVJCPv3pDWUN69C78GGbXsKw==", "license": "MIT", "dependencies": { "@types/estree": "1.0.8" @@ -11710,26 +11710,26 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.46.2", - "@rollup/rollup-android-arm64": "4.46.2", - "@rollup/rollup-darwin-arm64": "4.46.2", - "@rollup/rollup-darwin-x64": "4.46.2", - "@rollup/rollup-freebsd-arm64": "4.46.2", - "@rollup/rollup-freebsd-x64": "4.46.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.46.2", - "@rollup/rollup-linux-arm-musleabihf": "4.46.2", - "@rollup/rollup-linux-arm64-gnu": "4.46.2", - "@rollup/rollup-linux-arm64-musl": "4.46.2", - "@rollup/rollup-linux-loongarch64-gnu": "4.46.2", - "@rollup/rollup-linux-ppc64-gnu": "4.46.2", - "@rollup/rollup-linux-riscv64-gnu": "4.46.2", - "@rollup/rollup-linux-riscv64-musl": "4.46.2", - "@rollup/rollup-linux-s390x-gnu": "4.46.2", - "@rollup/rollup-linux-x64-gnu": "4.46.2", - "@rollup/rollup-linux-x64-musl": "4.46.2", - "@rollup/rollup-win32-arm64-msvc": "4.46.2", - "@rollup/rollup-win32-ia32-msvc": "4.46.2", - "@rollup/rollup-win32-x64-msvc": "4.46.2", + "@rollup/rollup-android-arm-eabi": "4.46.3", + "@rollup/rollup-android-arm64": "4.46.3", + "@rollup/rollup-darwin-arm64": "4.46.3", + "@rollup/rollup-darwin-x64": "4.46.3", + "@rollup/rollup-freebsd-arm64": "4.46.3", + "@rollup/rollup-freebsd-x64": "4.46.3", + "@rollup/rollup-linux-arm-gnueabihf": "4.46.3", + "@rollup/rollup-linux-arm-musleabihf": "4.46.3", + "@rollup/rollup-linux-arm64-gnu": "4.46.3", + "@rollup/rollup-linux-arm64-musl": "4.46.3", + "@rollup/rollup-linux-loongarch64-gnu": "4.46.3", + "@rollup/rollup-linux-ppc64-gnu": "4.46.3", + "@rollup/rollup-linux-riscv64-gnu": "4.46.3", + "@rollup/rollup-linux-riscv64-musl": "4.46.3", + "@rollup/rollup-linux-s390x-gnu": "4.46.3", + "@rollup/rollup-linux-x64-gnu": "4.46.3", + "@rollup/rollup-linux-x64-musl": "4.46.3", + "@rollup/rollup-win32-arm64-msvc": "4.46.3", + "@rollup/rollup-win32-ia32-msvc": "4.46.3", + "@rollup/rollup-win32-x64-msvc": "4.46.3", "fsevents": "~2.3.2" } }, @@ -12423,9 +12423,9 @@ "license": "MIT" }, "node_modules/string-width/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://artifact.devsnc.com/repository/npm-all/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + "version": "6.2.0", + "resolved": "https://artifact.devsnc.com/repository/npm-all/ansi-regex/-/ansi-regex-6.2.0.tgz", + "integrity": "sha512-TKY5pyBkHyADOPYlRT9Lx6F544mPl0vS5Ew7BJ45hA08Q+t3GjbueLliBWN3sMICk6+y7HdyxSzC4bWS8baBdg==", "license": "MIT", "engines": { "node": ">=12" diff --git a/package.json b/package.json index 7c0ea57..8c9d685 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@modesty/fluent-mcp", - "version": "0.0.12", + "version": "0.0.13", "description": "MCP server for Fluent (ServiceNow SDK)", "keywords": [ "Servicenow SDK", @@ -63,11 +63,11 @@ "@rollup/plugin-typescript": "^12.1.4", "@types/jest": "^30.0.0", "@types/node": "^24.3.0", - "@typescript-eslint/eslint-plugin": "^8.39.1", - "@typescript-eslint/parser": "^8.39.1", + "@typescript-eslint/eslint-plugin": "^8.40.0", + "@typescript-eslint/parser": "^8.40.0", "eslint": "^9.33.0", "jest": "^30.0.5", - "rollup": "^4.46.2", + "rollup": "^4.46.3", "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-sourcemaps": "^0.6.3", "ts-jest": "^29.4.1", diff --git a/src/tools/commands/authCommand.ts b/src/tools/commands/authCommand.ts index 8e88572..ab6ce6d 100644 --- a/src/tools/commands/authCommand.ts +++ b/src/tools/commands/authCommand.ts @@ -8,8 +8,8 @@ import { SessionFallbackCommand } from './sessionFallbackCommand.js'; * Handles adding, listing, deleting, and selecting auth profiles */ export class AuthCommand extends SessionFallbackCommand { - name = 'prepare_fluent_auth'; - description = 'Generate shell command to manage Fluent (ServiceNow SDK) authentication to with credential profiles, including create new auth alias, list /show existing ones, delete or use an existing one'; + name = 'manage_fluent_auth'; + description = 'Manage Fluent (ServiceNow SDK) authentication to instance with credential profiles, use this to add, list, delete, or switch between authentication profiles'; arguments: CommandArgument[] = [ { name: 'add', diff --git a/src/tools/commands/buildCommand.ts b/src/tools/commands/buildCommand.ts index d0c1e2e..54a2583 100644 --- a/src/tools/commands/buildCommand.ts +++ b/src/tools/commands/buildCommand.ts @@ -6,8 +6,8 @@ import { SessionAwareCLICommand } from './sessionAwareCommand.js'; * Uses the session's working directory */ export class BuildCommand extends SessionAwareCLICommand { - name = 'fluent_build'; - description = "Build the Fluent (ServiceNow SDK) application in the current session's working directory"; + name = 'build_fluent_app'; + description = 'Build the Fluent (ServiceNow SDK) application located in the current working directory.'; arguments: CommandArgument[] = [ { name: 'debug', diff --git a/src/tools/commands/dependenciesCommand.ts b/src/tools/commands/dependenciesCommand.ts index f42532d..24f0322 100644 --- a/src/tools/commands/dependenciesCommand.ts +++ b/src/tools/commands/dependenciesCommand.ts @@ -6,33 +6,9 @@ import { SessionAwareCLICommand } from './sessionAwareCommand.js'; * Uses the session's working directory */ export class DependenciesCommand extends SessionAwareCLICommand { - name = 'fluent_dependencies'; - description = "Manage dependencies for the Fluent (ServiceNow SDK) application in the current session's working directory"; + name = 'download_fluent_dependencies'; + description = 'Download configured dependencies in now.config.json and TypeScript type definitions for use in the application'; arguments: CommandArgument[] = [ - { - name: 'add', - type: 'boolean', - required: false, - description: 'Add dependencies', - }, - { - name: 'install', - type: 'boolean', - required: false, - description: 'Install dependencies', - }, - { - name: 'list', - type: 'boolean', - required: false, - description: 'List dependencies', - }, - { - name: 'packageName', - type: 'string', - required: false, - description: 'Name of the package to add', - }, { name: 'auth', type: 'string', @@ -51,23 +27,10 @@ export class DependenciesCommand extends SessionAwareCLICommand { const sdkArgs = ['now-sdk', 'dependencies']; // Add optional arguments if provided - if (args.add) { - sdkArgs.push('--add'); - - if (args.packageName) { - sdkArgs.push(args.packageName as string); - } - } else if (args.install) { - sdkArgs.push('--install'); - } else if (args.list) { - sdkArgs.push('--list'); - } - if (args.auth) { sdkArgs.push('--auth', args.auth as string); } - // Add debug flag if specified if (args.debug) { sdkArgs.push('--debug'); } diff --git a/src/tools/commands/helpCommand.ts b/src/tools/commands/helpCommand.ts index 362b5c3..c9be086 100644 --- a/src/tools/commands/helpCommand.ts +++ b/src/tools/commands/helpCommand.ts @@ -7,7 +7,7 @@ import { SessionFallbackCommand } from './sessionFallbackCommand.js'; */ export class HelpCommand extends SessionFallbackCommand { name = 'get_fluent_help'; - description = 'Get help information about Fluent (ServiceNow SDK) commands'; + description = 'Provides help and usage information for any Fluent (ServiceNow SDK) command.'; arguments: CommandArgument[] = [ { name: 'command', diff --git a/src/tools/commands/initCommand.ts b/src/tools/commands/initCommand.ts index e92f81b..1bc88d6 100644 --- a/src/tools/commands/initCommand.ts +++ b/src/tools/commands/initCommand.ts @@ -13,44 +13,44 @@ import logger from '../../utils/logger.js'; * Implements the init command with validation of prerequisites */ export class InitCommand extends BaseCLICommand { - name = 'prepare_fluent_init'; - description = "Generate the Shell command to initialize a Fluent (ServiceNow SDK) application: If specified working directory has no Fluent (ServiceNow SDK) application, it will create a new one. If it has a Fluent (ServiceNow SDK) application, it will save the directory as the working directory for future commands, including build, install, transform and dependencies.\nWhen converting an existing ServiceNow application, use the 'from' argument to specify the system ID or path to initialize from. \nNote, if the specified directory has no package-lock.json file, run `npm install` first.\nNote, This command will not execute the initialization but prepare the shell command to be run later."; + name = 'init_fluent_app'; + description = 'Initialize a new ServiceNow custom application or convert a legacy ServiceNow application from an instance or directory within the current directory'; arguments: CommandArgument[] = [ { name: 'from', type: 'string', required: false, - description: 'convert existing scoped app to Fluent by sys_id or path to initialize from', + description: 'convert existing scoped app to Fluent by sys_id or file path to initialize from', }, { name: 'appName', type: 'string', required: true, - description: 'The name of the application, this is the user friendly name that will be displayed in ServiceNow UI.', + description: 'The name of the application.', }, { name: 'packageName', type: 'string', required: true, - description: "The NPM package name for the application, usually it's the snake-case of appName in lowercase.", + description: "The NPM package name for the application, usually it's the snake-case of appName in lowercase with company prefix.", }, { name: 'scopeName', type: 'string', required: true, - description: "The scope name for the application in _ format. For localhost development, it should be in the format of 'sn_'. This is required to create a new Fluent (ServiceNow SDK) application, no spaces allowed.", + description: "The scope name for the application in _ format. For localhost development, it should be in the format of 'sn_'. No spaces allowed, no greater than 18 characters.", }, { name: 'auth', type: 'string', required: false, - description: "The authentication alias to use. If not provided, the default authentication alias will be used. You can set up authentication using the 'auth' command.", + description: "The authentication alias to use. If not provided, the default authentication alias will be used. You can set up authentication using the 'manage_fluent_auth' tool.", }, { name: 'workingDirectory', type: 'string', required: false, - description: "The directory where the Fluent (ServiceNow SDK) application will be created. If not provided, a new directory will be created in the user's home directory.", + description: "The directory where the Fluent (ServiceNow SDK) application will be created. If not provided, a new directory will be created in the project root if exists or the user's home directory.", }, { name: 'debug', diff --git a/src/tools/commands/installCommand.ts b/src/tools/commands/installCommand.ts index abab773..3d3a311 100644 --- a/src/tools/commands/installCommand.ts +++ b/src/tools/commands/installCommand.ts @@ -6,8 +6,8 @@ import { SessionAwareCLICommand } from './sessionAwareCommand.js'; * Uses the session's working directory */ export class InstallCommand extends SessionAwareCLICommand { - name = 'install_fluent_app'; - description = "Install / Deploy the Fluent (ServiceNow SDK) application in the current session's working directory to a ServiceNow instance"; + name = 'deploy_fluent_app'; + description = 'Deploy the Fluent (ServiceNow SDK) application to a ServiceNow instance by auth alias or default auth'; arguments: CommandArgument[] = [ { name: 'auth', diff --git a/src/tools/commands/transformCommand.ts b/src/tools/commands/transformCommand.ts index 754a086..6950764 100644 --- a/src/tools/commands/transformCommand.ts +++ b/src/tools/commands/transformCommand.ts @@ -7,19 +7,25 @@ import { SessionAwareCLICommand } from './sessionAwareCommand.js'; */ export class TransformCommand extends SessionAwareCLICommand { name = 'fluent_transform'; - description = "Transform files in the Fluent (ServiceNow SDK) application in the current session's working directory"; + description = 'Download and convert XML records from instance or from a local path into Fluent source code'; arguments: CommandArgument[] = [ { - name: 'source', + name: 'from', type: 'string', required: false, - description: 'Source file or directory to transform', + description: 'Path to local XML file(s)/directory to transform', }, { - name: 'destination', + name: 'directory', type: 'string', required: false, - description: 'Destination file or directory for transformed output', + description: 'Path to "package.json", default to current working directory', + }, + { + name: 'preview', + type: 'boolean', + required: false, + description: 'Preview fluent output and any transform errors without saving, default false', }, { name: 'debug', @@ -33,14 +39,17 @@ export class TransformCommand extends SessionAwareCLICommand { const sdkArgs = ['now-sdk', 'transform']; // Add optional arguments if provided - if (args.source) { - sdkArgs.push('--source', args.source as string); + if (args.from) { + sdkArgs.push('--from', args.from as string); } - if (args.destination) { - sdkArgs.push('--destination', args.destination as string); + if (args.directory) { + sdkArgs.push('--directory', args.directory as string); } + if (args.preview) { + sdkArgs.push('--preview', args.preview as string); + } // Add debug flag if specified if (args.debug) { sdkArgs.push('--debug'); diff --git a/src/tools/commands/versionCommand.ts b/src/tools/commands/versionCommand.ts index 968b878..cdbbb66 100644 --- a/src/tools/commands/versionCommand.ts +++ b/src/tools/commands/versionCommand.ts @@ -6,7 +6,7 @@ import { SessionFallbackCommand } from './sessionFallbackCommand.js'; */ export class VersionCommand extends SessionFallbackCommand { name = 'get_fluent_version'; - description = 'Get Fluent (ServiceNow SDK) version information'; + description = 'Retrieves the version number of the installed Fluent (ServiceNow SDK)'; arguments: CommandArgument[] = []; constructor(commandProcessor: CommandProcessor) { diff --git a/src/tools/resourceTools.ts b/src/tools/resourceTools.ts index ad63e78..29a0a11 100644 --- a/src/tools/resourceTools.ts +++ b/src/tools/resourceTools.ts @@ -113,7 +113,7 @@ export abstract class BaseResourceCommand implements CLICommand { */ export class GetApiSpecCommand extends BaseResourceCommand { name = 'get-api-spec'; - description = 'Get API specification for a ServiceNow metadata type'; + description = 'Fetches the Fluent API specification for a given ServiceNow metadata type (e.g., "business-rule", "acl", etc.).'; resourceType = ResourceType.SPEC; } @@ -122,7 +122,7 @@ export class GetApiSpecCommand extends BaseResourceCommand { */ export class GetSnippetCommand extends BaseResourceCommand { name = 'get-snippet'; - description = 'Get code snippet for a ServiceNow metadata type'; + description = 'Fetches the Fluent code snippet for a given ServiceNow metadata type'; resourceType = ResourceType.SNIPPET; /** @@ -200,7 +200,7 @@ export class GetSnippetCommand extends BaseResourceCommand { */ export class GetInstructCommand extends BaseResourceCommand { name = 'get-instruct'; - description = 'Get instructions for a ServiceNow metadata type'; + description = 'Retrieves instructions of Fluent API usage for a given ServiceNow metadata type'; resourceType = ResourceType.INSTRUCT; } @@ -209,7 +209,7 @@ export class GetInstructCommand extends BaseResourceCommand { */ export class ListMetadataTypesCommand implements CLICommand { name = 'list-metadata-types'; - description = 'List all available ServiceNow metadata types'; + description = 'List all available ServiceNow metadata types that currently supported by Fluent (ServiceNow SDK)'; arguments: CommandArgument[] = []; private resourceLoader: ResourceLoader; diff --git a/src/tools/toolsManager.ts b/src/tools/toolsManager.ts index fea1f32..5a8c52a 100644 --- a/src/tools/toolsManager.ts +++ b/src/tools/toolsManager.ts @@ -47,6 +47,8 @@ export class ToolsManager { commands.forEach((command) => { this.commandRegistry.register(command); + // Register each CLI command as an MCP tool + this.registerToolFromCommand(command); }); // Register resource tools diff --git a/test/server/fluentMCPServer.test.ts.fixed b/test/server/fluentMCPServer.test.ts.fixed deleted file mode 100644 index 9299e2c..0000000 --- a/test/server/fluentMCPServer.test.ts.fixed +++ /dev/null @@ -1,401 +0,0 @@ -/** - * Tests for FluentMCPServer resource capability with refactored module design - */ -import { FluentMcpServer } from "../../src/server/fluentMCPServer.js"; -import { ToolsManager } from "../../src/tools/toolsManager.js"; -import { ResourceManager } from "../../src/res/resourceManager.js"; -import { ServerStatus } from "../../src/types.js"; -import { patchLoggerForTests } from "../utils/loggerPatch.js"; - -// Mock the Model Context Protocol SDK -jest.mock("@modelcontextprotocol/sdk/server/mcp.js", () => { - // Create mock implementation for the MCP Server - const mockRegisterResource = jest.fn(); - const mockRegisterTool = jest.fn(); - const mockSetRequestHandler = jest.fn(); - const mockSetNotificationHandler = jest.fn(); - const mockRequest = jest.fn(); - const mockConnect = jest.fn(); - const mockClose = jest.fn(); - const mockNotification = jest.fn(); - - return { - __esModule: true, - mockSetNotificationHandler, - mockRequest, - McpServer: jest.fn().mockImplementation(() => ({ - registerResource: mockRegisterResource, - registerTool: mockRegisterTool, - connect: mockConnect, - close: mockClose, - server: { - setRequestHandler: mockSetRequestHandler, - setNotificationHandler: mockSetNotificationHandler, - notification: mockNotification, - request: mockRequest - } - })), - ResourceTemplate: jest.fn().mockImplementation((template, options) => ({ - template, - options - })) - }; -}); - -// Mock the StdioServerTransport -jest.mock("@modelcontextprotocol/sdk/server/stdio.js", () => { - return { - StdioServerTransport: jest.fn().mockImplementation(() => ({})) - }; -}); - -// Mock the config -jest.mock('../../src/config.js', () => ({ - getConfig: jest.fn().mockReturnValue({ - name: "test-mcp-server", - version: "1.0.0", - description: "Test MCP Server", - resourcePaths: { - spec: "/mock/path/to/spec", - snippet: "/mock/path/to/snippet", - instruct: "/mock/path/to/instruct", - } - }), - getProjectRootPath: jest.fn().mockReturnValue("/mock/project/root") -})); - -// Mock the ToolsManager -jest.mock("../../src/tools/toolsManager.js", () => { - const mockUpdateRoots = jest.fn(); - - return { - ToolsManager: jest.fn().mockImplementation(() => ({ - getMCPTools: jest.fn().mockReturnValue([ - { id: "mock-tool", title: "Mock Tool", description: "A mock tool for testing" } - ]), - getCommand: jest.fn().mockImplementation((name) => { - if (name === "mock-tool") { - return { - name: "mock-tool", - description: "A mock tool for testing", - execute: jest.fn().mockResolvedValue({ success: true, output: "Mock output" }) - }; - } - return undefined; - }), - formatResult: jest.fn().mockImplementation((result) => { - if (result.success) { - return `✅ Command executed successfully\n\nOutput:\n${result.output}`; - } else { - return `❌ Command failed (exit code: ${result.exitCode})\n\nError:\n${ - result.error || "Unknown error" - }\n\nOutput:\n${result.output}`; - } - }), - updateRoots: mockUpdateRoots - })), - mockUpdateRoots - }; -}); - -// Mock the ResourceManager -jest.mock("../../src/res/resourceManager.js", () => { - return { - ResourceManager: jest.fn().mockImplementation(() => ({ - initialize: jest.fn().mockResolvedValue(undefined), - registerAll: jest.fn(), - listResources: jest.fn().mockResolvedValue([ - { - uri: "sn-spec://business-rule", - title: "business-rule API Specification for Fluent (ServiceNow SDK)", - mimeType: "text/markdown" - }, - { - uri: "sn-instruct://business-rule", - title: "business-rule Instructions for Fluent (ServiceNow SDK)", - mimeType: "text/markdown" - }, - { - uri: "sn-snippet://business-rule/0001", - title: "business-rule Code Snippet for Fluent (ServiceNow SDK)", - mimeType: "text/markdown" - } - ]) - })) - }; -}); - -// Mock logger -jest.mock("../../src/utils/logger.js", () => { - return { - debug: jest.fn(), - info: jest.fn(), - warn: jest.fn(), - error: jest.fn(), - setMcpServer: jest.fn(), - setupLoggingHandlers: jest.fn(), - __esModule: true, - default: { - debug: jest.fn(), - info: jest.fn(), - warn: jest.fn(), - error: jest.fn(), - setMcpServer: jest.fn(), - setupLoggingHandlers: jest.fn() - } - }; -}); - -describe("FluentMcpServer with Modular Design", () => { - let server: FluentMcpServer; - - beforeEach(() => { - jest.clearAllMocks(); - // Patch the logger to handle missing notification function - patchLoggerForTests(); - server = new FluentMcpServer(); - }); - - test("should initialize correctly", () => { - expect(server).toBeDefined(); - expect(ToolsManager).toHaveBeenCalled(); - expect(ResourceManager).toHaveBeenCalled(); - }); - - test("should request roots from client and handle response", async () => { - // Mock the request response with roots - const mockRequest = require('@modelcontextprotocol/sdk/server/mcp.js').McpServer().server.request; - mockRequest.mockImplementation((request: { method: string }, schema: any) => { - if (request.method === 'roots/list') { - return { - roots: [ - { uri: 'file:///mock/client/root1', name: 'Client Root 1' }, - { uri: 'file:///mock/client/root2', name: 'Client Root 2' } - ] - }; - } - return {}; - }); - - await server.start(); - - // Simulate client sending the initialized notification - const { InitializedNotificationSchema } = require('@modelcontextprotocol/sdk/types.js'); - const { mockSetNotificationHandler } = require('@modelcontextprotocol/sdk/server/mcp.js'); - - // Find the initialized notification handler and call it - const initializedHandlerCall = mockSetNotificationHandler.mock.calls.find( - (call: any) => call[0] === InitializedNotificationSchema - ); - - if (initializedHandlerCall) { - // Call the handler to trigger the roots request - await initializedHandlerCall[1](); - } - - // Verify the request was made with correct parameters - expect(mockRequest).toHaveBeenCalledWith( - { method: 'roots/list' }, - expect.any(Object) // This will match the schema - ); - - // Get the roots - const roots = server.getRoots(); - expect(roots).toHaveLength(2); - expect(roots[0].uri).toBe('file:///mock/client/root1'); - expect(roots[0].name).toBe('Client Root 1'); - expect(roots[1].uri).toBe('file:///mock/client/root2'); - expect(roots[1].name).toBe('Client Root 2'); - }); - - test("should handle notifications for root changes", async () => { - // Since we've confirmed that the notification handler calls requestRootsFromClient, - // we can test the notification flow by directly testing requestRootsFromClient - - // Create a new server instance for clean test - jest.clearAllMocks(); - patchLoggerForTests(); - server = new FluentMcpServer(); - - // Set up request mock - const { mockRequest } = require('@modelcontextprotocol/sdk/server/mcp.js'); - - // Setup mock responses for roots/list - mockRequest.mockImplementation((request: { method: string }, schema: any) => { - if (request.method === 'roots/list') { - return { - roots: [ - { uri: 'file:///mock/client/root1', name: 'Client Root 1' }, - { uri: 'file:///mock/client/root2', name: 'Client Root 2' } - ] - }; - } - return {}; - }); - - // Start the server to initialize roots - await server.start(); - - // Simulate client sending the initialized notification - const { InitializedNotificationSchema } = require('@modelcontextprotocol/sdk/types.js'); - const { mockSetNotificationHandler } = require('@modelcontextprotocol/sdk/server/mcp.js'); - - // Find the initialized notification handler and call it - const initializedHandlerCall = mockSetNotificationHandler.mock.calls.find( - (call: any) => call[0] === InitializedNotificationSchema - ); - - if (initializedHandlerCall) { - // Call the handler to trigger the roots request - await initializedHandlerCall[1](); - } - - // Verify that requestRootsFromClient was called and roots were updated - const roots = server.getRoots(); - expect(roots).toHaveLength(2); - expect(roots[0].uri).toBe('file:///mock/client/root1'); - expect(roots[1].uri).toBe('file:///mock/client/root2'); - }); - - test("should handle invalid response format from roots/list", async () => { - // Create a completely new server for this test - jest.clearAllMocks(); - patchLoggerForTests(); - server = new FluentMcpServer(); - - // Mock an invalid response format - const { mockRequest } = require('@modelcontextprotocol/sdk/server/mcp.js'); - - // Clear previous mock implementations - mockRequest.mockReset(); - - // Set up new mock that throws an error - mockRequest.mockImplementation((request: { method: string }, schema: any) => { - if (request.method === 'roots/list') { - throw new Error('Invalid response format'); - } - return {}; - }); - - await server.start(); - - // Simulate client sending the initialized notification - const { InitializedNotificationSchema } = require('@modelcontextprotocol/sdk/types.js'); - const { mockSetNotificationHandler } = require('@modelcontextprotocol/sdk/server/mcp.js'); - - // Find the initialized notification handler and call it - const initializedHandlerCall = mockSetNotificationHandler.mock.calls.find( - (call: any) => call[0] === InitializedNotificationSchema - ); - - if (initializedHandlerCall) { - // Call the handler to trigger the roots request - await initializedHandlerCall[1](); - } - - // Should fallback to project root - const roots = server.getRoots(); - expect(roots).toHaveLength(1); - expect(roots[0].uri).toBe('/mock/project/root'); - }); - - describe("Root capability", () => { - const { mockUpdateRoots } = require("../../src/tools/toolsManager.js"); - - beforeEach(() => { - // Reset mockUpdateRoots to ensure clean state for each test - mockUpdateRoots.mockClear(); - }); - - test("should initialize with project root on start", async () => { - await server.start(); - - // Simulate client sending the initialized notification - const { InitializedNotificationSchema } = require('@modelcontextprotocol/sdk/types.js'); - const { mockSetNotificationHandler } = require('@modelcontextprotocol/sdk/server/mcp.js'); - - // Find the initialized notification handler and call it - const initializedHandlerCall = mockSetNotificationHandler.mock.calls.find( - (call: any) => call[0] === InitializedNotificationSchema - ); - - if (initializedHandlerCall) { - // Call the handler to trigger the roots request - await initializedHandlerCall[1](); - } - - const roots = server.getRoots(); - expect(roots).toHaveLength(1); - expect(roots[0].uri).toBe("/mock/project/root"); - expect(roots[0].name).toBe("Project Root"); - // Since we're now updating the roots in ToolsManager as part of addRoot - // during server.start, we just verify it was called at least once - expect(mockUpdateRoots).toHaveBeenCalled(); - }); - - test("should add a new root", async () => { - // Clear mockUpdateRoots calls from previous test - mockUpdateRoots.mockClear(); - - // Set the server status to RUNNING to ensure notifications are sent - // This mimics the real server behavior where roots are only updated when running - Object.defineProperty(server, 'status', { value: ServerStatus.RUNNING }); - - await server.addRoot("/test/path", "Test Root"); - const roots = server.getRoots(); - expect(roots).toHaveLength(1); - expect(roots[0].uri).toBe("/test/path"); - expect(roots[0].name).toBe("Test Root"); - expect(mockUpdateRoots).toHaveBeenCalled(); - }); - - test("should update an existing root", async () => { - // Clear mockUpdateRoots calls from previous test - mockUpdateRoots.mockClear(); - - // Set the server status to RUNNING to ensure notifications are sent - Object.defineProperty(server, 'status', { value: ServerStatus.RUNNING }); - - await server.addRoot("/test/path", "Test Root"); - await server.addRoot("/test/path", "Updated Root Name"); - const roots = server.getRoots(); - expect(roots).toHaveLength(1); - expect(roots[0].uri).toBe("/test/path"); - expect(roots[0].name).toBe("Updated Root Name"); - expect(mockUpdateRoots).toHaveBeenCalledTimes(2); - }); - - test("should remove a root", async () => { - // Clear mockUpdateRoots calls from previous test - mockUpdateRoots.mockClear(); - - // Set the server status to RUNNING to ensure notifications are sent - Object.defineProperty(server, 'status', { value: ServerStatus.RUNNING }); - - await server.addRoot("/test/path", "Test Root"); - await server.removeRoot("/test/path"); - const roots = server.getRoots(); - expect(roots).toHaveLength(0); - expect(mockUpdateRoots).toHaveBeenCalledTimes(2); - }); - - test("should update multiple roots", async () => { - // Clear mockUpdateRoots calls from previous test - mockUpdateRoots.mockClear(); - - // Set the server status to RUNNING to ensure notifications are sent - Object.defineProperty(server, 'status', { value: ServerStatus.RUNNING }); - - const newRoots = [ - { uri: "/root1", name: "Root 1" }, - { uri: "/root2", name: "Root 2" } - ]; - await server.updateRoots(newRoots); - const roots = server.getRoots(); - expect(roots).toHaveLength(2); - expect(roots[0].uri).toBe("/root1"); - expect(roots[1].uri).toBe("/root2"); - expect(mockUpdateRoots).toHaveBeenCalled(); - }); - }); -}); diff --git a/test/tools/authCommand.test.ts b/test/tools/authCommand.test.ts index e8cf576..39e94b1 100644 --- a/test/tools/authCommand.test.ts +++ b/test/tools/authCommand.test.ts @@ -38,9 +38,9 @@ describe("AuthCommand", () => { }); test("should have correct properties", () => { - expect(authCommand.name).toBe("prepare_fluent_auth"); + expect(authCommand.name).toBe("manage_fluent_auth"); expect(authCommand.description).toContain( - "shell command to manage Fluent (ServiceNow SDK) authentication" + "Manage Fluent (ServiceNow SDK) authentication" ); // Check for expected arguments expect(authCommand.arguments).toEqual( diff --git a/test/tools/initCommand.test.ts b/test/tools/initCommand.test.ts index 84e29bd..3e07a59 100644 --- a/test/tools/initCommand.test.ts +++ b/test/tools/initCommand.test.ts @@ -123,9 +123,9 @@ describe("InitCommand", () => { }); test("should have correct properties", () => { - expect(initCommand.name).toBe("prepare_fluent_init"); + expect(initCommand.name).toBe("init_fluent_app"); expect(initCommand.description).toContain( - "Fluent (ServiceNow SDK) application" + "Initialize a new ServiceNow custom application" ); expect(initCommand.arguments.length).toBeGreaterThan(0); diff --git a/test/tools/toolsManager.test.ts b/test/tools/toolsManager.test.ts index 12edcd6..c80ae03 100644 --- a/test/tools/toolsManager.test.ts +++ b/test/tools/toolsManager.test.ts @@ -1,31 +1,24 @@ /** * Tests for ToolsManager + * + * Note: Resource tool tests are in fluentMCPServer.resources.test.ts + * This file only tests the ToolsManager-specific functionality */ import { ToolsManager } from "../../src/tools/toolsManager.js"; // Mock the Model Context Protocol SDK jest.mock("@modelcontextprotocol/sdk/server/mcp.js", () => { // Create mock implementation for the MCP Server - const mockRegisterResource = jest.fn(); const mockRegisterTool = jest.fn(); - const mockSetRequestHandler = jest.fn(); - const mockConnect = jest.fn(); - const mockClose = jest.fn(); return { McpServer: jest.fn().mockImplementation(() => ({ - registerResource: mockRegisterResource, - registerTool: mockRegisterTool, - connect: mockConnect, - close: mockClose, - server: { - setRequestHandler: mockSetRequestHandler - } + registerTool: mockRegisterTool })) }; }); -// Mock command registry +// Mock command registry with minimal functionality needed for these tests jest.mock("../../src/tools/cliCommandTools.js", () => { const mockRegister = jest.fn(); const mockGetCommand = jest.fn(); @@ -37,14 +30,7 @@ jest.mock("../../src/tools/cliCommandTools.js", () => { CLIExecutor: jest.fn(), CLICmdWriter: jest.fn(), CommandFactory: { - createCommands: jest.fn().mockImplementation((executor, writer) => [ - { - name: "mock-command", - description: "A mock command for testing", - arguments: [], - execute: jest.fn().mockResolvedValue({ success: true, output: "Mock output" }) - } - ]) + createCommands: jest.fn().mockImplementation(() => []) }, CommandRegistry: jest.fn().mockImplementation(() => ({ register: mockRegister, @@ -55,8 +41,9 @@ jest.mock("../../src/tools/cliCommandTools.js", () => { }; }); -// Mock the resource tools +// Mock the resource tools module with proper arguments array jest.mock("../../src/tools/resourceTools.js", () => { + // Create commands with empty arguments arrays to satisfy iteration return { GetApiSpecCommand: jest.fn().mockImplementation(() => ({ name: "get-api-spec", @@ -80,10 +67,7 @@ jest.mock("../../src/tools/resourceTools.js", () => { name: "list-metadata-types", description: "List metadata types", arguments: [], - execute: jest.fn().mockResolvedValue({ - success: true, - output: "business-rule\nscript-include\ntable" - }) + execute: jest.fn().mockResolvedValue({ success: true, output: "Mock output" }) })) }; });