@caelo-cms/mcp-server 0.10.53 → 0.10.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +20 -3
  3. package/dist/admin-server.d.ts +1 -15
  4. package/dist/admin-server.d.ts.map +1 -1
  5. package/dist/admin-server.js +72 -302
  6. package/dist/admin-server.js.map +1 -1
  7. package/dist/admin.js +7 -8
  8. package/dist/admin.js.map +1 -1
  9. package/dist/chat-bridge.d.ts +1 -1
  10. package/dist/chat-bridge.d.ts.map +1 -1
  11. package/dist/image-upload.d.ts +2 -75
  12. package/dist/image-upload.d.ts.map +1 -1
  13. package/dist/image-upload.js +40 -134
  14. package/dist/image-upload.js.map +1 -1
  15. package/dist/index.js +38 -30
  16. package/dist/index.js.map +1 -1
  17. package/dist/server.d.ts +0 -6
  18. package/dist/server.d.ts.map +1 -1
  19. package/dist/server.js +24 -259
  20. package/dist/server.js.map +1 -1
  21. package/dist/surfaces/admin-surface.d.ts +106 -0
  22. package/dist/surfaces/admin-surface.d.ts.map +1 -0
  23. package/dist/surfaces/admin-surface.js +183 -0
  24. package/dist/surfaces/admin-surface.js.map +1 -0
  25. package/dist/surfaces/chat-surface.d.ts +48 -0
  26. package/dist/surfaces/chat-surface.d.ts.map +1 -0
  27. package/dist/surfaces/chat-surface.js +190 -0
  28. package/dist/surfaces/chat-surface.js.map +1 -0
  29. package/dist/surfaces/index.d.ts +15 -0
  30. package/dist/surfaces/index.d.ts.map +1 -0
  31. package/dist/surfaces/index.js +15 -0
  32. package/dist/surfaces/index.js.map +1 -0
  33. package/dist/surfaces/upload.d.ts +32 -0
  34. package/dist/surfaces/upload.d.ts.map +1 -0
  35. package/dist/surfaces/upload.js +58 -0
  36. package/dist/surfaces/upload.js.map +1 -0
  37. package/dist/tool-definitions.d.ts +465 -0
  38. package/dist/tool-definitions.d.ts.map +1 -0
  39. package/dist/tool-definitions.js +256 -0
  40. package/dist/tool-definitions.js.map +1 -0
  41. package/dist/unconfigured.d.ts +26 -0
  42. package/dist/unconfigured.d.ts.map +1 -0
  43. package/dist/unconfigured.js +82 -0
  44. package/dist/unconfigured.js.map +1 -0
  45. package/package.json +12 -3
  46. package/power-catalogue.json +8030 -0
@@ -1,40 +1,34 @@
1
1
  // SPDX-License-Identifier: MPL-2.0
