@zcouncil/pi

Pi package exposing one /chat-style zcouncil tool backed by the zcouncil SDK and bridge-aware backend.

Packages

Package details

extensionskill

Install @zcouncil/pi from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@zcouncil/pi
Package
@zcouncil/pi
Version
0.1.15
Published
May 19, 2026
Downloads
492/mo · 52/wk
Author
sshkeda
License
MIT
Types
extension, skill
Size
98.6 KB
Dependencies
3 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ],
  "skills": [
    "./skills"
  ]
}

Security note

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

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/pi

Local development:

pi install ./packages/pi
pi -e ./packages/pi

Auth

Use the same scoped token store as @zcouncil/cli:

~/.zcouncil/tokens/<bridge-scoped-token-file>

Inside Pi, run:

/zcouncil login

The 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 logout

Tool 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 defaults

Member 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.