@adminide-stack/yantra-mobile 12.0.31-alpha.17 → 12.0.31-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,71 @@
1
- The MIT License
2
-
3
- Copyright (c) 2017 CDMBase LLC.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
1
+ PROPRIETARY SOFTWARE LICENSE AGREEMENT
2
+
3
+ Copyright (c) 2026 CDEBase Inc. All Rights Reserved.
4
+
5
+ NOTICE TO USER: THIS IS A CONTRACT. BY INSTALLING, COPYING, OR OTHERWISE
6
+ USING THE SOFTWARE, YOU AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE.
7
+ IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENSE, DO NOT INSTALL, COPY,
8
+ OR USE THE SOFTWARE.
9
+
10
+ NO LICENSE GRANTED
11
+ No license, express or implied, is granted to any person or entity.
12
+ All rights are reserved by CDEBase Inc. Any use of this software
13
+ without prior written authorization from CDEBase Inc. is strictly
14
+ prohibited.
15
+
16
+ RESTRICTIONS
17
+ You may NOT:
18
+ a) Copy, modify, adapt, translate, reverse engineer, decompile, or
19
+ disassemble the software or create derivative works based on it
20
+ b) Distribute, sublicense, lease, rent, loan, or otherwise transfer
21
+ the software to any third party
22
+ c) Remove or alter any proprietary notices, labels, or marks on the
23
+ software
24
+ d) Use the software to develop competing products or services
25
+ e) Publicly disclose any benchmarking or performance results
26
+ f) Use the software in any manner that violates applicable laws or
27
+ regulations
28
+ g) Access, view, or use any portion of the source code without
29
+ explicit prior written consent from CDEBase Inc.
30
+
31
+ OWNERSHIP
32
+ This software is the exclusive proprietary property of CDEBase Inc.
33
+ and is protected by copyright laws and international treaty provisions.
34
+ CDEBase Inc. retains all rights, title, and interest in and to the
35
+ software, including all copyrights, patents, trade secrets, trademarks,
36
+ and other intellectual property rights. No rights are transferred or
37
+ conveyed by possession or access to this software.
38
+
39
+ CONFIDENTIALITY
40
+ The software contains trade secrets and proprietary information of
41
+ CDEBase Inc. You agree to maintain strict confidentiality of the
42
+ software and not disclose it, in whole or in part, to any third party
43
+ without prior written consent of CDEBase Inc. This obligation survives
44
+ termination of any agreement with CDEBase Inc.
45
+
46
+ TERMINATION
47
+ Any unauthorized use automatically and immediately terminates all
48
+ permissions. CDEBase Inc. may seek all available legal and equitable
49
+ remedies, including injunctive relief, for any unauthorized use or
50
+ disclosure.
51
+
52
+ WARRANTY DISCLAIMER
53
+ THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS
54
+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
55
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
56
+ NONINFRINGEMENT.
57
+
58
+ LIMITATION OF LIABILITY
59
+ IN NO EVENT SHALL CDEBASE INC. BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
60
+ INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER ARISING OUT OF THE USE
61
+ OF OR INABILITY TO USE THE SOFTWARE.
62
+
63
+ GOVERNING LAW
64
+ This agreement shall be governed by and construed in accordance with
65
+ the laws of the jurisdiction in which CDEBase Inc. is registered,
66
+ without regard to its conflict of law provisions.
67
+
68
+ For licensing inquiries, contact: legal@cdebase.com
69
+
70
+ CDEBase Inc.
71
+ All Rights Reserved.
package/lib/api/stt.js CHANGED
@@ -1,17 +1,12 @@
1
- import {config}from'../config/env-config.js';const GROQ_STT_URL = "https://api.groq.com/openai/v1/audio/transcriptions";
1
+ const BRAIN_STT_URL = "https://cdecli-agent.cdebase.dev/v1/yantra-brain/audio/transcriptions";
2
2
  const WHISPER_MODEL = "whisper-large-v3-turbo";
