/*
 * Copyright 1999-2025 Alibaba Group Holding Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.alibaba.nacos.ai.constant;

/**
 * Nacos AI Server Constants.
 *
 * @author xiweng.yy
 */
public class Constants {
    
    public static final String MCP_PATH = "/ai/mcp";
    
    public static final String MCP_ADMIN_PATH = "/v3/admin" + MCP_PATH;
    
    public static final String MCP_CONSOLE_PATH = "/v3/console" + MCP_PATH;
    
    public static final String MCP_LIST_SEARCH_ACCURATE = "accurate";
    
    public static final String MCP_LIST_SEARCH_BLUR = "blur";
    
    public static final String ALL_PATTERN = com.alibaba.nacos.api.common.Constants.ALL_PATTERN;
    
    public static final String MCP_SERVER_VERSIONS_GROUP = "mcp-server-versions";
    
    public static final String MCP_SERVER_GROUP = "mcp-server";
    
    public static final String MCP_SERVER_TOOL_GROUP = "mcp-tools";
    
    public static final String MCP_SERVER_SPEC_DATA_ID_SUFFIX = "-mcp-server.json";
    
    public static final String MCP_SERVER_VERSION_DATA_ID_SUFFIX = "-mcp-versions.json";
    
    public static final String MCP_SERVER_TOOL_DATA_ID_SUFFIX = "-mcp-tools.json";
    
    public static final String MCP_SERVER_ENDPOINT_GROUP = "mcp-endpoints";
    
    public static final String MCP_SERVER_ENDPOINT_CLUSTER = com.alibaba.nacos.api.common.Constants.DEFAULT_CLUSTER_NAME;
    
    public static final String MCP_BACKEND_INSTANCE_PROTOCOL_KEY = "transportProtocol";

    public static final String MCP_SERVER_ENDPOINT_ADDRESS = "address";
    
    public static final String MCP_SERVER_ENDPOINT_PORT = "port";
    
    public static final String MCP_SERVER_ENDPOINT_METADATA_MARK = "__nacos.ai.mcp.service__";
    
    public static final String MCP_SERVER_CONFIG_MARK = "nacos.internal.config=mcp";
    
    public static final String PROTOCOL_TYPE_HTTP = "http";
    
    public static final String PROTOCOL_TYPE_HTTPS = "https";
    
    public static final String SERVER_EXPORT_PATH_KEY = "exportPath";
    
    public static final String MCP_SERVER_NAME_TAG_KEY_PREFIX = "mcpServerName=";
    
    public static final int MAX_LIST_SIZE = 100;
    
    public static final String RELEASE_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
    
    public static final String CONFIG_TAGS_NAME = "config_tags";
    
    public static final String META_PATH = "path";
    
    public static final String SERVER_VERSION_CONFIG_DATA_ID_TEMPLATE = "%s" + MCP_SERVER_VERSION_DATA_ID_SUFFIX;
    
    public static final String SERVER_SPECIFICATION_CONFIG_DATA_ID_TEMPLATE = "%s-%s" + MCP_SERVER_SPEC_DATA_ID_SUFFIX;
    
    public static final String SERVER_TOOLS_SPEC_CONFIG_DATA_ID_TEMPLATE = "%s-%s" + MCP_SERVER_TOOL_DATA_ID_SUFFIX;
    
    public static class A2A {
        
        public static final String CONSOLE_PATH = "/v3/console/ai/a2a";
        
        public static final String ADMIN_PATH = "/v3/admin/ai/a2a";
        
        public static final String AGENT_GROUP = "agent";
        
        public static final String AGENT_VERSION_GROUP = "agent-version";
        
        public static final String SEARCH_BLUR = "blur";
        
        public static final String SEARCH_ACCURATE = "accurate";
        
        public static final String AGENT_ENDPOINT_GROUP = "agent-endpoints";
        
        public static final String AGENT_ENDPOINT_PATH_KEY = "__nacos.agent.endpoint.path__";
        
        public static final String AGENT_ENDPOINT_TRANSPORT_KEY = "__nacos.agent.endpoint.transport__";
        
        public static final String NACOS_AGENT_ENDPOINT_SUPPORT_TLS = "__nacos.agent.endpoint.supportTls__";
        
        public static final String NACOS_AGENT_ENDPOINT_PROTOCOL_KEY = "__nacos.agent.endpoint.protocol__";
        
        public static final String NACOS_AGENT_ENDPOINT_QUERY_KEY = "__nacos.agent.endpoint.query__";
    }
    
