|
240 | 240 | ;; ----------------------------------------------------------------------------- |
241 | 241 |
|
242 | 242 | (s/def ::prompt ::non-blank-string) |
243 | | -(s/def ::attachment-type #{:file :directory :selection}) |
| 243 | +(s/def ::attachment-type #{:file :directory :selection :github-reference}) |
244 | 244 | (s/def ::type ::attachment-type) |
245 | 245 | (s/def ::path ::non-blank-string) |
246 | 246 | (s/def ::file-path ::non-blank-string) |
|
274 | 274 | :opt-un [::selection-range ::text]) |
275 | 275 | #(= :selection (:type %)))) |
276 | 276 |
|
| 277 | +;; GitHub reference attachment (issue, PR, or discussion) |
| 278 | +;; Note: ::state is already defined as (instance? Atom) for the client record, |
| 279 | +;; so we cannot use s/keys here — manual predicates validate the :state field instead. |
| 280 | +(s/def ::number nat-int?) |
| 281 | +(s/def ::reference-type #{"issue" "pr" "discussion"}) |
| 282 | +(s/def ::url string?) |
| 283 | +(s/def ::attachment-state string?) |
| 284 | +(s/def ::github-reference-attachment |
| 285 | + (s/and map? |
| 286 | + #(= :github-reference (:type %)) |
| 287 | + #(nat-int? (:number %)) |
| 288 | + #(string? (:title %)) |
| 289 | + #(contains? #{"issue" "pr" "discussion"} (:reference-type %)) |
| 290 | + #(string? (:state %)) |
| 291 | + #(string? (:url %)))) |
| 292 | + |
277 | 293 | (s/def ::attachment |
278 | 294 | (s/or :file-or-directory ::file-or-directory-attachment |
279 | | - :selection ::selection-attachment)) |
| 295 | + :selection ::selection-attachment |
| 296 | + :github-reference ::github-reference-attachment)) |
280 | 297 |
|
281 | 298 | (s/def ::attachments (s/coll-of ::attachment)) |
282 | 299 | (s/def ::mode #{:enqueue :immediate}) |
|
365 | 382 | :copilot/tool.user_requested :copilot/tool.execution_start :copilot/tool.execution_partial_result |
366 | 383 | :copilot/tool.execution_progress :copilot/tool.execution_complete |
367 | 384 | :copilot/subagent.started :copilot/subagent.completed :copilot/subagent.failed :copilot/subagent.selected |
| 385 | + :copilot/subagent.deselected |
368 | 386 | :copilot/skill.invoked |
369 | 387 | :copilot/hook.start :copilot/hook.end |
370 | 388 | :copilot/system.message}) |
|
381 | 399 | (s/def ::session.idle-data map?) |
382 | 400 |
|
383 | 401 | (s/def ::agent-mode #{:interactive :plan :autopilot :shell}) |
| 402 | +(s/def ::interaction-id string?) |
384 | 403 |
|
385 | 404 | (s/def ::user.message-data |
386 | 405 | (s/keys :req-un [::content] |
387 | | - :opt-un [::transformed-content ::attachments ::source ::agent-mode])) |
| 406 | + :opt-un [::transformed-content ::attachments ::source ::agent-mode ::interaction-id])) |
388 | 407 |
|
389 | 408 | (s/def ::assistant.message-data |
390 | 409 | (s/keys :req-un [::message-id ::content] |
391 | 410 | :opt-un [::tool-requests ::parent-tool-call-id])) |
392 | 411 |
|
393 | 412 | (s/def ::total-response-size-bytes nat-int?) |
| 413 | +(s/def ::turn-id ::non-blank-string) |
| 414 | + |
| 415 | +(s/def ::assistant.turn_start-data |
| 416 | + (s/keys :req-un [::turn-id] |
| 417 | + :opt-un [::interaction-id])) |
394 | 418 |
|
395 | 419 | (s/def ::assistant.message_delta-data |
396 | 420 | (s/keys :req-un [::message-id ::delta-content] |
397 | | - :opt-un [::parent-tool-call-id])) |
| 421 | + :opt-un [::parent-tool-call-id ::interaction-id])) |
398 | 422 |
|
399 | 423 | (s/def ::assistant.streaming_delta-data |
400 | 424 | (s/keys :req-un [::total-response-size-bytes])) |
|
410 | 434 |
|
411 | 435 | (s/def ::tool.execution_complete-data |
412 | 436 | (s/keys :req-un [::tool-call-id ::success?] |
413 | | - :opt-un [::is-user-requested? ::result ::error ::tool-telemetry ::parent-tool-call-id])) |
| 437 | + :opt-un [::is-user-requested? ::result ::error ::tool-telemetry ::parent-tool-call-id |
| 438 | + ::model ::interaction-id])) |
414 | 439 |
|
415 | 440 | ;; Session shutdown event |
416 | 441 | (s/def ::shutdown-type #{"routine" "error"}) |
|
465 | 490 |
|
466 | 491 | ;; Skill invoked event |
467 | 492 | (s/def ::allowed-tools (s/coll-of string?)) |
| 493 | +(s/def ::plugin-name string?) |
| 494 | +(s/def ::plugin-version string?) |
468 | 495 |
|
469 | 496 | (s/def ::skill.invoked-data |
470 | 497 | (s/keys :req-un [::name ::path ::content] |
471 | | - :opt-un [::allowed-tools])) |
| 498 | + :opt-un [::allowed-tools ::plugin-name ::plugin-version])) |
472 | 499 |
|
473 | 500 | ;; Generic session event |
474 | 501 | (s/def ::session-event |
|
641 | 668 | ;; Session model operations (session.model.getCurrent / switchTo) |
642 | 669 | ;; ----------------------------------------------------------------------------- |
643 | 670 |
|
| 671 | +(s/def ::model string?) |
644 | 672 | (s/def ::model-id (s/nilable string?)) |
0 commit comments