@robinpath/translate
Advanced tools
| import type { ModuleAdapter } from "@robinpath/core"; | ||
| declare const TranslateModule: ModuleAdapter; | ||
| export default TranslateModule; | ||
| export { TranslateModule }; | ||
| export { TranslateFunctions, TranslateFunctionMetadata, TranslateModuleMetadata, TranslateCredentialTypes, configureTranslate, } from "./translate.js"; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AASrD,QAAA,MAAM,eAAe,EAAE,aAQtB,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC"} |
| import { TranslateFunctions, TranslateFunctionMetadata, TranslateModuleMetadata, TranslateCredentialTypes, configureTranslate, } from "./translate.js"; | ||
| const TranslateModule = { | ||
| name: "translate", | ||
| functions: TranslateFunctions, | ||
| functionMetadata: TranslateFunctionMetadata, | ||
| moduleMetadata: TranslateModuleMetadata, | ||
| credentialTypes: TranslateCredentialTypes, | ||
| configure: configureTranslate, | ||
| global: false, | ||
| }; | ||
| export default TranslateModule; | ||
| export { TranslateModule }; | ||
| export { TranslateFunctions, TranslateFunctionMetadata, TranslateModuleMetadata, TranslateCredentialTypes, configureTranslate, } from "./translate.js"; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AAExB,MAAM,eAAe,GAAkB;IACrC,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,kBAAkB;IAC7B,gBAAgB,EAAE,yBAAyB;IAC3C,cAAc,EAAE,uBAAuB;IACvC,eAAe,EAAE,wBAAwB;IACzC,SAAS,EAAE,kBAAkB;IAC7B,MAAM,EAAE,KAAK;CACd,CAAC;AAEF,eAAe,eAAe,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC"} |
| /** | ||
| * RobinPath Translate Module (Node port). | ||
| * | ||
| * Generic translation gateway with pluggable backends. The credential | ||
| * selects which provider to call — so the same script works against | ||
| * MyMemory, LibreTranslate, or Google Cloud Translate just by swapping | ||
| * the credential. | ||
| * | ||
| * Supported providers (`provider` field on the credential): | ||
| * - 'mymemory' — free community API (no key required; `api_key` may be empty) | ||
| * - 'libretranslate' — self-hostable; optional key; `base_url` picks instance | ||
| * - 'google' — Google Cloud Translation v2 (`api_key` required) | ||
| * | ||
| * A credential slug is OPTIONAL for MyMemory — if a handler is called with | ||
| * an empty slug, the module falls back to unauthenticated MyMemory. | ||
| * | ||
| * Credential type: | ||
| * - translate : { provider, api_key?, base_url?, default_source?, default_target? } | ||
| */ | ||
| import type { BuiltinHandler, CredentialTypeSchema, FunctionMetadata, ModuleHost, ModuleMetadata } from "@robinpath/core"; | ||
| export declare function configureTranslate(h: ModuleHost): void; | ||
| export declare const TranslateFunctions: Record<string, BuiltinHandler>; | ||
| export declare const TranslateCredentialTypes: CredentialTypeSchema[]; | ||
| export declare const TranslateFunctionMetadata: Record<string, FunctionMetadata>; | ||
| export declare const TranslateModuleMetadata: ModuleMetadata; | ||
| //# sourceMappingURL=translate.d.ts.map |
| {"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../src/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,cAAc,EAEf,MAAM,iBAAiB,CAAC;AAKzB,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI,CAAoB;AAka3E,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAW7D,CAAC;AAIF,eAAO,MAAM,wBAAwB,EAAE,oBAAoB,EA+C1D,CAAC;AAgCF,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAmXtE,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAuBrC,CAAC"} |
| /** | ||
| * RobinPath Translate Module (Node port). | ||
| * | ||
| * Generic translation gateway with pluggable backends. The credential | ||
| * selects which provider to call — so the same script works against | ||
| * MyMemory, LibreTranslate, or Google Cloud Translate just by swapping | ||
| * the credential. | ||
| * | ||
| * Supported providers (`provider` field on the credential): | ||
| * - 'mymemory' — free community API (no key required; `api_key` may be empty) | ||
| * - 'libretranslate' — self-hostable; optional key; `base_url` picks instance | ||
| * - 'google' — Google Cloud Translation v2 (`api_key` required) | ||
| * | ||
| * A credential slug is OPTIONAL for MyMemory — if a handler is called with | ||
| * an empty slug, the module falls back to unauthenticated MyMemory. | ||
| * | ||
| * Credential type: | ||
| * - translate : { provider, api_key?, base_url?, default_source?, default_target? } | ||
| */ | ||
| // ── Module state ──────────────────────────────────────────────────────── | ||
| const state = {}; | ||
| export function configureTranslate(h) { state.host = h; } | ||
| function host() { | ||
| if (!state.host) | ||
| throw new Error("Translate module not initialized — use rp.installModule()."); | ||
| return state.host; | ||
| } | ||
| const CREDENTIAL_TYPE = "translate"; | ||
| const errorReturn = (error, code, extra = {}) => ({ error, code, ...extra }); | ||
| const PROVIDER_DEFAULTS = { | ||
| mymemory: { baseUrl: "https://api.mymemory.translated.net" }, | ||
| libretranslate: { baseUrl: "https://libretranslate.com" }, | ||
| google: { baseUrl: "https://translation.googleapis.com/language/translate/v2" }, | ||
| }; | ||
| async function resolveConfig(slug) { | ||
| // If no slug is given, fall back to public MyMemory. | ||
| if (!slug) { | ||
| return { | ||
| provider: "mymemory", | ||
| apiKey: "", | ||
| baseUrl: PROVIDER_DEFAULTS.mymemory.baseUrl, | ||
| defaultSource: "auto", | ||
| defaultTarget: "en", | ||
| }; | ||
| } | ||
| let fields; | ||
| try { | ||
| fields = await host().credentials.get(slug); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "credential_not_found"); | ||
| } | ||
| if (!fields) | ||
| return errorReturn(`Credential '${slug}' not found.`, "credential_not_found"); | ||
| const providerRaw = String(fields.provider ?? "mymemory").toLowerCase(); | ||
| const provider = providerRaw === "libretranslate" ? "libretranslate" : | ||
| providerRaw === "google" ? "google" : | ||
| "mymemory"; | ||
| const apiKey = String(fields.api_key ?? ""); | ||
| if (provider === "google" && !apiKey) { | ||
| return errorReturn("Google provider requires `api_key`.", "api_key_missing"); | ||
| } | ||
| return { | ||
| provider, | ||
| apiKey, | ||
| baseUrl: String(fields.base_url ?? PROVIDER_DEFAULTS[provider].baseUrl).replace(/\/+$/, ""), | ||
| defaultSource: String(fields.default_source ?? "auto"), | ||
| defaultTarget: String(fields.default_target ?? "en"), | ||
| }; | ||
| } | ||
| // ── Provider-specific translators ─────────────────────────────────────── | ||
| async function translateMyMemory(cfg, text, source, target) { | ||
| const langPair = `${source || "auto"}|${target}`; | ||
| const url = `${cfg.baseUrl}/get?q=${encodeURIComponent(text)}&langpair=${encodeURIComponent(langPair)}`; | ||
| let response; | ||
| try { | ||
| response = await fetch(url); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| let data; | ||
| try { | ||
| data = raw ? JSON.parse(raw) : {}; | ||
| } | ||
| catch { | ||
| data = { raw }; | ||
| } | ||
| if (!response.ok) { | ||
| return errorReturn(`MyMemory returned HTTP ${response.status}.`, "provider_error", { status: response.status, provider_error: data }); | ||
| } | ||
| const responseData = data.responseData; | ||
| return { | ||
| provider: "mymemory", | ||
| translatedText: responseData?.translatedText ?? "", | ||
| detectedSource: data.responseStatus === 200 ? source : source, | ||
| raw: data, | ||
| }; | ||
| } | ||
| async function translateLibre(cfg, text, source, target) { | ||
| const body = { | ||
| q: text, | ||
| source: source || "auto", | ||
| target, | ||
| format: "text", | ||
| }; | ||
| if (cfg.apiKey) | ||
| body.api_key = cfg.apiKey; | ||
| let response; | ||
| try { | ||
| response = await fetch(`${cfg.baseUrl}/translate`, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify(body), | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| let data; | ||
| try { | ||
| data = raw ? JSON.parse(raw) : {}; | ||
| } | ||
| catch { | ||
| data = { raw }; | ||
| } | ||
| if (!response.ok) { | ||
| return errorReturn(`LibreTranslate returned HTTP ${response.status}.`, "provider_error", { status: response.status, provider_error: data }); | ||
| } | ||
| return { | ||
| provider: "libretranslate", | ||
| translatedText: String(data.translatedText ?? ""), | ||
| detectedSource: data.detectedLanguage?.language ?? source, | ||
| raw: data, | ||
| }; | ||
| } | ||
| async function translateGoogle(cfg, text, source, target) { | ||
| const url = `${cfg.baseUrl}?key=${encodeURIComponent(cfg.apiKey)}`; | ||
| const body = { q: text, target }; | ||
| if (source && source !== "auto") | ||
| body.source = source; | ||
| let response; | ||
| try { | ||
| response = await fetch(url, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify(body), | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| let data; | ||
| try { | ||
| data = raw ? JSON.parse(raw) : {}; | ||
| } | ||
| catch { | ||
| data = { raw }; | ||
| } | ||
| if (!response.ok) { | ||
| return errorReturn(`Google returned HTTP ${response.status}.`, "provider_error", { status: response.status, provider_error: data }); | ||
| } | ||
| const d = data.data; | ||
| const t = d?.translations?.[0]; | ||
| return { | ||
| provider: "google", | ||
| translatedText: t?.translatedText ?? "", | ||
| detectedSource: t?.detectedSourceLanguage ?? source, | ||
| raw: data, | ||
| }; | ||
| } | ||
| async function dispatchTranslate(cfg, text, source, target) { | ||
| switch (cfg.provider) { | ||
| case "mymemory": return translateMyMemory(cfg, text, source, target); | ||
| case "libretranslate": return translateLibre(cfg, text, source, target); | ||
| case "google": return translateGoogle(cfg, text, source, target); | ||
| } | ||
| } | ||
| // ── Handlers ──────────────────────────────────────────────────────────── | ||
| /** Translate a single string. */ | ||
| const translateText = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const text = String(args[1] ?? ""); | ||
| const target = String(args[2] ?? "") || undefined; | ||
| const source = String(args[3] ?? "") || undefined; | ||
| if (!text) | ||
| return errorReturn("`text` is required.", "text_missing"); | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| return (await dispatchTranslate(cfg, text, source ?? cfg.defaultSource, target ?? cfg.defaultTarget)); | ||
| }; | ||
| /** Translate an array of strings, return a plain array of translated strings. */ | ||
| const translateBatch = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const input = Array.isArray(args[1]) ? args[1].map(String) : [String(args[1] ?? "")]; | ||
| const target = String(args[2] ?? "") || undefined; | ||
| const source = String(args[3] ?? "") || undefined; | ||
| if (input.length === 0) | ||
| return []; | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| const results = []; | ||
| for (const item of input) { | ||
| const r = await dispatchTranslate(cfg, item, source ?? cfg.defaultSource, target ?? cfg.defaultTarget); | ||
| if (r && typeof r === "object" && "error" in r) { | ||
| results.push(r); | ||
| } | ||
| else { | ||
| results.push(String(r.translatedText ?? "")); | ||
| } | ||
| } | ||
| return results; | ||
| }; | ||
| /** Detect a language for a piece of text. */ | ||
| const detectLanguage = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const text = String(args[1] ?? ""); | ||
| if (!text) | ||
| return errorReturn("`text` is required.", "text_missing"); | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| if (cfg.provider === "libretranslate") { | ||
| let response; | ||
| try { | ||
| response = await fetch(`${cfg.baseUrl}/detect`, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ q: text, ...(cfg.apiKey ? { api_key: cfg.apiKey } : {}) }), | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| let data; | ||
| try { | ||
| data = raw ? JSON.parse(raw) : []; | ||
| } | ||
| catch { | ||
| data = { raw }; | ||
| } | ||
| return data; | ||
| } | ||
| if (cfg.provider === "google") { | ||
| const url = `${cfg.baseUrl}/detect?key=${encodeURIComponent(cfg.apiKey)}`; | ||
| let response; | ||
| try { | ||
| response = await fetch(url, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ q: text }), | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| let data; | ||
| try { | ||
| data = raw ? JSON.parse(raw) : {}; | ||
| } | ||
| catch { | ||
| data = { raw }; | ||
| } | ||
| return data; | ||
| } | ||
| // MyMemory: piggy-back on a translate call and trust detectedSource. | ||
| const result = await translateMyMemory(cfg, text, "auto", "en"); | ||
| if (result && typeof result === "object" && "error" in result) | ||
| return result; | ||
| const r = result; | ||
| return { language: r.detectedSource ?? "unknown", provider: cfg.provider }; | ||
| }; | ||
| /** List supported languages for the credential's provider. */ | ||
| const listLanguages = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| if (cfg.provider === "libretranslate") { | ||
| try { | ||
| const response = await fetch(`${cfg.baseUrl}/languages`); | ||
| return (await response.json()); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| } | ||
| if (cfg.provider === "google") { | ||
| try { | ||
| const response = await fetch(`${cfg.baseUrl}/languages?key=${encodeURIComponent(cfg.apiKey)}&target=en`); | ||
| return (await response.json()); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| } | ||
| // MyMemory doesn't have a language-listing endpoint — return the ISO-639-1 subset it supports. | ||
| return { | ||
| provider: "mymemory", | ||
| languages: [ | ||
| "en", "es", "fr", "de", "it", "pt", "nl", "ru", "zh", "ja", | ||
| "ko", "ar", "tr", "pl", "sv", "no", "da", "fi", "cs", "el", | ||
| "he", "hi", "hu", "id", "th", "vi", "uk", "ro", "bg", | ||
| ], | ||
| }; | ||
| }; | ||
| /** List supported source→target language pairs. Only meaningful for some providers. */ | ||
| const getSupportedLanguagePairs = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| // Most backends support any-to-any. Return the languages list with a flag. | ||
| const langs = await listLanguages([slug]); | ||
| return { provider: cfg.provider, note: "Any source → any target is supported.", languages: langs }; | ||
| }; | ||
| /** Translate an HTML snippet. Best-effort — some providers preserve tags, others don't. */ | ||
| const translateHtml = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const html = String(args[1] ?? ""); | ||
| const target = String(args[2] ?? "") || undefined; | ||
| const source = String(args[3] ?? "") || undefined; | ||
| if (!html) | ||
| return errorReturn("`html` is required.", "text_missing"); | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| if (cfg.provider === "libretranslate") { | ||
| let response; | ||
| try { | ||
| response = await fetch(`${cfg.baseUrl}/translate`, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ | ||
| q: html, | ||
| source: source ?? cfg.defaultSource ?? "auto", | ||
| target: target ?? cfg.defaultTarget, | ||
| format: "html", | ||
| ...(cfg.apiKey ? { api_key: cfg.apiKey } : {}), | ||
| }), | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| try { | ||
| return JSON.parse(raw); | ||
| } | ||
| catch { | ||
| return { raw }; | ||
| } | ||
| } | ||
| if (cfg.provider === "google") { | ||
| const url = `${cfg.baseUrl}?key=${encodeURIComponent(cfg.apiKey)}`; | ||
| const body = { q: html, target: target ?? cfg.defaultTarget, format: "html" }; | ||
| const srcEff = source ?? cfg.defaultSource; | ||
| if (srcEff && srcEff !== "auto") | ||
| body.source = srcEff; | ||
| let response; | ||
| try { | ||
| response = await fetch(url, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify(body), | ||
| }); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| try { | ||
| return JSON.parse(raw); | ||
| } | ||
| catch { | ||
| return { raw }; | ||
| } | ||
| } | ||
| // MyMemory: no formal HTML mode; send as plain text and trust the server to leave tags alone. | ||
| return translateMyMemory(cfg, html, source ?? cfg.defaultSource, target ?? cfg.defaultTarget); | ||
| }; | ||
| /** Submit a suggested improvement to a translation memory (MyMemory only). */ | ||
| const suggestTranslation = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const opts = (args[1] && typeof args[1] === "object" ? args[1] : {}); | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| if (cfg.provider !== "mymemory") { | ||
| return errorReturn("`suggestTranslation` is only supported by MyMemory.", "unsupported_provider"); | ||
| } | ||
| const source = String(opts.source ?? ""); | ||
| const target = String(opts.target ?? ""); | ||
| const from = String(opts.from ?? "en"); | ||
| const to = String(opts.to ?? "es"); | ||
| if (!source || !target) | ||
| return errorReturn("`source` and `target` are required.", "invalid_argument"); | ||
| const url = `${cfg.baseUrl}/set?lp=${encodeURIComponent(`${from}|${to}`)}&segment=${encodeURIComponent(source)}&translation=${encodeURIComponent(target)}`; | ||
| let response; | ||
| try { | ||
| response = await fetch(url); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| try { | ||
| return JSON.parse(raw); | ||
| } | ||
| catch { | ||
| return { raw }; | ||
| } | ||
| }; | ||
| /** Query MyMemory's translation memory for existing matches of a phrase. */ | ||
| const getTranslationMemory = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const text = String(args[1] ?? ""); | ||
| const target = String(args[2] ?? ""); | ||
| const source = String(args[3] ?? "auto"); | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| if (cfg.provider !== "mymemory") { | ||
| return errorReturn("`getTranslationMemory` is only supported by MyMemory.", "unsupported_provider"); | ||
| } | ||
| if (!text || !target) | ||
| return errorReturn("`text` and `target` are required.", "invalid_argument"); | ||
| const url = `${cfg.baseUrl}/get?q=${encodeURIComponent(text)}&langpair=${encodeURIComponent(`${source}|${target}`)}`; | ||
| let response; | ||
| try { | ||
| response = await fetch(url); | ||
| } | ||
| catch (e) { | ||
| return errorReturn(e instanceof Error ? e.message : String(e), "transport"); | ||
| } | ||
| const raw = await response.text(); | ||
| try { | ||
| const data = JSON.parse(raw); | ||
| return { matches: data.matches ?? [], raw: data }; | ||
| } | ||
| catch { | ||
| return { raw }; | ||
| } | ||
| }; | ||
| /** Auto-detect the source language, then translate. */ | ||
| const autoTranslate = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const text = String(args[1] ?? ""); | ||
| const target = String(args[2] ?? "") || undefined; | ||
| if (!text) | ||
| return errorReturn("`text` is required.", "text_missing"); | ||
| const cfg = await resolveConfig(slug); | ||
| if ("error" in cfg) | ||
| return cfg; | ||
| return (await dispatchTranslate(cfg, text, "auto", target ?? cfg.defaultTarget)); | ||
| }; | ||
| /** Set the active provider by overwriting a stored credential in memory (session-scoped). */ | ||
| const setProvider = async (args) => { | ||
| const slug = String(args[0] ?? ""); | ||
| const providerName = String(args[1] ?? "mymemory").toLowerCase(); | ||
| if (!slug) | ||
| return errorReturn("Credential slug is required.", "credential_not_found"); | ||
| if (!["mymemory", "libretranslate", "google"].includes(providerName)) { | ||
| return errorReturn(`Unknown provider '${providerName}'. Use mymemory, libretranslate, or google.`, "invalid_argument"); | ||
| } | ||
| const fields = await host().credentials.get(slug); | ||
| if (!fields) | ||
| return errorReturn(`Credential '${slug}' not found.`, "credential_not_found"); | ||
| const next = { ...fields, provider: providerName }; | ||
| await host().credentials.set(slug, CREDENTIAL_TYPE, next); | ||
| return { credential: slug, provider: providerName }; | ||
| }; | ||
| // ── Exports ───────────────────────────────────────────────────────────── | ||
| export const TranslateFunctions = { | ||
| translateText, | ||
| translateBatch, | ||
| detectLanguage, | ||
| listLanguages, | ||
| getSupportedLanguagePairs, | ||
| translateHtml, | ||
| suggestTranslation, | ||
| getTranslationMemory, | ||
| autoTranslate, | ||
| setProvider, | ||
| }; | ||
| // ── Credential types ──────────────────────────────────────────────────── | ||
| export const TranslateCredentialTypes = [ | ||
| { | ||
| slug: CREDENTIAL_TYPE, | ||
| title: "Translation Provider", | ||
| icon: "languages", | ||
| fields: [ | ||
| { | ||
| name: "provider", | ||
| title: "Provider", | ||
| type: "text", | ||
| required: true, | ||
| description: "'mymemory' (no key), 'libretranslate' (optional key), or 'google' (requires key).", | ||
| placeholder: "mymemory", | ||
| }, | ||
| { | ||
| name: "api_key", | ||
| title: "API Key", | ||
| type: "password", | ||
| required: false, | ||
| description: "Required for 'google'. Optional for 'libretranslate'. Ignored for 'mymemory'.", | ||
| }, | ||
| { | ||
| name: "base_url", | ||
| title: "Base URL", | ||
| type: "text", | ||
| required: false, | ||
| description: "Override the provider endpoint. Useful for self-hosted LibreTranslate.", | ||
| placeholder: "https://libretranslate.com", | ||
| }, | ||
| { | ||
| name: "default_source", | ||
| title: "Default source", | ||
| type: "text", | ||
| required: false, | ||
| description: "ISO code used when a handler doesn't supply `source`. Default: 'auto'.", | ||
| placeholder: "auto", | ||
| }, | ||
| { | ||
| name: "default_target", | ||
| title: "Default target", | ||
| type: "text", | ||
| required: false, | ||
| description: "ISO code used when a handler doesn't supply `target`. Default: 'en'.", | ||
| placeholder: "en", | ||
| }, | ||
| ], | ||
| }, | ||
| ]; | ||
| // ── Function metadata ─────────────────────────────────────────────────── | ||
| const credentialParam = { | ||
| name: "credential", | ||
| title: "Credential", | ||
| description: "Slug of a saved `translate` credential. May be empty — falls back to public MyMemory.", | ||
| dataType: "string", | ||
| formInputType: "resource", | ||
| required: false, | ||
| allowExpression: true, | ||
| placeholder: "my_translate", | ||
| resource: { | ||
| type: "credential", | ||
| listFn: "credential.list", | ||
| modes: ["list", "expression"], | ||
| searchable: true, | ||
| filter: { type: CREDENTIAL_TYPE }, | ||
| }, | ||
| }; | ||
| const commonErrors = { | ||
| credential_not_found: "No credential with that slug exists in the vault.", | ||
| api_key_missing: "The credential's provider requires an `api_key` and the field is empty.", | ||
| transport: "Network failure reaching the translation provider.", | ||
| provider_error: "The provider returned an error — see `provider_error` for details.", | ||
| text_missing: "`text` is required.", | ||
| invalid_argument: "A required argument is missing or empty.", | ||
| unsupported_provider: "The selected provider does not support this operation.", | ||
| }; | ||
| export const TranslateFunctionMetadata = { | ||
| translateText: { | ||
| title: "Translate text", | ||
| summary: "Translate a single string via the credential's provider", | ||
| description: "Returns `{ provider, translatedText, detectedSource, raw }`.", | ||
| group: "translate", | ||
| action: "write", | ||
| icon: "languages", | ||
| capability: "read", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["translate"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "text", | ||
| title: "Text", | ||
| description: "The string to translate.", | ||
| dataType: "string", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 4, | ||
| }, | ||
| { | ||
| name: "target", | ||
| title: "Target language", | ||
| description: "ISO-639-1 code (e.g. 'en', 'de', 'fr'). Falls back to the credential's default_target.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: false, | ||
| allowExpression: true, | ||
| placeholder: "en", | ||
| }, | ||
| { | ||
| name: "source", | ||
| title: "Source language", | ||
| description: "ISO-639-1 code or 'auto'. Falls back to the credential's default_source.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: false, | ||
| allowExpression: true, | ||
| placeholder: "auto", | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "{ provider, translatedText, detectedSource, raw }", | ||
| errors: commonErrors, | ||
| example: 'translate.translateText "my_translate" "Hello world" "de"', | ||
| }, | ||
| translateBatch: { | ||
| title: "Translate batch", | ||
| summary: "Translate an array of strings", | ||
| description: "Returns an array of translated strings (same order as input). Provider errors are returned in-place.", | ||
| group: "translate", | ||
| action: "write", | ||
| icon: "languages", | ||
| capability: "read", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["translate", "batch"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "texts", | ||
| title: "Texts", | ||
| description: "Array of strings (or a single string).", | ||
| dataType: "any", | ||
| formInputType: "json", | ||
| required: true, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 3, | ||
| }, | ||
| { | ||
| name: "target", | ||
| title: "Target language", | ||
| description: "ISO-639-1 code. Falls back to credential default.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: false, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "source", | ||
| title: "Source language", | ||
| description: "ISO-639-1 code or 'auto'.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: false, | ||
| allowExpression: true, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "array", | ||
| returnDescription: "Array of translated strings.", | ||
| errors: commonErrors, | ||
| example: 'translate.translateBatch "my_translate" ["hi","bye"] "es"', | ||
| }, | ||
| detectLanguage: { | ||
| title: "Detect language", | ||
| summary: "Guess the source language of a string", | ||
| description: "Returns provider-specific detection output. For MyMemory this is piggy-backed on a translate call.", | ||
| group: "detect", | ||
| action: "read", | ||
| icon: "search", | ||
| capability: "read", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["translate", "detect"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "text", | ||
| title: "Text", | ||
| description: "The string whose language we want.", | ||
| dataType: "string", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 3, | ||
| }, | ||
| ], | ||
| returnType: "any", | ||
| returnDescription: "Detection result (provider-dependent shape).", | ||
| errors: commonErrors, | ||
| example: 'translate.detectLanguage "my_translate" "Bonjour"', | ||
| }, | ||
| listLanguages: { | ||
| title: "List languages", | ||
| summary: "Return supported languages for the provider", | ||
| description: "For LibreTranslate and Google we return the provider's list. For MyMemory we return a curated subset of ISO-639-1 codes.", | ||
| group: "reference", | ||
| action: "read", | ||
| icon: "list", | ||
| capability: "read", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["translate", "languages"], | ||
| parameters: [credentialParam], | ||
| returnType: "any", | ||
| returnDescription: "Provider-specific language list.", | ||
| errors: commonErrors, | ||
| example: 'translate.listLanguages "my_translate"', | ||
| }, | ||
| getSupportedLanguagePairs: { | ||
| title: "Supported language pairs", | ||
| summary: "Which source→target combinations the provider supports", | ||
| description: "Most backends support any-to-any; this endpoint echoes the language list with a note.", | ||
| group: "reference", | ||
| action: "read", | ||
| icon: "shuffle", | ||
| capability: "read", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["translate", "languages"], | ||
| parameters: [credentialParam], | ||
| returnType: "object", | ||
| returnDescription: "{ provider, note, languages }", | ||
| errors: commonErrors, | ||
| example: 'translate.getSupportedLanguagePairs "my_translate"', | ||
| }, | ||
| translateHtml: { | ||
| title: "Translate HTML", | ||
| summary: "Translate an HTML fragment, preserving tags when the provider supports it", | ||
| description: "LibreTranslate and Google honor HTML tags natively. MyMemory treats it as plain text.", | ||
| group: "translate", | ||
| action: "write", | ||
| icon: "code", | ||
| capability: "read", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["translate", "html"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "html", | ||
| title: "HTML", | ||
| description: "HTML string to translate.", | ||
| dataType: "string", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 6, | ||
| }, | ||
| { | ||
| name: "target", | ||
| title: "Target language", | ||
| description: "ISO-639-1 code.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: false, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "source", | ||
| title: "Source language", | ||
| description: "ISO-639-1 code or 'auto'.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: false, | ||
| allowExpression: true, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "any", | ||
| returnDescription: "Provider response (translated HTML inside).", | ||
| errors: commonErrors, | ||
| example: 'translate.translateHtml "my_translate" "<b>Hi</b>" "de"', | ||
| }, | ||
| suggestTranslation: { | ||
| title: "Suggest translation (MyMemory)", | ||
| summary: "Submit a human translation to MyMemory's translation memory", | ||
| description: "MyMemory only. Helps other users by training the community TM. Requires `source` and `target` strings plus `from`/`to` language codes.", | ||
| group: "memory", | ||
| action: "write", | ||
| icon: "plus", | ||
| capability: "manage_options", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["translate", "memory", "mymemory"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "options", | ||
| title: "Options", | ||
| description: "{ source, target, from, to } — all ISO-639-1 codes for from/to.", | ||
| dataType: "object", | ||
| formInputType: "json", | ||
| required: true, | ||
| allowExpression: true, | ||
| language: "json", | ||
| rows: 4, | ||
| placeholder: '{source: "Hello", target: "Hola", from: "en", to: "es"}', | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "MyMemory response.", | ||
| errors: commonErrors, | ||
| example: 'translate.suggestTranslation "my_translate" {source: "Hi", target: "Hola", from: "en", to: "es"}', | ||
| }, | ||
| getTranslationMemory: { | ||
| title: "Get translation memory matches", | ||
| summary: "Find existing TM matches for a phrase (MyMemory)", | ||
| description: "MyMemory only. Returns an array of prior translation suggestions from the TM.", | ||
| group: "memory", | ||
| action: "read", | ||
| icon: "book", | ||
| capability: "read", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["translate", "memory", "mymemory"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "text", | ||
| title: "Text", | ||
| description: "Phrase to look up.", | ||
| dataType: "string", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 3, | ||
| }, | ||
| { | ||
| name: "target", | ||
| title: "Target language", | ||
| description: "ISO-639-1 code.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| }, | ||
| { | ||
| name: "source", | ||
| title: "Source language", | ||
| description: "ISO-639-1 code. Default 'auto'.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: false, | ||
| allowExpression: true, | ||
| advanced: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "{ matches, raw }", | ||
| errors: commonErrors, | ||
| example: 'translate.getTranslationMemory "my_translate" "Good morning" "es"', | ||
| }, | ||
| autoTranslate: { | ||
| title: "Auto translate", | ||
| summary: "Translate without specifying a source language", | ||
| description: "Forces `source=auto`. Equivalent to `translateText` without the fourth argument.", | ||
| group: "translate", | ||
| action: "write", | ||
| icon: "wand-2", | ||
| capability: "read", | ||
| sideEffects: ["makes_http_call"], | ||
| idempotent: true, | ||
| since: "1.0.0", | ||
| tags: ["translate", "auto"], | ||
| parameters: [ | ||
| credentialParam, | ||
| { | ||
| name: "text", | ||
| title: "Text", | ||
| description: "String to translate.", | ||
| dataType: "string", | ||
| formInputType: "textarea", | ||
| required: true, | ||
| allowExpression: true, | ||
| rows: 3, | ||
| }, | ||
| { | ||
| name: "target", | ||
| title: "Target language", | ||
| description: "ISO-639-1 code. Falls back to credential default.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: false, | ||
| allowExpression: true, | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "{ provider, translatedText, detectedSource, raw }", | ||
| errors: commonErrors, | ||
| example: 'translate.autoTranslate "my_translate" "Bonjour" "en"', | ||
| }, | ||
| setProvider: { | ||
| title: "Set provider", | ||
| summary: "Rewrite the credential's `provider` field in the vault", | ||
| description: "Writes back to the credential store with a new `provider` value. Useful when a single credential needs to swap between free/paid providers at runtime.", | ||
| group: "setup", | ||
| action: "write", | ||
| icon: "toggle-right", | ||
| capability: "manage_options", | ||
| sideEffects: [], | ||
| idempotent: false, | ||
| since: "1.0.0", | ||
| tags: ["translate", "provider"], | ||
| parameters: [ | ||
| { | ||
| ...credentialParam, | ||
| required: true, | ||
| }, | ||
| { | ||
| name: "provider", | ||
| title: "Provider", | ||
| description: "'mymemory' | 'libretranslate' | 'google'.", | ||
| dataType: "string", | ||
| formInputType: "text", | ||
| required: true, | ||
| allowExpression: true, | ||
| defaultValue: "mymemory", | ||
| }, | ||
| ], | ||
| returnType: "object", | ||
| returnDescription: "{ credential, provider }", | ||
| errors: commonErrors, | ||
| example: 'translate.setProvider "my_translate" "libretranslate"', | ||
| }, | ||
| }; | ||
| export const TranslateModuleMetadata = { | ||
| slug: "translate", | ||
| title: "Translate (multi-provider)", | ||
| summary: "Generic translation wrapper — MyMemory (free), LibreTranslate, or Google Cloud Translate", | ||
| description: "A provider-agnostic translation module. The credential picks the backend: MyMemory needs no key, LibreTranslate is free / self-hostable, Google requires an API key. Every handler takes an optional credential slug as its first argument — when empty, handlers default to public MyMemory.", | ||
| category: "translation", | ||
| icon: "icon.svg", | ||
| color: "#38BDF8", | ||
| version: "0.2.0", | ||
| docsUrl: "https://docs.robinpath.com/modules/translate", | ||
| status: "stable", | ||
| requires: [], | ||
| minNodeVersion: "18.0.0", | ||
| credentialsType: CREDENTIAL_TYPE, | ||
| operationGroups: { | ||
| setup: { title: "Setup", description: "Swap active provider.", order: 1 }, | ||
| translate: { title: "Translate", description: "Text, batch, HTML, auto.", order: 2 }, | ||
| detect: { title: "Detect", description: "Language detection.", order: 3 }, | ||
| reference: { title: "Reference", description: "Supported languages.", order: 4 }, | ||
| memory: { title: "Translation memory", description: "MyMemory-specific TM read/write.", order: 5 }, | ||
| }, | ||
| methods: Object.keys(TranslateFunctions), | ||
| }; | ||
| //# sourceMappingURL=translate.js.map |
| {"version":3,"file":"translate.js","sourceRoot":"","sources":["../src/translate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAWH,2EAA2E;AAE3E,MAAM,KAAK,GAA0B,EAAE,CAAC;AACxC,MAAM,UAAU,kBAAkB,CAAC,CAAa,IAAU,KAAK,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC;AAC3E,SAAS,IAAI;IACX,IAAI,CAAC,KAAK,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAC/F,OAAO,KAAK,CAAC,IAAI,CAAC;AACpB,CAAC;AAED,MAAM,eAAe,GAAG,WAAW,CAAC;AAapC,MAAM,WAAW,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,QAAiC,EAAE,EAAe,EAAE,CACpG,CAAC,EAAE,KAAK,EAAE,IAAI,EA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,EAAE,aAAa;IACvB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,8CAA8C;IACvD,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,EAAE;IACZ,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,eAAe;IAChC,eAAe,EAAE;QACf,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,EAAE;QACzE,SAAS,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,EAAE,KAAK,EAAE,CAAC,EAAE;QACpF,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC,EAAE;QACzE,SAAS,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC,EAAE;QAChF,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,kCAAkC,EAAE,KAAK,EAAE,CAAC,EAAE;KACnG;IACD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC;CACzC,CAAC"} |
+18
-8
| { | ||
| "name": "@robinpath/translate", | ||
| "version": "0.1.1", | ||
| "version": "0.3.0", | ||
| "publishConfig": { | ||
@@ -23,21 +23,31 @@ "access": "public" | ||
| "peerDependencies": { | ||
| "@robinpath/core": ">=0.20.0" | ||
| "@robinpath/core": ">=0.40.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@robinpath/core": "^0.30.1", | ||
| "@robinpath/core": "^0.40.0", | ||
| "typescript": "^5.6.0" | ||
| }, | ||
| "description": "Translate module for RobinPath.", | ||
| "description": "Multi-provider translation — MyMemory (free), LibreTranslate (optional key), or Google Cloud Translate. Uses the encrypted credential vault.", | ||
| "keywords": [ | ||
| "translate", | ||
| "ai" | ||
| "translation", | ||
| "i18n", | ||
| "mymemory", | ||
| "libretranslate", | ||
| "google" | ||
| ], | ||
| "license": "MIT", | ||
| "robinpath": { | ||
| "category": "ai", | ||
| "category": "translation", | ||
| "type": "integration", | ||
| "auth": "none", | ||
| "auth": "credential-vault", | ||
| "credentialType": "translate", | ||
| "functionCount": 10, | ||
| "baseUrl": "https://api.mymemory.translated.net" | ||
| "language": "nodejs", | ||
| "platforms": [ | ||
| "cloud", | ||
| "cli", | ||
| "desktop" | ||
| ] | ||
| } | ||
| } |
+1
-1
@@ -22,3 +22,3 @@ # @robinpath/translate | ||
| ```bash | ||
| npm install @robinpath/translate | ||
| robinpath add @robinpath/translate | ||
| ``` | ||
@@ -25,0 +25,0 @@ |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
72684
2056.16%10
400%1006
Infinity%2
100%12
500%