@agentapprove/pi

中文文档
0.1.13发布于 2026/08/31SEE LICENSE IN LICENSEES Module零依赖近 30 天下载 2800

Agent Approve extension for Pi - approve or deny AI agent tool calls from your iPhone and Apple Watch

原始使用文档
文档目录5 节
  1. Install
  2. What It Covers
  3. Runtime Mapping
  4. Configuration
  5. Security

@agentapprove/pi

Agent Approve extension for Pi. Approve or deny Pi tool calls from your iPhone or Apple Watch. Get the app on the App Store.

Install

Run the Agent Approve installer and select Pi:

npx agentapprove

If Agent Approve is already paired on this machine, you can install the Pi package directly:

pi install npm:@agentapprove/[email protected]

What It Covers

  • tool_call blocking approval
  • native tool completion events
  • MCP tool approvals and completion events grouped by MCP server
  • prompt, response, thinking, compaction, stop, and session-end events
  • optional follow-up input from Agent Approve when Pi finishes a turn

Runtime Mapping

Pi eventAgent Approve event
session_startsession_start
before_agent_startuser_prompt
tool_callblocking approval request
tool_resultcommand_executed, tool_complete, or mcp_complete
tool_execution_endcompletion fallback if tool_result was not observed
message_endthought, response, or plan_generated
session_compactcontext_compact
agent_endstop, with optional follow-up input
session_shutdownsession_end

Approval requests include:

{
  agent: "pi",
  hookType: "tool_call",
  toolName: string,
  toolType: string,
  toolInput?: object,
  command?: string,
  conversationId: string,
  generationId?: string,
  toolCallId?: string,
  model?: string,
  mcpServer?: RuntimeMcpServer,
  metadata: {
    sessionId: string,
    piEventName: "tool_call",
    cwd?: string,
    workspaceRoots?: string[],
    turnId?: string,
    messageId?: string,
    provider?: string,
    model?: string,
    toolCallId?: string
  },
  timestamp: number
}

Events use the same Agent Approve event envelope with agent: "pi", eventType, conversationId, optional generationId, optional tool metadata, optional mcpServer, optional sessionStats, metadata, and timestamp.

Configuration

The extension reads the standard Agent Approve config from ~/.agentapprove/env.

VariableDefaultDescription
AGENTAPPROVE_APIhttps://api.agentapprove.comAgent Approve API URL
AGENTAPPROVE_API_VERSIONv001API version
AGENTAPPROVE_TOKENkeychain or config tokenCLI API token
AGENTAPPROVE_PRIVACYfullminimal, summary, or full
AGENTAPPROVE_FAIL_BEHAVIORaskallow, deny, or ask if Agent Approve is unreachable
AGENTAPPROVE_AGENT_NAMEPiDisplay name for this Pi agent
AGENTAPPROVE_PI_NAMEPiLegacy Pi-specific display name fallback

Security

Requests are signed with Agent Approve HMAC headers and include the SHA256 hash of the installed package bundle. The API allowlists published bundle hashes by hook version.

版本与发布记录

@agentapprove/pi 共发布 10 个版本,首次发布于 2026/05/01;过去 12 个月发布了 10 个版本。

版本发布日期距今
0.1.13latest2026/08/312 个月前
0.1.122026/07/203 个月前
0.1.112026/07/193 个月前
0.1.102026/07/044 个月前
0.1.92026/07/044 个月前
0.1.72026/05/235 个月前

关于 @agentapprove/pi 的常见问题

@agentapprove/pi 是什么?

Agent Approve extension for Pi - approve or deny AI agent tool calls from your iPhone and Apple Watch

如何安装 @agentapprove/pi?

在项目目录运行 npm install @agentapprove/pi,或使用 pnpm add / yarn add / bun add。

@agentapprove/pi 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/agentapprove__pi 是否存在。

@agentapprove/pi 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agentapprove/pi 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@agentapprove/pi 可以商用吗?

@agentapprove/pi 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@agentapprove/pi 的下载量有多少?

根据 npm 官方下载统计,@agentapprove/pi 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,800 次,日均约 93 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agentapprove/pi 还在维护吗?

最新版本 0.1.13 发布于 2026/08/31(2 个月前);至今共发布 10 个版本,其中过去 12 个月发布了 10 个;首次发布于 2026/05/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。