@zcouncil/pi
v0.1.15
Published
Pi package exposing one /chat-style zcouncil tool backed by the zcouncil SDK and bridge-aware backend.
Downloads
487
Maintainers
Readme
@zcouncil/pi
Pi package that exposes exactly one tool: zcouncil.
It brings the zcouncil /chat-style council SDK into Pi:
messages.latestUser()
messages.recent()
council.run(input)
council.ask(memberId, input, description)
council.members()
council.profiles()
ui.status(text)In Pi, council.run() and council.ask() start zcouncil backend jobs and return immediately. Member results arrive later as <pi_context source="zcouncil" kind="member_result" name="gpt"> follow-up messages that wake Pi. Each invocation gets a small zc_inv_N id so started jobs and follow-up results can be correlated while debugging. The zcouncil backend handles model routing and the user's bridge.
Install
pi install @zcouncil/piLocal development:
pi install ./packages/pi
pi -e ./packages/piAuth
Use the same scoped token store as @zcouncil/cli:
~/.zcouncil/tokens/<bridge-scoped-token-file>Inside Pi, run:
/zcouncil loginThe command shows the correct token deep link for the current ZCOUNCIL_API_URL / ZCOUNCIL_BRIDGE_URL, prompts for the token through Pi UI, validates it, and saves it with 0600 permissions.
Other commands:
/zcouncil doctor
/zcouncil logoutTool calls never accept or prompt for tokens. If ZCOUNCIL_TOKEN is set, it overrides the saved token for the current Pi process.
Environments
Select dev, preview, or prod outside the agent by starting Pi with the desired environment:
ZCOUNCIL_API_URL=http://localhost:8787 pi
ZCOUNCIL_API_URL=https://zcouncil-worker-preview-pr-123.example.workers.dev pi
pi # prod defaultsMember jobs time out after 10 minutes by default. For unusual long-running jobs, set ZCOUNCIL_PI_JOB_TIMEOUT_MS before starting Pi.
Do not expose environment selection as tool arguments.
Tool calls
Pi tool calls are object-shaped, so conceptual zcouncil() is an empty tool call:
zcouncil({})That runs:
return council.run(messages.latestUser())Default member labels are gpt, claude, grok, and gemini when those backend members are available.
Custom /chat-style council code:
zcouncil({
code: "await ui.status('I’m asking the council.'); return council.run(messages.latestUser())"
})Ask one backend member:
zcouncil({
code: "return council.ask('gpt', messages.latestUser(), 'Answer from the GPT slot')"
})Adjust Pi message context:
zcouncil({ messages: { limit: 12, includeAssistant: true } })Notes
- The extension calls the zcouncil backend through
@zcouncil/sdk. - The backend handles bridge routing; Pi does not call model CLIs directly.
- Do not put API tokens in tool arguments; tool calls are saved in Pi sessions.
