/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ /** * Shared definition of the Copilot "policy" endpoints that * `DefaultAccountService` (src/vs/workbench/services/accounts/browser/defaultAccount.ts) * calls, together with sample response bodies. This is the single source of * truth shared by the Node server (route table + default state) and the browser * GUI (endpoint tabs + preset dropdown), exported UMD-style so it loads in both * environments without a build step. * * For the default (github.com) provider these URLs are read verbatim from * `product.json` -> `defaultChatAgent.`, so pointing all of them at * a local server via `product.overrides.json` lets a dev exercise the whole * policy pipeline offline. * * NOTE: The server uses `module.stripTypeScriptTypes()` to serve this file to * the browser as plain JavaScript — no build step is needed. */ export interface EndpointPreset { id: string; label: string; description: string; body: unknown; } export interface EndpointDef { /** Stable id used by the API + GUI. */ id: string; /** Human label for the GUI tab. */ label: string; /** URL path the server serves / Code OSS calls. */ path: string; /** Key under product.json `defaultChatAgent`. */ productKey: string; /** One-line summary for the GUI. */ description: string; /** First preset is used as the default body. */ presets: EndpointPreset[]; } /* eslint-disable-next-line no-var -- UMD global for browser