@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.
- package/README.md +248 -113
- package/dist/conditional-registration.d.ts.map +1 -1
- package/dist/conditional-registration.js +19 -3
- package/dist/conditional-registration.js.map +1 -1
- package/dist/index.js +21 -93
- package/dist/index.js.map +1 -1
- package/dist/preference-file.d.ts +16 -0
- package/dist/preference-file.d.ts.map +1 -0
- package/dist/preference-file.js +133 -0
- package/dist/preference-file.js.map +1 -0
- package/dist/profiles.d.ts +1 -3
- package/dist/profiles.d.ts.map +1 -1
- package/dist/profiles.js +60 -112
- package/dist/profiles.js.map +1 -1
- package/dist/searchConversion.d.ts.map +1 -1
- package/dist/searchConversion.js +18 -5
- package/dist/searchConversion.js.map +1 -1
- package/dist/searchSchema.d.ts +25 -25
- package/dist/searchSchema.d.ts.map +1 -1
- package/dist/searchSchema.js +5 -5
- package/dist/searchSchema.js.map +1 -1
- package/dist/token-hashing.d.ts +3 -0
- package/dist/token-hashing.d.ts.map +1 -0
- package/dist/token-hashing.js +18 -0
- package/dist/token-hashing.js.map +1 -0
- package/dist/tool-metadata.d.ts +2 -0
- package/dist/tool-metadata.d.ts.map +1 -0
- package/dist/tool-metadata.js +43 -0
- package/dist/tool-metadata.js.map +1 -0
- package/dist/tools/change-listeners.d.ts +30 -0
- package/dist/tools/change-listeners.d.ts.map +1 -1
- package/dist/tools/change-listeners.js +24 -18
- package/dist/tools/change-listeners.js.map +1 -1
- package/dist/tools/common-schemas.d.ts +2 -0
- package/dist/tools/common-schemas.d.ts.map +1 -1
- package/dist/tools/common-schemas.js +16 -0
- package/dist/tools/common-schemas.js.map +1 -1
- package/dist/tools/csv-export.d.ts +1849 -0
- package/dist/tools/csv-export.d.ts.map +1 -0
- package/dist/tools/csv-export.js +61 -0
- package/dist/tools/csv-export.js.map +1 -0
- package/dist/tools/generic-layouts.d.ts +302 -0
- package/dist/tools/generic-layouts.d.ts.map +1 -1
- package/dist/tools/generic-layouts.js +102 -70
- package/dist/tools/generic-layouts.js.map +1 -1
- package/dist/tools/get-operations.d.ts +16 -0
- package/dist/tools/get-operations.d.ts.map +1 -0
- package/dist/tools/get-operations.js +63 -0
- package/dist/tools/get-operations.js.map +1 -0
- package/dist/tools/pages.d.ts +55 -0
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +173 -257
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/ppt-export-schemas.d.ts +16 -16
- package/dist/tools/ppt-export.d.ts +1493 -0
- package/dist/tools/ppt-export.d.ts.map +1 -1
- package/dist/tools/ppt-export.js +23 -17
- package/dist/tools/ppt-export.js.map +1 -1
- package/dist/tools/profile-management.d.ts +20 -0
- package/dist/tools/profile-management.d.ts.map +1 -0
- package/dist/tools/profile-management.js +250 -0
- package/dist/tools/profile-management.js.map +1 -0
- package/dist/tools/references.d.ts +36 -0
- package/dist/tools/references.d.ts.map +1 -1
- package/dist/tools/references.js +48 -45
- package/dist/tools/references.js.map +1 -1
- package/dist/tools/richstring-widgets.d.ts +51 -0
- package/dist/tools/richstring-widgets.d.ts.map +1 -0
- package/dist/tools/richstring-widgets.js +173 -0
- package/dist/tools/richstring-widgets.js.map +1 -0
- package/dist/tools/schedule.d.ts +14 -0
- package/dist/tools/schedule.d.ts.map +1 -1
- package/dist/tools/schedule.js +7 -3
- package/dist/tools/schedule.js.map +1 -1
- package/dist/tools/script-logs.d.ts +29 -0
- package/dist/tools/script-logs.d.ts.map +1 -0
- package/dist/tools/script-logs.js +144 -0
- package/dist/tools/script-logs.js.map +1 -0
- package/dist/tools/search.d.ts +1870 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +49 -75
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/system.d.ts.map +1 -1
- package/dist/tools/system.js +4 -2
- package/dist/tools/system.js.map +1 -1
- package/dist/tools/type-layouts.d.ts +37 -0
- package/dist/tools/type-layouts.d.ts.map +1 -1
- package/dist/tools/type-layouts.js +30 -22
- package/dist/tools/type-layouts.js.map +1 -1
- package/dist/tools/type-management.d.ts +134 -0
- package/dist/tools/type-management.d.ts.map +1 -0
- package/dist/tools/{workspace.js → type-management.js} +67 -307
- package/dist/tools/type-management.js.map +1 -0
- package/dist/tools/users.d.ts +19 -0
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +14 -28
- package/dist/tools/users.js.map +1 -1
- package/dist/tools/validators.d.ts +28 -0
- package/dist/tools/validators.d.ts.map +1 -1
- package/dist/tools/validators.js +21 -15
- package/dist/tools/validators.js.map +1 -1
- package/dist/tools/version-check.d.ts.map +1 -1
- package/dist/tools/version-check.js +11 -9
- package/dist/tools/version-check.js.map +1 -1
- package/dist/tools/version-history.d.ts +48 -0
- package/dist/tools/version-history.d.ts.map +1 -1
- package/dist/tools/version-history.js +39 -29
- package/dist/tools/version-history.js.map +1 -1
- package/dist/tools/widgets.d.ts +182 -0
- package/dist/tools/widgets.d.ts.map +1 -1
- package/dist/tools/widgets.js +122 -343
- package/dist/tools/widgets.js.map +1 -1
- package/dist/tools/workflow-scripts.d.ts +40 -0
- package/dist/tools/workflow-scripts.d.ts.map +1 -0
- package/dist/tools/workflow-scripts.js +186 -0
- package/dist/tools/workflow-scripts.js.map +1 -0
- package/dist/tools/workflow.d.ts +70 -0
- package/dist/tools/workflow.d.ts.map +1 -0
- package/dist/tools/workflow.js +259 -0
- package/dist/tools/workflow.js.map +1 -0
- package/dist/tools/workspace-admin.d.ts +40 -0
- package/dist/tools/workspace-admin.d.ts.map +1 -0
- package/dist/tools/workspace-admin.js +125 -0
- package/dist/tools/workspace-admin.js.map +1 -0
- package/dist/tools/workspace-core.d.ts +45 -0
- package/dist/tools/workspace-core.d.ts.map +1 -0
- package/dist/tools/workspace-core.js +153 -0
- package/dist/tools/workspace-core.js.map +1 -0
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/dateValidation.d.ts +5 -0
- package/dist/utils/dateValidation.d.ts.map +1 -0
- package/dist/utils/dateValidation.js +57 -0
- package/dist/utils/dateValidation.js.map +1 -0
- package/dist/utils.js +7 -7
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/tools/workspace.d.ts +0 -4
- package/dist/tools/workspace.d.ts.map +0 -1
- package/dist/tools/workspace.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv-export.d.ts","sourceRoot":"","sources":["../../src/tools/csv-export.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;AAU5C,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAa9B,CAAC;AAEX,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAgEhF"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import SearchFilterSchema from "../searchSchema.js";
|
|
3
|
+
import { convertSearchFilterToCplaceFormat } from "../searchConversion.js";
|
|
4
|
+
import { debugLogWithTag } from "../logger.js";
|
|
5
|
+
import { convertPagesToCsv } from "../csvUtils.js";
|
|
6
|
+
const TOOL_SEARCH_PAGES_CSV = 'cplace_search_pages_csv';
|
|
7
|
+
export const CSV_EXPORT_TOOL_DEFINITIONS = {
|
|
8
|
+
[TOOL_SEARCH_PAGES_CSV]: {
|
|
9
|
+
description: "Same as cplace_search_pages but returns results in CSV format instead of JSON. Only use this tool after first calling cplace_search_pages to establish and validate the search parameters. The CSV result should always be stored as an artifact.\n\nIMPORTANT: Date filter values must use date-only format (YYYY-MM-DD). Datetime formats are not supported. See cplace_search_pages for full details.",
|
|
10
|
+
inputSchema: {
|
|
11
|
+
workspaceId: z.string().optional().describe("Same as cplace_search_pages"),
|
|
12
|
+
internalTypeName: z.string().describe("Same as cplace_search_pages"),
|
|
13
|
+
search_filter: SearchFilterSchema.describe("Same as cplace_search_pages"),
|
|
14
|
+
limit: z.number().min(1).max(1000).default(50).describe("Same as cplace_search_pages"),
|
|
15
|
+
offset: z.number().min(0).max(10000).default(0).describe("Same as cplace_search_pages"),
|
|
16
|
+
attributes: z.array(z.string()).optional().describe("Same as cplace_search_pages"),
|
|
17
|
+
},
|
|
18
|
+
annotations: { title: "Search Pages (CSV Export)" }
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export function registerCsvExportTools(server, client) {
|
|
22
|
+
server.registerTool(TOOL_SEARCH_PAGES_CSV, CSV_EXPORT_TOOL_DEFINITIONS[TOOL_SEARCH_PAGES_CSV], async ({ workspaceId, internalTypeName, search_filter, limit = 50, offset = 0, attributes, }) => {
|
|
23
|
+
debugLogWithTag('CSV_SEARCH', `Starting CSV search with params: workspaceId=${workspaceId || 'none'}, type=${internalTypeName}, filter=${JSON.stringify(search_filter)}, limit=${limit}, offset=${offset}`);
|
|
24
|
+
try {
|
|
25
|
+
const cplaceFilter = convertSearchFilterToCplaceFormat(search_filter);
|
|
26
|
+
debugLogWithTag('CSV_SEARCH', `Converted filter: ${JSON.stringify(cplaceFilter)}`);
|
|
27
|
+
if (workspaceId) {
|
|
28
|
+
cplaceFilter.filters.unshift({
|
|
29
|
+
type: "Workspace",
|
|
30
|
+
workspaceIds: [workspaceId]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
if (internalTypeName) {
|
|
34
|
+
cplaceFilter.filters.unshift({
|
|
35
|
+
type: "Type",
|
|
36
|
+
types: [internalTypeName]
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
debugLogWithTag('CSV_SEARCH', `Final cplace filter: ${JSON.stringify(cplaceFilter)}`);
|
|
40
|
+
const result = await client.makeApiRequest('json/search', 'GET', {
|
|
41
|
+
filter: JSON.stringify(cplaceFilter),
|
|
42
|
+
limit,
|
|
43
|
+
offset
|
|
44
|
+
});
|
|
45
|
+
const searchResults = result.results || [];
|
|
46
|
+
debugLogWithTag('CSV_SEARCH', `Retrieved ${searchResults.length} results for CSV conversion`);
|
|
47
|
+
const csvContent = await convertPagesToCsv(searchResults, client, attributes);
|
|
48
|
+
return {
|
|
49
|
+
content: [{ type: "text", text: csvContent }]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
debugLogWithTag('CSV_SEARCH', `Error during CSV search: ${error instanceof Error ? error.message : String(error)}`);
|
|
54
|
+
return {
|
|
55
|
+
content: [{ type: "text", text: `Error converting or executing CSV search: ${error instanceof Error ? error.message : String(error)}` }],
|
|
56
|
+
isError: true
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=csv-export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"csv-export.js","sourceRoot":"","sources":["../../src/tools/csv-export.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,kBAAkB,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,iCAAiC,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGnD,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAGxD,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,CAAC,qBAAqB,CAAC,EAAE;QACvB,WAAW,EAAE,0YAA0Y;QACvZ,WAAW,EAAE;YACX,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YAC1E,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YACpE,aAAa,EAAE,kBAAkB,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YACzE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,6BAA6B,CAAC;YACtF,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,C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
|
+
export declare const GENERIC_LAYOUT_TOOL_DEFINITIONS: {
|
|
30
|
+
readonly cplace_layout_get_overview: {
|
|
31
|
+
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.";
|
|
32
|
+
readonly inputSchema: {
|
|
33
|
+
readonly context: z.ZodUnion<[z.ZodObject<{
|
|
34
|
+
type: z.ZodLiteral<"page">;
|
|
35
|
+
pageUID: z.ZodString;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
type: "page";
|
|
38
|
+
pageUID: string;
|
|
39
|
+
}, {
|
|
40
|
+
type: "page";
|
|
41
|
+
pageUID: string;
|
|
42
|
+
}>, z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"type">;
|
|
44
|
+
workspaceId: z.ZodString;
|
|
45
|
+
typeInternalName: z.ZodString;
|
|
46
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
type: "type";
|
|
49
|
+
workspaceId: string;
|
|
50
|
+
typeInternalName: string;
|
|
51
|
+
alternativeLayoutName?: string | undefined;
|
|
52
|
+
}, {
|
|
53
|
+
type: "type";
|
|
54
|
+
workspaceId: string;
|
|
55
|
+
typeInternalName: string;
|
|
56
|
+
alternativeLayoutName?: string | undefined;
|
|
57
|
+
}>]>;
|
|
58
|
+
};
|
|
59
|
+
readonly annotations: {
|
|
60
|
+
readonly title: "Get Layout Overview";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
readonly cplace_layout_add_widget: {
|
|
64
|
+
readonly description: "Add widget to page or type layout. Works with both page and type layouts using the same interface and behavior.\n\n⚠️ REQUIRED BEFORE USE:\n- ALWAYS call cplace_get_widget_definition FIRST to understand required fields\n- Many widgets have non-obvious required attributes that will cause validation errors\n- Widget configurations must match the schema exactly\n\nCRITICAL BEHAVIOR:\n- Row creation: ❌ NOT automatic - use cplace_layout_add_row to create rows first\n- Column creation: ❌ NOT automatic - columnIndex only references existing columns\n- Invalid columnIndex: Falls back to last existing column (no error)\n\nTO CREATE SIDE-BY-SIDE LAYOUTS:\n1. First use cplace_layout_add_row to create multi-column structure\n2. Then add widgets to the created columns\n\nEXAMPLES:\n- Add to new row 0: Creates single-column row, widget goes to column 0\n- Add to column 1 when only column 0 exists: Widget goes to column 0 (fallback)\n- Add to pre-created 6/6 row: Works correctly if columns exist\n\nTIP: Always check current layout with cplace_layout_get_overview before adding widgets.";
|
|
65
|
+
readonly inputSchema: {
|
|
66
|
+
readonly context: z.ZodUnion<[z.ZodObject<{
|
|
67
|
+
type: z.ZodLiteral<"page">;
|
|
68
|
+
pageUID: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
type: "page";
|
|
71
|
+
pageUID: string;
|
|
72
|
+
}, {
|
|
73
|
+
type: "page";
|
|
74
|
+
pageUID: string;
|
|
75
|
+
}>, z.ZodObject<{
|
|
76
|
+
type: z.ZodLiteral<"type">;
|
|
77
|
+
workspaceId: z.ZodString;
|
|
78
|
+
typeInternalName: z.ZodString;
|
|
79
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, "strip", z.ZodTypeAny, {
|
|
81
|
+
type: "type";
|
|
82
|
+
workspaceId: string;
|
|
83
|
+
typeInternalName: string;
|
|
84
|
+
alternativeLayoutName?: string | undefined;
|
|
85
|
+
}, {
|
|
86
|
+
type: "type";
|
|
87
|
+
workspaceId: string;
|
|
88
|
+
typeInternalName: string;
|
|
89
|
+
alternativeLayoutName?: string | undefined;
|
|
90
|
+
}>]>;
|
|
91
|
+
readonly widgetType: z.ZodString;
|
|
92
|
+
readonly position: z.ZodObject<{
|
|
93
|
+
rowIndex: z.ZodNumber;
|
|
94
|
+
columnIndex: z.ZodNumber;
|
|
95
|
+
widgetIndex: z.ZodNumber;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
rowIndex: number;
|
|
98
|
+
columnIndex: number;
|
|
99
|
+
widgetIndex: number;
|
|
100
|
+
}, {
|
|
101
|
+
rowIndex: number;
|
|
102
|
+
columnIndex: number;
|
|
103
|
+
widgetIndex: number;
|
|
104
|
+
}>;
|
|
105
|
+
readonly configuration: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
106
|
+
};
|
|
107
|
+
readonly annotations: {
|
|
108
|
+
readonly title: "Add Widget to Layout";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
readonly cplace_layout_remove_widget: {
|
|
112
|
+
readonly description: "Remove widget from page or type layout. Works with both page and type layouts using the same interface.";
|
|
113
|
+
readonly inputSchema: {
|
|
114
|
+
readonly context: z.ZodUnion<[z.ZodObject<{
|
|
115
|
+
type: z.ZodLiteral<"page">;
|
|
116
|
+
pageUID: z.ZodString;
|
|
117
|
+
}, "strip", z.ZodTypeAny, {
|
|
118
|
+
type: "page";
|
|
119
|
+
pageUID: string;
|
|
120
|
+
}, {
|
|
121
|
+
type: "page";
|
|
122
|
+
pageUID: string;
|
|
123
|
+
}>, z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"type">;
|
|
125
|
+
workspaceId: z.ZodString;
|
|
126
|
+
typeInternalName: z.ZodString;
|
|
127
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
128
|
+
}, "strip", z.ZodTypeAny, {
|
|
129
|
+
type: "type";
|
|
130
|
+
workspaceId: string;
|
|
131
|
+
typeInternalName: string;
|
|
132
|
+
alternativeLayoutName?: string | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
type: "type";
|
|
135
|
+
workspaceId: string;
|
|
136
|
+
typeInternalName: string;
|
|
137
|
+
alternativeLayoutName?: string | undefined;
|
|
138
|
+
}>]>;
|
|
139
|
+
readonly widgetId: z.ZodString;
|
|
140
|
+
};
|
|
141
|
+
readonly annotations: {
|
|
142
|
+
readonly title: "Remove Widget from Layout";
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
readonly cplace_layout_add_row: {
|
|
146
|
+
readonly description: "Add row structure to page or type layout. Creates new row with specific column layout. Essential for multi-column structures as widget placement alone cannot create columns.";
|
|
147
|
+
readonly inputSchema: {
|
|
148
|
+
readonly context: z.ZodUnion<[z.ZodObject<{
|
|
149
|
+
type: z.ZodLiteral<"page">;
|
|
150
|
+
pageUID: z.ZodString;
|
|
151
|
+
}, "strip", z.ZodTypeAny, {
|
|
152
|
+
type: "page";
|
|
153
|
+
pageUID: string;
|
|
154
|
+
}, {
|
|
155
|
+
type: "page";
|
|
156
|
+
pageUID: string;
|
|
157
|
+
}>, z.ZodObject<{
|
|
158
|
+
type: z.ZodLiteral<"type">;
|
|
159
|
+
workspaceId: z.ZodString;
|
|
160
|
+
typeInternalName: z.ZodString;
|
|
161
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
162
|
+
}, "strip", z.ZodTypeAny, {
|
|
163
|
+
type: "type";
|
|
164
|
+
workspaceId: string;
|
|
165
|
+
typeInternalName: string;
|
|
166
|
+
alternativeLayoutName?: string | undefined;
|
|
167
|
+
}, {
|
|
168
|
+
type: "type";
|
|
169
|
+
workspaceId: string;
|
|
170
|
+
typeInternalName: string;
|
|
171
|
+
alternativeLayoutName?: string | undefined;
|
|
172
|
+
}>]>;
|
|
173
|
+
readonly rowIndex: z.ZodNumber;
|
|
174
|
+
readonly columnProportions: z.ZodArray<z.ZodNumber, "many">;
|
|
175
|
+
};
|
|
176
|
+
readonly annotations: {
|
|
177
|
+
readonly title: "Add Row to Layout";
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
readonly cplace_layout_get_widget_details: {
|
|
181
|
+
readonly description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.";
|
|
182
|
+
readonly inputSchema: {
|
|
183
|
+
readonly context: z.ZodUnion<[z.ZodObject<{
|
|
184
|
+
type: z.ZodLiteral<"page">;
|
|
185
|
+
pageUID: z.ZodString;
|
|
186
|
+
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
type: "page";
|
|
188
|
+
pageUID: string;
|
|
189
|
+
}, {
|
|
190
|
+
type: "page";
|
|
191
|
+
pageUID: string;
|
|
192
|
+
}>, z.ZodObject<{
|
|
193
|
+
type: z.ZodLiteral<"type">;
|
|
194
|
+
workspaceId: z.ZodString;
|
|
195
|
+
typeInternalName: z.ZodString;
|
|
196
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
type: "type";
|
|
199
|
+
workspaceId: string;
|
|
200
|
+
typeInternalName: string;
|
|
201
|
+
alternativeLayoutName?: string | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
type: "type";
|
|
204
|
+
workspaceId: string;
|
|
205
|
+
typeInternalName: string;
|
|
206
|
+
alternativeLayoutName?: string | undefined;
|
|
207
|
+
}>]>;
|
|
208
|
+
readonly widgetId: z.ZodString;
|
|
209
|
+
};
|
|
210
|
+
readonly annotations: {
|
|
211
|
+
readonly title: "Get Widget Details from Layout";
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
readonly cplace_layout_update_widget: {
|
|
215
|
+
readonly description: "Update widget configuration or collapse state in page or type layout. Allows modification of widget properties and display settings.\n\nUSE CASES:\n- Restore configuration after widget moves (configurations may be lost during moves)\n- Update widget connections (e.g., change tableWidgetId after layout modifications)\n- Modify display properties (titles, collapse state, etc.)\n\nTIP: Widget IDs may change after layout operations - always use current IDs from latest layout overview retrieved via cplace_layout_get_overview.";
|
|
216
|
+
readonly inputSchema: {
|
|
217
|
+
readonly context: z.ZodUnion<[z.ZodObject<{
|
|
218
|
+
type: z.ZodLiteral<"page">;
|
|
219
|
+
pageUID: z.ZodString;
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
type: "page";
|
|
222
|
+
pageUID: string;
|
|
223
|
+
}, {
|
|
224
|
+
type: "page";
|
|
225
|
+
pageUID: string;
|
|
226
|
+
}>, z.ZodObject<{
|
|
227
|
+
type: z.ZodLiteral<"type">;
|
|
228
|
+
workspaceId: z.ZodString;
|
|
229
|
+
typeInternalName: z.ZodString;
|
|
230
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
231
|
+
}, "strip", z.ZodTypeAny, {
|
|
232
|
+
type: "type";
|
|
233
|
+
workspaceId: string;
|
|
234
|
+
typeInternalName: string;
|
|
235
|
+
alternativeLayoutName?: string | undefined;
|
|
236
|
+
}, {
|
|
237
|
+
type: "type";
|
|
238
|
+
workspaceId: string;
|
|
239
|
+
typeInternalName: string;
|
|
240
|
+
alternativeLayoutName?: string | undefined;
|
|
241
|
+
}>]>;
|
|
242
|
+
readonly widgetId: z.ZodString;
|
|
243
|
+
readonly newConfiguration: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
244
|
+
readonly collapsed: z.ZodOptional<z.ZodBoolean>;
|
|
245
|
+
};
|
|
246
|
+
readonly annotations: {
|
|
247
|
+
readonly title: "Update Widget in Layout";
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
readonly cplace_layout_move_widget: {
|
|
251
|
+
readonly description: "Move widget to different position in page or type layout. Relocates widget to specified grid position.\n\nMOVE BEHAVIOR:\n- ✅ Can move between existing rows and columns\n- ❌ Cannot create new columns (only references existing ones)\n- Invalid columnIndex: Falls back to last column in target row\n\nCRITICAL WARNINGS:\n- Widget configurations may be LOST during moves\n- Widget IDs may CHANGE - always get new IDs from response\n- Connected widgets (charts) may lose their tableWidgetId references\n\nPOST-MOVE CHECKLIST:\n1. Get new widget ID from response\n2. Use cplace_layout_get_widget_details to check if configuration was preserved\n3. If lost, use cplace_layout_update_widget to restore configuration\n4. Update any widgets that referenced the moved widget's old ID\n\nTIP: For complex layouts, consider removing and re-adding widgets instead of moving.";
|
|
252
|
+
readonly inputSchema: {
|
|
253
|
+
readonly context: z.ZodUnion<[z.ZodObject<{
|
|
254
|
+
type: z.ZodLiteral<"page">;
|
|
255
|
+
pageUID: z.ZodString;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
type: "page";
|
|
258
|
+
pageUID: string;
|
|
259
|
+
}, {
|
|
260
|
+
type: "page";
|
|
261
|
+
pageUID: string;
|
|
262
|
+
}>, z.ZodObject<{
|
|
263
|
+
type: z.ZodLiteral<"type">;
|
|
264
|
+
workspaceId: z.ZodString;
|
|
265
|
+
typeInternalName: z.ZodString;
|
|
266
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
267
|
+
}, "strip", z.ZodTypeAny, {
|
|
268
|
+
type: "type";
|
|
269
|
+
workspaceId: string;
|
|
270
|
+
typeInternalName: string;
|
|
271
|
+
alternativeLayoutName?: string | undefined;
|
|
272
|
+
}, {
|
|
273
|
+
type: "type";
|
|
274
|
+
workspaceId: string;
|
|
275
|
+
typeInternalName: string;
|
|
276
|
+
alternativeLayoutName?: string | undefined;
|
|
277
|
+
}>]>;
|
|
278
|
+
readonly widgetId: z.ZodString;
|
|
279
|
+
readonly newPosition: z.ZodObject<{
|
|
280
|
+
rowIndex: z.ZodNumber;
|
|
281
|
+
columnIndex: z.ZodNumber;
|
|
282
|
+
widgetIndex: z.ZodNumber;
|
|
283
|
+
}, "strip", z.ZodTypeAny, {
|
|
284
|
+
rowIndex: number;
|
|
285
|
+
columnIndex: number;
|
|
286
|
+
widgetIndex: number;
|
|
287
|
+
}, {
|
|
288
|
+
rowIndex: number;
|
|
289
|
+
columnIndex: number;
|
|
290
|
+
widgetIndex: number;
|
|
291
|
+
}>;
|
|
292
|
+
};
|
|
293
|
+
readonly annotations: {
|
|
294
|
+
readonly title: "Move Widget in Layout";
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
readonly cplace_layout_compact: {
|
|
298
|
+
readonly description: "Remove empty rows from page or type layout. Compacts the layout by keeping only rows that contain widgets while preserving order and configurations.";
|
|
299
|
+
readonly inputSchema: {
|
|
300
|
+
readonly context: z.ZodUnion<[z.ZodObject<{
|
|
301
|
+
type: z.ZodLiteral<"page">;
|
|
302
|
+
pageUID: z.ZodString;
|
|
303
|
+
}, "strip", z.ZodTypeAny, {
|
|
304
|
+
type: "page";
|
|
305
|
+
pageUID: string;
|
|
306
|
+
}, {
|
|
307
|
+
type: "page";
|
|
308
|
+
pageUID: string;
|
|
309
|
+
}>, z.ZodObject<{
|
|
310
|
+
type: z.ZodLiteral<"type">;
|
|
311
|
+
workspaceId: z.ZodString;
|
|
312
|
+
typeInternalName: z.ZodString;
|
|
313
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
314
|
+
}, "strip", z.ZodTypeAny, {
|
|
315
|
+
type: "type";
|
|
316
|
+
workspaceId: string;
|
|
317
|
+
typeInternalName: string;
|
|
318
|
+
alternativeLayoutName?: string | undefined;
|
|
319
|
+
}, {
|
|
320
|
+
type: "type";
|
|
321
|
+
workspaceId: string;
|
|
322
|
+
typeInternalName: string;
|
|
323
|
+
alternativeLayoutName?: string | undefined;
|
|
324
|
+
}>]>;
|
|
325
|
+
};
|
|
326
|
+
readonly annotations: {
|
|
327
|
+
readonly title: "Compact Layout";
|
|
328
|
+
};
|
|
329
|
+
};
|
|
330
|
+
};
|
|
29
331
|
export declare function registerLayoutTools(server: McpServer, client: CplaceApiClient): void;
|
|
30
332
|
//# sourceMappingURL=generic-layouts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic-layouts.d.ts","sourceRoot":"","sources":["../../src/tools/generic-layouts.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;AAuB5C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;IAW+C,CAAC;
|
|
1
|
+
{"version":3,"file":"generic-layouts.d.ts","sourceRoot":"","sources":["../../src/tools/generic-layouts.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;AAuB5C,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;IAW+C,CAAC;AAgBhF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6ElC,CAAC;AAgFX,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAgb7E"}
|
|
@@ -13,6 +13,92 @@ export const LayoutContextSchema = z.union([
|
|
|
13
13
|
alternativeLayoutName: z.string().optional().describe("Alternative layout name (optional)")
|
|
14
14
|
})
|
|
15
15
|
]).describe("Layout target - specify whether operating on page or type layout");
|
|
16
|
+
const TOOL_LAYOUT_GET_OVERVIEW = 'cplace_layout_get_overview';
|
|
17
|
+
const TOOL_LAYOUT_ADD_WIDGET = 'cplace_layout_add_widget';
|
|
18
|
+
const TOOL_LAYOUT_REMOVE_WIDGET = 'cplace_layout_remove_widget';
|
|
19
|
+
const TOOL_LAYOUT_ADD_ROW = 'cplace_layout_add_row';
|
|
20
|
+
const TOOL_LAYOUT_GET_WIDGET_DETAILS = 'cplace_layout_get_widget_details';
|
|
21
|
+
const TOOL_LAYOUT_UPDATE_WIDGET = 'cplace_layout_update_widget';
|
|
22
|
+
const TOOL_LAYOUT_MOVE_WIDGET = 'cplace_layout_move_widget';
|
|
23
|
+
const TOOL_LAYOUT_COMPACT = 'cplace_layout_compact';
|
|
24
|
+
export const GENERIC_LAYOUT_TOOL_DEFINITIONS = {
|
|
25
|
+
[TOOL_LAYOUT_GET_OVERVIEW]: {
|
|
26
|
+
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.",
|
|
27
|
+
inputSchema: {
|
|
28
|
+
context: LayoutContextSchema
|
|
29
|
+
},
|
|
30
|
+
annotations: { title: "Get Layout Overview" }
|
|
31
|
+
},
|
|
32
|
+
[TOOL_LAYOUT_ADD_WIDGET]: {
|
|
33
|
+
description: "Add widget to page or type layout. Works with both page and type layouts using the same interface and behavior.\n\n⚠️ REQUIRED BEFORE USE:\n- ALWAYS call cplace_get_widget_definition FIRST to understand required fields\n- Many widgets have non-obvious required attributes that will cause validation errors\n- Widget configurations must match the schema exactly\n\nCRITICAL BEHAVIOR:\n- Row creation: ❌ NOT automatic - use cplace_layout_add_row to create rows first\n- Column creation: ❌ NOT automatic - columnIndex only references existing columns\n- Invalid columnIndex: Falls back to last existing column (no error)\n\nTO CREATE SIDE-BY-SIDE LAYOUTS:\n1. First use cplace_layout_add_row to create multi-column structure\n2. Then add widgets to the created columns\n\nEXAMPLES:\n- Add to new row 0: Creates single-column row, widget goes to column 0\n- Add to column 1 when only column 0 exists: Widget goes to column 0 (fallback)\n- Add to pre-created 6/6 row: Works correctly if columns exist\n\nTIP: Always check current layout with cplace_layout_get_overview before adding widgets.",
|
|
34
|
+
inputSchema: {
|
|
35
|
+
context: LayoutContextSchema,
|
|
36
|
+
widgetType: z.string().describe("Widget type identifier (e.g., 'cf.cplace.platform.table', 'cf.platform.wiki')"),
|
|
37
|
+
position: PositionSchema,
|
|
38
|
+
configuration: z.record(z.any()).optional().describe(`${WIDGET_CONFIG_DESCRIPTION}
|
|
39
|
+
|
|
40
|
+
WIDGET-SPECIFIC PATTERNS:
|
|
41
|
+
- Connected widgets (bar/pie charts): Use 'tableWidgetId' to connect to existing table widget
|
|
42
|
+
Example: {'tableWidgetId': 'id_abc123', 'title': {'en': 'Chart Title'}}
|
|
43
|
+
- Attribute widgets: Use 'cf.platform.quotedAttributeName' with single quotes
|
|
44
|
+
Example: {'cf.platform.quotedAttributeName': "'cf.cplace.myAttribute'", 'cf.platform.withLabel': true}
|
|
45
|
+
- Search widgets: Use 'search' with JSON search string
|
|
46
|
+
Example: {'search': '{"filters":[{"types":["test.project"]}]}', 'title': {'en': 'Results'}}`)
|
|
47
|
+
},
|
|
48
|
+
annotations: { title: "Add Widget to Layout" }
|
|
49
|
+
},
|
|
50
|
+
[TOOL_LAYOUT_REMOVE_WIDGET]: {
|
|
51
|
+
description: "Remove widget from page or type layout. Works with both page and type layouts using the same interface.",
|
|
52
|
+
inputSchema: {
|
|
53
|
+
context: LayoutContextSchema,
|
|
54
|
+
widgetId: z.string().describe("The unique identifier of the widget to remove")
|
|
55
|
+
},
|
|
56
|
+
annotations: { title: "Remove Widget from Layout" }
|
|
57
|
+
},
|
|
58
|
+
[TOOL_LAYOUT_ADD_ROW]: {
|
|
59
|
+
description: "Add row structure to page or type layout. Creates new row with specific column layout. Essential for multi-column structures as widget placement alone cannot create columns.",
|
|
60
|
+
inputSchema: {
|
|
61
|
+
context: LayoutContextSchema,
|
|
62
|
+
rowIndex: z.number().min(0).describe("Row index where to insert the new row (0-based). If rowIndex >= current row count, adds at the end. Otherwise, inserts at position and shifts existing rows down."),
|
|
63
|
+
columnProportions: z.array(z.number().min(1)).min(1).describe("Array of column width proportions that must sum to 12 (Bootstrap grid system). Examples: [12] (single column), [6,6] (two equal columns), [4,4,4] (three equal columns), [3,9] (sidebar + main)")
|
|
64
|
+
},
|
|
65
|
+
annotations: { title: "Add Row to Layout" }
|
|
66
|
+
},
|
|
67
|
+
[TOOL_LAYOUT_GET_WIDGET_DETAILS]: {
|
|
68
|
+
description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.",
|
|
69
|
+
inputSchema: {
|
|
70
|
+
context: LayoutContextSchema,
|
|
71
|
+
widgetId: z.string().describe("The unique widget identifier to get details for")
|
|
72
|
+
},
|
|
73
|
+
annotations: { title: "Get Widget Details from Layout" }
|
|
74
|
+
},
|
|
75
|
+
[TOOL_LAYOUT_UPDATE_WIDGET]: {
|
|
76
|
+
description: "Update widget configuration or collapse state in page or type layout. Allows modification of widget properties and display settings.\n\nUSE CASES:\n- Restore configuration after widget moves (configurations may be lost during moves)\n- Update widget connections (e.g., change tableWidgetId after layout modifications)\n- Modify display properties (titles, collapse state, etc.)\n\nTIP: Widget IDs may change after layout operations - always use current IDs from latest layout overview retrieved via cplace_layout_get_overview.",
|
|
77
|
+
inputSchema: {
|
|
78
|
+
context: LayoutContextSchema,
|
|
79
|
+
widgetId: z.string().describe("The unique identifier of the widget to update"),
|
|
80
|
+
newConfiguration: z.record(z.any()).optional().describe(`Updated widget configuration as key-value pairs (optional). ${WIDGET_CONFIG_DESCRIPTION}`),
|
|
81
|
+
collapsed: z.boolean().optional().describe("Widget collapse state (optional)")
|
|
82
|
+
},
|
|
83
|
+
annotations: { title: "Update Widget in Layout" }
|
|
84
|
+
},
|
|
85
|
+
[TOOL_LAYOUT_MOVE_WIDGET]: {
|
|
86
|
+
description: "Move widget to different position in page or type layout. Relocates widget to specified grid position.\n\nMOVE BEHAVIOR:\n- ✅ Can move between existing rows and columns\n- ❌ Cannot create new columns (only references existing ones)\n- Invalid columnIndex: Falls back to last column in target row\n\nCRITICAL WARNINGS:\n- Widget configurations may be LOST during moves\n- Widget IDs may CHANGE - always get new IDs from response\n- Connected widgets (charts) may lose their tableWidgetId references\n\nPOST-MOVE CHECKLIST:\n1. Get new widget ID from response\n2. Use cplace_layout_get_widget_details to check if configuration was preserved\n3. If lost, use cplace_layout_update_widget to restore configuration\n4. Update any widgets that referenced the moved widget's old ID\n\nTIP: For complex layouts, consider removing and re-adding widgets instead of moving.",
|
|
87
|
+
inputSchema: {
|
|
88
|
+
context: LayoutContextSchema,
|
|
89
|
+
widgetId: z.string().describe("The unique identifier of the widget to move"),
|
|
90
|
+
newPosition: PositionSchema
|
|
91
|
+
},
|
|
92
|
+
annotations: { title: "Move Widget in Layout" }
|
|
93
|
+
},
|
|
94
|
+
[TOOL_LAYOUT_COMPACT]: {
|
|
95
|
+
description: "Remove empty rows from page or type layout. Compacts the layout by keeping only rows that contain widgets while preserving order and configurations.",
|
|
96
|
+
inputSchema: {
|
|
97
|
+
context: LayoutContextSchema
|
|
98
|
+
},
|
|
99
|
+
annotations: { title: "Compact Layout" }
|
|
100
|
+
}
|
|
101
|
+
};
|
|
16
102
|
function determineApiEndpoint(context, operation) {
|
|
17
103
|
const baseEndpoint = context.type === "page" ? "json/pageLayout" : "json/typeLayout";
|
|
18
104
|
return baseEndpoint;
|
|
@@ -68,13 +154,7 @@ function mapOperationName(context, operation) {
|
|
|
68
154
|
return contextMapping[operation] || operation;
|
|
69
155
|
}
|
|
70
156
|
export function registerLayoutTools(server, client) {
|
|
71
|
-
server.registerTool(
|
|
72
|
-
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.",
|
|
73
|
-
inputSchema: {
|
|
74
|
-
context: LayoutContextSchema
|
|
75
|
-
},
|
|
76
|
-
annotations: { title: "Get Layout Overview" }
|
|
77
|
-
}, async ({ context }) => {
|
|
157
|
+
server.registerTool(TOOL_LAYOUT_GET_OVERVIEW, GENERIC_LAYOUT_TOOL_DEFINITIONS[TOOL_LAYOUT_GET_OVERVIEW], async ({ context }) => {
|
|
78
158
|
debugLogWithTag('LAYOUT', `Starting layout overview request for ${context.type} layout`);
|
|
79
159
|
try {
|
|
80
160
|
const result = await handleLayoutOperation(client, context, 'getOverview');
|
|
@@ -88,7 +168,8 @@ export function registerLayoutTools(server, client) {
|
|
|
88
168
|
widgets: column.widgets?.map((widget) => ({
|
|
89
169
|
id: widget.id,
|
|
90
170
|
widgetType: widget.widgetType,
|
|
91
|
-
configurationCount: widget.configuration?.length || 0
|
|
171
|
+
configurationCount: widget.configuration?.length || 0,
|
|
172
|
+
validationStatus: widget.validationStatus || null
|
|
92
173
|
})) || []
|
|
93
174
|
})) || []
|
|
94
175
|
})) || []
|
|
@@ -109,16 +190,7 @@ export function registerLayoutTools(server, client) {
|
|
|
109
190
|
};
|
|
110
191
|
}
|
|
111
192
|
});
|
|
112
|
-
server.registerTool(
|
|
113
|
-
description: "Add widget to page or type layout. Works with both page and type layouts using the same interface and behavior.",
|
|
114
|
-
inputSchema: {
|
|
115
|
-
context: LayoutContextSchema,
|
|
116
|
-
widgetType: z.string().describe("Widget type identifier (e.g., 'cf.cplace.platform.table', 'cf.platform.wiki')"),
|
|
117
|
-
position: PositionSchema,
|
|
118
|
-
configuration: z.record(z.any()).optional().describe(WIDGET_CONFIG_DESCRIPTION)
|
|
119
|
-
},
|
|
120
|
-
annotations: { title: "Add Widget to Layout" }
|
|
121
|
-
}, async ({ context, widgetType, position, configuration }) => {
|
|
193
|
+
server.registerTool(TOOL_LAYOUT_ADD_WIDGET, GENERIC_LAYOUT_TOOL_DEFINITIONS[TOOL_LAYOUT_ADD_WIDGET], async ({ context, widgetType, position, configuration }) => {
|
|
122
194
|
debugLogWithTag('LAYOUT', `Adding widget ${widgetType} to ${context.type} layout`);
|
|
123
195
|
try {
|
|
124
196
|
const operationType = mapOperationName(context, 'add_widget');
|
|
@@ -142,6 +214,8 @@ export function registerLayoutTools(server, client) {
|
|
|
142
214
|
context,
|
|
143
215
|
widgetType,
|
|
144
216
|
position,
|
|
217
|
+
validationStatus: result.status || null,
|
|
218
|
+
validationDetails: result.validationDetails || null,
|
|
145
219
|
message: `Widget added successfully to ${context.type} layout`
|
|
146
220
|
};
|
|
147
221
|
return {
|
|
@@ -165,14 +239,7 @@ export function registerLayoutTools(server, client) {
|
|
|
165
239
|
};
|
|
166
240
|
}
|
|
167
241
|
});
|
|
168
|
-
server.registerTool(
|
|
169
|
-
description: "Remove widget from page or type layout. Works with both page and type layouts using the same interface.",
|
|
170
|
-
inputSchema: {
|
|
171
|
-
context: LayoutContextSchema,
|
|
172
|
-
widgetId: z.string().describe("The unique identifier of the widget to remove")
|
|
173
|
-
},
|
|
174
|
-
annotations: { title: "Remove Widget from Layout" }
|
|
175
|
-
}, async ({ context, widgetId }) => {
|
|
242
|
+
server.registerTool(TOOL_LAYOUT_REMOVE_WIDGET, GENERIC_LAYOUT_TOOL_DEFINITIONS[TOOL_LAYOUT_REMOVE_WIDGET], async ({ context, widgetId }) => {
|
|
176
243
|
debugLogWithTag('LAYOUT', `Removing widget ${widgetId} from ${context.type} layout`);
|
|
177
244
|
try {
|
|
178
245
|
const operationType = mapOperationName(context, 'remove_widget');
|
|
@@ -205,15 +272,7 @@ export function registerLayoutTools(server, client) {
|
|
|
205
272
|
};
|
|
206
273
|
}
|
|
207
274
|
});
|
|
208
|
-
server.registerTool(
|
|
209
|
-
description: "Add row structure to page or type layout. Creates new row with specific column layout. Essential for multi-column structures as widget placement alone cannot create columns.",
|
|
210
|
-
inputSchema: {
|
|
211
|
-
context: LayoutContextSchema,
|
|
212
|
-
rowIndex: z.number().min(0).describe("Row index where to insert the new row (0-based). If rowIndex >= current row count, adds at the end. Otherwise, inserts at position and shifts existing rows down."),
|
|
213
|
-
columnProportions: z.array(z.number().min(1)).min(1).describe("Array of column width proportions that must sum to 12 (Bootstrap grid system). Examples: [12] (single column), [6,6] (two equal columns), [4,4,4] (three equal columns), [3,9] (sidebar + main)")
|
|
214
|
-
},
|
|
215
|
-
annotations: { title: "Add Row to Layout" }
|
|
216
|
-
}, async ({ context, rowIndex, columnProportions }) => {
|
|
275
|
+
server.registerTool(TOOL_LAYOUT_ADD_ROW, GENERIC_LAYOUT_TOOL_DEFINITIONS[TOOL_LAYOUT_ADD_ROW], async ({ context, rowIndex, columnProportions }) => {
|
|
217
276
|
debugLogWithTag('LAYOUT', `Adding row ${rowIndex} with proportions ${JSON.stringify(columnProportions)} to ${context.type} layout`);
|
|
218
277
|
try {
|
|
219
278
|
const operationType = mapOperationName(context, 'add_row');
|
|
@@ -252,14 +311,7 @@ export function registerLayoutTools(server, client) {
|
|
|
252
311
|
};
|
|
253
312
|
}
|
|
254
313
|
});
|
|
255
|
-
server.registerTool(
|
|
256
|
-
description: "Get detailed widget configuration from page or type layout. Extracts specific widget information from the layout structure.",
|
|
257
|
-
inputSchema: {
|
|
258
|
-
context: LayoutContextSchema,
|
|
259
|
-
widgetId: z.string().describe("The unique widget identifier to get details for")
|
|
260
|
-
},
|
|
261
|
-
annotations: { title: "Get Widget Details from Layout" }
|
|
262
|
-
}, async ({ context, widgetId }) => {
|
|
314
|
+
server.registerTool(TOOL_LAYOUT_GET_WIDGET_DETAILS, GENERIC_LAYOUT_TOOL_DEFINITIONS[TOOL_LAYOUT_GET_WIDGET_DETAILS], async ({ context, widgetId }) => {
|
|
263
315
|
debugLogWithTag('LAYOUT', `Getting widget details for ${widgetId} from ${context.type} layout`);
|
|
264
316
|
try {
|
|
265
317
|
const layoutResult = await handleLayoutOperation(client, context, 'getOverview');
|
|
@@ -291,7 +343,8 @@ export function registerLayoutTools(server, client) {
|
|
|
291
343
|
const response = {
|
|
292
344
|
context,
|
|
293
345
|
widgetId,
|
|
294
|
-
widget: foundWidget
|
|
346
|
+
widget: foundWidget,
|
|
347
|
+
validationStatus: foundWidget.validationStatus || null
|
|
295
348
|
};
|
|
296
349
|
return {
|
|
297
350
|
content: [{ type: "text", text: JSON.stringify(response, null, 2) }]
|
|
@@ -308,16 +361,7 @@ export function registerLayoutTools(server, client) {
|
|
|
308
361
|
};
|
|
309
362
|
}
|
|
310
363
|
});
|
|
311
|
-
server.registerTool(
|
|
312
|
-
description: "Update widget configuration or collapse state in page or type layout. Allows modification of widget properties and display settings.",
|
|
313
|
-
inputSchema: {
|
|
314
|
-
context: LayoutContextSchema,
|
|
315
|
-
widgetId: z.string().describe("The unique identifier of the widget to update"),
|
|
316
|
-
newConfiguration: z.record(z.any()).optional().describe(`Updated widget configuration as key-value pairs (optional). ${WIDGET_CONFIG_DESCRIPTION}`),
|
|
317
|
-
collapsed: z.boolean().optional().describe("Widget collapse state (optional)")
|
|
318
|
-
},
|
|
319
|
-
annotations: { title: "Update Widget in Layout" }
|
|
320
|
-
}, async ({ context, widgetId, newConfiguration, collapsed }) => {
|
|
364
|
+
server.registerTool(TOOL_LAYOUT_UPDATE_WIDGET, GENERIC_LAYOUT_TOOL_DEFINITIONS[TOOL_LAYOUT_UPDATE_WIDGET], async ({ context, widgetId, newConfiguration, collapsed }) => {
|
|
321
365
|
debugLogWithTag('LAYOUT', `Updating widget ${widgetId} in ${context.type} layout`);
|
|
322
366
|
try {
|
|
323
367
|
const operationType = mapOperationName(context, 'update_widget');
|
|
@@ -344,6 +388,8 @@ export function registerLayoutTools(server, client) {
|
|
|
344
388
|
status: "SUCCESS",
|
|
345
389
|
context,
|
|
346
390
|
widgetId,
|
|
391
|
+
validationStatus: result.status || null,
|
|
392
|
+
validationDetails: result.validationDetails || null,
|
|
347
393
|
message: `Widget updated successfully in ${context.type} layout`
|
|
348
394
|
};
|
|
349
395
|
return {
|
|
@@ -366,15 +412,7 @@ export function registerLayoutTools(server, client) {
|
|
|
366
412
|
};
|
|
367
413
|
}
|
|
368
414
|
});
|
|
369
|
-
server.registerTool(
|
|
370
|
-
description: "Move widget to different position in page or type layout. Relocates widget to specified grid position.",
|
|
371
|
-
inputSchema: {
|
|
372
|
-
context: LayoutContextSchema,
|
|
373
|
-
widgetId: z.string().describe("The unique identifier of the widget to move"),
|
|
374
|
-
newPosition: PositionSchema
|
|
375
|
-
},
|
|
376
|
-
annotations: { title: "Move Widget in Layout" }
|
|
377
|
-
}, async ({ context, widgetId, newPosition }) => {
|
|
415
|
+
server.registerTool(TOOL_LAYOUT_MOVE_WIDGET, GENERIC_LAYOUT_TOOL_DEFINITIONS[TOOL_LAYOUT_MOVE_WIDGET], async ({ context, widgetId, newPosition }) => {
|
|
378
416
|
debugLogWithTag('LAYOUT', `Moving widget ${widgetId} in ${context.type} layout to position ${JSON.stringify(newPosition)}`);
|
|
379
417
|
try {
|
|
380
418
|
const operationType = mapOperationName(context, 'move_widget');
|
|
@@ -417,13 +455,7 @@ export function registerLayoutTools(server, client) {
|
|
|
417
455
|
};
|
|
418
456
|
}
|
|
419
457
|
});
|
|
420
|
-
server.registerTool(
|
|
421
|
-
description: "Remove empty rows from page or type layout. Compacts the layout by keeping only rows that contain widgets while preserving order and configurations.",
|
|
422
|
-
inputSchema: {
|
|
423
|
-
context: LayoutContextSchema
|
|
424
|
-
},
|
|
425
|
-
annotations: { title: "Compact Layout" }
|
|
426
|
-
}, async ({ context }) => {
|
|
458
|
+
server.registerTool(TOOL_LAYOUT_COMPACT, GENERIC_LAYOUT_TOOL_DEFINITIONS[TOOL_LAYOUT_COMPACT], async ({ context }) => {
|
|
427
459
|
debugLogWithTag('LAYOUT', `Compacting ${context.type} layout`);
|
|
428
460
|
try {
|
|
429
461
|
const operationType = mapOperationName(context, 'compact');
|