2
2
  /**
3
- * Issue #376 — the Power-MCP server (`caelo-admin-mcp` / `caelo-mcp-server
4
- * admin`). Where the chat server routes editing through a tool that talks to Caelo's own
5
- * AI, this server exposes the whole chat-runner tool catalogue so the
6
- * CALLING agent (Claude Code et al.) drives the tool loop itself — no
7
- * Caelo-side reasoning cost. Issue #741: the AI work inside tools stays with
8
- * the agent too unless the token's Owner allowed "may use Caelo's AI" —
9
- * tools then hand back work items (translations, …) instead of calling the
10
- * install's provider; `caelo_get_context` explains the contract.
3
+ * Issue #376 — the Power-MCP stdio server (`caelo-admin-mcp` /
4
+ * `caelo-mcp-server admin`). Where the chat server routes editing through a
5
+ * tool that talks to Caelo's own AI, this server exposes the whole
6
+ * chat-runner tool catalogue so the CALLING agent (Claude Code et al.)
7
+ * drives the tool loop itself — no Caelo-side reasoning cost. Issue #741:
8
+ * the AI work inside tools stays with the agent too unless the token's
9
+ * Owner allowed "may use Caelo's AI" — tools then hand back work items
10
+ * (translations, …) instead of calling the install's provider;
11
+ * `caelo_get_context` explains the contract.
11
12
  *
12
- * The catalogue is fetched live from `/api/mcp/tools` at startup (an
13
- * admin-scoped token is required; 'chat' tokens get a 401 with the fix).
14
- * Local companion tools:
13
+ * The server itself (tools, companion tools, approval waits) is
14
+ * ./surfaces/admin-surface.ts, shared with the admin's remote endpoint
15
+ * (issue #806). This module is the stdio backend:
15
16
  *
16
- * - `caelo_upload_images` — uploads local or base64 image references to the media library.
17
- * - `caelo_open_session` — resumes the operator's most recent open work
18
- * session (issue #620; `newSession: true` opens a fresh one) whose
19
- * preview branch every subsequent tool call writes to. The session id
20
- * is held here in process state so the agent doesn't thread it through
21
- * every call; it also rides the response so a restarted server can
22
- * resume a specific session via `chatSessionId`.
23
- * - `caelo_await_approval` — issue #658: keep waiting for the operator's
24
- * decision on a proposal an approval-gated tool queued (the gated call
25
- * itself already waits, bounded by `CAELO_MCP_APPROVAL_WAIT_MS`).
26
- * - `caelo_get_context` — the composed site context (module model, tool
27
- * playbook, staging rules, site memory, skills index) the agent should
28
- * load once before working. For a checked-in variant, see
29
- * `caelo-mcp-server export`.
17
+ * - the catalogue is fetched live from `/api/mcp/tools` at startup (an
18
+ * admin-scoped token is required; 'chat' tokens get a 401 with the fix)
19
+ * and re-read periodically (#678) — a change reaches the client through
20
+ * `notifications/tools/list_changed`, an unknown tool name refreshes too;
21
+ * - the work session `caelo_open_session` opened is held in process state
22
+ * so the agent doesn't thread it through every call; it also rides the
23
+ * response so a restarted server can resume a specific session via
24
+ * `chatSessionId`.
30
25
  */
31
- import { Server } from "@modelcontextprotocol/sdk/server/index.js";
32
26
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
33
- import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
34
- import { z } from "zod";
35
- import { describeApprovalOutcome, resolveApprovalWaitMs, waitForApproval, } from "./approval-wait.js";
27
+ import { resolveApprovalWaitMs } from "./approval-wait.js";
36
28
  import { postAdmin, resolveTimeoutMs } from "./http.js";
37
- import { UPLOAD_IMAGES_TOOL, uploadImages } from "./image-upload.js";
29
+ import { uploadImages } from "./image-upload.js";
30
+ import { createAdminMcpServer, } from "./surfaces/admin-surface.js";
31
+ import { ownVersion } from "./version-handshake.js";
38
32
  const DEFAULT_CATALOGUE_REFRESH_MS = 5 * 60_000;
39
33
  /** The refresh interval: the option, else the env var, else 5 minutes. */
40
34
  export function resolveCatalogueRefreshMs(option, env = process.env.CAELO_MCP_CATALOGUE_REFRESH_MS) {
@@ -52,83 +46,10 @@ export function catalogueSignature(tools) {
52
46
  .sort((a, b) => a.name.localeCompare(b.name))
53
47
  .map((t) => [t.name, t.description, t.inputSchema, t.gated === true]));
54
48
  }
