npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zhushanwen/pi-session-manager

v0.2.1

Published

Pi extension for managing agent-managed sessions — create, send, read history, list, status, abort via ctx.ui.select channel.

Readme

@zhushanwen/pi-session-manager

agent-managed session pi extension:把 session 的创建/发送/读取/列表/状态/中止交给 agent 自主管理——agent 通过 6 个工具以子 session 形态并行工作,父 session 统一编排。

通道契约

  • 工具调用经 ctx.ui.select(SESSION_MANAGER_MARKER, [JSON], {timeout}) 发出,超时按 action 分档(create/history 60s、其余 30s,SSOT 在 src/index.ts 的 SELECT_TIMEOUT_MS);marker 为 \x00TAIJI_SESSION_MANAGER(NUL 前缀防与普通 select title 冲突,SSOT 在 @zhushanwen/extension-protocol)
  • 请求体为嵌套形状 { action, params }(形状 SSOT 在 @zhushanwen/extension-protocol);不要扁平化展开——runtime event-adapter 按 data.params 提取,扁平化会导致 params 丢失
  • 应答方是 taiji runtime 的 SessionManagerHandler(select value 通道回写 JSON 字符串;取消/超时返回 null)

工具(6 个工具,每工具 1 个 action)

| 工具 | action | 说明 | |------|--------|------| | create_managed_session | create | 在指定 cwd 创建子 session(可选 label;可选 prompt 作初始 prompt,create+send 原子完成);服务端注入 spawnSource: 'agent' 与父 session id,.agent.json sidecar 落盘供重启恢复 | | send_to_session | send | 向子 session 发送 prompt(异步处理) | | read_session_history | history | 读子 session 对话历史(可选 tailTurns 截尾部 N 个 turn) | | list_my_sessions | list | 列出本 agent 管理的 session(无过滤参数,自动限定发起方 agent) | | get_session_status | status | 查询子 session 状态与模型信息 | | abort_session | abort | 中止运行中的子 session |

运行要求

应答端(runtime handler)在 taiji 桌面应用内;独立 pi CLI 环境无 handler 应答,工具会等待至超时(create/history 60s、其余 30s)后返回 isError 错误结果(文案 cancelled or timed out——pi 实装对取消与超时不可区分,见 protocol callMarkerRpc)。

安装

pi install npm:@zhushanwen/pi-session-manager

测试

cd extensions/universal/session-manager && npx vitest run