@cplace/test-mcp-server 0.1.15 → 1.0.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 (140) hide show
  1. package/README.md +248 -113
  2. package/dist/conditional-registration.d.ts.map +1 -1
  3. package/dist/conditional-registration.js +19 -3
  4. package/dist/conditional-registration.js.map +1 -1
  5. package/dist/index.js +21 -93
  6. package/dist/index.js.map +1 -1
  7. package/dist/preference-file.d.ts +16 -0
  8. package/dist/preference-file.d.ts.map +1 -0
  9. package/dist/preference-file.js +133 -0
  10. package/dist/preference-file.js.map +1 -0
  11. package/dist/profiles.d.ts +1 -3
  12. package/dist/profiles.d.ts.map +1 -1
  13. package/dist/profiles.js +60 -112
  14. package/dist/profiles.js.map +1 -1
  15. package/dist/searchConversion.d.ts.map +1 -1
  16. package/dist/searchConversion.js +18 -5
  17. package/dist/searchConversion.js.map +1 -1
  18. package/dist/searchSchema.d.ts +25 -25
  19. package/dist/searchSchema.d.ts.map +1 -1
  20. package/dist/searchSchema.js +5 -5
  21. package/dist/searchSchema.js.map +1 -1
  22. package/dist/token-hashing.d.ts +3 -0
  23. package/dist/token-hashing.d.ts.map +1 -0
  24. package/dist/token-hashing.js +18 -0
  25. package/dist/token-hashing.js.map +1 -0
  26. package/dist/tool-metadata.d.ts +2 -0
  27. package/dist/tool-metadata.d.ts.map +1 -0
  28. package/dist/tool-metadata.js +43 -0
  29. package/dist/tool-metadata.js.map +1 -0
  30. package/dist/tools/change-listeners.d.ts +30 -0
  31. package/dist/tools/change-listeners.d.ts.map +1 -1
  32. package/dist/tools/change-listeners.js +24 -18
  33. package/dist/tools/change-listeners.js.map +1 -1
  34. package/dist/tools/common-schemas.d.ts +2 -0
  35. package/dist/tools/common-schemas.d.ts.map +1 -1
  36. package/dist/tools/common-schemas.js +16 -0
  37. package/dist/tools/common-schemas.js.map +1 -1
  38. package/dist/tools/csv-export.d.ts +1849 -0
  39. package/dist/tools/csv-export.d.ts.map +1 -0
  40. package/dist/tools/csv-export.js +61 -0
  41. package/dist/tools/csv-export.js.map +1 -0
  42. package/dist/tools/generic-layouts.d.ts +302 -0
  43. package/dist/tools/generic-layouts.d.ts.map +1 -1
  44. package/dist/tools/generic-layouts.js +102 -70
  45. package/dist/tools/generic-layouts.js.map +1 -1
  46. package/dist/tools/get-operations.d.ts +16 -0
  47. package/dist/tools/get-operations.d.ts.map +1 -0
  48. package/dist/tools/get-operations.js +63 -0
  49. package/dist/tools/get-operations.js.map +1 -0
  50. package/dist/tools/pages.d.ts +55 -0
  51. package/dist/tools/pages.d.ts.map +1 -1
  52. package/dist/tools/pages.js +173 -257
  53. package/dist/tools/pages.js.map +1 -1
  54. package/dist/tools/ppt-export-schemas.d.ts +16 -16
  55. package/dist/tools/ppt-export.d.ts +1493 -0
  56. package/dist/tools/ppt-export.d.ts.map +1 -1
  57. package/dist/tools/ppt-export.js +23 -17
  58. package/dist/tools/ppt-export.js.map +1 -1
  59. package/dist/tools/profile-management.d.ts +20 -0
  60. package/dist/tools/profile-management.d.ts.map +1 -0
  61. package/dist/tools/profile-management.js +250 -0
  62. package/dist/tools/profile-management.js.map +1 -0
  63. package/dist/tools/references.d.ts +36 -0
  64. package/dist/tools/references.d.ts.map +1 -1
  65. package/dist/tools/references.js +48 -45
  66. package/dist/tools/references.js.map +1 -1
  67. package/dist/tools/richstring-widgets.d.ts +51 -0
  68. package/dist/tools/richstring-widgets.d.ts.map +1 -0
  69. package/dist/tools/richstring-widgets.js +173 -0
  70. package/dist/tools/richstring-widgets.js.map +1 -0
  71. package/dist/tools/schedule.d.ts +14 -0
  72. package/dist/tools/schedule.d.ts.map +1 -1
  73. package/dist/tools/schedule.js +7 -3
  74. package/dist/tools/schedule.js.map +1 -1
  75. package/dist/tools/script-logs.d.ts +29 -0
  76. package/dist/tools/script-logs.d.ts.map +1 -0
  77. package/dist/tools/script-logs.js +144 -0
  78. package/dist/tools/script-logs.js.map +1 -0
  79. package/dist/tools/search.d.ts +1870 -0
  80. package/dist/tools/search.d.ts.map +1 -1
  81. package/dist/tools/search.js +49 -75
  82. package/dist/tools/search.js.map +1 -1
  83. package/dist/tools/system.d.ts.map +1 -1
  84. package/dist/tools/system.js +4 -2
  85. package/dist/tools/system.js.map +1 -1
  86. package/dist/tools/type-layouts.d.ts +37 -0
  87. package/dist/tools/type-layouts.d.ts.map +1 -1
  88. package/dist/tools/type-layouts.js +30 -22
  89. package/dist/tools/type-layouts.js.map +1 -1
  90. package/dist/tools/type-management.d.ts +134 -0
  91. package/dist/tools/type-management.d.ts.map +1 -0
  92. package/dist/tools/{workspace.js → type-management.js} +67 -307
  93. package/dist/tools/type-management.js.map +1 -0
  94. package/dist/tools/users.d.ts +19 -0
  95. package/dist/tools/users.d.ts.map +1 -1
  96. package/dist/tools/users.js +14 -28
  97. package/dist/tools/users.js.map +1 -1
  98. package/dist/tools/validators.d.ts +28 -0
  99. package/dist/tools/validators.d.ts.map +1 -1
  100. package/dist/tools/validators.js +21 -15
  101. package/dist/tools/validators.js.map +1 -1
  102. package/dist/tools/version-check.d.ts.map +1 -1
  103. package/dist/tools/version-check.js +11 -9
  104. package/dist/tools/version-check.js.map +1 -1
  105. package/dist/tools/version-history.d.ts +48 -0
  106. package/dist/tools/version-history.d.ts.map +1 -1
  107. package/dist/tools/version-history.js +39 -29
  108. package/dist/tools/version-history.js.map +1 -1
  109. package/dist/tools/widgets.d.ts +182 -0
  110. package/dist/tools/widgets.d.ts.map +1 -1
  111. package/dist/tools/widgets.js +122 -343
  112. package/dist/tools/widgets.js.map +1 -1
  113. package/dist/tools/workflow-scripts.d.ts +40 -0
  114. package/dist/tools/workflow-scripts.d.ts.map +1 -0
  115. package/dist/tools/workflow-scripts.js +186 -0
  116. package/dist/tools/workflow-scripts.js.map +1 -0
  117. package/dist/tools/workflow.d.ts +70 -0
  118. package/dist/tools/workflow.d.ts.map +1 -0
  119. package/dist/tools/workflow.js +259 -0
  120. package/dist/tools/workflow.js.map +1 -0
  121. package/dist/tools/workspace-admin.d.ts +40 -0
  122. package/dist/tools/workspace-admin.d.ts.map +1 -0
  123. package/dist/tools/workspace-admin.js +125 -0
  124. package/dist/tools/workspace-admin.js.map +1 -0
  125. package/dist/tools/workspace-core.d.ts +45 -0
  126. package/dist/tools/workspace-core.d.ts.map +1 -0
  127. package/dist/tools/workspace-core.js +153 -0
  128. package/dist/tools/workspace-core.js.map +1 -0
  129. package/dist/types.d.ts +3 -3
  130. package/dist/types.d.ts.map +1 -1
  131. package/dist/utils/dateValidation.d.ts +5 -0
  132. package/dist/utils/dateValidation.d.ts.map +1 -0
  133. package/dist/utils/dateValidation.js +57 -0
  134. package/dist/utils/dateValidation.js.map +1 -0
  135. package/dist/utils.js +7 -7
  136. package/dist/utils.js.map +1 -1
  137. package/package.json +1 -1
  138. package/dist/tools/workspace.d.ts +0 -4
  139. package/dist/tools/workspace.d.ts.map +0 -1
  140. package/dist/tools/workspace.js.map +0 -1
