正在自动登录…
← 返回项目列表finnvoor/
finnvoor/ PiDurableKit
PiDurableKit 是一个用于 Apple 平台(iPhone、iPad、Mac、Vision Pro)的 Swift 库,提供持久化 AI 代理功能,基于 JavaScriptCore 运行 pi-durable 引擎,支持对话、工具调用、子代理和事务,并能在应用被系统终止后恢复工作。
AI 中文解读 · 根据仓库描述与 README 生成 · 2026/10/17 05:21:12 · 查看原文
- 累计 Stars
- 274
- 当前热度
- 未达当前门槛
- 仓库创建时间
选用指南
AI 根据 README 整理 · 2026/10/17 05:21:12
- 使用方式
通过 Swift Package Manager 集成,使用 Swift 异步 API 创建模型、打开持久化存储、提交对话并处理结果。
查看 README 依据
# PiDurableKit Durable AI agents for iPhone, iPad, Mac, and Vision Pro, powered by [`@earendil-works/pi-durable`](https://www.npmjs.com/package/@earendil-works/pi-durable) running in JavaScriptCore. Conversations, model turns, tool calls, and your own state are committed to storage before anything is shown. If iOS kills your app mid-turn, reopening the storage picks the work up where it stopped. ```swift import PiDurableKit let models = Models(credentials: .keychain) try await models.setAPIKey(anthropicKey, for: .anthropic)
let harness = try await Harness.open(.sqlite(at: .documentsDirectory.appending(path: "agent.sqlite")), models: models) let root = try await harness.root(agent: AgentChange(model: .anthropic("claude-sonnet-4-5"))) let submission = try await root.submit("What is the capital of France?") let settled = try await submission.wait() if case .done(_, let answer?) = settled.status { let entry = try await root.commit { tx in try await tx.entry(answer) } print(entry?.assistantMessage?.text ?? "") } ``` - Swift tools, system prompt sections, hooks, and wraps, written as plain closures
- 部署要求
需要 iOS 17、macOS 14、tvOS 17 或 visionOS 1。
查看 README 依据
- OAuth sign-in to Claude Pro/Max, ChatGPT, GitHub Copilot, and OpenRouter, with tokens in the Keychain and automatic refresh - A scripted faux provider for tests and SwiftUI previews Requires iOS 17, macOS 14, tvOS 17, or visionOS 1. ## Installation ```swift .package(url: "https://github.com/<you>/PiDurableKit.git", from: "1.0.0") ``` and add `PiDurableKit` to your target's dependencies. ## Concepts The Swift API mirrors pi-durable's, with Swift concurrency in place of Chord contexts (cancel the Swift task to cancel a wait; cancelling a wait never cancels the work).
- 已知限制
扩展代码未沙箱化,仅安装可信代码;iOS 上无 shell,bash 工具不可用。
查看 README 依据
`/codemode`), `@earendil-works/pi-codemode/portable`, `@earendil-works/pi-ai`, and `@earendil-works/chord/context`. As in pi-durable, extension code is not sandboxed, so install only code you trust; it cannot reach PiDurableKit's own bridge to storage. Like any extension, install it again after a restart before resuming (`Harness.open(…, resume: false)`, `install`, `resume()`) so its pending tool calls continue. `PiDurable.documentation` is pi-durable's own `README.md` and TypeScript declarations for the bundled version, as its
The agent sees the directory as `/` and cannot leave it; a conversation's `cwd` is a path inside it. There is no shell on iOS, so `bash` is not included. On macOS, `.directory(url, shell: true)` adds a shell (commands run in the directory's real location and are not confined), and `.local` is the Mac's own file system and shell, like pi-durable's `NodeExecutionEnv`; pair either with `Extension.codingTools(shell: true)` or `Extension.builtinTools(name: "shell", [.bash(commandPrefix: "source .venv/bin/activate")])`. To give each
README
正在加载 README…
收录信息
- 仓库创建时间
- 2026/10/8 18:02:27
- 首次达标收录
- 2026/10/9 12:11:07
- 统计更新时间
- 2026/10/22 19:05:55
按创建时长与累计 Stars 判断等级。首次达标收录后,即使未达当前门槛仍保留;累计 Stars 和仓库状态会定期更新。确认只有 README 及辅助文件的仓库会停止公开。
模型评估
值得看加权总分 4.0 / 5
由 Jev 模型根据仓库描述与 README 评估,2026/10/16 20:26:25 生成。评分仅供参考,不是代码、安全或许可证审查;热度等级另按创建时长与累计 Stars 计算。
仓库信息
- 最近推送
- 2026/10/19 18:01:05
- 许可证标识
- CC0-1.0
- Fork 数
- 25
- 当前状态
- 未归档
收录记录
按创建时长与累计 Stars 首次收录:小火
首次发现项目