@cplace/mcp-server 1.7.10 → 1.8.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.
Files changed (67) hide show
  1. package/dist/plugins/core/app-catalog/cf.cplace.cboard.main/README.md +1 -1
  2. package/dist/plugins/core/widget-specifications/cf.cplace.cboard.main.board/_implementation.md +1 -1
  3. package/dist/plugins/core/widget-specifications/cf.cplace.platform.attributesGroup/layout.md +1 -1
  4. package/dist/plugins/core/widget-specifications/cf.cplace.platform.connectedAttributesGroup/cf.cplace.platform.attributesGroup.layout.md +1 -1
  5. package/dist/plugins/resource-management/widget-specifications/cf.cplace.resourceManagement.resourcePlannerDefinition/_implementation.md +1 -1
  6. package/dist/searchConversion.js +1 -1
  7. package/dist/searchConversion.js.map +1 -1
  8. package/dist/tools/board-widget.d.ts +50 -10
  9. package/dist/tools/board-widget.d.ts.map +1 -1
  10. package/dist/tools/common-schemas.d.ts +4 -5
  11. package/dist/tools/common-schemas.d.ts.map +1 -1
  12. package/dist/tools/common-schemas.js +39 -21
  13. package/dist/tools/common-schemas.js.map +1 -1
  14. package/dist/tools/csv-export.d.ts +472 -4
  15. package/dist/tools/csv-export.d.ts.map +1 -1
  16. package/dist/tools/csv-export.js +4 -8
  17. package/dist/tools/csv-export.js.map +1 -1
  18. package/dist/tools/jobs.d.ts +2 -2
  19. package/dist/tools/jobs.d.ts.map +1 -1
  20. package/dist/tools/jobs.js +3 -2
  21. package/dist/tools/jobs.js.map +1 -1
  22. package/dist/tools/layout-richstring-shared.d.ts +5 -0
  23. package/dist/tools/layout-richstring-shared.d.ts.map +1 -0
  24. package/dist/tools/layout-richstring-shared.js +35 -0
  25. package/dist/tools/layout-richstring-shared.js.map +1 -0
  26. package/dist/tools/layout-richstring-translator.d.ts +36 -0
  27. package/dist/tools/layout-richstring-translator.d.ts.map +1 -0
  28. package/dist/tools/layout-richstring-translator.js +695 -0
  29. package/dist/tools/layout-richstring-translator.js.map +1 -0
  30. package/dist/tools/layout-richstring-widgets.d.ts +6 -112
  31. package/dist/tools/layout-richstring-widgets.d.ts.map +1 -1
  32. package/dist/tools/layout-richstring-widgets.js +9 -204
  33. package/dist/tools/layout-richstring-widgets.js.map +1 -1
  34. package/dist/tools/layout.d.ts +69 -20
  35. package/dist/tools/layout.d.ts.map +1 -1
  36. package/dist/tools/layout.js +153 -113
  37. package/dist/tools/layout.js.map +1 -1
  38. package/dist/tools/pages.d.ts +2 -2
  39. package/dist/tools/pages.d.ts.map +1 -1
  40. package/dist/tools/pages.js +3 -12
  41. package/dist/tools/pages.js.map +1 -1
  42. package/dist/tools/resource-planner-widget.d.ts +54 -14
  43. package/dist/tools/resource-planner-widget.d.ts.map +1 -1
  44. package/dist/tools/resource-planner-widget.js +52 -13
  45. package/dist/tools/resource-planner-widget.js.map +1 -1
  46. package/dist/tools/search.d.ts +476 -8
  47. package/dist/tools/search.d.ts.map +1 -1
  48. package/dist/tools/search.js +8 -12
  49. package/dist/tools/search.js.map +1 -1
  50. package/dist/tools/system.d.ts.map +1 -1
  51. package/dist/tools/system.js +2 -1
  52. package/dist/tools/system.js.map +1 -1
  53. package/dist/tools/type-management.js +1 -1
  54. package/dist/tools/type-management.js.map +1 -1
  55. package/dist/tools/version-history.d.ts +4 -4
  56. package/dist/tools/version-history.d.ts.map +1 -1
  57. package/dist/tools/version-history.js +5 -4
  58. package/dist/tools/version-history.js.map +1 -1
  59. package/dist/tools/widgets.d.ts +2 -2
  60. package/dist/tools/widgets.d.ts.map +1 -1
  61. package/dist/tools/widgets.js +12 -2
  62. package/dist/tools/widgets.js.map +1 -1
  63. package/dist/tools/workspace-core.d.ts +2 -2
  64. package/dist/tools/workspace-core.d.ts.map +1 -1
  65. package/dist/tools/workspace-core.js +3 -2
  66. package/dist/tools/workspace-core.js.map +1 -1
  67. package/package.json +2 -2
