@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/bin.js +14 -13
- package/dist/bin.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +14 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -8640,17 +8640,21 @@ var init_orchestrator = __esm({
|
|
|
8640
8640
|
];
|
|
8641
8641
|
}
|
|
8642
8642
|
});
|
|
8643
|
-
function
|
|
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
|
|
8649
|
-
|
|
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
|
|
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 =
|
|
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"] ?? "
|
|
8683
|
-
const wsUrl =
|
|
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:
|
|
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,
|
|
@@ -14929,10 +14933,7 @@ async function startAgent(opts) {
|
|
|
14929
14933
|
log.info("DeskFree Agent Runtime starting...");
|
|
14930
14934
|
const { getRotationToken: getRotationToken2, setInitialRotationToken: setInitialRotationToken2 } = await Promise.resolve().then(() => (init_ws_gateway(), ws_gateway_exports));
|
|
14931
14935
|
const { collectFingerprint: collectFingerprint2 } = await Promise.resolve().then(() => (init_fingerprint(), fingerprint_exports));
|
|
14932
|
-
const
|
|
14933
|
-
const require3 = createRequire(import.meta.url);
|
|
14934
|
-
const runtimePkg = require3("../../package.json");
|
|
14935
|
-
const runtimeVersion = runtimePkg.version;
|
|
14936
|
+
const runtimeVersion = "0.6.5";
|
|
14936
14937
|
const fingerprint = collectFingerprint2(localConfig.stateDir, runtimeVersion);
|
|
14937
14938
|
log.info("Connecting to DeskFree...", { wsUrl: localConfig.wsUrl });
|
|
14938
14939
|
const connectResult = await initialConnect({
|