@questionbase/deskfree 0.6.3 → 0.6.4

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/bin.js CHANGED
@@ -8640,17 +8640,21 @@ var init_orchestrator = __esm({
8640
8640
  ];
8641
8641
  }
8642
8642
  });
8643
- function getStageDomain(stage, domain) {
8643
+ function getBaseDomain(stage) {
8644
+ return stage === "my" ? "deskfree.ai" : "dev.deskfree.ai";
8645
+ }
8646
+ function getStageHost(stage) {
8647
+ const domain = getBaseDomain(stage);
8644
8648
  if (domain.startsWith(`${stage}.`)) return domain;
8645
8649
  return `${stage}.${domain}`;
8646
8650
  }
8647
8651
  function deriveApiUrl() {
8648
- const domain = process.env["DESKFREE_DOMAIN"] ?? "dev.deskfree.ai";
8649
- const stage = process.env["STAGE"] ?? "dev";
8650
- return `https://${getStageDomain(stage, domain)}/v1/bot`;
8652
+ const stage = process.env["STAGE"] ?? "my";
8653
+ return `https://${getStageHost(stage)}/v1/bot`;
8651
8654
  }
8652
8655
  function deriveWsUrl() {
8653
- const domain = process.env["DESKFREE_DOMAIN"] ?? "dev.deskfree.ai";
8656
+ const stage = process.env["STAGE"] ?? "my";
8657
+ const domain = getBaseDomain(stage);
8654
8658
  return `wss://ws.${domain}`;
8655
8659
  }
8656
8660
  function loadConfig() {
@@ -8664,7 +8668,7 @@ function loadConfig() {
8664
8668
  if (idError !== null) {
8665
8669
  throw new Error(`Invalid bot ID: ${idError}`);
8666
8670
  }
8667
- const apiUrl = process.env["DESKFREE_API_URL"] ?? deriveApiUrl();
8671
+ const apiUrl = deriveApiUrl();
8668
8672
  const apiUrlError = validateApiUrl(apiUrl);
8669
8673
  if (apiUrlError !== null) {
8670
8674
  throw new Error(`Invalid API URL: ${apiUrlError}`);
@@ -8679,8 +8683,8 @@ function loadConfig() {
8679
8683
  if (isNaN(healthPort) || healthPort < 1 || healthPort > 65535) {
8680
8684
  throw new Error(`Invalid HEALTH_PORT: ${healthPortRaw}`);
8681
8685
  }
8682
- const stage = process.env["STAGE"] ?? "dev";
8683
- const wsUrl = process.env["DESKFREE_WS_URL"] ?? deriveWsUrl();
8686
+ const stage = process.env["STAGE"] ?? "my";
8687
+ const wsUrl = deriveWsUrl();
8684
8688
  return {
8685
8689
  botId,
8686
8690
  apiUrl,
@@ -8708,7 +8712,7 @@ function mergeWithRemoteConfig(local, remote) {
8708
8712
  return {
8709
8713
  ...local,
8710
8714
  claudeCodePath,
8711
- wsUrl: process.env["DESKFREE_WS_URL"] ?? remote.wsUrl ?? local.wsUrl,
8715
+ wsUrl: remote.wsUrl ?? local.wsUrl,
8712
8716
  model: process.env["DESKFREE_MODEL"] ?? remote.model,
8713
8717
  awsRegion: process.env["AWS_REGION"] ?? remote.awsRegion,
8714
8718
  heartbeatIntervalMs: process.env["DESKFREE_HEARTBEAT_INTERVAL_MS"] ? parseInt(process.env["DESKFREE_HEARTBEAT_INTERVAL_MS"], 10) : remote.heartbeatIntervalMs,