@@ -1,7 +1,7 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
2
  import { z } from "zod";
3
3
  import { CplaceApiClient } from '../api.js';
4
- export declare const LayoutContextSchema: z.ZodUnion<[z.ZodObject<{
4
+ export declare const LayoutContextSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
5
5
  type: z.ZodLiteral<"page">;
6
6
  pageUID: z.ZodString;
7
7
  }, "strip", z.ZodTypeAny, {
@@ -25,12 +25,20 @@ export declare const LayoutContextSchema: z.ZodUnion<[z.ZodObject<{
25
25
  workspaceId: string;
26
26
  typeInternalName: string;
27
27
  alternativeLayoutName?: string | undefined;
28
- }>]>;
28
+ }>]>, {
29
+ type: "page";
30
+ pageUID: string;
31
+ } | {
32
+ type: "type";
33
+ workspaceId: string;
34
+ typeInternalName: string;
35
+ alternativeLayoutName?: string | undefined;
36
+ }, unknown>;
29
37
  export declare const LAYOUT_TOOL_DEFINITIONS: {
30
- readonly cplace_define_layout: {
31
- readonly description: "Define a complete page or type layout atomically using a layout.define() low-code script.\n\nWHEN TO USE:\n- Use this tool when you know the full layout structure upfront\n- Replaces the entire layout in a single atomic operation (no partial updates)\n- More efficient than sequential add-row/add-widget calls for complete layouts\n\nKEY BEHAVIORS:\n- The script must call layout.define() exactly once\n- The entire layout is atomically replaced — previous layout is fully overwritten\n- Script timeout: 30 seconds\n- Widget IDs: auto-generated if omitted; if provided without '_' prefix, '_' is prepended automatically\n\nRESPONSE OUTCOMES:\n- VALID_COMPLETE: Layout saved, all widgets fully configured\n- VALID_INCOMPLETE: Layout saved, but some widgets have missing optional configuration (warnings returned)\n- Validation errors: Layout NOT saved — structural or widget errors returned with details\n- Generic errors: Entity not found, permission denied, script errors\n\nVALIDATION FEEDBACK:\n- Structural errors: invalid column proportions (must be 3-12 each, sum to 12 per row)\n- Widget errors: unknown widget types, invalid configurations\n- Warnings: widgets saved but missing optional configuration (e.g., search filter not set)\n\nTIP: After a VALID_INCOMPLETE response, re-run layout.define() with corrected widget configuration to resolve warnings.\n\nCOMMON WIDGET TYPES (platform, always available):\ncf.platform.attributes, cf.cplace.platform.attributesGroup,\ncf.platform.wiki, cf.platform.richString, cf.cplace.demoWidgets.demoRichString,\ncf.platform.embeddedSearchAsTable, cf.cplace.platform.tableWidget,\ncf.platform.connectedBarChart, cf.platform.connectedPieChart,\ncf.platform.connectedMatrix, cf.platform.connectedTableFilter,\ncf.platform.incomingReferences, cf.platform.comments, cf.platform.files,\ncf.cplace.visualizations.scriptingHighcharts\n\nFor app-dependent widgets not in this list, call cplace_list_widget_definitions with embeddingContext \"AS_WIDGET\".";
38
+ readonly cplace_execute_layout_script: {
39
+ readonly description: "Execute a layout script either a full layout.define() replacement or per-widget edit verbs.\n\nTWO MODES (determined by script content):\n\nMODE 1 — FULL REPLACE (layout.define):\n- Script calls layout.define() exactly once to declare the complete layout structure\n- Replaces the entire layout atomically\n- Same behavior as before\n\nMODE 2 — EDIT VERBS (per-widget):\n- Script calls one or more edit methods: layout.updateWidget(), layout.addWidget(), layout.removeWidget(), layout.moveWidget(), layout.addRow(), layout.compact()\n- Each call collects an operation; all operations commit atomically or fail together\n- Cannot mix layout.define() with edit verbs in the same script\n\nEDIT VERBS:\n layout.updateWidget(\"widgetId\", { \"cf.cplace.x\": newValue }) — partial config merge (only specified keys change)\n layout.addWidget({ widgetType: \"cf.platform.wiki\", position: { rowIndex: 0, columnIndex: 0, widgetIndex: 0 }, configuration: { ... } })\n layout.removeWidget(\"widgetId\")\n layout.moveWidget(\"widgetId\", { rowIndex: 1, columnIndex: 0, widgetIndex: 0 })\n layout.addRow(rowIndex, [6, 6]) — column proportions must sum to 12\n layout.compact() — remove empty rows\n\nWORKFLOW for per-widget edit:\n1. Read: cplace_get_layout_script with widgetIds to get layout.updateWidget() fragments\n2. Edit: modify the config values in the fragment\n3. Execute: post the modified script via this tool\n\nKEY BEHAVIORS (for layout.define mode):\n- The script must call layout.define() exactly once\n- The entire layout is atomically replaced — previous layout is fully overwritten\n- Script timeout: 30 seconds\n- Widget IDs: MUST be omitted from layout.define. Ids are assigned by the server and returned in the response. Use the returned id in subsequent layout.updateWidget() calls.\n\nRESPONSE OUTCOMES:\n- VALID_COMPLETE: Layout saved, all widgets fully configured\n- VALID_INCOMPLETE: Layout saved, but some widgets have missing optional configuration (warnings returned)\n- Validation errors: Layout NOT saved — structural or widget errors returned with details\n- Generic errors: Entity not found, permission denied, script errors\n\nVALIDATION FEEDBACK:\n- Structural errors: invalid column proportions (must be 3-12 each, sum to 12 per row)\n- Widget errors: unknown widget types, invalid configurations\n- Warnings: widgets saved but missing optional configuration (e.g., search filter not set)\n\nTIP: After a VALID_INCOMPLETE response, re-run layout.define() with corrected widget configuration to resolve warnings.\n\nCOMMON WIDGET TYPES (platform, always available):\ncf.platform.attributes, cf.cplace.platform.attributesGroup,\ncf.platform.wiki, cf.platform.richString, cf.cplace.demoWidgets.demoRichString,\ncf.platform.embeddedSearchAsTable, cf.cplace.platform.tableWidget,\ncf.platform.connectedBarChart, cf.platform.connectedPieChart,\ncf.platform.connectedMatrix, cf.platform.connectedTableFilter,\ncf.platform.incomingReferences, cf.platform.comments, cf.platform.files,\ncf.cplace.visualizations.scriptingHighcharts\n\nFor app-dependent widgets not in this list, call cplace_list_widget_definitions with embeddingContext \"AS_WIDGET\".\n\nRICHSTRING WIDGETS AND EMBEDDED WIDGETS (decoded form):\nRichString widgets (cf.platform.richString, cf.cplace.demoWidgets.demoRichString)\nhold HTML in their 'content' config. Embedded widgets inside that HTML are\nexpressed in decoded form:\n <embeddedwidget id=\"id_w1\" type=\"cf.platform.singleAttribute\">{\"properties\":{\"attribute\":\"name\"}}</embeddedwidget>\n\nSemantics when submitting a script:\n • Tag with an existing id + same type → update (properties replace current)\n • Tag without id → insert new embedded widget (backend assigns id)\n • Existing id omitted from new content → delete\n • Unknown id, duplicate id, or type change for same id → error\n\nRaw base64 <embeddedwidget>BASE64</embeddedwidget> tags are REJECTED on writes.\nFetch current decoded form via cplace_get_layout_script.\n\nIMPORTANT: Decoded <embeddedwidget> tags must appear directly inline in a content: value.\nDo NOT build the tag in a variable and pass it — the parser rejects tags outside content: literals.\n ✅ layout.updateWidget(\"id\", { content: '<embeddedwidget type=\"...\">...</embeddedwidget>' });\n ❌ var tag = '<embeddedwidget ...>...</embeddedwidget>'; layout.updateWidget(\"id\", { content: tag });\n\nFor atomic single-embedded-widget edits without rewriting the full script,\nsee cplace_layout_richstring_* tools.";
32
40
  readonly inputSchema: {
33
- readonly context: z.ZodUnion<[z.ZodObject<{
41
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
34
42
  type: z.ZodLiteral<"page">;
35
43
  pageUID: z.ZodString;
36
44
  }, "strip", z.ZodTypeAny, {
@@ -54,17 +62,25 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
54
62
  workspaceId: string;
55
63
  typeInternalName: string;
56
64
  alternativeLayoutName?: string | undefined;
57
- }>]>;
65
+ }>]>, {
66
+ type: "page";
67
+ pageUID: string;
68
+ } | {
69
+ type: "type";
70
+ workspaceId: string;
71
+ typeInternalName: string;
72
+ alternativeLayoutName?: string | undefined;
73
+ }, unknown>;
58
74
  readonly script: z.ZodString;
59
75
  };
60
76
  readonly annotations: {
61
- readonly title: "Define Layout";
77
+ readonly title: "Execute Layout Script";
62
78
  };
63
79
  };
