594
}
595
}
597
>
/**
598
>
* Field descriptors for a single MCP server entry, shared by the stdio and
599
>
* http shapes. The agent-host config schema has no `oneOf`, so both variants'
600
>
* fields are described together; `type` selects which fields apply
601
>
* (`stdio` uses `command`/`args`/`env`/`cwd`, `http` uses `url`/`headers`).
602
>
*/
603
>
const mcpServerConfigProperties: Record<string, SessionConfigPropertySchema> = {
604
>
type: {
605
>
type: 'string',
606
>
title: localize('agentHost.config.mcpServers.type.title', "Server Type"),
607
>
description: localize('agentHost.config.mcpServers.type.description', "The transport used to reach the server: `stdio` for a local command, `http` for a remote endpoint."),
608
>
enum: ['stdio', 'http'],
609
>
},
610
>
command: {
611
>
type: 'string',
612
>
title: localize('agentHost.config.mcpServers.command.title', "Command"),
613
>
description: localize('agentHost.config.mcpServers.command.description', "For `stdio` servers, the executable to spawn."),
614
>
},
615
>
args: {
616
>
type: 'array',
617
>
title: localize('agentHost.config.mcpServers.args.title', "Arguments"),
618
>
description: localize('agentHost.config.mcpServers.args.description', "For `stdio` servers, the arguments passed to the command."),
619
>
items: { type: 'string', title: localize('agentHost.config.mcpServers.arg.title', "Argument") },
620
>
},
621
>
env: {
622
>
type: 'object',
623
>
title: localize('agentHost.config.mcpServers.env.title', "Environment"),
624
>
description: localize('agentHost.config.mcpServers.env.description', "For `stdio` servers, environment variables set on the spawned process."),
625
>
},
626
>
cwd: {
627
>
type: 'string',
628
>
title: localize('agentHost.config.mcpServers.cwd.title', "Working Directory"),
629
>
description: localize('agentHost.config.mcpServers.cwd.description', "For `stdio` servers, the working directory the command runs in."),
630
>
},
631
>
url: {
632
>
type: 'string',
633
>
title: localize('agentHost.config.mcpServers.url.title', "URL"),
634
>
description: localize('agentHost.config.mcpServers.url.description', "For `http` servers, the endpoint URL of the MCP server."),
635
>
},
636
>
headers: {
637
>
type: 'object',
638
>
title: localize('agentHost.config.mcpServers.headers.title', "Headers"),
639
>
description: localize('agentHost.config.mcpServers.headers.description', "For `http` servers, HTTP headers sent with every request."),
640
>
},
641
>
};
642
>
643
>
/**
644
>
* Documents the value shape of the {@link AgentHostMcpServersConfigKey} map.
645
>
*
646
>
* The config value is a map of server name → server config. The schema
647
>
* language has no `additionalProperties`, so the per-entry shape is attached
648
>
* under a placeholder key (`<serverName>`) rather than at the map level —
649
>
* this keeps the field descriptions discoverable without the runtime
650
>
* validator mistaking a real server named e.g. `command` for the `command`
651
>
* field. Real entries (keyed by actual server names) are passed through.
652
>
*/
653
>
const mcpServersValueProperties: Record<string, SessionConfigPropertySchema> = {
654
>
'<serverName>': {
655
>
type: 'object',
656
>
title: localize('agentHost.config.mcpServers.entry.title', "MCP Server"),
657
>
description: localize('agentHost.config.mcpServers.entry.description', "A single MCP server entry. The property key is the server name."),
658
>
properties: mcpServerConfigProperties,
659
>
},
660
>
};
661
>
662
>
export const platformRootSchema = createSchema({
663
>
[SessionConfigKey.Permissions]: permissionsProperty,
664
>
[AgentHostDisableRepoInfoTelemetryConfigKey]: schemaProperty<boolean>({
665
>
type: 'boolean',
666
>
title: localize('agentHost.config.disableRepoInfoTelemetry.title', "Disable Repository Information Telemetry"),
667
>
description: localize('agentHost.config.disableRepoInfoTelemetry.description', "Whether repository information telemetry is disabled for Agent Host sessions."),
668
>
default: false,
669
>
}),
670
>
[AgentHostTelemetryLevelConfigKey]: schemaProperty<TelemetryConfiguration>({
671
>
type: 'string',
672
>
title: localize('agentHost.config.telemetryLevel.title', "Telemetry Level"),
673
>
description: localize('agentHost.config.telemetryLevel.description', "Most restrictive telemetry level requested by connected clients."),
674
>
enum: [TelemetryConfiguration.ON, TelemetryConfiguration.ERROR, TelemetryConfiguration.CRASH, TelemetryConfiguration.OFF],
675
>
default: TelemetryConfiguration.ON,
676
>
}),
677
>
[AgentHostSessionSyncEnabledConfigKey]: schemaProperty<boolean>({
678
>
type: 'boolean',
679
>
title: localize('agentHost.config.sessionSyncEnabled.title', "Session Sync"),
680
>
description: localize('agentHost.config.sessionSyncEnabled.description', "Whether remote session sync is enabled for the copilot-sdk CLI."),
681
>
default: false,
682
>
}),
683
>
[AgentHostCodexEnabledConfigKey]: schemaProperty<boolean>({
684
>
type: 'boolean',
685
>
title: localize('agentHost.config.codexAgentEnabled.title', "Codex Agent"),
686
>
description: localize('agentHost.config.codexAgentEnabled.description', "Whether the Codex provider is enabled."),
687
>
default: false,
688
>
}),
689
>
[AgentHostTerminalAutoApproveEnabledConfigKey]: schemaProperty<boolean>({
690
>
type: 'boolean',
691
>
title: localize('agentHost.config.terminalAutoApproveEnabled.title', "Terminal Auto Approve"),
692
>
description: localize('agentHost.config.terminalAutoApproveEnabled.description', "Whether terminal auto-approve rules forwarded by the connected client are allowed to apply to agent-host shell permission requests."),
693
>
default: true,
694
>
}),
695
>
[AgentHostGlobalAutoApproveEnabledConfigKey]: schemaProperty<boolean>({
696
>
type: 'boolean',
697
>
title: localize('agentHost.config.globalAutoApproveEnabled.title', "Global Auto Approve"),
698
>
description: localize('agentHost.config.globalAutoApproveEnabled.description', "Whether VS Code's global auto-approve setting is enabled. When `true`, every tool call is auto-approved, equivalent to a session using Allow all."),
699
>
default: false,
700
>
}),
701
>
[AgentHostAutoReplyEnabledConfigKey]: schemaProperty<boolean>({
702
>
type: 'boolean',
703
>
title: localize('agentHost.config.autoReplyEnabled.title', "Auto Reply"),
704
>
description: localize('agentHost.config.autoReplyEnabled.description', "Whether VS Code's auto-reply setting is enabled. When `true`, `ask_user` questions are auto-answered instead of blocking on the user, mirroring autopilot mode."),
705
>
default: false,
706
>
}),
707
>
[AgentHostPreferLongContextEnabledConfigKey]: schemaProperty<boolean>({
708
>
type: 'boolean',
709
>
title: localize('agentHost.config.preferLongContextEnabled.title', "Prefer Long Context"),
710
>
description: localize('agentHost.config.preferLongContextEnabled.description', "Whether Copilot Chat's prefer-long-context setting is enabled. When `true`, models with a free long context window only show the long context option in the picker. When `false` (default), the smaller default context option stays selectable."),
711
>
default: false,
712
>
}),
713
>
[AgentHostSystemProxyEnabledConfigKey]: schemaProperty<boolean>({
714
>
type: 'boolean',
715
>
title: localize('agentHost.config.systemProxyEnabled.title', "System Proxy Discovery"),
716
>
description: localize('agentHost.config.systemProxyEnabled.description', "Whether Copilot sessions automatically discover and use the operating system's proxy configuration."),
717
>
default: true,
718
>
}),
719
>
[AgentHostTerminalAutoApproveRulesConfigKey]: schemaProperty<AgentHostTerminalAutoApproveRules>({
720
>
type: 'object',
721
>
title: localize('agentHost.config.terminalAutoApproveRules.title', "Terminal Auto Approve Rules"),
722
>
description: localize('agentHost.config.terminalAutoApproveRules.description', "Terminal auto-approve rules forwarded by the connected client for agent-host shell permission checks."),
723
>
default: {},
724
>
}),
725
>
[AgentHostMcpServersConfigKey]: schemaProperty<AgentHostMcpServers>({
726
>
type: 'object',
727
>
title: localize('agentHost.config.mcpServers.title', "MCP Servers"),
728
>
description: localize('agentHost.config.mcpServers.description', "Agent-host-level MCP servers exposed to every session, keyed by server name. Each value is a server configuration (see `<serverName>`)."),
729
>
properties: mcpServersValueProperties,
730
>
default: {},
731
>
}),
732
>
});