Tags: willglas/copilot-sdk
Tags
[maven-release-plugin] copy for tag java/v1.0.0-beta-10-java.5
Expose install_bundled_cli and HAS_BUNDLED_CLI (github#1489) Lift embeddedcli::path() to a stable public surface so health checks, diagnostics, and version probes can reach the bundled CLI without spinning up a Client. Returns the same path Client::start resolves to for CliProgram::Resolve with no COPILOT_CLI_PATH or extract_dir override. Returns None when bundled-cli is off or the target is unsupported (no fallback to the dev-cache path). HAS_BUNDLED_CLI is a const so callers can branch on bundling presence without forcing extraction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose install_bundled_cli and HAS_BUNDLED_CLI (github#1489) Lift embeddedcli::path() to a stable public surface so health checks, diagnostics, and version probes can reach the bundled CLI without spinning up a Client. Returns the same path Client::start resolves to for CliProgram::Resolve with no COPILOT_CLI_PATH or extract_dir override. Returns None when bundled-cli is off or the target is unsupported (no fallback to the dev-cache path). HAS_BUNDLED_CLI is a const so callers can branch on bundling presence without forcing extraction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
[maven-release-plugin] copy for tag java/v1.0.0-beta-10-java.4
[maven-release-plugin] copy for tag java/v1.0.0-beta-10-java.3
[maven-release-plugin] copy for tag java/v1.0.0-beta-10-java.1
Expose install_bundled_cli and HAS_BUNDLED_CLI (github#1489) Lift embeddedcli::path() to a stable public surface so health checks, diagnostics, and version probes can reach the bundled CLI without spinning up a Client. Returns the same path Client::start resolves to for CliProgram::Resolve with no COPILOT_CLI_PATH or extract_dir override. Returns None when bundled-cli is off or the target is unsupported (no fallback to the dev-cache path). HAS_BUNDLED_CLI is a const so callers can branch on bundling presence without forcing extraction. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Refactor Rust SDK errors to use structs with a `kind()` method (githu… …b#1400) * Refactor Rust SDK errors to use structs with a `kind()` method The conventional `#[non_exhaustive] enum Error { ... }` pattern appears safe but creates problems as a library evolves. This PR changes all error types to the struct-with-`kind()` pattern, which also aligns with the Azure SDK for Rust error design. Why not a flat error enum: - `#[non_exhaustive]` on the enum prevents exhaustive matching, but individual variants are still fixed. Adding a field to any variant — even just to improve an error message with a line number or file path — is a breaking change. - Adding context data is harder than it looks. With a flat enum, new fields touch every affected variant and all match arms across the codebase. With a struct, new fields are added in one place and callers who don't use them are unaffected. - A single enum conflates all failure modes, making it impossible to document or guarantee which variants a given function can actually return. Callers must handle unrelated variants they will never see, or accept a wildcard arm that silently swallows future additions. The struct + kind pattern: | Concern | Flat enum | Struct + `kind()` | |---|---|---| | Categorization | Match directly on variant | Call `.kind()` → `&*Kind` | | Adding context | Breaking: add fields to variant | Non-breaking: add fields to struct | | `non_exhaustive` | On enum; variants are fixed | Not needed on struct with only private fields | | Simple display | Must match all variants | `format!("{err}")` — no match needed | Callers who only want to display or propagate an error with `?` do not need to call `.kind()` at all. Only callers who need to inspect the failure category call `.kind()`, and they get a stable, scoped `*Kind` enum to match against. * Remove unnecessary error structs Sticking with `*Kind` as a convention for error enums. * Add backtrace support to Error struct Enhanced the Error struct to include an optional backtrace, which is captured only when `RUST_BACKTRACE` is set. This change helps in debugging by providing context on error occurrences without inflating the Error size unnecessarily. * Resolve PR feedback
Refactor Rust SDK errors to use structs with a `kind()` method (githu… …b#1400) * Refactor Rust SDK errors to use structs with a `kind()` method The conventional `#[non_exhaustive] enum Error { ... }` pattern appears safe but creates problems as a library evolves. This PR changes all error types to the struct-with-`kind()` pattern, which also aligns with the Azure SDK for Rust error design. Why not a flat error enum: - `#[non_exhaustive]` on the enum prevents exhaustive matching, but individual variants are still fixed. Adding a field to any variant — even just to improve an error message with a line number or file path — is a breaking change. - Adding context data is harder than it looks. With a flat enum, new fields touch every affected variant and all match arms across the codebase. With a struct, new fields are added in one place and callers who don't use them are unaffected. - A single enum conflates all failure modes, making it impossible to document or guarantee which variants a given function can actually return. Callers must handle unrelated variants they will never see, or accept a wildcard arm that silently swallows future additions. The struct + kind pattern: | Concern | Flat enum | Struct + `kind()` | |---|---|---| | Categorization | Match directly on variant | Call `.kind()` → `&*Kind` | | Adding context | Breaking: add fields to variant | Non-breaking: add fields to struct | | `non_exhaustive` | On enum; variants are fixed | Not needed on struct with only private fields | | Simple display | Must match all variants | `format!("{err}")` — no match needed | Callers who only want to display or propagate an error with `?` do not need to call `.kind()` at all. Only callers who need to inspect the failure category call `.kind()`, and they get a stable, scoped `*Kind` enum to match against. * Remove unnecessary error structs Sticking with `*Kind` as a convention for error enums. * Add backtrace support to Error struct Enhanced the Error struct to include an optional backtrace, which is captured only when `RUST_BACKTRACE` is set. This change helps in debugging by providing context on error occurrences without inflating the Error size unnecessarily. * Resolve PR feedback
Refactor Rust SDK errors to use structs with a `kind()` method (githu… …b#1400) * Refactor Rust SDK errors to use structs with a `kind()` method The conventional `#[non_exhaustive] enum Error { ... }` pattern appears safe but creates problems as a library evolves. This PR changes all error types to the struct-with-`kind()` pattern, which also aligns with the Azure SDK for Rust error design. Why not a flat error enum: - `#[non_exhaustive]` on the enum prevents exhaustive matching, but individual variants are still fixed. Adding a field to any variant — even just to improve an error message with a line number or file path — is a breaking change. - Adding context data is harder than it looks. With a flat enum, new fields touch every affected variant and all match arms across the codebase. With a struct, new fields are added in one place and callers who don't use them are unaffected. - A single enum conflates all failure modes, making it impossible to document or guarantee which variants a given function can actually return. Callers must handle unrelated variants they will never see, or accept a wildcard arm that silently swallows future additions. The struct + kind pattern: | Concern | Flat enum | Struct + `kind()` | |---|---|---| | Categorization | Match directly on variant | Call `.kind()` → `&*Kind` | | Adding context | Breaking: add fields to variant | Non-breaking: add fields to struct | | `non_exhaustive` | On enum; variants are fixed | Not needed on struct with only private fields | | Simple display | Must match all variants | `format!("{err}")` — no match needed | Callers who only want to display or propagate an error with `?` do not need to call `.kind()` at all. Only callers who need to inspect the failure category call `.kind()`, and they get a stable, scoped `*Kind` enum to match against. * Remove unnecessary error structs Sticking with `*Kind` as a convention for error enums. * Add backtrace support to Error struct Enhanced the Error struct to include an optional backtrace, which is captured only when `RUST_BACKTRACE` is set. This change helps in debugging by providing context on error occurrences without inflating the Error size unnecessarily. * Resolve PR feedback
PreviousNext