@cplace/mcp-server 1.16.0 → 2.1.0

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 (162) hide show
  1. package/README.md +37 -110
  2. package/dist/backend-capabilities.d.ts +15 -1
  3. package/dist/backend-capabilities.d.ts.map +1 -1
  4. package/dist/backend-capabilities.js +26 -1
  5. package/dist/backend-capabilities.js.map +1 -1
  6. package/dist/capability-gating.d.ts +35 -0
  7. package/dist/capability-gating.d.ts.map +1 -0
  8. package/dist/capability-gating.js +169 -0
  9. package/dist/capability-gating.js.map +1 -0
  10. package/dist/index.js +88 -41
  11. package/dist/index.js.map +1 -1
  12. package/dist/lint-on-write.d.ts +14 -0
  13. package/dist/lint-on-write.d.ts.map +1 -0
  14. package/dist/lint-on-write.js +29 -0
  15. package/dist/lint-on-write.js.map +1 -0
  16. package/dist/plugin-registry.d.ts +1 -1
  17. package/dist/plugin-registry.d.ts.map +1 -1
  18. package/dist/plugin-registry.js +28 -13
  19. package/dist/plugin-registry.js.map +1 -1
  20. package/dist/plugins/core/widget-specifications/cf.cplace.platform.tableWidget/search.md +10 -0
  21. package/dist/plugins/core/widget-specifications/cf.platform.connectedBarChart/search.md +6 -0
  22. package/dist/plugins/core/widget-specifications/cf.platform.connectedPieChart/search.md +6 -0
  23. package/dist/plugins/core/widget-specifications/cf.platform.embeddedSearchAsList/search.md +6 -0
  24. package/dist/plugins/core/widget-specifications/cf.platform.embeddedSearchAsTable/search.md +6 -0
  25. package/dist/plugins/low-code.d.ts.map +1 -1
  26. package/dist/plugins/low-code.js +5 -0
  27. package/dist/plugins/low-code.js.map +1 -1
  28. package/dist/searchConversion.d.ts +6 -0
  29. package/dist/searchConversion.d.ts.map +1 -1
  30. package/dist/searchConversion.js +219 -132
  31. package/dist/searchConversion.js.map +1 -1
  32. package/dist/searchEditorShape.d.ts +10 -0
  33. package/dist/searchEditorShape.d.ts.map +1 -0
  34. package/dist/searchEditorShape.js +103 -0
  35. package/dist/searchEditorShape.js.map +1 -0
  36. package/dist/searchSchema.d.ts +119 -119
  37. package/dist/searchSchema.d.ts.map +1 -1
  38. package/dist/searchSchema.js +102 -50
  39. package/dist/searchSchema.js.map +1 -1
  40. package/dist/session-responses.d.ts +23 -0
  41. package/dist/session-responses.d.ts.map +1 -0
  42. package/dist/session-responses.js +17 -0
  43. package/dist/session-responses.js.map +1 -0
  44. package/dist/strict-schemas.d.ts +8 -0
  45. package/dist/strict-schemas.d.ts.map +1 -0
  46. package/dist/strict-schemas.js +202 -0
  47. package/dist/strict-schemas.js.map +1 -0
  48. package/dist/tools/app-configuration.d.ts +1 -0
  49. package/dist/tools/app-configuration.d.ts.map +1 -1
  50. package/dist/tools/app-configuration.js +1 -0
  51. package/dist/tools/app-configuration.js.map +1 -1
  52. package/dist/tools/apps-catalog.d.ts.map +1 -1
  53. package/dist/tools/apps-catalog.js +11 -5
  54. package/dist/tools/apps-catalog.js.map +1 -1
  55. package/dist/tools/change-listeners.d.ts +2 -0
  56. package/dist/tools/change-listeners.d.ts.map +1 -1
  57. package/dist/tools/change-listeners.js +42 -16
  58. package/dist/tools/change-listeners.js.map +1 -1
  59. package/dist/tools/common-schemas.d.ts +5 -0
  60. package/dist/tools/common-schemas.d.ts.map +1 -1
  61. package/dist/tools/common-schemas.js +13 -0
  62. package/dist/tools/common-schemas.js.map +1 -1
  63. package/dist/tools/csv-export.d.ts +122 -119
  64. package/dist/tools/csv-export.d.ts.map +1 -1
  65. package/dist/tools/csv-export.js +17 -2
  66. package/dist/tools/csv-export.js.map +1 -1
  67. package/dist/tools/enum-providers.d.ts.map +1 -1
  68. package/dist/tools/enum-providers.js +21 -7
  69. package/dist/tools/enum-providers.js.map +1 -1
  70. package/dist/tools/get-operations.d.ts +1 -1
  71. package/dist/tools/get-operations.d.ts.map +1 -1
  72. package/dist/tools/get-operations.js +3 -1
  73. package/dist/tools/get-operations.js.map +1 -1
  74. package/dist/tools/job-scripts.d.ts.map +1 -1
  75. package/dist/tools/job-scripts.js +19 -11
  76. package/dist/tools/job-scripts.js.map +1 -1
  77. package/dist/tools/layout-richstring-widgets.d.ts +2 -2
  78. package/dist/tools/layout-richstring-widgets.d.ts.map +1 -1
  79. package/dist/tools/layout-richstring-widgets.js +16 -6
  80. package/dist/tools/layout-richstring-widgets.js.map +1 -1
  81. package/dist/tools/layout.d.ts +115 -2
  82. package/dist/tools/layout.d.ts.map +1 -1
  83. package/dist/tools/layout.js +39 -14
  84. package/dist/tools/layout.js.map +1 -1
  85. package/dist/tools/linting.d.ts +1 -1
  86. package/dist/tools/linting.js +1 -1
  87. package/dist/tools/linting.js.map +1 -1
  88. package/dist/tools/page-action-simulation.d.ts +51 -1
  89. package/dist/tools/page-action-simulation.d.ts.map +1 -1
  90. package/dist/tools/page-action-simulation.js +2 -2
  91. package/dist/tools/page-action-simulation.js.map +1 -1
  92. package/dist/tools/page-actions.d.ts.map +1 -1
  93. package/dist/tools/page-actions.js +19 -11
  94. package/dist/tools/page-actions.js.map +1 -1
  95. package/dist/tools/pages.d.ts +3 -3
  96. package/dist/tools/pages.d.ts.map +1 -1
  97. package/dist/tools/pages.js +54 -15
  98. package/dist/tools/pages.js.map +1 -1
  99. package/dist/tools/ppt-export-schemas.d.ts +6 -6
  100. package/dist/tools/ppt-export.d.ts +4 -4
  101. package/dist/tools/profile-management.d.ts +4 -0
  102. package/dist/tools/profile-management.d.ts.map +1 -1
  103. package/dist/tools/profile-management.js +6 -4
  104. package/dist/tools/profile-management.js.map +1 -1
  105. package/dist/tools/resource-planner-widget.d.ts +4 -4
  106. package/dist/tools/richstring-widgets.js +3 -3
  107. package/dist/tools/richstring-widgets.js.map +1 -1
  108. package/dist/tools/script.d.ts +25 -2
  109. package/dist/tools/script.d.ts.map +1 -1
  110. package/dist/tools/script.js +5 -4
  111. package/dist/tools/script.js.map +1 -1
  112. package/dist/tools/search.d.ts +142 -122
  113. package/dist/tools/search.d.ts.map +1 -1
  114. package/dist/tools/search.js +71 -23
  115. package/dist/tools/search.js.map +1 -1
  116. package/dist/tools/system.d.ts +2 -1
  117. package/dist/tools/system.d.ts.map +1 -1
  118. package/dist/tools/system.js +2 -2
  119. package/dist/tools/system.js.map +1 -1
  120. package/dist/tools/type-management.d.ts +15 -14
  121. package/dist/tools/type-management.d.ts.map +1 -1
  122. package/dist/tools/type-management.js +168 -51
  123. package/dist/tools/type-management.js.map +1 -1
  124. package/dist/tools/validators.d.ts +1 -1
  125. package/dist/tools/validators.d.ts.map +1 -1
  126. package/dist/tools/validators.js +24 -8
  127. package/dist/tools/validators.js.map +1 -1
  128. package/dist/tools/version-check.d.ts +3 -2
  129. package/dist/tools/version-check.d.ts.map +1 -1
  130. package/dist/tools/version-check.js +39 -101
  131. package/dist/tools/version-check.js.map +1 -1
  132. package/dist/tools/widget-simulation-legacy.d.ts +50 -0
  133. package/dist/tools/widget-simulation-legacy.d.ts.map +1 -0
  134. package/dist/tools/widget-simulation-legacy.js +99 -0
  135. package/dist/tools/widget-simulation-legacy.js.map +1 -0
  136. package/dist/tools/widget-simulation.d.ts +1 -0
  137. package/dist/tools/widget-simulation.d.ts.map +1 -1
  138. package/dist/tools/widget-simulation.js +3 -1
  139. package/dist/tools/widget-simulation.js.map +1 -1
  140. package/dist/tools/wizards.d.ts.map +1 -1
  141. package/dist/tools/wizards.js +3 -2
  142. package/dist/tools/wizards.js.map +1 -1
  143. package/dist/tools/workflow-execution.d.ts +1 -0
  144. package/dist/tools/workflow-execution.d.ts.map +1 -1
  145. package/dist/tools/workflow-execution.js +5 -1
  146. package/dist/tools/workflow-execution.js.map +1 -1
  147. package/dist/tools/workflow-scripts.d.ts +2 -2
  148. package/dist/tools/workflow-scripts.d.ts.map +1 -1
  149. package/dist/tools/workflow-scripts.js +21 -11
  150. package/dist/tools/workflow-scripts.js.map +1 -1
  151. package/dist/tools/workflow.d.ts +5 -2
  152. package/dist/tools/workflow.d.ts.map +1 -1
  153. package/dist/tools/workflow.js +26 -3
  154. package/dist/tools/workflow.js.map +1 -1
  155. package/dist/tools/workspace-core.d.ts +3 -2
  156. package/dist/tools/workspace-core.d.ts.map +1 -1
  157. package/dist/tools/workspace-core.js +26 -8
  158. package/dist/tools/workspace-core.js.map +1 -1
  159. package/dist/utils.d.ts.map +1 -1
  160. package/dist/utils.js +17 -0
  161. package/dist/utils.js.map +1 -1
  162. package/package.json +4 -4
