@sonenta/cli 0.18.0 → 0.19.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 CHANGED
@@ -102,7 +102,11 @@ you to fix by reloading the session.
102
102
 
103
103
  `agents add` drops a ready-made Claude agent into the project's
104
104
  `.claude/agents/` directory — usable interactively in Claude Code or headless in
105
- CI. The bundled agents are **local-first** and CRUD-based: they do the work
105
+ CI. Each agent **preflights its prerequisites at startup** it verifies the
106
+ `@sonenta/mcp` server is connected with an `mcp:*` key before doing any work, and
107
+ if not, fails fast with the exact fix (`sonenta agents add` to wire it, reload
108
+ the session, `sonenta doctor` to diagnose) instead of probing 404s. The bundled
109
+ agents are **local-first** and CRUD-based: they do the work
106
110
  themselves and write it back via plain CRUD tools (**0 Sonenta AI credits**;
107
111
  changes land as drafts or soft/restorable for review); any server-side AI is an
108
112
  explicit, estimated, opt-in fallback.
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command as Command17 } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@sonenta/cli",
9
- version: "0.18.0",
9
+ version: "0.19.0",
10
10
  description: "Command-line interface for Sonenta translation management.",
11
11
  license: "MIT",
12
12
  homepage: "https://sonenta.com",
@@ -73,6 +73,27 @@ import { Command as Command2 } from "commander";
73
73
  import { promises as fs } from "fs";
74
74
  import { resolve } from "path";
75
75
  var AGENTS_DIR = ".claude/agents";
76
+ var PREFLIGHT = `## Preflight \u2014 verify your tools FIRST (fail fast, don't guess)
77
+ Before ANY work, confirm the Sonenta MCP tools are actually available to you in
78
+ this session \u2014 make a SINGLE cheap read (e.g. \`get_project_info\` or the first
79
+ read your task needs). Treat the result as a gate:
80
+ - **Tools missing** (you don't see the Sonenta MCP tools in your toolset, or the
81
+ call errors with "tool not found" / a connection failure) \u2192 the \`@sonenta/mcp\`
82
+ server isn't connected. **STOP and say so**, e.g.: "I can't run \u2014 I need the
83
+ \`@sonenta/mcp\` server connected with an \`mcp:*\` API key. Fix it: run
84
+ \`sonenta agents add <name>\` (it wires \`.mcp.json\` and preflights), then
85
+ RELOAD this Claude session so the server connects. Run \`sonenta doctor\` to see
86
+ the exact missing piece \u2014 it checks the wiring, host, key scope, and tools and
87
+ prints the precise next step."
88
+ - **Auth / scope error** (401 invalid key, or 403 \`MISSING_SCOPE\`) \u2192 the key is
89
+ missing or lacks \`mcp:*\`. STOP and relay the fix verbatim: a 403 carries
90
+ \`detail.how_to_get\` / \`detail.message\` (a ready-to-run command) \u2014 show it; or
91
+ point to \`sonenta doctor\`. Do NOT retry blindly.
92
+ - **Tools respond** \u2192 proceed with the workflow below.
93
+ NEVER probe arbitrary endpoints, guess tool names or URL paths, or hammer a
94
+ failing call \u2014 one clear, actionable message beats a pile of 404s.
95
+
96
+ `;
76
97
  var SONENTA_A11Y = `---
77
98
  name: sonenta-a11y
78
99
  description: Accessibility (a11y) auditor and fixer for Sonenta-managed i18n projects. Runs a complete code-aware WCAG 2.2 audit, then works like sonenta-source-health \u2014 it builds a remediation PLAN, presents it and reassures you, touches NOTHING until you accept, and only then executes the fixes (a11y variants in bulk, reversible drafts). Generates the alt/aria/screen-reader/plain-language text itself and computes real readability locally, at zero AI-credit cost; server-side AI is an explicit opt-in fallback. Also applies the remediation plans prepared + approved in the Sonenta dashboard, and produces formal WCAG conformance + EAA / EN 301 549 statements. Use interactively in Claude Code or headless in CI.
@@ -108,7 +129,7 @@ default: those bill Sonenta AI credits and exist only as an explicit fallback fo
108
129
  very large volumes or when the developer specifically asks for server-side
109
130
  generation.
110
131
 
111
- ## Requirements
132
+ ${PREFLIGHT}## Requirements
112
133
  - The Sonenta MCP server (\`@sonenta/mcp\`) must be configured with an \`mcp:*\`
113
134
  API key. Every operation goes through its tools \u2014 never call the HTTP API
114
135
  directly. If the a11y tools are missing, tell the user to add the server
@@ -346,7 +367,7 @@ results with \`propose_translations_bulk\` as **drafts/proposed** \u2014 plain C
346
367
  translation by default; where such a path exists it BILLS Sonenta AI credits and
347
368
  is an explicit, estimate-first, opt-in fallback for very large volumes.
348
369
 
349
- ## Requirements
370
+ ${PREFLIGHT}## Requirements
350
371
  - The Sonenta MCP server (\`@sonenta/mcp\`) must be configured with an \`mcp:*\`
351
372
  API key. Everything goes through its tools \u2014 never call the HTTP API directly.
352
373
  If the tools are missing, tell the user to add the server
@@ -464,7 +485,7 @@ narrate what you are about to do, and wait for a clear yes. Reassure: nothing yo
464
485
  propose is destructive until accepted, deletes are soft (trash, restorable), and
465
486
  every change is a reviewable draft.
466
487
 
467
- ## Requirements
488
+ ${PREFLIGHT}## Requirements
468
489
  - The Sonenta MCP server (\`@sonenta/mcp\`) must be configured with an \`mcp:*\`
469
490
  API key. Every operation goes through its tools \u2014 never call the HTTP API
470
491
  directly. If the tools are missing, tell the user to add the server
@@ -671,7 +692,7 @@ Knowledge is human-owned. You **propose, then confirm before you overwrite**.
671
692
  - Everything you write is a reviewable change \u2014 present proposals as proposals,
672
693
  not as done deals.
673
694
 
674
- ## Requirements
695
+ ${PREFLIGHT}## Requirements
675
696
  - The Sonenta MCP server (\`@sonenta/mcp\`) must be configured with an \`mcp:*\`
676
697
  API key. Every operation goes through its tools \u2014 never call the HTTP API
677
698
  directly. If the tools are missing, tell the user to add the server
@@ -832,7 +853,7 @@ There is no server-side AI in this agent.
832
853
  \`update_surface\` response \`affected_variants\` reports how many variants a
833
854
  toggle impacts \u2014 always state that blast radius before toggling.
834
855
 
835
- ## Requirements
856
+ ${PREFLIGHT}## Requirements
836
857
  - The Sonenta MCP server (\`@sonenta/mcp\`) must be configured with an \`mcp:*\`
837
858
  API key. Every operation goes through its tools \u2014 never call the HTTP API
838
859
  directly. If the tools are missing, tell the user to add the server