@cplace/mcp-server 1.9.0 → 1.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -13
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/plugins/app-catalog.js +1 -1
- package/dist/plugins/app-catalog.js.map +1 -1
- package/dist/plugins/application-settings.d.ts.map +1 -1
- package/dist/plugins/application-settings.js +6 -3
- package/dist/plugins/application-settings.js.map +1 -1
- package/dist/plugins/core/widget-specifications/cf.cplace.platform.tableWidget/columns.md +6 -0
- package/dist/plugins/core.d.ts.map +1 -1
- package/dist/plugins/core.js +25 -13
- package/dist/plugins/core.js.map +1 -1
- package/dist/plugins/forms-wizard.js +2 -2
- package/dist/plugins/forms-wizard.js.map +1 -1
- package/dist/plugins/history.d.ts.map +1 -1
- package/dist/plugins/history.js +6 -3
- package/dist/plugins/history.js.map +1 -1
- package/dist/plugins/jobs.js +2 -2
- package/dist/plugins/jobs.js.map +1 -1
- package/dist/plugins/layouts.d.ts.map +1 -1
- package/dist/plugins/layouts.js +17 -8
- package/dist/plugins/layouts.js.map +1 -1
- package/dist/plugins/low-code.d.ts.map +1 -1
- package/dist/plugins/low-code.js +48 -15
- package/dist/plugins/low-code.js.map +1 -1
- package/dist/plugins/project-planning.d.ts.map +1 -1
- package/dist/plugins/project-planning.js +6 -3
- package/dist/plugins/project-planning.js.map +1 -1
- package/dist/plugins/resource-management.d.ts.map +1 -1
- package/dist/plugins/resource-management.js +6 -3
- package/dist/plugins/resource-management.js.map +1 -1
- package/dist/plugins/solution-management.d.ts.map +1 -1
- package/dist/plugins/solution-management.js +6 -3
- package/dist/plugins/solution-management.js.map +1 -1
- package/dist/plugins/types-write.d.ts.map +1 -1
- package/dist/plugins/types-write.js +6 -3
- package/dist/plugins/types-write.js.map +1 -1
- package/dist/plugins/widget-specifications.d.ts.map +1 -1
- package/dist/plugins/widget-specifications.js +2 -2
- package/dist/plugins/widget-specifications.js.map +1 -1
- package/dist/plugins/workspace-admin.d.ts.map +1 -1
- package/dist/plugins/workspace-admin.js +6 -3
- package/dist/plugins/workspace-admin.js.map +1 -1
- package/dist/str-replace-utils.js +1 -1
- package/dist/str-replace-utils.js.map +1 -1
- package/dist/tools/apps-catalog.d.ts +1 -1
- package/dist/tools/apps-catalog.d.ts.map +1 -1
- package/dist/tools/apps-catalog.js +16 -12
- package/dist/tools/apps-catalog.js.map +1 -1
- package/dist/tools/board-widget.d.ts +2 -2
- package/dist/tools/board-widget.d.ts.map +1 -1
- package/dist/tools/board-widget.js +354 -201
- package/dist/tools/board-widget.js.map +1 -1
- package/dist/tools/change-listeners.d.ts +2 -2
- package/dist/tools/change-listeners.d.ts.map +1 -1
- package/dist/tools/change-listeners.js +125 -57
- package/dist/tools/change-listeners.js.map +1 -1
- package/dist/tools/common-schemas.d.ts +1 -1
- package/dist/tools/common-schemas.d.ts.map +1 -1
- package/dist/tools/common-schemas.js +5 -3
- package/dist/tools/common-schemas.js.map +1 -1
- package/dist/tools/csv-export.d.ts +2 -2
- package/dist/tools/csv-export.d.ts.map +1 -1
- package/dist/tools/csv-export.js +29 -24
- package/dist/tools/csv-export.js.map +1 -1
- package/dist/tools/documents.d.ts +2 -2
- package/dist/tools/documents.d.ts.map +1 -1
- package/dist/tools/documents.js +34 -14
- package/dist/tools/documents.js.map +1 -1
- package/dist/tools/expert-settings.d.ts +3 -3
- package/dist/tools/expert-settings.d.ts.map +1 -1
- package/dist/tools/expert-settings.js +97 -38
- package/dist/tools/expert-settings.js.map +1 -1
- package/dist/tools/get-operations.d.ts +2 -2
- package/dist/tools/get-operations.d.ts.map +1 -1
- package/dist/tools/get-operations.js +29 -21
- package/dist/tools/get-operations.js.map +1 -1
- package/dist/tools/job-schedule-trigger.d.ts +2 -2
- package/dist/tools/job-schedule-trigger.d.ts.map +1 -1
- package/dist/tools/job-schedule-trigger.js +19 -10
- package/dist/tools/job-schedule-trigger.js.map +1 -1
- package/dist/tools/job-scripts.d.ts +2 -2
- package/dist/tools/job-scripts.d.ts.map +1 -1
- package/dist/tools/job-scripts.js +119 -55
- package/dist/tools/job-scripts.js.map +1 -1
- package/dist/tools/jobs.d.ts +2 -2
- package/dist/tools/jobs.d.ts.map +1 -1
- package/dist/tools/jobs.js +68 -38
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/layout-richstring-shared.d.ts +24 -1
- package/dist/tools/layout-richstring-shared.d.ts.map +1 -1
- package/dist/tools/layout-richstring-shared.js +99 -1
- package/dist/tools/layout-richstring-shared.js.map +1 -1
- package/dist/tools/layout-richstring-widgets.d.ts +94 -2
- package/dist/tools/layout-richstring-widgets.d.ts.map +1 -1
- package/dist/tools/layout-richstring-widgets.js +247 -25
- package/dist/tools/layout-richstring-widgets.js.map +1 -1
- package/dist/tools/layout.d.ts +5 -4
- package/dist/tools/layout.d.ts.map +1 -1
- package/dist/tools/layout.js +235 -124
- package/dist/tools/layout.js.map +1 -1
- package/dist/tools/linting.d.ts +2 -2
- package/dist/tools/linting.d.ts.map +1 -1
- package/dist/tools/linting.js +5 -5
- package/dist/tools/linting.js.map +1 -1
- package/dist/tools/page-action-simulation.d.ts +18 -0
- package/dist/tools/page-action-simulation.d.ts.map +1 -0
- package/dist/tools/page-action-simulation.js +88 -0
- package/dist/tools/page-action-simulation.js.map +1 -0
- package/dist/tools/page-actions.d.ts +60 -0
- package/dist/tools/page-actions.d.ts.map +1 -0
- package/dist/tools/page-actions.js +284 -0
- package/dist/tools/page-actions.js.map +1 -0
- package/dist/tools/pages.d.ts +3 -3
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +237 -112
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/ppt-export-schemas.d.ts +1 -1
- package/dist/tools/ppt-export-schemas.d.ts.map +1 -1
- package/dist/tools/ppt-export-schemas.js +269 -122
- package/dist/tools/ppt-export-schemas.js.map +1 -1
- package/dist/tools/ppt-export.d.ts +2 -2
- package/dist/tools/ppt-export.d.ts.map +1 -1
- package/dist/tools/ppt-export.js +82 -43
- package/dist/tools/ppt-export.js.map +1 -1
- package/dist/tools/profile-management.d.ts +2 -2
- package/dist/tools/profile-management.d.ts.map +1 -1
- package/dist/tools/profile-management.js +109 -82
- package/dist/tools/profile-management.js.map +1 -1
- package/dist/tools/references.d.ts +2 -2
- package/dist/tools/references.d.ts.map +1 -1
- package/dist/tools/references.js +36 -24
- package/dist/tools/references.js.map +1 -1
- package/dist/tools/resource-planner-widget.d.ts +2 -2
- package/dist/tools/resource-planner-widget.d.ts.map +1 -1
- package/dist/tools/resource-planner-widget.js +334 -138
- package/dist/tools/resource-planner-widget.js.map +1 -1
- package/dist/tools/richstring-marker-resolver.d.ts +16 -0
- package/dist/tools/richstring-marker-resolver.d.ts.map +1 -0
- package/dist/tools/richstring-marker-resolver.js +47 -0
- package/dist/tools/richstring-marker-resolver.js.map +1 -0
- package/dist/tools/richstring-widgets.d.ts +6 -16
- package/dist/tools/richstring-widgets.d.ts.map +1 -1
- package/dist/tools/richstring-widgets.js +184 -129
- package/dist/tools/richstring-widgets.js.map +1 -1
- package/dist/tools/schedule.d.ts +2 -2
- package/dist/tools/schedule.d.ts.map +1 -1
- package/dist/tools/schedule.js +23 -14
- package/dist/tools/schedule.js.map +1 -1
- package/dist/tools/script-logs.d.ts +2 -2
- package/dist/tools/script-logs.d.ts.map +1 -1
- package/dist/tools/script-logs.js +71 -32
- package/dist/tools/script-logs.js.map +1 -1
- package/dist/tools/script.d.ts +2 -2
- package/dist/tools/script.d.ts.map +1 -1
- package/dist/tools/script.js +44 -26
- package/dist/tools/script.js.map +1 -1
- package/dist/tools/search.d.ts +2 -2
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +139 -102
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/solution-packages.d.ts +2 -2
- package/dist/tools/solution-packages.d.ts.map +1 -1
- package/dist/tools/solution-packages.js +149 -61
- package/dist/tools/solution-packages.js.map +1 -1
- package/dist/tools/system.d.ts +2 -2
- package/dist/tools/system.d.ts.map +1 -1
- package/dist/tools/system.js +43 -21
- package/dist/tools/system.js.map +1 -1
- package/dist/tools/type-layouts.d.ts +2 -2
- package/dist/tools/type-layouts.d.ts.map +1 -1
- package/dist/tools/type-layouts.js +67 -31
- package/dist/tools/type-layouts.js.map +1 -1
- package/dist/tools/type-management.d.ts +86 -70
- package/dist/tools/type-management.d.ts.map +1 -1
- package/dist/tools/type-management.js +410 -138
- package/dist/tools/type-management.js.map +1 -1
- package/dist/tools/url-resolution.d.ts +2 -2
- package/dist/tools/url-resolution.d.ts.map +1 -1
- package/dist/tools/url-resolution.js +16 -12
- package/dist/tools/url-resolution.js.map +1 -1
- package/dist/tools/users.d.ts +2 -2
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +24 -14
- package/dist/tools/users.js.map +1 -1
- package/dist/tools/validators.d.ts +2 -2
- package/dist/tools/validators.d.ts.map +1 -1
- package/dist/tools/validators.js +68 -35
- package/dist/tools/validators.js.map +1 -1
- package/dist/tools/version-check.d.ts +2 -2
- package/dist/tools/version-check.d.ts.map +1 -1
- package/dist/tools/version-check.js +36 -30
- package/dist/tools/version-check.js.map +1 -1
- package/dist/tools/version-history.d.ts +2 -2
- package/dist/tools/version-history.d.ts.map +1 -1
- package/dist/tools/version-history.js +72 -41
- package/dist/tools/version-history.js.map +1 -1
- package/dist/tools/widget-simulation.d.ts +18 -0
- package/dist/tools/widget-simulation.d.ts.map +1 -0
- package/dist/tools/widget-simulation.js +94 -0
- package/dist/tools/widget-simulation.js.map +1 -0
- package/dist/tools/widget-tool-helpers.d.ts +17 -1
- package/dist/tools/widget-tool-helpers.d.ts.map +1 -1
- package/dist/tools/widget-tool-helpers.js +41 -6
- package/dist/tools/widget-tool-helpers.js.map +1 -1
- package/dist/tools/widgets.d.ts +2 -2
- package/dist/tools/widgets.d.ts.map +1 -1
- package/dist/tools/widgets.js +62 -43
- package/dist/tools/widgets.js.map +1 -1
- package/dist/tools/wizards.d.ts +2 -2
- package/dist/tools/wizards.d.ts.map +1 -1
- package/dist/tools/wizards.js +378 -182
- package/dist/tools/wizards.js.map +1 -1
- package/dist/tools/workflow-execution.d.ts +2 -2
- package/dist/tools/workflow-execution.d.ts.map +1 -1
- package/dist/tools/workflow-execution.js +27 -19
- package/dist/tools/workflow-execution.js.map +1 -1
- package/dist/tools/workflow-scripts.d.ts +2 -2
- package/dist/tools/workflow-scripts.d.ts.map +1 -1
- package/dist/tools/workflow-scripts.js +168 -81
- package/dist/tools/workflow-scripts.js.map +1 -1
- package/dist/tools/workflow.d.ts +2 -2
- package/dist/tools/workflow.d.ts.map +1 -1
- package/dist/tools/workflow.js +185 -74
- package/dist/tools/workflow.js.map +1 -1
- package/dist/tools/workspace-admin.d.ts +2 -2
- package/dist/tools/workspace-admin.d.ts.map +1 -1
- package/dist/tools/workspace-admin.js +82 -40
- package/dist/tools/workspace-admin.js.map +1 -1
- package/dist/tools/workspace-core.d.ts +2 -2
- package/dist/tools/workspace-core.d.ts.map +1 -1
- package/dist/tools/workspace-core.js +93 -53
- package/dist/tools/workspace-core.js.map +1 -1
- package/dist/utils/dateValidation.js.map +1 -1
- package/package.json +9 -4
package/dist/tools/jobs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { debugLogWithTag } from
|
|
3
|
-
import { checkResponseSize } from
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { debugLogWithTag } from '../logger.js';
|
|
3
|
+
import { checkResponseSize } from '../utils.js';
|
|
4
4
|
import { coerceNumber } from './common-schemas.js';
|
|
5
5
|
const TOOL_GET_JOB = 'cplace_get_job';
|
|
6
6
|
const TOOL_LIST_JOBS = 'cplace_list_jobs';
|
|
@@ -39,15 +39,15 @@ function transformJobResponse(job) {
|
|
|
39
39
|
startedAt: job.timestamps?.startedAt,
|
|
40
40
|
finishedAt: job.timestamps?.finishedAt,
|
|
41
41
|
durationMs: job.timestamps?.durationMs,
|
|
42
|
-
duration: formatDuration(job.timestamps?.durationMs)
|
|
42
|
+
duration: formatDuration(job.timestamps?.durationMs),
|
|
43
43
|
},
|
|
44
44
|
creator: job.creator,
|
|
45
45
|
...(job.output && {
|
|
46
46
|
output: {
|
|
47
47
|
log: job.output.log,
|
|
48
|
-
downloadFileName: job.output.downloadFileName
|
|
49
|
-
}
|
|
50
|
-
})
|
|
48
|
+
downloadFileName: job.output.downloadFileName,
|
|
49
|
+
},
|
|
50
|
+
}),
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
function transformJobListItem(job) {
|
|
@@ -64,9 +64,9 @@ function transformJobListItem(job) {
|
|
|
64
64
|
startedAt: job.timestamps?.startedAt,
|
|
65
65
|
finishedAt: job.timestamps?.finishedAt,
|
|
66
66
|
durationMs: job.timestamps?.durationMs,
|
|
67
|
-
duration: formatDuration(job.timestamps?.durationMs)
|
|
67
|
+
duration: formatDuration(job.timestamps?.durationMs),
|
|
68
68
|
},
|
|
69
|
-
creator: job.creator
|
|
69
|
+
creator: job.creator,
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
export const JOBS_TOOL_DEFINITIONS = {
|
|
@@ -83,9 +83,13 @@ Use cases:
|
|
|
83
83
|
Note: If response is too large due to job log size, retry with includeOutput=false.`,
|
|
84
84
|
inputSchema: {
|
|
85
85
|
jobId: z.string().describe("The job ID to retrieve (e.g., '12345' or 'persistentJob/12345')"),
|
|
86
|
-
includeOutput: z
|
|
86
|
+
includeOutput: z
|
|
87
|
+
.boolean()
|
|
88
|
+
.optional()
|
|
89
|
+
.default(true)
|
|
90
|
+
.describe('Whether to include job output (log and downloadFileName). Set to false for faster, smaller responses when output is not needed. Default: true'),
|
|
87
91
|
},
|
|
88
|
-
annotations: { title:
|
|
92
|
+
annotations: { title: 'Get Job by ID' },
|
|
89
93
|
},
|
|
90
94
|
[TOOL_LIST_JOBS]: {
|
|
91
95
|
description: `List PersistentJobs with optional filtering and pagination.
|
|
@@ -103,16 +107,28 @@ Use cases:
|
|
|
103
107
|
- List jobs by a specific user
|
|
104
108
|
- Monitor recent job activity`,
|
|
105
109
|
inputSchema: {
|
|
106
|
-
state: z
|
|
110
|
+
state: z
|
|
111
|
+
.enum(['created', 'running', 'success', 'error', 'cancelled', 'skipped'])
|
|
112
|
+
.optional()
|
|
113
|
+
.describe('Filter by job state'),
|
|
107
114
|
createdBy: z.string().optional().describe("Filter by creator user ID (e.g., 'user/abc123')"),
|
|
108
|
-
createdAfter: z
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
createdAfter: z
|
|
116
|
+
.string()
|
|
117
|
+
.optional()
|
|
118
|
+
.describe("Filter jobs created after this timestamp. Use ISO 8601 format (e.g., '2025-01-15T10:30:00Z')"),
|
|
119
|
+
createdBefore: z
|
|
120
|
+
.string()
|
|
121
|
+
.optional()
|
|
122
|
+
.describe("Filter jobs created before this timestamp. Use ISO 8601 format (e.g., '2025-01-31T23:59:59Z')"),
|
|
123
|
+
className: z
|
|
124
|
+
.string()
|
|
125
|
+
.optional()
|
|
126
|
+
.describe("Filter by job class name (partial match, case-sensitive). Example: 'DataExport' matches 'cf.cplace.myPlugin.jobs.DataExportJob'"),
|
|
127
|
+
limit: coerceNumber(z.number().min(1).max(100).optional().default(50)).describe('Maximum number of results (1-100). Default: 50'),
|
|
128
|
+
offset: coerceNumber(z.number().min(0).optional().default(0)).describe('Number of results to skip for pagination. Default: 0'),
|
|
113
129
|
},
|
|
114
|
-
annotations: { title:
|
|
115
|
-
}
|
|
130
|
+
annotations: { title: 'List Jobs' },
|
|
131
|
+
},
|
|
116
132
|
};
|
|
117
133
|
export function registerJobsTools(server, client) {
|
|
118
134
|
server.registerTool(TOOL_GET_JOB, JOBS_TOOL_DEFINITIONS[TOOL_GET_JOB], async ({ jobId, includeOutput = true }) => {
|
|
@@ -120,34 +136,41 @@ export function registerJobsTools(server, client) {
|
|
|
120
136
|
try {
|
|
121
137
|
const result = await client.makeApiRequest('json/job', 'GET', {
|
|
122
138
|
jobId,
|
|
123
|
-
includeOutput
|
|
139
|
+
includeOutput,
|
|
124
140
|
});
|
|
125
141
|
const transformedResult = transformJobResponse(result);
|
|
126
142
|
const sizeCheck = checkResponseSize(transformedResult);
|
|
127
143
|
if (sizeCheck.tooLarge) {
|
|
128
144
|
debugLogWithTag('JOBS', `Response too large: ${sizeCheck.actualSize} characters`);
|
|
129
145
|
return {
|
|
130
|
-
content: [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
146
|
+
content: [
|
|
147
|
+
{
|
|
148
|
+
type: 'text',
|
|
149
|
+
text: `Response too large (${sizeCheck.actualSize} characters). The job log is likely very large. Retry with includeOutput=false to get job details without the log.`,
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
isError: true,
|
|
135
153
|
};
|
|
136
154
|
}
|
|
137
155
|
debugLogWithTag('JOBS', `Successfully retrieved job ${jobId}`);
|
|
138
156
|
return {
|
|
139
|
-
content: [{ type:
|
|
157
|
+
content: [{ type: 'text', text: JSON.stringify(transformedResult, null, 2) }],
|
|
140
158
|
};
|
|
141
159
|
}
|
|
142
160
|
catch (error) {
|
|
143
161
|
debugLogWithTag('JOBS', `Error retrieving job: ${error instanceof Error ? error.message : String(error)}`);
|
|
144
162
|
return {
|
|
145
|
-
content: [
|
|
146
|
-
|
|
163
|
+
content: [
|
|
164
|
+
{
|
|
165
|
+
type: 'text',
|
|
166
|
+
text: `Error retrieving job: ${error instanceof Error ? error.message : String(error)}`,
|
|
167
|
+
},
|
|
168
|
+
],
|
|
169
|
+
isError: true,
|
|
147
170
|
};
|
|
148
171
|
}
|
|
149
172
|
});
|
|
150
|
-
server.registerTool(TOOL_LIST_JOBS, JOBS_TOOL_DEFINITIONS[TOOL_LIST_JOBS], async ({ state, createdBy, createdAfter, createdBefore, className, limit = 50, offset = 0 }) => {
|
|
173
|
+
server.registerTool(TOOL_LIST_JOBS, JOBS_TOOL_DEFINITIONS[TOOL_LIST_JOBS], async ({ state, createdBy, createdAfter, createdBefore, className, limit = 50, offset = 0, }) => {
|
|
151
174
|
debugLogWithTag('JOBS', `Listing jobs with filters: ${JSON.stringify({ state, createdBy, createdAfter, createdBefore, className, limit, offset })}`);
|
|
152
175
|
try {
|
|
153
176
|
const queryParams = { limit, offset };
|
|
@@ -164,29 +187,36 @@ export function registerJobsTools(server, client) {
|
|
|
164
187
|
const result = await client.makeApiRequest('json/jobs', 'GET', queryParams);
|
|
165
188
|
const transformedResult = {
|
|
166
189
|
...result,
|
|
167
|
-
jobs: result.jobs?.map(transformJobListItem) || []
|
|
190
|
+
jobs: result.jobs?.map(transformJobListItem) || [],
|
|
168
191
|
};
|
|
169
192
|
const sizeCheck = checkResponseSize(transformedResult);
|
|
170
193
|
if (sizeCheck.tooLarge) {
|
|
171
194
|
debugLogWithTag('JOBS', `Response too large: ${sizeCheck.actualSize} characters`);
|
|
172
195
|
return {
|
|
173
|
-
content: [
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
196
|
+
content: [
|
|
197
|
+
{
|
|
198
|
+
type: 'text',
|
|
199
|
+
text: `Response too large (${sizeCheck.actualSize} characters). Try: reduce limit (e.g., limit: 10), add filters (state, createdAfter, className), or use pagination with smaller pages.`,
|
|
200
|
+
},
|
|
201
|
+
],
|
|
202
|
+
isError: true,
|
|
178
203
|
};
|
|
179
204
|
}
|
|
180
205
|
debugLogWithTag('JOBS', `Successfully retrieved ${transformedResult.jobs?.length || 0} jobs`);
|
|
181
206
|
return {
|
|
182
|
-
content: [{ type:
|
|
207
|
+
content: [{ type: 'text', text: JSON.stringify(transformedResult, null, 2) }],
|
|
183
208
|
};
|
|
184
209
|
}
|
|
185
210
|
catch (error) {
|
|
186
211
|
debugLogWithTag('JOBS', `Error listing jobs: ${error instanceof Error ? error.message : String(error)}`);
|
|
187
212
|
return {
|
|
188
|
-
content: [
|
|
189
|
-
|
|
213
|
+
content: [
|
|
214
|
+
{
|
|
215
|
+
type: 'text',
|
|
216
|
+
text: `Error listing jobs: ${error instanceof Error ? error.message : String(error)}`,
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
isError: true,
|
|
190
220
|
};
|
|
191
221
|
}
|
|
192
222
|
});
|
package/dist/tools/jobs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jobs.js","sourceRoot":"","sources":["../../src/tools/jobs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,MAAM,YAAY,GAAG,gBAAgB,CAAC;AACtC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAS1C,SAAS,cAAc,CAAC,UAAqC;IAC3D,IAAI,UAAU,KAAK,IAAI,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IAEvC,MAAM,gBAAgB,GAAG,OAAO,GAAG,EAAE,CAAC;IACtC,MAAM,gBAAgB,GAAG,OAAO,GAAG,EAAE,CAAC;IAEtC,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACd,OAAO,GAAG,KAAK,KAAK,gBAAgB,KAAK,gBAAgB,GAAG,CAAC;IAC/D,CAAC;SAAM,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,GAAG,gBAAgB,KAAK,gBAAgB,GAAG,CAAC;I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CAAC,CAAC;gBAClF,OAAO;oBACL,OAAO,EAAE;wBACP;4BACE,IAAI,EAAE,MAAM;4BACZ,IAAI,EAAE,uBAAuB,SAAS,CAAC,UAAU,wIAAwI;yBAC1L;qBACF;oBACD,OAAO,EAAE,IAAI;iBACd,CAAC;YACJ,CAAC;YAED,eAAe,CACb,MAAM,EACN,0BAA0B,iBAAiB,CAAC,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CACrE,CAAC;YAEF,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC9E,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,eAAe,CACb,MAAM,EACN,uBAAuB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAChF,CAAC;YACF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,uBAAuB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACtF;iBACF;gBACD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +1,30 @@
|
|
|
1
|
+
export interface ContentMapSegment {
|
|
2
|
+
type: 'html' | 'widget';
|
|
3
|
+
start: number;
|
|
4
|
+
end: number;
|
|
5
|
+
content?: string;
|
|
6
|
+
widgetId?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ContentMap {
|
|
9
|
+
totalLength: number;
|
|
10
|
+
segments: ContentMapSegment[];
|
|
11
|
+
}
|
|
1
12
|
export declare const RICHSTRING_WIDGET_TYPES: readonly ["cf.platform.richString", "cf.cplace.demoWidgets.demoRichString"];
|
|
2
|
-
export type RichStringWidgetType = typeof RICHSTRING_WIDGET_TYPES[number];
|
|
13
|
+
export type RichStringWidgetType = (typeof RICHSTRING_WIDGET_TYPES)[number];
|
|
3
14
|
export declare function extractStringConfigValue(configuration: any, configAttribute: string): string;
|
|
4
15
|
export declare function isRichStringWidgetType(widgetType: string): boolean;
|
|
5
16
|
export declare const SCRIPT_EXECUTING_WIDGETS: Readonly<Record<string, string>>;
|
|
6
17
|
export declare function getScriptPropertyKey(widgetType: string): string | undefined;
|
|
18
|
+
export declare function parseScriptEnvelope(value: unknown): string;
|
|
19
|
+
export interface EmbeddedWidgetSnapshot {
|
|
20
|
+
widgetId: string;
|
|
21
|
+
widgetType: string;
|
|
22
|
+
properties: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
export interface ParsedDecodedContent {
|
|
25
|
+
embeddedWidgets: EmbeddedWidgetSnapshot[];
|
|
26
|
+
contentMap: ContentMap;
|
|
27
|
+
}
|
|
28
|
+
export declare function parseDecodedRichStringContent(rawContent: string): ParsedDecodedContent;
|
|
29
|
+
export declare function reassembleDecodedContent(contentMap: ContentMap, widgetsById: Map<string, EmbeddedWidgetSnapshot>): string;
|
|
7
30
|
//# sourceMappingURL=layout-richstring-shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-richstring-shared.d.ts","sourceRoot":"","sources":["../../src/tools/layout-richstring-shared.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB,6EAG1B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"layout-richstring-shared.d.ts","sourceRoot":"","sources":["../../src/tools/layout-richstring-shared.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxB,KAAK,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|
export const RICHSTRING_WIDGET_TYPES = [
|
|
2
2
|
'cf.platform.richString',
|
|
3
|
-
'cf.cplace.demoWidgets.demoRichString'
|
|
3
|
+
'cf.cplace.demoWidgets.demoRichString',
|
|
4
4
|
];
|
|
5
5
|
export function extractStringConfigValue(configuration, configAttribute) {
|
|
6
6
|
if (!configuration)
|
|
@@ -42,4 +42,102 @@ export const SCRIPT_EXECUTING_WIDGETS = {
|
|
|
42
42
|
export function getScriptPropertyKey(widgetType) {
|
|
43
43
|
return SCRIPT_EXECUTING_WIDGETS[widgetType];
|
|
44
44
|
}
|
|
45
|
+
export function parseScriptEnvelope(value) {
|
|
46
|
+
if (typeof value !== 'string')
|
|
47
|
+
return '';
|
|
48
|
+
const trimmed = value.trim();
|
|
49
|
+
if (!trimmed.startsWith('{') || !trimmed.endsWith('}'))
|
|
50
|
+
return value;
|
|
51
|
+
try {
|
|
52
|
+
const parsed = JSON.parse(trimmed);
|
|
53
|
+
if (parsed && typeof parsed === 'object' && typeof parsed.script === 'string') {
|
|
54
|
+
return parsed.script;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}
|
|
61
|
+
export function parseDecodedRichStringContent(rawContent) {
|
|
62
|
+
const totalLength = rawContent ? rawContent.length : 0;
|
|
63
|
+
if (!rawContent) {
|
|
64
|
+
return { embeddedWidgets: [], contentMap: { totalLength: 0, segments: [] } };
|
|
65
|
+
}
|
|
66
|
+
const tagRegex = /<decoded-widget\s+([^>]*?)>([\s\S]*?)<\/decoded-widget>/g;
|
|
67
|
+
const idAttrRegex = /\bid="([^"]+)"/;
|
|
68
|
+
const typeAttrRegex = /\btype="([^"]+)"/;
|
|
69
|
+
const embeddedWidgets = [];
|
|
70
|
+
const segments = [];
|
|
71
|
+
let cursor = 0;
|
|
72
|
+
let m;
|
|
73
|
+
while ((m = tagRegex.exec(rawContent)) !== null) {
|
|
74
|
+
const fullStart = m.index;
|
|
75
|
+
const fullEnd = fullStart + m[0].length;
|
|
76
|
+
const attrs = m[1] ?? '';
|
|
77
|
+
const body = m[2] ?? '';
|
|
78
|
+
const idMatch = idAttrRegex.exec(attrs);
|
|
79
|
+
const typeMatch = typeAttrRegex.exec(attrs);
|
|
80
|
+
if (!idMatch || !typeMatch) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (cursor < fullStart) {
|
|
84
|
+
segments.push({
|
|
85
|
+
type: 'html',
|
|
86
|
+
start: cursor,
|
|
87
|
+
end: fullStart,
|
|
88
|
+
content: rawContent.substring(cursor, fullStart),
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
let properties = {};
|
|
92
|
+
try {
|
|
93
|
+
const parsed = JSON.parse(body);
|
|
94
|
+
if (parsed &&
|
|
95
|
+
typeof parsed === 'object' &&
|
|
96
|
+
parsed.properties &&
|
|
97
|
+
typeof parsed.properties === 'object') {
|
|
98
|
+
properties = parsed.properties;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
}
|
|
103
|
+
embeddedWidgets.push({
|
|
104
|
+
widgetId: idMatch[1],
|
|
105
|
+
widgetType: typeMatch[1],
|
|
106
|
+
properties,
|
|
107
|
+
});
|
|
108
|
+
segments.push({
|
|
109
|
+
type: 'widget',
|
|
110
|
+
start: fullStart,
|
|
111
|
+
end: fullEnd,
|
|
112
|
+
widgetId: idMatch[1],
|
|
113
|
+
});
|
|
114
|
+
cursor = fullEnd;
|
|
115
|
+
}
|
|
116
|
+
if (cursor < totalLength) {
|
|
117
|
+
segments.push({
|
|
118
|
+
type: 'html',
|
|
119
|
+
start: cursor,
|
|
120
|
+
end: totalLength,
|
|
121
|
+
content: rawContent.substring(cursor, totalLength),
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return { embeddedWidgets, contentMap: { totalLength, segments } };
|
|
125
|
+
}
|
|
126
|
+
export function reassembleDecodedContent(contentMap, widgetsById) {
|
|
127
|
+
const parts = [];
|
|
128
|
+
for (const seg of contentMap.segments) {
|
|
129
|
+
if (seg.type === 'html') {
|
|
130
|
+
parts.push(seg.content ?? '');
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const w = widgetsById.get(seg.widgetId);
|
|
134
|
+
if (!w) {
|
|
135
|
+
throw new Error(`reassembleDecodedContent: widget '${seg.widgetId}' missing from snapshot map`);
|
|
136
|
+
}
|
|
137
|
+
const payload = JSON.stringify({ properties: w.properties });
|
|
138
|
+
parts.push(`<decoded-widget id="${w.widgetId}" type="${w.widgetType}">${payload}</decoded-widget>`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return parts.join('');
|
|
142
|
+
}
|
|
45
143
|
//# sourceMappingURL=layout-richstring-shared.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-richstring-shared.js","sourceRoot":"","sources":["../../src/tools/layout-richstring-shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout-richstring-shared.js","sourceRoot":"","sources":["../../src/tools/layout-richstring-shared.ts"],"names":[],"mappings":"AAuCA,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,wBAAwB;IACxB,sCAAsC;CAC9B,CAAC;AAWX,MAAM,UAAU,wBAAwB,CAAC,aAAkB,EAAE,eAAuB;IAClF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE9B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QAClC,IAAI,OAAO,aAAa,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAC;QACjD,MAAM,KAAK,GAAG,aAAa,CAAC,eAAe,CAAC,CAAC;QAC7C,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;YAAE,OAAO,EAAE,CAAC;QACrD,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,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C;AACxB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { McpServer } from
|
|
2
|
-
import { z } from
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
3
|
import { CplaceApiClient } from '../api.js';
|
|
4
4
|
export declare const LAYOUT_RICHSTRING_WIDGET_TOOL_DEFINITIONS: {
|
|
5
5
|
readonly cplace_layout_richstring_extract_widgets: {
|
|
@@ -44,6 +44,98 @@ export declare const LAYOUT_RICHSTRING_WIDGET_TOOL_DEFINITIONS: {
|
|
|
44
44
|
readonly title: "Extract Embedded Widgets from Layout Widget RichString";
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
|
+
readonly cplace_richstring_set_widget_script: {
|
|
48
|
+
readonly description: "Replace the entire script body of a script-typed attribute on an embedded widget inside a layout-resident rich-string container. Reads the layout, modifies the target attribute, and writes back via a single layout.updateWidget call — atomic.\n\nWhy this tool exists. When a rich-string widget (cf.platform.richString, cf.cplace.demoWidgets.demoRichString) is placed in a page or type layout via cplace_execute_layout_script, embedded widgets travel inline as <decoded-widget> tags. Authoring a script attribute inline forces it through four nested encoding layers (HTML → JSON → JS string literal → MCP wire). Use this tool instead: the script arrives as a plain string in a structured tool argument.\n\nWorkflow.\n1. Place the rich-string container with embedded children via cplace_execute_layout_script, initializing each script attribute to a minimal placeholder body (e.g. return '';).\n2. Run cplace_layout_richstring_extract_widgets to discover embedded widget IDs.\n3. For each embedded widget, call this tool with the real script body.\n\nKnown script-bearing embedded widget types and their attribute keys:\n- cf.cplace.lowCodeWidgets.lowCodeText → cf.cplace.lowCodeWidgets.lowCodeTextWidget.script\n- cf.cplace.lowCodeWidgets.lowCodeButton → cf.cplace.lowCodeWidgets.lowCodeButtonWidget.script\n- cf.cplace.visualizations.scriptingHighcharts → cf.cplace.visualization.script\n- cf.cplace.visualizations.scriptingLineChart → cf.cplace.visualization.script\n- cf.cplace.dynamicCodeBlockWidget.dynamicCodeBlockWidget → cf.cplace.dynamicCodeBlockWidget.script\n\nPassing a non-script attribute key writes the value as a string into that attribute (no guard) — verify the attribute key matches a script-typed attribute on the target widget type.";
|
|
49
|
+
readonly inputSchema: {
|
|
50
|
+
readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
|
|
51
|
+
type: z.ZodLiteral<"page">;
|
|
52
|
+
pageUID: z.ZodString;
|
|
53
|
+
}, "strip", z.ZodTypeAny, {
|
|
54
|
+
type: "page";
|
|
55
|
+
pageUID: string;
|
|
56
|
+
}, {
|
|
57
|
+
type: "page";
|
|
58
|
+
pageUID: string;
|
|
59
|
+
}>, z.ZodObject<{
|
|
60
|
+
type: z.ZodLiteral<"type">;
|
|
61
|
+
workspaceId: z.ZodString;
|
|
62
|
+
typeInternalName: z.ZodString;
|
|
63
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
type: "type";
|
|
66
|
+
workspaceId: string;
|
|
67
|
+
typeInternalName: string;
|
|
68
|
+
alternativeLayoutName?: string | undefined;
|
|
69
|
+
}, {
|
|
70
|
+
type: "type";
|
|
71
|
+
workspaceId: string;
|
|
72
|
+
typeInternalName: string;
|
|
73
|
+
alternativeLayoutName?: string | undefined;
|
|
74
|
+
}>]>, {
|
|
75
|
+
type: "page";
|
|
76
|
+
pageUID: string;
|
|
77
|
+
} | {
|
|
78
|
+
type: "type";
|
|
79
|
+
workspaceId: string;
|
|
80
|
+
typeInternalName: string;
|
|
81
|
+
alternativeLayoutName?: string | undefined;
|
|
82
|
+
}, unknown>;
|
|
83
|
+
readonly containerWidgetId: z.ZodString;
|
|
84
|
+
readonly embeddedWidgetId: z.ZodString;
|
|
85
|
+
readonly attributeKey: z.ZodString;
|
|
86
|
+
readonly script: z.ZodString;
|
|
87
|
+
};
|
|
88
|
+
readonly annotations: {
|
|
89
|
+
readonly title: "Set Embedded Widget Script in Layout RichString";
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
readonly cplace_richstring_edit_widget_script: {
|
|
93
|
+
readonly description: "Apply a string-replacement edit to the script body of a script-typed attribute on an embedded widget inside a layout-resident rich-string container. oldString must match the current raw script body exactly once unless replaceAll is true. Atomic via a single layout.updateWidget call.\n\nUse this tool for iterative refinement of an already-set script body — small, focused diffs over the wire instead of resending the full script. Mirrors the contract of the file Edit tool: matches against the raw script body (the stored CplaceJsScript envelope is unwrapped server-side before matching), fails fast on zero or duplicate matches.\n\nSame target shape and constraints as cplace_richstring_set_widget_script — see that tool's description for the placeholder workflow, the list of script-bearing widget types, and the addressing model.";
|
|
94
|
+
readonly inputSchema: {
|
|
95
|
+
readonly context: z.ZodEffects<z.ZodUnion<[z.ZodObject<{
|
|
96
|
+
type: z.ZodLiteral<"page">;
|
|
97
|
+
pageUID: z.ZodString;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
type: "page";
|
|
100
|
+
pageUID: string;
|
|
101
|
+
}, {
|
|
102
|
+
type: "page";
|
|
103
|
+
pageUID: string;
|
|
104
|
+
}>, z.ZodObject<{
|
|
105
|
+
type: z.ZodLiteral<"type">;
|
|
106
|
+
workspaceId: z.ZodString;
|
|
107
|
+
typeInternalName: z.ZodString;
|
|
108
|
+
alternativeLayoutName: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
type: "type";
|
|
111
|
+
workspaceId: string;
|
|
112
|
+
typeInternalName: string;
|
|
113
|
+
alternativeLayoutName?: string | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
type: "type";
|
|
116
|
+
workspaceId: string;
|
|
117
|
+
typeInternalName: string;
|
|
118
|
+
alternativeLayoutName?: string | undefined;
|
|
119
|
+
}>]>, {
|
|
120
|
+
type: "page";
|
|
121
|
+
pageUID: string;
|
|
122
|
+
} | {
|
|
123
|
+
type: "type";
|
|
124
|
+
workspaceId: string;
|
|
125
|
+
typeInternalName: string;
|
|
126
|
+
alternativeLayoutName?: string | undefined;
|
|
127
|
+
}, unknown>;
|
|
128
|
+
readonly containerWidgetId: z.ZodString;
|
|
129
|
+
readonly embeddedWidgetId: z.ZodString;
|
|
130
|
+
readonly attributeKey: z.ZodString;
|
|
131
|
+
readonly oldString: z.ZodString;
|
|
132
|
+
readonly newString: z.ZodString;
|
|
133
|
+
readonly replaceAll: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
134
|
+
};
|
|
135
|
+
readonly annotations: {
|
|
136
|
+
readonly title: "Edit Embedded Widget Script in Layout RichString";
|
|
137
|
+
};
|
|
138
|
+
};
|
|
47
139
|
};
|
|
48
140
|
export declare function registerLayoutRichStringWidgetTools(server: McpServer, client: CplaceApiClient): void;
|
|
49
141
|
//# sourceMappingURL=layout-richstring-widgets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-richstring-widgets.d.ts","sourceRoot":"","sources":["../../src/tools/layout-richstring-widgets.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;
|
|
1
|
+
{"version":3,"file":"layout-richstring-widgets.d.ts","sourceRoot":"","sources":["../../src/tools/layout-richstring-widgets.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;AAsD5C,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoE5C,CAAC;AAuFX,wBAAgB,mCAAmC,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAoN7F"}
|