@azhi-ss/feishu-remote

Feishu Remote Bridge transport for Pi-compatible agents

Packages

Package details

extension

Install @azhi-ss/feishu-remote from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@azhi-ss/feishu-remote
Package
@azhi-ss/feishu-remote
Version
0.1.0
Published
Sep 9, 2026
Downloads
100/mo · 100/wk
Author
zorya156
License
MIT
Types
extension
Size
55.4 KB
Dependencies
1 dependency · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@azhi-ss/feishu-remote

A transport-only Pi extension that lets the owner drive the active Pi session from a one-to-one Feishu/Lark bot chat. Replies stream back through a Card Kit card.

It provides /remote, the outbound WebSocket transport, owner-only inbound message filtering, turn queuing, and streaming-card delivery. It does not include Feishu Agent Skills, Mem0, or high-risk action policy.

Requirements

  • Node.js 22.19 or later
  • A self-built Feishu/Lark bot app with WebSocket event delivery enabled
  • The bot's App Secret in FEISHU_REMOTE_APP_SECRET
  • The App ID and owner open_id, resolved in one of these ways:
    • an existing lark-cli config under ~/.lark-cli/config.json or the XDG config path; or
    • FEISHU_REMOTE_APP_ID and FEISHU_REMOTE_OWNER_OPEN_ID when no lark-cli config exists

A present but invalid lark-cli config is treated as an error and does not fall back to environment identity.

Install

pi install npm:@azhi-ss/feishu-remote

Export the secret for the Pi process. It is kept in memory and is never written to Pi settings or session files.

export FEISHU_REMOTE_APP_SECRET=<app-secret>
pi

Then run:

/remote start
/remote switch
/remote status
/remote stop

Set FEISHU_REMOTE=1 to opt into autostart for each interactive session. Normal Pi startup stays offline when this variable is unset.

Constraints

  • Only the configured owner's one-to-one chat can drive the session. Group messages and other senders are ignored.
  • Do not run lark-cli event consume for the same app while the extension is connected. Feishu load-balances events across concurrent consumers.
  • Two local sessions cannot share one bot app. The active window holds a per-App-ID lock (JSON metadata: pid, start time, cwd) under $HOME/.cache/feishu-remote/.
  • Switching which window answers the phone: in the new window run /remote switch. It asks the holding window (via a short-lived yield file, not signals) to stop, waits for the lock, then connects. A window that starts while another holds the lock can either fail (/remote start) or, with FEISHU_REMOTE=1, sit in standby and show the holder in its status line.
  • Session replacement (/new, resume, fork, or reload) closes the old bridge. Start it again in the replacement session, or use FEISHU_REMOTE=1.

License

MIT