defmodule PromptRunner.MixProject do use Mix.Project @version "0.7.0" @source_url "https://github.com/nshkrdotcom/prompt_runner_sdk" @homepage_url "https://hex.pm/packages/prompt_runner_sdk" @docs_url "https://hexdocs.pm/prompt_runner_sdk" def project do [ app: :prompt_runner_sdk, version: @version, elixir: "~> 1.19", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), escript: escript(), docs: docs(), dialyzer: [plt_add_apps: [:mix]], description: description(), package: package(), name: "PromptRunnerSDK", source_url: @source_url, homepage_url: @homepage_url ] end defp elixirc_paths(:test), do: ["lib", "test/support"] defp elixirc_paths(_), do: ["lib"] def application do [ extra_applications: [:logger, :inets], mod: {PromptRunner.Application, []} ] end defp deps do [ local_dev_or_hex_dep(:agent_session_manager, "~> 0.10.0", "../agent_session_manager"), {:jason, "~> 1.4"}, {:yaml_elixir, "~> 2.11"}, {:mox, "~> 1.1", only: :test}, {:ex_doc, "~> 0.40.0", only: :dev, runtime: false}, {:credo, "~> 1.7", only: [:dev, :test], runtime: false}, {:dialyxir, "~> 1.4", only: :dev, runtime: false} ] ++ local_stack_dev_deps() end defp local_dev_or_hex_dep(app, version, relative_path, opts \\ []) do path = Path.expand(relative_path, __DIR__) if local_workspace_deps?() and File.dir?(path) do {app, version, Keyword.put(opts, :path, relative_path)} else {app, version, opts} end end defp local_stack_dev_deps do if local_workspace_deps?() and File.dir?(Path.expand("../cli_subprocess_core", __DIR__)) do [ {:cli_subprocess_core, path: "../cli_subprocess_core", override: true} ] else [] end end defp local_workspace_deps? do not hex_packaging_task?() and not Enum.member?(Path.split(__DIR__), "deps") end defp hex_packaging_task? do Enum.any?(System.argv(), &(&1 in ["hex.build", "hex.publish", "hex.package"])) end defp description do """ Prompt Runner SDK - packet-first prompt execution for Elixir and CLI workflows with verifier-owned completion, retry, repair, and git-aware repository orchestration. """ end defp escript do [ main_module: PromptRunner.CLI, name: "prompt_runner" ] end defp docs do [ main: "readme", name: "PromptRunnerSDK", source_ref: "v#{@version}", source_url: @source_url, homepage_url: @docs_url, assets: %{"assets" => "assets"}, logo: "assets/prompt_runner_sdk.svg", extras: [ {"README.md", filename: "readme", title: "Prompt Runner SDK"}, "CHANGELOG.md", "LICENSE", {"guides/getting-started.md", filename: "getting-started", title: "Getting Started"}, {"guides/from-adrs-to-packets.md", filename: "from-adrs-to-packets", title: "From ADRs To Packets"}, {"guides/cli.md", filename: "cli", title: "CLI Guide"}, {"guides/api.md", filename: "api", title: "API Guide"}, {"guides/configuration.md", filename: "configuration", title: "Packet Manifest Reference"}, {"guides/templates.md", filename: "templates", title: "Templates"}, {"guides/profiles.md", filename: "profiles", title: "Profiles"}, {"guides/providers.md", filename: "providers", title: "Provider Guide"}, {"guides/simulated-provider.md", filename: "simulated-provider", title: "Simulated Provider"}, {"guides/verification-and-repair.md", filename: "verification-and-repair", title: "Verification And Repair"}, {"guides/rendering.md", filename: "rendering", title: "Rendering Modes"}, {"guides/multi-repo.md", filename: "multi-repo", title: "Multi-Repository Packets"}, {"guides/architecture.md", filename: "architecture", title: "Architecture"}, {"examples/README.md", filename: "examples", title: "Examples Overview"}, {"examples/authoring_packet/README.md", filename: "example-authoring", title: "Authoring From ADRs Packet Example"}, {"examples/single_repo_packet/README.md", filename: "example-single-repo", title: "Single Repo Packet Example"}, {"examples/simulated_recovery_packet/README.md", filename: "example-simulated-recovery", title: "Simulated Recovery Packet Example"}, {"examples/multi_repo_packet/README.md", filename: "example-multi-repo", title: "Multi-Repo Packet Example"} ], groups_for_extras: [ Overview: ["readme", "getting-started", "from-adrs-to-packets"], Authoring: ["cli", "configuration", "templates", "profiles", "multi-repo"], Configuration: [ "configuration", "providers", "simulated-provider", "verification-and-repair", "rendering" ], Embedding: ["api"], Architecture: ["architecture"], Examples: [ "examples", "example-authoring", "example-single-repo", "example-simulated-recovery", "example-multi-repo" ], Reference: [ "CHANGELOG.md", "LICENSE" ] ], groups_for_modules: [ "Core API": [ PromptRunner, PromptRunner.Packet, PromptRunner.Packets, PromptRunner.Profile, PromptRunner.Verifier, PromptRunner.RecoveryConfig, PromptRunner.FailureEnvelope, PromptRunner.RecoveryPolicy, PromptRunner.Runtime, PromptRunner.Run, PromptRunner.RunSpec, PromptRunner.Plan, PromptRunner.Preflight, PromptRunner.Application, PromptRunner.CLI, Mix.Tasks.PromptRunner ], Sources: [ PromptRunner.Source, PromptRunner.Source.Result, PromptRunner.Source.PacketSource, PromptRunner.Source.DirectorySource, PromptRunner.Source.ListSource, PromptRunner.Source.SinglePromptSource ], Runtime: [ PromptRunner.Runner, PromptRunner.SimulatedLLM, PromptRunner.RuntimeStore, PromptRunner.RuntimeStore.FileStore, PromptRunner.RuntimeStore.MemoryStore, PromptRunner.RuntimeStore.NoopStore, PromptRunner.Committer, PromptRunner.Committer.GitCommitter, PromptRunner.Committer.NoopCommitter, PromptRunner.Committer.CallbackCommitter ], Configuration: [ PromptRunner.Config, PromptRunner.Prompt, PromptRunner.FrontMatter, PromptRunner.Paths, PromptRunner.Template, PromptRunner.PermissionMode, PromptRunner.ProviderOptions ], "LLM Integration": [ PromptRunner.LLM, PromptRunner.LLMFacade, PromptRunner.Session ], Observability: [ PromptRunner.Observer.PubSub, PromptRunner.UI ], Compatibility: [ PromptRunner.Source.LegacyConfigSource, PromptRunner.Prompts, PromptRunner.CommitMessages, PromptRunner.Progress, PromptRunner.Scaffold, PromptRunner.Validator, PromptRunner.RepoTargets, PromptRunner.Git ] ] ] end defp package do [ name: "prompt_runner_sdk", description: description(), files: ~w( lib guides assets mix.exs README.md CHANGELOG.md LICENSE run_prompts.exs examples/README.md examples/*_packet/README.md examples/*_packet/setup.sh examples/*_packet/cleanup.sh examples/*_packet/prompt_runner_packet.md examples/*_packet/prompts/*.prompt.md examples/*_packet/prompts/*.checklist.md examples/authoring_packet/docs/*.md examples/authoring_packet/templates/*.md ), licenses: ["MIT"], links: %{ "Changelog" => "#{@source_url}/blob/main/CHANGELOG.md", "GitHub" => @source_url, "Hex" => @homepage_url, "HexDocs" => @docs_url, "License" => "#{@source_url}/blob/main/LICENSE" }, maintainers: ["nshkrdotcom"] ] end end