Skip to content

Commit 9d8d0be

Browse files
committed
save work
1 parent 3d0b691 commit 9d8d0be

File tree

85 files changed

+3413
-631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3413
-631
lines changed

docs/src/main/asciidoc/includes/openapi/openapi-generator.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ In the vocabulary of the tool, there are two _generators_ for Helidon:
3838
Each of these generators supports two _libraries_:
3939
4040
* `mp` - for Helidon MP code generation
41-
* `se` - for Helidon SE code generation
41+
* `imperative` - for Helidon SE code generation
4242
4343
Use the Helidon _client_ generator and its `{flavor-lc}` library to create a
4444
ifdef::mp-flavor[]
@@ -220,7 +220,7 @@ You must specify the following options:
220220
| `<library>`
221221
|Library you want to use
222222
|`mp` +
223-
`se`
223+
`imperative`
224224
|===
225225
226226
=== Recommended Settings for the OpenAPI Generator

docs/src/main/asciidoc/se/config/hierarchical-features.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ and has a single value.
219219
| `traverse()` +
220220
`traverse(Predicate<Config>)` | Returns a `Stream<Config>` as an iterative
221221
deepening depth-first traversal of the subtree
222-
|`type()` |Returns the `Type` enum value for the node: `OBJECT`, `LIST`, `VALUE`,
222+
|`type()` |Returns the `CompletionType` enum value for the node: `OBJECT`, `LIST`, `VALUE`,
223223
or `MISSING`
224224
|===
225225

integrations/mcp/codegen/src/main/java/io/helidon/integrations/mcp/codegen/McpCodegenProvider.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright (c) 2025 Oracle and/or its affiliates.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.helidon.integrations.mcp.codegen;
218

319
import java.util.Set;

integrations/mcp/codegen/src/main/java/io/helidon/integrations/mcp/codegen/McpTypes.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright (c) 2025 Oracle and/or its affiliates.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.helidon.integrations.mcp.codegen;
218

319
import io.helidon.common.types.TypeName;

integrations/mcp/server/src/main/java/io/helidon/integrations/mcp/server/Capability.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,17 @@ enum Capability {
4747
/**
4848
* Enable pagination capability.
4949
*/
50-
PAGINATION
50+
PAGINATION,
51+
/**
52+
* Sampling client capability.
53+
*/
54+
SAMPLING,
55+
/**
56+
* Root client capability
57+
*/
58+
ROOT,
59+
/**
60+
* Progress capability
61+
*/
62+
PROGRESS
5163
}

