@questionbase/deskfree 0.6.3 → 0.6.5

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 CHANGED
@@ -390,7 +390,7 @@ interface RuntimeConfig extends LocalConfig {
390
390
  * Load local config from environment variables.
391
391
  *
392
392
  * Requires `BOT=BFRH3VXHQR7` (or `DESKFREE_BOT_ID`).
393
- * API URL is derived from STAGE + DESKFREE_DOMAIN, or set explicitly via DESKFREE_API_URL.
393
+ * API URL is derived from STAGE.
394
394
  */
395
395
  declare function loadConfig(): LocalConfig;
396
396
  /**
package/dist/index.js CHANGED
@@ -12607,17 +12607,21 @@ var DEFAULTS = {
12607
12607
  logLevel: "info",
12608
12608
  healthPort: 3100
12609
12609
  };
12610
- function getStageDomain(stage, domain) {
12610
+ function getBaseDomain(stage) {
12611
+ return stage === "my" ? "deskfree.ai" : "dev.deskfree.ai";
12612
+ }
12613
+ function getStageHost(stage) {
12614
+ const domain = getBaseDomain(stage);
12611
12615
  if (domain.startsWith(`${stage}.`)) return domain;
12612
12616
  return `${stage}.${domain}`;
12613
12617
  }
12614
12618
  function deriveApiUrl() {
12615
- const domain = process.env["DESKFREE_DOMAIN"] ?? "dev.deskfree.ai";
12616
- const stage = process.env["STAGE"] ?? "dev";
12617
- return `https://${getStageDomain(stage, domain)}/v1/bot`;
12619
+ const stage = process.env["STAGE"] ?? "my";
12620
+ return `https://${getStageHost(stage)}/v1/bot`;
12618
12621
  }
12619
12622
  function deriveWsUrl() {
12620
- const domain = process.env["DESKFREE_DOMAIN"] ?? "dev.deskfree.ai";
12623
+ const stage = process.env["STAGE"] ?? "my";
12624
+ const domain = getBaseDomain(stage);
12621
12625
  return `wss://ws.${domain}`;
12622
12626
  }
12623
12627
  function loadConfig() {
@@ -12631,7 +12635,7 @@ function loadConfig() {
12631
12635
  if (idError !== null) {
12632
12636
  throw new Error(`Invalid bot ID: ${idError}`);
12633
12637
  }
12634
- const apiUrl = process.env["DESKFREE_API_URL"] ?? deriveApiUrl();
12638
+ const apiUrl = deriveApiUrl();
12635
12639
  const apiUrlError = validateApiUrl(apiUrl);
12636
12640
  if (apiUrlError !== null) {
12637
12641
  throw new Error(`Invalid API URL: ${apiUrlError}`);
@@ -12646,8 +12650,8 @@ function loadConfig() {
12646
12650
  if (isNaN(healthPort) || healthPort < 1 || healthPort > 65535) {
12647
12651
  throw new Error(`Invalid HEALTH_PORT: ${healthPortRaw}`);
12648
12652
  }
12649
- const stage = process.env["STAGE"] ?? "dev";
12650
- const wsUrl = process.env["DESKFREE_WS_URL"] ?? deriveWsUrl();
12653
+ const stage = process.env["STAGE"] ?? "my";
12654
+ const wsUrl = deriveWsUrl();
12651
12655
  return {
12652
12656
  botId,
12653
12657
  apiUrl,
@@ -12675,7 +12679,7 @@ function mergeWithRemoteConfig(local, remote) {
12675
12679
  return {
12676
12680
  ...local,
12677
12681
  claudeCodePath,
12678
- wsUrl: process.env["DESKFREE_WS_URL"] ?? remote.wsUrl ?? local.wsUrl,
12682
+ wsUrl: remote.wsUrl ?? local.wsUrl,
12679
12683
  model: process.env["DESKFREE_MODEL"] ?? remote.model,
12680
12684
  awsRegion: process.env["AWS_REGION"] ?? remote.awsRegion,
12681
12685
  heartbeatIntervalMs: process.env["DESKFREE_HEARTBEAT_INTERVAL_MS"] ? parseInt(process.env["DESKFREE_HEARTBEAT_INTERVAL_MS"], 10) : remote.heartbeatIntervalMs,
@@ -14417,10 +14421,7 @@ async function startAgent(opts) {
14417
14421
  log.info("DeskFree Agent Runtime starting...");
14418
14422
  const { getRotationToken: getRotationToken2, setInitialRotationToken: setInitialRotationToken2 } = await Promise.resolve().then(() => (init_ws_gateway(), ws_gateway_exports));
14419
14423
  const { collectFingerprint: collectFingerprint2 } = await Promise.resolve().then(() => (init_fingerprint(), fingerprint_exports));
14420
- const { createRequire } = await import('module');
14421
- const require3 = createRequire(import.meta.url);
14422
- const runtimePkg = require3("../../package.json");
14423
- const runtimeVersion = runtimePkg.version;
14424
+ const runtimeVersion = "0.6.5";
14424
14425
  const fingerprint = collectFingerprint2(localConfig.stateDir, runtimeVersion);
14425
14426
  log.info("Connecting to DeskFree...", { wsUrl: localConfig.wsUrl });
14426
14427
  const connectResult = await initialConnect({