64
80
  readonly cplace_get_layout_overview: {
65
81
  readonly description: "Get layout structure for page or type. Provides an overview of the layout grid including rows, columns, and widget summaries for both page and type layouts.";
66
82
  readonly inputSchema: {
67
- readonly context: z.ZodUnion<[z.ZodObject<{
83
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
68
84
  type: z.ZodLiteral<"page">;
69
85
  pageUID: z.ZodString;
70
86
  }, "strip", z.ZodTypeAny, {
@@ -88,16 +104,24 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
88
104
  workspaceId: string;
89
105
  typeInternalName: string;
90
106
  alternativeLayoutName?: string | undefined;
91
- }>]>;
107
+ }>]>, {
108
+ type: "page";
109
+ pageUID: string;
110
+ } | {
111
+ type: "type";
112
+ workspaceId: string;
113
+ typeInternalName: string;
114
+ alternativeLayoutName?: string | undefined;
115
+ }, unknown>;
92
116
  };
93
117
  readonly annotations: {
94
118
  readonly title: "Get Layout Overview";
95
119
  };
96
120
  };
97
121
  readonly cplace_get_layout_widget_details: {
98
- readonly description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.";
122
+ readonly description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.\n\nRichString widget content appears in decoded form: `<embeddedwidget id=\"…\" type=\"…\">{\"properties\":{…}}</embeddedwidget>` — no base64.";
99
123
  readonly inputSchema: {
100
- readonly context: z.ZodUnion<[z.ZodObject<{
124
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
101
125
  type: z.ZodLiteral<"page">;
102
126
  pageUID: z.ZodString;
103
127
  }, "strip", z.ZodTypeAny, {
@@ -121,17 +145,25 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
121
145
  workspaceId: string;
122
146
  typeInternalName: string;
123
147
  alternativeLayoutName?: string | undefined;
124
- }>]>;
148
+ }>]>, {
149
+ type: "page";
150
+ pageUID: string;
151
+ } | {
152
+ type: "type";
153
+ workspaceId: string;
154
+ typeInternalName: string;
155
+ alternativeLayoutName?: string | undefined;
156
+ }, unknown>;
125
157
  readonly widgetId: z.ZodString;
