@questionbase/deskfree 0.6.2 → 0.6.3

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
@@ -1,6 +1,7 @@
1
1
  import { PluginLogger, AgentContext, DeskFreeClient, DeskFreeTool, ChatMessage, RuntimeBootstrapConfig } from '@deskfree/core';
2
2
  import * as _anthropic_ai_claude_agent_sdk from '@anthropic-ai/claude-agent-sdk';
3
3
  import { McpSdkServerConfigWithInstance, SDKMessage, SDKUserMessage, Query, tool } from '@anthropic-ai/claude-agent-sdk';
4
+ import WebSocket from 'ws';
4
5
 
5
6
  interface StartAgentOptions {
6
7
  log?: PluginLogger;
@@ -11,7 +12,7 @@ type DisposeAgent = () => void;
11
12
  * Full agent startup sequence:
12
13
  *
13
14
  * 1. Load local config (botId + apiUrl from env)
14
- * 2. Connect to DeskFree (bots.connect → rotation token)
15
+ * 2. Connect to DeskFree (WS-first → rotation token)
15
16
  * 3. Create authenticated DeskFree client
16
17
  * 4. Bootstrap: fetch config from API (wsUrl, model, region, tools)
17
18
  * 5. Install enabled tool packages
@@ -268,19 +269,6 @@ declare class SessionStore {
268
269
  dispose(): void;
269
270
  }
270
271
 
271
- /** Host fingerprint sent to bots.connect. */
272
- interface HostFingerprint {
273
- hostId: string;
274
- machineId: string;
275
- platform: string;
276
- arch: string;
277
- hostname: string;
278
- cpuModel: string;
279
- totalMemory: number;
280
- nodeVersion: string;
281
- runtimeVersion: string;
282
- }
283
-
284
272
  interface WorkerStatus {
285
273
  activeWorkers: number;
286
274
  queuedTasks: number;
@@ -297,22 +285,19 @@ interface GatewayConfig {
297
285
  getWorkerStatus?: () => WorkerStatus;
298
286
  /** Trigger memory consolidation on demand. Returns status string. */
299
287
  onConsolidate?: () => Promise<string>;
300
- /** Bot ID for bots.connect flow */
288
+ /** Bot ID for WS-first connection */
301
289
  botId: string;
302
- /** Public API URL for bots.connect (e.g. https://stage.domain/v1/public) */
303
- publicApiUrl: string;
304
- /** Host fingerprint for bots.connect */
305
- fingerprint: HostFingerprint;
306
- /** Ticket + wsUrl from initial bots.connect — skip first connect call */
307
- initialTicket?: {
308
- ticket: string;
309
- wsUrl: string;
310
- };
290
+ /** Deployment stage (e.g. "dev", "alpha") */
291
+ stage: string;
292
+ /** Live WebSocket from initial connect (first iteration only) */
293
+ initialWs: WebSocket;
294
+ /** Rotation token from initial connect */
295
+ initialRotationToken: string;
311
296
  }
312
297
  /**
313
298
  * Start the WS gateway — reconnection loop with backoff.
314
299
  *
315
- * Flow: bots.connect → WS connectheartbeat rotation → proactive reconnect
300
+ * Flow: WS connect → init "go" run connection → proactive reconnect
316
301
  */
317
302
  declare function startGateway(config: GatewayConfig): Promise<void>;
318
303
 
@@ -348,6 +333,10 @@ interface LocalConfig {
348
333
  botId: string;
349
334
  /** DeskFree backend API URL */
350
335
  apiUrl: string;
336
+ /** Deployment stage (e.g. "dev", "alpha") */
337
+ stage: string;
338
+ /** WebSocket URL (derived from domain or explicit override) */
339
+ wsUrl: string;
351
340
  /** Directory for cursor + media storage */
352
341
  stateDir: string;
353
342
  /** Directory for dynamic tool installs */