@cplace/test-mcp-server 0.1.14 → 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 +275 -75
- package/dist/api.d.ts +4 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/conditional-registration.d.ts.map +1 -1
- package/dist/conditional-registration.js +21 -3
- package/dist/conditional-registration.js.map +1 -1
- package/dist/index.js +82 -99
- 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 -107
- 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 +332 -0
- package/dist/tools/generic-layouts.d.ts.map +1 -0
- package/dist/tools/generic-layouts.js +490 -0
- package/dist/tools/generic-layouts.js.map +1 -0
- 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 +217 -209
- 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 +2 -1
- package/dist/tools/system.d.ts.map +1 -1
- package/dist/tools/system.js +68 -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 +57 -11
- 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 +4 -0
- package/dist/tools/version-check.d.ts.map +1 -0
- package/dist/tools/version-check.js +107 -0
- package/dist/tools/version-check.js.map +1 -0
- 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 +213 -590
- 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/url-parsing.d.ts +6 -0
- package/dist/url-parsing.d.ts.map +1 -0
- package/dist/url-parsing.js +25 -0
- package/dist/url-parsing.js.map +1 -0
- 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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EAAE,IAAI;aAChB,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { CplaceApiClient } from '../api.js';
|
|
4
|
+
export declare const LayoutContextSchema: z.ZodUnion<[z.ZodObject<{
|
|
5
|
+
type: z.ZodLiteral<"page">;
|
|
6
|
+
pageUID: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
type: "page";
|
|
9
|
+
pageUID: string;
|
|
10
|
+
}, {
|
|
11
|
+
type: "page";
|
|
12
|
+
pageUID: string;
|
|
13
|
+
}>, z.ZodObject<{
|
|
14
|
+
type: z.ZodLiteral<"type">;
|
|
15
|
+
workspaceId: z.ZodString;
|
|
16
|
+
typeInternalName: z.ZodString;
|
|
17
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
type: "type";
|
|
20
|
+
workspaceId: string;
|
|
21
|
+
typeInternalName: string;
|
|
22
|
+
alternativeLayoutName?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
type: "type";
|
|
25
|
+
workspaceId: string;
|
|
26
|
+
typeInternalName: string;
|
|
27
|
+
alternativeLayoutName?: string | undefined;
|
|
28
|
+
}>]>;
|
|
29
|
+
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
|
+
};
|
|
331
|
+
export declare function registerLayoutTools(server: McpServer, client: CplaceApiClient): void;
|
|
332
|
+
//# sourceMappingURL=generic-layouts.d.ts.map
|
|
@@ -0,0 +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;AAgBhF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6ElC,CAAC;AAgFX,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAgb7E"}
|