126
158
  };
127
159
  readonly annotations: {
128
160
  readonly title: "Get Layout Widget Details";
129
161
  };
130
162
  };
131
- readonly cplace_get_layout_definition: {
132
- readonly description: "Get the current layout as a layout.define() JavaScript definition for a page or type layout.\n\nWHEN TO USE:\n- To read the current layout before modifying it (read-edit-write workflow)\n- To inspect the full layout definition including widget configurations and embedded layouts\n- To copy a layout from one page/type to another\n\nRETURNS:\n- The layout as a layout.define({...}) definition string, ready to be modified and posted back via cplace_define_layout\n- Widget config values are in the INPUT format accepted by cplace_define_layout (references as UID strings, rich strings as markup strings, localized strings as {locale: value} maps)\n\nROUND-TRIP WORKFLOW:\n1. GET: Use this tool to retrieve the current layout definition\n2. EDIT: Modify the definition as needed\n3. APPLY: Use cplace_define_layout to apply the modified definition";
163
+ readonly cplace_get_layout_script: {
164
+ readonly description: "Get the current layout as an executable script for a page or type layout.\n\nTWO MODES (determined by widgetIds parameter):\n\nWITHOUT widgetIds: Returns the full layout as a layout.define({...}) script (same as before).\n\nWITH widgetIds: Returns layout.updateWidget(\"id\", {config}) fragments for just the specified widgets.\nThe output is directly executable post it back via cplace_execute_layout_script.\n\nROUND-TRIP WORKFLOW:\n1. GET: Use this tool (with widgetIds for selective read, without for full layout)\n2. EDIT: Modify the script as needed\n3. APPLY: Use cplace_execute_layout_script to apply\n\nRichString widget content is returned in decoded form:\n <embeddedwidget id=\"…\" type=\"…\">{\"properties\":{…}}</embeddedwidget>\nThe output is directly executable — base64 tags are never emitted.";
133
165
  readonly inputSchema: {
134
- readonly context: z.ZodUnion<[z.ZodObject<{
166
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
135
167
  type: z.ZodLiteral<"page">;
136
168
  pageUID: z.ZodString;
137
169
  }, "strip", z.ZodTypeAny, {
@@ -155,16 +187,25 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
155
187
  workspaceId: string;
156
188
  typeInternalName: string;
157
189
  alternativeLayoutName?: string | undefined;
158
- }>]>;
190
+ }>]>, {
191
+ type: "page";
192
+ pageUID: string;
193
+ } | {
194
+ type: "type";
195
+ workspaceId: string;
196
+ typeInternalName: string;
197
+ alternativeLayoutName?: string | undefined;
198
+ }, unknown>;
199
+ readonly widgetIds: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
159
200
  };
