@cplace/mcp-server 1.9.0 → 1.10.5
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 -15
- 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 +410 -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 +18 -0
- package/dist/tools/widget-simulation.d.ts.map +1 -0
- package/dist/tools/widget-simulation.js +94 -0
- package/dist/tools/widget-simulation.js.map +1 -0
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { debugLogWithTag } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { debugLogWithTag } from '../logger.js';
|
|
3
3
|
import { LayoutContextSchema } from './layout.js';
|
|
4
|
-
import { findWidgetById, determineApiEndpoint, buildRequestParams, buildUpdateRequestBody } from './widget-tool-helpers.js';
|
|
4
|
+
import { findWidgetById, determineApiEndpoint, buildRequestParams, buildUpdateRequestBody, } from './widget-tool-helpers.js';
|
|
5
5
|
const TOOL_RP_GET_CONFIGURATION = 'cplace_resource_planner_get_configuration';
|
|
6
6
|
const TOOL_RP_CONFIGURE_DATA_SOURCE = 'cplace_resource_planner_configure_data_source';
|
|
7
7
|
const TOOL_RP_CONFIGURE_GROUPS = 'cplace_resource_planner_configure_groups';
|
|
@@ -10,16 +10,16 @@ const TOOL_RP_CONFIGURE_DISPLAY = 'cplace_resource_planner_configure_display';
|
|
|
10
10
|
const RP_WIDGET_TYPE = 'cf.cplace.resourceManagement.resourcePlannerDefinition';
|
|
11
11
|
const RP_PREFIX = 'cf.cplace.resourceManagement.resourcePlanner.';
|
|
12
12
|
const ENUM_VALUE_MAP = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
STATIC: `${RP_PREFIX}static`,
|
|
14
|
+
DYNAMIC: `${RP_PREFIX}dynamic`,
|
|
15
|
+
ATTRIBUTE: `${RP_PREFIX}attribute`,
|
|
16
|
+
DAY: `${RP_PREFIX}day`,
|
|
17
|
+
WEEK: `${RP_PREFIX}week`,
|
|
18
|
+
MONTH: `${RP_PREFIX}month`,
|
|
19
|
+
QUARTER: `${RP_PREFIX}quarter`,
|
|
20
|
+
YEAR: `${RP_PREFIX}year`,
|
|
21
|
+
RELATIVE: `${RP_PREFIX}relative`,
|
|
22
|
+
ABSOLUTE: `${RP_PREFIX}absolute`,
|
|
23
23
|
};
|
|
24
24
|
function mapEnumValue(value) {
|
|
25
25
|
if (value.startsWith(RP_PREFIX))
|
|
@@ -35,63 +35,149 @@ function shortEnumValue(value) {
|
|
|
35
35
|
}
|
|
36
36
|
const DataSourceInputSchema = {
|
|
37
37
|
context: LayoutContextSchema,
|
|
38
|
-
widgetId: z.string().describe(
|
|
39
|
-
searchNode: z
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
widgetId: z.string().describe('The widget ID of the resource planner widget'),
|
|
39
|
+
searchNode: z
|
|
40
|
+
.string()
|
|
41
|
+
.describe('WARNING: Do not manually construct! Use cplaceJson from cplace_search_pages response. Primary data source search for the resource planner nodes.'),
|
|
42
|
+
sortColumnNode: z
|
|
43
|
+
.string()
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Sort column for node results (attribute internal name)'),
|
|
46
|
+
sortOrderNode: z
|
|
47
|
+
.enum(['ascending', 'descending'])
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Sort order for node results'),
|
|
50
|
+
nodeSelection: z
|
|
51
|
+
.string()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Node selection grouping. Use the value from get_configuration or from the widget definition schema.'),
|
|
54
|
+
dateCalculation: z
|
|
55
|
+
.string()
|
|
56
|
+
.describe('Date calculation mode: STATIC (fixed dates), DYNAMIC (relative offset from today, most common), or ATTRIBUTE (read from entity attributes)'),
|
|
57
|
+
start: z
|
|
58
|
+
.string()
|
|
59
|
+
.optional()
|
|
60
|
+
.describe("Start date for STATIC mode (ISO date format, e.g., '2026-01-01'). Required when dateCalculation=STATIC."),
|
|
61
|
+
end: z
|
|
62
|
+
.string()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('End date for STATIC mode (ISO date format). Required when dateCalculation=STATIC.'),
|
|
65
|
+
startValueDynamic: z
|
|
66
|
+
.number()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe('Start offset value for DYNAMIC mode (negative = past). Required when dateCalculation=DYNAMIC.'),
|
|
69
|
+
startUnitDynamic: z
|
|
70
|
+
.string()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe('Start offset unit for DYNAMIC mode: DAY, WEEK, MONTH, QUARTER, or YEAR. Required when dateCalculation=DYNAMIC.'),
|
|
73
|
+
endValueDynamic: z
|
|
74
|
+
.number()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe('End offset value for DYNAMIC mode (positive = future). Required when dateCalculation=DYNAMIC.'),
|
|
77
|
+
endUnitDynamic: z
|
|
78
|
+
.string()
|
|
79
|
+
.optional()
|
|
80
|
+
.describe('End offset unit for DYNAMIC mode: DAY, WEEK, MONTH, QUARTER, or YEAR. Required when dateCalculation=DYNAMIC.'),
|
|
81
|
+
startDateAttribute: z
|
|
82
|
+
.string()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe('Attribute name for start date in ATTRIBUTE mode. Required when dateCalculation=ATTRIBUTE.'),
|
|
85
|
+
endDateAttribute: z
|
|
86
|
+
.string()
|
|
87
|
+
.optional()
|
|
88
|
+
.describe('Attribute name for end date in ATTRIBUTE mode. Required when dateCalculation=ATTRIBUTE.'),
|
|
52
89
|
};
|
|
53
90
|
const GroupConfigSchema = z.object({
|
|
54
|
-
enabled: z.boolean().describe(
|
|
55
|
-
search: z
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
91
|
+
enabled: z.boolean().describe('Whether this grouping layer is enabled'),
|
|
92
|
+
search: z
|
|
93
|
+
.string()
|
|
94
|
+
.optional()
|
|
95
|
+
.describe('WARNING: Do not manually construct! Use cplaceJson from cplace_search_pages. Required when enabled=true.'),
|
|
96
|
+
sortColumn: z.string().optional().describe('Sort column for group results'),
|
|
97
|
+
sortOrder: z
|
|
98
|
+
.enum(['ascending', 'descending'])
|
|
99
|
+
.optional()
|
|
100
|
+
.describe('Sort order for group results'),
|
|
101
|
+
selection: z
|
|
102
|
+
.string()
|
|
103
|
+
.optional()
|
|
104
|
+
.describe('Group selection value. Use the value from get_configuration or from the widget definition schema.'),
|
|
105
|
+
name: z
|
|
106
|
+
.record(z.string())
|
|
107
|
+
.optional()
|
|
108
|
+
.describe('Localized group name. Format: {"en": "English Name", "de": "German Name"}'),
|
|
60
109
|
});
|
|
61
110
|
const GroupsInputSchema = {
|
|
62
111
|
context: LayoutContextSchema,
|
|
63
|
-
widgetId: z.string().describe(
|
|
64
|
-
firstGroup: GroupConfigSchema.optional().describe(
|
|
65
|
-
secondGroup: GroupConfigSchema.optional().describe(
|
|
112
|
+
widgetId: z.string().describe('The widget ID of the resource planner widget'),
|
|
113
|
+
firstGroup: GroupConfigSchema.optional().describe('First grouping layer configuration. When enabled=true, search is required. When enabled=false, all group attributes are cleared.'),
|
|
114
|
+
secondGroup: GroupConfigSchema.optional().describe('Second grouping layer configuration. Same behavior as firstGroup.'),
|
|
66
115
|
};
|
|
67
116
|
const ColumnSchema = z.object({
|
|
68
|
-
feature: z
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
117
|
+
feature: z
|
|
118
|
+
.string()
|
|
119
|
+
.describe("Fully-qualified attribute name (e.g., 'cf.cplace.resourceManagement.startDate')"),
|
|
120
|
+
header: z.string().describe('Display name for the column header'),
|
|
121
|
+
builtin: z
|
|
122
|
+
.boolean()
|
|
123
|
+
.describe('Whether this is a built-in column (true) or a custom attribute column (false)'),
|
|
124
|
+
visible: z.boolean().describe('Whether the column is visible by default'),
|
|
72
125
|
});
|
|
73
126
|
const ColumnsInputSchema = {
|
|
74
127
|
context: LayoutContextSchema,
|
|
75
|
-
widgetId: z.string().describe(
|
|
76
|
-
attributesConfiguration: z
|
|
77
|
-
|
|
128
|
+
widgetId: z.string().describe('The widget ID of the resource planner widget'),
|
|
129
|
+
attributesConfiguration: z
|
|
130
|
+
.array(ColumnSchema)
|
|
131
|
+
.optional()
|
|
132
|
+
.describe('Column definitions for the attributes panel. Full replacement — omitting a column removes it. At least one of attributesConfiguration or defaultColumnsConfiguration must be provided.'),
|
|
133
|
+
defaultColumnsConfiguration: z
|
|
134
|
+
.array(ColumnSchema)
|
|
135
|
+
.optional()
|
|
136
|
+
.describe('Default visible columns configuration. Full replacement — omitting a column removes it. At least one of attributesConfiguration or defaultColumnsConfiguration must be provided.'),
|
|
78
137
|
};
|
|
79
138
|
const DisplayInputSchema = {
|
|
80
139
|
context: LayoutContextSchema,
|
|
81
|
-
widgetId: z.string().describe(
|
|
82
|
-
interval: z
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
140
|
+
widgetId: z.string().describe('The widget ID of the resource planner widget'),
|
|
141
|
+
interval: z
|
|
142
|
+
.string()
|
|
143
|
+
.optional()
|
|
144
|
+
.describe('Default time interval: DAY, WEEK, MONTH, QUARTER, or YEAR'),
|
|
145
|
+
allowedIntervals: z
|
|
146
|
+
.array(z.string())
|
|
147
|
+
.optional()
|
|
148
|
+
.describe('Allowed time intervals the user can choose from: DAY, WEEK, MONTH, QUARTER, YEAR'),
|
|
149
|
+
calculationSelection: z
|
|
150
|
+
.string()
|
|
151
|
+
.optional()
|
|
152
|
+
.describe('Utilization calculation mode: RELATIVE or ABSOLUTE'),
|
|
153
|
+
checkboxWeekend: z
|
|
154
|
+
.boolean()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe('Whether weekends are included in the time grid'),
|
|
157
|
+
boundaryLow: z.number().optional().describe('Low utilization threshold (e.g., 80)'),
|
|
158
|
+
boundaryHigh: z.number().optional().describe('High utilization threshold (e.g., 100)'),
|
|
88
159
|
colorLow: z.string().optional().describe("Color for low utilization (hex, e.g., '#4CAF50')"),
|
|
89
|
-
colorMedium: z
|
|
160
|
+
colorMedium: z
|
|
161
|
+
.string()
|
|
162
|
+
.optional()
|
|
163
|
+
.describe("Color for medium utilization (hex, e.g., '#FF9800')"),
|
|
90
164
|
colorHigh: z.string().optional().describe("Color for high utilization (hex, e.g., '#F44336')"),
|
|
91
|
-
treeStructure: z
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
165
|
+
treeStructure: z
|
|
166
|
+
.array(z.string())
|
|
167
|
+
.optional()
|
|
168
|
+
.describe('Hierarchy attributes for tree display (fully-qualified attribute names)'),
|
|
169
|
+
collapseLevel: z
|
|
170
|
+
.number()
|
|
171
|
+
.optional()
|
|
172
|
+
.describe('Default tree collapse level (0 = fully collapsed)'),
|
|
173
|
+
searchRootNode: z
|
|
174
|
+
.string()
|
|
175
|
+
.optional()
|
|
176
|
+
.describe('WARNING: Do not manually construct! Use cplaceJson from cplace_search_pages. Root node search for tree structure.'),
|
|
177
|
+
rootNodeSelection: z
|
|
178
|
+
.string()
|
|
179
|
+
.optional()
|
|
180
|
+
.describe('Root node selection value. Use the value from get_configuration or from the widget definition schema.'),
|
|
95
181
|
};
|
|
96
182
|
const RP_TOOL_DEFINITIONS = {
|
|
97
183
|
[TOOL_RP_GET_CONFIGURATION]: {
|
|
@@ -107,9 +193,9 @@ Returns all configuration organized into logical sections:
|
|
|
107
193
|
Use this to inspect current state before making changes with the configure tools.`,
|
|
108
194
|
inputSchema: {
|
|
109
195
|
context: LayoutContextSchema,
|
|
110
|
-
widgetId: z.string().describe(
|
|
196
|
+
widgetId: z.string().describe('The widget ID of the resource planner widget'),
|
|
111
197
|
},
|
|
112
|
-
annotations: { title:
|
|
198
|
+
annotations: { title: 'Get Resource Planner Configuration' },
|
|
113
199
|
},
|
|
114
200
|
[TOOL_RP_CONFIGURE_DATA_SOURCE]: {
|
|
115
201
|
description: `Configure the resource planner's primary data source and date calculation settings.
|
|
@@ -122,7 +208,7 @@ The dateCalculation mode determines which parameters are required:
|
|
|
122
208
|
|
|
123
209
|
Parameters for non-selected modes are ignored. Full replacement — all data source settings are overwritten.`,
|
|
124
210
|
inputSchema: DataSourceInputSchema,
|
|
125
|
-
annotations: { title:
|
|
211
|
+
annotations: { title: 'Configure Resource Planner Data Source' },
|
|
126
212
|
},
|
|
127
213
|
[TOOL_RP_CONFIGURE_GROUPS]: {
|
|
128
214
|
description: `Configure the resource planner's optional grouping layers.
|
|
@@ -135,7 +221,7 @@ Each group has a toggle pattern:
|
|
|
135
221
|
Full replacement per group — all attributes for the specified group(s) are overwritten.
|
|
136
222
|
Omitting a group parameter leaves that group unchanged.`,
|
|
137
223
|
inputSchema: GroupsInputSchema,
|
|
138
|
-
annotations: { title:
|
|
224
|
+
annotations: { title: 'Configure Resource Planner Groups' },
|
|
139
225
|
},
|
|
140
226
|
[TOOL_RP_CONFIGURE_COLUMNS]: {
|
|
141
227
|
description: `Configure the resource planner's column definitions (attributesConfiguration and defaultColumnsConfiguration).
|
|
@@ -148,7 +234,7 @@ Full replacement — the provided array completely replaces the current configur
|
|
|
148
234
|
|
|
149
235
|
Use cplace_resource_planner_get_configuration first to see current columns, then modify and send back the complete desired state.`,
|
|
150
236
|
inputSchema: ColumnsInputSchema,
|
|
151
|
-
annotations: { title:
|
|
237
|
+
annotations: { title: 'Configure Resource Planner Columns' },
|
|
152
238
|
},
|
|
153
239
|
[TOOL_RP_CONFIGURE_DISPLAY]: {
|
|
154
240
|
description: `Configure the resource planner's display and visual settings.
|
|
@@ -159,7 +245,7 @@ Settings include:
|
|
|
159
245
|
- Utilization colors: boundaryLow, boundaryHigh, colorLow, colorMedium, colorHigh
|
|
160
246
|
- Tree structure: treeStructure (hierarchy attributes), collapseLevel, searchRootNode, rootNodeSelection`,
|
|
161
247
|
inputSchema: DisplayInputSchema,
|
|
162
|
-
annotations: { title:
|
|
248
|
+
annotations: { title: 'Configure Resource Planner Display' },
|
|
163
249
|
},
|
|
164
250
|
};
|
|
165
251
|
function extractResourcePlannerConfiguration(widget) {
|
|
@@ -171,10 +257,12 @@ function extractResourcePlannerConfiguration(widget) {
|
|
|
171
257
|
if (typeof val === 'string')
|
|
172
258
|
return shortEnumValue(val);
|
|
173
259
|
if (Array.isArray(val))
|
|
174
|
-
return val.map(v => typeof v === 'string' ? shortEnumValue(v) : v);
|
|
260
|
+
return val.map((v) => (typeof v === 'string' ? shortEnumValue(v) : v));
|
|
175
261
|
return val;
|
|
176
262
|
};
|
|
177
|
-
if (widget.configuration &&
|
|
263
|
+
if (widget.configuration &&
|
|
264
|
+
typeof widget.configuration === 'object' &&
|
|
265
|
+
!Array.isArray(widget.configuration)) {
|
|
178
266
|
for (const [key, value] of Object.entries(widget.configuration)) {
|
|
179
267
|
config[getShortName(key)] = shortValue(value);
|
|
180
268
|
}
|
|
@@ -253,18 +341,22 @@ function groupConfiguration(config) {
|
|
|
253
341
|
searchRootNode: config.searchRootNode || null,
|
|
254
342
|
rootNodeSelection: config.rootNodeSelection || null,
|
|
255
343
|
},
|
|
256
|
-
actions: config.actionSearch
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
344
|
+
actions: config.actionSearch
|
|
345
|
+
? {
|
|
346
|
+
search: config.actionSearch,
|
|
347
|
+
sortColumn: config.sortColumnAction || null,
|
|
348
|
+
sortOrder: config.sortOrderAction || null,
|
|
349
|
+
selection: config.actionSelection || null,
|
|
350
|
+
}
|
|
351
|
+
: null,
|
|
352
|
+
charts: config.chartSearch
|
|
353
|
+
? {
|
|
354
|
+
search: config.chartSearch,
|
|
355
|
+
sortColumn: config.sortColumnChart || null,
|
|
356
|
+
sortOrder: config.sortOrderChart || null,
|
|
357
|
+
selection: config.chartSelection || null,
|
|
358
|
+
}
|
|
359
|
+
: null,
|
|
268
360
|
};
|
|
269
361
|
}
|
|
270
362
|
export function registerResourcePlannerTools(server, client) {
|
|
@@ -277,62 +369,100 @@ export function registerResourcePlannerTools(server, client) {
|
|
|
277
369
|
const widget = findWidgetById(layoutResult.rows, widgetId);
|
|
278
370
|
if (!widget) {
|
|
279
371
|
return {
|
|
280
|
-
content: [
|
|
281
|
-
|
|
372
|
+
content: [
|
|
373
|
+
{
|
|
374
|
+
type: 'text',
|
|
375
|
+
text: `Resource planner widget with ID '${widgetId}' not found in layout`,
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
isError: true,
|
|
282
379
|
};
|
|
283
380
|
}
|
|
284
381
|
if (widget.widgetType !== RP_WIDGET_TYPE) {
|
|
285
382
|
return {
|
|
286
|
-
content: [
|
|
287
|
-
|
|
383
|
+
content: [
|
|
384
|
+
{
|
|
385
|
+
type: 'text',
|
|
386
|
+
text: `Widget '${widgetId}' is not a resource planner widget (found: ${widget.widgetType})`,
|
|
387
|
+
},
|
|
388
|
+
],
|
|
389
|
+
isError: true,
|
|
288
390
|
};
|
|
289
391
|
}
|
|
290
392
|
const rawConfig = extractResourcePlannerConfiguration(widget);
|
|
291
393
|
const grouped = groupConfiguration(rawConfig);
|
|
292
394
|
const isUnconfigured = !rawConfig.searchNode && !rawConfig.dateCalculation;
|
|
293
395
|
return {
|
|
294
|
-
content: [
|
|
396
|
+
content: [
|
|
397
|
+
{
|
|
398
|
+
type: 'text',
|
|
399
|
+
text: JSON.stringify({
|
|
295
400
|
context,
|
|
296
401
|
widgetId,
|
|
297
402
|
configuration: {
|
|
298
|
-
status: isUnconfigured ?
|
|
299
|
-
...grouped
|
|
300
|
-
}
|
|
301
|
-
}, null, 2)
|
|
403
|
+
status: isUnconfigured ? 'unconfigured' : 'configured',
|
|
404
|
+
...grouped,
|
|
405
|
+
},
|
|
406
|
+
}, null, 2),
|
|
407
|
+
},
|
|
408
|
+
],
|
|
302
409
|
};
|
|
303
410
|
}
|
|
304
411
|
catch (error) {
|
|
305
412
|
debugLogWithTag('RESOURCE_PLANNER', `Error getting configuration: ${error instanceof Error ? error.message : String(error)}`);
|
|
306
413
|
return {
|
|
307
|
-
content: [
|
|
308
|
-
|
|
414
|
+
content: [
|
|
415
|
+
{
|
|
416
|
+
type: 'text',
|
|
417
|
+
text: `Failed to get resource planner configuration: ${error instanceof Error ? error.message : String(error)}`,
|
|
418
|
+
},
|
|
419
|
+
],
|
|
420
|
+
isError: true,
|
|
309
421
|
};
|
|
310
422
|
}
|
|
311
423
|
});
|
|
312
|
-
server.registerTool(TOOL_RP_CONFIGURE_DATA_SOURCE, RP_TOOL_DEFINITIONS[TOOL_RP_CONFIGURE_DATA_SOURCE], async ({ context, widgetId, searchNode, sortColumnNode, sortOrderNode, nodeSelection, dateCalculation, start, end, startValueDynamic, startUnitDynamic, endValueDynamic, endUnitDynamic, startDateAttribute, endDateAttribute }) => {
|
|
424
|
+
server.registerTool(TOOL_RP_CONFIGURE_DATA_SOURCE, RP_TOOL_DEFINITIONS[TOOL_RP_CONFIGURE_DATA_SOURCE], async ({ context, widgetId, searchNode, sortColumnNode, sortOrderNode, nodeSelection, dateCalculation, start, end, startValueDynamic, startUnitDynamic, endValueDynamic, endUnitDynamic, startDateAttribute, endDateAttribute, }) => {
|
|
313
425
|
debugLogWithTag('RESOURCE_PLANNER', `Configuring data source for widget ${widgetId}, mode=${dateCalculation}`);
|
|
314
426
|
try {
|
|
315
427
|
if (dateCalculation === 'STATIC') {
|
|
316
428
|
if (!start || !end) {
|
|
317
429
|
return {
|
|
318
|
-
content: [
|
|
319
|
-
|
|
430
|
+
content: [
|
|
431
|
+
{
|
|
432
|
+
type: 'text',
|
|
433
|
+
text: "Error: dateCalculation=STATIC requires 'start' and 'end' parameters.",
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
isError: true,
|
|
320
437
|
};
|
|
321
438
|
}
|
|
322
439
|
}
|
|
323
440
|
else if (dateCalculation === 'DYNAMIC') {
|
|
324
|
-
if (startValueDynamic === undefined ||
|
|
441
|
+
if (startValueDynamic === undefined ||
|
|
442
|
+
!startUnitDynamic ||
|
|
443
|
+
endValueDynamic === undefined ||
|
|
444
|
+
!endUnitDynamic) {
|
|
325
445
|
return {
|
|
326
|
-
content: [
|
|
327
|
-
|
|
446
|
+
content: [
|
|
447
|
+
{
|
|
448
|
+
type: 'text',
|
|
449
|
+
text: "Error: dateCalculation=DYNAMIC requires 'startValueDynamic', 'startUnitDynamic', 'endValueDynamic', and 'endUnitDynamic' parameters.",
|
|
450
|
+
},
|
|
451
|
+
],
|
|
452
|
+
isError: true,
|
|
328
453
|
};
|
|
329
454
|
}
|
|
330
455
|
}
|
|
331
456
|
else if (dateCalculation === 'ATTRIBUTE') {
|
|
332
457
|
if (!startDateAttribute || !endDateAttribute) {
|
|
333
458
|
return {
|
|
334
|
-
content: [
|
|
335
|
-
|
|
459
|
+
content: [
|
|
460
|
+
{
|
|
461
|
+
type: 'text',
|
|
462
|
+
text: "Error: dateCalculation=ATTRIBUTE requires 'startDateAttribute' and 'endDateAttribute' parameters.",
|
|
463
|
+
},
|
|
464
|
+
],
|
|
465
|
+
isError: true,
|
|
336
466
|
};
|
|
337
467
|
}
|
|
338
468
|
}
|
|
@@ -364,21 +494,31 @@ export function registerResourcePlannerTools(server, client) {
|
|
|
364
494
|
const endpoint = determineApiEndpoint(context);
|
|
365
495
|
await client.makeApiRequest(endpoint, 'PATCH', undefined, requestBody);
|
|
366
496
|
return {
|
|
367
|
-
content: [
|
|
368
|
-
|
|
369
|
-
|
|
497
|
+
content: [
|
|
498
|
+
{
|
|
499
|
+
type: 'text',
|
|
500
|
+
text: JSON.stringify({
|
|
501
|
+
operation: 'CONFIGURE_DATA_SOURCE',
|
|
502
|
+
status: 'SUCCESS',
|
|
370
503
|
context,
|
|
371
504
|
widgetId,
|
|
372
505
|
dateCalculationMode: dateCalculation,
|
|
373
|
-
message: `Resource planner data source configured with dateCalculation=${dateCalculation}
|
|
374
|
-
}, null, 2)
|
|
506
|
+
message: `Resource planner data source configured with dateCalculation=${dateCalculation}`,
|
|
507
|
+
}, null, 2),
|
|
508
|
+
},
|
|
509
|
+
],
|
|
375
510
|
};
|
|
376
511
|
}
|
|
377
512
|
catch (error) {
|
|
378
513
|
debugLogWithTag('RESOURCE_PLANNER', `Error configuring data source: ${error instanceof Error ? error.message : String(error)}`);
|
|
379
514
|
return {
|
|
380
|
-
content: [
|
|
381
|
-
|
|
515
|
+
content: [
|
|
516
|
+
{
|
|
517
|
+
type: 'text',
|
|
518
|
+
text: `Failed to configure data source: ${error instanceof Error ? error.message : String(error)}`,
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
isError: true,
|
|
382
522
|
};
|
|
383
523
|
}
|
|
384
524
|
});
|
|
@@ -387,20 +527,35 @@ export function registerResourcePlannerTools(server, client) {
|
|
|
387
527
|
try {
|
|
388
528
|
if (!firstGroup && !secondGroup) {
|
|
389
529
|
return {
|
|
390
|
-
content: [
|
|
391
|
-
|
|
530
|
+
content: [
|
|
531
|
+
{
|
|
532
|
+
type: 'text',
|
|
533
|
+
text: "Error: At least one of 'firstGroup' or 'secondGroup' must be provided.",
|
|
534
|
+
},
|
|
535
|
+
],
|
|
536
|
+
isError: true,
|
|
392
537
|
};
|
|
393
538
|
}
|
|
394
539
|
if (firstGroup?.enabled && !firstGroup.search) {
|
|
395
540
|
return {
|
|
396
|
-
content: [
|
|
397
|
-
|
|
541
|
+
content: [
|
|
542
|
+
{
|
|
543
|
+
type: 'text',
|
|
544
|
+
text: 'Error: firstGroup.search is required when firstGroup.enabled=true.',
|
|
545
|
+
},
|
|
546
|
+
],
|
|
547
|
+
isError: true,
|
|
398
548
|
};
|
|
399
549
|
}
|
|
400
550
|
if (secondGroup?.enabled && !secondGroup.search) {
|
|
401
551
|
return {
|
|
402
|
-
content: [
|
|
403
|
-
|
|
552
|
+
content: [
|
|
553
|
+
{
|
|
554
|
+
type: 'text',
|
|
555
|
+
text: 'Error: secondGroup.search is required when secondGroup.enabled=true.',
|
|
556
|
+
},
|
|
557
|
+
],
|
|
558
|
+
isError: true,
|
|
404
559
|
};
|
|
405
560
|
}
|
|
406
561
|
const configuration = {};
|
|
@@ -450,22 +605,32 @@ export function registerResourcePlannerTools(server, client) {
|
|
|
450
605
|
const endpoint = determineApiEndpoint(context);
|
|
451
606
|
await client.makeApiRequest(endpoint, 'PATCH', undefined, requestBody);
|
|
452
607
|
return {
|
|
453
|
-
content: [
|
|
454
|
-
|
|
455
|
-
|
|
608
|
+
content: [
|
|
609
|
+
{
|
|
610
|
+
type: 'text',
|
|
611
|
+
text: JSON.stringify({
|
|
612
|
+
operation: 'CONFIGURE_GROUPS',
|
|
613
|
+
status: 'SUCCESS',
|
|
456
614
|
context,
|
|
457
615
|
widgetId,
|
|
458
|
-
firstGroupEnabled: firstGroup?.enabled ??
|
|
459
|
-
secondGroupEnabled: secondGroup?.enabled ??
|
|
460
|
-
message: `Resource planner groups configured
|
|
461
|
-
}, null, 2)
|
|
616
|
+
firstGroupEnabled: firstGroup?.enabled ?? 'unchanged',
|
|
617
|
+
secondGroupEnabled: secondGroup?.enabled ?? 'unchanged',
|
|
618
|
+
message: `Resource planner groups configured`,
|
|
619
|
+
}, null, 2),
|
|
620
|
+
},
|
|
621
|
+
],
|
|
462
622
|
};
|
|
463
623
|
}
|
|
464
624
|
catch (error) {
|
|
465
625
|
debugLogWithTag('RESOURCE_PLANNER', `Error configuring groups: ${error instanceof Error ? error.message : String(error)}`);
|
|
466
626
|
return {
|
|
467
|
-
content: [
|
|
468
|
-
|
|
627
|
+
content: [
|
|
628
|
+
{
|
|
629
|
+
type: 'text',
|
|
630
|
+
text: `Failed to configure groups: ${error instanceof Error ? error.message : String(error)}`,
|
|
631
|
+
},
|
|
632
|
+
],
|
|
633
|
+
isError: true,
|
|
469
634
|
};
|
|
470
635
|
}
|
|
471
636
|
});
|
|
@@ -474,37 +639,56 @@ export function registerResourcePlannerTools(server, client) {
|
|
|
474
639
|
try {
|
|
475
640
|
if (!attributesConfiguration && !defaultColumnsConfiguration) {
|
|
476
641
|
return {
|
|
477
|
-
content: [
|
|
478
|
-
|
|
642
|
+
content: [
|
|
643
|
+
{
|
|
644
|
+
type: 'text',
|
|
645
|
+
text: "Error: At least one of 'attributesConfiguration' or 'defaultColumnsConfiguration' must be provided.",
|
|
646
|
+
},
|
|
647
|
+
],
|
|
648
|
+
isError: true,
|
|
479
649
|
};
|
|
480
650
|
}
|
|
481
651
|
const configuration = {};
|
|
482
652
|
if (attributesConfiguration) {
|
|
483
|
-
configuration[`${RP_PREFIX}attributesConfiguration`] = JSON.stringify({
|
|
653
|
+
configuration[`${RP_PREFIX}attributesConfiguration`] = JSON.stringify({
|
|
654
|
+
columns: attributesConfiguration,
|
|
655
|
+
});
|
|
484
656
|
}
|
|
485
657
|
if (defaultColumnsConfiguration) {
|
|
486
|
-
configuration[`${RP_PREFIX}defaultColumnsConfiguration`] = JSON.stringify({
|
|
658
|
+
configuration[`${RP_PREFIX}defaultColumnsConfiguration`] = JSON.stringify({
|
|
659
|
+
columns: defaultColumnsConfiguration,
|
|
660
|
+
});
|
|
487
661
|
}
|
|
488
662
|
const requestBody = buildUpdateRequestBody(context, widgetId, configuration);
|
|
489
663
|
const endpoint = determineApiEndpoint(context);
|
|
490
664
|
await client.makeApiRequest(endpoint, 'PATCH', undefined, requestBody);
|
|
491
665
|
return {
|
|
492
|
-
content: [
|
|
493
|
-
|
|
494
|
-
|
|
666
|
+
content: [
|
|
667
|
+
{
|
|
668
|
+
type: 'text',
|
|
669
|
+
text: JSON.stringify({
|
|
670
|
+
operation: 'CONFIGURE_COLUMNS',
|
|
671
|
+
status: 'SUCCESS',
|
|
495
672
|
context,
|
|
496
673
|
widgetId,
|
|
497
|
-
attributesConfigurationCount: attributesConfiguration?.length ??
|
|
498
|
-
defaultColumnsConfigurationCount: defaultColumnsConfiguration?.length ??
|
|
499
|
-
message: `Resource planner columns configured
|
|
500
|
-
}, null, 2)
|
|
674
|
+
attributesConfigurationCount: attributesConfiguration?.length ?? 'unchanged',
|
|
675
|
+
defaultColumnsConfigurationCount: defaultColumnsConfiguration?.length ?? 'unchanged',
|
|
676
|
+
message: `Resource planner columns configured`,
|
|
677
|
+
}, null, 2),
|
|
678
|
+
},
|
|
679
|
+
],
|
|
501
680
|
};
|
|
502
681
|
}
|
|
503
682
|
catch (error) {
|
|
504
683
|
debugLogWithTag('RESOURCE_PLANNER', `Error configuring columns: ${error instanceof Error ? error.message : String(error)}`);
|
|
505
684
|
return {
|
|
506
|
-
content: [
|
|
507
|
-
|
|
685
|
+
content: [
|
|
686
|
+
{
|
|
687
|
+
type: 'text',
|
|
688
|
+
text: `Failed to configure columns: ${error instanceof Error ? error.message : String(error)}`,
|
|
689
|
+
},
|
|
690
|
+
],
|
|
691
|
+
isError: true,
|
|
508
692
|
};
|
|
509
693
|
}
|
|
510
694
|
});
|
|
@@ -546,29 +730,41 @@ export function registerResourcePlannerTools(server, client) {
|
|
|
546
730
|
}
|
|
547
731
|
if (appliedSettings.length === 0) {
|
|
548
732
|
return {
|
|
549
|
-
content: [
|
|
550
|
-
|
|
733
|
+
content: [
|
|
734
|
+
{ type: 'text', text: 'Error: At least one display setting must be provided.' },
|
|
735
|
+
],
|
|
736
|
+
isError: true,
|
|
551
737
|
};
|
|
552
738
|
}
|
|
553
739
|
const requestBody = buildUpdateRequestBody(context, widgetId, configuration);
|
|
554
740
|
const endpoint = determineApiEndpoint(context);
|
|
555
741
|
await client.makeApiRequest(endpoint, 'PATCH', undefined, requestBody);
|
|
556
742
|
return {
|
|
557
|
-
content: [
|
|
558
|
-
|
|
559
|
-
|
|
743
|
+
content: [
|
|
744
|
+
{
|
|
745
|
+
type: 'text',
|
|
746
|
+
text: JSON.stringify({
|
|
747
|
+
operation: 'CONFIGURE_DISPLAY',
|
|
748
|
+
status: 'SUCCESS',
|
|
560
749
|
context,
|
|
561
750
|
widgetId,
|
|
562
751
|
appliedSettings,
|
|
563
|
-
message: `Resource planner display configured (${appliedSettings.length} settings updated)
|
|
564
|
-
}, null, 2)
|
|
752
|
+
message: `Resource planner display configured (${appliedSettings.length} settings updated)`,
|
|
753
|
+
}, null, 2),
|
|
754
|
+
},
|
|
755
|
+
],
|
|
565
756
|
};
|
|
566
757
|
}
|
|
567
758
|
catch (error) {
|
|
568
759
|
debugLogWithTag('RESOURCE_PLANNER', `Error configuring display: ${error instanceof Error ? error.message : String(error)}`);
|
|
569
760
|
return {
|
|
570
|
-
content: [
|
|
571
|
-
|
|
761
|
+
content: [
|
|
762
|
+
{
|
|
763
|
+
type: 'text',
|
|
764
|
+
text: `Failed to configure display: ${error instanceof Error ? error.message : String(error)}`,
|
|
765
|
+
},
|
|
766
|
+
],
|
|
767
|
+
isError: true,
|
|
572
768
|
};
|
|
573
769
|
}
|
|
574
770
|
});
|