@sonenta/mcp 0.27.0 → 0.28.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonenta/mcp",
3
- "version": "0.27.0",
3
+ "version": "0.28.0",
4
4
  "description": "MCP server for Sonenta translation management \u2014 wires Claude Desktop and other MCP clients into your project's keys, missing-key feed, and translation drafts.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://sonenta.com",
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sonenta-mcp"
3
- version = "0.27.0"
3
+ version = "0.28.0"
4
4
  description = "Model Context Protocol server for Sonenta — list projects, missing keys, propose translations from Claude Desktop and other MCP clients."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12,<3.14"
@@ -1,3 +1,3 @@
1
1
  """Sonenta MCP server (MIT)."""
2
2
 
3
- __version__ = "0.27.0"
3
+ __version__ = "0.28.0"
@@ -2163,6 +2163,101 @@ def register(server: Server, client: VerbumiaClient) -> tuple[Any, Any]:
2163
2163
  "additionalProperties": False,
2164
2164
  },
2165
2165
  ),
2166
+ # --- Source Health: agent-authored merge plan + per-cluster applied
2167
+ # marking (task 1363; backend PR #183 + cluster-applied route) ---
2168
+ Tool(
2169
+ name="set_source_duplicate_merge_plan",
2170
+ description=(
2171
+ "AUTHOR (or clear) the merge plan for one duplicate group, addressed "
2172
+ "by its shared source_value (Source Health duplicates). This is how "
2173
+ "the sonenta-source-health agent records the CONSOLIDATION it proposes "
2174
+ "and the dev accepted: which keys collapse onto which canonical, and "
2175
+ "what to do with whatever still shares the text. `merge_plan` = "
2176
+ "{clusters:[{canonical_key_uuid, redundant_key_uuids:[...]}], "
2177
+ "survivor_outcome:'allowed'|'differentiate'} — or null/omit to CLEAR "
2178
+ "the plan. Saving a plan sets the group's status to to_fix. After "
2179
+ "authoring, the agent repoints t() usages, trashes the redundant keys "
2180
+ "(delete_keys_bulk), marks each cluster applied (mark_cluster_applied), "
2181
+ "and finally set_duplicate_status(resolved). Author only a plan the "
2182
+ "dev accepted — never decide a merge silently."
2183
+ ),
2184
+ inputSchema={
2185
+ "type": "object",
2186
+ "properties": {
2187
+ "project_uuid": {
2188
+ "type": "string",
2189
+ "description": "Project UUID. Required when multiple projects are configured (SONENTA_PROJECTS); defaults to the single configured project otherwise.",
2190
+ },
2191
+ "source_value": {
2192
+ "type": "string",
2193
+ "description": "The shared source-language value identifying the duplicate group (from list_source_duplicates).",
2194
+ },
2195
+ "merge_plan": {
2196
+ "type": ["object", "null"],
2197
+ "description": "The consolidation plan, or null to clear it.",
2198
+ "properties": {
2199
+ "clusters": {
2200
+ "type": "array",
2201
+ "items": {
2202
+ "type": "object",
2203
+ "properties": {
2204
+ "canonical_key_uuid": {"type": "string"},
2205
+ "redundant_key_uuids": {
2206
+ "type": "array",
2207
+ "items": {"type": "string"},
2208
+ },
2209
+ },
2210
+ "required": ["canonical_key_uuid", "redundant_key_uuids"],
2211
+ },
2212
+ },
2213
+ "survivor_outcome": {
2214
+ "type": "string",
2215
+ "enum": ["allowed", "differentiate"],
2216
+ "description": "What to do with survivors that still share the text: allowed (sanctioned duplicate) or differentiate (make distinct).",
2217
+ },
2218
+ },
2219
+ },
2220
+ },
2221
+ "required": ["source_value"],
2222
+ "additionalProperties": False,
2223
+ },
2224
+ ),
2225
+ Tool(
2226
+ name="mark_cluster_applied",
2227
+ description=(
2228
+ "Mark ONE cluster of a duplicate group's merge plan as APPLIED — "
2229
+ "addressed by the group's source_value + the cluster's "
2230
+ "canonical_key_uuid. Call it after you have repointed the redundant "
2231
+ "keys' t() usages onto the canonical and trashed them "
2232
+ "(delete_keys_bulk), so the dashboard tracks per-cluster progress. "
2233
+ "Pass applied=false to UN-mark it. Once every cluster of the group is "
2234
+ "applied (and the survivor_outcome handled), set_duplicate_status("
2235
+ "resolved) closes the group."
2236
+ ),
2237
+ inputSchema={
2238
+ "type": "object",
2239
+ "properties": {
2240
+ "project_uuid": {
2241
+ "type": "string",
2242
+ "description": "Project UUID. Required when multiple projects are configured (SONENTA_PROJECTS); defaults to the single configured project otherwise.",
2243
+ },
2244
+ "source_value": {
2245
+ "type": "string",
2246
+ "description": "The shared source-language value identifying the duplicate group.",
2247
+ },
2248
+ "canonical_key_uuid": {
2249
+ "type": "string",
2250
+ "description": "The surviving canonical key of the cluster to mark applied.",
2251
+ },
2252
+ "applied": {
2253
+ "type": "boolean",
2254
+ "description": "True to mark applied (default), false to un-mark.",
2255
+ },
2256
+ },
2257
+ "required": ["source_value", "canonical_key_uuid"],
2258
+ "additionalProperties": False,
2259
+ },
2260
+ ),
2166
2261
  ]
2167
2262
 
2168
2263
  @server.call_tool()
@@ -2885,6 +2980,35 @@ def register(server: Server, client: VerbumiaClient) -> tuple[Any, Any]:
2885
2980
  json=body,
2886
2981
  )
2887
2982
  return _text(data)
2983
+ if name == "set_source_duplicate_merge_plan":
2984
+ project_uuid = _project_uuid(args, client)
2985
+ if not args.get("source_value"):
2986
+ return _err("source_value is required")
2987
+ body = {"source_value": args["source_value"]}
2988
+ # merge_plan may be an object OR explicit null (to clear); send it
2989
+ # whenever the key is present at all.
2990
+ if "merge_plan" in args:
2991
+ body["merge_plan"] = args["merge_plan"]
2992
+ data = await client.put(
2993
+ f"/v1/mcp/projects/{project_uuid}/source-duplicates/merge-plan",
2994
+ json=body,
2995
+ )
2996
+ return _text(data)
2997
+ if name == "mark_cluster_applied":
2998
+ project_uuid = _project_uuid(args, client)
2999
+ if not args.get("source_value") or not args.get("canonical_key_uuid"):
3000
+ return _err("source_value and canonical_key_uuid are required")
3001
+ body = {
3002
+ "source_value": args["source_value"],
3003
+ "canonical_key_uuid": args["canonical_key_uuid"],
3004
+ }
3005
+ if "applied" in args:
3006
+ body["applied"] = bool(args["applied"])
3007
+ data = await client.put(
3008
+ f"/v1/mcp/projects/{project_uuid}/source-duplicates/cluster-applied",
3009
+ json=body,
3010
+ )
3011
+ return _text(data)
2888
3012
  return _err(f"unknown tool: {name}")
2889
3013
  except VerbumiaApiError as exc:
2890
3014
  return _err(f"API {exc.status}: {exc.body}")