@ikonai/sdk 1.0.38 → 1.0.39

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.
@@ -77,6 +77,7 @@ export declare class ChannelManager {
77
77
  private abortController;
78
78
  private demotedTypes;
79
79
  private connectionStable;
80
+ private connectionTimeoutMs;
80
81
  private readonly config;
81
82
  constructor(config: ChannelManagerConfig);
82
83
  /**
@@ -19,6 +19,11 @@ export interface ChannelConfig {
19
19
  * Keepalive timeout in milliseconds.
20
20
  */
21
21
  keepaliveTimeoutMs: number;
22
+ /**
23
+ * Connection timeout in milliseconds for the transport handshake.
24
+ * If not specified, transports use their own defaults.
25
+ */
26
+ connectionTimeoutMs?: number;
22
27
  /**
23
28
  * Callback when a protocol message is received.
24
29
  */
@@ -34,6 +34,10 @@ export declare class EndpointSelector {
34
34
  * Called by IkonClient when auth-level proxy fallback succeeds in auto mode.
35
35
  */
36
36
  markProxyPreferred(): void;
37
+ /**
38
+ * Clear the proxy preference so the next connection tries direct first.
39
+ */
40
+ clearProxyPreference(): void;
37
41
  /**
38
42
  * Get ordered list of endpoint types to try.
39
43
  * Returns only types that exist in the provided map.
@@ -49,6 +53,7 @@ export declare class EndpointSelector {
49
53
  */
50
54
  clearRememberedType(): void;
51
55
  private filterByTransport;
56
+ private checkPreferenceExpiry;
52
57
  private loadRememberedType;
53
58
  private loadProxyPreference;
54
59
  }
@@ -177,7 +177,7 @@ export interface TimeoutConfig {
177
177
  slowConnectionThresholdMs?: number;
178
178
  /**
179
179
  * Duration in milliseconds before giving up and showing offline.
180
- * Default: 300000 (5 minutes)
180
+ * Default: 60000 (60 seconds)
181
181
  */
182
182
  connectionTimeoutMs?: number;
183
183
  /**
@@ -349,7 +349,7 @@ export interface IkonClientConfig {
349
349
  proxy?: boolean;
350
350
  }
351
351
  export declare const DEFAULT_SLOW_CONNECTION_THRESHOLD_MS = 5000;
352
- export declare const DEFAULT_CONNECTION_TIMEOUT_MS = 300000;
352
+ export declare const DEFAULT_CONNECTION_TIMEOUT_MS = 60000;
353
353
  export declare const DEFAULT_KEEPALIVE_TIMEOUT_MS = 15000;
354
354
  export declare const DEFAULT_RECONNECT_BACKOFF_MS = 2000;
355
355
  export declare const DEFAULT_MAX_RECONNECT_ATTEMPTS = 2;
@@ -7,13 +7,19 @@ import { ProxyMode } from '../client/endpoint-selector';
7
7
  export interface AuthResult {
8
8
  authResponse: AuthResponse;
9
9
  usedProxyUrl?: boolean;
10
+ directUrl?: string;
10
11
  backendUrl?: string;
11
12
  authToken?: string;
12
13
  }
13
14
  /**
14
15
  * Common authentication logic - fetch the connect URL and decode the AuthResponse.
15
16
  */
16
- export declare function authenticateWithUrl(connectUrl: string, signal?: AbortSignal): Promise<AuthResult>;
17
+ export declare function authenticateWithUrl(connectUrl: string, signal?: AbortSignal, timeoutMs?: number): Promise<AuthResult>;
18
+ /**
19
+ * Probe server health by fetching the /health endpoint.
20
+ * Returns true if the server responds with HTTP 200 within the timeout.
21
+ */
22
+ export declare function probeServerHealth(connectUrl: string, signal?: AbortSignal): Promise<boolean>;
17
23
  /**
18
24
  * Authenticate with a local Ikon server in development mode.
19
25
  *