@ikonai/sdk 0.0.4 → 0.0.6

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.
@@ -1,5 +1,5 @@
1
1
  import { EndpointSelector } from '../client/endpoint-selector';
2
- import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../platform-generated/src/index.ts';
2
+ import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../../shared/generated/src/index.ts';
3
3
  /**
4
4
  * ChannelManager state.
5
5
  */
@@ -1,4 +1,4 @@
1
- import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../platform-generated/src/index.ts';
1
+ import { Entrypoint, EntrypointType, ProtocolMessage } from '../../../../shared/generated/src/index.ts';
2
2
  /**
3
3
  * Channel state.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { Entrypoint, EntrypointType } from '../../../platform-generated/src/index.ts';
1
+ import { Entrypoint, EntrypointType } from '../../../../shared/generated/src/index.ts';
2
2
  import { LocalConfig } from './ikon-client-config';
3
3
  /**
4
4
  * EndpointSelector handles ordering and selection of endpoint types.
@@ -1,4 +1,4 @@
1
- import { ProtocolMessage } from '../../../platform-generated/src/index.ts';
1
+ import { ProtocolMessage } from '../../../../shared/generated/src/index.ts';
2
2
  import { ConnectionState } from './connection-state';
3
3
  /**
4
4
  * Backend environment type.
@@ -32,7 +32,7 @@ export interface CommonConnectionConfig {
32
32
  */
33
33
  description?: string;
34
34
  /**
35
- * Launch parameters passed to the server.
35
+ * Client parameters passed to the server.
36
36
  */
37
37
  parameters?: Record<string, string>;
38
38
  /**
@@ -80,9 +80,9 @@ export interface CloudConnectionConfig extends CommonConnectionConfig {
80
80
  */
81
81
  channelKey?: string;
82
82
  /**
83
- * Optional session hash for targeting precomputed sessions.
83
+ * Optional session ID for targeting precomputed sessions.
84
84
  */
85
- hash?: string;
85
+ sessionId?: string;
86
86
  /**
87
87
  * Timeout for provisioning in milliseconds.
88
88
  * Default: 60000 (60 seconds)
@@ -1,4 +1,4 @@
1
- import { ProtocolMessage } from '../../../platform-generated/src/index.ts';
1
+ import { GlobalState, ProtocolMessage } from '../../../../shared/generated/src/index.ts';
2
2
  import { ConnectionState } from './connection-state';
3
3
  import { IkonClientConfig } from './ikon-client-config';
4
4
  /**
@@ -52,6 +52,8 @@ export declare class IkonClient {
52
52
  private boundBeforeUnload;
53
53
  private boundPageHide;
54
54
  private boundVisibilityChange;
55
+ private _globalState;
56
+ private _initialGlobalStateReceived;
55
57
  constructor(config: IkonClientConfig);
56
58
  private _lastError;
57
59
  /**
@@ -65,6 +67,11 @@ export declare class IkonClient {
65
67
  * Returns undefined if not connected.
66
68
  */
67
69
  get sessionId(): number | undefined;
70
+ /**
71
+ * Get the current GlobalState from the server.
72
+ * Returns null if not yet received.
73
+ */
74
+ get globalState(): GlobalState | null;
68
75
  /**
69
76
  * Get the current connection state.
70
77
  */
@@ -1,4 +1,4 @@
1
- import { AuthResponse } from '../../../platform-generated/src/index.ts';
1
+ import { AuthResponse } from '../../../../shared/generated/src/index.ts';
2
2
  import { ApiKeyConfig, BrowserConfig, LocalConfig } from '../client/ikon-client-config';
3
3
  /**
4
4
  * Result of authentication - contains the AuthResponse from the server.
@@ -30,12 +30,13 @@ export declare function authenticateLocal(config: LocalConfig, signal?: AbortSig
30
30
  * Authenticate with the Ikon backend using browser session cookies.
31
31
  *
32
32
  * Flow:
33
- * 1. Derive backend URL and space domain from hostname
34
- * 2. Fetch space info by domain
35
- * 3. Fetch channels for space
36
- * 4. Select channel (by channelKey or first available)
37
- * 5. POST /rooms/connect and poll until running
38
- * 6. Connect to the returned Ikon server URL
33
+ * 1. Parse URL query parameters (id sessionId, ck → channelKey, all → parameters)
34
+ * 2. Derive backend URL and space domain from hostname
35
+ * 3. Fetch space info by domain
36
+ * 4. Fetch channels for space
37
+ * 5. Select channel (by channelKey or first available)
38
+ * 6. POST /rooms/connect and poll until running
39
+ * 7. Connect to the returned Ikon server URL
39
40
  */
40
41
  export declare function authenticateBrowser(config: BrowserConfig, signal?: AbortSignal): Promise<AuthResult>;
41
42
  /**
package/index.d.ts CHANGED
@@ -6,9 +6,9 @@ export { ChannelManager, type ChannelManagerConfig, type ChannelManagerState } f
6
6
  export { Channel, type ChannelConfig, type ChannelState } from './channel/channel';
7
7
  export { EndpointSelector } from './client/endpoint-selector';
8
8
  export { ConnectionError, AuthenticationError, TransportError, KeepaliveTimeoutError, MaxRetriesExceededError, ProvisioningTimeoutError, ChannelNotFoundError, SpaceNotFoundError, NoChannelsError, } from './errors';
9
- export { Opcode, EntrypointType, ClientReady, UserType, ClientType, ContextType } from '../../platform-generated/src/index.ts';
10
- export type { ProtocolMessage, ProtocolMessageHeaders } from '../../platform-generated/src/index.ts';
11
- export { teleportReadOpcode as readOpcode, teleportReadOpcodeGroup as readOpcodeGroup, asProtocolMessage, readProtocolMessageHeaders } from '../../platform-generated/src/index.ts';
9
+ export { Opcode, EntrypointType, ClientReady, UserType, ClientType, ContextType, GlobalState } from '../../../shared/generated/src/index.ts';
10
+ export type { ProtocolMessage, ProtocolMessageHeaders } from '../../../shared/generated/src/index.ts';
11
+ export { teleportReadOpcode as readOpcode, teleportReadOpcodeGroup as readOpcodeGroup, asProtocolMessage, readProtocolMessageHeaders } from '../../../shared/generated/src/index.ts';
12
12
  export { isWebTransportSupported } from './transport/web-transport-transport';
13
13
  export { setLogLevel, setLogSink, getLogLevel, getLogSink, createLogger, LogLevel } from './utils/logger';
14
14
  export type { LogEntry, LogSink, Logger } from './utils/logger';