    public static class Skills {
        
        public static final String CONSOLE_PATH = "/v3/console/ai/skills";
        
        public static final String ADMIN_PATH = "/v3/admin/ai/skills";

        public static final String CLIENT_PATH = "/v3/client/ai/skills";
        
        public static final String SKILL_GROUP = "skill";
        
        public static final String SKILL_VERSION_GROUP = "skill-version";
        
        public static final String SEARCH_BLUR = "blur";
        
        public static final String SEARCH_ACCURATE = "accurate";
        
        public static final String SKILL_DEFAULT_NAMESPACE = "public";

        /**
         * Max allowed size for skill zip upload (10MB). Exceeding this will result in a clear error.
         */
        public static final long MAX_UPLOAD_ZIP_BYTES = 10L * 1024 * 1024;
    }
    
    public static class AgentSpecs {
        
        public static final String ADMIN_PATH = "/v3/admin/ai/agentspecs";
        
        public static final String CLIENT_PATH = "/v3/client/ai/agentspecs";
        
        public static final String CONSOLE_PATH = "/v3/console/ai/agentspecs";
        
        public static final String AGENTSPEC_GROUP_PREFIX = "agentspec_";
        
        public static final String RESOURCE_TYPE_AGENTSPEC = "agentspec";
        
        public static final String AGENTSPEC_MAIN_DATA_ID = "manifest.json";
        
        /**
         * Max allowed size for agentspec zip upload (50MB). Exceeding this will result in a clear error.
         */
        public static final long MAX_UPLOAD_ZIP_BYTES = 50L * 1024 * 1024;
        
        public static final String AGENTSPEC_STORAGE_PROVIDER_CONFIG_KEY = "nacos.ai.agentspec.storage.provider";
        
        public static final String SEARCH_BLUR = "blur";
        
        public static final String SEARCH_ACCURATE = "accurate";
        
        public static final String AGENTSPEC_DEFAULT_NAMESPACE = "public";
    }
    
    public static class Pipeline {
        
        public static final String ADMIN_PATH = "/v3/admin/ai/pipelines";
        
        public static final String CONSOLE_PATH = "/v3/console/ai/pipelines";
    }
    
    public static class Prompt {
        
        public static final String CONSOLE_PATH = "/v3/console/ai/prompt";
        
        public static final String ADMIN_PATH = "/v3/admin/ai/prompt";
        
        public static final String CLIENT_PATH = "/v3/client/ai/prompt";
        
        /**
         * Fixed group for all prompt configurations.
         */
        public static final String PROMPT_GROUP = "nacos-ai-prompt";
        
        /**
         * DataId suffix for prompt configurations.
         */
        public static final String PROMPT_DATA_ID_SUFFIX = ".json";
        
        /**
         * DataId suffix for descriptor side prompt metadata.
         */
        public static final String DESCRIPTOR_DATA_ID_SUFFIX = ".descriptor" + PROMPT_DATA_ID_SUFFIX;
        
        /**
         * DataId suffix for runtime label/version mapping.
         */
        public static final String LABEL_VERSION_MAPPING_DATA_ID_SUFFIX = ".label-version-mapping" + PROMPT_DATA_ID_SUFFIX;
        
        /**
         * Key for prompt version in extInfo.
         */
        public static final String EXT_PROMPT_VERSION = "prompt_version";
        
        /**
         * Key for prompt commit message in extInfo.
         */
        public static final String EXT_PROMPT_COMMIT_MSG = "prompt_commit_msg";
        
        /**
         * Search mode: blur search.
         */
        public static final String SEARCH_BLUR = "blur";
        
        /**
         * Search mode: accurate search.
         */
        public static final String SEARCH_ACCURATE = "accurate";
        
        /**
         * Default namespace for prompt.
         */
        public static final String PROMPT_DEFAULT_NAMESPACE = "public";
        
        /**
         * Config type for prompt.
         */
        public static final String PROMPT_CONFIG_TYPE = "json";
        
        /**
         * JSON field: promptKey.
         */
        public static final String FIELD_PROMPT_KEY = "promptKey";
        
        /**
         * JSON field: version.
         */
        public static final String FIELD_VERSION = "version";
        
        /**
         * JSON field: template.
         */
        public static final String FIELD_TEMPLATE = "template";
        
        /**
         * JSON field: commitMsg.
         */
        public static final String FIELD_COMMIT_MSG = "commitMsg";
    }
}
