Heypi gives your agent a curated set of runtime-backed tools for shell, files, and search, and lets you add your own. Every tool call can be gated behind a human approval step: heypi pauses the turn, sends an approval card to your chat platform, and replays the call only after a human says yes. Approvals are first-class — persisted in SQLite, rendered with native buttons on Slack, Telegram, and Discord, and resolvable by text command on every adapter.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hunvreus/heypi/llms.txt
Use this file to discover all available pages before exploring further.
Built-in Core Tools
Heypi registers the following Pi-compatible tools automatically:bash
Run shell commands. Requires approval by default via
commandConfirm().read
Read a file from the runtime workspace.
write
Write a file to the runtime workspace.
edit
Edit (patch) a file in the runtime workspace.
grep
Search file contents with a regex pattern.
find
List files matching a glob pattern.
ls
List directory entries in the runtime workspace.
history
Read thread message history.
bash uses commandConfirm() by default. File and search tools (read, write, edit, grep, find, ls) run inside the scoped runtime workspace with path containment and size limits enforced. write and edit do not require approval unless you configure one.
coreTools() API
Use coreTools() to include and selectively configure the built-in tools. Pass false to disable a tool, true to enable it without a custom confirm, or an options object to override its confirmation:
Omitting
tools entirely uses the full default core tool set with commandConfirm() on bash. If you pass tools, include coreTools() explicitly or those tools will not be available.Custom Tools with tool()
Use tool() when your custom tool needs a confirmation step. Heypi stores the pending call, renders approval buttons where the adapter supports them, and can replay the call safely after approval.
The confirm Function
The confirm field controls whether a call requires human approval. It can be a static object or a function that receives the tool arguments:
- Require approval
- Allow silently
- Block entirely
Return
{ message, details } to pause the turn and request approval.policyReason (Audit-Only)
The ConfirmResult type also accepts a policyReason field. Unlike message, it is not shown as the main approval text in cards or buttons — it is recorded for policy audit purposes only. Use it to capture the rule or pattern that triggered approval (for example, the regex that matched):
Approval details
Each entry in details is a label/value pair shown in the approval card:
| Field | Type | Notes |
|---|---|---|
label | string | Display label shown in the approval card |
value | string | The field value |
format | "text" | "code" | Optional. Use "code" to render as a code block |
Approval Configuration
Configure who can approve tool calls and how long approvals stay open at the app level:approvers list means any user in that chat can approve.
Permissions
| Action | Who can perform it |
|---|---|
approve | Configured approval.approvers, or any user if none are configured |
deny | Configured approvers, or the original requester |
cancel | Run initiator, or configured approvers |
approvals | Configured approvers, or current-thread users when no approvers are configured |
commandConfirm() for Bash Risk
commandConfirm() translates command risk classification into the tool confirm contract. It parses the shell command, classifies each segment, and returns false (allow), an approval prompt, or a block based on your rules.
Evaluation Order
Each parsed command segment is classified independently, and the highest risk wins:Built-in approval patterns
Patterns like
curl, wget, ssh, scp, rsync, docker, kubectl, terraform, helm, firewall changes (ufw, firewall-cmd, iptables, nft), git push, npm publish, pnpm publish, and rm -rf (without a trailing /) → request approvalclassifyCommand() is exported for lower-level use when you need to inspect the CommandRisk result directly. Most code should use commandConfirm() instead, which wraps classification into the tool confirm contract.
Using ctx.runtime in Custom Tools
Custom tool execute functions run as trusted Node.js code. When a tool needs to run commands or file operations inside the configured runtime sandbox, use ctx.runtime:
ctx.runtime is the scoped runtime bound to the current turn. Calls through it are covered by the custom tool’s own confirm decision — heypi does not create separate nested approval records for those internal calls.
Approval Cards and Text Commands
Slack, Telegram, and Discord render provider-native approval buttons. The card shows themessage, optional details, and the requester’s name. Approve/deny actions edit the original message in place and remove the buttons.
Text commands work in every chat adapter: