@sonenta/mcp 0.37.0 → 0.38.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 +1 -1
- package/bin/sonenta-mcp.js +76 -2
- package/bin/sonenta-mcp.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Model Context Protocol server for **Sonenta** translation management — **pure TypeScript**, no Python, no `uv`, no bundled wheel. Runs on Node ≥18.
|
|
4
4
|
|
|
5
|
-
Wires Claude Desktop and other MCP clients into your Sonenta project's keys, translations, accessibility surfaces, source-health, and glossary tools — plus **agent-observability** tools (`session_start` / `annotate` / `human_needed` / `session_end`) that surface an agent's run as a live, timestamped thread in the Sonenta dashboard.
|
|
5
|
+
Wires Claude Desktop and other MCP clients into your Sonenta project's keys, translations, accessibility surfaces, source-health, and glossary tools — plus **agent-observability** tools (`session_start` / `annotate` / `human_needed` / `session_end`) that surface an agent's run as a live, timestamped thread in the Sonenta dashboard, and **prompt-library** reads (`list_prompts` / `resolve_prompt`) so agents can discover and reuse the project's curated prompts.
|
|
6
6
|
|
|
7
7
|
## Use
|
|
8
8
|
|
package/bin/sonenta-mcp.js
CHANGED
|
@@ -19562,6 +19562,58 @@ var init_schemas_observability = __esm({
|
|
|
19562
19562
|
}
|
|
19563
19563
|
});
|
|
19564
19564
|
|
|
19565
|
+
// src/tools/schemas.prompts.ts
|
|
19566
|
+
var PROJECT_UUID2, PROMPTS_SCHEMAS, PROMPTS_TOOL_NAMES;
|
|
19567
|
+
var init_schemas_prompts = __esm({
|
|
19568
|
+
"src/tools/schemas.prompts.ts"() {
|
|
19569
|
+
"use strict";
|
|
19570
|
+
PROJECT_UUID2 = {
|
|
19571
|
+
type: "string",
|
|
19572
|
+
description: "Project UUID. Required when multiple projects are configured (SONENTA_PROJECTS); defaults to the single configured project otherwise."
|
|
19573
|
+
};
|
|
19574
|
+
PROMPTS_SCHEMAS = {
|
|
19575
|
+
list_prompts: {
|
|
19576
|
+
description: "Browse the Sonenta prompt library (the global catalogue). Use this to discover the reusable, curated prompts available for a project before you write your own \u2014 filter by section / subsection / tier / phase to narrow down. Read-only, free (0 credits). Returns {items:[{key, i18n_key, section, subsection, tier, phase, agent, category, title, template, enabled}], total}. To get a single ready-to-use template with variables filled, use resolve_prompt instead.",
|
|
19577
|
+
inputSchema: {
|
|
19578
|
+
type: "object",
|
|
19579
|
+
properties: {
|
|
19580
|
+
project_uuid: PROJECT_UUID2,
|
|
19581
|
+
section: { type: "string", description: "Filter by top-level section." },
|
|
19582
|
+
subsection: { type: "string", description: "Filter by subsection within a section." },
|
|
19583
|
+
tier: { type: "string", description: "Filter by tier." },
|
|
19584
|
+
phase: { type: "string", description: "Filter by phase." },
|
|
19585
|
+
enabled: {
|
|
19586
|
+
type: "boolean",
|
|
19587
|
+
description: "If set, return only enabled (true) or only disabled (false) prompts; omit for all."
|
|
19588
|
+
}
|
|
19589
|
+
}
|
|
19590
|
+
}
|
|
19591
|
+
},
|
|
19592
|
+
resolve_prompt: {
|
|
19593
|
+
description: "Resolve the single best-matching prompt for a section and get its template ready to use, with catalogue variables filled in. Use this when you want THE prompt for a job rather than a list to pick from. `section` is required; narrow further with subsection / tier / phase, and pass language / namespace / count to shape the resolved variables. Read-only, free (0 credits). Returns {prompt:{key, i18n_key, template, resolved, variables_used}}; errors 404 if nothing matches.",
|
|
19594
|
+
inputSchema: {
|
|
19595
|
+
type: "object",
|
|
19596
|
+
properties: {
|
|
19597
|
+
project_uuid: PROJECT_UUID2,
|
|
19598
|
+
section: { type: "string", description: "Section to resolve a prompt for (REQUIRED)." },
|
|
19599
|
+
subsection: { type: "string", description: "Optional subsection to narrow the match." },
|
|
19600
|
+
tier: { type: "string", description: "Optional tier to narrow the match." },
|
|
19601
|
+
phase: { type: "string", description: "Optional phase to narrow the match." },
|
|
19602
|
+
language: { type: "string", description: "Optional language code used when filling template variables." },
|
|
19603
|
+
namespace: { type: "string", description: "Optional namespace used when filling template variables." },
|
|
19604
|
+
count: {
|
|
19605
|
+
type: "integer",
|
|
19606
|
+
description: "Optional count used by count-dependent template variables (default 0)."
|
|
19607
|
+
}
|
|
19608
|
+
},
|
|
19609
|
+
required: ["section"]
|
|
19610
|
+
}
|
|
19611
|
+
}
|
|
19612
|
+
};
|
|
19613
|
+
PROMPTS_TOOL_NAMES = Object.keys(PROMPTS_SCHEMAS);
|
|
19614
|
+
}
|
|
19615
|
+
});
|
|
19616
|
+
|
|
19565
19617
|
// src/tools/registry.ts
|
|
19566
19618
|
var registry_exports = {};
|
|
19567
19619
|
__export(registry_exports, {
|
|
@@ -19622,6 +19674,7 @@ var init_registry = __esm({
|
|
|
19622
19674
|
init_helpers2();
|
|
19623
19675
|
init_schemas_generated();
|
|
19624
19676
|
init_schemas_observability();
|
|
19677
|
+
init_schemas_prompts();
|
|
19625
19678
|
A11Y_SURFACES = ["aria_label", "alt_text", "screen_reader", "plain_language"];
|
|
19626
19679
|
has = (args, k) => k in args;
|
|
19627
19680
|
truthy = (args, k) => Boolean(args[k]);
|
|
@@ -20175,11 +20228,32 @@ var init_registry = __esm({
|
|
|
20175
20228
|
const data = await client.post(`/v1/mcp/projects/${p}/agent/sessions/${sid}/end`, body);
|
|
20176
20229
|
if (client.sessionId === sid) client.clearSession();
|
|
20177
20230
|
return data;
|
|
20231
|
+
},
|
|
20232
|
+
// ---- prompt library (read-only, task 1618 / backend #230) ----
|
|
20233
|
+
async list_prompts(args, client) {
|
|
20234
|
+
const p = resolveProjectUuid(args, client);
|
|
20235
|
+
const params = {};
|
|
20236
|
+
for (const k of ["section", "subsection", "tier", "phase"]) {
|
|
20237
|
+
if (args[k]) params[k] = str(args[k]);
|
|
20238
|
+
}
|
|
20239
|
+
if ("enabled" in args) params["enabled"] = Boolean(args["enabled"]);
|
|
20240
|
+
return client.get(`/v1/mcp/projects/${p}/prompts/catalogue`, params);
|
|
20241
|
+
},
|
|
20242
|
+
async resolve_prompt(args, client) {
|
|
20243
|
+
const p = resolveProjectUuid(args, client);
|
|
20244
|
+
if (!truthy(args, "section")) throw new ToolValidationError("section is required");
|
|
20245
|
+
const params = { section: str(args["section"]) };
|
|
20246
|
+
for (const k of ["subsection", "tier", "phase", "language", "namespace"]) {
|
|
20247
|
+
if (args[k]) params[k] = str(args[k]);
|
|
20248
|
+
}
|
|
20249
|
+
if ("count" in args) params["count"] = args["count"];
|
|
20250
|
+
return client.get(`/v1/mcp/projects/${p}/prompts/resolve`, params);
|
|
20178
20251
|
}
|
|
20179
20252
|
};
|
|
20180
20253
|
TOOLS = Object.entries({
|
|
20181
20254
|
...SCHEMAS,
|
|
20182
|
-
...OBSERVABILITY_SCHEMAS
|
|
20255
|
+
...OBSERVABILITY_SCHEMAS,
|
|
20256
|
+
...PROMPTS_SCHEMAS
|
|
20183
20257
|
}).map(([name, schema]) => {
|
|
20184
20258
|
const handler = HANDLERS[name];
|
|
20185
20259
|
if (!handler) throw new Error(`registry: no handler ported for tool '${name}'`);
|
|
@@ -20270,7 +20344,7 @@ var init_server3 = __esm({
|
|
|
20270
20344
|
init_errors3();
|
|
20271
20345
|
init_helpers2();
|
|
20272
20346
|
init_registry();
|
|
20273
|
-
VERSION = "0.
|
|
20347
|
+
VERSION = "0.38.0";
|
|
20274
20348
|
}
|
|
20275
20349
|
});
|
|
20276
20350
|
|