@cplace/mcp-server 1.9.1 → 1.10.6
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/README.md +12 -13
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/plugins/app-catalog.js +1 -1
- package/dist/plugins/app-catalog.js.map +1 -1
- package/dist/plugins/application-settings.d.ts.map +1 -1
- package/dist/plugins/application-settings.js +6 -3
- package/dist/plugins/application-settings.js.map +1 -1
- package/dist/plugins/core/widget-specifications/cf.cplace.platform.tableWidget/columns.md +6 -0
- package/dist/plugins/core.d.ts.map +1 -1
- package/dist/plugins/core.js +25 -13
- package/dist/plugins/core.js.map +1 -1
- package/dist/plugins/forms-wizard.js +2 -2
- package/dist/plugins/forms-wizard.js.map +1 -1
- package/dist/plugins/history.d.ts.map +1 -1
- package/dist/plugins/history.js +6 -3
- package/dist/plugins/history.js.map +1 -1
- package/dist/plugins/jobs.js +2 -2
- package/dist/plugins/jobs.js.map +1 -1
- package/dist/plugins/layouts.d.ts.map +1 -1
- package/dist/plugins/layouts.js +17 -8
- package/dist/plugins/layouts.js.map +1 -1
- package/dist/plugins/low-code.d.ts.map +1 -1
- package/dist/plugins/low-code.js +48 -17
- package/dist/plugins/low-code.js.map +1 -1
- package/dist/plugins/project-planning.d.ts.map +1 -1
- package/dist/plugins/project-planning.js +6 -3
- package/dist/plugins/project-planning.js.map +1 -1
- package/dist/plugins/resource-management.d.ts.map +1 -1
- package/dist/plugins/resource-management.js +6 -3
- package/dist/plugins/resource-management.js.map +1 -1
- package/dist/plugins/solution-management.d.ts.map +1 -1
- package/dist/plugins/solution-management.js +6 -3
- package/dist/plugins/solution-management.js.map +1 -1
- package/dist/plugins/types-write.d.ts.map +1 -1
- package/dist/plugins/types-write.js +6 -3
- package/dist/plugins/types-write.js.map +1 -1
- package/dist/plugins/widget-specifications.d.ts.map +1 -1
- package/dist/plugins/widget-specifications.js +2 -2
- package/dist/plugins/widget-specifications.js.map +1 -1
- package/dist/plugins/workspace-admin.d.ts.map +1 -1
- package/dist/plugins/workspace-admin.js +6 -3
- package/dist/plugins/workspace-admin.js.map +1 -1
- package/dist/str-replace-utils.js +1 -1
- package/dist/str-replace-utils.js.map +1 -1
- package/dist/tools/apps-catalog.d.ts +1 -1
- package/dist/tools/apps-catalog.d.ts.map +1 -1
- package/dist/tools/apps-catalog.js +16 -12
- package/dist/tools/apps-catalog.js.map +1 -1
- package/dist/tools/board-widget.d.ts +2 -2
- package/dist/tools/board-widget.d.ts.map +1 -1
- package/dist/tools/board-widget.js +354 -201
- package/dist/tools/board-widget.js.map +1 -1
- package/dist/tools/change-listeners.d.ts +2 -2
- package/dist/tools/change-listeners.d.ts.map +1 -1
- package/dist/tools/change-listeners.js +125 -57
- package/dist/tools/change-listeners.js.map +1 -1
- package/dist/tools/common-schemas.d.ts +1 -1
- package/dist/tools/common-schemas.d.ts.map +1 -1
- package/dist/tools/common-schemas.js +5 -3
- package/dist/tools/common-schemas.js.map +1 -1
- package/dist/tools/csv-export.d.ts +2 -2
- package/dist/tools/csv-export.d.ts.map +1 -1
- package/dist/tools/csv-export.js +29 -24
- package/dist/tools/csv-export.js.map +1 -1
- package/dist/tools/documents.d.ts +2 -2
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +34 -14
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/expert-settings.d.ts +3 -3
- package/dist/tools/expert-settings.d.ts.map +1 -1
- package/dist/tools/expert-settings.js +97 -38
- package/dist/tools/expert-settings.js.map +1 -1
- package/dist/tools/get-operations.d.ts +2 -2
- package/dist/tools/get-operations.d.ts.map +1 -1
- package/dist/tools/get-operations.js +29 -21
- package/dist/tools/get-operations.js.map +1 -1
- package/dist/tools/job-schedule-trigger.d.ts +2 -2
- package/dist/tools/job-schedule-trigger.d.ts.map +1 -1
- package/dist/tools/job-schedule-trigger.js +19 -10
- package/dist/tools/job-schedule-trigger.js.map +1 -1
- package/dist/tools/job-scripts.d.ts +2 -2
- package/dist/tools/job-scripts.d.ts.map +1 -1
- package/dist/tools/job-scripts.js +119 -55
- package/dist/tools/job-scripts.js.map +1 -1
- package/dist/tools/jobs.d.ts +2 -2
- package/dist/tools/jobs.d.ts.map +1 -1
- package/dist/tools/jobs.js +68 -38
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/layout-richstring-shared.d.ts +24 -1
- package/dist/tools/layout-richstring-shared.d.ts.map +1 -1
- package/dist/tools/layout-richstring-shared.js +99 -1
- package/dist/tools/layout-richstring-shared.js.map +1 -1
- package/dist/tools/layout-richstring-widgets.d.ts +94 -2
- package/dist/tools/layout-richstring-widgets.d.ts.map +1 -1
- package/dist/tools/layout-richstring-widgets.js +247 -25
- package/dist/tools/layout-richstring-widgets.js.map +1 -1
- package/dist/tools/layout.d.ts +5 -4
- package/dist/tools/layout.d.ts.map +1 -1
- package/dist/tools/layout.js +235 -124
- package/dist/tools/layout.js.map +1 -1
- package/dist/tools/linting.d.ts +2 -2
- package/dist/tools/linting.d.ts.map +1 -1
- package/dist/tools/linting.js +5 -5
- package/dist/tools/linting.js.map +1 -1
- package/dist/tools/page-action-simulation.d.ts +18 -0
- package/dist/tools/page-action-simulation.d.ts.map +1 -0
- package/dist/tools/page-action-simulation.js +88 -0
- package/dist/tools/page-action-simulation.js.map +1 -0
- package/dist/tools/page-actions.d.ts +60 -0
- package/dist/tools/page-actions.d.ts.map +1 -0
- package/dist/tools/page-actions.js +284 -0
- package/dist/tools/page-actions.js.map +1 -0
- package/dist/tools/pages.d.ts +3 -3
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +237 -112
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/ppt-export-schemas.d.ts +1 -1
- package/dist/tools/ppt-export-schemas.d.ts.map +1 -1
- package/dist/tools/ppt-export-schemas.js +269 -122
- package/dist/tools/ppt-export-schemas.js.map +1 -1
- package/dist/tools/ppt-export.d.ts +2 -2
- package/dist/tools/ppt-export.d.ts.map +1 -1
- package/dist/tools/ppt-export.js +82 -43
- package/dist/tools/ppt-export.js.map +1 -1
- package/dist/tools/profile-management.d.ts +2 -2
- package/dist/tools/profile-management.d.ts.map +1 -1
- package/dist/tools/profile-management.js +109 -82
- package/dist/tools/profile-management.js.map +1 -1
- package/dist/tools/references.d.ts +2 -2
- package/dist/tools/references.d.ts.map +1 -1
- package/dist/tools/references.js +36 -24
- package/dist/tools/references.js.map +1 -1
- package/dist/tools/resource-planner-widget.d.ts +2 -2
- package/dist/tools/resource-planner-widget.d.ts.map +1 -1
- package/dist/tools/resource-planner-widget.js +334 -138
- package/dist/tools/resource-planner-widget.js.map +1 -1
- package/dist/tools/richstring-marker-resolver.d.ts +16 -0
- package/dist/tools/richstring-marker-resolver.d.ts.map +1 -0
- package/dist/tools/richstring-marker-resolver.js +47 -0
- package/dist/tools/richstring-marker-resolver.js.map +1 -0
- package/dist/tools/richstring-widgets.d.ts +6 -16
- package/dist/tools/richstring-widgets.d.ts.map +1 -1
- package/dist/tools/richstring-widgets.js +184 -129
- package/dist/tools/richstring-widgets.js.map +1 -1
- package/dist/tools/schedule.d.ts +2 -2
- package/dist/tools/schedule.d.ts.map +1 -1
- package/dist/tools/schedule.js +23 -14
- package/dist/tools/schedule.js.map +1 -1
- package/dist/tools/script-logs.d.ts +2 -2
- package/dist/tools/script-logs.d.ts.map +1 -1
- package/dist/tools/script-logs.js +71 -32
- package/dist/tools/script-logs.js.map +1 -1
- package/dist/tools/script.d.ts +2 -2
- package/dist/tools/script.d.ts.map +1 -1
- package/dist/tools/script.js +44 -26
- package/dist/tools/script.js.map +1 -1
- package/dist/tools/search.d.ts +2 -2
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +139 -102
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/solution-packages.d.ts +2 -2
- package/dist/tools/solution-packages.d.ts.map +1 -1
- package/dist/tools/solution-packages.js +149 -61
- package/dist/tools/solution-packages.js.map +1 -1
- package/dist/tools/system.d.ts +2 -2
- package/dist/tools/system.d.ts.map +1 -1
- package/dist/tools/system.js +43 -21
- package/dist/tools/system.js.map +1 -1
- package/dist/tools/type-layouts.d.ts +2 -2
- package/dist/tools/type-layouts.d.ts.map +1 -1
- package/dist/tools/type-layouts.js +67 -31
- package/dist/tools/type-layouts.js.map +1 -1
- package/dist/tools/type-management.d.ts +86 -70
- package/dist/tools/type-management.d.ts.map +1 -1
- package/dist/tools/type-management.js +407 -138
- package/dist/tools/type-management.js.map +1 -1
- package/dist/tools/url-resolution.d.ts +2 -2
- package/dist/tools/url-resolution.d.ts.map +1 -1
- package/dist/tools/url-resolution.js +16 -12
- package/dist/tools/url-resolution.js.map +1 -1
- package/dist/tools/users.d.ts +2 -2
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +24 -14
- package/dist/tools/users.js.map +1 -1
- package/dist/tools/validators.d.ts +2 -2
- package/dist/tools/validators.d.ts.map +1 -1
- package/dist/tools/validators.js +68 -35
- package/dist/tools/validators.js.map +1 -1
- package/dist/tools/version-check.d.ts +2 -2
- package/dist/tools/version-check.d.ts.map +1 -1
- package/dist/tools/version-check.js +36 -30
- package/dist/tools/version-check.js.map +1 -1
- package/dist/tools/version-history.d.ts +2 -2
- package/dist/tools/version-history.d.ts.map +1 -1
- package/dist/tools/version-history.js +72 -41
- package/dist/tools/version-history.js.map +1 -1
- package/dist/tools/widget-simulation.d.ts +5 -6
- package/dist/tools/widget-simulation.d.ts.map +1 -1
- package/dist/tools/widget-simulation.js +60 -42
- package/dist/tools/widget-simulation.js.map +1 -1
- package/dist/tools/widget-tool-helpers.d.ts +17 -1
- package/dist/tools/widget-tool-helpers.d.ts.map +1 -1
- package/dist/tools/widget-tool-helpers.js +41 -6
- package/dist/tools/widget-tool-helpers.js.map +1 -1
- package/dist/tools/widgets.d.ts +2 -2
- package/dist/tools/widgets.d.ts.map +1 -1
- package/dist/tools/widgets.js +62 -43
- package/dist/tools/widgets.js.map +1 -1
- package/dist/tools/wizards.d.ts +2 -2
- package/dist/tools/wizards.d.ts.map +1 -1
- package/dist/tools/wizards.js +378 -182
- package/dist/tools/wizards.js.map +1 -1
- package/dist/tools/workflow-execution.d.ts +2 -2
- package/dist/tools/workflow-execution.d.ts.map +1 -1
- package/dist/tools/workflow-execution.js +27 -19
- package/dist/tools/workflow-execution.js.map +1 -1
- package/dist/tools/workflow-scripts.d.ts +2 -2
- package/dist/tools/workflow-scripts.d.ts.map +1 -1
- package/dist/tools/workflow-scripts.js +168 -81
- package/dist/tools/workflow-scripts.js.map +1 -1
- package/dist/tools/workflow.d.ts +2 -2
- package/dist/tools/workflow.d.ts.map +1 -1
- package/dist/tools/workflow.js +185 -74
- package/dist/tools/workflow.js.map +1 -1
- package/dist/tools/workspace-admin.d.ts +2 -2
- package/dist/tools/workspace-admin.d.ts.map +1 -1
- package/dist/tools/workspace-admin.js +82 -40
- package/dist/tools/workspace-admin.js.map +1 -1
- package/dist/tools/workspace-core.d.ts +2 -2
- package/dist/tools/workspace-core.d.ts.map +1 -1
- package/dist/tools/workspace-core.js +93 -53
- package/dist/tools/workspace-core.js.map +1 -1
- package/dist/utils/dateValidation.js.map +1 -1
- package/package.json +9 -4
package/dist/tools/ppt-export.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
import { applyPathUpdates } from '../utils.js';
|
|
3
3
|
import { debugLogWithTag } from '../logger.js';
|
|
4
|
-
import { AdvancedVisualizationSchema, BasicVisualizationSchema, LayoutSchema, LegendSchema, PageConfigSchema, ScalesSchema, TaskClassesSchema, TimelineSchema } from
|
|
4
|
+
import { AdvancedVisualizationSchema, BasicVisualizationSchema, LayoutSchema, LegendSchema, PageConfigSchema, ScalesSchema, TaskClassesSchema, TimelineSchema, } from './ppt-export-schemas.js';
|
|
5
5
|
const TOOL_CREATE_PPT_EXPORT_PROFILE = 'cplace_create_ppt_export_profile';
|
|
6
6
|
const TOOL_PARTIAL_UPDATE_PPT_EXPORT_PROFILE = 'cplace_partial_update_ppt_export_profile';
|
|
7
7
|
export const PPT_EXPORT_TOOL_DEFINITIONS = {
|
|
8
8
|
[TOOL_CREATE_PPT_EXPORT_PROFILE]: {
|
|
9
9
|
description: "Create PowerPoint Export Profiles with comprehensive configuration options for page layout, timeline settings, task classes, and visual formatting. Prerequisites: The 'Presentation Graphics' app (cf.cplace.pptexport) must be installed in the target workspace.",
|
|
10
10
|
inputSchema: {
|
|
11
|
-
workspaceId: z
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
workspaceId: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe('Required: The workspace ID where the profile should be created'),
|
|
14
|
+
name: z.string().describe('Required: Display name for the profile page in cplace'),
|
|
15
|
+
profileName: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe('Required: Internal name used for the PowerPoint export configuration'),
|
|
18
|
+
builtIn: z
|
|
19
|
+
.boolean()
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('Whether this is a built-in profile (default: false)'),
|
|
15
22
|
pageConfig: PageConfigSchema,
|
|
16
23
|
basicVisualization: BasicVisualizationSchema,
|
|
17
24
|
timeline: TimelineSchema,
|
|
@@ -19,38 +26,48 @@ export const PPT_EXPORT_TOOL_DEFINITIONS = {
|
|
|
19
26
|
taskClasses: TaskClassesSchema,
|
|
20
27
|
layout: LayoutSchema,
|
|
21
28
|
advancedVisualization: AdvancedVisualizationSchema,
|
|
22
|
-
legend: LegendSchema
|
|
29
|
+
legend: LegendSchema,
|
|
23
30
|
},
|
|
24
|
-
annotations: { title:
|
|
31
|
+
annotations: { title: 'Create PPT Export Profile' },
|
|
25
32
|
},
|
|
26
33
|
[TOOL_PARTIAL_UPDATE_PPT_EXPORT_PROFILE]: {
|
|
27
|
-
description:
|
|
34
|
+
description: 'Update PowerPoint Export Profiles using path-based updates. Modify specific configuration values while preserving all other settings. This is the only way to update existing profiles. Supports dot notation paths and array indices.',
|
|
28
35
|
inputSchema: {
|
|
29
|
-
pageUID: z.string().describe(
|
|
30
|
-
name: z.string().optional().describe(
|
|
31
|
-
profileName: z
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
pageUID: z.string().describe('Required: The unique identifier of the profile page to update'),
|
|
37
|
+
name: z.string().optional().describe('Optional: New display name for the profile page'),
|
|
38
|
+
profileName: z
|
|
39
|
+
.string()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe('Optional: New internal name for the PowerPoint export configuration'),
|
|
42
|
+
builtIn: z.boolean().optional().describe('Optional: Whether this is a built-in profile'),
|
|
43
|
+
updates: z
|
|
44
|
+
.array(z.object({
|
|
45
|
+
path: z
|
|
46
|
+
.string()
|
|
47
|
+
.describe("Dot notation path to the configuration value (e.g., 'pageConfig.margins.left', 'taskClasses.definitions[0].fillColor')"),
|
|
48
|
+
value: z.any().describe('New value to set at the specified path'),
|
|
49
|
+
}))
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Array of path-value pairs for configuration updates. Supports dot notation with array indices.'),
|
|
37
52
|
},
|
|
38
|
-
annotations: { title:
|
|
39
|
-
}
|
|
53
|
+
annotations: { title: 'Partial Update PPT Export Profile (Path-Based)' },
|
|
54
|
+
},
|
|
40
55
|
};
|
|
41
56
|
export function registerPPTExportProfileTools(server, client) {
|
|
42
57
|
server.registerTool(TOOL_CREATE_PPT_EXPORT_PROFILE, PPT_EXPORT_TOOL_DEFINITIONS[TOOL_CREATE_PPT_EXPORT_PROFILE], async (params) => {
|
|
43
58
|
try {
|
|
44
59
|
if (!params.workspaceId || !params.name || !params.profileName) {
|
|
45
60
|
return {
|
|
46
|
-
content: [
|
|
47
|
-
|
|
61
|
+
content: [
|
|
62
|
+
{ type: 'text', text: 'Error: workspaceId, name, and profileName are required' },
|
|
63
|
+
],
|
|
64
|
+
isError: true,
|
|
48
65
|
};
|
|
49
66
|
}
|
|
50
67
|
const requestBody = {
|
|
51
68
|
workspaceId: params.workspaceId,
|
|
52
69
|
name: params.name,
|
|
53
|
-
profileName: params.profileName
|
|
70
|
+
profileName: params.profileName,
|
|
54
71
|
};
|
|
55
72
|
if (params.builtIn !== undefined)
|
|
56
73
|
requestBody.builtIn = params.builtIn;
|
|
@@ -73,20 +90,25 @@ export function registerPPTExportProfileTools(server, client) {
|
|
|
73
90
|
const result = await client.makeApiRequest('json/pptexport-profile/create', 'POST', undefined, requestBody);
|
|
74
91
|
const successMessage = {
|
|
75
92
|
success: true,
|
|
76
|
-
operation:
|
|
77
|
-
pageUID: result.pageUID || result.uid ||
|
|
93
|
+
operation: 'created',
|
|
94
|
+
pageUID: result.pageUID || result.uid || 'unknown',
|
|
78
95
|
profileName: params.profileName,
|
|
79
96
|
name: params.name,
|
|
80
|
-
workspaceId: params.workspaceId
|
|
97
|
+
workspaceId: params.workspaceId,
|
|
81
98
|
};
|
|
82
99
|
return {
|
|
83
|
-
content: [{ type:
|
|
100
|
+
content: [{ type: 'text', text: JSON.stringify(successMessage, null, 2) }],
|
|
84
101
|
};
|
|
85
102
|
}
|
|
86
103
|
catch (error) {
|
|
87
104
|
return {
|
|
88
|
-
content: [
|
|
89
|
-
|
|
105
|
+
content: [
|
|
106
|
+
{
|
|
107
|
+
type: 'text',
|
|
108
|
+
text: `Error creating PPT Export Profile: ${error instanceof Error ? error.message : String(error)}`,
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
isError: true,
|
|
90
112
|
};
|
|
91
113
|
}
|
|
92
114
|
});
|
|
@@ -97,8 +119,10 @@ export function registerPPTExportProfileTools(server, client) {
|
|
|
97
119
|
if (!params.pageUID) {
|
|
98
120
|
debugLogWithTag('PPT_UPDATE', 'ERROR: pageUID parameter is missing');
|
|
99
121
|
return {
|
|
100
|
-
content: [
|
|
101
|
-
|
|
122
|
+
content: [
|
|
123
|
+
{ type: 'text', text: 'Error: pageUID parameter is required for partial updates' },
|
|
124
|
+
],
|
|
125
|
+
isError: true,
|
|
102
126
|
};
|
|
103
127
|
}
|
|
104
128
|
const hasConfigUpdates = params.updates && params.updates.length > 0;
|
|
@@ -109,21 +133,31 @@ export function registerPPTExportProfileTools(server, client) {
|
|
|
109
133
|
if (!hasConfigUpdates && !hasProfileUpdates) {
|
|
110
134
|
debugLogWithTag('PPT_UPDATE', 'ERROR: No meaningful updates provided');
|
|
111
135
|
return {
|
|
112
|
-
content: [
|
|
113
|
-
|
|
136
|
+
content: [
|
|
137
|
+
{
|
|
138
|
+
type: 'text',
|
|
139
|
+
text: 'No updates specified. At least one path update or profile property must be provided.',
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
isError: true,
|
|
114
143
|
};
|
|
115
144
|
}
|
|
116
145
|
debugLogWithTag('PPT_UPDATE', `Fetching current profile data for pageUID: ${params.pageUID}`);
|
|
117
|
-
const currentProfile = await client.makeApiRequest('json/page', 'GET', {
|
|
146
|
+
const currentProfile = await client.makeApiRequest('json/page', 'GET', {
|
|
147
|
+
pageUID: params.pageUID,
|
|
148
|
+
});
|
|
118
149
|
debugLogWithTag('PPT_UPDATE', `Current profile response status: ${currentProfile ? 'SUCCESS' : 'FAILED'}`);
|
|
119
150
|
debugLogWithTag('PPT_UPDATE', `Profile attributes present: ${currentProfile.attributes ? 'YES' : 'NO'}`);
|
|
120
151
|
debugLogWithTag('PPT_UPDATE', `Config JSON present: ${currentProfile.attributes?.['cf.cplace.pptexport.configJson'] ? 'YES' : 'NO'}`);
|
|
121
|
-
if (!currentProfile.attributes ||
|
|
152
|
+
if (!currentProfile.attributes ||
|
|
153
|
+
!currentProfile.attributes['cf.cplace.pptexport.configJson']) {
|
|
122
154
|
debugLogWithTag('PPT_UPDATE', `ERROR: Profile ${params.pageUID} has no configuration data`);
|
|
123
155
|
debugLogWithTag('PPT_UPDATE', `Available attributes: ${Object.keys(currentProfile.attributes || {}).join(', ')}`);
|
|
124
156
|
return {
|
|
125
|
-
content: [
|
|
126
|
-
|
|
157
|
+
content: [
|
|
158
|
+
{ type: 'text', text: `Error: Profile ${params.pageUID} has no configuration data` },
|
|
159
|
+
],
|
|
160
|
+
isError: true,
|
|
127
161
|
};
|
|
128
162
|
}
|
|
129
163
|
const currentConfigJson = currentProfile.attributes['cf.cplace.pptexport.configJson'];
|
|
@@ -149,7 +183,7 @@ export function registerPPTExportProfileTools(server, client) {
|
|
|
149
183
|
debugLogWithTag('PPT_UPDATE', 'Preparing update request body');
|
|
150
184
|
const updateRequestBody = {
|
|
151
185
|
pageUID: params.pageUID,
|
|
152
|
-
configJson: JSON.stringify(currentConfig)
|
|
186
|
+
configJson: JSON.stringify(currentConfig),
|
|
153
187
|
};
|
|
154
188
|
if (params.builtIn !== undefined) {
|
|
155
189
|
updateRequestBody.builtIn = params.builtIn;
|
|
@@ -176,21 +210,26 @@ export function registerPPTExportProfileTools(server, client) {
|
|
|
176
210
|
debugLogWithTag('PPT_UPDATE', 'Partial update completed successfully');
|
|
177
211
|
const successMessage = {
|
|
178
212
|
success: true,
|
|
179
|
-
operation:
|
|
213
|
+
operation: 'updated',
|
|
180
214
|
pageUID: params.pageUID,
|
|
181
|
-
profileName: result.profileName || result.attributes?.profileName ||
|
|
182
|
-
updatedFields: Object.keys(updateRequestBody).filter(key => key !== 'pageUID' && key !== 'configJson')
|
|
215
|
+
profileName: result.profileName || result.attributes?.profileName || 'unknown',
|
|
216
|
+
updatedFields: Object.keys(updateRequestBody).filter((key) => key !== 'pageUID' && key !== 'configJson'),
|
|
183
217
|
};
|
|
184
218
|
return {
|
|
185
|
-
content: [{ type:
|
|
219
|
+
content: [{ type: 'text', text: JSON.stringify(successMessage, null, 2) }],
|
|
186
220
|
};
|
|
187
221
|
}
|
|
188
222
|
catch (error) {
|
|
189
223
|
debugLogWithTag('PPT_UPDATE', `ERROR in partial update: ${error instanceof Error ? error.message : String(error)}`);
|
|
190
224
|
debugLogWithTag('PPT_UPDATE', `Error stack: ${error instanceof Error ? error.stack : 'No stack available'}`);
|
|
191
225
|
return {
|
|
192
|
-
content: [
|
|
193
|
-
|
|
226
|
+
content: [
|
|
227
|
+
{
|
|
228
|
+
type: 'text',
|
|
229
|
+
text: `Error in partial update: ${error instanceof Error ? error.message : String(error)}`,
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
isError: true,
|
|
194
233
|
};
|
|
195
234
|
}
|
|
196
235
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ppt-export.js","sourceRoot":"","sources":["../../src/tools/ppt-export.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"ppt-export.js","sourceRoot":"","sources":["../../src/tools/ppt-export.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,cAAc,GACf,MAAM,yBAAyB,CAAC;AAGjC,MAAM,8BAA8B,GAAG,kCAAkC,CAAC;AAC1E,MAAM,sCAAsC,GAAG,0CAA0C,CAAC;AAG1F,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,CAAC,8BAA8B,CAAC,EAAE;QAChC,WAAW,EACT,qQAAqQ;QACvQ,WAAW,EAAE;YAEX,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,QAAQ,CAAC,gEAAgE,CAAC;YAC7E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;YAClF,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,QAAQ,CAAC,sEAAsE,CAAC;YAEnF,OAAO,EAAE,CAAC;iBACP,OAAO,EAAE;iBACT,QAAQ,EAAE;iBACV,QAAQ,CAAC,qDAAqD,CAAC;YAClE,UAAU,EAAE,gBAAgB;YAC5B,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,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,4BAA4B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBAC3F;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { McpServer } from
|
|
2
|
-
import { PluginRegistry } from
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { PluginRegistry } from '../plugin-registry.js';
|
|
3
3
|
export declare function registerProfileManagementTools(server: McpServer, getCredentials: () => {
|
|
4
4
|
apiToken: string;
|
|
5
5
|
cplaceUrl: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile-management.d.ts","sourceRoot":"","sources":["../../src/tools/profile-management.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"profile-management.d.ts","sourceRoot":"","sources":["../../src/tools/profile-management.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA6QvD,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,EACjB,cAAc,EAAE,MAAM;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,EAC7D,QAAQ,EAAE,cAAc,QA2GzB"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { debugLogWithTag } from
|
|
3
|
-
import { parseProfiles } from
|
|
4
|
-
import { setPreference, getPreference, clearPreference, readPreferences } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { debugLogWithTag } from '../logger.js';
|
|
3
|
+
import { parseProfiles } from '../profiles.js';
|
|
4
|
+
import { setPreference, getPreference, clearPreference, readPreferences, } from '../preference-file.js';
|
|
5
5
|
const TOOL_MANAGE_PROFILES = 'cplace_manage_profiles';
|
|
6
6
|
async function handleSetOperation(params, apiToken, cplaceUrl, registry) {
|
|
7
7
|
const availableNames = Array.from(registry.getAvailableProfileNames());
|
|
8
8
|
if (!params.profiles || params.profiles.length === 0) {
|
|
9
9
|
return {
|
|
10
|
-
content: [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
content: [
|
|
11
|
+
{
|
|
12
|
+
type: 'text',
|
|
13
|
+
text: `Error: profiles parameter is required when operation='set'. Specify which profiles to activate as an array. Examples: ['layouts'], ['layouts', 'types-write'], ['all']. Available profiles: ${availableNames.join(', ')}`,
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
isError: true,
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
19
|
debugLogWithTag('PROFILES', `Setting profiles for ${cplaceUrl}: ${params.profiles.join(', ')}`);
|
|
@@ -19,10 +21,12 @@ async function handleSetOperation(params, apiToken, cplaceUrl, registry) {
|
|
|
19
21
|
if (requestedGroups.length === 1 && requestedGroups[0] === 'all') {
|
|
20
22
|
setPreference(apiToken, cplaceUrl, ['all']);
|
|
21
23
|
return {
|
|
22
|
-
content: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
content: [
|
|
25
|
+
{
|
|
26
|
+
type: 'text',
|
|
27
|
+
text: formatSuccessResponse(availableNames, cplaceUrl, [], availableNames),
|
|
28
|
+
},
|
|
29
|
+
],
|
|
26
30
|
};
|
|
27
31
|
}
|
|
28
32
|
const validGroups = [];
|
|
@@ -40,19 +44,23 @@ async function handleSetOperation(params, apiToken, cplaceUrl, registry) {
|
|
|
40
44
|
}
|
|
41
45
|
if (validGroups.length === 0) {
|
|
42
46
|
return {
|
|
43
|
-
content: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
content: [
|
|
48
|
+
{
|
|
49
|
+
type: 'text',
|
|
50
|
+
text: `❌ No valid profiles specified. Available profiles:\n${availableNames.join(', ')}`,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
isError: true,
|
|
48
54
|
};
|
|
49
55
|
}
|
|
50
56
|
setPreference(apiToken, cplaceUrl, validGroups);
|
|
51
57
|
return {
|
|
52
|
-
content: [
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
content: [
|
|
59
|
+
{
|
|
60
|
+
type: 'text',
|
|
61
|
+
text: formatSuccessResponse(validGroups, cplaceUrl, unknownGroups, availableNames),
|
|
62
|
+
},
|
|
63
|
+
],
|
|
56
64
|
};
|
|
57
65
|
}
|
|
58
66
|
async function handleGetOperation(apiToken, cplaceUrl, registry) {
|
|
@@ -63,40 +71,44 @@ async function handleGetOperation(apiToken, cplaceUrl, registry) {
|
|
|
63
71
|
let source;
|
|
64
72
|
let message;
|
|
65
73
|
if (storedPreference) {
|
|
66
|
-
source =
|
|
67
|
-
message =
|
|
74
|
+
source = 'path_preference';
|
|
75
|
+
message = 'Using saved preference for current directory';
|
|
68
76
|
}
|
|
69
77
|
else {
|
|
70
|
-
const cliArg = process.argv.find(arg => arg.startsWith('--profiles='));
|
|
78
|
+
const cliArg = process.argv.find((arg) => arg.startsWith('--profiles='));
|
|
71
79
|
if (cliArg) {
|
|
72
|
-
source =
|
|
73
|
-
message =
|
|
80
|
+
source = 'cli_argument';
|
|
81
|
+
message = 'Using CLI argument (no saved preference for current directory)';
|
|
74
82
|
}
|
|
75
83
|
else {
|
|
76
|
-
source =
|
|
77
|
-
message =
|
|
84
|
+
source = 'code_default';
|
|
85
|
+
message = 'Using code default (no saved preference or CLI argument)';
|
|
78
86
|
}
|
|
79
87
|
}
|
|
80
88
|
const display = {
|
|
81
89
|
active_profiles: Array.from(activeGroups).sort(),
|
|
82
90
|
source: source,
|
|
83
|
-
message: message
|
|
91
|
+
message: message,
|
|
84
92
|
};
|
|
85
93
|
return {
|
|
86
|
-
content: [
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
94
|
+
content: [
|
|
95
|
+
{
|
|
96
|
+
type: 'text',
|
|
97
|
+
text: JSON.stringify(display, null, 2),
|
|
98
|
+
},
|
|
99
|
+
],
|
|
90
100
|
};
|
|
91
101
|
}
|
|
92
102
|
async function handleClearOperation(apiToken, cplaceUrl) {
|
|
93
103
|
debugLogWithTag('PROFILES', `Clearing profiles for current directory`);
|
|
94
104
|
clearPreference(apiToken, cplaceUrl);
|
|
95
105
|
return {
|
|
96
|
-
content: [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
content: [
|
|
107
|
+
{
|
|
108
|
+
type: 'text',
|
|
109
|
+
text: `✅ Profile preferences cleared for current directory\n\nReconnect MCP server to apply default profiles.`,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
100
112
|
};
|
|
101
113
|
}
|
|
102
114
|
async function handleDetailsOperation(params, apiToken, cplaceUrl, registry) {
|
|
@@ -105,16 +117,16 @@ async function handleDetailsOperation(params, apiToken, cplaceUrl, registry) {
|
|
|
105
117
|
const activeGroups = parseProfiles(process.argv, apiToken || undefined, cplaceUrl || undefined, registry.getAvailableProfileNames());
|
|
106
118
|
if (params.profileName && !registry.hasProfile(params.profileName)) {
|
|
107
119
|
return {
|
|
108
|
-
content: [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
120
|
+
content: [
|
|
121
|
+
{
|
|
122
|
+
type: 'text',
|
|
123
|
+
text: `Profile '${params.profileName}' not found. Available profiles: ${availableNames.join(', ')}`,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
isError: true,
|
|
113
127
|
};
|
|
114
128
|
}
|
|
115
|
-
const profilesToShow = params.profileName
|
|
116
|
-
? [params.profileName]
|
|
117
|
-
: availableNames;
|
|
129
|
+
const profilesToShow = params.profileName ? [params.profileName] : availableNames;
|
|
118
130
|
const profiles = profilesToShow.map((profileName) => {
|
|
119
131
|
const profileToolDefs = registry.getToolDefinitions(profileName);
|
|
120
132
|
const tools = [];
|
|
@@ -122,7 +134,7 @@ async function handleDetailsOperation(params, apiToken, cplaceUrl, registry) {
|
|
|
122
134
|
Object.entries(moduleToolDefs).forEach(([toolName, toolDef]) => {
|
|
123
135
|
tools.push({
|
|
124
136
|
name: toolName,
|
|
125
|
-
description: toolDef.description ||
|
|
137
|
+
description: toolDef.description || '',
|
|
126
138
|
});
|
|
127
139
|
});
|
|
128
140
|
}
|
|
@@ -132,29 +144,33 @@ async function handleDetailsOperation(params, apiToken, cplaceUrl, registry) {
|
|
|
132
144
|
description: profileInfo?.description || '',
|
|
133
145
|
active: activeGroups.has(profileName),
|
|
134
146
|
tool_count: tools.length,
|
|
135
|
-
tools: tools.sort((a, b) => a.name.localeCompare(b.name))
|
|
147
|
+
tools: tools.sort((a, b) => a.name.localeCompare(b.name)),
|
|
136
148
|
};
|
|
137
149
|
});
|
|
138
150
|
if (params.profileName) {
|
|
139
151
|
const response = {
|
|
140
|
-
profile: profiles[0]
|
|
152
|
+
profile: profiles[0],
|
|
141
153
|
};
|
|
142
154
|
return {
|
|
143
|
-
content: [
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
155
|
+
content: [
|
|
156
|
+
{
|
|
157
|
+
type: 'text',
|
|
158
|
+
text: JSON.stringify(response, null, 2),
|
|
159
|
+
},
|
|
160
|
+
],
|
|
147
161
|
};
|
|
148
162
|
}
|
|
149
163
|
const response = {
|
|
150
164
|
profiles,
|
|
151
|
-
currently_active: Array.from(activeGroups).sort()
|
|
165
|
+
currently_active: Array.from(activeGroups).sort(),
|
|
152
166
|
};
|
|
153
167
|
return {
|
|
154
|
-
content: [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
168
|
+
content: [
|
|
169
|
+
{
|
|
170
|
+
type: 'text',
|
|
171
|
+
text: JSON.stringify(response, null, 2),
|
|
172
|
+
},
|
|
173
|
+
],
|
|
158
174
|
};
|
|
159
175
|
}
|
|
160
176
|
export function registerProfileManagementTools(server, getCredentials, registry) {
|
|
@@ -181,14 +197,19 @@ Available profiles: ${availableNames.join(', ')}
|
|
|
181
197
|
|
|
182
198
|
Changes take effect after reconnecting the MCP server.`,
|
|
183
199
|
inputSchema: {
|
|
184
|
-
operation: z
|
|
200
|
+
operation: z
|
|
201
|
+
.enum(['set', 'get', 'clear', 'details'])
|
|
185
202
|
.describe("Profile operation to perform: 'set' to activate profiles, 'get' to view current configuration, 'clear' to remove stored preferences, 'details' to get profile information"),
|
|
186
|
-
profiles: z
|
|
203
|
+
profiles: z
|
|
204
|
+
.array(z.string())
|
|
205
|
+
.optional()
|
|
187
206
|
.describe(`Required for operation='set': Array of profile names to activate. Examples: ['layouts'], ['layouts', 'types-write'], ['all']. Available profiles: ${availableNames.join(', ')}`),
|
|
188
|
-
profileName: z
|
|
189
|
-
.
|
|
207
|
+
profileName: z
|
|
208
|
+
.string()
|
|
209
|
+
.optional()
|
|
210
|
+
.describe("Optional for operation='details': Specific profile name to get details for (e.g., 'layouts', 'types-write'). If omitted, returns details for all available profiles."),
|
|
190
211
|
},
|
|
191
|
-
annotations: { title:
|
|
212
|
+
annotations: { title: 'Manage Profiles' },
|
|
192
213
|
};
|
|
193
214
|
server.registerTool(TOOL_MANAGE_PROFILES, toolDefinition, async (params) => {
|
|
194
215
|
const { operation } = params;
|
|
@@ -196,39 +217,45 @@ Changes take effect after reconnecting the MCP server.`,
|
|
|
196
217
|
const { apiToken, cplaceUrl } = getCredentials();
|
|
197
218
|
if (!apiToken || !cplaceUrl) {
|
|
198
219
|
return {
|
|
199
|
-
content: [
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
220
|
+
content: [
|
|
221
|
+
{
|
|
222
|
+
type: 'text',
|
|
223
|
+
text: '❌ Cannot manage profiles: No active connection credentials found',
|
|
224
|
+
},
|
|
225
|
+
],
|
|
226
|
+
isError: true,
|
|
204
227
|
};
|
|
205
228
|
}
|
|
206
229
|
switch (operation) {
|
|
207
|
-
case
|
|
230
|
+
case 'set':
|
|
208
231
|
return await handleSetOperation(params, apiToken, cplaceUrl, registry);
|
|
209
|
-
case
|
|
232
|
+
case 'get':
|
|
210
233
|
return await handleGetOperation(apiToken, cplaceUrl, registry);
|
|
211
|
-
case
|
|
234
|
+
case 'clear':
|
|
212
235
|
return await handleClearOperation(apiToken, cplaceUrl);
|
|
213
|
-
case
|
|
236
|
+
case 'details':
|
|
214
237
|
return await handleDetailsOperation(params, apiToken, cplaceUrl, registry);
|
|
215
238
|
default:
|
|
216
239
|
return {
|
|
217
|
-
content: [
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
240
|
+
content: [
|
|
241
|
+
{
|
|
242
|
+
type: 'text',
|
|
243
|
+
text: `Unknown operation: ${operation}`,
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
isError: true,
|
|
222
247
|
};
|
|
223
248
|
}
|
|
224
249
|
}
|
|
225
250
|
catch (error) {
|
|
226
251
|
return {
|
|
227
|
-
content: [
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
252
|
+
content: [
|
|
253
|
+
{
|
|
254
|
+
type: 'text',
|
|
255
|
+
text: `Failed to ${operation} profiles: ${error instanceof Error ? error.message : String(error)}`,
|
|
256
|
+
},
|
|
257
|
+
],
|
|
258
|
+
isError: true,
|
|
232
259
|
};
|
|
233
260
|
}
|
|
234
261
|
});
|