@mcp-b/embedded-agent 1.2.0 → 1.2.1
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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/web-component-standalone.iife.js +1 -1
- package/dist/web-component.d.ts +2 -0
- package/dist/web-component.d.ts.map +1 -1
- package/dist/web-component.js +6 -7
- package/dist/web-component.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ interface DevModeConfig {
|
|
|
14
14
|
anthropicApiKey: string;
|
|
15
15
|
/** Your OpenAI API key for voice mode (optional) */
|
|
16
16
|
openaiApiKey?: string;
|
|
17
|
+
/** Use window.location.origin instead of production API (for internal development) */
|
|
18
|
+
useLocalApi?: boolean;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* Props for the EmbeddedAgent component
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/web-component.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/web-component.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;UA8DiB,aAAA;;;;;;;;;;;UAYA,kBAAA;;;;;;;YAQN;;;;;;;;;;;;cAaE,eAAe,GAAG;;;;;;;iBAgDf,mBAAA"}
|
package/dist/index.js
CHANGED
|
@@ -8933,13 +8933,12 @@ function injectStyles() {
|
|
|
8933
8933
|
*
|
|
8934
8934
|
*/
|
|
8935
8935
|
/**
|
|
8936
|
-
* Get the default API base URL
|
|
8937
|
-
*
|
|
8938
|
-
* - Development builds: use current origin (for local dev server)
|
|
8936
|
+
* Get the default API base URL.
|
|
8937
|
+
* Always uses production unless explicitly overridden with useLocalApi.
|
|
8939
8938
|
*/
|
|
8940
|
-
const getDefaultApiBase = () => {
|
|
8941
|
-
if (
|
|
8942
|
-
return
|
|
8939
|
+
const getDefaultApiBase = (useLocalApi) => {
|
|
8940
|
+
if (useLocalApi && typeof window !== "undefined") return window.location.origin;
|
|
8941
|
+
return WEBMCP_PRODUCTION_API_BASE;
|
|
8943
8942
|
};
|
|
8944
8943
|
/**
|
|
8945
8944
|
* EmbeddedAgent - Drop-in AI chat widget
|
|
@@ -8956,7 +8955,7 @@ const EmbeddedAgent = (t0) => {
|
|
|
8956
8955
|
const { appId, devMode } = t0;
|
|
8957
8956
|
let apiBase;
|
|
8958
8957
|
if ($[0] !== appId || $[1] !== devMode) {
|
|
8959
|
-
apiBase = getDefaultApiBase();
|
|
8958
|
+
apiBase = getDefaultApiBase(devMode?.useLocalApi);
|
|
8960
8959
|
if (typeof window !== "undefined") console.debug("[WebMCP] Initialized", {
|
|
8961
8960
|
appId,
|
|
8962
8961
|
mode: devMode ? "development" : "production",
|