Skip to content

Commit 07a1f30

Browse files
authored
feat: add skillDirectories and disabledSkills to all SDKs
Expose skill configuration options from CLI server to SDK clients: - skillDirectories: directories to load skills from - disabledSkills: list of skill names to disable Updated SDKs: - Node.js: SessionConfig, ResumeSessionConfig types and client - Go: SessionConfig, ResumeSessionConfig structs and client - .NET: SessionConfig, ResumeSessionConfig classes and client - Python: SessionConfig, ResumeSessionConfig TypedDicts and client
1 parent 24724f7 commit 07a1f30

File tree

11 files changed

+135
-36
lines changed

11 files changed

+135
-36
lines changed

dotnet/src/Client.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,9 @@ public async Task<CopilotSession> CreateSessionAsync(SessionConfig? config = nul
344344
config?.Streaming == true ? true : null,
345345
config?.McpServers,
346346
config?.CustomAgents,
347-
config?.ConfigDir);
347+
config?.ConfigDir,
348+
config?.SkillDirectories,
349+
config?.DisabledSkills);
348350

349351
var response = await connection.Rpc.InvokeWithCancellationAsync<CreateSessionResponse>(
350352
"session.create", [request], cancellationToken);
@@ -399,7 +401,9 @@ public async Task<CopilotSession> ResumeSessionAsync(string sessionId, ResumeSes
399401
config?.OnPermissionRequest != null ? true : null,
400402
config?.Streaming == true ? true : null,
401403
config?.McpServers,
402-
config?.CustomAgents);
404+
config?.CustomAgents,
405+
config?.SkillDirectories,
406+
config?.DisabledSkills);
403407

404408
var response = await connection.Rpc.InvokeWithCancellationAsync<ResumeSessionResponse>(
405409
"session.resume", [request], cancellationToken);
@@ -927,7 +931,9 @@ private record CreateSessionRequest(
927931
bool? Streaming,
928932
Dictionary<string, object>? McpServers,
929933
List<CustomAgentConfig>? CustomAgents,
930-
string? ConfigDir);
934+
string? ConfigDir,
935+
List<string>? SkillDirectories,
936+
List<string>? DisabledSkills);
931937

932938
private record ToolDefinition(
933939
string Name,
@@ -948,7 +954,9 @@ private record ResumeSessionRequest(
948954
bool? RequestPermission,
949955
bool? Streaming,
950956
Dictionary<string, object>? McpServers,
951-
List<CustomAgentConfig>? CustomAgents);
957+
List<CustomAgentConfig>? CustomAgents,
958+
List<string>? SkillDirectories,
959+
List<string>? DisabledSkills);
952960

953961
private record ResumeSessionResponse(
954962
string SessionId);

dotnet/src/Types.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,16 @@ public class SessionConfig
329329
/// Custom agent configurations for the session.
330330
/// </summary>
331331
public List<CustomAgentConfig>? CustomAgents { get; set; }
332+
333+
/// <summary>
334+
/// Directories to load skills from.
335+
/// </summary>
336+
public List<string>? SkillDirectories { get; set; }
337+
338+
/// <summary>
339+
/// List of skill names to disable.
340+
/// </summary>
341+
public List<string>? DisabledSkills { get; set; }
332342
}
333343

334344
public class ResumeSessionConfig
@@ -359,6 +369,16 @@ public class ResumeSessionConfig
359369
/// Custom agent configurations for the session.
360370
/// </summary>
361371
public List<CustomAgentConfig>? CustomAgents { get; set; }
372+
373+
/// <summary>
374+
/// Directories to load skills from.
375+
/// </summary>
376+
public List<string>? SkillDirectories { get; set; }
377+
378+
/// <summary>
379+
/// List of skill names to disable.
380+
/// </summary>
381+
public List<string>? DisabledSkills { get; set; }
362382
}
363383

364384
public class MessageOptions

go/client.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,14 @@ func (c *Client) CreateSession(config *SessionConfig) (*Session, error) {
536536
if config.ConfigDir != "" {
537537
params["configDir"] = config.ConfigDir
538538
}
539+
// Add skill directories configuration
540+
if len(config.SkillDirectories) > 0 {
541+
params["skillDirectories"] = config.SkillDirectories
542+
}
543+
// Add disabled skills configuration
544+
if len(config.DisabledSkills) > 0 {
545+
params["disabledSkills"] = config.DisabledSkills
546+
}
539547
}
540548

541549
result, err := c.client.Request("session.create", params)
@@ -664,6 +672,14 @@ func (c *Client) ResumeSessionWithOptions(sessionID string, config *ResumeSessio
664672
}
665673
params["customAgents"] = customAgents
666674
}
675+
// Add skill directories configuration
676+
if len(config.SkillDirectories) > 0 {
677+
params["skillDirectories"] = config.SkillDirectories
678+
}
679+
// Add disabled skills configuration
680+
if len(config.DisabledSkills) > 0 {
681+
params["disabledSkills"] = config.DisabledSkills
682+
}
667683
}
668684

