diff --git a/CHANGELOG.md b/CHANGELOG.md index 76acaca..1d2de6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented in this file. This change ## [Unreleased] +### Added (v0.1.33 sync) +- New event data fields from upstream codegen update (upstream PR #796): + - `session.start` event: `:reasoning-effort`, `:already-in-use?`, `:host-type`, `:head-commit`, `:base-commit` optional fields now in spec + - `session.resume` event: new `::session.resume-data` spec with `:event-count`, `:selected-model`, `:reasoning-effort`, `:already-in-use?`, `:host-type`, `:head-commit`, `:base-commit` + - `session.model_change` event: new `::session.model_change-data` spec with `:new-model`, `:previous-model`, `:reasoning-effort`, `:previous-reasoning-effort` + - `user.message` event: new `:blob` attachment type with `:data` (base64), `:mime-type`, optional `:display-name` + ## [0.1.32.0] - 2026-03-12 ### Added (upstream sync) - Session pre-registration: sessions are now created and registered in client state **before** the RPC call, preventing early events (e.g. `session.start`) from being dropped. Session IDs are generated client-side via `java.util.UUID/randomUUID` when not explicitly provided. On RPC failure, sessions are automatically cleaned up (upstream PR #664). diff --git a/src/github/copilot_sdk/specs.clj b/src/github/copilot_sdk/specs.clj index 20711a7..f320d0d 100644 --- a/src/github/copilot_sdk/specs.clj +++ b/src/github/copilot_sdk/specs.clj @@ -255,7 +255,7 @@ ;; ----------------------------------------------------------------------------- (s/def ::prompt ::non-blank-string) -(s/def ::attachment-type #{:file :directory :selection :github-reference}) +(s/def ::attachment-type #{:file :directory :selection :github-reference :blob}) (s/def ::type ::attachment-type) (s/def ::path ::non-blank-string) (s/def ::file-path ::non-blank-string) @@ -305,10 +305,19 @@ #(string? (:state %)) #(string? (:url %)))) +;; Blob attachment (base64-encoded inline data, received in user.message events) +(s/def ::mime-type string?) +(s/def ::blob-attachment + (s/and map? + #(= :blob (:type %)) + #(string? (:data %)) + #(string? (:mime-type %)))) + (s/def ::attachment (s/or :file-or-directory ::file-or-directory-attachment :selection ::selection-attachment - :github-reference ::github-reference-attachment)) + :github-reference ::github-reference-attachment + :blob ::blob-attachment)) (s/def ::attachments (s/coll-of ::attachment)) (s/def ::mode #{:enqueue :immediate}) @@ -414,9 +423,21 @@ :copilot/external_tool.requested}) ;; Session events +(s/def ::already-in-use? boolean?) +(s/def ::host-type string?) +(s/def ::head-commit string?) +(s/def ::base-commit string?) + (s/def ::session.start-data (s/keys :req-un [::session-id] - :opt-un [::version ::producer ::copilot-version ::start-time ::selected-model])) + :opt-un [::version ::producer ::copilot-version ::start-time ::selected-model + ::reasoning-effort ::already-in-use? ::host-type ::head-commit ::base-commit])) + +(s/def ::event-count nat-int?) +(s/def ::session.resume-data + (s/keys :req-un [::event-count] + :opt-un [::selected-model ::reasoning-effort ::already-in-use? + ::host-type ::head-commit ::base-commit])) (s/def ::session.error-data (s/keys :req-un [::error-type ::message] @@ -493,6 +514,14 @@ (s/keys :req-un [::cwd] :opt-un [::git-root ::repository ::branch])) +;; Session model change event +(s/def ::previous-model (s/nilable string?)) +(s/def ::new-model string?) +(s/def ::previous-reasoning-effort string?) +(s/def ::session.model_change-data + (s/keys :req-un [::new-model] + :opt-un [::previous-model ::previous-reasoning-effort ::reasoning-effort])) + ;; Session mode changed event (s/def ::previous-mode string?) (s/def ::new-mode string?)