55
- /**
56
- * MCP `instructions` for the admin server (#552). Clients such as Claude
57
- * Code put this into the agent's context on connect, so a freshly
58
- * connected agent knows the session protocol without the operator
59
- * pasting anything: without a session every write fails, without the
60
- * context it works without the site's rules and brand voice.
61
- */
62
- export const ADMIN_MCP_INSTRUCTIONS = [
63
- "This server edits a Caelo CMS site. Before any other caelo tool:",
64
- "1. Call caelo_open_session once. It resumes the operator's most recent open session (pass newSession: true only when the operator asks for a fresh one; chatSessionId resumes a specific one). Every write lands in the site's shared draft (or the session's own experiment branch); you may stage finished work with stage_changes, but nothing reaches the live site until the operator clicks Publish live in the Caelo admin.",
65
- "2. Call caelo_get_context once and follow it: it carries the site model, tool playbook, staging rules, site memory (brand voice, glossary) and the skills index.",
66
- "3. Load every skill the context marks ALWAYS APPLIES with load_skill before the work it covers (e.g. before writing any visitor-facing copy).",
67
- "Every tool in this list works over MCP, including approval-gated ones (marked APPROVAL-GATED — deploys, users/roles, languages/locales, plugin settings, bulk deletes …). Call them yourself: Caelo shows the operator an approval card in the Caelo admin (their Live Edit chat and the pending-approvals page), the call waits for Approve/Reject and returns the decision; if the wait times out, call caelo_await_approval with the proposalId. Tell the operator what you requested and that they approve the card in Caelo. Never ask the operator to paste a prompt into the Caelo admin chat or to do a step there that a tool here can do, and never re-propose a pending proposal.",
68
- "After every stage_changes, call get_quality_audit (it waits for the result) and fix every open problem it names, then Stage and re-read until it passes: the target is 100 in every category and zero findings, and a score that dropped since the page's previous audit points at a recent change — check those changes first. Do not report open scores or findings to the operator as a result — only what you proved cannot be fixed in the site.",
69
- "Tool errors name the next step to take; follow them instead of retrying unchanged.",
70
- ].join("\n");
71
- const openSessionInput = z
72
- .object({
73
- title: z.string().min(1).max(200).optional(),
74
- pageId: z.string().uuid().optional(),
75
- chatSessionId: z.string().uuid().optional(),
76
- newSession: z.boolean().optional(),
77
- })
78
- .strict();
79
- const OPEN_SESSION_TOOL = {
80
- name: "caelo_open_session",
81
- description: "Open the Caelo work session your subsequent tool calls run in. Every write lands in the site's shared " +
82
- "draft — invisible to the live site until it is staged and the operator clicks Publish live in the Caelo admin. " +
83
- "Call this ONCE before any other caelo tool. By default it RESUMES the operator's own most recent open " +
84
- "session (so earlier unstaged work continues in the same chat); pass newSession: true only when the " +
85
- "operator wants a separate fresh session, or chatSessionId to resume a specific one. Optional pageId " +
86
- "resumes (or opens) that page's session.",
87
- inputSchema: {
88
- type: "object",
89
- properties: {
90
- title: { type: "string", description: "Session title shown in the Caelo admin chat list." },
91
- pageId: { type: "string", description: "Optional page UUID to bind the session to." },
92
- chatSessionId: {
93
- type: "string",
94
- description: "Resume this specific session instead of the most recent one.",
95
- },
96
- newSession: {
97
- type: "boolean",
98
- description: "Open a fresh session instead of resuming the most recent open one.",
99
- },
100
- },
101
- },
102
- };
103
- const awaitApprovalInput = z.object({ proposalId: z.string().uuid() }).strict();
104
- /** Issue #658 — keep waiting for a decision after a gated call's wait timed out. */
105
- const AWAIT_APPROVAL_TOOL = {
106
- name: "caelo_await_approval",
107
- description: "Wait for the operator's Approve/Reject on a proposal you queued with an approval-gated tool, and return " +
108
- "the decision (applied / rejected with reason / …). Use it when a gated tool's result says it is still " +
109
- "waiting. You cannot approve anything yourself — only the operator can, in the Caelo admin.",
110
- inputSchema: {
111
- type: "object",
112
- properties: {
113
- proposalId: {
114
- type: "string",
115
- description: "The id from the gated tool's 'Queued proposal <id>' result.",
116
- },
117
- },
118
- required: ["proposalId"],
119
- },
120
- };
121
- const GET_CONTEXT_TOOL = {
122
- name: "caelo_get_context",
123
- description: "Fetch the Caelo install's composed site context: how pages/modules/content instances fit together, " +
124
- "the tool playbook, staging rules, site memory (brand voice, glossary) and the active skills index. " +
125
- "Load this once before working; load individual skills on demand via the load_skill tool.",
126
- inputSchema: { type: "object", properties: {} },
127
- };
128
49
  export async function startAdminMcpServer(opts) {
50
+ const target = { adminUrl: opts.adminUrl, token: opts.token };
129
51
  const fetchCatalogue = () => postAdmin({
130
- adminUrl: opts.adminUrl,
131
- token: opts.token,
52
+ ...target,
132
53
  path: "/api/mcp/tools",
133
54
  body: {},
134
55
  timeoutMs: resolveTimeoutMs(60_000),
@@ -139,12 +60,55 @@ export async function startAdminMcpServer(opts) {
139
60
  let remoteByName = new Map(catalogue.tools.map((t) => [t.name, t]));
140
61
  let signature = catalogueSignature(catalogue.tools);
141
62
  let currentSession = null;
63
+ let connected = false;
64
+ let refreshing = null;
142
65
  // #678 — the catalogue is the ADMIN's: an upgrade or an activated plugin
143
66
  // changes it while this process runs. `listChanged` tells the client to
144
67
  // re-list when we say so, instead of the operator reconnecting (/mcp).
145
- const server = new Server({ name: "caelo-admin-mcp", version: "0.1.0" }, { capabilities: { tools: { listChanged: true } }, instructions: ADMIN_MCP_INSTRUCTIONS });
146
- let connected = false;
147
- let refreshing = null;
68
+ const server = createAdminMcpServer({
69
+ listCatalogue: async () => catalogue.tools,
70
+ findTool: async (name) => {
71
+ if (!remoteByName.has(name)) {
72
+ // The admin may have gained the tool since we last listed (#678).
73
+ await refreshCatalogue();
74
+ }
75
+ return remoteByName.get(name);
76
+ },
77
+ openSession: async (input) => {
78
+ currentSession = await postAdmin({
79
+ ...target,
80
+ path: "/api/mcp/session",
81
+ body: input,
82
+ timeoutMs: resolveTimeoutMs(30_000),
83
+ });
84
+ return currentSession;
85
+ },
86
+ currentSessionId: async () => currentSession?.chatSessionId ?? null,
87
+ executeTool: (call) => postAdmin({
88
+ ...target,
89
+ path: "/api/mcp/tool",
90
+ body: call,
91
+ timeoutMs: resolveTimeoutMs(120_000),
92
+ }),
93
+ getContext: () => postAdmin({
94
+ ...target,
95
+ path: "/api/mcp/context",
96
+ body: { includeSkillBodies: false },
97
+ timeoutMs: resolveTimeoutMs(60_000),
98
+ }),
99
+ fetchApprovalOutcome: (proposalId) => postAdmin({
100
+ ...target,
101
+ path: "/api/mcp/approval",
102
+ body: { proposalId },
103
+ timeoutMs: resolveTimeoutMs(30_000),
104
+ }),
105
+ uploadImages: (args) => uploadImages(target, args),
106
+ }, {
107
+ serverVersion: ownVersion(),
108
+ approvalWaitMs: resolveApprovalWaitMs,
109
+ listChanged: true,
110
+ ...(opts.approvalPollMs !== undefined ? { approvalPollMs: opts.approvalPollMs } : {}),
111
+ });
148
112
  /** Re-read the catalogue; true (and a list_changed to the client) when it changed. */
149
113
  const refreshCatalogue = () => {
150
114
  refreshing ??= (async () => {
@@ -178,201 +142,7 @@ export async function startAdminMcpServer(opts) {
178
142
  if (timer)
179
143
  clearInterval(timer);
180
144
  };
181
- server.setRequestHandler(ListToolsRequestSchema, async () => ({
182
- tools: [
183
- UPLOAD_IMAGES_TOOL,
184
- OPEN_SESSION_TOOL,
185
- GET_CONTEXT_TOOL,
186
- AWAIT_APPROVAL_TOOL,
187
- ...catalogue.tools.map((t) => ({
188
- name: t.name,
189
- description: t.description,
190
- inputSchema: t.inputSchema,
191
- })),
192
- ],
193
- }));
194
- /** Reads the operator's decision; the agent can never make it. */
195
- const fetchOutcome = (proposalId) => () => postAdmin({
196
- adminUrl: opts.adminUrl,
197
- token: opts.token,
198
- path: "/api/mcp/approval",
199
- body: { proposalId },
200
- timeoutMs: resolveTimeoutMs(30_000),
201
- });
202
- server.setRequestHandler(CallToolRequestSchema, async (req, extra) => {
203
- const name = req.params.name;
204
- // Progress notifications keep progress-aware clients from timing the
205
- // call out while it waits on the operator (only when they asked).
206
- const progressToken = req.params._meta?.progressToken;
207
- const onPending = progressToken === undefined
208
- ? undefined
209
- : async (elapsedMs) => {
210
- await extra.sendNotification({
211
- method: "notifications/progress",
212
- params: {
213
- progressToken,
214
- progress: Math.round(elapsedMs / 1000),
215
- message: "Waiting for the operator to approve or reject in the Caelo admin…",
216
- },
217
- });
218
- };
219
- try {
220
- if (name === AWAIT_APPROVAL_TOOL.name) {
221
- const parsed = awaitApprovalInput.safeParse(req.params.arguments ?? {});
222
- if (!parsed.success) {
223
- return errorResult(`invalid arguments: ${parsed.error.message}`);
224
- }
225
- const outcome = await waitForApproval({
226
- fetchOutcome: fetchOutcome(parsed.data.proposalId),
227
- waitMs: resolveApprovalWaitMs(),
228
- ...(opts.approvalPollMs !== undefined ? { intervalMs: opts.approvalPollMs } : {}),
229
- ...(onPending ? { onPending } : {}),
230
- });
231
- return outcomeResult(outcome);
232
- }
233
- if (name === UPLOAD_IMAGES_TOOL.name)
234
- return await uploadImages(opts, req.params.arguments);
235
- if (name === OPEN_SESSION_TOOL.name) {
236
- const parsed = openSessionInput.safeParse(req.params.arguments ?? {});
237
- if (!parsed.success) {
238
- return errorResult(`invalid arguments: ${parsed.error.message}`);
239
- }
240
- currentSession = await postAdmin({
241
- adminUrl: opts.adminUrl,
242
- token: opts.token,
243
- path: "/api/mcp/session",
244
- body: parsed.data,
245
- timeoutMs: resolveTimeoutMs(30_000),
246
- });
247
- return {
248
- content: [
249
- {
250
- type: "text",
251
- text: JSON.stringify(currentSession, null, 2) +
252
- (currentSession.resumed
253
- ? `\nResumed the operator's session '${currentSession.title}' — its earlier unstaged work continues here. `
254
- : `\nOpened a new session '${currentSession.title}'. `) +
255
- "Subsequent caelo tool calls write to the site's shared draft (or this session's experiment branch). " +
256
- "Stage finished work with stage_changes; the operator clicks Publish live in the Caelo admin.",
257
- },
258
- ],
259
- };
260
- }
261
- if (name === GET_CONTEXT_TOOL.name) {
262
- const context = await postAdmin({
263
- adminUrl: opts.adminUrl,
264
- token: opts.token,
265
- path: "/api/mcp/context",
266
- body: { includeSkillBodies: false },
267
- timeoutMs: resolveTimeoutMs(60_000),
268
- });
269
- return {
270
- content: [
271
- { type: "text", text: context.systemContext },
272
- {
273
- type: "text",
274
- text: JSON.stringify({ statusLine: context.statusLine, skills: context.skills }, null, 2),
275
- },
276
- ],
277
- };
278
- }
279
- let remote = remoteByName.get(name);
280
- if (!remote) {
281
- // The admin may have gained the tool since we last listed (#678).
282
- await refreshCatalogue();
283
- remote = remoteByName.get(name);
284
- }
285
- if (!remote) {
286
- return errorResult(`unknown tool: ${name}`);
287
- }
288
- if (!currentSession) {
289
- return errorResult("no open work session — call caelo_open_session first. Every caelo write lands on a " +
290
- "session's preview branch; without one there is nothing to write to.");
291
- }
292
- const result = await postAdmin({
293
- adminUrl: opts.adminUrl,
294
- token: opts.token,
295
- path: "/api/mcp/tool",
296
- body: {
297
- toolName: name,
298
- args: req.params.arguments ?? {},
299
- chatSessionId: currentSession.chatSessionId,
300
- },
301
- timeoutMs: resolveTimeoutMs(120_000),
302
- });
303
- if (result.approval) {
304
- // Issue #658 — the call queued a proposal: wait for the operator's
305
- // decision (bounded) and return it in THIS result, so the agent
306
- // continues with the outcome instead of a "queued" note.
307
- const outcome = await waitForApproval({
308
- fetchOutcome: fetchOutcome(result.approval.proposalId),
309
- waitMs: resolveApprovalWaitMs(),
310
- ...(opts.approvalPollMs !== undefined ? { intervalMs: opts.approvalPollMs } : {}),
311
- ...(onPending ? { onPending } : {}),
312
- });
313
- const decided = outcomeResult(outcome);
314
- return {
315
- ...decided,
316
- content: [
317
- ...decided.content,
318
- {
319
- type: "text",
320
- text: JSON.stringify({ requestId: result.requestId, cached: result.cached }),
321
- },
322
- ],
323
- };
324
- }
325
- return {
326
- ...(result.ok ? {} : { isError: true }),
327
- content: [
328
- { type: "text", text: result.content },
329
- ...(result.image
330
- ? [
331
- {
332
- type: "image",
333
- data: result.image.base64,
334
- mimeType: result.image.mediaType,
335
- },
336
- ]
337
- : []),
338
- {
339
- type: "text",
340
- text: JSON.stringify({
341
- requestId: result.requestId,
342
- cached: result.cached,
343
- ...(result.nextAction !== undefined ? { nextAction: result.nextAction } : {}),
344
- }),
345
- },
346
- ],
347
- };
348
- }
349
- catch (e) {
350
- const msg = e instanceof Error ? e.message : String(e);
351
- return errorResult(`${name} failed: ${msg}`);
352
- }
353
- });
354
145
  await server.connect(opts.transport ?? new StdioServerTransport());
355
146
  connected = true;
356
147
  }
357
- /** An outcome as an MCP tool result; a failed apply is an error result. */
358
- function outcomeResult(o) {
359
- return {
360
- ...(o.outcome === "failed" ? { isError: true } : {}),
361
- content: [
362
- { type: "text", text: describeApprovalOutcome(o) },
363
- {
364
- type: "text",
365
- text: JSON.stringify({
366
- proposalId: o.proposalId,
367
- outcome: o.outcome,
368
- detail: o.detail,
369
- decidedAt: o.decidedAt,
370
- }),
371
- },
372
- ],
373
- };
374
- }
375
- function errorResult(text) {
376
- return { isError: true, content: [{ type: "text", text }] };
377
- }
378
148
  //# sourceMappingURL=admin-server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"admin-server.js","sourceRoot":"","sources":["../src/admin-server.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAEjF,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAEL,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,GAChB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAmBrE,MAAM,4BAA4B,GAAG,CAAC,GAAG,MAAM,CAAC;AAEhD,0EAA0E;AAC1E,MAAM,UAAU,yBAAyB,CACvC,MAA0B,EAC1B,MAA0B,OAAO,CAAC,GAAG,CAAC,8BAA8B;IAEpE,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,CAAC,GAAG,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,QAAQ,CAAC,CAA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/admin.js CHANGED
@@ -6,17 +6,16 @@
6
6
  * `claude mcp add` snippet stays a single flag-free command.
7
7
  */
8
8
  import { startAdminMcpServer } from "./admin-server.js";
9
+ import { missingCredentials, startUnconfiguredServer } from "./unconfigured.js";
9
10
  import { ensureAdminRelease } from "./version-handshake.js";
10
11
  const adminUrl = process.env.CAELO_ADMIN_URL;
11
12
  const token = process.env.CAELO_MCP_TOKEN;
12
- if (!adminUrl) {
13
- console.error("CAELO_ADMIN_URL not set — point me at your admin install (e.g. https://admin.example.com)");
14
- process.exit(2);
13
+ if (!adminUrl || !token) {
14
+ // #841 — answer tools/list for MCP directories; every call names the fix.
15
+ await startUnconfiguredServer({ mode: "admin", missing: missingCredentials(process.env) });
15
16
  }
16
- if (!token) {
17
- console.error("CAELO_MCP_TOKEN not set — mint an ADMIN-scoped token at /settings/mcp on your admin install");
18
- process.exit(2);
17
+ else {
18
+ await ensureAdminRelease({ adminUrl, token, bin: "caelo-admin-mcp" });
19
+ await startAdminMcpServer({ adminUrl, token });
19
20
  }
20
- await ensureAdminRelease({ adminUrl, token, bin: "caelo-admin-mcp" });
21
- await startAdminMcpServer({ adminUrl, token });
22
21
  //# sourceMappingURL=admin.js.map
package/dist/admin.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":";AACA,mCAAmC;AAEnC;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAE1C,IAAI,CAAC,QAAQ,EAAE,CAAC;IACd,OAAO,CAAC,KAAK,CACX,2FAA2F,CAC5F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AACD,IAAI,CAAC,KAAK,EAAE,CAAC;IACX,OAAO,CAAC,KAAK,CACX,6FAA6F,CAC9F,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACtE,MAAM,mBAAmB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"admin.js","sourceRoot":"","sources":["../src/admin.ts"],"names":[],"mappings":";AACA,mCAAmC;AAEnC;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;AAE1C,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,EAAE,CAAC;IACxB,0EAA0E;IAC1E,MAAM,uBAAuB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAC7F,CAAC;KAAM,CAAC;IACN,MAAM,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACtE,MAAM,mBAAmB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;AACjD,CAAC"}
@@ -11,7 +11,7 @@
11
11
  */
12
12
  import type { z } from "zod";
13
13
  import type { ChatApprovalState, SendChatResult } from "./chat-approval.js";
14
- import type { uploadedImageSchema } from "./image-upload.js";
14
+ import type { uploadedImageSchema } from "./tool-definitions.js";
15
15
  interface AdminTarget {
16
16
  readonly adminUrl: string;
17
17
  readonly token: string;
@@ -1 +1 @@
1
- {"version":3,"file":"chat-bridge.d.ts","sourceRoot":"","sources":["../src/chat-bridge.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,UAAU,WAAW;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,EAAE,CAAC;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAa1E;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACrD,OAAO,CAAC,cAAc,CAAC,CAQzB;AAED,qFAAqF;AACrF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACrD,OAAO,CAAC,iBAAiB,CAAC,CAQ5B"}
1
+ {"version":3,"file":"chat-bridge.d.ts","sourceRoot":"","sources":["../src/chat-bridge.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEjE,UAAU,WAAW;IACnB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,YAAa,SAAQ,WAAW;IAC/C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,EAAE,CAAC;IAC7D,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAa1E;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACrD,OAAO,CAAC,cAAc,CAAC,CAQzB;AAED,qFAAqF;AACrF,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,WAAW,GAAG;IAAE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACrD,OAAO,CAAC,iBAAiB,CAAC,CAQ5B"}
@@ -1,80 +1,7 @@
1
- import { z } from "zod";
2
- /** Uploaded media references accepted by caelo_chat; never accept object-store keys. */
3
- export declare const uploadedImageSchema: z.ZodObject<{
4
- assetId: z.ZodString;
5
- mime: z.ZodEnum<{
6
- "image/png": "image/png";
7
- "image/jpeg": "image/jpeg";
8
- "image/webp": "image/webp";
9
- "image/gif": "image/gif";
10
- }>;
11
- alt: z.ZodOptional<z.ZodString>;
12
- }, z.core.$strict>;
13
- /** A bounded batch; each file has its own success/error result for safe retries. */
14
- export declare const uploadImagesInput: z.ZodObject<{
15
- images: z.ZodArray<z.ZodObject<{
16
- filePath: z.ZodOptional<z.ZodString>;
17
- base64: z.ZodOptional<z.ZodString>;
18
- filename: z.ZodOptional<z.ZodString>;
19
- alt: z.ZodOptional<z.ZodString>;
20
- reference: z.ZodOptional<z.ZodBoolean>;
21
- }, z.core.$strict>>;
22
- }, z.core.$strict>;
23
- /** Exposed in both MCP catalogues, including chat-scoped connections. */
24
- export declare const UPLOAD_IMAGES_TOOL: {
25
- name: string;
26
- description: string;
27
- inputSchema: {
28
- type: "object";
29
- required: string[];
30
- additionalProperties: boolean;
31
- properties: {
32
- images: {
33
- type: string;
34
- minItems: number;
35
- maxItems: number;
36
- items: {
37
- type: string;
38
- additionalProperties: boolean;
39
- properties: {
40
- filePath: {
41
- type: string;
42
- description: string;
43
- };
44
- base64: {
45
- type: string;
46
- description: string;
47
- };
48
- filename: {
49
- type: string;
50
- description: string;
51
- };
52
- alt: {
53
- type: string;
54
- description: string;
55
- };
56
- reference: {
57
- type: string;
58
- description: string;
59
- };
60
- };
61
- oneOf: {
62
- required: string[];
63
- }[];
64
- };
65
- };
66
- };
67
- };
68
- };
1
+ import { type UploadImagesResult } from "./surfaces/upload.js";
69
2
  /** Upload caller-selected files, returning failures individually without dropping successes. */
70
3
  export declare function uploadImages(opts: {
71
4
  adminUrl: string;
72
5
  token: string;
73
- }, input: unknown): Promise<{
74
- content: {
75
- type: "text";
76
- text: string;
77
- }[];
78
- isError?: boolean | undefined;
79
- }>;
6
+ }, input: unknown): Promise<UploadImagesResult>;
80
7
  //# sourceMappingURL=image-upload.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-upload.d.ts","sourceRoot":"","sources":["../src/image-upload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,wFAAwF;AACxF,eAAO,MAAM,mBAAmB;;;;;;;;;kBAMrB,CAAC;AAoBZ,oFAAoF;AACpF,eAAO,MAAM,iBAAiB;;;;;;;;kBAAmE,CAAC;AAElG,yEAAyE;AACzE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4C9B,CAAC;AAEF,gGAAgG;AAChG,wBAAsB,YAAY,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,OAAO;;;;;;GA4E3F"}
1
+ {"version":3,"file":"image-upload.d.ts","sourceRoot":"","sources":["../src/image-upload.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,kBAAkB,EAAoB,MAAM,sBAAsB,CAAC;AAwBjF,gGAAgG;AAChG,wBAAsB,YAAY,CAChC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EACzC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,kBAAkB,CAAC,CA2B7B"}