669685
result, err := c.client.Request("session.resume", params)

go/types.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ type SessionConfig struct {
163163
MCPServers map[string]MCPServerConfig
164164
// CustomAgents configures custom agents for the session
165165
CustomAgents []CustomAgentConfig
166+
// SkillDirectories is a list of directories to load skills from
167+
SkillDirectories []string
168+
// DisabledSkills is a list of skill names to disable
169+
DisabledSkills []string
166170
}
167171

168172
// Tool describes a caller-implemented tool that can be invoked by Copilot
@@ -211,6 +215,10 @@ type ResumeSessionConfig struct {
211215
MCPServers map[string]MCPServerConfig
212216
// CustomAgents configures custom agents for the session
213217
CustomAgents []CustomAgentConfig
218+
// SkillDirectories is a list of directories to load skills from
219+
SkillDirectories []string
220+
// DisabledSkills is a list of skill names to disable
221+
DisabledSkills []string
214222
}
215223

216224
// ProviderConfig configures a custom model provider

justfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ lint-python:
4545
lint-nodejs:
4646
@echo "=== Linting Node.js code ==="
4747
@cd nodejs && npm run format:check && npm run lint && npm run typecheck
48-
@echo "=== Linting Playground ==="
49-
@cd demos/playground && npm run format:check && npm run lint && npm run typecheck
5048

5149
# Lint .NET code
5250
lint-dotnet:

nodejs/package-lock.json

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

nodejs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"author": "GitHub",
4141
"license": "MIT",
4242
"dependencies": {
43-
"@github/copilot": "^0.0.387",
43+
"@github/copilot": "^0.0.388-1",
4444
"vscode-jsonrpc": "^8.2.1",
4545
"zod": "^4.3.5"
4646
},

nodejs/src/client.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,8 @@ export class CopilotClient {
447447
mcpServers: config.mcpServers,
448448
customAgents: config.customAgents,
449449
configDir: config.configDir,
450+
skillDirectories: config.skillDirectories,
451+
disabledSkills: config.disabledSkills,
450452
});
451453

452454
const sessionId = (response as { sessionId: string }).sessionId;
@@ -507,6 +509,8 @@ export class CopilotClient {
507509
streaming: config.streaming,
508510
mcpServers: config.mcpServers,
509511
customAgents: config.customAgents,
512+
skillDirectories: config.skillDirectories,
513+
disabledSkills: config.disabledSkills,
510514
});
511515

512516
const resumedSessionId = (response as { sessionId: string }).sessionId;

nodejs/src/types.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,31 @@ export interface SessionConfig {
384384
* Custom agent configurations for the session.
385385
*/
386386
customAgents?: CustomAgentConfig[];
387+
388+
/**
389+
* Directories to load skills from.
390+
*/
391+
skillDirectories?: string[];
392+
393+
/**
394+
* List of skill names to disable.
395+
*/
396+
disabledSkills?: string[];
387397
}
388398

389399
/**
390400
* Configuration for resuming a session
391401
*/
392402
export type ResumeSessionConfig = Pick<
393403
SessionConfig,
394-
"tools" | "provider" | "streaming" | "onPermissionRequest" | "mcpServers" | "customAgents"
404+
| "tools"
405+
| "provider"
406+
| "streaming"
407+
| "onPermissionRequest"
408+
| "mcpServers"
409+
| "customAgents"
410+
| "skillDirectories"
411+
| "disabledSkills"
395412
>;
396413

397414
/**

python/copilot/client.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,16 @@ async def create_session(self, config: Optional[SessionConfig] = None) -> Copilo
405405
if config_dir:
406406
payload["configDir"] = config_dir
407407

408+
# Add skill directories configuration if provided
409+
skill_directories = cfg.get("skill_directories")
410+
if skill_directories:
411+
payload["skillDirectories"] = skill_directories
412+
413+
# Add disabled skills configuration if provided
414+
disabled_skills = cfg.get("disabled_skills")
415+
if disabled_skills:
416+
payload["disabledSkills"] = disabled_skills
417+
408418
if not self._client:
409419
raise RuntimeError("Client not connected")
410420
response = await self._client.request("session.create", payload)
@@ -498,6 +508,16 @@ async def resume_session(
498508
self._convert_custom_agent_to_wire_format(agent) for agent in custom_agents
499509
]
500510

511+
# Add skill directories configuration if provided
512+
skill_directories = cfg.get("skill_directories")
513+
if skill_directories:
514+
payload["skillDirectories"] = skill_directories
515+
516+
# Add disabled skills configuration if provided
517+
disabled_skills = cfg.get("disabled_skills")
518+
if disabled_skills:
519+
payload["disabledSkills"] = disabled_skills
520+
501521
if not self._client:
502522
raise RuntimeError("Client not connected")
503523
response = await self._client.request("session.resume", payload)

0 commit comments

Comments
 (0)