160
201
  readonly annotations: {
161
- readonly title: "Get Layout Definition";
202
+ readonly title: "Get Layout Script";
162
203
  };
163
204
  };
164
205
  readonly cplace_edit_layout: {
165
- readonly description: "Edit a layout using str_replace — find an exact text match and replace it. Reads the current layout.define() definition, applies the replacement, and writes back. Use this instead of cplace_define_layout when making small changes to large layouts to avoid reproducing the entire definition.";
206
+ readonly description: "Edit a layout using str_replace — find an exact text match and replace it. Reads the current layout.define() definition, applies the replacement, and writes back. Use this instead of cplace_execute_layout_script when making small changes to large layouts to avoid reproducing the entire definition.\n\nRichString widget content is in decoded form. `old_str` must match the decoded form exactly as returned by cplace_get_layout_script. Raw base64 <embeddedwidget> tags are rejected in both `old_str` and `new_str`.";
166
207
  readonly inputSchema: {
167
- readonly context: z.ZodUnion<[z.ZodObject<{
208
+ readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
168
209
  type: z.ZodLiteral<"page">;
169
210
  pageUID: z.ZodString;
170
211
  }, "strip", z.ZodTypeAny, {
@@ -188,7 +229,15 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
188
229
  workspaceId: string;
189
230
  typeInternalName: string;
190
231
  alternativeLayoutName?: string | undefined;
191
- }>]>;
232
+ }>]>, {
233
+ type: "page";
234
+ pageUID: string;
235
+ } | {
236
+ type: "type";
237
+ workspaceId: string;
238
+ typeInternalName: string;
239
+ alternativeLayoutName?: string | undefined;
240
+ }, unknown>;
192
241
  readonly old_str: z.ZodString;
193
242
  readonly new_str: z.ZodString;
194
243
  readonly replace_all: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
@@ -1 +1 @@
1
- {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/tools/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAO5C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;IAW0F,CAAC;AAa3H,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+N1B,CAAC;AAYX,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QA2V7E"}
1
+ {"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/tools/layout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAe5C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAWgD,CAAC;AAajF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqO1B,CAAC;AAYX,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAqY7E"}