defmodule CMDCGateway.MixProject do use Mix.Project @version "0.6.0" @source_url "https://github.com/tupleyun/cmdc_gateway" @description "CMDC Gateway — HTTP + SSE + WebSocket 协议网关,接入 CMDC Agent 能力" def project do [ app: :cmdc_gateway, version: @version, elixir: "~> 1.17", start_permanent: Mix.env() == :prod, deps: deps(), description: @description, package: package(), docs: docs(), source_url: @source_url, homepage_url: @source_url, dialyzer: [ plt_add_apps: [:mix], ignore_warnings: ".dialyzer_ignore.exs" ] ] end def application do [ extra_applications: [:logger], mod: {CMDCGateway.Application, []} ] end defp deps do [ cmdc_dep(), {:plug_cowboy, "~> 2.7"}, {:jason, "~> 1.4"}, {:corsica, "~> 2.1"}, {:telemetry, "~> 1.2"}, cmdc_test_dep(), {:ex_doc, "~> 0.35", only: :dev, runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}, {:excoveralls, "~> 0.18", only: :test, runtime: false}, {:benchee, "~> 1.3", only: [:dev, :test], runtime: false} ] end defp cmdc_dep do if File.exists?("../mix.exs") && is_nil(System.get_env("HEX_BUILD")) do {:cmdc, path: "..", env: Mix.env(), override: true} else {:cmdc, "~> 0.6"} end end defp cmdc_test_dep do if File.exists?("../cmdc_test/mix.exs") && is_nil(System.get_env("HEX_BUILD")) do {:cmdc_test, path: "../cmdc_test", only: :test, runtime: false} else {:cmdc_test, "~> 0.3", only: :test, runtime: false} end end defp package do [ name: "cmdc_gateway", description: @description, licenses: ["Apache-2.0"], links: %{ "Repository" => @source_url, "HexDocs" => "https://hexdocs.pm/cmdc_gateway", "CMDC Core" => "https://hex.pm/packages/cmdc", "Changelog" => "#{@source_url}/blob/main/cmdc_gateway/CHANGELOG.md" }, maintainers: ["CMDC Team"], files: ~w(lib mix.exs README.md API.md CHANGELOG.md LICENSE) ] end defp docs do [ main: "CMDCGateway", source_ref: "v#{@version}", source_url: @source_url, extras: [ "README.md", "API.md": [title: "API Reference"], "CHANGELOG.md": [title: "Changelog"], LICENSE: [title: "License"] ], groups_for_modules: [ 路由层: [CMDCGateway.Router], 中间件: [CMDCGateway.Plugs.Auth, CMDCGateway.Plugs.RateLimitPlug], 核心组件: [ CMDCGateway.SessionStore, CMDCGateway.RateLimiter, CMDCGateway.Meter, CMDCGateway.EventTranslator, CMDCGateway.WorkflowEventAdapter, CMDCGateway.WorkflowReplay, CMDCGateway.CallbackTool ], A2A_协议: [ CMDCGateway.AgentCard, CMDCGateway.A2A, CMDCGateway.TaskStore, CMDCGateway.Webhook ], 安全边界: [CMDCGateway.WorkingDirPolicy], 事件流: [CMDCGateway.SSEHandler, CMDCGateway.WSHandler] ] ] end end