Skip to main content

README.md

# apple_intents

Server-side App Intents fulfillment for Elixir — JWS verification, typed handlers, delegation, and approval webhooks.

## Installation

```elixir
def deps do
  [{:apple_intents, "~> 0.1.0"}]
end
```

## Usage

```elixir
defmodule MyApp.PhotoIntent do
  use AppleIntents.Intent, intent: "OrganizePhotos"
  use AppleIntents.Delegated, task: "organize_photos", require_approval: true
end

defmodule MyApp.IntentRouter do
  use AppleIntents.Router

  handlers do
    [MyApp.PhotoIntent]
  end
end
```

```elixir
# Phoenix
post "/apple/intents/fulfill", AppleIntents.Plug, init_opts: [router: MyApp.IntentRouter]
post "/apple/intents/approve", AppleIntents.ApprovalPlug, init_opts: [router: MyApp.IntentRouter]
```

## Optional Jido integration

See [apple_intents_jido](https://hex.pm/packages/apple_intents_jido) for agent orchestration via `Jido.Exec`.

## License

MIT