@things-factory/codelingua 10.0.0-beta.57 → 10.0.0-beta.64

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 (77) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist-server/controllers/ai-client.d.ts +4 -0
  3. package/dist-server/controllers/ai-client.js +46 -0
  4. package/dist-server/controllers/ai-client.js.map +1 -0
  5. package/dist-server/controllers/decipher-error-code.js +30 -22
  6. package/dist-server/controllers/decipher-error-code.js.map +1 -1
  7. package/dist-server/controllers/i18n-completion.d.ts +3 -1
  8. package/dist-server/controllers/i18n-completion.js +27 -22
  9. package/dist-server/controllers/i18n-completion.js.map +1 -1
  10. package/dist-server/controllers/index.d.ts +2 -7
  11. package/dist-server/controllers/index.js +2 -7
  12. package/dist-server/controllers/index.js.map +1 -1
  13. package/dist-server/routes.js +5 -46
  14. package/dist-server/routes.js.map +1 -1
  15. package/dist-server/service/code-decipher/code-decipher-resolver.d.ts +0 -1
  16. package/dist-server/service/code-decipher/code-decipher-resolver.js +4 -20
  17. package/dist-server/service/code-decipher/code-decipher-resolver.js.map +1 -1
  18. package/dist-server/service/code-decipher/code-decipher-type.d.ts +3 -0
  19. package/dist-server/service/code-decipher/code-decipher-type.js.map +1 -1
  20. package/dist-server/service/code-decipher/index.d.ts +0 -2
  21. package/dist-server/service/code-decipher/index.js +1 -3
  22. package/dist-server/service/code-decipher/index.js.map +1 -1
  23. package/dist-server/service/i18n-completion/i18n-completion-resolver.js +5 -3
  24. package/dist-server/service/i18n-completion/i18n-completion-resolver.js.map +1 -1
  25. package/dist-server/service/i18n-completion/i18n-completion-type.d.ts +11 -0
  26. package/dist-server/service/i18n-completion/i18n-completion-type.js +8 -0
  27. package/dist-server/service/i18n-completion/i18n-completion-type.js.map +1 -1
  28. package/dist-server/service/index.d.ts +1 -1
  29. package/dist-server/service/index.js +1 -7
  30. package/dist-server/service/index.js.map +1 -1
  31. package/dist-server/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +4 -4
  33. package/dist-server/controllers/api-doc-completion.d.ts +0 -4
  34. package/dist-server/controllers/api-doc-completion.js +0 -32
  35. package/dist-server/controllers/api-doc-completion.js.map +0 -1
  36. package/dist-server/controllers/chat-completion.d.ts +0 -3
  37. package/dist-server/controllers/chat-completion.js +0 -31
  38. package/dist-server/controllers/chat-completion.js.map +0 -1
  39. package/dist-server/controllers/codereview-completion.d.ts +0 -1
  40. package/dist-server/controllers/codereview-completion.js +0 -40
  41. package/dist-server/controllers/codereview-completion.js.map +0 -1
  42. package/dist-server/controllers/decipher-code.d.ts +0 -5
  43. package/dist-server/controllers/decipher-code.js +0 -33
  44. package/dist-server/controllers/decipher-code.js.map +0 -1
  45. package/dist-server/controllers/image-completion.d.ts +0 -5
  46. package/dist-server/controllers/image-completion.js +0 -29
  47. package/dist-server/controllers/image-completion.js.map +0 -1
  48. package/dist-server/controllers/openai-connection.d.ts +0 -2
  49. package/dist-server/controllers/openai-connection.js +0 -16
  50. package/dist-server/controllers/openai-connection.js.map +0 -1
  51. package/dist-server/service/api-doc-completion/api-doc-completion-resolver.d.ts +0 -5
  52. package/dist-server/service/api-doc-completion/api-doc-completion-resolver.js +0 -31
  53. package/dist-server/service/api-doc-completion/api-doc-completion-resolver.js.map +0 -1
  54. package/dist-server/service/api-doc-completion/api-doc-completion-type.d.ts +0 -7
  55. package/dist-server/service/api-doc-completion/api-doc-completion-type.js +0 -30
  56. package/dist-server/service/api-doc-completion/api-doc-completion-type.js.map +0 -1
  57. package/dist-server/service/api-doc-completion/index.d.ts +0 -4
  58. package/dist-server/service/api-doc-completion/index.js +0 -8
  59. package/dist-server/service/api-doc-completion/index.js.map +0 -1
  60. package/dist-server/service/chat-completion/chat-completion-resolver.d.ts +0 -5
  61. package/dist-server/service/chat-completion/chat-completion-resolver.js +0 -30
  62. package/dist-server/service/chat-completion/chat-completion-resolver.js.map +0 -1
  63. package/dist-server/service/chat-completion/chat-completion-type.d.ts +0 -6
  64. package/dist-server/service/chat-completion/chat-completion-type.js +0 -26
  65. package/dist-server/service/chat-completion/chat-completion-type.js.map +0 -1
  66. package/dist-server/service/chat-completion/index.d.ts +0 -4
  67. package/dist-server/service/chat-completion/index.js +0 -8
  68. package/dist-server/service/chat-completion/index.js.map +0 -1
  69. package/dist-server/service/image-completion/image-completion-resolver.d.ts +0 -5
  70. package/dist-server/service/image-completion/image-completion-resolver.js +0 -30
  71. package/dist-server/service/image-completion/image-completion-resolver.js.map +0 -1
  72. package/dist-server/service/image-completion/image-completion-type.d.ts +0 -8
  73. package/dist-server/service/image-completion/image-completion-type.js +0 -34
  74. package/dist-server/service/image-completion/image-completion-type.js.map +0 -1
  75. package/dist-server/service/image-completion/index.d.ts +0 -4
  76. package/dist-server/service/image-completion/index.js +0 -8
  77. package/dist-server/service/image-completion/index.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -6,3 +6,33 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
6
  and adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  <!-- ## [Unreleased] -->
