defmodule CMDC.MixProject do use Mix.Project @version "0.2.0" @source_url "https://github.com/tuplehq/cmdc" @description "Elixir Agent Kernel — OTP gen_statem 驱动的 AI Agent 开发库" def project do [ app: :cmdc, version: @version, elixir: "~> 1.17", start_permanent: Mix.env() == :prod, deps: deps(), aliases: aliases(), description: @description, package: package(), docs: docs(), source_url: @source_url, homepage_url: @source_url, test_coverage: [tool: ExCoveralls], dialyzer: [ plt_add_apps: [:mix], ignore_warnings: ".dialyzer_ignore.exs" ] ] end def cli do [ preferred_envs: [ coveralls: :test, "coveralls.detail": :test, "coveralls.post": :test, "coveralls.html": :test ] ] end def application do [ extra_applications: [:logger, :crypto], mod: {CMDC.Application, []} ] end defp deps do [ {:req_llm, "~> 1.7"}, {:jason, "~> 1.4"}, {:nimble_options, "~> 1.1"}, {:anubis_mcp, "~> 0.17"}, {:plug, "~> 1.16"}, {:yaml_elixir, "~> 2.11"}, {: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} ] end defp aliases do [ "quality.check": [ "format --check-formatted", "compile --warnings-as-errors", "credo --strict", "test" ] ] end defp package do [ name: "cmdc", description: @description, licenses: ["Apache-2.0"], links: %{ "GitHub" => @source_url, "HexDocs" => "https://hexdocs.pm/cmdc", "Changelog" => "#{@source_url}/blob/main/CHANGELOG.md", "Commercial Licensing" => "#{@source_url}#license" }, maintainers: ["CMDC Team"], files: ~w(lib mix.exs README.md CHANGELOG.md LICENSE llm.txt llms-full.txt) ] end defp docs do [ main: "CMDC", source_ref: "v#{@version}", source_url: @source_url, source_url_pattern: "#{@source_url}/blob/v#{@version}/%{path}#L%{line}", extras: [ "README.md", "CHANGELOG.md": [title: "Changelog"], LICENSE: [title: "License"], "llm.txt": [title: "AI Quick Reference"], "llms-full.txt": [title: "AI Complete Reference"] ], groups_for_modules: [ "公共 API": [CMDC, CMDC.Options, CMDC.Config, CMDC.Context], 核心类型: [CMDC.Message, CMDC.Event, CMDC.EventBus, CMDC.SubAgent], 核心抽象: [CMDC.Plugin, CMDC.Tool, CMDC.Sandbox, CMDC.Skill, CMDC.Blueprint, CMDC.Provider], "Agent Kernel": [ CMDC.Agent, CMDC.Agent.State, CMDC.Agent.Stream, CMDC.Agent.ToolRunner, CMDC.Agent.Emitter, CMDC.Agent.BasePrompt, CMDC.Agent.SystemPrompt, CMDC.Agent.Compactor, CMDC.Agent.Compactor.ArgTruncator ], "内置 Plugin": [ CMDC.Plugin.Builtin.SecurityGuard, CMDC.Plugin.Builtin.EventLogger, CMDC.Plugin.Builtin.HumanApproval, CMDC.Plugin.Builtin.MemoryLoader, CMDC.Plugin.Builtin.PatchToolCalls, CMDC.Plugin.Builtin.PromptCache ], "内置 Tool": [ CMDC.Tool.ReadFile, CMDC.Tool.WriteFile, CMDC.Tool.EditFile, CMDC.Tool.Shell, CMDC.Tool.Grep, CMDC.Tool.ListDir, CMDC.Tool.Glob, CMDC.Tool.Task, CMDC.Tool.WriteTodos, CMDC.Tool.AskUser, CMDC.Tool.CompactConversation ], 集成层: [ CMDC.SessionServer, CMDC.SubAgent.Supervisor, CMDC.MCP.Bridge, CMDC.MCP.Client, CMDC.MCP.Supervisor, CMDC.MCP.Config, CMDC.Memory.ETS, CMDC.Gateway, CMDC.Gateway.Local ] ] ] end end