Files
vscode/build/lib/policies/policyData.jsonc
Josh Spicer fcbabe4c73 Merge extension-provided policy (#306874)
* Add merge script for extension configuration policies from distro

Adds build/lib/policies/mergeExtensionPolicies.ts which fetches the
distro's product.json (at the commit pinned in package.json) and merges
extensionConfigurationPolicy entries into policyData.jsonc.

The --export-policy-data step only captures policies from the OSS
configuration registry. Extension policies (e.g., Copilot settings)
are defined in vscode-distro's product.json and are not available in
the OSS dev build. This merge script bridges that gap.

Workflow: ./scripts/code.sh --export-policy-data && node build/lib/policies/mergeExtensionPolicies.ts

Also updates:
- policyExport integration test to run the merge step
- add-policy skill documentation with extension policy lifecycle

* Simplify extension policy format: drop localization block from distro

- mergeExtensionPolicies.ts now reads only description/category from
  the distro and synthesizes localization key/value pairs internally
- Integration test gracefully skips merge step when distro is unavailable
- Updated SKILL.md to document the simplified distro format

* docs: use gh auth token in policy export command

* Handle old distro format missing description/category fields

* docs: add troubleshooting section for merge step in policy skill

* Require description and category fields in extension policy entries

* Add extension configuration policies to policyData.jsonc

* Address PR feedback: fix disclaimer, log targetPath, strip GITHUB_TOKEN from test

* fix: revert extension policies from policyData.jsonc, remove console.log from test

Extension policies should only be added after the distro PR merges.
Test runner disallows console output in tests.

* Add mock distro test for mergeExtensionPolicies, remove merge from export test

- mergeExtensionPolicies.ts: add DISTRO_PRODUCT_JSON env var to
  override the distro path (for testing without private repo access)
- New test: creates a mock product.json, runs the merge script,
  verifies policies are added correctly and idempotently
- Export test: no longer runs the merge step (avoids needing
  distro access or GITHUB_TOKEN in CI)

* Update distro and regenerate policyData.jsonc with extension policies

* Fix CI: add extension policy fixture for export test

The export test now runs mergeExtensionPolicies using a checked-in
fixture file instead of requiring distro access or GITHUB_TOKEN.
When extension policies change in the distro, regenerate both
policyData.jsonc and the fixture file.

* Integrate extension policy merge into --export-policy-data

- Removed mergeExtensionPolicies.ts — no separate CLI tool needed
- --export-policy-data now reads build/lib/policies/extensionPolicies.json
  and merges extension policies into the output automatically
- Single command workflow: ./scripts/code.sh --export-policy-data
- Simplified test — no merge step, no GITHUB_TOKEN, no distro access
- Updated SKILL.md to document the simplified workflow

* Dynamic distro reading: --export-policy-data fetches from distro directly

- policyExport.contribution.ts reads distro product.json dynamically:
  1. DISTRO_PRODUCT_JSON env var (for testing)
  2. .build/distro/mixin/stable/product.json (local checkout)
  3. GitHub API with GITHUB_TOKEN (remote fetch)
- New scripts/export-policy-data.sh wrapper: sets up GITHUB_TOKEN
  via gh CLI and runs the export
- Deleted build/lib/policies/extensionPolicies.json (no static copy)
- Test uses DISTRO_PRODUCT_JSON with a fixture file
- Uses sandbox process.env and VSBuffer (renderer-safe)

* Replace bash wrapper with cross-platform TS script

- New build/lib/policies/exportPolicyData.ts: handles transpilation,
  GITHUB_TOKEN setup via gh CLI, and runs --export-policy-data
- Added 'npm run export-policy-data' script to package.json
- Removed scripts/export-policy-data.sh
- Updated SKILL.md and test error message

* Use OAuth device flow for GitHub token acquisition

exportPolicyData.ts now acquires tokens via:
1. GITHUB_TOKEN env var (if set)
2. gh CLI (fast, non-interactive)
3. GitHub OAuth device flow (interactive, no dependencies)

Based on vscode-copilot-chat's getToken.mts pattern.

* Fix error messages to reference npm run export-policy-data

* Fix disclaimer to reference npm run export-policy-data, clean up stale refs

* Clarify test fixture is static and not expected to track distro changes

* Add inline comment in test clarifying fixture is static

* SKILL.md: add step to update distro commit hash in package.json

* Remove inline comment per PR feedback

* Remove local .build/distro/ fallback path per PR feedback
2026-04-01 00:07:47 +00:00

376 lines
14 KiB
JSON

/** THIS FILE IS AUTOMATICALLY GENERATED USING `npm run export-policy-data`. DO NOT MODIFY IT MANUALLY. **/
{
"categories": [
{
"key": "Extensions",
"name": {
"key": "extensionsConfigurationTitle",
"value": "Extensions"
}
},
{
"key": "IntegratedTerminal",
"name": {
"key": "terminalIntegratedConfigurationTitle",
"value": "Integrated Terminal"
}
},
{
"key": "InteractiveSession",
"name": {
"key": "interactiveSessionConfigurationTitle",
"value": "Chat"
}
},
{
"key": "Telemetry",
"name": {
"key": "telemetryConfigurationTitle",
"value": "Telemetry"
}
},
{
"key": "Update",
"name": {
"key": "updateConfigurationTitle",
"value": "Update"
}
}
],
"policies": [
{
"key": "extensions.gallery.serviceUrl",
"name": "ExtensionGalleryServiceUrl",
"category": "Extensions",
"minimumVersion": "1.99",
"localization": {
"description": {
"key": "extensions.gallery.serviceUrl",
"value": "Configure the Marketplace service URL to connect to"
}
},
"type": "string",
"default": ""
},
{
"key": "chat.mcp.gallery.serviceUrl",
"name": "McpGalleryServiceUrl",
"category": "InteractiveSession",
"minimumVersion": "1.101",
"localization": {
"description": {
"key": "mcp.gallery.serviceUrl",
"value": "Configure the MCP Gallery service URL to connect to"
}
},
"type": "string",
"default": ""
},
{
"key": "extensions.allowed",
"name": "AllowedExtensions",
"category": "Extensions",
"minimumVersion": "1.96",
"localization": {
"description": {
"key": "extensions.allowed.policy",
"value": "Specify a list of extensions that are allowed to use. This helps maintain a secure and consistent development environment by restricting the use of unauthorized extensions. More information: https://aka.ms/vscode/enterprise/extensions/allowed"
}
},
"type": "object",
"default": "*"
},
{
"key": "chat.tools.global.autoApprove",
"name": "ChatToolsAutoApprove",
"category": "InteractiveSession",
"minimumVersion": "1.99",
"localization": {
"description": {
"key": "autoApprove3.description",
"value": "Global auto approve also known as \"YOLO mode\" disables manual approval completely for all tools in all workspaces, allowing the agent to act fully autonomously. This is extremely dangerous and is *never* recommended, even containerized environments like Codespaces and Dev Containers have user keys forwarded into the container that could be compromised.\n\nThis feature disables critical security protections and makes it much easier for an attacker to compromise the machine.\n\nNote: This setting only controls tool approval and does not prevent the agent from asking questions. To automatically answer agent questions, use the `#chat.autoReply#` setting."
}
},
"type": "boolean",
"default": false
},
{
"key": "chat.tools.eligibleForAutoApproval",
"name": "ChatToolsEligibleForAutoApproval",
"category": "InteractiveSession",
"minimumVersion": "1.107",
"localization": {
"description": {
"key": "chat.tools.eligibleForAutoApproval",
"value": "Controls which tools are eligible for automatic approval. Tools set to 'false' will always present a confirmation and will never offer the option to auto-approve. The default behavior (or setting a tool to 'true') may result in the tool offering auto-approval options."
}
},
"type": "object",
"default": {}
},
{
"key": "chat.mcp.access",
"name": "ChatMCP",
"category": "InteractiveSession",
"minimumVersion": "1.99",
"localization": {
"description": {
"key": "chat.mcp.access",
"value": "Controls access to installed Model Context Protocol servers."
},
"enumDescriptions": [
{
"key": "chat.mcp.access.none",
"value": "No access to MCP servers."
},
{
"key": "chat.mcp.access.registry",
"value": "Allows access to MCP servers installed from the registry that VS Code is connected to."
},
{
"key": "chat.mcp.access.any",
"value": "Allow access to any installed MCP server."
}
]
},
"type": "string",
"default": "all",
"enum": [
"none",
"registry",
"all"
]
},
{
"key": "chat.extensionTools.enabled",
"name": "ChatAgentExtensionTools",
"category": "InteractiveSession",
"minimumVersion": "1.99",
"localization": {
"description": {
"key": "chat.extensionToolsEnabled",
"value": "Enable using tools contributed by third-party extensions."
}
},
"type": "boolean",
"default": true
},
{
"key": "chat.agent.enabled",
"name": "ChatAgentMode",
"category": "InteractiveSession",
"minimumVersion": "1.99",
"localization": {
"description": {
"key": "chat.agent.enabled.description",
"value": "When enabled, agent mode can be activated from chat and tools in agentic contexts with side effects can be used."
}
},
"type": "boolean",
"default": true
},
{
"key": "chat.editMode.hidden",
"name": "DeprecatedEditModeHidden",
"category": "InteractiveSession",
"minimumVersion": "1.112",
"localization": {
"description": {
"key": "chat.editMode.hidden",
"value": "When enabled, hides the Edit mode from the chat mode picker."
}
},
"type": "boolean",
"default": true
},
{
"key": "chat.useHooks",
"name": "ChatHooks",
"category": "InteractiveSession",
"minimumVersion": "1.109",
"localization": {
"description": {
"key": "chat.useHooks.description",
"value": "Controls whether chat hooks are executed at strategic points during an agent's workflow. Hooks are loaded from the files configured in `#chat.hookFilesLocations#`."
}
},
"type": "boolean",
"default": true
},
{
"key": "chat.tools.terminal.enableAutoApprove",
"name": "ChatToolsTerminalEnableAutoApprove",
"category": "IntegratedTerminal",
"minimumVersion": "1.104",
"localization": {
"description": {
"key": "autoApproveMode.description",
"value": "Controls whether to allow auto approval in the run in terminal tool."
}
},
"type": "boolean",
"default": true
},
{
"key": "update.mode",
"name": "UpdateMode",
"category": "Update",
"minimumVersion": "1.67",
"localization": {
"description": {
"key": "updateMode",
"value": "Configure whether you receive automatic updates. Requires a restart after change. The updates are fetched from a Microsoft online service."
},
"enumDescriptions": [
{
"key": "none",
"value": "Disable updates."
},
{
"key": "manual",
"value": "Disable automatic background update checks. Updates will be available if you manually check for updates."
},
{
"key": "start",
"value": "Check for updates only on startup. Disable automatic background update checks."
},
{
"key": "default",
"value": "Enable automatic update checks. Code will check for updates automatically and periodically."
}
]
},
"type": "string",
"default": "default",
"enum": [
"none",
"manual",
"start",
"default"
]
},
{
"key": "telemetry.telemetryLevel",
"name": "TelemetryLevel",
"category": "Telemetry",
"minimumVersion": "1.99",
"localization": {
"description": {
"key": "telemetry.telemetryLevel.policyDescription",
"value": "Controls the level of telemetry."
},
"enumDescriptions": [
{
"key": "telemetry.telemetryLevel.default",
"value": "Sends usage data, errors, and crash reports."
},
{
"key": "telemetry.telemetryLevel.error",
"value": "Sends general error telemetry and crash reports."
},
{
"key": "telemetry.telemetryLevel.crash",
"value": "Sends OS level crash reports."
},
{
"key": "telemetry.telemetryLevel.off",
"value": "Disables all product telemetry."
}
]
},
"type": "string",
"default": "all",
"enum": [
"all",
"error",
"crash",
"off"
]
},
{
"key": "telemetry.feedback.enabled",
"name": "EnableFeedback",
"category": "Telemetry",
"minimumVersion": "1.99",
"localization": {
"description": {
"key": "telemetry.feedback.enabled",
"value": "Enable feedback mechanisms such as the issue reporter, surveys, and other feedback options."
}
},
"type": "boolean",
"default": true
},
{
"key": "workbench.browser.enableChatTools",
"name": "BrowserChatTools",
"category": "InteractiveSession",
"minimumVersion": "1.110",
"localization": {
"description": {
"key": "browser.enableChatTools",
"value": "When enabled, chat agents can use browser tools to open and interact with pages in the Integrated Browser."
}
},
"type": "boolean",
"default": false
},
{
"key": "github.copilot.nextEditSuggestions.enabled",
"name": "CopilotNextEditSuggestions",
"category": "InteractiveSession",
"minimumVersion": "1.99",
"localization": {
"description": {
"key": "github.copilot.nextEditSuggestions.enabled",
"value": "Whether to enable next edit suggestions (NES). NES can propose a next edit based on your recent changes."
}
},
"type": "boolean",
"default": true
},
{
"key": "github.copilot.chat.reviewSelection.enabled",
"name": "CopilotReviewSelection",
"category": "InteractiveSession",
"minimumVersion": "1.104",
"localization": {
"description": {
"key": "github.copilot.chat.reviewSelection.enabled",
"value": "Enables code review on current selection."
}
},
"type": "boolean",
"default": true
},
{
"key": "github.copilot.chat.reviewAgent.enabled",
"name": "CopilotReviewAgent",
"category": "InteractiveSession",
"minimumVersion": "1.104",
"localization": {
"description": {
"key": "github.copilot.chat.reviewAgent.enabled",
"value": "Enables the code review agent."
}
},
"type": "boolean",
"default": true
},
{
"key": "github.copilot.chat.claudeAgent.enabled",
"name": "Claude3PIntegration",
"category": "InteractiveSession",
"minimumVersion": "1.113",
"localization": {
"description": {
"key": "github.copilot.chat.claudeAgent.enabled",
"value": "Enable Claude Agent sessions in VS Code. Start and resume agentic coding sessions powered by Anthropic Claude Agent SDK directly in the editor. Uses your existing Copilot subscription."
}
},
"type": "boolean",
"default": true
}
]
}