@mcp-consultant-tools/powerplatform 33.0.0 → 33.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/PowerPlatformService.d.ts +201 -0
- package/build/PowerPlatformService.js +305 -0
- package/build/PowerPlatformService.js.map +1 -0
- package/build/cli/commands/app-commands.d.ts +7 -0
- package/build/cli/commands/field-security-commands.d.ts +8 -0
- package/build/cli/commands/flow-commands.d.ts +7 -0
- package/build/cli/commands/form-commands.d.ts +7 -0
- package/build/cli/commands/index.d.ts +16 -0
- package/build/cli/commands/index.js +33 -0
- package/build/cli/commands/index.js.map +1 -0
- package/build/cli/commands/integration-commands.d.ts +7 -0
- package/build/cli/commands/metadata-commands.d.ts +7 -0
- package/build/cli/commands/plugin-commands.d.ts +7 -0
- package/build/cli/commands/security-commands.d.ts +7 -0
- package/build/cli/commands/solution-commands.d.ts +7 -0
- package/build/cli/output.d.ts +11 -0
- package/build/cli.d.ts +9 -0
- package/build/context-factory.d.ts +11 -0
- package/build/context-factory.js +39 -0
- package/build/context-factory.js.map +1 -0
- package/build/http-server.d.ts +3 -0
- package/build/index.d.ts +18 -0
- package/build/prompts/analysis-prompts.d.ts +3 -0
- package/build/prompts/analysis-prompts.js +286 -0
- package/build/prompts/analysis-prompts.js.map +1 -0
- package/build/prompts/entity-prompts.d.ts +3 -0
- package/build/prompts/entity-prompts.js +304 -0
- package/build/prompts/entity-prompts.js.map +1 -0
- package/build/prompts/index.d.ts +8 -0
- package/build/prompts/index.js +11 -0
- package/build/prompts/index.js.map +1 -0
- package/build/services/index.d.ts +5 -0
- package/build/services/index.js +5 -0
- package/build/services/index.js.map +1 -0
- package/build/tool-examples.d.ts +48 -0
- package/build/tools/app-tools.d.ts +3 -0
- package/build/tools/app-tools.js +127 -0
- package/build/tools/app-tools.js.map +1 -0
- package/build/tools/field-security-tools.d.ts +3 -0
- package/build/tools/field-security-tools.js +84 -0
- package/build/tools/field-security-tools.js.map +1 -0
- package/build/tools/flow-tools.d.ts +3 -0
- package/build/tools/flow-tools.js +374 -0
- package/build/tools/flow-tools.js.map +1 -0
- package/build/tools/form-view-tools.d.ts +3 -0
- package/build/tools/form-view-tools.js +162 -0
- package/build/tools/form-view-tools.js.map +1 -0
- package/build/tools/index.d.ts +14 -0
- package/build/tools/index.js +31 -0
- package/build/tools/index.js.map +1 -0
- package/build/tools/integration-tools.d.ts +3 -0
- package/build/tools/integration-tools.js +325 -0
- package/build/tools/integration-tools.js.map +1 -0
- package/build/tools/metadata-tools.d.ts +3 -0
- package/build/tools/metadata-tools.js +166 -0
- package/build/tools/metadata-tools.js.map +1 -0
- package/build/tools/plugin-tools.d.ts +3 -0
- package/build/tools/plugin-tools.js +138 -0
- package/build/tools/plugin-tools.js.map +1 -0
- package/build/tools/security-tools.d.ts +3 -0
- package/build/tools/security-tools.js +188 -0
- package/build/tools/security-tools.js.map +1 -0
- package/build/tools/solution-tools.d.ts +3 -0
- package/build/tools/solution-tools.js +318 -0
- package/build/tools/solution-tools.js.map +1 -0
- package/build/types.d.ts +9 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity Prompts - 6 prompts for entity analysis and plugin reports
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { ENTITY_OVERVIEW, ATTRIBUTE_DETAILS, QUERY_TEMPLATE, RELATIONSHIP_MAP, } from '@mcp-consultant-tools/powerplatform-core';
|
|
6
|
+
function makePromptResult(text) {
|
|
7
|
+
return {
|
|
8
|
+
messages: [
|
|
9
|
+
{
|
|
10
|
+
role: "assistant",
|
|
11
|
+
content: { type: "text", text },
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function makePromptError(message) {
|
|
17
|
+
return makePromptResult(`Error: ${message}`);
|
|
18
|
+
}
|
|
19
|
+
export function registerEntityPrompts(server, ctx) {
|
|
20
|
+
server.prompt("entity-overview", "Get an overview of a Power Platform entity", {
|
|
21
|
+
entityName: z.string().describe("The logical name of the entity")
|
|
22
|
+
}, async (args) => {
|
|
23
|
+
try {
|
|
24
|
+
const service = ctx.pp;
|
|
25
|
+
const entityName = args.entityName;
|
|
26
|
+
const [rawMetadata, attributes] = await Promise.all([
|
|
27
|
+
service.getEntityMetadata(entityName),
|
|
28
|
+
service.getEntityAttributes(entityName)
|
|
29
|
+
]);
|
|
30
|
+
const metadata = rawMetadata;
|
|
31
|
+
const entityDetails = `- Display Name: ${metadata.DisplayName?.UserLocalizedLabel?.Label || entityName}\n` +
|
|
32
|
+
`- Schema Name: ${metadata.SchemaName}\n` +
|
|
33
|
+
`- Description: ${metadata.Description?.UserLocalizedLabel?.Label || 'No description'}\n` +
|
|
34
|
+
`- Primary Key: ${metadata.PrimaryIdAttribute}\n` +
|
|
35
|
+
`- Primary Name: ${metadata.PrimaryNameAttribute}`;
|
|
36
|
+
const keyAttributes = attributes.value
|
|
37
|
+
.map((attr) => {
|
|
38
|
+
const attrType = attr["@odata.type"] || attr.odata?.type || "Unknown type";
|
|
39
|
+
return `- ${attr.LogicalName}: ${attrType}`;
|
|
40
|
+
})
|
|
41
|
+
.join('\n');
|
|
42
|
+
const relationships = await service.getEntityRelationships(entityName);
|
|
43
|
+
const oneToManyCount = relationships.oneToMany.value.length;
|
|
44
|
+
const manyToManyCount = relationships.manyToMany.value.length;
|
|
45
|
+
const relationshipsSummary = `- One-to-Many Relationships: ${oneToManyCount}\n` +
|
|
46
|
+
`- Many-to-Many Relationships: ${manyToManyCount}`;
|
|
47
|
+
let promptContent = ENTITY_OVERVIEW(entityName);
|
|
48
|
+
promptContent = promptContent
|
|
49
|
+
.replace('{{entity_details}}', entityDetails)
|
|
50
|
+
.replace('{{key_attributes}}', keyAttributes)
|
|
51
|
+
.replace('{{relationships}}', relationshipsSummary);
|
|
52
|
+
return makePromptResult(promptContent);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
console.error(`Error handling entity-overview prompt:`, error);
|
|
56
|
+
return makePromptError(error.message);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
server.prompt("attribute-details", "Get detailed information about a specific entity attribute/field", {
|
|
60
|
+
entityName: z.string().describe("The logical name of the entity"),
|
|
61
|
+
attributeName: z.string().describe("The logical name of the attribute"),
|
|
62
|
+
}, async (args) => {
|
|
63
|
+
try {
|
|
64
|
+
const service = ctx.pp;
|
|
65
|
+
const { entityName, attributeName } = args;
|
|
66
|
+
const attribute = await service.getEntityAttribute(entityName, attributeName);
|
|
67
|
+
const attrDetails = `- Display Name: ${attribute.DisplayName?.UserLocalizedLabel?.Label || attributeName}\n` +
|
|
68
|
+
`- Description: ${attribute.Description?.UserLocalizedLabel?.Label || 'No description'}\n` +
|
|
69
|
+
`- Type: ${attribute.AttributeType}\n` +
|
|
70
|
+
`- Format: ${attribute.Format || 'N/A'}\n` +
|
|
71
|
+
`- Is Required: ${attribute.RequiredLevel?.Value || 'No'}\n` +
|
|
72
|
+
`- Is Searchable: ${attribute.IsValidForAdvancedFind || false}`;
|
|
73
|
+
let promptContent = ATTRIBUTE_DETAILS(entityName, attributeName);
|
|
74
|
+
promptContent = promptContent
|
|
75
|
+
.replace('{{attribute_details}}', attrDetails)
|
|
76
|
+
.replace('{{data_type}}', attribute.AttributeType)
|
|
77
|
+
.replace('{{required}}', attribute.RequiredLevel?.Value || 'No')
|
|
78
|
+
.replace('{{max_length}}', attribute.MaxLength || 'N/A');
|
|
79
|
+
return makePromptResult(promptContent);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
console.error(`Error handling attribute-details prompt:`, error);
|
|
83
|
+
return makePromptError(error.message);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
server.prompt("query-template", "Get a template for querying a Power Platform entity", {
|
|
87
|
+
entityName: z.string().describe("The logical name of the entity"),
|
|
88
|
+
}, async (args) => {
|
|
89
|
+
try {
|
|
90
|
+
const service = ctx.pp;
|
|
91
|
+
const entityName = args.entityName;
|
|
92
|
+
const metadata = await service.getEntityMetadata(entityName);
|
|
93
|
+
const entityNamePlural = metadata.EntitySetName;
|
|
94
|
+
const attributes = await service.getEntityAttributes(entityName);
|
|
95
|
+
const selectFields = attributes.value
|
|
96
|
+
.filter((attr) => attr.IsValidForRead === true && !attr.AttributeOf)
|
|
97
|
+
.slice(0, 5)
|
|
98
|
+
.map((attr) => attr.LogicalName)
|
|
99
|
+
.join(',');
|
|
100
|
+
let promptContent = QUERY_TEMPLATE(entityNamePlural);
|
|
101
|
+
promptContent = promptContent
|
|
102
|
+
.replace('{{selected_fields}}', selectFields)
|
|
103
|
+
.replace('{{filter_conditions}}', `${metadata.PrimaryNameAttribute} eq 'Example'`)
|
|
104
|
+
.replace('{{order_by}}', `${metadata.PrimaryNameAttribute} asc`)
|
|
105
|
+
.replace('{{max_records}}', '50');
|
|
106
|
+
return makePromptResult(promptContent);
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
console.error(`Error handling query-template prompt:`, error);
|
|
110
|
+
return makePromptError(error.message);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
server.prompt("relationship-map", "Get a list of relationships for a Power Platform entity", {
|
|
114
|
+
entityName: z.string().describe("The logical name of the entity"),
|
|
115
|
+
}, async (args) => {
|
|
116
|
+
try {
|
|
117
|
+
const service = ctx.pp;
|
|
118
|
+
const entityName = args.entityName;
|
|
119
|
+
const relationships = await service.getEntityRelationships(entityName);
|
|
120
|
+
const oneToManyPrimary = relationships.oneToMany.value
|
|
121
|
+
.filter((rel) => rel.ReferencingEntity !== entityName)
|
|
122
|
+
.map((rel) => `- ${rel.SchemaName}: ${entityName} (1) → ${rel.ReferencingEntity} (N)`)
|
|
123
|
+
.join('\n');
|
|
124
|
+
const oneToManyRelated = relationships.oneToMany.value
|
|
125
|
+
.filter((rel) => rel.ReferencingEntity === entityName)
|
|
126
|
+
.map((rel) => `- ${rel.SchemaName}: ${rel.ReferencedEntity} (1) → ${entityName} (N)`)
|
|
127
|
+
.join('\n');
|
|
128
|
+
const manyToMany = relationships.manyToMany.value
|
|
129
|
+
.map((rel) => {
|
|
130
|
+
const otherEntity = rel.Entity1LogicalName === entityName ? rel.Entity2LogicalName : rel.Entity1LogicalName;
|
|
131
|
+
return `- ${rel.SchemaName}: ${entityName} (N) ↔ ${otherEntity} (N)`;
|
|
132
|
+
})
|
|
133
|
+
.join('\n');
|
|
134
|
+
let promptContent = RELATIONSHIP_MAP(entityName);
|
|
135
|
+
promptContent = promptContent
|
|
136
|
+
.replace('{{one_to_many_primary}}', oneToManyPrimary || 'None found')
|
|
137
|
+
.replace('{{one_to_many_related}}', oneToManyRelated || 'None found')
|
|
138
|
+
.replace('{{many_to_many}}', manyToMany || 'None found');
|
|
139
|
+
return makePromptResult(promptContent);
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
console.error(`Error handling relationship-map prompt:`, error);
|
|
143
|
+
return makePromptError(error.message);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
server.prompt("plugin-deployment-report", "Generate a comprehensive deployment report for a plugin assembly", {
|
|
147
|
+
assemblyName: z.string().describe("The name of the plugin assembly"),
|
|
148
|
+
}, async (args) => {
|
|
149
|
+
try {
|
|
150
|
+
const service = ctx.pp;
|
|
151
|
+
const result = await service.getPluginAssemblyComplete(args.assemblyName, false);
|
|
152
|
+
const assembly = result.assembly;
|
|
153
|
+
let report = `# Plugin Deployment Report: ${assembly.name}\n\n`;
|
|
154
|
+
report += `## Assembly Information\n`;
|
|
155
|
+
report += `- **Version**: ${assembly.version}\n`;
|
|
156
|
+
report += `- **Isolation Mode**: ${assembly.isolationmode === 2 ? 'Sandbox' : 'None'}\n`;
|
|
157
|
+
report += `- **Source**: ${assembly.sourcetype === 0 ? 'Database' : assembly.sourcetype === 1 ? 'Disk' : 'GAC'}\n`;
|
|
158
|
+
report += `- **Last Modified**: ${assembly.modifiedon} by ${assembly.modifiedby?.fullname || 'Unknown'}\n`;
|
|
159
|
+
report += `- **Managed**: ${assembly.ismanaged ? 'Yes' : 'No'}\n\n`;
|
|
160
|
+
report += `## Plugin Types (${result.pluginTypes.length} total)\n`;
|
|
161
|
+
result.pluginTypes.forEach((type, idx) => {
|
|
162
|
+
report += `${idx + 1}. ${type.typename}\n`;
|
|
163
|
+
});
|
|
164
|
+
report += `\n`;
|
|
165
|
+
report += `## Registered Steps (${result.steps.length} total)\n\n`;
|
|
166
|
+
result.steps.forEach((step) => {
|
|
167
|
+
const stageName = step.stage === 10 ? 'PreValidation' : step.stage === 20 ? 'PreOperation' : 'PostOperation';
|
|
168
|
+
const modeName = step.mode === 0 ? 'Sync' : 'Async';
|
|
169
|
+
const status = step.statuscode === 1 ? '✓ Enabled' : '✗ Disabled';
|
|
170
|
+
report += `### ${step.sdkmessageid?.name || 'Unknown'} - ${step.sdkmessagefilterid?.primaryobjecttypecode || 'None'} (${stageName}, ${modeName}, Rank ${step.rank})\n`;
|
|
171
|
+
report += `- **Plugin**: ${step.plugintypeid?.typename || 'Unknown'}\n`;
|
|
172
|
+
report += `- **Status**: ${status}\n`;
|
|
173
|
+
report += `- **Filtering Attributes**: ${step.filteringattributes || '(none - runs on all changes)'}\n`;
|
|
174
|
+
report += `- **Deployment**: ${step.supporteddeployment === 0 ? 'Server Only' : step.supporteddeployment === 1 ? 'Offline Only' : 'Both'}\n`;
|
|
175
|
+
if (step.images.length > 0) {
|
|
176
|
+
report += `- **Images**:\n`;
|
|
177
|
+
step.images.forEach((img) => {
|
|
178
|
+
const imageType = img.imagetype === 0 ? 'PreImage' : img.imagetype === 1 ? 'PostImage' : 'Both';
|
|
179
|
+
report += ` - ${img.name} (${imageType}) → Attributes: ${img.attributes || '(all)'}\n`;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
report += `- **Images**: None\n`;
|
|
184
|
+
}
|
|
185
|
+
report += `\n`;
|
|
186
|
+
});
|
|
187
|
+
report += `## Validation Results\n\n`;
|
|
188
|
+
if (result.validation.hasDisabledSteps) {
|
|
189
|
+
report += `⚠ Some steps are disabled\n`;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
report += `✓ All steps are enabled\n`;
|
|
193
|
+
}
|
|
194
|
+
if (result.validation.stepsWithoutFilteringAttributes.length > 0) {
|
|
195
|
+
report += `⚠ Warning: ${result.validation.stepsWithoutFilteringAttributes.length} Update/Delete steps without filtering attributes:\n`;
|
|
196
|
+
result.validation.stepsWithoutFilteringAttributes.forEach((name) => {
|
|
197
|
+
report += ` - ${name}\n`;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
report += `✓ All Update/Delete steps have filtering attributes\n`;
|
|
202
|
+
}
|
|
203
|
+
if (result.validation.stepsWithoutImages.length > 0) {
|
|
204
|
+
report += `⚠ Warning: ${result.validation.stepsWithoutImages.length} Update/Delete steps without images:\n`;
|
|
205
|
+
result.validation.stepsWithoutImages.forEach((name) => {
|
|
206
|
+
report += ` - ${name}\n`;
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (result.validation.potentialIssues.length > 0) {
|
|
210
|
+
report += `\n### Potential Issues\n`;
|
|
211
|
+
result.validation.potentialIssues.forEach((issue) => {
|
|
212
|
+
report += `- ${issue}\n`;
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
return makePromptResult(report);
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
console.error(`Error generating plugin deployment report:`, error);
|
|
219
|
+
return makePromptError(error.message);
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
server.prompt("entity-plugin-pipeline-report", "Generate a visual execution pipeline showing all plugins for an entity", {
|
|
223
|
+
entityName: z.string().describe("The logical name of the entity"),
|
|
224
|
+
messageFilter: z.string().optional().describe("Optional filter by message name"),
|
|
225
|
+
}, async (args) => {
|
|
226
|
+
try {
|
|
227
|
+
const service = ctx.pp;
|
|
228
|
+
const result = await service.getEntityPluginPipeline(args.entityName, args.messageFilter, false);
|
|
229
|
+
let report = `# Plugin Pipeline: ${result.entity} Entity\n\n`;
|
|
230
|
+
if (result.steps.length === 0) {
|
|
231
|
+
report += `No plugins registered for this entity.\n`;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
result.messages.forEach((msg) => {
|
|
235
|
+
report += `## ${msg.messageName} Message\n\n`;
|
|
236
|
+
if (msg.stages.preValidation.length > 0) {
|
|
237
|
+
report += `### Stage 1: PreValidation (Synchronous)\n`;
|
|
238
|
+
msg.stages.preValidation.forEach((step, idx) => {
|
|
239
|
+
report += `${idx + 1}. **[Rank ${step.rank}]** ${step.pluginType}\n`;
|
|
240
|
+
report += ` - Assembly: ${step.assemblyName} v${step.assemblyVersion}\n`;
|
|
241
|
+
report += ` - Filtering: ${step.filteringAttributes.join(', ') || '(all columns)'}\n`;
|
|
242
|
+
if (step.hasPreImage || step.hasPostImage) {
|
|
243
|
+
const images = [];
|
|
244
|
+
if (step.hasPreImage)
|
|
245
|
+
images.push('PreImage');
|
|
246
|
+
if (step.hasPostImage)
|
|
247
|
+
images.push('PostImage');
|
|
248
|
+
report += ` - Images: ${images.join(', ')}\n`;
|
|
249
|
+
}
|
|
250
|
+
report += `\n`;
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
if (msg.stages.preOperation.length > 0) {
|
|
254
|
+
report += `### Stage 2: PreOperation (Synchronous)\n`;
|
|
255
|
+
msg.stages.preOperation.forEach((step, idx) => {
|
|
256
|
+
report += `${idx + 1}. **[Rank ${step.rank}]** ${step.pluginType}\n`;
|
|
257
|
+
report += ` - Assembly: ${step.assemblyName} v${step.assemblyVersion}\n`;
|
|
258
|
+
report += ` - Filtering: ${step.filteringAttributes.join(', ') || '(all columns)'}\n`;
|
|
259
|
+
if (step.hasPreImage || step.hasPostImage) {
|
|
260
|
+
const images = [];
|
|
261
|
+
if (step.hasPreImage)
|
|
262
|
+
images.push('PreImage');
|
|
263
|
+
if (step.hasPostImage)
|
|
264
|
+
images.push('PostImage');
|
|
265
|
+
report += ` - Images: ${images.join(', ')}\n`;
|
|
266
|
+
}
|
|
267
|
+
report += `\n`;
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
if (msg.stages.postOperation.length > 0) {
|
|
271
|
+
report += `### Stage 3: PostOperation\n`;
|
|
272
|
+
msg.stages.postOperation.forEach((step, idx) => {
|
|
273
|
+
const mode = step.modeName === 'Asynchronous' ? ' (Async)' : ' (Sync)';
|
|
274
|
+
report += `${idx + 1}. **[Rank ${step.rank}]** ${step.pluginType}${mode}\n`;
|
|
275
|
+
report += ` - Assembly: ${step.assemblyName} v${step.assemblyVersion}\n`;
|
|
276
|
+
report += ` - Filtering: ${step.filteringAttributes.join(', ') || '(all columns)'}\n`;
|
|
277
|
+
if (step.hasPreImage || step.hasPostImage) {
|
|
278
|
+
const images = [];
|
|
279
|
+
if (step.hasPreImage)
|
|
280
|
+
images.push('PreImage');
|
|
281
|
+
if (step.hasPostImage)
|
|
282
|
+
images.push('PostImage');
|
|
283
|
+
report += ` - Images: ${images.join(', ')}\n`;
|
|
284
|
+
}
|
|
285
|
+
report += `\n`;
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
report += `---\n\n`;
|
|
289
|
+
});
|
|
290
|
+
report += `## Execution Order\n\n`;
|
|
291
|
+
report += `Plugins execute in this order:\n`;
|
|
292
|
+
result.executionOrder.forEach((name, idx) => {
|
|
293
|
+
report += `${idx + 1}. ${name}\n`;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
return makePromptResult(report);
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
console.error(`Error generating entity plugin pipeline report:`, error);
|
|
300
|
+
return makePromptError(error.message);
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=entity-prompts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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mB,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,eAAe,IAAI,CAAC;4BACxF,IAAI,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;gCAC1C,MAAM,MAAM,GAAG,EAAE,CAAC;gCAClB,IAAI,IAAI,CAAC,WAAW;oCAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gCAC9C,IAAI,IAAI,CAAC,YAAY;oCAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gCAChD,MAAM,IAAI,gBAAgB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;4BAClD,CAAC;4BACD,MAAM,IAAI,IAAI,CAAC;wBACjB,CAAC,CAAC,CAAC;oBACL,CAAC;oBAED,MAAM,IAAI,SAAS,CAAC;gBACtB,CAAC,CAAC,CAAC;gBAEH,MAAM,IAAI,wBAAwB,CAAC;gBACnC,MAAM,IAAI,kCAAkC,CAAC;gBAC7C,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,IAAY,EAAE,GAAW,EAAE,EAAE;oBAC1D,MAAM,IAAI,GAAG,GAAG,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC;gBACpC,CAAC,CAAC,CAAC;YACL,CAAC;YAED,OAAO,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,iDAAiD,EAAE,KAAK,CAAC,CAAC;YACxE,OAAO,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompts barrel export + combined registration
|
|
3
|
+
*/
|
|
4
|
+
import type { ServiceContext } from '../types.js';
|
|
5
|
+
export declare function registerAllPrompts(server: any, ctx: ServiceContext): void;
|
|
6
|
+
export { registerEntityPrompts } from './entity-prompts.js';
|
|
7
|
+
export { registerAnalysisPrompts } from './analysis-prompts.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { registerEntityPrompts } from './entity-prompts.js';
|
|
2
|
+
import { registerAnalysisPrompts } from './analysis-prompts.js';
|
|
3
|
+
export function registerAllPrompts(server, ctx) {
|
|
4
|
+
registerEntityPrompts(server, ctx);
|
|
5
|
+
registerAnalysisPrompts(server, ctx);
|
|
6
|
+
// 6 entity + 6 analysis = 12
|
|
7
|
+
console.error(`powerplatform prompts registered: 12 prompts`);
|
|
8
|
+
}
|
|
9
|
+
export { registerEntityPrompts } from './entity-prompts.js';
|
|
10
|
+
export { registerAnalysisPrompts } from './analysis-prompts.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,UAAU,kBAAkB,CAAC,MAAW,EAAE,GAAmB;IACjE,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,uBAAuB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAErC,6BAA6B;IAC7B,OAAO,CAAC,KAAK,CAAC,8CAA8C,CAAC,CAAC;AAChE,CAAC;AAED,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Examples for PowerPlatform Read-Only Tools
|
|
3
|
+
* Provides examples to improve LLM accuracy when using these tools.
|
|
4
|
+
*
|
|
5
|
+
* Anthropic research shows 72% -> 90% accuracy improvement with examples.
|
|
6
|
+
*/
|
|
7
|
+
export { descWithExamples } from '@mcp-consultant-tools/core';
|
|
8
|
+
export declare const ENTITY_NAME_EXAMPLES: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
}[];
|
|
12
|
+
export declare const ATTRIBUTE_TYPE_EXAMPLES: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
}[];
|
|
16
|
+
export declare const FLOW_CATEGORY_EXAMPLES: {
|
|
17
|
+
label: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}[];
|
|
20
|
+
export declare const STATECODE_EXAMPLES: {
|
|
21
|
+
label: string;
|
|
22
|
+
value: string;
|
|
23
|
+
}[];
|
|
24
|
+
export declare const FLOW_RUN_STATUS_EXAMPLES: {
|
|
25
|
+
label: string;
|
|
26
|
+
value: string;
|
|
27
|
+
}[];
|
|
28
|
+
export declare const MESSAGE_FILTER_EXAMPLES: {
|
|
29
|
+
label: string;
|
|
30
|
+
value: string;
|
|
31
|
+
}[];
|
|
32
|
+
export declare const HOURS_BACK_EXAMPLES: {
|
|
33
|
+
label: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}[];
|
|
36
|
+
export declare const SOLUTION_NAME_EXAMPLES: {
|
|
37
|
+
label: string;
|
|
38
|
+
value: string;
|
|
39
|
+
}[];
|
|
40
|
+
export declare const COMPONENT_TYPE_EXAMPLES: {
|
|
41
|
+
label: string;
|
|
42
|
+
value: string;
|
|
43
|
+
}[];
|
|
44
|
+
export declare const OUTPUT_FORMAT_EXAMPLES: {
|
|
45
|
+
label: string;
|
|
46
|
+
value: string;
|
|
47
|
+
}[];
|
|
48
|
+
//# sourceMappingURL=tool-examples.d.ts.map
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* App Tools - 4 tools for model-driven app inspection
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { descWithExamples, SOLUTION_NAME_EXAMPLES } from '../tool-examples.js';
|
|
6
|
+
export function registerAppTools(server, ctx) {
|
|
7
|
+
server.tool("get-apps", "Get all model-driven apps in the PowerPlatform environment. Returns app name, unique name, URL, published status, and solution association.", {
|
|
8
|
+
activeOnly: z.boolean().optional().describe("Only return active apps (default: false)"),
|
|
9
|
+
maxRecords: z.number().optional().describe("Maximum number of apps to return (default: 100)"),
|
|
10
|
+
includeUnpublished: z.boolean().optional().describe("Include unpublished/draft apps (default: true)"),
|
|
11
|
+
solutionUniqueName: z.string().optional().describe(descWithExamples("Filter apps by solution unique name", SOLUTION_NAME_EXAMPLES)),
|
|
12
|
+
}, async ({ activeOnly, maxRecords, includeUnpublished, solutionUniqueName }) => {
|
|
13
|
+
try {
|
|
14
|
+
const service = ctx.pp;
|
|
15
|
+
const result = await service.getApps(activeOnly || false, maxRecords || 100, includeUnpublished !== undefined ? includeUnpublished : true, solutionUniqueName);
|
|
16
|
+
const resultStr = JSON.stringify(result, null, 2);
|
|
17
|
+
return {
|
|
18
|
+
content: [
|
|
19
|
+
{
|
|
20
|
+
type: "text",
|
|
21
|
+
text: `Model-Driven Apps (found ${result.totalCount}):\n\n${resultStr}`,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
console.error("Error getting apps:", error);
|
|
28
|
+
return {
|
|
29
|
+
content: [
|
|
30
|
+
{
|
|
31
|
+
type: "text",
|
|
32
|
+
text: `Failed to get apps: ${error.message}`,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
isError: true
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
server.tool("get-app", "Get detailed information about a specific model-driven app", {
|
|
40
|
+
appId: z.string().describe("The GUID of the app (appmoduleid)"),
|
|
41
|
+
}, async ({ appId }) => {
|
|
42
|
+
try {
|
|
43
|
+
const service = ctx.pp;
|
|
44
|
+
const result = await service.getApp(appId);
|
|
45
|
+
const resultStr = JSON.stringify(result, null, 2);
|
|
46
|
+
return {
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: "text",
|
|
50
|
+
text: `Model-Driven App '${result.name}':\n\n${resultStr}`,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.error("Error getting app:", error);
|
|
57
|
+
return {
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: "text",
|
|
61
|
+
text: `Failed to get app: ${error.message}`,
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
isError: true
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
server.tool("get-app-components", "Get all components (entities, forms, views, sitemaps) in a model-driven app", {
|
|
69
|
+
appId: z.string().describe("The GUID of the app (appmoduleid)"),
|
|
70
|
+
}, async ({ appId }) => {
|
|
71
|
+
try {
|
|
72
|
+
const service = ctx.pp;
|
|
73
|
+
const result = await service.getAppComponents(appId);
|
|
74
|
+
const resultStr = JSON.stringify(result, null, 2);
|
|
75
|
+
return {
|
|
76
|
+
content: [
|
|
77
|
+
{
|
|
78
|
+
type: "text",
|
|
79
|
+
text: `App Components (found ${result.totalCount}):\n\n${resultStr}`,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error("Error getting app components:", error);
|
|
86
|
+
return {
|
|
87
|
+
content: [
|
|
88
|
+
{
|
|
89
|
+
type: "text",
|
|
90
|
+
text: `Failed to get app components: ${error.message}`,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
isError: true
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
server.tool("get-app-sitemap", "Get the sitemap (navigation) configuration for a model-driven app", {
|
|
98
|
+
appId: z.string().describe("The GUID of the app (appmoduleid)"),
|
|
99
|
+
}, async ({ appId }) => {
|
|
100
|
+
try {
|
|
101
|
+
const service = ctx.pp;
|
|
102
|
+
const result = await service.getAppSitemap(appId);
|
|
103
|
+
const resultStr = JSON.stringify(result, null, 2);
|
|
104
|
+
return {
|
|
105
|
+
content: [
|
|
106
|
+
{
|
|
107
|
+
type: "text",
|
|
108
|
+
text: `App Sitemap:\n\n${resultStr}`,
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
console.error("Error getting app sitemap:", error);
|
|
115
|
+
return {
|
|
116
|
+
content: [
|
|
117
|
+
{
|
|
118
|
+
type: "text",
|
|
119
|
+
text: `Failed to get app sitemap: ${error.message}`,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
isError: true
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=app-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-tools.js","sourceRoot":"","sources":["../../src/tools/app-tools.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE/E,MAAM,UAAU,gBAAgB,CAAC,MAAW,EAAE,GAAmB;IAC/D,MAAM,CAAC,IAAI,CACT,UAAU,EACV,6IAA6I,EAC7I;QACE,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;QACvF,UAAU,EAAE,CAAC,CAAC,MA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,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field Security Tools (read-only) - 3 tools
|
|
3
|
+
*
|
|
4
|
+
* Tools: list-field-security-profiles, get-field-security-profile, get-secured-columns
|
|
5
|
+
*/
|
|
6
|
+
import { z } from 'zod';
|
|
7
|
+
import { descWithExamples, ENTITY_NAME_EXAMPLES } from '../tool-examples.js';
|
|
8
|
+
function ok(text) {
|
|
9
|
+
return { content: [{ type: 'text', text }] };
|
|
10
|
+
}
|
|
11
|
+
function err(message) {
|
|
12
|
+
return { content: [{ type: 'text', text: message }], isError: true };
|
|
13
|
+
}
|
|
14
|
+
export function registerFieldSecurityTools(server, ctx) {
|
|
15
|
+
server.tool('list-field-security-profiles', 'List all Field Security Profiles in the environment, with optional name substring filter. Returns id, name, description, and managed flag for each.', {
|
|
16
|
+
namePattern: z
|
|
17
|
+
.string()
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Case-insensitive substring filter on FSP name'),
|
|
20
|
+
}, async (params) => {
|
|
21
|
+
try {
|
|
22
|
+
const results = await ctx.pp.listFieldSecurityProfiles(params.namePattern);
|
|
23
|
+
if (results.length === 0)
|
|
24
|
+
return ok('No field security profiles found.');
|
|
25
|
+
const lines = results.map((r) => `- ${r.name}${r.isManaged ? ' [managed]' : ''} (${r.fieldSecurityProfileId})${r.description ? ` — ${r.description}` : ''}`);
|
|
26
|
+
return ok(`Found ${results.length} field security profile(s):\n${lines.join('\n')}`);
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
console.error('Error in list-field-security-profiles:', error);
|
|
30
|
+
return err(`Failed to list FSPs: ${error.message}`);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
server.tool('get-field-security-profile', 'Get a single Field Security Profile with all its field permissions and team/user assignments — a one-call snapshot.', {
|
|
34
|
+
fieldSecurityProfileId: z
|
|
35
|
+
.string()
|
|
36
|
+
.describe('GUID of the field security profile'),
|
|
37
|
+
}, async (params) => {
|
|
38
|
+
try {
|
|
39
|
+
const r = await ctx.pp.getFieldSecurityProfile(params.fieldSecurityProfileId);
|
|
40
|
+
const permLines = r.permissions.length
|
|
41
|
+
? r.permissions
|
|
42
|
+
.map((p) => ` - ${p.entityName}.${p.attributeLogicalName}: C=${p.canCreate} R=${p.canRead} U=${p.canUpdate}`)
|
|
43
|
+
.join('\n')
|
|
44
|
+
: ' (none)';
|
|
45
|
+
const teamLines = r.teams.length
|
|
46
|
+
? r.teams.map((t) => ` - ${t.name} (${t.teamId})`).join('\n')
|
|
47
|
+
: ' (none)';
|
|
48
|
+
const userLines = r.users.length
|
|
49
|
+
? r.users.map((u) => ` - ${u.fullName} (${u.systemUserId})`).join('\n')
|
|
50
|
+
: ' (none)';
|
|
51
|
+
return ok(`FSP "${r.name}"${r.isManaged ? ' [managed]' : ''}\nId: ${r.fieldSecurityProfileId}\n${r.description ? `Description: ${r.description}\n` : ''}\nPermissions (${r.permissions.length}):\n${permLines}\n\nTeams (${r.teams.length}):\n${teamLines}\n\nUsers (${r.users.length}):\n${userLines}`);
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
console.error('Error in get-field-security-profile:', error);
|
|
55
|
+
return err(`Failed to get FSP: ${error.message}`);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
server.tool('get-secured-columns', 'List all secured columns on an entity (columns with IsSecured=true on metadata) plus the Field Security Profiles that grant access to each. Useful for auditing field security coverage.', {
|
|
59
|
+
entityLogicalName: z
|
|
60
|
+
.string()
|
|
61
|
+
.describe(descWithExamples('Entity logical name', ENTITY_NAME_EXAMPLES)),
|
|
62
|
+
}, async (params) => {
|
|
63
|
+
try {
|
|
64
|
+
const cols = await ctx.pp.getSecuredColumns(params.entityLogicalName);
|
|
65
|
+
if (cols.length === 0) {
|
|
66
|
+
return ok(`No secured columns on ${params.entityLogicalName}.`);
|
|
67
|
+
}
|
|
68
|
+
const lines = cols.map((c) => {
|
|
69
|
+
const fspLines = c.fieldSecurityProfiles.length
|
|
70
|
+
? c.fieldSecurityProfiles
|
|
71
|
+
.map((f) => ` · ${f.name} (${f.fieldSecurityProfileId}): C=${f.canCreate} R=${f.canRead} U=${f.canUpdate}`)
|
|
72
|
+
.join('\n')
|
|
73
|
+
: ' (no FSP grants access — column is fully locked down)';
|
|
74
|
+
return `- ${c.attributeLogicalName} [${c.attributeType}]\n${fspLines}`;
|
|
75
|
+
});
|
|
76
|
+
return ok(`Secured columns on ${params.entityLogicalName} (${cols.length}):\n${lines.join('\n')}`);
|
|
77
|
+
}
|
|
78
|
+
catch (error) {
|
|
79
|
+
console.error('Error in get-secured-columns:', error);
|
|
80
|
+
return err(`Failed to get secured columns: ${error.message}`);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=field-security-tools.js.map
|