9
+ <!--
10
+ On the next release, replace the marker above with the assigned version header
11
+ (e.g. `## [10.0.0-beta.58]`) and uncomment this block.
12
+
13
+ ### Changed
14
+ - Migrated all AI calls from direct `openai` SDK to `@things-factory/ai-client-base` — codelingua is now provider-agnostic (Anthropic / Gemini / OpenAI).
15
+ - Removed hardcoded `gpt-3.5-turbo` model. Model selection now governed by `config.aiClient` (preferred) or legacy `config.openai`.
16
+ - Package focus narrowed to its core identity: **error message decipher + i18n auto-translation**. The package description statement remains the source of truth for scope.
17
+
18
+ ### Improved
19
+ - `i18n-completion`: `sourceLocale` and `targetLocales` are now configurable input fields. The previous hardcoded "ko → en/ja/zh/ms" behavior is preserved as the default when these fields are omitted.
20
+ - `decipher-error-code`: tightened system prompt — concise (2–4 sentences), causal, actionable, fully localized.
21
+
22
+ ### Removed
23
+ - `chatCompletion` / GraphQL `chatCompletion` query / `POST /chat-completion` — generic LLM chat without domain context. Use `@things-factory/board-ai` natural-language chat for a richer domain workflow.
24
+ - `apiDocCompletion` / `POST /api-doc-completion` — code documentation generation is better handled by IDE assistants (Copilot, Cursor, Continue).
25
+ - `decipherCode` (the non-error-message variant) / `POST /code-decipher` — code explanation overlapped with IDE assistant scope.
26
+ - `codereviewCompletion` / `POST /codereview-completion` — code review is IDE/CI scope. Existing callers (`operato-codelingua/github-webhook-router`) migrated to call `ai-client-base` directly.
27
+ - `imageCompletion` / `POST /image-completion` — the implementation was a prompt-injection trick instructing an LLM to write Unsplash URLs in markdown (the LLM never saw an image). Real image generation will be added later via a dedicated capability on `ai-client-base`.
28
+
29
+ ### Dependencies
30
+ - Removed: `openai`
31
+ - Added: `@things-factory/ai-client-base`
32
+
33
+ ### Backward compatibility
34
+ - HTTP `POST /error-code-decipher` and `POST /i18n-completion` preserved.
35
+ - GraphQL `decipherErrorCode` and `i18nCompletion` queries preserved with the same input/output type names (`CodeDecipherInput` / `CodeDecipherOutput` / `i18nCompletionInput` / `i18nCompletionOutput`).
36
+ - The legacy `config.openai: { organization, apiKey }` is still honored as a fallback when `config.aiClient` is not set.
37
+ -->
38
+
@@ -0,0 +1,4 @@
1
+ import { type AIClient } from '@things-factory/ai-client-base';
2
+ export declare function getCodelinguaClient(): AIClient;
3
+ /** Test 용 reset. */
4
+ export declare function _resetCodelinguaClient(): void;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCodelinguaClient = getCodelinguaClient;
4
+ exports._resetCodelinguaClient = _resetCodelinguaClient;
5
+ /**
6
+ * codelingua 의 AI client 획득 — backward 호환 + provider-agnostic.
7
+ *
8
+ * 우선순위:
9
+ * 1. ai-client-base 의 default client (config.aiClient — 권장 신규 방식)
10
+ * 2. legacy config.openai: { organization, apiKey } (기존 codelingua 사용자)
11
+ *
12
+ * 둘 다 없으면 throw — 호출자 (controller) 가 fallback 메시지 처리.
13
+ *
14
+ * 참고 — codelingua 본연 기능이 "에러 메시지 → 사용자 친화 설명" (decipher-error-code)
15
+ * 인 만큼 어떤 LLM provider 에 묶을 이유가 없다. ai-client-base 위에 올리면 사용자가
16
+ * Anthropic / Gemini / OpenAI 중 자유 선택 가능.
17
+ */
18
+ const env_1 = require("@things-factory/env");
19
+ const ai_client_base_1 = require("@things-factory/ai-client-base");
20
+ let _cached;
21
+ function getCodelinguaClient() {
22
+ if (_cached)
23
+ return _cached;
24
+ // 1) ai-client-base default — config.aiClient 가 있으면 거기서.
25
+ const defaultClient = (0, ai_client_base_1.getDefaultAIClient)();
26
+ if (defaultClient) {
27
+ _cached = defaultClient;
28
+ return _cached;
29
+ }
30
+ // 2) legacy config.openai backward 호환.
31
+ const legacy = env_1.config.get('openai', null);
32
+ if (legacy && legacy.apiKey) {
33
+ _cached = (0, ai_client_base_1.createAIClient)({
34
+ provider: 'openai',
35
+ apiKey: legacy.apiKey,
36
+ ...(legacy.organization && { organization: legacy.organization })
37
+ });
38
+ return _cached;
39
+ }
40
+ throw new Error('codelingua: no AI client available. Configure config.aiClient (preferred) or legacy config.openai.');
41
+ }
42
+ /** Test 용 reset. */
43
+ function _resetCodelinguaClient() {
44
+ _cached = undefined;
45
+ }
46
+ //# sourceMappingURL=ai-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-client.js","sourceRoot":"","sources":["../../server/controllers/ai-client.ts"],"names":[],"mappings":";;AAsBA,kDAwBC;AAGD,wDAEC;AAnDD;;;;;;;;;;;;GAYG;AACH,6CAA4C;AAC5C,mEAIuC;AAEvC,IAAI,OAA6B,CAAA;AAEjC,SAAgB,mBAAmB;IACjC,IAAI,OAAO;QAAE,OAAO,OAAO,CAAA;IAE3B,yDAAyD;IACzD,MAAM,aAAa,GAAG,IAAA,mCAAkB,GAAE,CAAA;IAC1C,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,GAAG,aAAa,CAAA;QACvB,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,uCAAuC;IACvC,MAAM,MAAM,GAAG,YAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAsD,CAAA;IAC9F,IAAI,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;QAC5B,OAAO,GAAG,IAAA,+BAAc,EAAC;YACvB,QAAQ,EAAE,QAAQ;YAClB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,GAAG,CAAC,MAAM,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,CAAC;SAClE,CAAC,CAAA;QACF,OAAO,OAAO,CAAA;IAChB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,oGAAoG,CACrG,CAAA;AACH,CAAC;AAED,oBAAoB;AACpB,SAAgB,sBAAsB;IACpC,OAAO,GAAG,SAAS,CAAA;AACrB,CAAC","sourcesContent":["/**\n * codelingua 의 AI client 획득 — backward 호환 + provider-agnostic.\n *\n * 우선순위:\n * 1. ai-client-base 의 default client (config.aiClient — 권장 신규 방식)\n * 2. legacy config.openai: { organization, apiKey } (기존 codelingua 사용자)\n *\n * 둘 다 없으면 throw — 호출자 (controller) 가 fallback 메시지 처리.\n *\n * 참고 — codelingua 본연 기능이 \"에러 메시지 → 사용자 친화 설명\" (decipher-error-code)\n * 인 만큼 어떤 LLM provider 에 묶을 이유가 없다. ai-client-base 위에 올리면 사용자가\n * Anthropic / Gemini / OpenAI 중 자유 선택 가능.\n */\nimport { config } from '@things-factory/env'\nimport {\n createAIClient,\n getDefaultAIClient,\n type AIClient\n} from '@things-factory/ai-client-base'\n\nlet _cached: AIClient | undefined\n\nexport function getCodelinguaClient(): AIClient {\n if (_cached) return _cached\n\n // 1) ai-client-base default — config.aiClient 가 있으면 거기서.\n const defaultClient = getDefaultAIClient()\n if (defaultClient) {\n _cached = defaultClient\n return _cached\n }\n\n // 2) legacy config.openai backward 호환.\n const legacy = config.get('openai', null) as { organization?: string; apiKey?: string } | null\n if (legacy && legacy.apiKey) {\n _cached = createAIClient({\n provider: 'openai',\n apiKey: legacy.apiKey,\n ...(legacy.organization && { organization: legacy.organization })\n })\n return _cached\n }\n\n throw new Error(\n 'codelingua: no AI client available. Configure config.aiClient (preferred) or legacy config.openai.'\n )\n}\n\n/** Test 용 reset. */\nexport function _resetCodelinguaClient(): void {\n _cached = undefined\n}\n"]}
@@ -1,33 +1,41 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.decipherErrorCode = decipherErrorCode;
4
- const openai_connection_1 = require("./openai-connection");
4
+ /**
5
+ * 알 수 없는 시스템 에러 메시지를 사용자 친화적 설명으로 변환.
6
+ *
7
+ * codelingua 의 핵심 use case — 운영 환경에서 사용자가 SQLITE_CONSTRAINT 같은
8
+ * 메시지를 그대로 보고 막히는 상황을, 한국어/현지어로 "원인 + 다음 행동" 형태로
9
+ * 풀어주는 것.
10
+ *
11
+ * provider-agnostic — ai-client-base 를 통해 OpenAI / Anthropic / Gemini 어느 쪽이든
12
+ * config 에 따라 사용. 모델 / 온도는 옵션, 미지정 시 client 의 default.
13
+ */
14
+ const ai_client_1 = require("./ai-client");
15
+ const FALLBACK_MESSAGE = 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
16
+ const SYSTEM_PROMPT = `You are a helpful assistant that translates cryptic system / framework / database error messages into clear, user-friendly explanations.
17
+
18
+ Your response MUST be:
19
+ 1. Concise — 2 to 4 sentences. No headers, no markdown lists.
20
+ 2. Causal — explain the most likely cause in plain language.
21
+ 3. Actionable — end with a concrete next action the user can take.
22
+ 4. Localized — written entirely in the requested locale.
23
+ Do NOT include the original error code verbatim, do NOT add disclaimers like "I am an AI".`;
5
24
  async function decipherErrorCode({ code, system, language = 'en-US' }) {
6
25
  try {
7
- const completion = await openai_connection_1.client.chat.completions.create({
8
- model: 'gpt-3.5-turbo',
9
- messages: [
10
- {
11
- role: 'system',
12
- content: 'You are a helpful assistant that translates error messages into user-friendly explanations.'
13
- },
14
- {
15
- role: 'user',
16
- content: system
17
- ? `We received an error from the ${system} system. The error message is: ${code}.`
18
- : `The error message is: ${code}.`
19
- },
20
- {
21
- role: 'system',
22
- content: `Translate the explanation according to this locale code "${language}".`
23
- }
24
- ]
26
+ const client = (0, ai_client_1.getCodelinguaClient)();
27
+ const userMsg = system
28
+ ? `Source system: ${system}\nError message: ${code}\nLocale: ${language}`
29
+ : `Error message: ${code}\nLocale: ${language}`;
30
+ const reply = await client.chat([{ role: 'user', content: userMsg }], {
31
+ systemPrompt: SYSTEM_PROMPT,
32
+ temperature: 0.3 // 결정적 — 동일 에러는 비슷한 설명
25
33
  });
26
- return completion.choices[0].message.content;
34
+ return reply || FALLBACK_MESSAGE;
27
35
  }
28
36
  catch (error) {
29
- console.error(error);
30
- return 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
37
+ console.error('[codelingua] decipherErrorCode failed:', error);
38
+ return FALLBACK_MESSAGE;
31
39
  }
32
40
  }
33
41
  //# sourceMappingURL=decipher-error-code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decipher-error-code.js","sourceRoot":"","sources":["../../server/controllers/decipher-error-code.ts"],"names":[],"mappings":";;AAEA,8CAmCC;AArCD,2DAA4C;AAErC,KAAK,UAAU,iBAAiB,CAAC,EACtC,IAAI,EACJ,MAAM,EACN,QAAQ,GAAG,OAAO,EAKnB;IACC,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;YACtD,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,6FAA6F;iBACvG;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,MAAM;wBACb,CAAC,CAAC,iCAAiC,MAAM,kCAAkC,IAAI,GAAG;wBAClF,CAAC,CAAC,yBAAyB,IAAI,GAAG;iBACrC;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,4DAA4D,QAAQ,IAAI;iBAClF;aACF;SACF,CAAC,CAAA;QAEF,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,6FAA6F,CAAA;IACtG,CAAC;AACH,CAAC","sourcesContent":["import { client } from './openai-connection'\n\nexport async function decipherErrorCode({\n code,\n system,\n language = 'en-US'\n}: {\n code: string\n system?: string\n language?: string\n}): Promise<string> {\n try {\n const completion = await client.chat.completions.create({\n model: 'gpt-3.5-turbo',\n messages: [\n {\n role: 'system',\n content: 'You are a helpful assistant that translates error messages into user-friendly explanations.'\n },\n {\n role: 'user',\n content: system\n ? `We received an error from the ${system} system. The error message is: ${code}.`\n : `The error message is: ${code}.`\n },\n {\n role: 'system',\n content: `Translate the explanation according to this locale code \"${language}\".`\n }\n ]\n })\n\n return completion.choices[0].message.content\n } catch (error) {\n console.error(error)\n return 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n }\n}\n"]}
1
+ {"version":3,"file":"decipher-error-code.js","sourceRoot":"","sources":["../../server/controllers/decipher-error-code.ts"],"names":[],"mappings":";;AAuBA,8CA0BC;AAjDD;;;;;;;;;GASG;AACH,2CAAiD;AAEjD,MAAM,gBAAgB,GAAG,6FAA6F,CAAA;AAEtH,MAAM,aAAa,GAAG;;;;;;;2FAOqE,CAAA;AAEpF,KAAK,UAAU,iBAAiB,CAAC,EACtC,IAAI,EACJ,MAAM,EACN,QAAQ,GAAG,OAAO,EAKnB;IACC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAA,+BAAmB,GAAE,CAAA;QACpC,MAAM,OAAO,GAAG,MAAM;YACpB,CAAC,CAAC,kBAAkB,MAAM,oBAAoB,IAAI,aAAa,QAAQ,EAAE;YACzE,CAAC,CAAC,kBAAkB,IAAI,aAAa,QAAQ,EAAE,CAAA;QACjD,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,IAAI,CAC7B,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EACpC;YACE,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,GAAG,CAAC,sBAAsB;SACxC,CACF,CAAA;QACD,OAAO,KAAK,IAAI,gBAAgB,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAA;QAC9D,OAAO,gBAAgB,CAAA;IACzB,CAAC;AACH,CAAC","sourcesContent":["/**\n * 알 수 없는 시스템 에러 메시지를 사용자 친화적 설명으로 변환.\n *\n * codelingua 의 핵심 use case — 운영 환경에서 사용자가 SQLITE_CONSTRAINT 같은\n * 메시지를 그대로 보고 막히는 상황을, 한국어/현지어로 \"원인 + 다음 행동\" 형태로\n * 풀어주는 것.\n *\n * provider-agnostic — ai-client-base 를 통해 OpenAI / Anthropic / Gemini 어느 쪽이든\n * config 에 따라 사용. 모델 / 온도는 옵션, 미지정 시 client 의 default.\n */\nimport { getCodelinguaClient } from './ai-client'\n\nconst FALLBACK_MESSAGE = 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n\nconst SYSTEM_PROMPT = `You are a helpful assistant that translates cryptic system / framework / database error messages into clear, user-friendly explanations.\n\nYour response MUST be:\n1. Concise — 2 to 4 sentences. No headers, no markdown lists.\n2. Causal — explain the most likely cause in plain language.\n3. Actionable — end with a concrete next action the user can take.\n4. Localized — written entirely in the requested locale.\nDo NOT include the original error code verbatim, do NOT add disclaimers like \"I am an AI\".`\n\nexport async function decipherErrorCode({\n code,\n system,\n language = 'en-US'\n}: {\n code: string\n system?: string\n language?: string\n}): Promise<string> {\n try {\n const client = getCodelinguaClient()\n const userMsg = system\n ? `Source system: ${system}\\nError message: ${code}\\nLocale: ${language}`\n : `Error message: ${code}\\nLocale: ${language}`\n const reply = await client.chat(\n [{ role: 'user', content: userMsg }],\n {\n systemPrompt: SYSTEM_PROMPT,\n temperature: 0.3 // 결정적 동일 에러는 비슷한 설명\n }\n )\n return reply || FALLBACK_MESSAGE\n } catch (error) {\n console.error('[codelingua] decipherErrorCode failed:', error)\n return FALLBACK_MESSAGE\n }\n}\n"]}
@@ -1,3 +1,5 @@
1
- export declare function i18nCompletion({ json }: {
1
+ export declare function i18nCompletion({ json, sourceLocale, targetLocales }: {
2
2
  json: string;
3
+ sourceLocale?: string;
4
+ targetLocales?: string[];
3
5
  }): Promise<string>;
@@ -1,32 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.i18nCompletion = i18nCompletion;
4
- const openai_connection_1 = require("./openai-connection");
5
- async function i18nCompletion({ json }) {
4
+ /**
5
+ * i18n JSON 자동 번역 — 원본 JSON + 원본 locale + 대상 locale 배열을 받아서 같은 키
6
+ * 구조로 다국어 JSON 묶음을 생성.
7
+ *
8
+ * 이전 hardcoded "ko → en/ja/zh/ms" 에서 source/target 동적 파라미터로 일반화.
9
+ * provider-agnostic (ai-client-base).
10
+ */
11
+ const ai_client_1 = require("./ai-client");
12
+ const FALLBACK_MESSAGE = 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
13
+ const DEFAULT_SOURCE_LOCALE = 'ko';
14
+ const DEFAULT_TARGET_LOCALES = ['en', 'ja', 'zh', 'ms'];
15
+ const SYSTEM_PROMPT = `You are a translation assistant. You receive a JSON object of i18n key-value pairs in a single source locale, and produce equivalent JSON objects for the requested target locales.
16
+
17
+ Output strictly as a single JSON object whose top-level keys are the target locale codes, and each value is a translated JSON object preserving the EXACT same key structure as the source. Translate values only — never translate keys. Preserve placeholders like {{name}}, %{var}, {0} verbatim. No commentary, no explanation, no markdown — JSON only.`;
18
+ async function i18nCompletion({ json, sourceLocale, targetLocales }) {
6
19
  try {
7
- const completion = await openai_connection_1.client.chat.completions.create({
8
- model: 'gpt-3.5-turbo',
9
- messages: [
10
- {
11
- role: 'system',
12
- content: `You are an assistant that takes a JSON file of key-value pairs in one language and generates equivalent JSON files in other languages.
13
- And you provides pure and direct data in response to user requests. The responses should contain no additional explanations or details.`
14
- },
15
- {
16
- role: 'user',
17
- content: `Here is a JSON file in Korean: [${json}]. Can you help generate equivalent JSON files in these languages: English, Japanese, Chinese and Malaysian?`
18
- },
19
- {
20
- role: 'assistant',
21
- content: "Please generate the translations according to these locale codes: 'en', 'ja', 'zh', 'ms'."
22
- }
23
- ]
20
+ const src = sourceLocale && sourceLocale.length > 0 ? sourceLocale : DEFAULT_SOURCE_LOCALE;
21
+ const targets = targetLocales && targetLocales.length > 0 ? targetLocales : DEFAULT_TARGET_LOCALES;
22
+ const userMsg = `Source locale: ${src}\n` +
23
+ `Target locales: ${JSON.stringify(targets)}\n` +
24
+ `Source JSON:\n${json}`;
25
+ const client = (0, ai_client_1.getCodelinguaClient)();
26
+ const reply = await client.chat([{ role: 'user', content: userMsg }], {
27
+ systemPrompt: SYSTEM_PROMPT,
28
+ temperature: 0.2 // 번역은 일관성 우선
24
29
  });
25
- return completion.choices[0].message.content;
30
+ return reply || FALLBACK_MESSAGE;
26
31
  }
27
32
  catch (error) {
28
- console.error(error);
29
- return 'The Code Lingua service is currently unavailable. Please contact your system administrator.';
33
+ console.error('[codelingua] i18nCompletion failed:', error);
34
+ return FALLBACK_MESSAGE;
30
35
  }
31
36
  }
32
37
  //# sourceMappingURL=i18n-completion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-completion.js","sourceRoot":"","sources":["../../server/controllers/i18n-completion.ts"],"names":[],"mappings":";;AAEA,wCA0BC;AA5BD,2DAA4C;AAErC,KAAK,UAAU,cAAc,CAAC,EAAE,IAAI,EAAoB;IAC7D,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,0BAAM,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;YACtD,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE;oJACiI;iBAC3I;gBACD;oBACE,IAAI,EAAE,MAAM;oBACZ,OAAO,EAAE,mCAAmC,IAAI,8GAA8G;iBAC/J;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,2FAA2F;iBACrG;aACF;SACF,CAAC,CAAA;QAEF,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAA;IAC9C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACpB,OAAO,6FAA6F,CAAA;IACtG,CAAC;AACH,CAAC","sourcesContent":["import { client } from './openai-connection'\n\nexport async function i18nCompletion({ json }: { json: string }): Promise<string> {\n try {\n const completion = await client.chat.completions.create({\n model: 'gpt-3.5-turbo',\n messages: [\n {\n role: 'system',\n content: `You are an assistant that takes a JSON file of key-value pairs in one language and generates equivalent JSON files in other languages.\n And you provides pure and direct data in response to user requests. The responses should contain no additional explanations or details.`\n },\n {\n role: 'user',\n content: `Here is a JSON file in Korean: [${json}]. Can you help generate equivalent JSON files in these languages: English, Japanese, Chinese and Malaysian?`\n },\n {\n role: 'assistant',\n content: \"Please generate the translations according to these locale codes: 'en', 'ja', 'zh', 'ms'.\"\n }\n ]\n })\n\n return completion.choices[0].message.content\n } catch (error) {\n console.error(error)\n return 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n }\n}\n"]}
1
+ {"version":3,"file":"i18n-completion.js","sourceRoot":"","sources":["../../server/controllers/i18n-completion.ts"],"names":[],"mappings":";;AAkBA,wCAgCC;AAlDD;;;;;;GAMG;AACH,2CAAiD;AAEjD,MAAM,gBAAgB,GAAG,6FAA6F,CAAA;AAEtH,MAAM,qBAAqB,GAAG,IAAI,CAAA;AAClC,MAAM,sBAAsB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAEvD,MAAM,aAAa,GAAG;;6VAEuU,CAAA;AAEtV,KAAK,UAAU,cAAc,CAAC,EACnC,IAAI,EACJ,YAAY,EACZ,aAAa,EAKd;IACC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,qBAAqB,CAAA;QAC1F,MAAM,OAAO,GACX,aAAa,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,sBAAsB,CAAA;QAEpF,MAAM,OAAO,GACX,kBAAkB,GAAG,IAAI;YACzB,mBAAmB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI;YAC9C,iBAAiB,IAAI,EAAE,CAAA;QAEzB,MAAM,MAAM,GAAG,IAAA,+BAAmB,GAAE,CAAA;QACpC,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,IAAI,CAC7B,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EACpC;YACE,YAAY,EAAE,aAAa;YAC3B,WAAW,EAAE,GAAG,CAAC,aAAa;SAC/B,CACF,CAAA;QACD,OAAO,KAAK,IAAI,gBAAgB,CAAA;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAA;QAC3D,OAAO,gBAAgB,CAAA;IACzB,CAAC;AACH,CAAC","sourcesContent":["/**\n * i18n JSON 자동 번역 — 원본 JSON + 원본 locale + 대상 locale 배열을 받아서 같은 키\n * 구조로 다국어 JSON 묶음을 생성.\n *\n * 이전 hardcoded \"ko → en/ja/zh/ms\" 에서 source/target 동적 파라미터로 일반화.\n * provider-agnostic (ai-client-base).\n */\nimport { getCodelinguaClient } from './ai-client'\n\nconst FALLBACK_MESSAGE = 'The Code Lingua service is currently unavailable. Please contact your system administrator.'\n\nconst DEFAULT_SOURCE_LOCALE = 'ko'\nconst DEFAULT_TARGET_LOCALES = ['en', 'ja', 'zh', 'ms']\n\nconst SYSTEM_PROMPT = `You are a translation assistant. You receive a JSON object of i18n key-value pairs in a single source locale, and produce equivalent JSON objects for the requested target locales.\n\nOutput strictly as a single JSON object whose top-level keys are the target locale codes, and each value is a translated JSON object preserving the EXACT same key structure as the source. Translate values only never translate keys. Preserve placeholders like {{name}}, %{var}, {0} verbatim. No commentary, no explanation, no markdown — JSON only.`\n\nexport async function i18nCompletion({\n json,\n sourceLocale,\n targetLocales\n}: {\n json: string\n sourceLocale?: string\n targetLocales?: string[]\n}): Promise<string> {\n try {\n const src = sourceLocale && sourceLocale.length > 0 ? sourceLocale : DEFAULT_SOURCE_LOCALE\n const targets =\n targetLocales && targetLocales.length > 0 ? targetLocales : DEFAULT_TARGET_LOCALES\n\n const userMsg =\n `Source locale: ${src}\\n` +\n `Target locales: ${JSON.stringify(targets)}\\n` +\n `Source JSON:\\n${json}`\n\n const client = getCodelinguaClient()\n const reply = await client.chat(\n [{ role: 'user', content: userMsg }],\n {\n systemPrompt: SYSTEM_PROMPT,\n temperature: 0.2 // 번역은 일관성 우선\n }\n )\n return reply || FALLBACK_MESSAGE\n } catch (error) {\n console.error('[codelingua] i18nCompletion failed:', error)\n return FALLBACK_MESSAGE\n }\n}\n"]}
@@ -1,8 +1,3 @@
1
- export * from './openai-connection';
2
- export * from './chat-completion';
3
- export * from './image-completion';
4
- export * from './i18n-completion';
5
- export * from './api-doc-completion';
6
- export * from './codereview-completion';
7
- export * from './decipher-code';
1
+ export * from './ai-client';
8
2
  export * from './decipher-error-code';
3
+ export * from './i18n-completion';
@@ -1,12 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./openai-connection"), exports);
5
- tslib_1.__exportStar(require("./chat-completion"), exports);
6
- tslib_1.__exportStar(require("./image-completion"), exports);
7
- tslib_1.__exportStar(require("./i18n-completion"), exports);
8
- tslib_1.__exportStar(require("./api-doc-completion"), exports);
9
- tslib_1.__exportStar(require("./codereview-completion"), exports);
10
- tslib_1.__exportStar(require("./decipher-code"), exports);
4
+ tslib_1.__exportStar(require("./ai-client"), exports);
11
5
  tslib_1.__exportStar(require("./decipher-error-code"), exports);
6
+ tslib_1.__exportStar(require("./i18n-completion"), exports);
12
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;AAAA,8DAAmC;AAEnC,4DAAiC;AACjC,6DAAkC;AAClC,4DAAiC;AACjC,+DAAoC;AACpC,kEAAuC;AACvC,0DAA+B;AAC/B,gEAAqC","sourcesContent":["export * from './openai-connection'\n\nexport * from './chat-completion'\nexport * from './image-completion'\nexport * from './i18n-completion'\nexport * from './api-doc-completion'\nexport * from './codereview-completion'\nexport * from './decipher-code'\nexport * from './decipher-error-code'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/controllers/index.ts"],"names":[],"mappings":";;;AAAA,sDAA2B;AAE3B,gEAAqC;AACrC,4DAAiC","sourcesContent":["export * from './ai-client'\n\nexport * from './decipher-error-code'\nexport * from './i18n-completion'\n"]}
@@ -2,38 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const controllers_1 = require("./controllers");
4
4
  process.on('bootstrap-module-global-public-route', (app, globalPublicRouter) => {
5
- /*
6
- * can add global public routes to application (auth not required, tenancy not required)
7
- *
8
- * ex) routes.get('/path', async(context, next) => {})
9
- * ex) routes.post('/path', async(context, next) => {})
10
- */
11
- globalPublicRouter.post('/chat-completion', async (context, next) => {
12
- const { content } = context.request.body;
13
- const message = await (0, controllers_1.chatCompletion)({ content });
14
- context.body = {
15
- message
16
- };
17
- });
18
- globalPublicRouter.post('/api-doc-completion', async (context, next) => {
19
- const { code, language: requestedLanguage } = context.request.body;
20
- const language = requestedLanguage || context.language;
21
- const message = await (0, controllers_1.apiDocCompletion)({ code, language });
22
- context.body = {
23
- message
24
- };
25
- });
26
5
  globalPublicRouter.post('/i18n-completion', async (context, next) => {
27
- const { json } = context.request.body;
28
- const message = await (0, controllers_1.i18nCompletion)({ json });
29
- context.body = {
30
- message
31
- };
32
- });
33
- globalPublicRouter.post('/code-decipher', async (context, next) => {
34
- const { code, system, language: requestedLanguage } = context.request.body;
35
- const language = requestedLanguage || context.language;
36
- const message = await (0, controllers_1.decipherCode)({ code, system, language });
6
+ const { json, sourceLocale, targetLocales } = context.request.body;
7
+ const message = await (0, controllers_1.i18nCompletion)({ json, sourceLocale, targetLocales });
37
8
  context.body = {
38
9
  message
39
10
  };
@@ -47,19 +18,7 @@ process.on('bootstrap-module-global-public-route', (app, globalPublicRouter) =>
47
18
  };
48
19
  });
49
20
  });
50
- process.on('bootstrap-module-global-private-route', (app, globalPrivateRouter) => {
51
- /*
52
- * can add global private routes to application (auth required, tenancy not required)
53
- */
54
- });
55
- process.on('bootstrap-module-domain-public-route', (app, domainPublicRouter) => {
56
- /*
57
- * can add domain public routes to application (auth not required, tenancy required)
58
- */
59
- });
60
- process.on('bootstrap-module-domain-private-route', (app, domainPrivateRouter) => {
61
- /*
62
- * can add domain private routes to application (auth required, tenancy required)
63
- */
64
- });
21
+ process.on('bootstrap-module-global-private-route', (app, globalPrivateRouter) => { });
22
+ process.on('bootstrap-module-domain-public-route', (app, domainPublicRouter) => { });
23
+ process.on('bootstrap-module-domain-private-route', (app, domainPrivateRouter) => { });
65
24
  //# sourceMappingURL=routes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;AAEA,+CAAiH;AAIjH,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;;;;OAKG;IACH,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAClE,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAA2B,CAAA;QAE/D,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAc,EAAC,EAAE,OAAO,EAAE,CAAC,CAAA;QAEjD,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,qBAAqB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACrE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAA6B,CAAA;QAC3F,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,8BAAgB,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAA;QAE1D,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAClE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAA2B,CAAA;QAE5D,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAc,EAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QAE9C,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAChE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAAyB,CAAA;QAC/F,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,0BAAY,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAE9D,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACtE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAAyB,CAAA;QAC/F,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,+BAAiB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAEnE,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA","sourcesContent":["import { ChatCompletionInput } from './service/chat-completion/chat-completion-type'\nimport { CodeDecipherInput } from './service/code-decipher/code-decipher-type'\nimport { chatCompletion, apiDocCompletion, i18nCompletion, decipherCode, decipherErrorCode } from './controllers'\nimport { APIDocCompletionInput } from './service/api-doc-completion/api-doc-completion-type'\nimport { i18nCompletionInput } from './service/i18n-completion/i18n-completion-type'\n\nprocess.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n /*\n * can add global public routes to application (auth not required, tenancy not required)\n *\n * ex) routes.get('/path', async(context, next) => {})\n * ex) routes.post('/path', async(context, next) => {})\n */\n globalPublicRouter.post('/chat-completion', async (context, next) => {\n const { content } = context.request.body as ChatCompletionInput\n\n const message = await chatCompletion({ content })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/api-doc-completion', async (context, next) => {\n const { code, language: requestedLanguage } = context.request.body as APIDocCompletionInput\n const language = requestedLanguage || context.language\n\n const message = await apiDocCompletion({ code, language })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/i18n-completion', async (context, next) => {\n const { json } = context.request.body as i18nCompletionInput\n\n const message = await i18nCompletion({ json })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/code-decipher', async (context, next) => {\n const { code, system, language: requestedLanguage } = context.request.body as CodeDecipherInput\n const language = requestedLanguage || context.language\n\n const message = await decipherCode({ code, system, language })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/error-code-decipher', async (context, next) => {\n const { code, system, language: requestedLanguage } = context.request.body as CodeDecipherInput\n const language = requestedLanguage || context.language\n\n const message = await decipherErrorCode({ code, system, language })\n\n context.body = {\n message\n }\n })\n})\n\nprocess.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {\n /*\n * can add global private routes to application (auth required, tenancy not required)\n */\n})\n\nprocess.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {\n /*\n * can add domain public routes to application (auth not required, tenancy required)\n */\n})\n\nprocess.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {\n /*\n * can add domain private routes to application (auth required, tenancy required)\n */\n})\n"]}
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":";;AAYA,+CAAiE;AAGjE,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF,kBAAkB,CAAC,IAAI,CAAC,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QAClE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAA2B,CAAA;QAEzF,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAc,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,CAAA;QAE3E,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,kBAAkB,CAAC,IAAI,CAAC,sBAAsB,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;QACtE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,IAAyB,CAAA;QAC/F,MAAM,QAAQ,GAAG,iBAAiB,IAAK,OAAe,CAAC,QAAQ,CAAA;QAE/D,MAAM,OAAO,GAAG,MAAM,IAAA,+BAAiB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAEnE,OAAO,CAAC,IAAI,GAAG;YACb,OAAO;SACR,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,GAAE,CAAC,CAAC,CAAA;AAC5F,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE,GAAE,CAAC,CAAC,CAAA;AAC1F,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE,GAAE,CAAC,CAAC,CAAA","sourcesContent":["/**\n * codelingua HTTP routes global public.\n *\n * 노출되는 endpoint 패키지의 정체성:\n * - POST /error-code-decipher : 에러 메시지 사용자 친화 설명 (decipherErrorCode)\n * - POST /i18n-completion : i18n JSON 다국어 자동 번역\n *\n * 5개 legacy endpoint (chat-completion / api-doc-completion / code-decipher /\n * codereview-completion / image-completion) v10 에서 제거됨. board-ai 자연어\n * 인터페이스가 풍부한 대안.\n */\nimport { CodeDecipherInput } from './service/code-decipher/code-decipher-type'\nimport { decipherErrorCode, i18nCompletion } from './controllers'\nimport { i18nCompletionInput } from './service/i18n-completion/i18n-completion-type'\n\nprocess.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n globalPublicRouter.post('/i18n-completion', async (context, next) => {\n const { json, sourceLocale, targetLocales } = context.request.body as i18nCompletionInput\n\n const message = await i18nCompletion({ json, sourceLocale, targetLocales })\n\n context.body = {\n message\n }\n })\n\n globalPublicRouter.post('/error-code-decipher', async (context, next) => {\n const { code, system, language: requestedLanguage } = context.request.body as CodeDecipherInput\n const language = requestedLanguage || (context as any).language\n\n const message = await decipherErrorCode({ code, system, language })\n\n context.body = {\n message\n }\n })\n})\n\nprocess.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {})\nprocess.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {})\nprocess.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {})\n"]}
@@ -1,6 +1,5 @@
1
1
  import '@things-factory/auth-base';
2
2
  import { CodeDecipherInput, CodeDecipherOutput } from './code-decipher-type';
3
3
  export declare class CodeDecipherResolver {
4
- decipherCode(input: CodeDecipherInput, context: ResolverContext): Promise<CodeDecipherOutput>;
5
4
  decipherErrorCode(input: CodeDecipherInput, context: ResolverContext): Promise<CodeDecipherOutput>;
6
5
  }
@@ -7,34 +7,18 @@ require("@things-factory/auth-base"); // for ResolverContext
7
7
  const code_decipher_type_1 = require("./code-decipher-type");
8
8
  const controllers_1 = require("../../controllers");
9
9
  let CodeDecipherResolver = class CodeDecipherResolver {
10
- async decipherCode(input, context) {
11
- const { code, system, language: requestedLanguage } = input;
12
- const language = requestedLanguage || context.language;
13
- const message = await (0, controllers_1.decipherCode)({ code, system, language });
14
- return {
15
- message
16
- };
17
- }
18
10
  async decipherErrorCode(input, context) {
19
11
  const { code, system, language: requestedLanguage } = input;
20
12
  const language = requestedLanguage || context.language;
21
13
  const message = await (0, controllers_1.decipherErrorCode)({ code, system, language });
22
- return {
23
- message
24
- };
14
+ return { message };
25
15
  }
26
16
  };
27
17
  exports.CodeDecipherResolver = CodeDecipherResolver;
28
18
  tslib_1.__decorate([
29
- (0, type_graphql_1.Query)(() => code_decipher_type_1.CodeDecipherOutput),
30
- tslib_1.__param(0, (0, type_graphql_1.Arg)('input')),
31
- tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
32
- tslib_1.__metadata("design:type", Function),
33
- tslib_1.__metadata("design:paramtypes", [code_decipher_type_1.CodeDecipherInput, Object]),
34
- tslib_1.__metadata("design:returntype", Promise)
35
- ], CodeDecipherResolver.prototype, "decipherCode", null);
36
- tslib_1.__decorate([
37
- (0, type_graphql_1.Query)(() => code_decipher_type_1.CodeDecipherOutput),
19
+ (0, type_graphql_1.Query)(() => code_decipher_type_1.CodeDecipherOutput, {
20
+ description: 'Translate a cryptic system / framework / database error message into a concise, localized, actionable explanation for end users.'
21
+ }),
38
22
  tslib_1.__param(0, (0, type_graphql_1.Arg)('input')),
39
23
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
40
24
  tslib_1.__metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"code-decipher-resolver.js","sourceRoot":"","sources":["../../../server/service/code-decipher/code-decipher-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AACxD,qCAAkC,CAAC,sBAAsB;AACzD,6DAA4E;AAC5E,mDAAmE;AAG5D,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAEzB,AAAN,KAAK,CAAC,YAAY,CACF,KAAwB,EAC/B,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAA;QAC3D,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,0BAAY,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAE9D,OAAO;YACL,OAAO;SACR,CAAA;IACH,CAAC;IAGK,AAAN,KAAK,CAAC,iBAAiB,CACP,KAAwB,EAC/B,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAA;QAC3D,MAAM,QAAQ,GAAG,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;QAEtD,MAAM,OAAO,GAAG,MAAM,IAAA,+BAAiB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAEnE,OAAO;YACL,OAAO;SACR,CAAA;IACH,CAAC;CACF,CAAA;AA9BY,oDAAoB;AAEzB;IADL,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,uCAAkB,CAAC;IAE7B,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADe,sCAAiB;;wDAWvC;AAGK;IADL,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,uCAAkB,CAAC;IAE7B,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADe,sCAAiB;;6DAWvC;+BA7BU,oBAAoB;IADhC,IAAA,uBAAQ,GAAE;GACE,oBAAoB,CA8BhC","sourcesContent":["import { Resolver, Query, Arg, Ctx } from 'type-graphql'\nimport '@things-factory/auth-base' // for ResolverContext\nimport { CodeDecipherInput, CodeDecipherOutput } from './code-decipher-type'\nimport { decipherCode, decipherErrorCode } from '../../controllers'\n\n@Resolver()\nexport class CodeDecipherResolver {\n @Query(() => CodeDecipherOutput)\n async decipherCode(\n @Arg('input') input: CodeDecipherInput,\n @Ctx() context: ResolverContext\n ): Promise<CodeDecipherOutput> {\n const { code, system, language: requestedLanguage } = input\n const language = requestedLanguage || context.language\n\n const message = await decipherCode({ code, system, language })\n\n return {\n message\n }\n }\n\n @Query(() => CodeDecipherOutput)\n async decipherErrorCode(\n @Arg('input') input: CodeDecipherInput,\n @Ctx() context: ResolverContext\n ): Promise<CodeDecipherOutput> {\n const { code, system, language: requestedLanguage } = input\n const language = requestedLanguage || context.language\n\n const message = await decipherErrorCode({ code, system, language })\n\n return {\n message\n }\n }\n}\n"]}
1
+ {"version":3,"file":"code-decipher-resolver.js","sourceRoot":"","sources":["../../../server/service/code-decipher/code-decipher-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AACxD,qCAAkC,CAAC,sBAAsB;AACzD,6DAA4E;AAC5E,mDAAqD;AAG9C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAKzB,AAAN,KAAK,CAAC,iBAAiB,CACP,KAAwB,EAC/B,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,GAAG,KAAK,CAAA;QAC3D,MAAM,QAAQ,GAAG,iBAAiB,IAAK,OAAe,CAAC,QAAQ,CAAA;QAE/D,MAAM,OAAO,GAAG,MAAM,IAAA,+BAAiB,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAA;QAEnE,OAAO,EAAE,OAAO,EAAE,CAAA;IACpB,CAAC;CACF,CAAA;AAhBY,oDAAoB;AAKzB;IAJL,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,uCAAkB,EAAE;QAC/B,WAAW,EACT,kIAAkI;KACrI,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADe,sCAAiB;;6DASvC;+BAfU,oBAAoB;IADhC,IAAA,uBAAQ,GAAE;GACE,oBAAoB,CAgBhC","sourcesContent":["import { Resolver, Query, Arg, Ctx } from 'type-graphql'\nimport '@things-factory/auth-base' // for ResolverContext\nimport { CodeDecipherInput, CodeDecipherOutput } from './code-decipher-type'\nimport { decipherErrorCode } from '../../controllers'\n\n@Resolver()\nexport class CodeDecipherResolver {\n @Query(() => CodeDecipherOutput, {\n description:\n 'Translate a cryptic system / framework / database error message into a concise, localized, actionable explanation for end users.'\n })\n async decipherErrorCode(\n @Arg('input') input: CodeDecipherInput,\n @Ctx() context: ResolverContext\n ): Promise<CodeDecipherOutput> {\n const { code, system, language: requestedLanguage } = input\n const language = requestedLanguage || (context as any).language\n\n const message = await decipherErrorCode({ code, system, language })\n\n return { message }\n }\n}\n"]}
@@ -1,6 +1,9 @@
1
1
  export declare class CodeDecipherInput {
2
+ /** 풀어쓸 에러 메시지 / 코드 / 시스템 출력 텍스트. */
2
3
  code: string;
4
+ /** 에러가 발생한 시스템 이름 (선택). 예: 'TypeORM', 'Koa', 'PostgreSQL'. */
3
5
  system?: string;
6
+ /** 응답 locale BCP-47. 예: 'ko-KR', 'en-US'. 미지정 시 'en-US'. */
4
7
  language?: string;
5
8
  }
6
9
  export declare class CodeDecipherOutput {
@@ -1 +1 @@
1
- {"version":3,"file":"code-decipher-type.js","sourceRoot":"","sources":["../../../server/service/code-decipher/code-decipher-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAGpD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAS7B,CAAA;AATY,8CAAiB;AAE5B;IADC,IAAA,oBAAK,GAAE;;+CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACT;4BARN,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAS7B;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAG9B,CAAA;AAHY,gDAAkB;AAE7B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACV;6BAFL,kBAAkB;IAD9B,IAAA,yBAAU,GAAE;GACA,kBAAkB,CAG9B","sourcesContent":["import { ObjectType, Field, InputType } from 'type-graphql'\n\n@InputType()\nexport class CodeDecipherInput {\n @Field()\n code: string\n\n @Field({ nullable: true })\n system?: string\n\n @Field({ nullable: true })\n language?: string\n}\n\n@ObjectType()\nexport class CodeDecipherOutput {\n @Field({ nullable: true })\n message?: string\n}\n"]}
1
+ {"version":3,"file":"code-decipher-type.js","sourceRoot":"","sources":["../../../server/service/code-decipher/code-decipher-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAGpD,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAY7B,CAAA;AAZY,8CAAiB;AAG5B;IADC,IAAA,oBAAK,GAAE;;+CACK;AAIb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACX;AAIf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACT;4BAXN,iBAAiB;IAD7B,IAAA,wBAAS,GAAE;GACC,iBAAiB,CAY7B;AAGM,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAG9B,CAAA;AAHY,gDAAkB;AAE7B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACV;6BAFL,kBAAkB;IAD9B,IAAA,yBAAU,GAAE;GACA,kBAAkB,CAG9B","sourcesContent":["import { ObjectType, Field, InputType } from 'type-graphql'\n\n@InputType()\nexport class CodeDecipherInput {\n /** 풀어쓸 에러 메시지 / 코드 / 시스템 출력 텍스트. */\n @Field()\n code!: string\n\n /** 에러가 발생한 시스템 이름 (선택). 예: 'TypeORM', 'Koa', 'PostgreSQL'. */\n @Field({ nullable: true })\n system?: string\n\n /** 응답 locale BCP-47. 예: 'ko-KR', 'en-US'. 미지정 시 'en-US'. */\n @Field({ nullable: true })\n language?: string\n}\n\n@ObjectType()\nexport class CodeDecipherOutput {\n @Field({ nullable: true })\n message?: string\n}\n"]}
@@ -1,4 +1,2 @@
1
1
  import { CodeDecipherResolver } from './code-decipher-resolver';
2
- export declare const entities: any[];
3
2
  export declare const resolvers: (typeof CodeDecipherResolver)[];
4
- export declare const subscribers: any[];
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.subscribers = exports.resolvers = exports.entities = void 0;
3
+ exports.resolvers = void 0;
4
4
  const code_decipher_resolver_1 = require("./code-decipher-resolver");
5
- exports.entities = [];
6
5
  exports.resolvers = [code_decipher_resolver_1.CodeDecipherResolver];
7
- exports.subscribers = [];
8
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/code-decipher/index.ts"],"names":[],"mappings":";;;AAAA,qEAA+D;AAElD,QAAA,QAAQ,GAAG,EAAE,CAAA;AACb,QAAA,SAAS,GAAG,CAAC,6CAAoB,CAAC,CAAA;AAClC,QAAA,WAAW,GAAG,EAAE,CAAA","sourcesContent":["import { CodeDecipherResolver } from './code-decipher-resolver'\n\nexport const entities = []\nexport const resolvers = [CodeDecipherResolver]\nexport const subscribers = []\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/code-decipher/index.ts"],"names":[],"mappings":";;;AAAA,qEAA+D;AAElD,QAAA,SAAS,GAAG,CAAC,6CAAoB,CAAC,CAAA","sourcesContent":["import { CodeDecipherResolver } from './code-decipher-resolver'\n\nexport const resolvers = [CodeDecipherResolver]\n"]}
@@ -8,8 +8,8 @@ const i18n_completion_type_1 = require("./i18n-completion-type");
8
8
  const controllers_1 = require("../../controllers");
9
9
  let i18nCompletionResolver = class i18nCompletionResolver {
10
10
  async i18nCompletion(input, context) {
11
- const { json } = input;
12
- const message = await (0, controllers_1.i18nCompletion)({ json });
11
+ const { json, sourceLocale, targetLocales } = input;
12
+ const message = await (0, controllers_1.i18nCompletion)({ json, sourceLocale, targetLocales });
13
13
  return {
14
14
  message
15
15
  };
@@ -17,7 +17,9 @@ let i18nCompletionResolver = class i18nCompletionResolver {
17
17
  };
18
18
  exports.i18nCompletionResolver = i18nCompletionResolver;
19
19
  tslib_1.__decorate([
20
- (0, type_graphql_1.Query)(() => i18n_completion_type_1.i18nCompletionOutput),
20
+ (0, type_graphql_1.Query)(() => i18n_completion_type_1.i18nCompletionOutput, {
21
+ description: 'Translate an i18n JSON (key-value) from a source locale into multiple target locales. Source/target locales are configurable; defaults preserve historical "ko → en/ja/zh/ms" behavior.'
22
+ }),
21
23
  tslib_1.__param(0, (0, type_graphql_1.Arg)('input')),
22
24
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
23
25
  tslib_1.__metadata("design:type", Function),
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-completion-resolver.js","sourceRoot":"","sources":["../../../server/service/i18n-completion/i18n-completion-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AACxD,qCAAkC,CAAC,sBAAsB;AACzD,iEAAkF;AAClF,mDAAkD;AAG3C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAE3B,AAAN,KAAK,CAAC,cAAc,CACJ,KAA0B,EACjC,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAA;QAEtB,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAc,EAAC,EAAE,IAAI,EAAE,CAAC,CAAA;QAE9C,OAAO;YACL,OAAO;SACR,CAAA;IACH,CAAC;CACF,CAAA;AAdY,wDAAsB;AAE3B;IADL,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,2CAAoB,CAAC;IAE/B,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADe,0CAAmB;;4DAUzC;iCAbU,sBAAsB;IADlC,IAAA,uBAAQ,GAAE;GACE,sBAAsB,CAclC","sourcesContent":["import { Resolver, Query, Arg, Ctx } from 'type-graphql'\nimport '@things-factory/auth-base' // for ResolverContext\nimport { i18nCompletionInput, i18nCompletionOutput } from './i18n-completion-type'\nimport { i18nCompletion } from '../../controllers'\n\n@Resolver()\nexport class i18nCompletionResolver {\n @Query(() => i18nCompletionOutput)\n async i18nCompletion(\n @Arg('input') input: i18nCompletionInput,\n @Ctx() context: ResolverContext\n ): Promise<i18nCompletionOutput> {\n const { json } = input\n\n const message = await i18nCompletion({ json })\n\n return {\n message\n }\n }\n}\n"]}
1
+ {"version":3,"file":"i18n-completion-resolver.js","sourceRoot":"","sources":["../../../server/service/i18n-completion/i18n-completion-resolver.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AACxD,qCAAkC,CAAC,sBAAsB;AACzD,iEAAkF;AAClF,mDAAkD;AAG3C,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAK3B,AAAN,KAAK,CAAC,cAAc,CACJ,KAA0B,EACjC,OAAwB;QAE/B,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,GAAG,KAAK,CAAA;QAEnD,MAAM,OAAO,GAAG,MAAM,IAAA,4BAAc,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,CAAC,CAAA;QAE3E,OAAO;YACL,OAAO;SACR,CAAA;IACH,CAAC;CACF,CAAA;AAjBY,wDAAsB;AAK3B;IAJL,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,2CAAoB,EAAE;QACjC,WAAW,EACT,yLAAyL;KAC5L,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CADe,0CAAmB;;4DAUzC;iCAhBU,sBAAsB;IADlC,IAAA,uBAAQ,GAAE;GACE,sBAAsB,CAiBlC","sourcesContent":["import { Resolver, Query, Arg, Ctx } from 'type-graphql'\nimport '@things-factory/auth-base' // for ResolverContext\nimport { i18nCompletionInput, i18nCompletionOutput } from './i18n-completion-type'\nimport { i18nCompletion } from '../../controllers'\n\n@Resolver()\nexport class i18nCompletionResolver {\n @Query(() => i18nCompletionOutput, {\n description:\n 'Translate an i18n JSON (key-value) from a source locale into multiple target locales. Source/target locales are configurable; defaults preserve historical \"ko → en/ja/zh/ms\" behavior.'\n })\n async i18nCompletion(\n @Arg('input') input: i18nCompletionInput,\n @Ctx() context: ResolverContext\n ): Promise<i18nCompletionOutput> {\n const { json, sourceLocale, targetLocales } = input\n\n const message = await i18nCompletion({ json, sourceLocale, targetLocales })\n\n return {\n message\n }\n }\n}\n"]}
@@ -1,5 +1,16 @@
1
1
  export declare class i18nCompletionInput {
2
+ /** Source JSON (key-value pairs). 보통 한 언어로 작성된 i18n 파일 내용. */
2
3
  json: string;
4
+ /**
5
+ * 원본 언어 BCP-47 코드. 예: 'ko', 'en', 'ja'.
6
+ * 미지정 시 'ko' (codelingua 의 historical default).
7
+ */
8
+ sourceLocale?: string;
9
+ /**
10
+ * 번역할 대상 언어 코드 배열. 예: ['en', 'ja', 'zh', 'ms'].
11
+ * 미지정 시 ['en', 'ja', 'zh', 'ms'] (codelingua 의 historical default).
12
+ */
13
+ targetLocales?: string[];
3
14
  }
4
15
  export declare class i18nCompletionOutput {
5
16
  message?: string;
@@ -10,6 +10,14 @@ tslib_1.__decorate([
10
10
  (0, type_graphql_1.Field)(),
11
11
  tslib_1.__metadata("design:type", String)
12
12
  ], i18nCompletionInput.prototype, "json", void 0);
13
+ tslib_1.__decorate([
14
+ (0, type_graphql_1.Field)({ nullable: true }),
15
+ tslib_1.__metadata("design:type", String)
16
+ ], i18nCompletionInput.prototype, "sourceLocale", void 0);
17
+ tslib_1.__decorate([
18
+ (0, type_graphql_1.Field)(() => [String], { nullable: true }),
19
+ tslib_1.__metadata("design:type", Array)
20
+ ], i18nCompletionInput.prototype, "targetLocales", void 0);
13
21
  exports.i18nCompletionInput = i18nCompletionInput = tslib_1.__decorate([
14
22
  (0, type_graphql_1.InputType)()
15
23
  ], i18nCompletionInput);
@@ -1 +1 @@
1
- {"version":3,"file":"i18n-completion-type.js","sourceRoot":"","sources":["../../../server/service/i18n-completion/i18n-completion-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAGpD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAG/B,CAAA;AAHY,kDAAmB;AAE9B;IADC,IAAA,oBAAK,GAAE;;iDACI;8BAFD,mBAAmB;IAD/B,IAAA,wBAAS,GAAE;GACC,mBAAmB,CAG/B;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAGhC,CAAA;AAHY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;+BAFL,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAGhC","sourcesContent":["import { ObjectType, Field, InputType } from 'type-graphql'\n\n@InputType()\nexport class i18nCompletionInput {\n @Field()\n json: string\n}\n\n@ObjectType()\nexport class i18nCompletionOutput {\n @Field({ nullable: true })\n message?: string\n}\n"]}
1
+ {"version":3,"file":"i18n-completion-type.js","sourceRoot":"","sources":["../../../server/service/i18n-completion/i18n-completion-type.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAGpD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;CAkB/B,CAAA;AAlBY,kDAAmB;AAG9B;IADC,IAAA,oBAAK,GAAE;;iDACK;AAOb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACL;AAOrB;IADC,IAAA,oBAAK,EAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0DAClB;8BAjBb,mBAAmB;IAD/B,IAAA,wBAAS,GAAE;GACC,mBAAmB,CAkB/B;AAGM,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAGhC,CAAA;AAHY,oDAAoB;AAE/B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;qDACV;+BAFL,oBAAoB;IADhC,IAAA,yBAAU,GAAE;GACA,oBAAoB,CAGhC","sourcesContent":["import { ObjectType, Field, InputType } from 'type-graphql'\n\n@InputType()\nexport class i18nCompletionInput {\n /** Source JSON (key-value pairs). 보통 한 언어로 작성된 i18n 파일 내용. */\n @Field()\n json!: string\n\n /**\n * 원본 언어 BCP-47 코드. 예: 'ko', 'en', 'ja'.\n * 미지정 시 'ko' (codelingua 의 historical default).\n */\n @Field({ nullable: true })\n sourceLocale?: string\n\n /**\n * 번역할 대상 언어 코드 배열. 예: ['en', 'ja', 'zh', 'ms'].\n * 미지정 시 ['en', 'ja', 'zh', 'ms'] (codelingua 의 historical default).\n */\n @Field(() => [String], { nullable: true })\n targetLocales?: string[]\n}\n\n@ObjectType()\nexport class i18nCompletionOutput {\n @Field({ nullable: true })\n message?: string\n}\n"]}
@@ -1,4 +1,4 @@
1
1
  export declare const entities: any[];
2
2
  export declare const schema: {
3
- resolverClasses: (typeof import("./chat-completion/chat-completion-resolver").ChatCompletionResolver | typeof import("./image-completion/image-completion-resolver").ImageCompletionResolver | typeof import("./api-doc-completion/api-doc-completion-resolver").APIDocCompletionResolver | typeof import("./i18n-completion/i18n-completion-resolver").i18nCompletionResolver | typeof import("./code-decipher/code-decipher-resolver").CodeDecipherResolver)[];
3
+ resolverClasses: (typeof import("./i18n-completion/i18n-completion-resolver").i18nCompletionResolver | typeof import("./code-decipher/code-decipher-resolver").CodeDecipherResolver)[];
4
4
  };