@centrali-io/centrali-mcp 5.1.2 → 5.3.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 +15 -0
- package/dist/index.js +2 -0
- package/dist/tools/_register.d.ts +24 -0
- package/dist/tools/_register.js +44 -0
- package/dist/tools/auth-providers.js +15 -30
- package/dist/tools/compute.js +48 -69
- package/dist/tools/describe.js +174 -21
- package/dist/tools/insights.js +13 -36
- package/dist/tools/orchestrations.js +21 -44
- package/dist/tools/pages.js +39 -61
- package/dist/tools/records.js +29 -50
- package/dist/tools/search.js +3 -24
- package/dist/tools/service-accounts.js +93 -108
- package/dist/tools/smart-queries.js +15 -36
- package/dist/tools/structures.js +23 -61
- package/dist/tools/validation.js +11 -34
- package/dist/tools/webhook-subscriptions.d.ts +3 -0
- package/dist/tools/webhook-subscriptions.js +292 -0
- package/package.json +5 -6
- package/src/index.ts +2 -0
- package/src/tools/_register.ts +53 -0
- package/src/tools/auth-providers.ts +8 -24
- package/src/tools/compute.ts +25 -46
- package/src/tools/describe.ts +200 -21
- package/src/tools/insights.ts +19 -28
- package/src/tools/orchestrations.ts +11 -34
- package/src/tools/pages.ts +20 -41
- package/src/tools/records.ts +15 -36
- package/src/tools/search.ts +7 -22
- package/src/tools/service-accounts.ts +47 -63
- package/src/tools/smart-queries.ts +8 -29
- package/src/tools/structures.ts +12 -50
- package/src/tools/validation.ts +21 -27
- package/src/tools/webhook-subscriptions.ts +363 -0
|
@@ -11,32 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.registerOrchestrationTools = registerOrchestrationTools;
|
|
13
13
|
const zod_1 = require("zod");
|
|
14
|
-
|
|
15
|
-
var _a, _b;
|
|
16
|
-
if (error && typeof error === "object") {
|
|
17
|
-
const e = error;
|
|
18
|
-
if ("message" in e) {
|
|
19
|
-
let msg = `Error ${context}`;
|
|
20
|
-
if ("code" in e || "status" in e) {
|
|
21
|
-
msg += `: [${(_b = (_a = e.code) !== null && _a !== void 0 ? _a : e.status) !== null && _b !== void 0 ? _b : "ERROR"}] ${e.message}`;
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
msg += `: ${e.message}`;
|
|
25
|
-
}
|
|
26
|
-
if (Array.isArray(e.fieldErrors) && e.fieldErrors.length > 0) {
|
|
27
|
-
msg +=
|
|
28
|
-
"\nField errors:\n" +
|
|
29
|
-
e.fieldErrors
|
|
30
|
-
.map((f) => ` ${f.field}: ${f.message}`)
|
|
31
|
-
.join("\n");
|
|
32
|
-
}
|
|
33
|
-
return msg;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return `Error ${context}: ${error instanceof Error ? error.message : String(error)}`;
|
|
37
|
-
}
|
|
14
|
+
const _register_js_1 = require("./_register.js");
|
|
38
15
|
function registerOrchestrationTools(server, sdk) {
|
|
39
|
-
|
|
16
|
+
(0, _register_js_1.registerTool)(server, "list_orchestrations", "List all orchestrations in the workspace. Orchestrations are multi-step workflows that chain compute functions together.", {
|
|
40
17
|
offset: zod_1.z.number().optional().describe("Number of results to skip (for pagination)"),
|
|
41
18
|
limit: zod_1.z.number().optional().describe("Results per page"),
|
|
42
19
|
status: zod_1.z
|
|
@@ -59,12 +36,12 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
59
36
|
}
|
|
60
37
|
catch (error) {
|
|
61
38
|
return {
|
|
62
|
-
content: [{ type: "text", text: formatError(error, "listing orchestrations") }],
|
|
39
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "listing orchestrations") }],
|
|
63
40
|
isError: true,
|
|
64
41
|
};
|
|
65
42
|
}
|
|
66
43
|
}));
|
|
67
|
-
|
|
44
|
+
(0, _register_js_1.registerTool)(server, "get_orchestration", "Get full details of a single orchestration by ID, including its step definitions.", {
|
|
68
45
|
orchestrationId: zod_1.z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123)"),
|
|
69
46
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ orchestrationId }) {
|
|
70
47
|
try {
|
|
@@ -78,14 +55,14 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
78
55
|
content: [
|
|
79
56
|
{
|
|
80
57
|
type: "text",
|
|
81
|
-
text: formatError(error, `getting orchestration '${orchestrationId}'`),
|
|
58
|
+
text: (0, _register_js_1.formatError)(error, `getting orchestration '${orchestrationId}'`),
|
|
82
59
|
},
|
|
83
60
|
],
|
|
84
61
|
isError: true,
|
|
85
62
|
};
|
|
86
63
|
}
|
|
87
64
|
}));
|
|
88
|
-
|
|
65
|
+
(0, _register_js_1.registerTool)(server, "trigger_orchestration", "Trigger an orchestration run. Creates a new run instance and starts executing the workflow. Optionally pass input data to the run.", {
|
|
89
66
|
orchestrationId: zod_1.z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to trigger"),
|
|
90
67
|
input: zod_1.z
|
|
91
68
|
.record(zod_1.z.string(), zod_1.z.any())
|
|
@@ -112,14 +89,14 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
112
89
|
content: [
|
|
113
90
|
{
|
|
114
91
|
type: "text",
|
|
115
|
-
text: formatError(error, `triggering orchestration '${orchestrationId}'`),
|
|
92
|
+
text: (0, _register_js_1.formatError)(error, `triggering orchestration '${orchestrationId}'`),
|
|
116
93
|
},
|
|
117
94
|
],
|
|
118
95
|
isError: true,
|
|
119
96
|
};
|
|
120
97
|
}
|
|
121
98
|
}));
|
|
122
|
-
|
|
99
|
+
(0, _register_js_1.registerTool)(server, "list_orchestration_runs", "List all runs for an orchestration. Runs represent individual executions of the workflow.", {
|
|
123
100
|
orchestrationId: zod_1.z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123)"),
|
|
124
101
|
offset: zod_1.z.number().optional().describe("Number of results to skip (for pagination)"),
|
|
125
102
|
limit: zod_1.z.number().optional().describe("Results per page"),
|
|
@@ -146,14 +123,14 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
146
123
|
content: [
|
|
147
124
|
{
|
|
148
125
|
type: "text",
|
|
149
|
-
text: formatError(error, `listing runs for orchestration '${orchestrationId}'`),
|
|
126
|
+
text: (0, _register_js_1.formatError)(error, `listing runs for orchestration '${orchestrationId}'`),
|
|
150
127
|
},
|
|
151
128
|
],
|
|
152
129
|
isError: true,
|
|
153
130
|
};
|
|
154
131
|
}
|
|
155
132
|
}));
|
|
156
|
-
|
|
133
|
+
(0, _register_js_1.registerTool)(server, "get_orchestration_run", "Get details of a specific orchestration run. Set includeSteps=true to see step-by-step execution history.", {
|
|
157
134
|
orchestrationId: zod_1.z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123)"),
|
|
158
135
|
runId: zod_1.z.string().describe("The run ID (prefixed, e.g. orun_abc123)"),
|
|
159
136
|
includeSteps: zod_1.z
|
|
@@ -172,14 +149,14 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
172
149
|
content: [
|
|
173
150
|
{
|
|
174
151
|
type: "text",
|
|
175
|
-
text: formatError(error, `getting run '${runId}' for orchestration '${orchestrationId}'`),
|
|
152
|
+
text: (0, _register_js_1.formatError)(error, `getting run '${runId}' for orchestration '${orchestrationId}'`),
|
|
176
153
|
},
|
|
177
154
|
],
|
|
178
155
|
isError: true,
|
|
179
156
|
};
|
|
180
157
|
}
|
|
181
158
|
}));
|
|
182
|
-
|
|
159
|
+
(0, _register_js_1.registerTool)(server, "create_orchestration", "Create a new orchestration workflow. Orchestrations chain compute functions together in multi-step workflows.", {
|
|
183
160
|
slug: zod_1.z.string().describe("URL-friendly unique slug (e.g., 'order-processing')"),
|
|
184
161
|
name: zod_1.z.string().describe("Human-readable name"),
|
|
185
162
|
description: zod_1.z.string().optional().describe("Optional description of the workflow"),
|
|
@@ -204,14 +181,14 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
204
181
|
content: [
|
|
205
182
|
{
|
|
206
183
|
type: "text",
|
|
207
|
-
text: formatError(error, `creating orchestration '${slug}'`),
|
|
184
|
+
text: (0, _register_js_1.formatError)(error, `creating orchestration '${slug}'`),
|
|
208
185
|
},
|
|
209
186
|
],
|
|
210
187
|
isError: true,
|
|
211
188
|
};
|
|
212
189
|
}
|
|
213
190
|
}));
|
|
214
|
-
|
|
191
|
+
(0, _register_js_1.registerTool)(server, "update_orchestration", "Update an existing orchestration by ID. Only include the fields you want to change.", {
|
|
215
192
|
orchestrationId: zod_1.z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to update"),
|
|
216
193
|
name: zod_1.z.string().optional().describe("Updated name"),
|
|
217
194
|
description: zod_1.z.string().optional().describe("Updated description"),
|
|
@@ -250,14 +227,14 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
250
227
|
content: [
|
|
251
228
|
{
|
|
252
229
|
type: "text",
|
|
253
|
-
text: formatError(error, `updating orchestration '${orchestrationId}'`),
|
|
230
|
+
text: (0, _register_js_1.formatError)(error, `updating orchestration '${orchestrationId}'`),
|
|
254
231
|
},
|
|
255
232
|
],
|
|
256
233
|
isError: true,
|
|
257
234
|
};
|
|
258
235
|
}
|
|
259
236
|
}));
|
|
260
|
-
|
|
237
|
+
(0, _register_js_1.registerTool)(server, "delete_orchestration", "Delete an orchestration by ID. This also deletes all runs associated with the orchestration.", {
|
|
261
238
|
orchestrationId: zod_1.z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to delete"),
|
|
262
239
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ orchestrationId }) {
|
|
263
240
|
try {
|
|
@@ -276,14 +253,14 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
276
253
|
content: [
|
|
277
254
|
{
|
|
278
255
|
type: "text",
|
|
279
|
-
text: formatError(error, `deleting orchestration '${orchestrationId}'`),
|
|
256
|
+
text: (0, _register_js_1.formatError)(error, `deleting orchestration '${orchestrationId}'`),
|
|
280
257
|
},
|
|
281
258
|
],
|
|
282
259
|
isError: true,
|
|
283
260
|
};
|
|
284
261
|
}
|
|
285
262
|
}));
|
|
286
|
-
|
|
263
|
+
(0, _register_js_1.registerTool)(server, "activate_orchestration", "Activate an orchestration. Active orchestrations can be triggered by scheduled events, record events, and webhooks.", {
|
|
287
264
|
orchestrationId: zod_1.z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to activate"),
|
|
288
265
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ orchestrationId }) {
|
|
289
266
|
try {
|
|
@@ -297,14 +274,14 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
297
274
|
content: [
|
|
298
275
|
{
|
|
299
276
|
type: "text",
|
|
300
|
-
text: formatError(error, `activating orchestration '${orchestrationId}'`),
|
|
277
|
+
text: (0, _register_js_1.formatError)(error, `activating orchestration '${orchestrationId}'`),
|
|
301
278
|
},
|
|
302
279
|
],
|
|
303
280
|
isError: true,
|
|
304
281
|
};
|
|
305
282
|
}
|
|
306
283
|
}));
|
|
307
|
-
|
|
284
|
+
(0, _register_js_1.registerTool)(server, "pause_orchestration", "Pause an orchestration. Paused orchestrations cannot be triggered by any mechanism.", {
|
|
308
285
|
orchestrationId: zod_1.z.string().describe("The orchestration ID (prefixed, e.g. orch_abc123) to pause"),
|
|
309
286
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ orchestrationId }) {
|
|
310
287
|
try {
|
|
@@ -318,7 +295,7 @@ function registerOrchestrationTools(server, sdk) {
|
|
|
318
295
|
content: [
|
|
319
296
|
{
|
|
320
297
|
type: "text",
|
|
321
|
-
text: formatError(error, `pausing orchestration '${orchestrationId}'`),
|
|
298
|
+
text: (0, _register_js_1.formatError)(error, `pausing orchestration '${orchestrationId}'`),
|
|
322
299
|
},
|
|
323
300
|
],
|
|
324
301
|
isError: true,
|
package/dist/tools/pages.js
CHANGED
|
@@ -14,30 +14,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.registerPageTools = registerPageTools;
|
|
16
16
|
const zod_1 = require("zod");
|
|
17
|
+
const _register_js_1 = require("./_register.js");
|
|
17
18
|
const axios_1 = __importDefault(require("axios"));
|
|
18
|
-
function formatError(error, context) {
|
|
19
|
-
var _a, _b, _c;
|
|
20
|
-
if (axios_1.default.isAxiosError(error) && ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data)) {
|
|
21
|
-
const body = error.response.data;
|
|
22
|
-
const status = error.response.status;
|
|
23
|
-
const message = body.message || body.error || error.message;
|
|
24
|
-
return `Error ${context}: [${status}] ${message}`;
|
|
25
|
-
}
|
|
26
|
-
if (error && typeof error === "object") {
|
|
27
|
-
const e = error;
|
|
28
|
-
if ("message" in e) {
|
|
29
|
-
let msg = `Error ${context}`;
|
|
30
|
-
if ("code" in e || "status" in e) {
|
|
31
|
-
msg += `: [${(_c = (_b = e.code) !== null && _b !== void 0 ? _b : e.status) !== null && _c !== void 0 ? _c : "ERROR"}] ${e.message}`;
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
msg += `: ${e.message}`;
|
|
35
|
-
}
|
|
36
|
-
return msg;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return `Error ${context}: ${error instanceof Error ? error.message : String(error)}`;
|
|
40
|
-
}
|
|
41
19
|
/**
|
|
42
20
|
* Derives the pages API base URL from the CENTRALI_URL.
|
|
43
21
|
* Pattern: https://centrali.io -> https://api.centrali.io/pages
|
|
@@ -117,7 +95,7 @@ function registerPageTools(server, sdk, centraliUrl, workspaceId) {
|
|
|
117
95
|
const { client } = createPagesClient(sdk, centraliUrl, workspaceId);
|
|
118
96
|
const basePath = `/ws/${workspaceId}/api/v1/pages`;
|
|
119
97
|
// ── Page CRUD ──────────────────────────────────────────────────────
|
|
120
|
-
|
|
98
|
+
(0, _register_js_1.registerTool)(server, "list_pages", "List all pages in the workspace. Pages are pre-built UI views (lists, detail views, forms, dashboards) that surface data from collections.", {
|
|
121
99
|
page: zod_1.z.number().optional().describe("Page number (1-indexed, default: 1)"),
|
|
122
100
|
pageSize: zod_1.z.number().optional().describe("Items per page (default: 20)"),
|
|
123
101
|
pageType: zod_1.z
|
|
@@ -140,12 +118,12 @@ function registerPageTools(server, sdk, centraliUrl, workspaceId) {
|
|
|
140
118
|
}
|
|
141
119
|
catch (error) {
|
|
142
120
|
return {
|
|
143
|
-
content: [{ type: "text", text: formatError(error, "listing pages") }],
|
|
121
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "listing pages") }],
|
|
144
122
|
isError: true,
|
|
145
123
|
};
|
|
146
124
|
}
|
|
147
125
|
}));
|
|
148
|
-
|
|
126
|
+
(0, _register_js_1.registerTool)(server, "get_page", "Get a page by its ID. Returns the page metadata including name, slug, type, and description.", {
|
|
149
127
|
pageId: zod_1.z.string().describe("The page ID (UUID)"),
|
|
150
128
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ pageId }) {
|
|
151
129
|
try {
|
|
@@ -156,12 +134,12 @@ function registerPageTools(server, sdk, centraliUrl, workspaceId) {
|
|
|
156
134
|
}
|
|
157
135
|
catch (error) {
|
|
158
136
|
return {
|
|
159
|
-
content: [{ type: "text", text: formatError(error, `getting page '${pageId}'`) }],
|
|
137
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `getting page '${pageId}'`) }],
|
|
160
138
|
isError: true,
|
|
161
139
|
};
|
|
162
140
|
}
|
|
163
141
|
}));
|
|
164
|
-
|
|
142
|
+
(0, _register_js_1.registerTool)(server, "create_page", `Create a new page in the workspace. A page is a UI view backed by data from collections. Specify the page type: 'list' for data tables, 'detail' for single-record views, 'form' for data entry, 'dashboard' for metrics and charts.
|
|
165
143
|
|
|
166
144
|
Navigate-to-page actions can use config.useQueryParams: true to pass selected row fields as URL query params to the target page. Pair with paramConfig: { source: 'row', mode: 'selected', selectedFields: ['id'] } to control which fields are passed. Use config.paramMapping: { sourceField: 'targetParam' } to rename fields in the URL (e.g., { requestId: 'id' } passes ?id=<value> instead of ?requestId=<value>). The target detail page can then use variable bindings with { source: 'url', param: 'id' } to read those params.`, {
|
|
167
145
|
name: zod_1.z.string().describe("Display name for the page (e.g., 'Customer List')"),
|
|
@@ -179,12 +157,12 @@ Navigate-to-page actions can use config.useQueryParams: true to pass selected ro
|
|
|
179
157
|
}
|
|
180
158
|
catch (error) {
|
|
181
159
|
return {
|
|
182
|
-
content: [{ type: "text", text: formatError(error, "creating page") }],
|
|
160
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "creating page") }],
|
|
183
161
|
isError: true,
|
|
184
162
|
};
|
|
185
163
|
}
|
|
186
164
|
}));
|
|
187
|
-
|
|
165
|
+
(0, _register_js_1.registerTool)(server, "update_page", "Update a page's metadata (name, slug, description). Does not modify the page definition — use save_page_draft for that.", {
|
|
188
166
|
pageId: zod_1.z.string().describe("The page ID (UUID) to update"),
|
|
189
167
|
name: zod_1.z.string().optional().describe("New display name"),
|
|
190
168
|
slug: zod_1.z.string().optional().describe("New URL slug"),
|
|
@@ -208,12 +186,12 @@ Navigate-to-page actions can use config.useQueryParams: true to pass selected ro
|
|
|
208
186
|
}
|
|
209
187
|
catch (error) {
|
|
210
188
|
return {
|
|
211
|
-
content: [{ type: "text", text: formatError(error, `updating page '${pageId}'`) }],
|
|
189
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `updating page '${pageId}'`) }],
|
|
212
190
|
isError: true,
|
|
213
191
|
};
|
|
214
192
|
}
|
|
215
193
|
}));
|
|
216
|
-
|
|
194
|
+
(0, _register_js_1.registerTool)(server, "delete_page", "Soft-delete a page by its ID. The page will no longer be accessible but can potentially be restored.", {
|
|
217
195
|
pageId: zod_1.z.string().describe("The page ID (UUID) to delete"),
|
|
218
196
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ pageId }) {
|
|
219
197
|
try {
|
|
@@ -224,13 +202,13 @@ Navigate-to-page actions can use config.useQueryParams: true to pass selected ro
|
|
|
224
202
|
}
|
|
225
203
|
catch (error) {
|
|
226
204
|
return {
|
|
227
|
-
content: [{ type: "text", text: formatError(error, `deleting page '${pageId}'`) }],
|
|
205
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `deleting page '${pageId}'`) }],
|
|
228
206
|
isError: true,
|
|
229
207
|
};
|
|
230
208
|
}
|
|
231
209
|
}));
|
|
232
210
|
// ── Drafts & Versions ─────────────────────────────────────────────
|
|
233
|
-
|
|
211
|
+
(0, _register_js_1.registerTool)(server, "save_page_draft", `Save or update the draft definition for a page. The definition describes the page's layout: sections, blocks, data sources, actions, and presentation. This does NOT publish the page — use publish_page after saving.
|
|
234
212
|
|
|
235
213
|
Each block's dataSource can include an optional 'variables' map for runtime variable binding:
|
|
236
214
|
variables: { [varName]: { source, param?, field?, value? } }
|
|
@@ -267,12 +245,12 @@ Common patterns:
|
|
|
267
245
|
}
|
|
268
246
|
catch (error) {
|
|
269
247
|
return {
|
|
270
|
-
content: [{ type: "text", text: formatError(error, `saving draft for page '${pageId}'`) }],
|
|
248
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `saving draft for page '${pageId}'`) }],
|
|
271
249
|
isError: true,
|
|
272
250
|
};
|
|
273
251
|
}
|
|
274
252
|
}));
|
|
275
|
-
|
|
253
|
+
(0, _register_js_1.registerTool)(server, "get_page_draft", "Get the current draft version of a page, including its full definition (sections, blocks, data sources).", {
|
|
276
254
|
pageId: zod_1.z.string().describe("The page ID (UUID)"),
|
|
277
255
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ pageId }) {
|
|
278
256
|
try {
|
|
@@ -283,12 +261,12 @@ Common patterns:
|
|
|
283
261
|
}
|
|
284
262
|
catch (error) {
|
|
285
263
|
return {
|
|
286
|
-
content: [{ type: "text", text: formatError(error, `getting draft for page '${pageId}'`) }],
|
|
264
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `getting draft for page '${pageId}'`) }],
|
|
287
265
|
isError: true,
|
|
288
266
|
};
|
|
289
267
|
}
|
|
290
268
|
}));
|
|
291
|
-
|
|
269
|
+
(0, _register_js_1.registerTool)(server, "list_page_versions", "List all versions of a page. Each version captures a snapshot of the page definition at a point in time.", {
|
|
292
270
|
pageId: zod_1.z.string().describe("The page ID (UUID)"),
|
|
293
271
|
page: zod_1.z.number().optional().describe("Page number (1-indexed, default: 1)"),
|
|
294
272
|
pageSize: zod_1.z.number().optional().describe("Items per page (default: 20)"),
|
|
@@ -306,13 +284,13 @@ Common patterns:
|
|
|
306
284
|
}
|
|
307
285
|
catch (error) {
|
|
308
286
|
return {
|
|
309
|
-
content: [{ type: "text", text: formatError(error, `listing versions for page '${pageId}'`) }],
|
|
287
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `listing versions for page '${pageId}'`) }],
|
|
310
288
|
isError: true,
|
|
311
289
|
};
|
|
312
290
|
}
|
|
313
291
|
}));
|
|
314
292
|
// ── Publishing ────────────────────────────────────────────────────
|
|
315
|
-
|
|
293
|
+
(0, _register_js_1.registerTool)(server, "validate_page", "Run validation checks on a page's current draft to determine if it is ready to publish. Returns a list of issues (errors and warnings) that must be resolved before publishing.", {
|
|
316
294
|
pageId: zod_1.z.string().describe("The page ID (UUID) to validate"),
|
|
317
295
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ pageId }) {
|
|
318
296
|
try {
|
|
@@ -323,12 +301,12 @@ Common patterns:
|
|
|
323
301
|
}
|
|
324
302
|
catch (error) {
|
|
325
303
|
return {
|
|
326
|
-
content: [{ type: "text", text: formatError(error, `validating page '${pageId}'`) }],
|
|
304
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `validating page '${pageId}'`) }],
|
|
327
305
|
isError: true,
|
|
328
306
|
};
|
|
329
307
|
}
|
|
330
308
|
}));
|
|
331
|
-
|
|
309
|
+
(0, _register_js_1.registerTool)(server, "publish_page", "Publish the current draft of a page, making it accessible at its runtime URL. Validates the draft first — if there are errors, publishing is rejected with details. Returns the publication record and the public runtime URL.", {
|
|
332
310
|
pageId: zod_1.z.string().describe("The page ID (UUID) to publish"),
|
|
333
311
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ pageId }) {
|
|
334
312
|
try {
|
|
@@ -339,12 +317,12 @@ Common patterns:
|
|
|
339
317
|
}
|
|
340
318
|
catch (error) {
|
|
341
319
|
return {
|
|
342
|
-
content: [{ type: "text", text: formatError(error, `publishing page '${pageId}'`) }],
|
|
320
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `publishing page '${pageId}'`) }],
|
|
343
321
|
isError: true,
|
|
344
322
|
};
|
|
345
323
|
}
|
|
346
324
|
}));
|
|
347
|
-
|
|
325
|
+
(0, _register_js_1.registerTool)(server, "unpublish_page", "Unpublish a page, making it no longer accessible at its runtime URL. The page definition is preserved and can be re-published later.", {
|
|
348
326
|
pageId: zod_1.z.string().describe("The page ID (UUID) to unpublish"),
|
|
349
327
|
}, (_a) => __awaiter(this, [_a], void 0, function* ({ pageId }) {
|
|
350
328
|
try {
|
|
@@ -355,13 +333,13 @@ Common patterns:
|
|
|
355
333
|
}
|
|
356
334
|
catch (error) {
|
|
357
335
|
return {
|
|
358
|
-
content: [{ type: "text", text: formatError(error, `unpublishing page '${pageId}'`) }],
|
|
336
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `unpublishing page '${pageId}'`) }],
|
|
359
337
|
isError: true,
|
|
360
338
|
};
|
|
361
339
|
}
|
|
362
340
|
}));
|
|
363
341
|
// ── Access Policy ─────────────────────────────────────────────────
|
|
364
|
-
|
|
342
|
+
(0, _register_js_1.registerTool)(server, "set_page_access_policy", "Set the access policy for a page. Controls who can view the published page: 'public' (anyone), 'authenticated' (logged-in users), or 'role-gated' (users with specific roles).", {
|
|
365
343
|
pageId: zod_1.z.string().describe("The page ID (UUID)"),
|
|
366
344
|
accessMode: zod_1.z
|
|
367
345
|
.enum(["public", "authenticated", "role-gated"])
|
|
@@ -382,13 +360,13 @@ Common patterns:
|
|
|
382
360
|
}
|
|
383
361
|
catch (error) {
|
|
384
362
|
return {
|
|
385
|
-
content: [{ type: "text", text: formatError(error, `setting access policy for page '${pageId}'`) }],
|
|
363
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, `setting access policy for page '${pageId}'`) }],
|
|
386
364
|
isError: true,
|
|
387
365
|
};
|
|
388
366
|
}
|
|
389
367
|
}));
|
|
390
368
|
// ── Theme ─────────────────────────────────────────────────────────
|
|
391
|
-
|
|
369
|
+
(0, _register_js_1.registerTool)(server, "get_page_theme", "Get the workspace theme configuration used by published pages. Includes primary color, accent color, optional logo URL, and font family.", {}, () => __awaiter(this, void 0, void 0, function* () {
|
|
392
370
|
try {
|
|
393
371
|
const resp = yield client.get(`${basePath}/theme`);
|
|
394
372
|
return {
|
|
@@ -397,12 +375,12 @@ Common patterns:
|
|
|
397
375
|
}
|
|
398
376
|
catch (error) {
|
|
399
377
|
return {
|
|
400
|
-
content: [{ type: "text", text: formatError(error, "getting page theme") }],
|
|
378
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "getting page theme") }],
|
|
401
379
|
isError: true,
|
|
402
380
|
};
|
|
403
381
|
}
|
|
404
382
|
}));
|
|
405
|
-
|
|
383
|
+
(0, _register_js_1.registerTool)(server, "set_page_theme", "Set the workspace theme for published pages. Controls the visual branding of all published pages.", {
|
|
406
384
|
primaryColor: zod_1.z.string().describe("Primary brand color (hex, e.g., '#1a73e8')"),
|
|
407
385
|
accentColor: zod_1.z.string().describe("Accent color (hex, e.g., '#ff6d00')"),
|
|
408
386
|
logoUrl: zod_1.z.string().optional().describe("URL to the workspace logo"),
|
|
@@ -421,13 +399,13 @@ Common patterns:
|
|
|
421
399
|
}
|
|
422
400
|
catch (error) {
|
|
423
401
|
return {
|
|
424
|
-
content: [{ type: "text", text: formatError(error, "setting page theme") }],
|
|
402
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "setting page theme") }],
|
|
425
403
|
isError: true,
|
|
426
404
|
};
|
|
427
405
|
}
|
|
428
406
|
}));
|
|
429
407
|
// ── Navigation ────────────────────────────────────────────────────
|
|
430
|
-
|
|
408
|
+
(0, _register_js_1.registerTool)(server, "get_navigation", "Get the workspace navigation configuration. Controls the sidebar/nav shell that wraps published pages.", {}, () => __awaiter(this, void 0, void 0, function* () {
|
|
431
409
|
try {
|
|
432
410
|
const resp = yield client.get(`${basePath}/navigation`);
|
|
433
411
|
return {
|
|
@@ -436,12 +414,12 @@ Common patterns:
|
|
|
436
414
|
}
|
|
437
415
|
catch (error) {
|
|
438
416
|
return {
|
|
439
|
-
content: [{ type: "text", text: formatError(error, "getting navigation config") }],
|
|
417
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "getting navigation config") }],
|
|
440
418
|
isError: true,
|
|
441
419
|
};
|
|
442
420
|
}
|
|
443
421
|
}));
|
|
444
|
-
|
|
422
|
+
(0, _register_js_1.registerTool)(server, "set_navigation", "Set the workspace navigation configuration. Defines the sidebar items, branding, and grouping for the page navigation shell.", {
|
|
445
423
|
config: zod_1.z
|
|
446
424
|
.record(zod_1.z.string(), zod_1.z.any())
|
|
447
425
|
.describe("Navigation config object with: enabled (boolean), branding ({ logoUrl, displayName }), items (array of nav items with pageId, label, icon, group)"),
|
|
@@ -454,12 +432,12 @@ Common patterns:
|
|
|
454
432
|
}
|
|
455
433
|
catch (error) {
|
|
456
434
|
return {
|
|
457
|
-
content: [{ type: "text", text: formatError(error, "setting navigation config") }],
|
|
435
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "setting navigation config") }],
|
|
458
436
|
isError: true,
|
|
459
437
|
};
|
|
460
438
|
}
|
|
461
439
|
}));
|
|
462
|
-
|
|
440
|
+
(0, _register_js_1.registerTool)(server, "delete_navigation", "Delete the workspace navigation configuration. Pages revert to standalone rendering without a sidebar/nav shell.", {}, () => __awaiter(this, void 0, void 0, function* () {
|
|
463
441
|
try {
|
|
464
442
|
yield client.delete(`${basePath}/navigation`);
|
|
465
443
|
return {
|
|
@@ -468,13 +446,13 @@ Common patterns:
|
|
|
468
446
|
}
|
|
469
447
|
catch (error) {
|
|
470
448
|
return {
|
|
471
|
-
content: [{ type: "text", text: formatError(error, "deleting navigation config") }],
|
|
449
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "deleting navigation config") }],
|
|
472
450
|
isError: true,
|
|
473
451
|
};
|
|
474
452
|
}
|
|
475
453
|
}));
|
|
476
454
|
// ── Assembly (AI-assisted page generation) ────────────────────────
|
|
477
|
-
|
|
455
|
+
(0, _register_js_1.registerTool)(server, "generate_starter_pages", "Generate page proposals from collection IDs. Uses guided assembly to create page definitions (list, detail, form, dashboard) tailored to the data schema. Returns proposals that can be reviewed and accepted.", {
|
|
478
456
|
collectionIds: zod_1.z
|
|
479
457
|
.array(zod_1.z.string())
|
|
480
458
|
.describe("Array of collection IDs (UUIDs) to generate pages for. Get these from list_collections → id field."),
|
|
@@ -494,12 +472,12 @@ Common patterns:
|
|
|
494
472
|
}
|
|
495
473
|
catch (error) {
|
|
496
474
|
return {
|
|
497
|
-
content: [{ type: "text", text: formatError(error, "generating starter pages") }],
|
|
475
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "generating starter pages") }],
|
|
498
476
|
isError: true,
|
|
499
477
|
};
|
|
500
478
|
}
|
|
501
479
|
}));
|
|
502
|
-
|
|
480
|
+
(0, _register_js_1.registerTool)(server, "accept_page_proposal", "Accept a generated page proposal and create the page with its initial draft definition. Use after reviewing proposals from generate_starter_pages.", {
|
|
503
481
|
name: zod_1.z.string().describe("Display name for the page"),
|
|
504
482
|
slug: zod_1.z.string().describe("URL-safe slug for the page"),
|
|
505
483
|
pageType: zod_1.z
|
|
@@ -526,7 +504,7 @@ Common patterns:
|
|
|
526
504
|
}
|
|
527
505
|
catch (error) {
|
|
528
506
|
return {
|
|
529
|
-
content: [{ type: "text", text: formatError(error, "accepting page proposal") }],
|
|
507
|
+
content: [{ type: "text", text: (0, _register_js_1.formatError)(error, "accepting page proposal") }],
|
|
530
508
|
isError: true,
|
|
531
509
|
};
|
|
532
510
|
}
|