integrations/mcp/server/src/main/java/io/helidon/integrations/mcp/server/Completion.java

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,45 +25,54 @@
2525
*/
2626
@RuntimeType.PrototypedBy(CompletionConfig.class)
2727
public interface Completion extends RuntimeType.Api<CompletionConfig> {
28+
/**
29+
* Create a {@link Completion} instance from its configuration.
30+
*
31+
* @param config completion configuration
32+
* @return completion instance
33+
*/
2834
static Completion create(CompletionConfig config) {
29-
return new CompletionImpl(config.uri(), config.name(), config.completion());
35+
return new CompletionImpl(config.reference(), config.completion());
3036
}
3137

38+
/**
39+
* Create a {@link Completion} instance from its configuration builder.
40+
*
41+
* @param consumer configuration builder
42+
* @return completion instance
43+
*/
3244
static Completion create(Consumer<CompletionConfig.Builder> consumer) {
3345
return CompletionConfig.builder()
3446
.update(consumer)
3547
.build();
3648
}
3749

38-
static CompletionConfig.Builder builder() {
39-
return CompletionConfig.builder();
40-
}
41-
4250
/**
43-
* Resource completion uri.
51+
* Get completion builder.
4452
*
45-
* @return uri
53+
* @return builder
4654
*/
47-
String uri();
55+
static CompletionConfig.Builder builder() {
56+
return CompletionConfig.builder();
57+
}
4858

4959
/**
50-
* Prompt completion name.
60+
* Completion reference must be a {@link Prompt} name or a {@link Resource} uri template.
5161
*
52-
* @return name
62+
* @return completion reference
5363
*/
54-
String name();
64+
String reference();
5565

5666
/**
5767
* Completion content.
5868
*
5969
* @return content
6070
*/
61-
CompletionContent complete(McpParameters parameters);
71+
CompletionContent complete(McpParameters parameters, McpFeatures features);
6272

6373
default CompletionConfig prototype() {
6474
return CompletionConfig.builder()
65-
.name(name())
66-
.uri(uri())
75+
.reference(reference())
6776
.completion(this::complete)
6877
.buildPrototype();
6978
}
Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,39 @@
1+
/*
2+
* Copyright (c) 2025 Oracle and/or its affiliates.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.helidon.integrations.mcp.server;
218

19+
import java.util.function.BiFunction;
320
import java.util.function.Function;
421

522
import io.helidon.builder.api.Prototype;
623

724
@Prototype.Blueprint
825
interface CompletionConfigBlueprint extends Prototype.Factory<Completion>{
926
/**
10-
* Resource completion uri
11-
*
12-
* @return uri
13-
*/
14-
String uri();
15-
16-
/**
17-
* Prompt completion name.
27+
* Completion reference must be a {@link Prompt} name or a {@link Resource} uri template.
1828
*
19-
* @return name
29+
* @return completion reference
2030
*/
21-
String name();
31+
String reference();
2232

2333
/**
2434
* Completion content.
2535
*
2636
* @return content
2737
*/
28-
Function<McpParameters, CompletionContent> completion();
38+
BiFunction<McpParameters, McpFeatures, CompletionContent> completion();
2939
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,11 @@
1818

1919
import java.util.List;
2020

21-
class CompletionPrompt implements CompletionContent {
21+
class CompletionContentImpl implements CompletionContent {
2222
private final List<String> values;
23-
private final String name;
2423

25-
CompletionPrompt(String name, List<String> values) {
24+
CompletionContentImpl(List<String> values) {
2625
this.values = values;
27-
this.name = name;
2826
}
2927

3028
@Override

integrations/mcp/server/src/main/java/io/helidon/integrations/mcp/server/CompletionContents.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,12 @@ private CompletionContents() {
2626
}
2727

2828
/**
29-
* Create {@link Resource} completion content.
29+
* Create a completion content.
3030
*
3131
* @param values completion values
3232
* @return completion content
3333
*/
34-
public static CompletionContent createResourceCompletion(String uri, List<String> values) {
35-
return new CompletionResource(uri, values);
36-
}
37-
38-
/**
39-
* Create {@link Prompt} completion content.
40-
*
41-
* @param values completion values
42-
* @return completion content
43-
*/
44-
public static CompletionContent createPromptCompletion(String name, List<String> values) {
45-
return new CompletionPrompt(name, values);
34+
public static CompletionContent completion(List<String> values) {
35+
return new CompletionContentImpl(values);
4636
}
4737
}
Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,39 @@
1+
/*
2+
* Copyright (c) 2025 Oracle and/or its affiliates.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package io.helidon.integrations.mcp.server;
218

3-
import java.util.function.Function;
19+
import java.util.function.BiFunction;
420

521
class CompletionImpl implements Completion {
6-
private final Function<McpParameters, CompletionContent> complete;
7-
private final String uri;
8-
private final String name;
22+
private final String reference;
23+
private final BiFunction<McpParameters, McpFeatures, CompletionContent> complete;
924

10-
public CompletionImpl(String uri, String name, Function<McpParameters, CompletionContent> complete) {
11-
this.uri = uri;
12-
this.name = name;
25+
public CompletionImpl(String reference, BiFunction<McpParameters, McpFeatures, CompletionContent> complete) {
26+
this.reference = reference;
1327
this.complete = complete;
1428
}
1529

1630
@Override
17-
public String uri() {
18-
return uri;
19-
}
20-
21-
@Override
22-
public String name() {
23-
return name;
31+
public String reference() {
32+
return reference;
2433
}
2534

2635
@Override
27-
public CompletionContent complete(McpParameters parameters) {
28-
return complete.apply(parameters);
36+
public CompletionContent complete(McpParameters parameters, McpFeatures features) {
37+
return complete.apply(parameters, features);
2938
}
3039
}

0 commit comments

Comments
 (0)