@@ -1866,6 +1866,8 @@ export function createWorkspaceStore(options: {
18661866 const ok = await createRemoteWorkspaceFlow ( {
18671867 openworkHostUrl : host . openworkUrl ,
18681868 openworkToken : host . ownerToken ?. trim ( ) || host . token ,
1869+ openworkClientToken : host . token ,
1870+ openworkHostToken : host . hostToken ,
18691871 directory : resolvedFolder ,
18701872 displayName : name ,
18711873 sandboxBackend : host . sandboxBackend ?? "docker" ,
@@ -1913,6 +1915,8 @@ export function createWorkspaceStore(options: {
19131915 async function createRemoteWorkspaceFlow ( input : {
19141916 openworkHostUrl ?: string | null ;
19151917 openworkToken ?: string | null ;
1918+ openworkClientToken ?: string | null ;
1919+ openworkHostToken ?: string | null ;
19161920 directory ?: string | null ;
19171921 displayName ?: string | null ;
19181922 manageBusy ?: boolean ;
@@ -2048,6 +2052,10 @@ export function createWorkspaceStore(options: {
20482052 remoteType,
20492053 openworkHostUrl : remoteType === "openwork" ? resolvedHostUrl : null ,
20502054 openworkToken : remoteType === "openwork" ? ( token || null ) : null ,
2055+ openworkClientToken :
2056+ remoteType === "openwork" ? ( input . openworkClientToken ?. trim ( ) || null ) : null ,
2057+ openworkHostToken :
2058+ remoteType === "openwork" ? ( input . openworkHostToken ?. trim ( ) || null ) : null ,
20512059 openworkWorkspaceId : remoteType === "openwork" ? openworkWorkspace ?. id ?? null : null ,
20522060 openworkWorkspaceName : remoteType === "openwork" ? openworkWorkspace ?. name ?? null : null ,
20532061 sandboxBackend : input . sandboxBackend ?? null ,
@@ -2071,6 +2079,10 @@ export function createWorkspaceStore(options: {
20712079 displayName,
20722080 openworkHostUrl : remoteType === "openwork" ? resolvedHostUrl : null ,
20732081 openworkToken : remoteType === "openwork" ? ( token || null ) : null ,
2082+ openworkClientToken :
2083+ remoteType === "openwork" ? ( input . openworkClientToken ?. trim ( ) || null ) : null ,
2084+ openworkHostToken :
2085+ remoteType === "openwork" ? ( input . openworkHostToken ?. trim ( ) || null ) : null ,
20742086 openworkWorkspaceId : remoteType === "openwork" ? openworkWorkspace ?. id ?? null : null ,
20752087 openworkWorkspaceName : remoteType === "openwork" ? openworkWorkspace ?. name ?? null : null ,
20762088 sandboxBackend : input . sandboxBackend ?? null ,
@@ -2132,6 +2144,8 @@ export function createWorkspaceStore(options: {
21322144 input : {
21332145 openworkHostUrl ?: string | null ;
21342146 openworkToken ?: string | null ;
2147+ openworkClientToken ?: string | null ;
2148+ openworkHostToken ?: string | null ;
21352149 directory ?: string | null ;
21362150 displayName ?: string | null ;
21372151 } ,
@@ -2241,6 +2255,10 @@ export function createWorkspaceStore(options: {
22412255 displayName,
22422256 openworkHostUrl : resolvedHostUrl ,
22432257 openworkToken : token ? token : null ,
2258+ openworkClientToken :
2259+ input . openworkClientToken ?. trim ( ) || workspace . openworkClientToken ?. trim ( ) || null ,
2260+ openworkHostToken :
2261+ input . openworkHostToken ?. trim ( ) || workspace . openworkHostToken ?. trim ( ) || null ,
22442262 openworkWorkspaceId : openworkWorkspace ?. id ?? workspace . openworkWorkspaceId ?? null ,
22452263 openworkWorkspaceName : openworkWorkspace ?. name ?? workspace . openworkWorkspaceName ?? null ,
22462264 } ) ;
@@ -2261,6 +2279,10 @@ export function createWorkspaceStore(options: {
22612279 displayName,
22622280 openworkHostUrl : resolvedHostUrl ,
22632281 openworkToken : token ? token : null ,
2282+ openworkClientToken :
2283+ input . openworkClientToken ?. trim ( ) || item . openworkClientToken ?. trim ( ) || null ,
2284+ openworkHostToken :
2285+ input . openworkHostToken ?. trim ( ) || item . openworkHostToken ?. trim ( ) || null ,
22642286 openworkWorkspaceId : openworkWorkspace ?. id ?? item . openworkWorkspaceId ?? null ,
22652287 openworkWorkspaceName : openworkWorkspace ?. name ?? item . openworkWorkspaceName ?? null ,
22662288 }
@@ -2397,7 +2419,11 @@ export function createWorkspaceStore(options: {
23972419 sandboxBackend : "docker" ,
23982420 runId : workspace . sandboxRunId ?. trim ( ) || null ,
23992421 openworkToken :
2400- workspace . openworkToken ?. trim ( ) || options . openworkServerSettings ( ) . token ?. trim ( ) || null ,
2422+ workspace . openworkClientToken ?. trim ( ) ||
2423+ workspace . openworkToken ?. trim ( ) ||
2424+ options . openworkServerSettings ( ) . token ?. trim ( ) ||
2425+ null ,
2426+ openworkHostToken : workspace . openworkHostToken ?. trim ( ) || null ,
24012427 } ) ;
24022428
24032429 const resolved = await resolveOpenworkHost ( {
@@ -2417,6 +2443,8 @@ export function createWorkspaceStore(options: {
24172443 directory : resolved . directory || workspacePath ,
24182444 openworkHostUrl : resolved . hostUrl ,
24192445 openworkToken : host . ownerToken ?. trim ( ) || host . token ,
2446+ openworkClientToken : host . token ,
2447+ openworkHostToken : host . hostToken ,
24202448 openworkWorkspaceId : resolved . workspace . id ,
24212449 openworkWorkspaceName : resolved . workspace . name ?? workspace . openworkWorkspaceName ?? null ,
24222450 sandboxBackend : host . sandboxBackend ?? "docker" ,
0 commit comments