Overview
Implement Phase 4.1 of #1810: add the public API types needed to define tools inline with lambdas.
Before coding
- Do not start any implementation work until this issue is explicitly assigned to the coding agent.
- Base branch for this work:
edburns/1810-java-tool-ergonomics-tool-as-lambda.
- Read this plan file on the branch before coding:
1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md
Ordering rule (important)
Issues for Phase 4 are resolved strictly in plan order (4.1, then 4.2, ...). Each issue is merged to edburns/1810-java-tool-ergonomics-tool-as-lambda before the next one starts.
Relevant Phase 3 resolutions to apply
- 3.1 API shape: v1 sync/async families are
from, fromAsync, plus context-aware fromWithToolInvocation / fromAsyncWithToolInvocation.
- 3.2 functional interfaces: use JDK functional interfaces (Supplier/Function/BiFunction), no custom SAM interfaces in v1.
- 3.3 parameter DSL: use runtime metadata class
Param<T> with fluent API and validation.
- 3.8 package placement: user-facing helper types belong in
com.github.copilot.tool; avoid leaking internal helper types.
Scope / deliverables
- Add/finish public API type(s) under
java/src/main/java/com/github/copilot/tool/ required by lambda tool definitions, including Param<T>.
- Ensure the API is discoverable and unambiguous at call sites.
- Ensure module exports/public surface remain minimal and user-facing only.
Validation and behavior requirements
Param rejects blank name/description.
required=true with non-empty default is rejected.
- default values are validated against declared
Class<T>.
- Public signatures compile cleanly and are ready for Phase 4.2 overload implementation.
Constraints
- Keep changes focused to this sub-item only.
- Follow existing Java style and public API documentation conventions.
Completion bookkeeping
When complete, update the checkbox for Phase 4.1 in:
1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md
Overview
Implement Phase 4.1 of #1810: add the public API types needed to define tools inline with lambdas.
Before coding
edburns/1810-java-tool-ergonomics-tool-as-lambda.1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.mdOrdering rule (important)
Issues for Phase 4 are resolved strictly in plan order (4.1, then 4.2, ...). Each issue is merged to
edburns/1810-java-tool-ergonomics-tool-as-lambdabefore the next one starts.Relevant Phase 3 resolutions to apply
from,fromAsync, plus context-awarefromWithToolInvocation/fromAsyncWithToolInvocation.Param<T>with fluent API and validation.com.github.copilot.tool; avoid leaking internal helper types.Scope / deliverables
java/src/main/java/com/github/copilot/tool/required by lambda tool definitions, includingParam<T>.Validation and behavior requirements
Paramrejects blankname/description.required=truewith non-empty default is rejected.Class<T>.Constraints
Completion bookkeeping
When complete, update the checkbox for Phase 4.1 in:
1810-java-tool-ergonomics-tool-as-lambda-remove-before-merge/1810-ignorance-reduction-for-implementation-plan.md