generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 50
TBI(MCP) Add new tool get_fiori_rules to include default rules #3748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
devinea
wants to merge
7
commits into
main
Choose a base branch
from
mcp_rules
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5fec087
feat: add Fiori rules and enhance server functionality with prompt ha…
devinea 3798034
Add new tool get_fiori_rules to include default rules
devinea 192eb1e
Add cset
devinea a3d9bd9
add tests
devinea 2eb4b92
feat: add prompt handling tests for Fiori rules in FioriFunctionality…
devinea 49f538e
feedback
devinea ed0e8d2
Merge remote-tracking branch 'origin/main' into mcp_rules
devinea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@sap-ux/fiori-mcp-server': minor | ||
--- | ||
|
||
Add new tool get_fiori_rules to include default rules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const { build } = require('esbuild'); | ||
|
||
const baseConfig = { | ||
entryPoints: ['src/index.ts'], | ||
bundle: true, | ||
platform: 'node', | ||
target: 'node20', | ||
outdir: 'dist', | ||
external: ['vscode', '@lancedb/lancedb', '@xenova/transformers', '@sap-ux/fiori-docs-embeddings'], | ||
mainFields: ['module', 'main'], | ||
loader: { | ||
'.md': 'text' | ||
} | ||
}; | ||
|
||
const isDev = process.argv.includes('--dev'); | ||
const isProd = process.argv.includes('--minify'); | ||
|
||
build({ | ||
...baseConfig, | ||
sourcemap: isDev ? 'inline' : false, | ||
minify: isProd | ||
}).catch(() => process.exit(1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Rules for creation or modification of SAP Fiori elements apps | ||
|
||
- When asked to create an SAP Fiori elements app check whether the user input can be interpreted as an application organized into one or more pages containing table data or forms, these can be translated into a SAP Fiori elements application, else ask the user for suitable input. | ||
- The application typically starts with a List Report page showing the data of the base entity of the application in a table. Details of a specific table row are shown in the ObjectPage. This first Object Page is therefore based on the base entity of the application. | ||
- An Object Page can contain one or more table sections based on to-many associations of its entity type. The details of a table section row can be shown in an another Object Page based on the associations target entity. | ||
- The data model must be suitable for usage in a SAP Fiori elements frontend application. So there must be one main entity and one or more navigation properties to related entities. | ||
- Each property of an entity must have a proper datatype. | ||
- For all entities in the data model provide primary keys of type UUID. | ||
- When creating sample data in CSV files, all primary keys and foreign keys MUST be in UUID format (e.g., `550e8400-e29b-41d4-a716-446655440001`). | ||
- When generating or modifying the SAP Fiori elements application on top of the CAP service use the Fiori MCP server if available. | ||
- When attempting to modify the SAP Fiori elements application like adding columns you must not use the screen personalization but instead modify the code of the project, before this first check whether an MCP server provides a suitable function. | ||
- When previewing the SAP Fiori elements application use the most specific `npm run watch-*` script for the app in the `package.json`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import fioriRulesContent from './fiori-rules.md'; | ||
|
||
/** | ||
* Returns the Fiori rules content bundled at build time. | ||
* | ||
* @returns The Fiori rules content as a string | ||
*/ | ||
export function getFioriRules(): string { | ||
return fioriRulesContent; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare module '*.md' { | ||
const content: string; | ||
export default content; | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/fiori-mcp-server/test/__mocks__/markdown-transform.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const { readFileSync } = require('fs'); | ||
|
||
module.exports = { | ||
process(sourceText, sourcePath) { | ||
// Read the actual markdown file content | ||
const content = readFileSync(sourcePath, 'utf-8'); | ||
|
||
// Return as a CommonJS module that exports the content as default | ||
return { | ||
code: `module.exports = ${JSON.stringify(content)};` | ||
}; | ||
} | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.