( sandbox: SandboxInstance, sessionHome: string, sessionId: string )
| 853 | sandbox: SandboxInstance, |
| 854 | session: ExecutionSession, |
| 855 | sessionHome: string, |
| 856 | kilocodeToken: string |
| 857 | ): Promise<string> { |
| 858 | const tokenPath = getRestoreTokenFilePath(sessionHome); |
| 859 | const tokenDir = dirname(tokenPath); |
| 860 | |
| 861 | await timedExec(session, `mkdir -p ${shellQuote(tokenDir)}`, 'session.restoreTokenFile.mkdir'); |
| 862 | await sandbox.writeFile(tokenPath, kilocodeToken); |
| 863 | await timedExec(session, `chmod 600 ${shellQuote(tokenPath)}`, 'session.restoreTokenFile.chmod'); |
| 864 | |
| 865 | return tokenPath; |
| 866 | } |
| 867 | |
| 868 | async function cleanupRestoreTokenFile( |
| 869 | session: ExecutionSession, |
no test coverage detected