@@ -1,150 +1,14 @@
1
1
  import { z } from "zod";
2
2
  import { debugLogWithTag } from "../logger.js";
3
- import { transformMultiplicityToBoolean, checkResponseSize } from '../utils.js';
4
- export function registerWorkspaceTools(server, client) {
5
- server.registerTool("cplace_list_workspaces", {
6
- description: "Get a list of all workspaces with essential properties (id, name, displayName, totalPages, isFavorite, installed apps)",
7
- inputSchema: {
8
- limit: z.number().min(1).max(100).optional().describe("Maximum number of workspaces to return (1-100). If not provided, returns all workspaces."),
9
- offset: z.number().min(0).default(0).describe("Number of workspaces to skip for pagination")
10
- },
11
- annotations: { title: "List Workspaces" }
12
- }, async ({ limit, offset = 0 }) => {
13
- debugLogWithTag('WORKSPACES', 'Starting workspace list request');
14
- try {
15
- const workspaces = await client.makeApiRequest('json/workspaces');
16
- const filteredWorkspaces = workspaces.map((workspace) => ({
17
- id: workspace.id,
18
- name: workspace.name,
19
- displayName: workspace.displayName,
20
- totalPages: workspace.totalPages,
21
- isFavorite: workspace.isFavorite,
22
- installedApps: workspace.apps?.installed?.map(app => app.name) || []
23
- }));
24
- const total = filteredWorkspaces.length;
25
- const paginatedWorkspaces = limit ? filteredWorkspaces.slice(offset, offset + limit) : filteredWorkspaces.slice(offset);
26
- const result = {
27
- results: paginatedWorkspaces,
28
- pagination: {
29
- total,
30
- limit: limit || total,
31
- offset,
32
- hasMore: limit ? offset + limit < total : false
33
- }
34
- };
35
- debugLogWithTag('WORKSPACES', `Retrieved ${paginatedWorkspaces.length} workspaces (${offset}-${offset + paginatedWorkspaces.length} of ${total} total)`);
36
- const sizeCheck = checkResponseSize(result);
37
- if (sizeCheck.tooLarge) {
38
- return {
39
- content: [{ type: "text", text: `Response too large (${sizeCheck.actualSize} characters, max allowed: 45000). Try using the limit parameter to reduce the number of workspaces returned (e.g., limit: 10).` }],
40
- isError: true
41
- };
42
- }
43
- return {
44
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
45
- };
46
- }
47
- catch (error) {
48
- return {
49
- content: [{ type: "text", text: `Error retrieving workspaces: ${error instanceof Error ? error.message : String(error)}` }],
50
- isError: true
51
- };
52
- }
53
- });
54
- server.registerTool("cplace_list_types", {
55
- description: "List all types available in a workspace",
56
- inputSchema: {
57
- workspaceId: z.string().describe("The ID of the workspace to get types for")
58
- },
59
- annotations: { title: "List Types" }
60
- }, async ({ workspaceId }) => {
61
- try {
62
- const workspaces = await client.makeApiRequest('json/workspaces');
63
- const workspace = workspaces.find((w) => w.id === workspaceId);
64
- if (workspace) {
65
- const types = workspace.typeDefinitions?.types || [];
66
- return {
67
- content: [{ type: "text", text: JSON.stringify(types, null, 2) }]
68
- };
69
- }
70
- return {
71
- content: [{ type: "text", text: `Workspace ${workspaceId} not found` }]
72
- };
73
- }
74
- catch (error) {
75
- return {
76
- content: [{ type: "text", text: `Error retrieving types: ${error instanceof Error ? error.message : String(error)}` }],
77
- isError: true
78
- };
79
- }
80
- });
81
- server.registerTool("cplace_get_workspace_details", {
82
- description: "Get comprehensive details about a specific workspace including all metadata, permissions, type definitions (count only), styling, and configuration. Provides access to rootPageId and other fields not available in the list view. For the full list of types, use cplace_list_types.",
83
- inputSchema: {
84
- workspaceId: z.string().describe("The ID of the workspace to get details for")
85
- },
86
- annotations: { title: "Get Workspace Details" }
87
- }, async ({ workspaceId }) => {
88
- debugLogWithTag('WORKSPACES', `Getting details for workspace: ${workspaceId}`);
89
- try {
90
- const workspaces = await client.makeApiRequest('json/workspaces');
91
- const workspace = workspaces.find((w) => w.id === workspaceId);
92
- if (!workspace) {
93
- return {
94
- content: [{ type: "text", text: `Workspace not found: ${workspaceId}` }]
95
- };
96
- }
97
- debugLogWithTag('WORKSPACES', `Found workspace with rootPageId: ${workspace.rootPageId}`);
98
- const workspaceDetails = {
99
- ...workspace,
100
- typeDefinitions: {
101
- count: workspace.typeDefinitions?.count || 0
102
- }
103
- };
104
- return {
105
- content: [{ type: "text", text: JSON.stringify(workspaceDetails, null, 2) }]
106
- };
107
- }
108
- catch (error) {
109
- return {
110
- content: [{ type: "text", text: `Error retrieving workspace details: ${error instanceof Error ? error.message : String(error)}` }],
111
- isError: true
112
- };
113
- }
114
- });
115
- server.registerTool("cplace_get_type_datamodel", {
116
- description: "Get the datamodel of a type including its attributes, constraints, and permissions. Use this before performing a search to understand the type structure.",
117
- inputSchema: {
118
- workspaceId: z.string().describe("The ID of the workspace"),
119
- internalName: z.string().describe("The internal name of the type")
120
- },
121
- annotations: { title: "Get Type Details" }
122
- }, async ({ workspaceId, internalName }) => {
123
- try {
124
- const result = await client.makeApiRequest('json/type-definition', 'GET', {
125
- workspaceId,
126
- internalName
127
- });
128
- if (result && result.attributes) {
129
- result.attributes = transformMultiplicityToBoolean(result.attributes);
130
- }
131
- return {
132
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
133
- };
134
- }
135
- catch (error) {
136
- return {
137
- content: [{ type: "text", text: `Error retrieving type details: ${error instanceof Error ? error.message : String(error)}` }],
138
- isError: true
139
- };
140
- }
141
- });
142
- server.registerTool("cplace_manage_type_definition", {
3
+ const TOOL_MANAGE_TYPE_DEFINITION = 'cplace_manage_type_definition';
4
+ const TOOL_MANAGE_ATTRIBUTE_DEFINITION = 'cplace_manage_attribute_definition';
5
+ export const TYPE_MANAGEMENT_TOOL_DEFINITIONS = {
6
+ [TOOL_MANAGE_TYPE_DEFINITION]: {
143
7
  description: "Create or update type definitions in a workspace with comprehensive configuration options. All properties from the enhanced read endpoint are available for both creation and updates to enable complete type configuration.",
144
8
  inputSchema: {
145
9
  operation: z.enum(["create", "update"]).describe("Operation type: 'create' for new type definitions, 'update' for existing type definitions"),
146
10
  workspaceId: z.string().optional().describe("Required for both: Target workspace ID (e.g., 'abc123')"),
147
- typeInternalName: z.string().optional().describe("For create: type internal name (e.g., 'cf.example.myType'). For update: type internal name to update (e.g., 'cf.example.myType')"),
11
+ typeInternalName: z.string().optional().describe("Type internal name (e.g., 'cf.example.myType') - no trailing dot"),
148
12
  localizedNames: z.record(z.string()).optional().describe("Localized type names (singular) - e.g., {\"en\": \"My Type\", \"de\": \"Mein Typ\"}"),
149
13
  localizedPlural: z.record(z.string()).optional().describe("Localized type names (plural) - e.g., {\"en\": \"My Types\", \"de\": \"Meine Typen\"}"),
150
14
  description: z.string().optional().describe("Type description"),
@@ -162,14 +26,63 @@ export function registerWorkspaceTools(server, client) {
162
26
  hideTabVersions: z.boolean().optional().describe("Hide versions tab (default: false for create)"),
163
27
  allowDivergentLayouts: z.boolean().optional().describe("Allow different layouts per page (default: false for create)"),
164
28
  iconName: z.string().optional().describe("FontAwesome icon name (e.g., 'fa-project', 'fa-list') or visual icon identifier for update"),
165
- nameGenerationPattern: z.string().optional().describe("Create only: Auto-naming pattern (e.g., 'PROJ-{###}')"),
166
- displayNameGenerationPattern: z.string().optional().describe("Create only: Display name pattern (e.g., 'Project {###}')"),
29
+ nameGenerationPattern: z.string().optional().describe("Create only: Auto-naming pattern for pages of this type. When configured, page names can be auto-generated during creation. Pattern syntax: <attributeName> for attribute values, {###} for sequential counter, {0000} for zero-padded counter. Examples: 'PROJ-{###}' generates PROJ-1, PROJ-2, etc. '<title>-{0000}' generates 'ProjectAlpha-0001'. Pages can still override with explicit names. Leave empty to require explicit names."),
30
+ displayNameGenerationPattern: z.string().optional().describe("Create only: Display name pattern for UI representation. Uses same syntax as nameGenerationPattern (see above). Display name shown in UI, separate from internal page name."),
167
31
  autocompleteDetailsPattern: z.string().optional().describe("Create only: Autocomplete format (e.g., '{name}: {description}')"),
168
32
  internalAttributeNamePrefix: z.string().optional().describe("Prefix for attribute names (e.g., 'cf.mycompany.risk' - no trailing dot)"),
169
33
  localizedPageNamesMode: z.enum(["none", "optional", "optional_with_dialog", "mandatory"]).optional().describe("Localized naming mode")
170
34
  },
171
35
  annotations: { title: "Manage Type Definition" }
172
- }, async (params) => {
36
+ },
37
+ [TOOL_MANAGE_ATTRIBUTE_DEFINITION]: {
38
+ description: "Create or update attribute definitions within existing type definitions. Supports all major constraint types including string, number, boolean, date, reference, enumeration, and specialized types like rich text and colors. Provides comprehensive configuration options for display properties, validation, and low-code integration.",
39
+ inputSchema: {
40
+ operation: z.enum(["create", "update"]).describe("Operation type: 'create' for new attribute definitions, 'update' for existing attribute definitions"),
41
+ workspaceId: z.string().describe("Target workspace ID (e.g., 'abc123')"),
42
+ typeDefinitionInternalName: z.string().describe("Target type internal name (e.g., 'cf.example.myType')"),
43
+ attributeName: z.string().describe("For create: attribute name without prefix (e.g., 'myAttribute'). For update: attribute name to update (e.g., 'myAttribute')"),
44
+ multiplicity: z.enum(["exactlyOne", "maximalOne", "atLeastOne", "arbitrary"]).optional().describe("Required for create: Attribute multiplicity. Optional for update."),
45
+ constraintConfig: z.object({
46
+ constraintType: z.enum([
47
+ "string", "longString", "richString", "localizedString",
48
+ "number", "boolean", "date", "color", "reference",
49
+ "textEnumeration", "numberEnumeration", "dynamicEnumeration", "workflow"
50
+ ]).describe("Constraint type"),
51
+ pattern: z.string().optional().describe("Regex pattern for string validation"),
52
+ patternErrorMessage: z.record(z.string()).optional().describe("Localized error messages for pattern validation"),
53
+ precision: z.number().optional().describe("Decimal precision (-1 for unlimited)"),
54
+ suffix: z.record(z.string()).optional().describe("Localized suffix text"),
55
+ specificity: z.enum(["date", "datetime", "time"]).optional().describe("Date specificity"),
56
+ withTime: z.boolean().optional().describe("Include time component"),
57
+ dateFormat: z.string().optional().describe("Display format"),
58
+ targetTypeNames: z.array(z.string()).optional().describe("Target type internal names"),
59
+ targetEntityKind: z.string().optional().describe("Target entity kind"),
60
+ sameWorkspace: z.boolean().optional().describe("Restrict to same workspace"),
61
+ isHierarchy: z.boolean().optional().describe("Whether this is a hierarchical reference"),
62
+ inverseRoleName: z.record(z.string()).optional().describe("Localized inverse role name"),
63
+ elements: z.array(z.object({
64
+ value: z.string().describe("Enumeration value"),
65
+ localizedName: z.record(z.string()).describe("Localized display names"),
66
+ icon: z.string().optional().describe("Optional icon name")
67
+ })).optional().describe("Enumeration elements for textEnumeration/numberEnumeration"),
68
+ providerClass: z.string().optional().describe("Provider class for dynamicEnumeration"),
69
+ providerSimpleName: z.string().optional().describe("Provider simple name for dynamicEnumeration")
70
+ }).optional().describe("Required for create: Constraint configuration object. Optional for update: New constraint configuration object (replaces existing)."),
71
+ localizedNames: z.record(z.string()).optional().describe("Localized attribute names - e.g., {\"en\": \"My Attribute\", \"de\": \"Mein Attribut\"}"),
72
+ localizedShortNames: z.record(z.string()).optional().describe("Localized short names - e.g., {\"en\": \"My Attr\", \"de\": \"Mein Attr\"}"),
73
+ localizedShortHelp: z.record(z.string()).optional().describe("Localized help text - e.g., {\"en\": \"Help text\", \"de\": \"Hilfetext\"}"),
74
+ readOnly: z.boolean().optional().describe("Whether attribute is read-only"),
75
+ showInTables: z.boolean().optional().describe("Show in table views"),
76
+ showInNewDialog: z.boolean().optional().describe("Show in new item dialogs"),
77
+ showValuesWithLineBreak: z.boolean().optional().describe("Display values with line breaks"),
78
+ showInAttributesWidget: z.boolean().optional().describe("Show in attribute widgets"),
79
+ showInColumnSelection: z.boolean().optional().describe("Include in column selection")
80
+ },
81
+ annotations: { title: "Manage Attribute Definition" }
82
+ }
83
+ };
84
+ export function registerTypeManagementTools(server, client) {
85
+ server.registerTool(TOOL_MANAGE_TYPE_DEFINITION, TYPE_MANAGEMENT_TOOL_DEFINITIONS[TOOL_MANAGE_TYPE_DEFINITION], async (params) => {
173
86
  try {
174
87
  if (params.operation === "create") {
175
88
  if (!params.workspaceId || !params.typeInternalName) {
@@ -292,61 +205,18 @@ export function registerWorkspaceTools(server, client) {
292
205
  };
293
206
  }
294
207
  });
295
- server.registerTool("cplace_manage_attribute_definition", {
296
- description: "Create or update attribute definitions within existing type definitions. Supports all major constraint types including string, number, boolean, date, reference, enumeration, and specialized types like rich text and colors. Provides comprehensive configuration options for display properties, validation, and low-code integration.",
297
- inputSchema: {
298
- operation: z.enum(["create", "update"]).describe("Operation type: 'create' for new attribute definitions, 'update' for existing attribute definitions"),
299
- typeDefinitionInternalName: z.string().describe("Target type internal name (e.g., 'cf.example.myType')"),
300
- attributeName: z.string().describe("For create: attribute name without prefix (e.g., 'myAttribute'). For update: attribute name to update (e.g., 'myAttribute')"),
301
- multiplicity: z.enum(["exactlyOne", "maximalOne", "atLeastOne", "arbitrary"]).optional().describe("Required for create: Attribute multiplicity. Optional for update."),
302
- constraintConfig: z.object({
303
- constraintType: z.enum([
304
- "string", "longString", "richString", "localizedString",
305
- "number", "boolean", "date", "color", "reference",
306
- "textEnumeration", "numberEnumeration", "dynamicEnumeration"
307
- ]).describe("Constraint type"),
308
- pattern: z.string().optional().describe("Regex pattern for string validation"),
309
- patternErrorMessage: z.record(z.string()).optional().describe("Localized error messages for pattern validation"),
310
- precision: z.number().optional().describe("Decimal precision (-1 for unlimited)"),
311
- suffix: z.record(z.string()).optional().describe("Localized suffix text"),
312
- specificity: z.enum(["date", "datetime", "time"]).optional().describe("Date specificity"),
313
- withTime: z.boolean().optional().describe("Include time component"),
314
- dateFormat: z.string().optional().describe("Display format"),
315
- targetTypeNames: z.array(z.string()).optional().describe("Target type internal names"),
316
- targetEntityKind: z.string().optional().describe("Target entity kind"),
317
- sameWorkspace: z.boolean().optional().describe("Restrict to same workspace"),
318
- isHierarchy: z.boolean().optional().describe("Whether this is a hierarchical reference"),
319
- inverseRoleName: z.record(z.string()).optional().describe("Localized inverse role name"),
320
- elements: z.array(z.object({
321
- value: z.string().describe("Enumeration value"),
322
- localizedName: z.record(z.string()).describe("Localized display names"),
323
- icon: z.string().optional().describe("Optional icon name")
324
- })).optional().describe("Enumeration elements for textEnumeration/numberEnumeration"),
325
- providerClass: z.string().optional().describe("Provider class for dynamicEnumeration"),
326
- providerSimpleName: z.string().optional().describe("Provider simple name for dynamicEnumeration")
327
- }).optional().describe("Required for create: Constraint configuration object. Optional for update: New constraint configuration object (replaces existing)."),
328
- localizedNames: z.record(z.string()).optional().describe("Localized attribute names - e.g., {\"en\": \"My Attribute\", \"de\": \"Mein Attribut\"}"),
329
- localizedShortNames: z.record(z.string()).optional().describe("Localized short names - e.g., {\"en\": \"My Attr\", \"de\": \"Mein Attr\"}"),
330
- localizedShortHelp: z.record(z.string()).optional().describe("Localized help text - e.g., {\"en\": \"Help text\", \"de\": \"Hilfetext\"}"),
331
- readOnly: z.boolean().optional().describe("Whether attribute is read-only"),
332
- showInTables: z.boolean().optional().describe("Show in table views"),
333
- showInNewDialog: z.boolean().optional().describe("Show in new item dialogs"),
334
- showValuesWithLineBreak: z.boolean().optional().describe("Display values with line breaks"),
335
- showInAttributesWidget: z.boolean().optional().describe("Show in attribute widgets"),
336
- showInColumnSelection: z.boolean().optional().describe("Include in column selection")
337
- },
338
- annotations: { title: "Manage Attribute Definition" }
339
- }, async (params) => {
208
+ server.registerTool(TOOL_MANAGE_ATTRIBUTE_DEFINITION, TYPE_MANAGEMENT_TOOL_DEFINITIONS[TOOL_MANAGE_ATTRIBUTE_DEFINITION], async (params) => {
340
209
  try {
341
210
  if (params.operation === "create") {
342
- if (!params.typeDefinitionInternalName || !params.attributeName || !params.multiplicity || !params.constraintConfig) {
211
+ if (!params.workspaceId || !params.typeDefinitionInternalName || !params.attributeName || !params.multiplicity || !params.constraintConfig) {
343
212
  return {
344
- content: [{ type: "text", text: "Error: Create operation requires typeDefinitionInternalName, attributeName, multiplicity, and constraintConfig parameters" }],
213
+ content: [{ type: "text", text: "Error: Create operation requires workspaceId, typeDefinitionInternalName, attributeName, multiplicity, and constraintConfig parameters" }],
345
214
  isError: true
346
215
  };
347
216
  }
348
- debugLogWithTag('ATTRIBUTE_CREATION', `Creating attribute: ${params.attributeName} for type: ${params.typeDefinitionInternalName}`);
217
+ debugLogWithTag('ATTRIBUTE_CREATION', `Creating attribute: ${params.attributeName} for type: ${params.typeDefinitionInternalName} in workspace: ${params.workspaceId}`);
349
218
  const requestBody = {
219
+ workspaceId: params.workspaceId,
350
220
  typeDefinitionInternalName: params.typeDefinitionInternalName,
351
221
  attributeName: params.attributeName,
352
222
  multiplicity: params.multiplicity,
@@ -377,14 +247,15 @@ export function registerWorkspaceTools(server, client) {
377
247
  };
378
248
  }
379
249
  else {
380
- if (!params.typeDefinitionInternalName || !params.attributeName) {
250
+ if (!params.workspaceId || !params.typeDefinitionInternalName || !params.attributeName) {
381
251
  return {
382
- content: [{ type: "text", text: "Error: Update operation requires typeDefinitionInternalName and attributeName parameters" }],
252
+ content: [{ type: "text", text: "Error: Update operation requires workspaceId, typeDefinitionInternalName and attributeName parameters" }],
383
253
  isError: true
384
254
  };
385
255
  }
386
- debugLogWithTag('ATTRIBUTE_UPDATE', `Updating attribute: ${params.attributeName} for type: ${params.typeDefinitionInternalName}`);
256
+ debugLogWithTag('ATTRIBUTE_UPDATE', `Updating attribute: ${params.attributeName} for type: ${params.typeDefinitionInternalName} in workspace: ${params.workspaceId}`);
387
257
  const requestBody = {
258
+ workspaceId: params.workspaceId,
388
259
  typeDefinitionInternalName: params.typeDefinitionInternalName,
389
260
  attributeName: params.attributeName
390
261
  };
@@ -429,116 +300,5 @@ export function registerWorkspaceTools(server, client) {
429
300
  };
430
301
  }
431
302
  });
432
- server.registerTool("cplace_create_workspace", {
433
- description: "Create a new workspace (PageSpace) with specified configuration including name, permissions, and apps. Requires global CREATE_PAGE_SPACE permission.",
434
- inputSchema: {
435
- name: z.string().describe("Required: Internal workspace name (must be unique across the system)"),
436
- administratorUids: z.array(z.string()).optional().describe("Optional: List of administrator principal UIDs (e.g., ['person/user123', 'person/admin456']). Defaults to current user if not provided."),
437
- readerUids: z.array(z.string()).optional().describe("Optional: List of reader principal UIDs (e.g., ['person/reader789'])"),
438
- writerUids: z.array(z.string()).optional().describe("Optional: List of writer principal UIDs (e.g., ['person/writer456'])"),
439
- layouterUids: z.array(z.string()).optional().describe("Optional: List of layouter principal UIDs (e.g., ['person/layouter123'])"),
440
- apps: z.array(z.string()).optional().describe("Optional: List of app qualified names to install (e.g., ['cf.cplace.solution.safe', 'cf.cplace.solution.ppm']). Apps are installed best-effort - incompatible apps are skipped with warnings.")
441
- },
442
- annotations: { title: "Create Workspace" }
443
- }, async ({ name, administratorUids, readerUids, writerUids, layouterUids, apps }) => {
444
- debugLogWithTag('WORKSPACES', `Creating workspace: ${name}`);
445
- try {
446
- const requestBody = { name };
447
- if (administratorUids)
448
- requestBody.administratorUids = administratorUids;
449
- if (readerUids)
450
- requestBody.readerUids = readerUids;
451
- if (writerUids)
452
- requestBody.writerUids = writerUids;
453
- if (layouterUids)
454
- requestBody.layouterUids = layouterUids;
455
- if (apps)
456
- requestBody.apps = apps;
457
- const result = await client.makeApiRequest('json/workspace/create', 'POST', undefined, requestBody);
458
- debugLogWithTag('WORKSPACES', `Successfully created workspace: ${name} with ID: ${result.result?.workspaceId}`);
459
- return {
460
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
461
- };
462
- }
463
- catch (error) {
464
- debugLogWithTag('WORKSPACES', `Error creating workspace ${name}: ${error instanceof Error ? error.message : String(error)}`);
465
- return {
466
- content: [{ type: "text", text: `Error creating workspace: ${error instanceof Error ? error.message : String(error)}` }],
467
- isError: true
468
- };
469
- }
470
- });
471
- server.registerTool("cplace_list_workspace_apps", {
472
- description: "Get comprehensive information about applications within a workspace, including installed apps, available apps for installation, dependency information, and compatibility status",
473
- inputSchema: {
474
- workspaceId: z.string().describe("The ID of the workspace to query for apps (e.g., 'abc123')")
475
- },
476
- annotations: { title: "List Workspace Apps" }
477
- }, async ({ workspaceId }) => {
478
- debugLogWithTag('WORKSPACES', `Getting apps for workspace: ${workspaceId}`);
479
- try {
480
- const result = await client.makeApiRequest('json/apps', 'GET', { workspaceId });
481
- debugLogWithTag('WORKSPACES', `Retrieved apps data for workspace ${workspaceId}`);
482
- debugLogWithTag('WORKSPACES', `Installed apps: ${result.result?.installed?.length || 0}, Available apps: ${result.result?.available?.length || 0}`);
483
- const sizeCheck = checkResponseSize(result);
484
- if (sizeCheck.tooLarge) {
485
- return {
486
- content: [{ type: "text", text: `Response too large (${sizeCheck.actualSize} characters, max allowed: 45000). The apps data for this workspace is too large to display. Consider using the workspace details tool for basic app information.` }],
487
- isError: true
488
- };
489
- }
490
- return {
491
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
492
- };
493
- }
494
- catch (error) {
495
- debugLogWithTag('WORKSPACES', `Error getting apps for workspace ${workspaceId}: ${error instanceof Error ? error.message : String(error)}`);
496
- return {
497
- content: [{ type: "text", text: `Error retrieving workspace apps: ${error instanceof Error ? error.message : String(error)}` }],
498
- isError: true
499
- };
500
- }
501
- });
502
- server.registerTool("cplace_install_workspace_app", {
503
- description: "Install a specific application into a workspace, including automatic dependency resolution. Validates permissions, app compatibility, and automatically installs required dependencies.",
504
- inputSchema: {
505
- workspaceId: z.string().describe("The ID of the workspace to install the app in (e.g., 'abc123')"),
506
- appQualifiedName: z.string().describe("The qualified name of the app to install (e.g., 'cf.cplace.solution.safe')")
507
- },
508
- annotations: { title: "Install Workspace App" }
509
- }, async ({ workspaceId, appQualifiedName }) => {
510
- debugLogWithTag('WORKSPACES', `Installing app: ${appQualifiedName} in workspace: ${workspaceId}`);
511
- try {
512
- const requestBody = {
513
- workspaceId,
514
- appQualifiedName
515
- };
516
- const result = await client.makeApiRequest('json/install-app', 'POST', undefined, requestBody);
517
- debugLogWithTag('WORKSPACES', `Successfully installed app: ${appQualifiedName}`);
518
- const sizeCheck = checkResponseSize(result);
519
- if (sizeCheck.tooLarge) {
520
- return {
521
- content: [{
522
- type: "text",
523
- text: `App installed successfully but response too large (${sizeCheck.actualSize} characters, max allowed: 45000). Use cplace_list_workspace_apps to see updated app information.`
524
- }],
525
- isError: true
526
- };
527
- }
528
- return {
529
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
530
- };
531
- }
532
- catch (error) {
533
- debugLogWithTag('WORKSPACES', `Error installing app ${appQualifiedName} in workspace ${workspaceId}: ${error instanceof Error ? error.message : String(error)}`);
534
- return {
535
- content: [{
536
- type: "text",
537
- text: `Error installing app: ${error instanceof Error ? error.message : String(error)}`
538
- }],
539
- isError: true
540
- };
541
- }
542
- });
543
303
  }
544
- //# sourceMappingURL=workspace.js.map
304
+ //# sourceMappingURL=type-management.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-management.js","sourceRoot":"","sources":["../../src/tools/type-management.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAG/C,MAAM,2BAA2B,GAAG,+BAA+B,CAAC;AACpE,MAAM,gCAAgC,GAAG,oCAAoC,CAAC;AAG9E,MAAM,CAAC,MAAM,gCAAgC,GAAG;IAC9C,CAAC,2BAA2B,CAAC,EAAE;QAC7B,WAAW,EAAE,8NAA8N;QAC3O,WAAW,EAAE;YACX,SAAS,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,2FAA2F,CAAC;YAG7I,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;YACtG,gBAAgB,EAAE,CAAC,CAAC,M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;qBACjH,CAAC;gBACF,OAAO,EAAE,IAAI;aAChB,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,23 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
2
3
  import { CplaceApiClient } from '../api.js';
4
+ export declare const USER_TOOL_DEFINITIONS: {
5
+ readonly cplace_get_person_by_name: {
6
+ readonly description: "Get details about a person by searching for their name.";
7
+ readonly inputSchema: {
8
+ readonly name: z.ZodString;
9
+ };
10
+ readonly annotations: {
11
+ readonly title: "Get Person by Name";
12
+ };
13
+ };
14
+ readonly cplace_get_current_user: {
15
+ readonly description: "Get information about the currently logged-in user, including their attributes and metadata";
16
+ readonly inputSchema: {};
17
+ readonly annotations: {
18
+ readonly title: "Get Current User";
19
+ };
20
+ };
21
+ };
3
22
  export declare function registerUserTools(server: McpServer, client: CplaceApiClient): void;
4
23
  //# sourceMappingURL=users.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/tools/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAG5C,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QA6E3E"}
1
+ {"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/tools/users.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;AAQ5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;CAaxB,CAAC;AAEX,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QA0C3E"}
@@ -1,33 +1,23 @@
1
1
  import { z } from "zod";
2
2
  import { debugLogWithTag } from "../logger.js";
3
- export function registerUserTools(server, client) {
4
- server.registerTool("cplace_get_person_by_id", {
5
- description: "Get details about a person including their name and email.",
6
- inputSchema: {
7
- id: z.string().describe("The ID of the person to get, e.g. 'person/kkt8ol745jqur4581kelm5ply'")
8
- },
9
- annotations: { title: "Get Person by ID" }
10
- }, async ({ id }) => {
11
- try {
12
- const result = await client.makeApiRequest('json/person', 'GET', { id });
13
- return {
14
- content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
15
- };
16
- }
17
- catch (error) {
18
- return {
19
- content: [{ type: "text", text: `Error retrieving person: ${error instanceof Error ? error.message : String(error)}` }],
20
- isError: true
21
- };
22
- }
23
- });
24
- server.registerTool("cplace_get_person_by_name", {
3
+ const TOOL_GET_PERSON_BY_NAME = 'cplace_get_person_by_name';
4
+ const TOOL_GET_CURRENT_USER = 'cplace_get_current_user';
5
+ export const USER_TOOL_DEFINITIONS = {
6
+ [TOOL_GET_PERSON_BY_NAME]: {
25
7
  description: "Get details about a person by searching for their name.",
26
8
  inputSchema: {
27
9
  name: z.string().describe("The name of the person or part of the name to search for"),
28
10
  },
29
11
  annotations: { title: "Get Person by Name" }
30
- }, async ({ name }) => {
12
+ },
13
+ [TOOL_GET_CURRENT_USER]: {
14
+ description: "Get information about the currently logged-in user, including their attributes and metadata",
15
+ inputSchema: {},
16
+ annotations: { title: "Get Current User" }
17
+ }
18
+ };
19
+ export function registerUserTools(server, client) {
20
+ server.registerTool(TOOL_GET_PERSON_BY_NAME, USER_TOOL_DEFINITIONS[TOOL_GET_PERSON_BY_NAME], async ({ name }) => {
31
21
  try {
32
22
  const result = await client.makeApiRequest('json/person', 'GET', { name });
33
23
  return {
@@ -41,11 +31,7 @@ export function registerUserTools(server, client) {
41
31
  };
42
32
  }
43
33
  });
44
- server.registerTool("cplace_get_current_user", {
45
- description: "Get information about the currently logged-in user, including their attributes and metadata",
46
- inputSchema: {},
47
- annotations: { title: "Get Current User" }
48
- }, async () => {
34
+ server.registerTool(TOOL_GET_CURRENT_USER, USER_TOOL_DEFINITIONS[TOOL_GET_CURRENT_USER], async () => {
49
35
  debugLogWithTag('CURRENT_USER', 'Starting current user request');
50
36
  try {
51
37
  const result = await client.makeApiRequest('json/current-user');
@@ -1 +1 @@
1
- {"version":3,"file":"users.js","sourceRoot":"","sources":["../../src/tools/users.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,MAAM,UAAU,iBAAiB,CAAC,MAAiB,EAAE,MAAuB;IAE1E,MAAM,CAAC,YAAY,CAAC,yBAAyB,EAC3C;QACE,WAAW,EAAE,4DAA4D;QACzE,WAAW,EAAE;YACX,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sEAAsE,CAAC;SAChG;QACD,WAAW,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE;KAC3C,EACD,KAAK,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;YAEzE,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACnE,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4BAA4B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;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CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,8CAA8C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;gBACzI,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,4 +1,32 @@
1
1
  import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+ import { z } from "zod";
2
3
  import { CplaceApiClient } from '../api.js';
4
+ export declare const VALIDATOR_TOOL_DEFINITIONS: {
5
+ readonly cplace_get_validator_by_attribute: {
6
+ readonly description: "Retrieves the JavaScript validator script and metadata for a specific attribute definition. Returns comprehensive context information including workspace, type, and attribute details along with the validator code if it exists.";
7
+ readonly inputSchema: {
8
+ readonly workspaceId: z.ZodString;
9
+ readonly typeInternalName: z.ZodString;
10
+ readonly attributeName: z.ZodString;
11
+ };
12
+ readonly annotations: {
13
+ readonly title: "Get Validator by Attribute";
14
+ };
15
+ };
16
+ readonly cplace_manage_validator: {
17
+ readonly description: "Create or update JavaScript validators for attribute definitions. Validators are JavaScript functions executed to validate attribute values during page creation and updates.";
18
+ readonly inputSchema: {
19
+ readonly operation: z.ZodEnum<["create", "update"]>;
20
+ readonly workspaceId: z.ZodString;
21
+ readonly typeInternalName: z.ZodString;
22
+ readonly attributeName: z.ZodString;
23
+ readonly script: z.ZodOptional<z.ZodString>;
24
+ readonly description: z.ZodOptional<z.ZodString>;
25
+ };
26
+ readonly annotations: {
27
+ readonly title: "Manage Validator";
28
+ };
29
+ };
30
+ };
3
31
  export declare function registerValidatorTools(server: McpServer, client: CplaceApiClient): void;
4
32
  //# sourceMappingURL=validators.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/tools/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QA0GhF"}
1
+ {"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/tools/validators.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,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;CAsB7B,CAAC;AAEX,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAuFhF"}