Skip to content

Commit f21206e

Browse files
authored
Merge pull request #88 from copilot-community-sdk/upstream-sync/v0.2.2-post
Upstream sync: Port 6 post-v0.2.2 changes
2 parents e3a7037 + 64f6279 commit f21206e

15 files changed

Lines changed: 830 additions & 20 deletions

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. This change
33

44
## [Unreleased]
55

6+
### Added (post-v0.2.2 sync)
7+
- **`convert-mcp-call-tool-result`** — new public function in `tools` namespace that converts MCP `CallToolResult` format into the SDK's `ToolResultObject`. Handles text, image, and resource content types. (upstream PR #1049)
8+
- **`default-join-session-permission-handler`** — new permission handler for `resume-session` that returns `{:kind :no-result}`, signaling the CLI to handle permissions itself. Sends `requestPermission: false` on the wire. (upstream PR #1056)
9+
- **MCP config spec aliases**`::mcp-stdio-server` and `::mcp-http-server` as aliases for `::mcp-local-server` and `::mcp-remote-server` respectively, matching upstream rename from Local→Stdio, Remote→HTTP. Old names kept for backward compatibility. (upstream PR #1051)
10+
- **Per-agent skills field**`::agent-skills` (vector of strings) on `::custom-agent` spec, allowing skill injection per custom agent. (upstream PR #995)
11+
- **Memory permission event specs**`::memory-action`, `::memory-direction`, `::memory-reason` specs for enriched memory permission request events. (CLI 1.0.22, upstream PR #1055)
12+
- **New RPC wrappers** in `session` namespace (all experimental):
13+
- `session-name-get`, `session-name-set!` — get/set session display name (CLI 1.0.26, upstream PR #1076)
14+
- `workspace-get-workspace` — get current workspace metadata (CLI 1.0.26, upstream PR #1076)
15+
- `mcp-discover` — discover MCP servers in a working directory (CLI 1.0.22, upstream PR #1055)
16+
- `usage-get-metrics` — get session usage metrics (CLI 1.0.22, upstream PR #1055)
17+
- Integration tests for all new features (18 tests covering convert-mcp-call-tool-result, spec renames, agent skills, requestPermission behavior, new RPCs, and memory specs)
18+
19+
### Changed (post-v0.2.2 sync)
20+
- **`requestPermission` on resume**`resume-session` now sends `requestPermission: false` when using `default-join-session-permission-handler`, and `true` when using any other handler (e.g., `approve-all`). Previously always sent `true`. (upstream PR #1056)
21+
622
### Added (v0.2.2 sync)
723
- **`enableConfigDiscovery` session option** — new boolean `:enable-config-discovery` on session and resume configs. Auto-discovers `.mcp.json`, `.vscode/mcp.json`, skills, etc. Instruction files are always loaded regardless. (upstream PR #1044)
824
- **`modelCapabilities` override** — new `:model-capabilities` option on session config, resume config, and `switch-model!`/`set-model!`. Pass a partial capabilities map (e.g. `{:model-supports {:supports-vision true}}`) to override model capabilities for the session. (upstream PR #1029)

doc/api/API.html

Lines changed: 224 additions & 4 deletions
Large diffs are not rendered by default.

doc/api/github.copilot-sdk.client.html

Lines changed: 12 additions & 3 deletions
Large diffs are not rendered by default.

doc/api/github.copilot-sdk.html

Lines changed: 3 additions & 1 deletion
Large diffs are not rendered by default.

doc/api/github.copilot-sdk.session.html

Lines changed: 24 additions & 3 deletions
Large diffs are not rendered by default.

doc/api/github.copilot-sdk.tools.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<!DOCTYPE html PUBLIC ""
22
"">
3-
<html><head><meta charset="UTF-8" /><title>github.copilot-sdk.tools documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name"></span> <span class="project-version"></span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="API.html"><div class="inner"><span>API Reference</span></div></a></li><li class="depth-1 "><a href="azure-managed-identity.html"><div class="inner"><span>Azure Managed Identity with BYOK</span></div></a></li><li class="depth-1 "><a href="byok.html"><div class="inner"><span>BYOK (Bring Your Own Key)</span></div></a></li><li class="depth-1 "><a href="custom-agents.html"><div class="inner"><span>Custom Agents &amp; Sub-Agent Orchestration</span></div></a></li><li class="depth-1 "><a href="debugging.html"><div class="inner"><span>MCP Server Debugging Guide</span></div></a></li><li class="depth-1 "><a href="getting-started.html"><div class="inner"><span>Getting Started with the Copilot SDK for Clojure</span></div></a></li><li class="depth-1 "><a href="index.html"><div class="inner"><span>Authentication</span></div></a></li><li class="depth-1 "><a href="index.html"><div class="inner"><span>Documentation</span></div></a></li><li class="depth-1 "><a href="overview.html"><div class="inner"><span>Using MCP Servers with the Copilot SDK for Clojure</span></div></a></li><li class="depth-1 "><a href="style.html"><div class="inner"><span>Documentation Style Guide</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>github</span></div></div></li><li class="depth-2"><a href="github.copilot-sdk.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>copilot-sdk</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.client.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>client</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.helpers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>helpers</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.instrument.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>instrument</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.process.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>process</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.protocol.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>protocol</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-3 branch current"><a href="github.copilot-sdk.tools.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tools</span></div></a></li><li class="depth-3"><a href="github.copilot-sdk.util.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-define-tool"><div class="inner"><span>define-tool</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-define-tool-from-spec"><div class="inner"><span>define-tool-from-spec</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-result-denied"><div class="inner"><span>result-denied</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-result-failure"><div class="inner"><span>result-failure</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-result-rejected"><div class="inner"><span>result-rejected</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-result-success"><div class="inner"><span>result-success</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">github.copilot-sdk.tools</h1><div class="doc"><div class="markdown"><p>Helper functions for defining tools.</p>
4-
</div></div><div class="public anchor" id="var-define-tool"><h3>define-tool</h3><div class="usage"><code>(define-tool name {:keys [description parameters handler overrides-built-in-tool]})</code></div><div class="doc"><div class="markdown"><p>Define a tool with a handler function.</p>
3+
<html><head><meta charset="UTF-8" /><title>github.copilot-sdk.tools documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name"></span> <span class="project-version"></span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="API.html"><div class="inner"><span>API Reference</span></div></a></li><li class="depth-1 "><a href="azure-managed-identity.html"><div class="inner"><span>Azure Managed Identity with BYOK</span></div></a></li><li class="depth-1 "><a href="byok.html"><div class="inner"><span>BYOK (Bring Your Own Key)</span></div></a></li><li class="depth-1 "><a href="custom-agents.html"><div class="inner"><span>Custom Agents &amp; Sub-Agent Orchestration</span></div></a></li><li class="depth-1 "><a href="debugging.html"><div class="inner"><span>MCP Server Debugging Guide</span></div></a></li><li class="depth-1 "><a href="getting-started.html"><div class="inner"><span>Getting Started with the Copilot SDK for Clojure</span></div></a></li><li class="depth-1 "><a href="index.html"><div class="inner"><span>Authentication</span></div></a></li><li class="depth-1 "><a href="index.html"><div class="inner"><span>Documentation</span></div></a></li><li class="depth-1 "><a href="overview.html"><div class="inner"><span>Using MCP Servers with the Copilot SDK for Clojure</span></div></a></li><li class="depth-1 "><a href="style.html"><div class="inner"><span>Documentation Style Guide</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>github</span></div></div></li><li class="depth-2"><a href="github.copilot-sdk.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>copilot-sdk</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.client.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>client</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.helpers.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>helpers</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.instrument.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>instrument</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.logging.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>logging</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.process.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>process</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.protocol.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>protocol</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.session.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>session</span></div></a></li><li class="depth-3 branch"><a href="github.copilot-sdk.specs.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>specs</span></div></a></li><li class="depth-3 branch current"><a href="github.copilot-sdk.tools.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>tools</span></div></a></li><li class="depth-3"><a href="github.copilot-sdk.util.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>util</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-convert-mcp-call-tool-result"><div class="inner"><span>convert-mcp-call-tool-result</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-define-tool"><div class="inner"><span>define-tool</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-define-tool-from-spec"><div class="inner"><span>define-tool-from-spec</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-result-denied"><div class="inner"><span>result-denied</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-result-failure"><div class="inner"><span>result-failure</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-result-rejected"><div class="inner"><span>result-rejected</span></div></a></li><li class="depth-1"><a href="github.copilot-sdk.tools.html#var-result-success"><div class="inner"><span>result-success</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">github.copilot-sdk.tools</h1><div class="doc"><div class="markdown"><p>Helper functions for defining tools.</p>
4+
</div></div><div class="public anchor" id="var-convert-mcp-call-tool-result"><h3>convert-mcp-call-tool-result</h3><div class="usage"><code>(convert-mcp-call-tool-result {:keys [content is-error]})</code></div><div class="doc"><div class="markdown"><p>Convert an MCP CallToolResult into the SDK’s ToolResultObject format.</p>
5+
<p>The input map should have Clojure-idiomatic keys: - :content - vector of content blocks, each with :type and type-specific fields - :is-error - optional boolean, when true the result-type is “failure”</p>
6+
<p>Content block types: - {:type “text” :text “…”} - {:type “image” :data “base64…” :mime-type “image/png”} - {:type “resource” :resource {:uri “…” :text “…” :blob “…” :mime-type “…”}}</p>
7+
<p>Returns a ToolResultObject map with :text-result-for-llm, :result-type, and optionally :binary-results-for-llm.</p>
8+
</div></div></div><div class="public anchor" id="var-define-tool"><h3>define-tool</h3><div class="usage"><code>(define-tool name {:keys [description parameters handler overrides-built-in-tool]})</code></div><div class="doc"><div class="markdown"><p>Define a tool with a handler function.</p>
59
<p>Arguments: - name - Tool name (string) - opts map: - :description - Tool description - :parameters - JSON schema for parameters (or nil) - :handler - Function (fn <a href="args invocation">args invocation</a> -&gt; result) - :overrides-built-in-tool - When true, explicitly overrides a built-in tool of the same name. Without this flag, name clashes with built-in tools cause an error.</p>
610
<p>The handler receives: - args - The parsed arguments from the LLM (no key conversion) - invocation - Map with :session-id, :tool-call-id, :tool-name, :arguments</p>
711
<p>The handler should return one of: - A string (treated as success) - A map with :text-result-for-llm and :result-type - Any other value (JSON-encoded as success) - A core.async channel that will yield one of the above</p>

0 commit comments

Comments
 (0)