| 193 | }; |
| 194 | } |
| 195 | |
| 196 | get hasSession(): boolean { |
| 197 | return this.session !== null; |
| 198 | } |
| 199 | |
| 200 | get currentSession(): SessionContext | null { |
| 201 | return this.session; |
| 202 | } |
| 203 | |
| 204 | bindSession(context: SessionContext): { changed: boolean } { |
| 205 | if (!this.session) { |
| 206 | this.session = context; |
| 207 | this._admissionsBlocked = false; |
| 208 | this._blockedWrapperRunId = undefined; |
| 209 | this._lastError = null; |
| 210 | this.updateActivity(); |
| 211 | return { changed: true }; |
| 212 | } |
| 213 | const changed = |
| 214 | this.session.kiloSessionId !== context.kiloSessionId || |
| 215 | this.session.ingestUrl !== context.ingestUrl || |
| 216 | this.session.ingestToken !== context.ingestToken || |
| 217 | this.session.workerAuthToken !== context.workerAuthToken || |
| 218 | this.session.platform !== context.platform || |
| 219 | this.session.wrapperRunId !== context.wrapperRunId || |
| 220 | this.session.wrapperGeneration !== context.wrapperGeneration || |