Trying to hit the [execute API](https://www.elastic.co/guide/en/elasticsearch/painless/8.5/painless-execute-api.html) with an index that in available via cross cluster search will fail with an `IllegalArgumentException`: `Cross-cluster calls are not supported in this context but remote indices were requested`

That is because `PainlessExecuteAction`'s [`TransportAction`](https://github.com/elastic/elasticsearch/blob/8.5/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java#L462) is a [`TransportSingleShardAction`](https://github.com/elastic/elasticsearch/blob/8.5/server/src/main/java/org/elasticsearch/action/support/single/shard/TransportSingleShardAction.java#L153) which uses [`IndexNameExpressionResolver.concreteIndices`](https://github.com/elastic/elasticsearch/blob/8.5/server/src/main/java/org/elasticsearch/cluster/metadata/IndexNameExpressionResolver.java#L331), which does not support remote clusters.

What would it take it enable PainlessExecuteAction to support CCS?

Kibana uses the execute api to validate runtime fields on edit, see https://github.com/elastic/kibana/issues/145861
modules/lang-painless/src/test/java/org/elasticsearch/painless/action/PainlessExecuteApiTests.java
ScriptService scriptService = getInstanceFromNode(ScriptService.class);
        IndexService indexService = createIndex("index", Settings.EMPTY, "doc", "rank", "type=long", "text", "type=keyword");
        Request.ContextSetup contextSetup = new Request.ContextSetup("index", new BytesArray("{}"), new MatchAllQueryBuilder());
        contextSetup.setXContentType(XContentType.JSON);
        Request request = new Request(
            new Script(ScriptType.INLINE, "painless", "emit(\"foo\", \"bar\"); emit(\"foo2\", 2);", emptyMap()),
            "composite_field",
            contextSetup
        );
        Response response = innerShardOperation(request, scriptService, indexService);
        assertEquals(Map.of("composite_field.foo", List.of("bar"), "composite_field.foo2", List.of(2)), response.getResult());
    }
    public void testContextWhitelists() throws IOException {
        ScriptService scriptService = getInstanceFromNode(ScriptService.class);
        
        Request request = new Request(new Script("sigmoid(1.0, 2.0, 3.0)"), null, null);
        Response response = innerShardOperation(request, scriptService, null);
        double result = Double.parseDouble((String) response.getResult());
        assertEquals(0.111, result, 0.001);
        
        request = new Request(new Script("'foo'.sha1()"), null, null);
        response = innerShardOperation(request, scriptService, null);
        assertEquals("0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33", response.getResult());
        
        request = new Request(new Script("Json.load('{\"a\": 1, \"b\": 2}')['b']"), null, null);
        response = innerShardOperation(request, scriptService, null);
        assertEquals(2, Integer.parseInt((String) response.getResult()));
    }
}