PiDurableKit runs durable AI agents on iPhone, Mac and Vision Pro
PiDurableKit is a Swift package that puts durable AI agents inside an iOS, macOS, tvOS or visionOS app; it bundles earendil's pi-durable runtime in JavaScriptCore, writes every model turn and tool call to SQLite before the user sees it, and picked up 210 stars in the three days since its first push on 8 October 2026.
Image: GitHub
Why it mattersAn iOS app whose main view is a long-running AI conversation has one quiet failure that is hard to design around: the system reclaims memory, the app comes back, and the half-finished model turn is gone. A kit that commits work to disk before anything renders removes that case.
A new Swift package called PiDurableKit, from the developer finnvoor, puts the full pi-durable agent runtime inside an iOS or macOS app and gives Swift code a native API over it. The README's one-line description is "Durable AI agents for iPhone, iPad, Mac, and Vision Pro, powered by @earendil-works/pi-durable." The repository was pushed on 8 October 2026 and had 210 stars three days later, under a CC0 1.0 public-domain dedication for the Swift code; the bundled JavaScript carries MIT, Apache-2.0, BSD-3-Clause and Unlicense terms.
The piece pi-durable solves is the one iOS developers meet first when they try to run an AI conversation inside an app. A model turn can take fifteen seconds. A tool call can take longer. iOS can reclaim the app at any point in that window, and when it comes back the user wants the half-finished turn to resume rather than restart. pi-durable, released by earendil on 2 October 2026, writes the state of a conversation to storage before the next step runs, so a crash or a kill reads back the same state and keeps going. PiDurableKit is the Swift wrapper that makes that machinery usable from a native app.
What lives on which side
The JavaScript runtime runs inside JavaScriptCore, the engine Apple ships with the operating system. The Swift side handles everything a browser or Node runtime would otherwise do: URLSession for network calls, SQLite for the persistent store, cryptography, timers, and the OAuth redirect round-trip for signing a user in. Storage is SQLite or JSONL on disk with crash recovery, or an in-memory variant for tests, and the README states that "conversations, model turns, tool calls, and your own state are committed to storage before anything is shown."
A matching concurrency change goes with it. Where pi-durable upstream uses its own Chord context to cancel in-flight work, PiDurableKit uses Swift concurrency: cancelling the Swift task cancels the wait, and the work itself continues to completion so a cancelled view does not leave half-written state behind. The README gives one working example built around a Harness.open() call that submits a prompt against .anthropic("claude-sonnet-4-5") and awaits the result; a developer swaps in any provider pi-ai supports or any OpenAI- or Anthropic-compatible server.
Which Apple platforms
Minimum deployment targets are iOS 17, macOS 14, tvOS 17 and visionOS 1. Supported providers through pi-ai cover Anthropic, OpenAI, Google, OpenRouter, Groq, xAI and Mistral by name, with the open escape hatch for anything speaking either API. Custom Swift tools, system prompts and hooks are exposed on the Swift side; sandboxed tool execution against a working directory is on the kit's feature list, as is a streaming conversation view a SwiftUI app can bind to directly.
Source
PiDurableKit, finnvoor on GitHub.
This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.
Get AI News in your inbox
New developer tools, model and agent releases, and how teams are actually using them to release software. Short, and only when there is something worth reading.