3
3
  async function transcribeAudio(params) {
4
- var _a, _b, _c;
5
4
  const {
6
5
  uri,
7
6
  mimeType = "audio/m4a",
8
7
  filename = "audio.m4a",
9
8
  prompt
10
9
  } = params;
11
- const apiKey = config.GROQ_API_KEY;
12
- if (!apiKey) {
13
- throw new Error("GROQ_API_KEY is not configured. Add it to your .env (e.g. config/development/dev.env).");
14
- }
15
10
  if (!uri) {
16
11
  throw new Error("Audio file uri is empty or not provided");
17
12
  }
@@ -25,16 +20,17 @@ async function transcribeAudio(params) {
25
20
  if (prompt) {
26
21
  formData.append("prompt", prompt);
27
22
  }
28
- const response = await fetch(GROQ_STT_URL, {
23
+ return requestTranscription(BRAIN_STT_URL, formData);
24
+ }
25
+ async function requestTranscription(url, formData) {
26
+ var _a, _b, _c;
27
+ const response = await fetch(url, {
29
28
  method: "POST",
30
- headers: {
31
- Authorization: `Bearer ${apiKey}`
32
- /*
33
- * Intentionally NOT setting Content-Type. Letting `fetch` derive
34
- * it from FormData ensures the multipart boundary string is set
35
- * correctly. Overriding here would break the upload silently.
36
- */
37
- },
29
+ /*
30
+ * Intentionally NOT setting Content-Type. Letting `fetch` derive
31
+ * it from FormData ensures the multipart boundary string is set
32
+ * correctly. Overriding here would break the upload silently.
33
+ */
38
34
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
35
  body: formData
40
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"stt.js","sources":["../../src/api/stt.ts"],"sourcesContent":["/**\n * Speech-to-Text (STT) API using Groq's Whisper model — mobile port.\n *\n * Mirrors `packages-modules/account/browser/src/api/stt.ts` (which uploads\n * a `Blob` produced by the browser's `MediaRecorder`). On React Native we\n * upload a file by URI instead, because:\n * • `expo-audio` writes the recording to a local `file://` URI on disk,\n * not an in-memory Blob.\n * • RN's `fetch` + `FormData` already supports `{uri, name, type}` parts —\n * it streams the file directly without us reading bytes into JS, which\n * keeps a 3-minute clip from spiking memory.\n *\n * Same Groq endpoint / model / auth as web so a single `GROQ_API_KEY`\n * works for both surfaces.\n */\n\nimport { config } from '../config';\n\nconst GROQ_STT_URL = 'https://api.groq.com/openai/v1/audio/transcriptions';\nconst WHISPER_MODEL = 'whisper-large-v3-turbo';\n\nexport interface STTParams {\n /** Local file URI returned by `expo-audio`'s `recorder.uri` (e.g. `file:///...m4a`). */\n uri: string;\n /** Optional MIME type override. HIGH_QUALITY preset → `audio/m4a` on iOS & Android. */\n mimeType?: string;\n /** Optional filename hint sent with the multipart form. Whisper uses the extension to pick a decoder. */\n filename?: string;\n /** Optional Whisper \"prompt\" — passed through to bias decoding. */\n prompt?: string;\n}\n\nexport async function transcribeAudio(params: STTParams): Promise<string> {\n const { uri, mimeType = 'audio/m4a', filename = 'audio.m4a', prompt } = params;\n\n const apiKey = config.GROQ_API_KEY;\n if (!apiKey) {\n throw new Error('GROQ_API_KEY is not configured. Add it to your .env (e.g. config/development/dev.env).');\n }\n if (!uri) {\n throw new Error('Audio file uri is empty or not provided');\n }\n\n const formData = new FormData();\n /*\n * React Native's FormData accepts file parts in `{uri, name, type}` shape;\n * the runtime streams the file from disk on send. The cast is the usual\n * escape hatch — web FormData's TS lib types only know about\n * `Blob | string`, but the RN polyfill widens it at runtime.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n formData.append('file', { uri, name: filename, type: mimeType } as any);\n formData.append('model', WHISPER_MODEL);\n if (prompt) {\n formData.append('prompt', prompt);\n }\n\n const response = await fetch(GROQ_STT_URL, {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${apiKey}`,\n /*\n * Intentionally NOT setting Content-Type. Letting `fetch` derive\n * it from FormData ensures the multipart boundary string is set\n * correctly. Overriding here would break the upload silently.\n */\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n body: formData as any,\n });\n\n if (!response.ok) {\n const errorText = await response.text();\n let errorMessage: string;\n try {\n const errorJson = JSON.parse(errorText);\n errorMessage = errorJson?.error?.message || errorJson?.message || errorText;\n } catch {\n errorMessage = errorText || response.statusText;\n }\n throw new Error(`STT API error (${response.status}): ${errorMessage}`);\n }\n\n const data = (await response.json()) as { text?: string };\n return data?.text?.trim() ?? '';\n}\n"],"names":[],"mappings":"6CAiBA,MAAM,YAAe,GAAA,qDAAA;AACrB,MAAM,aAAgB,GAAA,wBAAA;AAWtB,eAAsB,gBAAgB,MAAoC,EAAA;AA7B1E,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA;AA8BE,EAAM,MAAA;AAAA,IACJ,GAAA;AAAA,IACA,QAAW,GAAA,WAAA;AAAA,IACX,QAAW,GAAA,WAAA;AAAA,IACX;AAAA,GACE,GAAA,MAAA;AACJ,EAAA,MAAM,SAAS,MAAO,CAAA,YAAA;AACtB,EAAA,IAAI,CAAC,MAAQ,EAAA;AACX,IAAM,MAAA,IAAI,MAAM,wFAAwF,CAAA;AAAA;AAE1G,EAAA,IAAI,CAAC,GAAK,EAAA;AACR,IAAM,MAAA,IAAI,MAAM,yCAAyC,CAAA;AAAA;AAE3D,EAAM,MAAA,QAAA,GAAW,IAAI,QAAS,EAAA;AAQ9B,EAAA,QAAA,CAAS,OAAO,MAAQ,EAAA;AAAA,IACtB,GAAA;AAAA,IACA,IAAM,EAAA,QAAA;AAAA,IACN,IAAM,EAAA;A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A,IAAA,EAAA,KAAZ,IAAsB,GAAA,EAAA,GAAA,EAAA;AAC/B"}
1
+ {"version":3,"file":"stt.js","sources":["../../src/api/stt.ts"],"sourcesContent":["/**\n * Speech-to-Text (STT) API using Groq's Whisper model — mobile port.\n *\n * Mirrors `packages-modules/account/browser/src/api/stt.ts` (which uploads\n * a `Blob` produced by the browser's `MediaRecorder`). On React Native we\n * upload a file by URI instead, because:\n * • `expo-audio` writes the recording to a local `file://` URI on disk,\n * not an in-memory Blob.\n * • RN's `fetch` + `FormData` already supports `{uri, name, type}` parts —\n * it streams the file directly without us reading bytes into JS, which\n * keeps a 3-minute clip from spiking memory.\n *\n * Mobile calls ONLY the yantra-brain resource endpoint: the gateway holds\n * the Groq key server-side. A shipped app bundle must never embed a provider\n * key (it cannot be rotated out of installed apps), so unlike web there is\n * NO direct-Groq BYO-key fallback here.\n */\n\nconst BRAIN_STT_URL = 'https://cdecli-agent.cdebase.dev/v1/yantra-brain/audio/transcriptions';\nconst WHISPER_MODEL = 'whisper-large-v3-turbo';\n\nexport interface STTParams {\n /** Local file URI returned by `expo-audio`'s `recorder.uri` (e.g. `file:///...m4a`). */\n uri: string;\n /** Optional MIME type override. HIGH_QUALITY preset → `audio/m4a` on iOS & Android. */\n mimeType?: string;\n /** Optional filename hint sent with the multipart form. Whisper uses the extension to pick a decoder. */\n filename?: string;\n /** Optional Whisper \"prompt\" — passed through to bias decoding. */\n prompt?: string;\n}\n\nexport async function transcribeAudio(params: STTParams): Promise<string> {\n const { uri, mimeType = 'audio/m4a', filename = 'audio.m4a', prompt } = params;\n\n if (!uri) {\n throw new Error('Audio file uri is empty or not provided');\n }\n\n const formData = new FormData();\n /*\n * React Native's FormData accepts file parts in `{uri, name, type}` shape;\n * the runtime streams the file from disk on send. The cast is the usual\n * escape hatch — web FormData's TS lib types only know about\n * `Blob | string`, but the RN polyfill widens it at runtime.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n formData.append('file', { uri, name: filename, type: mimeType } as any);\n formData.append('model', WHISPER_MODEL);\n if (prompt) {\n formData.append('prompt', prompt);\n }\n\n // yantra-brain resource endpoint — the gateway holds the Groq key, the\n // app sends NO Authorization header and ships NO key.\n return requestTranscription(BRAIN_STT_URL, formData);\n}\n\nasync function requestTranscription(url: string, formData: FormData): Promise<string> {\n const response = await fetch(url, {\n method: 'POST',\n /*\n * Intentionally NOT setting Content-Type. Letting `fetch` derive\n * it from FormData ensures the multipart boundary string is set\n * correctly. Overriding here would break the upload silently.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n body: formData as any,\n });\n\n if (!response.ok) {\n const errorText = await response.text();\n let errorMessage: string;\n try {\n const errorJson = JSON.parse(errorText);\n errorMessage = errorJson?.error?.message || errorJson?.message || errorText;\n } catch {\n errorMessage = errorText || response.statusText;\n }\n throw new Error(`STT API error (${response.status}): ${errorMessage}`);\n }\n\n const data = (await response.json()) as { text?: string };\n return data?.text?.trim() ?? '';\n}\n"],"names":[],"mappings":"AAkBA,MAAM,aAAgB,GAAA,uEAAA;AACtB,MAAM,aAAgB,GAAA,wBAAA;AAWtB,eAAsB,gBAAgB,MAAoC,EAAA;AACxE,EAAM,MAAA;AAAA,IACJ,GAAA;AAAA,IACA,QAAW,GAAA,WAAA;AAAA,IACX,QAAW,GAAA,WAAA;AAAA,IACX;AAAA,GACE,GAAA,MAAA;AACJ,EAAA,IAAI,CAAC,GAAK,EAAA;AACR,IAAM,MAAA,IAAI,MAAM,yCAAyC,CAAA;AAAA;AAE3D,EAAM,MAAA,QAAA,GAAW,IAAI,QAAS,EAAA;AAQ9B,EAAA,QAAA,CAAS,OAAO,MAAQ,EAAA;AAAA,IACtB,GAAA;AAAA,IACA,IAAM,EAAA,QAAA;AAAA,IACN,IAAM,EAAA;AAAA,GACA,CAAA;AACR,EAAS,QAAA,CAAA,MAAA,CAAO,SAAS,aAAa,CAAA;AACtC,EAAA,IAAI,MAAQ,EAAA;AACV,IAAS,QAAA,CAAA,MAAA,CAAO,UAAU,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package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminide-stack/yantra-mobile",
3
- "version": "12.0.31-alpha.17",
3
+ "version": "12.0.31-alpha.19",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -25,7 +25,7 @@
25
25
  "uuid": "^9.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "common": "12.0.31-alpha.16"
28
+ "common": "12.0.31-alpha.19"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@admin-layout/gluestack-ui-mobile": "*",
@@ -40,7 +40,7 @@
40
40
  "@expo/vector-icons": "*",
41
41
  "@messenger-box/platform-mobile": "*",
42
42
  "@react-native-async-storage/async-storage": "*",
43
- "common": "12.0.31-alpha.16",
43
+ "common": "12.0.31-alpha.18",
44
44
  "lodash": "*"
45
45
  },
46
46
  "publishConfig": {
@@ -49,5 +49,5 @@
49
49
  "typescript": {
50
50
  "definition": "lib/index.d.ts"
51
51
  },
52
- "gitHead": "ff54e9c963787750b559aa874ea8ea4f2b2a3813"
52
+ "gitHead": "5aa18c8ec37e351a21fefd3efdc3b5e38524ca0a"
53
53
  }