best-email-builder 0.6.0 → 0.8.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/README.md +127 -698
  3. package/dist/ai-server.js +116 -3
  4. package/dist/ai-server.js.map +1 -1
  5. package/dist/ai.js +507 -172
  6. package/dist/ai.js.map +1 -1
  7. package/dist/builder.js +8 -8
  8. package/dist/chunk-62HBUBBI.js +3866 -0
  9. package/dist/chunk-62HBUBBI.js.map +1 -0
  10. package/dist/{chunk-NC2YDZSP.js → chunk-6W3QUZR7.js} +8 -8
  11. package/dist/{chunk-W424KPCR.js → chunk-AXIM6E7T.js} +2 -2
  12. package/dist/{chunk-JU3OUO6X.js → chunk-DXWIVGHP.js} +3 -3
  13. package/dist/{chunk-QPAZLCPO.js → chunk-FAEVYSIF.js} +3 -3
  14. package/dist/{chunk-QPAZLCPO.js.map → chunk-FAEVYSIF.js.map} +1 -1
  15. package/dist/{chunk-4U7L2NYQ.js → chunk-G4U6PSF6.js} +2 -2
  16. package/dist/{chunk-5W4TUUPD.js → chunk-ITIG5NTJ.js} +4 -4
  17. package/dist/{chunk-CNJZLZRH.js → chunk-LUM7J5FF.js} +2 -2
  18. package/dist/{chunk-SAIW46IC.js → chunk-P7ABBLX6.js} +2 -2
  19. package/dist/chunk-SHHHYRPC.js +2829 -0
  20. package/dist/chunk-SHHHYRPC.js.map +1 -0
  21. package/dist/{chunk-XEFBPP5Y.js → chunk-WM2EEV4Q.js} +4 -4
  22. package/dist/index.js +10 -10
  23. package/dist/library.js +5 -5
  24. package/dist/server.js +8 -8
  25. package/dist/server.js.map +1 -1
  26. package/dist/styles.css +1 -1
  27. package/dist/types/ai/ConnectAi.d.ts +2 -1
  28. package/dist/types/ai/ModelPicker.d.ts +34 -0
  29. package/dist/types/ai/agent.d.ts +31 -0
  30. package/dist/types/ai/agentEndpoint.d.ts +69 -0
  31. package/dist/types/ai/claude.d.ts +2 -1
  32. package/dist/types/ai/draft.d.ts +10 -4
  33. package/dist/types/ai/generator.d.ts +10 -4
  34. package/dist/types/ai/i18n/de.d.ts +2 -0
  35. package/dist/types/ai/i18n/es.d.ts +2 -0
  36. package/dist/types/ai/i18n/pt.d.ts +2 -0
  37. package/dist/types/ai/i18n/ru.d.ts +2 -0
  38. package/dist/types/ai/i18n/zh.d.ts +2 -0
  39. package/dist/types/ai/index.d.ts +2 -1
  40. package/dist/types/ai/keys.d.ts +14 -1
  41. package/dist/types/ai/providers.d.ts +48 -5
  42. package/dist/types/ai/rewrite.d.ts +2 -1
  43. package/dist/types/ai/server.d.ts +3 -1
  44. package/dist/types/ai/subjects.d.ts +2 -1
  45. package/dist/types/core/constants.d.ts +1 -1
  46. package/dist/types/engine/NativeAdapter.d.ts +1 -1
  47. package/dist/types/i18n/de.d.ts +2 -0
  48. package/dist/types/i18n/es.d.ts +2 -0
  49. package/dist/types/i18n/pt.d.ts +2 -0
  50. package/dist/types/i18n/ru.d.ts +2 -0
  51. package/dist/types/i18n/zh.d.ts +2 -0
  52. package/dist/types/server/handler.d.ts +3 -0
  53. package/package.json +2 -2
  54. package/dist/chunk-JI36FNWE.js +0 -1361
  55. package/dist/chunk-JI36FNWE.js.map +0 -1
  56. package/dist/chunk-NZIQF7IW.js +0 -1830
  57. package/dist/chunk-NZIQF7IW.js.map +0 -1
  58. /package/dist/{chunk-NC2YDZSP.js.map → chunk-6W3QUZR7.js.map} +0 -0
  59. /package/dist/{chunk-W424KPCR.js.map → chunk-AXIM6E7T.js.map} +0 -0
  60. /package/dist/{chunk-JU3OUO6X.js.map → chunk-DXWIVGHP.js.map} +0 -0
  61. /package/dist/{chunk-4U7L2NYQ.js.map → chunk-G4U6PSF6.js.map} +0 -0
  62. /package/dist/{chunk-5W4TUUPD.js.map → chunk-ITIG5NTJ.js.map} +0 -0
  63. /package/dist/{chunk-CNJZLZRH.js.map → chunk-LUM7J5FF.js.map} +0 -0
  64. /package/dist/{chunk-SAIW46IC.js.map → chunk-P7ABBLX6.js.map} +0 -0
  65. /package/dist/{chunk-XEFBPP5Y.js.map → chunk-WM2EEV4Q.js.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -6,6 +6,65 @@ All notable changes are documented here. The format follows
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.8.0] — 2026-10-16
10
+
11
+ ### Added
12
+ - **German, Spanish, Portuguese (Brazil), Russian and Chinese** (Simplified),
13
+ built in next to English and French: `locale="de"`, `"es"`, `"pt"`, `"ru"`
14
+ or `"zh"` (`"de-AT"`, `"pt-PT"`, `"zh-CN"`… find them too). Every text is translated — the interface, the
15
+ starting templates, the server's messages and the AI module — and counts
16
+ are written so that no language needs plural forms.
17
+ - The live demo offers the seven languages in a list and opens in the
18
+ visitor's: their browser's language, else the country of their device's
19
+ time zone (read in the page, nothing is sent), else English; a language
20
+ picked is remembered. Its code samples follow the page: their comments and
21
+ `locale` change with the language.
22
+ - `npm run check:i18n` checks every built-in language.
23
+
24
+ ### Changed
25
+ - **Documentation.** The README is now a short front page: what the
26
+ builder is, a quick start and where to read next. The reference moved to
27
+ `docs/`, one page per subject: getting started, editor and library,
28
+ server, variables and sending, AI, brand, languages and the security
29
+ model, with an index in `docs/README.md`. The project has a logo.
30
+
31
+ ## [0.7.0] — 2026-10-15
32
+
33
+ ### Added
34
+ - **The user chooses the model.** In the Connect dialog, under the key, a
35
+ field opens the provider's list of models in place: the default first,
36
+ then the free ones (marked, with a *Free only* filter), then the newest;
37
+ searchable, and an id the list does not have can be used as typed. The
38
+ list is asked with the key (OpenRouter's needs none, so it shows before
39
+ any key); embeddings, speech, pictures and video are left out. The model
40
+ chosen is remembered for each provider and sent with each request.
41
+ `ai.key` gains `model(id?)`, `chooseModel(model, id?)` and
42
+ `listModels(id?, { apiKey, signal })`.
43
+ - **`listProviderModels({ provider, apiKey })`** — the models a provider
44
+ offers for writing, from `/ai` and `/ai/server`. `claudeProvider` lists
45
+ Claude's through the application's SDK and takes the model chosen.
46
+ - The live demo says which model is connected, and its link is now *Change
47
+ provider or model*.
48
+ - **Your own AI agent as the builder's AI** — `agentEmailModel({ url, headers })`
49
+ sends each model turn to an agent of the application's own over a small
50
+ HTTP protocol, `best-email-builder/agent@1` (`{ task, system, messages,
51
+ schema }` in, `{ text }` out, errors as codes the interface explains).
52
+ Generate, Rewrite and Subjects then go through the agent (its tools, its
53
+ knowledge, its users' rights) and its answers are checked like any model's.
54
+ On the server, `headers({ task, user })` gets the user `authorize` returned,
55
+ to forward who asks; the handler now hands that user to the generator and
56
+ its model. The agent's side: `createAgentEndpoint({ complete })` in
57
+ JavaScript, a FastAPI router to copy in `examples/agent/python`;
58
+ `checkAgent({ url, headers })` tries an agent with the builder's own checks.
59
+ See docs/AGENT.md.
60
+ - **`MODEL_UNAVAILABLE`** — a model the provider does not have, or no longer
61
+ (a 404 about the model, OpenRouter's "not a valid model ID"): *Choose
62
+ another one*, instead of *Try again*.
63
+
64
+ ### Changed
65
+ - *Get a key* opens the provider's page in a new tab with `window.open`,
66
+ also where a link's target is ignored (some embedded browsers).
67
+
9
68
  ## [0.6.0] — 2026-10-15
10
69
 
11
70
  ### Added