@@ -1,6 +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
+ import { type Guard } from '../capability-gating.js';
4
5
  export declare const LayoutContextSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
5
6
  type: z.ZodLiteral<"page">;
6
7
  pageUID: z.ZodString;
@@ -37,7 +38,103 @@ export declare const LayoutContextSchema: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
37
38
  export type LayoutContext = z.infer<typeof LayoutContextSchema>;
38
39
  export declare const LAYOUT_TOOL_DEFINITIONS: {
39
40
  readonly cplace_execute_layout_script: {
40
- 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 be one of the layout templates (listed in the script parameter description)\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- ID PRESERVATION: edit verbs (updateWidget/addWidget/removeWidget/moveWidget/addRow/compact) look widgets up by id and mutate in place — they PRESERVE the IDs of every widget you don't touch. This is the only safe path for cross-referenced widgets (e.g. a Low-Code Button's tableWidgetId). By contrast, layout.define — and cplace_edit_layout, which round-trips through layout.define — REGENERATES every widget id.\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: column proportions that are not a layout template\n- Widget errors: unknown widget types, invalid configurations\n- Property value errors: a widget property value outside its allowed domain (e.g. a heading `size` other than h1-h6) is rejected — for top-level layout widgets and for embedded <decoded-widget> properties alike. Only the property names you submit are checked; omitted required properties are reported as warnings, not errors.\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\nON A SyntaxError / SCRIPT ERROR: the response carries the parser message with a caret (^) under the\noffending token. Correct THAT line before re-submitting — never resend the identical script,\nincluding after a \"Session expired\" reconnect. A blind retry reproduces the same error.\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 <decoded-widget id=\"id_w1\" type=\"cf.platform.singleAttribute\">{\"properties\":{\"attribute\":\"name\"}}</decoded-widget>\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 on cplace_richstring_* tools; NOT checked on layout-script and page writes, which treat richstring markup as fully-replaced client-authored text\n\nRaw base64 <embeddedwidget>BASE64</embeddedwidget> tags are REJECTED on writes.\nFetch current decoded form via cplace_get_layout_script.\n\nIMPORTANT: Decoded <decoded-widget> 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: '<decoded-widget type=\"...\">...</decoded-widget>' });\n ❌ var tag = '<decoded-widget ...>...</decoded-widget>'; layout.updateWidget(\"id\", { content: tag });\n\nEMBEDDED WIDGET SCRIPT ATTRIBUTES — PLACEHOLDER WORKFLOW (REQUIRED):\nFor script-typed attributes on embedded widgets (e.g. cf.cplace.lowCodeWidgets.lowCodeTextWidget.script),\ninitialize the value to a minimal placeholder body inside the inline <decoded-widget> JSON, then fill the\nreal script body afterward via cplace_richstring_set_widget_script (full replace) or\ncplace_richstring_edit_widget_script (str-replace diff). Authoring a non-trivial script body inline\nforces it through four nested encoding layers (HTML → JSON → JS string literal → MCP wire) and is a\ndocumented source of escape-bug churn — the dedicated tools take the script as a plain string in a\nstructured argument and avoid all four layers.\n\nSafe placeholder for cf.cplace.lowCodeWidgets.lowCodeText: return '';\nOther script-bearing widget types: pick any runtime-valid placeholder for that widget.\n\nNon-script attributes (strings, numbers, references, lists) do NOT have this problem and are authored\ninline as normal JSON properties on the <decoded-widget> tag.\n\nFor atomic single-embedded-widget edits without rewriting the full script,\nsee cplace_layout_richstring_* and cplace_richstring_*_widget_script tools.";
41
+ readonly description: `Execute a layout script \u2014 either a full layout.define() replacement or per-widget edit verbs.
42
+
43
+ TWO MODES (determined by script content):
44
+
45
+ MODE 1 \u2014 FULL REPLACE (layout.define):
46
+ - Script calls layout.define() exactly once to declare the complete layout structure
47
+ - Replaces the entire layout atomically
48
+ - Same behavior as before
49
+ ${string}
50
+ MODE 2 \u2014 EDIT VERBS (per-widget):
51
+ - Script calls one or more edit methods: layout.updateWidget(), layout.addWidget(), layout.removeWidget()${string}
52
+ - Each call collects an operation; all operations commit atomically or fail together
53
+ - Cannot mix layout.define() with edit verbs in the same script
54
+
55
+ EDIT VERBS:
56
+ layout.updateWidget("widgetId", { "cf.cplace.x": newValue }) \u2014 partial config merge (only specified keys change)
57
+ layout.addWidget({ widgetType: "cf.platform.wiki", position: { rowIndex: 0, columnIndex: 0, widgetIndex: 0 }, configuration: { ... } })
58
+ layout.removeWidget("widgetId")${string}
59
+ ${string}
60
+ WORKFLOW for per-widget edit:
61
+ 1. Read: cplace_get_layout_script with widgetIds to get layout.updateWidget() fragments
62
+ 2. Edit: modify the config values in the fragment
63
+ 3. Execute: post the modified script via this tool
64
+
65
+ KEY BEHAVIORS (for layout.define mode):
66
+ - The script must call layout.define() exactly once
67
+ - The entire layout is atomically replaced \u2014 previous layout is fully overwritten
68
+ - Script timeout: 30 seconds
69
+ - 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.
70
+ - ID PRESERVATION: edit verbs (updateWidget/addWidget/removeWidget${string}) look widgets up by id and mutate in place \u2014 they PRESERVE the IDs of every widget you don't touch. This is the only safe path for cross-referenced widgets (e.g. a Low-Code Button's tableWidgetId). By contrast, layout.define \u2014 and cplace_edit_layout, which round-trips through layout.define \u2014 REGENERATES every widget id.
71
+
72
+ RESPONSE OUTCOMES:
73
+ - VALID_COMPLETE: Layout saved, all widgets fully configured
74
+ - VALID_INCOMPLETE: Layout saved, but some widgets have missing optional configuration (warnings returned)
75
+ ${string}${string}- Validation errors: Layout NOT saved \u2014 structural or widget errors returned with details
76
+ - Generic errors: Entity not found, permission denied, script errors
77
+
78
+ VALIDATION FEEDBACK:
79
+ - Structural errors: column proportions that are not a layout template
80
+ - Widget errors: unknown widget types, invalid configurations
81
+ - Property value errors: a widget property value outside its allowed domain (e.g. a heading \`size\` other than h1-h6) is rejected${string}${string}${string} Only the property names you submit are checked; omitted required properties are reported as warnings, not errors.
82
+ - Warnings: widgets saved but missing optional configuration (e.g., search filter not set)
83
+
84
+ TIP: After a VALID_INCOMPLETE response, ${string}re-run layout.define() with corrected widget configuration to resolve warnings.
85
+
86
+ ON A SyntaxError / SCRIPT ERROR: the response carries the parser message with a caret (^) under the
87
+ offending token. Correct THAT line before re-submitting \u2014 never resend the identical script,
88
+ including after a "Session expired" reconnect. A blind retry reproduces the same error.
89
+
90
+ COMMON WIDGET TYPES (platform, always available):
91
+ cf.platform.attributes, cf.cplace.platform.attributesGroup,
92
+ cf.platform.wiki, cf.platform.richString, cf.cplace.demoWidgets.demoRichString,
93
+ cf.platform.embeddedSearchAsTable, cf.cplace.platform.tableWidget,
94
+ cf.platform.connectedBarChart, cf.platform.connectedPieChart,
95
+ cf.platform.connectedMatrix, cf.platform.connectedTableFilter,
96
+ cf.platform.incomingReferences, cf.platform.comments, cf.platform.files,
97
+ cf.cplace.visualizations.scriptingHighcharts
98
+
99
+ For app-dependent widgets not in this list, call cplace_list_widget_definitions with embeddingContext "AS_WIDGET".
100
+
101
+ RICHSTRING WIDGETS AND EMBEDDED WIDGETS (decoded form):
102
+ RichString widgets (cf.platform.richString, cf.cplace.demoWidgets.demoRichString)
103
+ hold HTML in their 'content' config. Embedded widgets inside that HTML are
104
+ expressed in decoded form:
105
+ <decoded-widget id="id_w1" type="cf.platform.singleAttribute">{"properties":{"attribute":"name"}}</decoded-widget>
106
+
107
+ Semantics when submitting a script:
108
+ \u2022 Tag with an existing id + same type \u2192 update (properties replace current)
109
+ \u2022 Tag without id \u2192 insert new embedded widget (backend assigns id)
110
+ \u2022 Existing id omitted from new content \u2192 delete
111
+ \u2022 Unknown id, duplicate id, or type change for same id \u2192 error on cplace_richstring_* tools; NOT checked on layout-script and page writes, which treat richstring markup as fully-replaced client-authored text
112
+
113
+ Raw base64 <embeddedwidget>BASE64</embeddedwidget> tags are REJECTED on writes.
114
+ Fetch current decoded form via cplace_get_layout_script.
115
+
116
+ IMPORTANT: Decoded <decoded-widget> tags must appear directly inline in a content: value.
117
+ Do NOT build the tag in a variable and pass it \u2014 the parser rejects tags outside content: literals.
118
+ \u2705 layout.updateWidget("id", { content: '<decoded-widget type="...">...</decoded-widget>' });
119
+ \u274C var tag = '<decoded-widget ...>...</decoded-widget>'; layout.updateWidget("id", { content: tag });
120
+
121
+ EMBEDDED WIDGET SCRIPT ATTRIBUTES \u2014 PLACEHOLDER WORKFLOW (REQUIRED):
122
+ For script-typed attributes on embedded widgets (e.g. cf.cplace.lowCodeWidgets.lowCodeTextWidget.script),
123
+ initialize the value to a minimal placeholder body inside the inline <decoded-widget> JSON, then fill the
124
+ real script body afterward via cplace_richstring_set_widget_script (full replace) or
125
+ cplace_richstring_edit_widget_script (str-replace diff). Authoring a non-trivial script body inline
126
+ forces it through four nested encoding layers (HTML \u2192 JSON \u2192 JS string literal \u2192 MCP wire) and is a
127
+ documented source of escape-bug churn \u2014 the dedicated tools take the script as a plain string in a
128
+ structured argument and avoid all four layers.
129
+
130
+ Safe placeholder for cf.cplace.lowCodeWidgets.lowCodeText: return '';
131
+ Other script-bearing widget types: pick any runtime-valid placeholder for that widget.
132
+
133
+ Non-script attributes (strings, numbers, references, lists) do NOT have this problem and are authored
134
+ inline as normal JSON properties on the <decoded-widget> tag.
135
+
136
+ For atomic single-embedded-widget edits without rewriting the full script,
137
+ see cplace_layout_richstring_* and cplace_richstring_*_widget_script tools.`;
41
138
  readonly inputSchema: {
42
139
  readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
43
140
  type: z.ZodLiteral<"page">;
@@ -77,6 +174,7 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
77
174
  readonly annotations: {
78
175
  readonly title: "Execute Layout Script";
79
176
  };
177
+ readonly guards: readonly [Guard];
80
178
  };
81
179
  readonly cplace_get_layout_overview: {
82
180
  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.";
@@ -162,7 +260,22 @@ export declare const LAYOUT_TOOL_DEFINITIONS: {
162
260
  };
163
261
  };
164
262
  readonly cplace_get_layout_script: {
165
- 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 <decoded-widget id=\"…\" type=\"…\">{\"properties\":{…}}</decoded-widget>\nThe output is directly executable — base64 tags are never emitted.";
263
+ readonly description: `Get the current layout as an executable script for a page or type layout.
264
+
265
+ TWO MODES (determined by widgetIds parameter):
266
+
267
+ WITHOUT widgetIds: Returns the full layout as a layout.define({...}) script (same as before).
268
+
269
+ WITH widgetIds: Returns layout.updateWidget("id", {config}) fragments for just the specified widgets.
270
+ ${string}${string}
271
+ ROUND-TRIP WORKFLOW:
272
+ 1. GET: Use this tool (with widgetIds for selective read, without for full layout)
273
+ 2. EDIT: Modify the script as needed
274
+ 3. APPLY: Use cplace_execute_layout_script to apply
275
+
276
+ RichString widget content is returned in decoded form:
277
+ <decoded-widget id="\u2026" type="\u2026">{"properties":{\u2026}}</decoded-widget>
278
+ The output is directly executable \u2014 base64 tags are never emitted.`;
166
279
  readonly inputSchema: {
167
280
  readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
168
281
  type: z.ZodLiteral<"page">;
@@ -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;AAe5C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAe/B,CAAC;AAGF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAUhE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoT1B,CAAC;AAYX,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAgf7E"}
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;AAa5C,OAAO,EAA+B,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGlF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAe/B,CAAC;AAGF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAkEhE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsU1B,CAAC;AAYX,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAgf7E"}
@@ -3,7 +3,8 @@ import { debugLogWithTag } from '../logger.js';
3
3
  import { checkResponseSize } from '../utils.js';
4
4
  import { applyStrReplace } from '../str-replace-utils.js';
5
5
  import { determineApiEndpoint, buildRequestParams, findWidgetById, extractWidgetIdSummary, buildStaleIdErrorResponse, } from './widget-tool-helpers.js';
6
- import { jsonStringToObject } from './common-schemas.js';
6
+ import { DECODED_WIDGET_SEARCH_FILTER_NOTE, jsonStringToObject } from './common-schemas.js';
7
+ import { backendName, ifCap, ifNoCap } from '../capability-gating.js';
7
8
  export const LayoutContextSchema = jsonStringToObject(z
8
9
  .union([
9
10
  z.object({
@@ -18,11 +19,32 @@ export const LayoutContextSchema = jsonStringToObject(z
18
19
  }),
19
20
  ])
20
21
  .describe('Layout target - specify whether operating on page or type layout'));
22
+ const withInheritedWidgetVerbs = (text) => ifCap('layout.keep-inherited-widgets', text);
23
+ const REMOVE_UNKNOWN_ID_FAILS = 'layout.remove-unknown-id-fails';
24
+ const REMOVE_UNKNOWN_ID_NOTE = ifCap(REMOVE_UNKNOWN_ID_FAILS, ' — an id that matches no widget fails the whole script; nothing is saved') +
25
+ ifNoCap(REMOVE_UNKNOWN_ID_FAILS, ' — on this backend, an id that matches no widget reports success and removes nothing. Take ids from a ' +
26
+ 'layout read made before the script (cplace_get_layout_overview), and report a widget as removed only ' +
27
+ 'if that read listed it');
28
+ const PAGE_ROWS_BY_DEFINE_NOTE = 'On this backend a page that inherits its layout gets new rows only through a full layout.define() ' +
29
+ 'that re-declares the inherited widgets, which regenerates every widget id.';
30
+ const INHERITED_WIDGET_VERBS = /\blayout\.(addRow|moveWidget|compact)\s*\(/;
31
+ const KEEP_INHERITED_WIDGETS_GUARD = {
32
+ capability: 'layout.keep-inherited-widgets',
33
+ refuse(args, backend) {
34
+ if (args.context?.type !== 'page' || !INHERITED_WIDGET_VERBS.test(args.script ?? '')) {
35
+ return undefined;
36
+ }
37
+ return (`${backendName(backend)} drops a page's inherited widgets on addRow, moveWidget and compact, ` +
38
+ 'and still reports success. Use updateWidget, addWidget and removeWidget, edit the type layout ' +
39
+ 'instead, or upgrade the backend.');
40
+ },
41
+ };
21
42
  const TOOL_EXECUTE_LAYOUT_SCRIPT = 'cplace_execute_layout_script';
22
43
  const TOOL_GET_LAYOUT_OVERVIEW = 'cplace_get_layout_overview';
23
44
  const TOOL_GET_LAYOUT_WIDGET_DETAILS = 'cplace_get_layout_widget_details';
24
45
  const TOOL_GET_LAYOUT_SCRIPT = 'cplace_get_layout_script';
25
46
  const TOOL_EDIT_LAYOUT = 'cplace_edit_layout';
47
+ const SCRIPT_KEEPS_WIDGET_IDS = 'layout.script-keeps-widget-ids';
26
48
  export const LAYOUT_TOOL_DEFINITIONS = {
27
49
  [TOOL_EXECUTE_LAYOUT_SCRIPT]: {
28
50
  description: `Execute a layout script — either a full layout.define() replacement or per-widget edit verbs.
@@ -33,20 +55,20 @@ MODE 1 — FULL REPLACE (layout.define):
33
55
  - Script calls layout.define() exactly once to declare the complete layout structure
34
56
  - Replaces the entire layout atomically
35
57
  - Same behavior as before
36
-
58
+ ${ifNoCap('layout.keep-inherited-widgets', `- ${PAGE_ROWS_BY_DEFINE_NOTE}\n`)}
37
59
  MODE 2 — EDIT VERBS (per-widget):
38
- - Script calls one or more edit methods: layout.updateWidget(), layout.addWidget(), layout.removeWidget(), layout.moveWidget(), layout.addRow(), layout.compact()
60
+ - Script calls one or more edit methods: layout.updateWidget(), layout.addWidget(), layout.removeWidget()${withInheritedWidgetVerbs(', layout.moveWidget(), layout.addRow(), layout.compact()')}
39
61
  - Each call collects an operation; all operations commit atomically or fail together
40
62
  - Cannot mix layout.define() with edit verbs in the same script
41
63
 
42
64
  EDIT VERBS:
43
65
  layout.updateWidget("widgetId", { "cf.cplace.x": newValue }) — partial config merge (only specified keys change)
44
66
  layout.addWidget({ widgetType: "cf.platform.wiki", position: { rowIndex: 0, columnIndex: 0, widgetIndex: 0 }, configuration: { ... } })
45
- layout.removeWidget("widgetId")
46
- layout.moveWidget("widgetId", { rowIndex: 1, columnIndex: 0, widgetIndex: 0 })
67
+ layout.removeWidget("widgetId")${REMOVE_UNKNOWN_ID_NOTE}
68
+ ${withInheritedWidgetVerbs(` layout.moveWidget("widgetId", { rowIndex: 1, columnIndex: 0, widgetIndex: 0 })
47
69
  layout.addRow(rowIndex, [6, 6]) — column proportions must be one of the layout templates (listed in the script parameter description)
48
70
  layout.compact() — remove empty rows
49
-
71
+ `)}
50
72
  WORKFLOW for per-widget edit:
51
73
  1. Read: cplace_get_layout_script with widgetIds to get layout.updateWidget() fragments
52
74
  2. Edit: modify the config values in the fragment
@@ -57,21 +79,24 @@ KEY BEHAVIORS (for layout.define mode):
57
79
  - The entire layout is atomically replaced — previous layout is fully overwritten
58
80
  - Script timeout: 30 seconds
59
81
  - 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.
60
- - ID PRESERVATION: edit verbs (updateWidget/addWidget/removeWidget/moveWidget/addRow/compact) look widgets up by id and mutate in place — they PRESERVE the IDs of every widget you don't touch. This is the only safe path for cross-referenced widgets (e.g. a Low-Code Button's tableWidgetId). By contrast, layout.define — and cplace_edit_layout, which round-trips through layout.define — REGENERATES every widget id.
82
+ - ID PRESERVATION: edit verbs (updateWidget/addWidget/removeWidget${withInheritedWidgetVerbs('/moveWidget/addRow/compact')}) look widgets up by id and mutate in place — they PRESERVE the IDs of every widget you don't touch. This is the only safe path for cross-referenced widgets (e.g. a Low-Code Button's tableWidgetId). By contrast, layout.define — and cplace_edit_layout, which round-trips through layout.define — REGENERATES every widget id.
61
83
 
62
84
  RESPONSE OUTCOMES:
63
85
  - VALID_COMPLETE: Layout saved, all widgets fully configured
64
86
  - VALID_INCOMPLETE: Layout saved, but some widgets have missing optional configuration (warnings returned)
65
- - Validation errors: Layout NOT saved — structural or widget errors returned with details
87
+ ${ifCap('layout.validation-warnings', `- Edit verbs report the same way: validationWarnings list each widget they added or updated that still has warnings.
88
+ - A search filter the platform cannot parse (e.g. {"uids": [...]}, where the key is "uid") is saved but skipped when the search runs. The warning names it. If no filter is left, the widget shows no rows.
89
+ `)}${ifNoCap('layout.validation-warnings', `- On this backend, layout.updateWidget() and layout.addWidget() always answer VALID_COMPLETE, and a search filter the platform cannot parse is not reported: it is saved and skipped when the search runs.
90
+ `)}- Validation errors: Layout NOT saved — structural or widget errors returned with details
66
91
  - Generic errors: Entity not found, permission denied, script errors
67
92
 
68
93
  VALIDATION FEEDBACK:
69
94
  - Structural errors: column proportions that are not a layout template
70
95
  - Widget errors: unknown widget types, invalid configurations
71
- - Property value errors: a widget property value outside its allowed domain (e.g. a heading \`size\` other than h1-h6) is rejected — for top-level layout widgets and for embedded <decoded-widget> properties alike. Only the property names you submit are checked; omitted required properties are reported as warnings, not errors.
96
+ - Property value errors: a widget property value outside its allowed domain (e.g. a heading \`size\` other than h1-h6) is rejected${ifCap('decoded-widget.property-values-validated', ' — for top-level layout widgets and for embedded <decoded-widget> properties alike.')}${ifNoCap('decoded-widget.property-values-validated', ' for top-level layout widgets. On this backend an embedded <decoded-widget> property value is not checked: an out-of-domain value is stored as given, and the call reports success. Read the widget back to confirm its properties.')}${DECODED_WIDGET_SEARCH_FILTER_NOTE} Only the property names you submit are checked; omitted required properties are reported as warnings, not errors.
72
97
  - Warnings: widgets saved but missing optional configuration (e.g., search filter not set)
73
98
 
74
- TIP: After a VALID_INCOMPLETE response, re-run layout.define() with corrected widget configuration to resolve warnings.
99
+ TIP: After a VALID_INCOMPLETE response, ${ifCap('layout.validation-warnings', 'fix the named widgets with layout.updateWidget(), or ')}re-run layout.define() with corrected widget configuration to resolve warnings.
75
100
 
76
101
  ON A SyntaxError / SCRIPT ERROR: the response carries the parser message with a caret (^) under the
77
102
  offending token. Correct THAT line before re-submitting — never resend the identical script,
@@ -161,10 +186,10 @@ EDIT VERBS — per-widget operations:
161
186
  layout.updateWidget("widgetId", { "configKey": newValue });
162
187
  layout.addWidget({ widgetType: "cf.platform.wiki", position: { rowIndex: 0, columnIndex: 0, widgetIndex: 0 } });
163
188
  layout.removeWidget("widgetId");
164
- layout.moveWidget("widgetId", { rowIndex: 1, columnIndex: 0, widgetIndex: 0 });
189
+ ${withInheritedWidgetVerbs(`layout.moveWidget("widgetId", { rowIndex: 1, columnIndex: 0, widgetIndex: 0 });
165
190
  layout.addRow(0, [6, 6]);
166
191
  layout.compact();
167
-
192
+ `)}
168
193
  COLUMN PROPORTIONS — LAYOUT TEMPLATES:
169
194
  A row's column proportions must be one of the 11 layout templates offered by the cplace layout
170
195
  editor's Templates list:
@@ -255,6 +280,7 @@ non-trivial script body inline forces it through four nested encoding layers and
255
280
  documented source of escape-bug churn.`),
256
281
  },
257
282
  annotations: { title: 'Execute Layout Script' },
283
+ guards: [KEEP_INHERITED_WIDGETS_GUARD],
258
284
  },
259
285
  [TOOL_GET_LAYOUT_OVERVIEW]: {
260
286
  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.',
@@ -279,8 +305,7 @@ TWO MODES (determined by widgetIds parameter):
279
305
  WITHOUT widgetIds: Returns the full layout as a layout.define({...}) script (same as before).
280
306
 
281
307
  WITH widgetIds: Returns layout.updateWidget("id", {config}) fragments for just the specified widgets.
282
- The output is directly executable — post it back via cplace_execute_layout_script.
283
-
308
+ ${ifCap(SCRIPT_KEEPS_WIDGET_IDS, 'The output is directly executable — post it back via cplace_execute_layout_script.\n')}${ifNoCap(SCRIPT_KEEPS_WIDGET_IDS, 'On this backend, the widget IDs in these fragments can be wrong. Before posting a fragment back via cplace_execute_layout_script, replace each widget ID with the ID from cplace_get_layout_overview.\n')}
284
309
  ROUND-TRIP WORKFLOW:
285
310
  1. GET: Use this tool (with widgetIds for selective read, without for full layout)
286
311
  2. EDIT: Modify the script as needed
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/tools/layout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,EAEtB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CACnD,CAAC;KACE,KAAK,CAAC;IACL,CAAC,CAAC,MAAM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C,CACF,CAAC;AACJ,CAAC"}
@@ -3,7 +3,7 @@ import { z } from 'zod';
3
3
  import { CplaceApiClient } from '../api.js';
4
4
  export declare const LINTING_TOOL_DEFINITIONS: {
5
5
  readonly cplace_lint_script: {
6
- readonly description: "Lint a cplace low-code script (change listener, validator, or workflow script) using the cplace ESLint rules. Returns errors and warnings. Does not modify the script. Use this to check script quality before or after saving. It reports unknown identifiers as errors: any name that is neither declared in the script nor a known cplace runtime global — a typo like `Filtres` instead of `Filters`, or a helper such as `updatePage` used without pasting its definition. Host globals that the cplace runtime does not provide, such as `console` and `setTimeout`, are reported the same way. This undefined-name check is a whitelist of names, not a type check: it does not know which globals a given script kind actually receives, and it does not verify that a member exists (`cplace.actions().updtaePage(...)` still passes), nor argument types or counts, nor that attribute or transition names exist. If a real cplace binding is missing from the whitelist, add `/* global myBinding */` at the top of the script to silence the false positive, and report the gap.";
6
+ readonly description: "Lint a cplace low-code script of any kind — change listener, validator, workflow, job, page action, enum provider or widget script — using the cplace ESLint rules. For a widget script, pass the inner body, not the JSON envelope. Returns errors and warnings. Does not modify the script. Script write tools already lint what they store and lead their response with a `Lint:` line, so a separate call is not needed after a save. Use this tool to review a script already on the server, for a script embedded through cplace_execute_layout_script, and when a write response shows no `Lint:` line (an older server). It reports unknown identifiers as errors: any name that is neither declared in the script nor a known cplace runtime global — a typo like `Filtres` instead of `Filters`, or a helper such as `updatePage` used without pasting its definition. Host globals that the cplace runtime does not provide, such as `console` and `setTimeout`, are reported the same way. This undefined-name check is a whitelist of names, not a type check: it does not know which globals a given script kind actually receives, and it does not verify that a member exists (`cplace.actions().updtaePage(...)` still passes), nor argument types or counts, nor that attribute or transition names exist. If a real cplace binding is missing from the whitelist, add `/* global myBinding */` at the top of the script to silence the false positive, and report the gap.";
7
7
  readonly inputSchema: {
8
8
  readonly script: z.ZodString;
9
9
  };
@@ -3,7 +3,7 @@ import { lintScript } from '../linter.js';
3
3
  const TOOL_LINT_SCRIPT = 'cplace_lint_script';
4
4
  export const LINTING_TOOL_DEFINITIONS = {
5
5
  [TOOL_LINT_SCRIPT]: {
6
- description: 'Lint a cplace low-code script (change listener, validator, or workflow script) using the cplace ESLint rules. Returns errors and warnings. Does not modify the script. Use this to check script quality before or after saving. It reports unknown identifiers as errors: any name that is neither declared in the script nor a known cplace runtime global — a typo like `Filtres` instead of `Filters`, or a helper such as `updatePage` used without pasting its definition. Host globals that the cplace runtime does not provide, such as `console` and `setTimeout`, are reported the same way. This undefined-name check is a whitelist of names, not a type check: it does not know which globals a given script kind actually receives, and it does not verify that a member exists (`cplace.actions().updtaePage(...)` still passes), nor argument types or counts, nor that attribute or transition names exist. If a real cplace binding is missing from the whitelist, add `/* global myBinding */` at the top of the script to silence the false positive, and report the gap.',
6
+ description: 'Lint a cplace low-code script of any kind — change listener, validator, workflow, job, page action, enum provider or widget script — using the cplace ESLint rules. For a widget script, pass the inner body, not the JSON envelope. Returns errors and warnings. Does not modify the script. Script write tools already lint what they store and lead their response with a `Lint:` line, so a separate call is not needed after a save. Use this tool to review a script already on the server, for a script embedded through cplace_execute_layout_script, and when a write response shows no `Lint:` line (an older server). It reports unknown identifiers as errors: any name that is neither declared in the script nor a known cplace runtime global — a typo like `Filtres` instead of `Filters`, or a helper such as `updatePage` used without pasting its definition. Host globals that the cplace runtime does not provide, such as `console` and `setTimeout`, are reported the same way. This undefined-name check is a whitelist of names, not a type check: it does not know which globals a given script kind actually receives, and it does not verify that a member exists (`cplace.actions().updtaePage(...)` still passes), nor argument types or counts, nor that attribute or transition names exist. If a real cplace binding is missing from the whitelist, add `/* global myBinding */` at the top of the script to silence the false positive, and report the gap.',
7
7
  inputSchema: {
8
8
  script: z.string().describe('The full JavaScript source code of the cplace script to lint'),
9
9
  },
@@ -1 +1 @@
1
- {"version":3,"file":"linting.js","sourceRoot":"","sources":["../../src/tools/linting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,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AAE,OAAwB;IAC9E,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB,wBAAwB,CAAC,gBAAgB,CAAC,EAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;QACnB,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;QAClC,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;SAC3D,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -3,7 +3,57 @@ import { z } from 'zod';
3
3
  import { CplaceApiClient } from '../api.js';
4
4
  export declare const PAGE_ACTION_SIMULATION_TOOL_DEFINITIONS: {
5
5
  readonly cplace_simulate_page_action: {
6
- readonly description: "Execute a page-action script under the production page-action engine context for pre-embed verification.\n\nThis tool runs the real two-phase page-action lifecycle from the cplace platform\n(`ExecutePageActionHandler`). The bindings, allowed type classes, and posture come\nfrom the platform's page-action script context — see `script-context-cards/page-action.md` and\n`best-practices/low-code/script-contexts.md`.\n\n**Script shape**: `script` must evaluate to an action object that exposes at least a\n`call` method (optionally a `checkAccess` method), exactly like a saved page action:\n```js\nreturn {\n checkAccess: function() { return true; }, // optional; false denies and skips call()\n call: function() {\n // write-enabled — persisting actions commit here\n cplace.actions('<plugin>').createPage({ name: '...', space: '...', customType: '...' });\n return 'ok';\n }\n};\n```\n\n**Two-phase lifecycle**:\n1. **Load (module level)** runs under `ServerMode.prohibitWriteAccess`. The object is\n evaluated here. A write or persisting action at module level **fails** — move it into\n `call()`. A missing `call` member is rejected.\n2. **checkAccess + call**. `checkAccess()` is honored: returning `false` reports access\n denial and `call()` is **not** run. `call()` then runs **write-enabled** — persisting\n actions (`createPage`, `deletePage`, …) **commit**. This requires low-code edit\n permission (`mayEditLowCode`); without it the call is denied.\n\nThe tool returns `call()`'s **raw value**. It does **not** reproduce the framework's\nreturn-object interpretation (`success` / `message` / `target` → URL / `job` → modal).\n**Timeout**: 30 seconds maximum execution time.\n\n**Injected bindings** (in addition to the baseline cplace API):\n- `page` — WrappedPage the action was invoked on\n- `embeddingPage` — WrappedPage hosting the action (aliased to `page` in this script context in production)\n- `messages` — CplaceJSTypeMessageProvider for the page's type (when one exists)\n\n**Allowed type classes**: `Search`, `Filters` (lowcode wrapper classes).\n**`cplace.actions(...)`**: enabled. Use it for any state-changing side effect (inside `call()`).\n\n**Writes are real**: a `call()` that persists commits to the dev instance. There is no\ndry-run/rollback mode.\n\n**Return Value Restrictions**: Same as cplace_execute_script (primitives and nested arrays/objects up to 3 levels; use JSON.stringify for deeper data).\n\n**When to use**: Before saving a page-action script, to verify the action object's\n`checkAccess`/`call` control flow against `page`, `embeddingPage`, and any\n`cplace.actions()` call. For other contexts (widget, change listener, validator, job,\nwizard, button widget) use the matching `cplace_simulate_*` tool — never\n`cplace_execute_script_write` for context-specific scripts.";
6
+ readonly description: `Execute a page-action script under the production page-action engine context for pre-embed verification.
7
+
8
+ This tool runs the real two-phase page-action lifecycle from the cplace platform
9
+ (\`ExecutePageActionHandler\`). The bindings, allowed type classes, and posture come
10
+ from the platform's page-action script context \u2014 see \`script-context-cards/page-action.md\` and
11
+ \`best-practices/low-code/script-contexts.md\`.
12
+
13
+ **Script shape**: \`script\` must evaluate to an action object that exposes at least a
14
+ \`call\` method (optionally a \`checkAccess\` method), exactly like a saved page action:
15
+ \`\`\`js
16
+ return {
17
+ checkAccess: function() { return true; }, // optional; false denies and skips call()
18
+ call: function() {
19
+ // write-enabled \u2014 persisting actions commit here
20
+ cplace.actions('<plugin>').createPage({ name: '...', space: '...', customType: '...' });
21
+ return 'ok';
22
+ }
23
+ };
24
+ \`\`\`
25
+
26
+ **Two-phase lifecycle**:
27
+ 1. **Load (module level)** runs under \`ServerMode.prohibitWriteAccess\`. The object is
28
+ evaluated here. A write or persisting action at module level **fails** \u2014 move it into
29
+ \`call()\`. A missing \`call\` member is rejected.
30
+ 2. **checkAccess + call**. \`checkAccess()\` is honored: returning \`false\` reports access
31
+ denial and \`call()\` is **not** run. \`call()\` then runs **write-enabled** \u2014 persisting
32
+ actions (\`createPage\`, \`deletePage\`, \u2026) **commit**. This requires low-code edit
33
+ permission (\`mayEditLowCode\`); without it the call is denied.
34
+
35
+ The tool returns \`call()\`'s **raw value**. It does **not** reproduce the framework's
36
+ return-object interpretation (\`success\` / \`message\` / \`target\` \u2192 URL / \`job\` \u2192 modal).
37
+ **Timeout**: 30 seconds maximum execution time.
38
+
39
+ **Injected bindings** (in addition to the baseline cplace API):
40
+ - \`page\` \u2014 WrappedPage the action was invoked on
41
+ - \`embeddingPage\` \u2014 WrappedPage hosting the action (aliased to \`page\` in this script context in production)
42
+ - \`messages\` \u2014 CplaceJSTypeMessageProvider for the page's type (when one exists)
43
+
44
+ **Allowed type classes**: \`Search\`, \`Filters\` (lowcode wrapper classes).
45
+ **\`cplace.actions(...)\`**: enabled. Use it for any state-changing side effect (inside \`call()\`).
46
+
47
+ **Writes are real**: a \`call()\` that persists commits to the dev instance. There is no
48
+ dry-run/rollback mode.
49
+
50
+ ${string}
51
+
52
+ **When to use**: Before saving a page-action script, to verify the action object's
53
+ \`checkAccess\`/\`call\` control flow against \`page\`, \`embeddingPage\`, and any
54
+ \`cplace.actions()\` call. For other contexts (widget, change listener, validator, job,
55
+ wizard, button widget) use the matching \`cplace_simulate_*\` tool \u2014 never
56
+ \`cplace_execute_script_write\` for context-specific scripts.`;
7
57
  readonly inputSchema: {
8
58
  readonly script: z.ZodString;
9
59
  readonly pageUID: z.ZodString;
@@ -1 +1 @@
1
- {"version":3,"file":"page-action-simulation.d.ts","sourceRoot":"","sources":["../../src/tools/page-action-simulation.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,uCAAuC;;;;;;;;;;;;CAyE1C,CAAC;AAEX,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAkE3F"}
1
+ {"version":3,"file":"page-action-simulation.d.ts","sourceRoot":"","sources":["../../src/tools/page-action-simulation.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,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyE1C,CAAC;AAEX,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAkE3F"}
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { debugLogWithTag } from '../logger.js';
3
3
  import { checkResponseSize } from '../utils.js';
4
- import { CPLACEJS_COMMON_API_CHEAT_SHEET } from './common-schemas.js';
4
+ import { CPLACEJS_COMMON_API_CHEAT_SHEET, SAME_RETURN_RESTRICTIONS } from './common-schemas.js';
5
5
  const TOOL_SIMULATE_PAGE_ACTION = 'cplace_simulate_page_action';
6
6
  export const PAGE_ACTION_SIMULATION_TOOL_DEFINITIONS = {
7
7
  [TOOL_SIMULATE_PAGE_ACTION]: {
@@ -49,7 +49,7 @@ return-object interpretation (\`success\` / \`message\` / \`target\` → URL / \
49
49
  **Writes are real**: a \`call()\` that persists commits to the dev instance. There is no
50
50
  dry-run/rollback mode.
51
51
 
52
- **Return Value Restrictions**: Same as cplace_execute_script (primitives and nested arrays/objects up to 3 levels; use JSON.stringify for deeper data).
52
+ ${SAME_RETURN_RESTRICTIONS}
53
53
 
54
54
  **When to use**: Before saving a page-action script, to verify the action object's
55
55
  \`checkAccess\`/\`call\` control flow against \`page\`, \`embeddingPage\`, and any
@@ -1 +1 @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I;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"page-actions.d.ts","sourceRoot":"","sources":["../../src/tools/page-actions.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;AAW5C,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqGhC,CAAC;AAEX,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAuRlF"}
1
+ {"version":3,"file":"page-actions.d.ts","sourceRoot":"","sources":["../../src/tools/page-actions.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;AAkB5C,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGhC,CAAC;AAEX,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAoSlF"}
@@ -1,12 +1,14 @@
1
1
  import { z } from 'zod';
2
2
  import { debugLogWithTag } from '../logger.js';
3
3
  import { applyStrReplace } from '../str-replace-utils.js';
4
+ import { formatLintSection, withLintSection, withoutScriptEcho } from '../lint-on-write.js';
4
5
  import { addPayloadIdsToScriptList, scriptPayloadId } from '../utils.js';
5
- import { CPLACEJS_COMMON_API_CHEAT_SHEET, SCRIPT_PAYLOAD_ID_NOTE } from './common-schemas.js';
6
+ import { CPLACEJS_COMMON_API_CHEAT_SHEET, LINT_ON_WRITE_NOTE, SCRIPT_PAYLOAD_ID_NOTE, } from './common-schemas.js';
6
7
  const TOOL_GET_PAGE_ACTIONS = 'cplace_get_page_actions';
7
8
  const TOOL_MANAGE_PAGE_ACTION = 'cplace_manage_page_action';
8
9
  const TOOL_EDIT_PAGE_ACTION = 'cplace_edit_page_action';
9
10
  const TOOL_DELETE_PAGE_ACTION = 'cplace_delete_page_action';
11
+ const LINT_FIX_HINT = `fix by diff with ${TOOL_EDIT_PAGE_ACTION}`;
10
12
  export const PAGE_ACTIONS_TOOL_DEFINITIONS = {
11
13
  [TOOL_GET_PAGE_ACTIONS]: {
12
14
  description: 'Get all page actions configured on a type. Page actions are low-code scripts attached to a type that users invoke from a page (buttons). Returns identifier, localized name, icon (FontAwesome), success message, enabled status, and script code for each action.' +
@@ -21,7 +23,8 @@ export const PAGE_ACTIONS_TOOL_DEFINITIONS = {
21
23
  },
22
24
  [TOOL_MANAGE_PAGE_ACTION]: {
23
25
  description: 'Create or update a page action on a type. Page actions are buttons on a page that invoke a low-code script when clicked. For create: workspaceId, typeInternalName, identifier, and script are required. For update: workspaceId, typeInternalName, and identifier are required; all other fields are optional. Identifier is immutable.' +
24
- SCRIPT_PAYLOAD_ID_NOTE,
26
+ SCRIPT_PAYLOAD_ID_NOTE +
27
+ LINT_ON_WRITE_NOTE,
25
28
  inputSchema: {
26
29
  operation: z
27
30
  .enum(['create', 'update'])
@@ -60,7 +63,8 @@ export const PAGE_ACTIONS_TOOL_DEFINITIONS = {
60
63
  },
61
64
  [TOOL_EDIT_PAGE_ACTION]: {
62
65
  description: "Edit a page action's script using str_replace — find an exact text match and replace it. Reads the current script, applies the replacement, and writes back. Use this instead of cplace_manage_page_action when making small changes to avoid reproducing the entire script." +
63
- SCRIPT_PAYLOAD_ID_NOTE,
66
+ SCRIPT_PAYLOAD_ID_NOTE +
67
+ LINT_ON_WRITE_NOTE,
64
68
  inputSchema: {
65
69
  workspaceId: z.string().describe("The workspace ID (e.g., 'abc123')"),
66
70
  typeInternalName: z
@@ -151,9 +155,11 @@ export function registerPageActionsTools(server, client) {
151
155
  const withPayloadId = result && typeof result.id === 'string'
152
156
  ? { ...result, payloadId: scriptPayloadId(result.id) }
153
157
  : result;
154
- return {
155
- content: [{ type: 'text', text: JSON.stringify(withPayloadId, null, 2) }],
156
- };
158
+ return withLintSection({
159
+ content: [
160
+ { type: 'text', text: JSON.stringify(withoutScriptEcho(withPayloadId), null, 2) },
161
+ ],
162
+ }, [formatLintSection(params.script, LINT_FIX_HINT)]);
157
163
  }
158
164
  else {
159
165
  const requestBody = {
@@ -183,9 +189,11 @@ export function registerPageActionsTools(server, client) {
183
189
  const withPayloadId = result && typeof result.id === 'string'
184
190
  ? { ...result, payloadId: scriptPayloadId(result.id) }
185
191
  : result;
186
- return {
187
- content: [{ type: 'text', text: JSON.stringify(withPayloadId, null, 2) }],
188
- };
192
+ return withLintSection({
193
+ content: [
194
+ { type: 'text', text: JSON.stringify(withoutScriptEcho(withPayloadId), null, 2) },
195
+ ],
196
+ }, params.script !== undefined ? [formatLintSection(params.script, LINT_FIX_HINT)] : []);
189
197
  }
190
198
  }
191
199
  catch (error) {
@@ -248,14 +256,14 @@ export function registerPageActionsTools(server, client) {
248
256
  const pullHint = typeof action.id === 'string'
249
257
  ? ` The local repo copy is now the stale pre-change version — pull it with: cplace-lowcode-cli get -f <file> -p ${scriptPayloadId(action.id)}`
250
258
  : '';
251
- return {
259
+ return withLintSection({
252
260
  content: [
253
261
  {
254
262
  type: 'text',
255
263
  text: `Successfully edited page action '${identifier}'. Replaced ${result.replacementCount} occurrence(s).${pullHint}`,
256
264
  },
257
265
  ],
258
- };
266
+ }, [formatLintSection(result.newContent, LINT_FIX_HINT)]);
259
267
  }
260
268
  catch (error) {
261
269
  debugLogWithTag('EDIT_PAGE_ACTION', `Error: ${error instanceof Error ? error.message : String(error)}`);