You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,21 @@ All notable changes to this project will be documented in this file. This change
4
4
## [Unreleased]
5
5
6
6
### Added (v0.2.1 sync)
7
-
-**`steerable` field on `session.start`events** — `session.start`event data now includes optional `:steerable?` boolean field indicating whether the session supports remote steering via Mission Control. New `::steerable?`spec added (upstream PR#927).
7
+
-**`remote-steerable?` field on `session.start`and `session.resume` events** — event data now includes optional `:remote-steerable?` boolean field indicating whether the session supports remote steering via Mission Control. Replaces previous `:steerable?` (upstream PRs#927, #908).
8
8
-**`get-session-metadata`** — new function on client for efficient O(1) session lookup by ID. Returns session metadata map if found, or `nil` if not found. Sends `session.getMetadata` JSON-RPC call. Shared `wire->session-metadata` helper extracted from `list-sessions` to eliminate duplication (upstream PR #899).
9
+
-**Elicitation provider support** — new `:on-elicitation-request` handler on `SessionConfig` and `ResumeSessionConfig`. When provided, sends `requestElicitation: true` in the session create/resume RPC. The runtime routes `elicitation.requested` broadcast events to the handler, and results are sent back via `session.ui.handlePendingElicitation` RPC. Handler errors automatically send a cancel response. New `::elicitation-request` and `::on-elicitation-request` specs (upstream PR #908).
10
+
-**`capabilities.changed` event handling** — session capabilities are dynamically updated when `capabilities.changed` broadcast events are received, e.g. when another client joins with elicitation support (upstream PR #908).
11
+
-**New event types** — `sampling.requested`, `sampling.completed`, `session.remote_steerable_changed`, `capabilities.changed` added to event type enum and event sets (upstream PRs #908, #916).
12
+
-**Subagent event data fields** — `subagent.started`, `subagent.completed`, `subagent.failed` events now include optional `:model`, `:total-tool-calls`, `:total-tokens`, `:duration-ms` fields. New `::subagent.started-data`, `::subagent.completed-data`, `::subagent.failed-data` specs (upstream PR #916).
-**`session.custom_agents_updated` payload spec** — full `::session.custom_agents_updated-data` spec with `:agents` (array of agent metadata), `:warnings`, `:errors`. New `::custom-agent-info` spec (upstream PR #916).
15
+
-**SessionFs virtual filesystem** — new `:session-fs` client option with `:initial-cwd`, `:session-state-path`, `:conventions`. Client calls `sessionFs.setProvider` RPC on connect. New `:create-session-fs-handler` on session config provides a per-session FS handler factory. The SDK dispatches incoming `sessionFs.*` RPC requests (10 operations: `readFile`, `writeFile`, `appendFile`, `exists`, `stat`, `mkdir`, `readdir`, `readdirWithTypes`, `rm`, `rename`) to the session's handler. Enables custom session storage backends (upstream PR #917).
16
+
-**`aborted?` on `session.task_complete`** — optional boolean indicating the preceding agentic loop was cancelled via abort signal. New `::aborted?` spec (upstream PR #917).
17
+
-**`timeout` tool result type** — `::result-type` now accepts `:timeout` / `"timeout"` for tool calls that timed out (upstream PR #970).
18
+
- Integration tests for elicitation provider routing, handler error→cancel fallback, capabilities.changed updates, and requestElicitation wire flag.
9
19
10
20
### Changed (v0.2.1 sync)
21
+
-**BREAKING**: `::steerable?` renamed to `::remote-steerable?` on `session.start` and `session.resume` event data, matching upstream wire field rename from `steerable` to `remoteSteerable` (upstream PR #908).
11
22
-**`session.idle` is now ephemeral** — the runtime no longer persists `session.idle` events in session history. `get-messages` will no longer return `session.idle` events. Live event listeners (used by `send-and-wait!` and `send!`) are unaffected and still receive it (upstream PR #927).
Copy file name to clipboardExpand all lines: doc/reference/API.md
+101-5Lines changed: 101 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,7 @@ Get information about the current shared client state. Returns `nil` if no share
130
130
|`:use-logged-in-user?`| boolean |`true`| Use logged-in user auth. Defaults to `false` when `:github-token` is provided. Cannot be used with `:cli-url`|
131
131
|`:on-list-models`| fn | nil | Zero-arg function returning model info maps. Bypasses `models.list` RPC; does not require `start!`. Results are cached the same way as RPC results |
132
132
|`:is-child-process?`| boolean |`false`| When `true`, connect via own stdio to a parent Copilot CLI process (no process spawning). Requires `:use-stdio?``true`; mutually exclusive with `:cli-url`|
133
+
|`:session-fs`| map | nil | Session filesystem provider config. Keys: `:initial-cwd` (string, required), `:session-state-path` (string, required), `:conventions` (`"windows"` or `"posix"`, required). When set, the client calls `sessionFs.setProvider` on connect and routes filesystem operations through per-session handlers. See [Session Filesystem](#session-filesystem)|
133
134
134
135
### Methods
135
136
@@ -254,6 +255,8 @@ Create a client and session together, ensuring both are cleaned up on exit.
254
255
|`:hooks`| map | Lifecycle hooks (see below) |
255
256
|`:agent`| string | Name of a custom agent to activate at session start. Must match a name in `:custom-agents`. Equivalent to calling `agent.select` after creation. |
256
257
|`:on-event`| fn | Event handler (1-arg fn receiving event maps). Registered before the RPC call, guaranteeing early events like `session.start` are not missed. |
258
+
|`:on-elicitation-request`| fn | Handler for elicitation requests from the agent. When provided, advertises `requestElicitation=true` and handles `elicitation.requested` broadcast events. Receives `(request ctx)` where request has `:message`, `:requested-schema`, `:mode`, `:elicitation-source`, `:url`. Returns an `ElicitationResult` map `{:action "accept"/"decline"/"cancel" :content {...}}`. See [Elicitation Provider](#elicitation-provider)|
259
+
|`:create-session-fs-handler`| fn | Factory for session filesystem handlers. Required when `:session-fs` is set on the client. Called as `(factory session)`, returns a map of FS handler functions. See [Session Filesystem](#session-filesystem)|
257
260
258
261
#### `resume-session`
259
262
@@ -1135,8 +1138,8 @@ Convert an unqualified event keyword to a namespace-qualified `:copilot/` keywor
|`request`| Map with `:message` (string), optional `:requested-schema` (JSON Schema map), `:mode` (`"form"` or `"url"`), `:elicitation-source` (string), `:url` (string) |
1706
+
|`ctx`| Map with `:session-id` (string) |
1707
+
1708
+
Return an `ElicitationResult` map:
1709
+
1710
+
| Key | Type | Description |
1711
+
|-----|------|-------------|
1712
+
|`:action`| string |`"accept"`, `"decline"`, or `"cancel"`|
1713
+
|`:content`| map | Field values when action is `"accept"`|
1714
+
1715
+
If the handler throws, the SDK sends `{:action "cancel"}` to prevent the request from hanging.
1716
+
1717
+
When `:on-elicitation-request` is set, the session advertises `requestElicitation=true` in the create/resume RPC. Capabilities are updated dynamically via `capabilities.changed` events.
1718
+
1719
+
### Session Filesystem
1720
+
1721
+
Virtualize per-session storage with custom filesystem handlers. The runtime routes all session-scoped file I/O (event logs, large outputs, checkpoints) through the provided callbacks.
Demonstrates how to act as an elicitation provider — handling form-based or URL-based input requests from MCP servers and sub-agents.
821
+
822
+
### What It Demonstrates
823
+
824
+
- Registering an `:on-elicitation-request` handler
825
+
- Inspecting elicitation mode (`"form"` vs `"url"`)
826
+
- Auto-filling form fields from a JSON Schema
827
+
- Observing `elicitation.requested` and `capabilities.changed` events
828
+
829
+
### Usage
830
+
831
+
```bash
832
+
clojure -A:examples -X elicitation-provider/run
833
+
```
834
+
835
+
### Code Walkthrough
836
+
837
+
The handler receives a request map with `:message`, optional `:requested-schema` (JSON Schema), `:mode` (`"form"` or `"url"`), `:elicitation-source`, and `:url`. It returns an `ElicitationResult`:
838
+
839
+
```clojure
840
+
{:action"accept";; or "decline" or "cancel"
841
+
:content {:field-name"value"}}
842
+
```
843
+
844
+
If the handler throws, the SDK sends `{:action "cancel"}` to prevent hanging. In a real application, the handler would render a UI dialog or open a browser for OAuth flows.
845
+
846
+
---
847
+
815
848
## Clojure vs JavaScript Comparison
816
849
817
850
Here's how common patterns compare between the Clojure and JavaScript SDKs:
0 commit comments