{"_id":"@ayuanaa/pi-provider-stepfun-cn","name":"@ayuanaa/pi-provider-stepfun-cn","dist-tags":{"beta":"0.1.0-beta.1","latest":"0.1.0-beta.1"},"versions":{"0.1.0-beta.1":{"name":"@ayuanaa/pi-provider-stepfun-cn","version":"0.1.0-beta.1","description":"StepFun China Step Plan provider extension for Pi Coding Agent","type":"module","license":"MIT","keywords":["pi-package","pi-extension","pi-coding-agent","provider","stepfun","stepfun-cn","step-plan","china","openai-compatible"],"pi":{"extensions":["./extensions/stepfun-cn.ts"]},"peerDependencies":{"@earendil-works/pi-ai":"*","@earendil-works/pi-coding-agent":"*"},"repository":{"type":"git","url":"git+https://github.com/CiaoBye/pi-provider-stepfun-cn.git"},"bugs":{"url":"https://github.com/CiaoBye/pi-provider-stepfun-cn/issues"},"homepage":"https://github.com/CiaoBye/pi-provider-stepfun-cn#readme","publishConfig":{"access":"public"},"scripts":{"check:shell":"bash -n tests/*.sh","pack:check":"npm pack --dry-run"},"engines":{"node":">=22.19.0"},"gitHead":"a29763e9705909730c09ecfed55b3ce7f4de7708","_id":"@ayuanaa/pi-provider-stepfun-cn@0.1.0-beta.1","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-M4bxHijTbDz+biceB8ai495DHy8pdqUh46gEWBx1eXYjQunniMJfKWYogdTCKCEv4VYx3BbEd8KIyqxmNLnKJA==","shasum":"916ad78408cf993d69cbfa745c1260de4586d5b6","tarball":"https://registry.npmjs.org/@ayuanaa/pi-provider-stepfun-cn/-/pi-provider-stepfun-cn-0.1.0-beta.1.tgz","fileCount":8,"unpackedSize":32007,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCGGUyysIf1c7KdJ7e7qGNiarFh+QFOX1nUMmCZTqqnoQIhAOV0o3T+1tpsDxpYCJZ8kx6OZFO+LGEDLY1Ln96/O3I4"}]},"_npmUser":{"name":"ayuanaa","email":"exk2020@qq.com"},"directories":{},"maintainers":[{"name":"ayuanaa","email":"exk2020@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-provider-stepfun-cn_0.1.0-beta.1_1784212094234_0.8349194447646233"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T14:28:14.059Z","0.1.0-beta.1":"2026-07-16T14:28:14.388Z","modified":"2026-07-16T14:28:14.579Z"},"maintainers":[{"name":"ayuanaa","email":"exk2020@qq.com"}],"description":"StepFun China Step Plan provider extension for Pi Coding Agent","homepage":"https://github.com/CiaoBye/pi-provider-stepfun-cn#readme","keywords":["pi-package","pi-extension","pi-coding-agent","provider","stepfun","stepfun-cn","step-plan","china","openai-compatible"],"repository":{"type":"git","url":"git+https://github.com/CiaoBye/pi-provider-stepfun-cn.git"},"bugs":{"url":"https://github.com/CiaoBye/pi-provider-stepfun-cn/issues"},"license":"MIT","readme":"# StepFun 中国区 Step Plan Provider Extension\n\n为官方 Pi Coding Agent 注册一个名为 `stepfun-cn` 的自定义 Provider，使 Pi 可以使用中国区 Step Plan 订阅套餐。\n\n代码基线：官方 [pi-providers](https://github.com/pi-vault/pi-providers) `src/providers/stepfun-ai.ts`，仅替换中国区配置项。\n\n## 安装\n\n从 npm 安装 Beta 版本：\n\n```bash\npi install \"npm:@ayuanaa/pi-provider-stepfun-cn@beta\"\n```\n\n临时体验而不安装：\n\n```bash\npi -e \"npm:@ayuanaa/pi-provider-stepfun-cn@beta\"\n```\n\n## 认证方法\n\n### 方法一：环境变量（推荐）\n\n此 Provider 通过环境变量 `STEPFUN_API_KEY` 读取 API Key，**不在源码中写入或读取真实 Key**。\n\n```bash\n# 在 Pi 启动前导出（推荐）\nexport STEPFUN_API_KEY=\"<your-stepfun-api-key>\"\n\n# 或在 Pi 命令行中直接设置\nSTEPFUN_API_KEY=\"<your-stepfun-api-key>\" pi -e \"npm:@ayuanaa/pi-provider-stepfun-cn@beta\"\n```\n\n如果你的 shell 配置文件（如 `~/.zshrc`、`~/.bashrc`）中已设置该变量，直接启动 Pi 即可。\n\n### 方法二：/login 交互式登录\n\n在 Pi 中运行 `/login stepfun-cn`，按提示输入中国区 Step Plan API Key。登录凭据将保存到 `auth.json`，后续启动 Pi 自动使用，无需重复输入。\n\n认证优先级：**auth.json 登录凭据优先，环境变量 `STEPFUN_API_KEY` 作为后备**。\n\n## 临时测试（pi -e）\n\n```bash\n# 设置 API Key\nexport STEPFUN_API_KEY=\"your-key\"\n\n# 启动 Pi 并加载 npm Package\npi -e \"npm:@ayuanaa/pi-provider-stepfun-cn@beta\"\n\n# 进入 Pi 后，查看所有可用模型\n# 输入 /model，确认能看到 stepfun-cn 下的模型列表\n```\n\n## /model 使用方法\n\n**切换模型**\n\n```\n# 查看所有可用模型\n/model\n\n# 选择指定模型（示例）\n/model stepfun-cn/step-3.7-flash\n\n# 循环切换模型\nCtrl+P\n```\n\n## curl 连通性测试\n\n在终端中直接测试 Step Plan API：\n\n```bash\n# 替换 YOUR_API_KEY 为真实 Key\ncurl -sS -X POST \"https://api.stepfun.com/step_plan/v1/chat/completions\" \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $STEPFUN_API_KEY\" \\\n  -d '{\n    \"model\": \"step-3.7-flash\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"回复 OK\"}],\n    \"max_tokens\": 256,\n    \"reasoning_effort\": \"low\"\n  }' | jq .\n```\n\n预期返回包含 `\"content\": \"OK\"` 或类似简短回复的 JSON。\n\n## 卸载方法\n\n```bash\npi remove \"npm:@ayuanaa/pi-provider-stepfun-cn\"\n```\n\n## 安全说明\n\n1. **API Key 管理**\n   - API Key 仅通过环境变量 `STEPFUN_API_KEY` 或 `/login` 交互式输入读取\n   - 源码中不写入、不硬编码任何真实 Key\n   - 不输出、不记录、不验证展示完整 API Key\n   - 不要将包含 Key 的 `.env` 文件提交到代码仓库\n   - 建议将 `.env` 加入 `.gitignore`\n\n2. **扩展权限**\n   - Pi 扩展运行在 Pi 的上下文中，具有与 Pi 相同的系统权限\n   - 此扩展仅注册一个自定义 Provider，不涉及文件读写、网络代理或系统命令执行\n\n3. **API 请求**\n   - 所有 API 请求通过 Pi 内置的 OpenAI Chat Completions 兼容层发出\n   - 请求发送到 `https://api.stepfun.com/step_plan/v1`，使用标准 Bearer Token 认证\n   - 不在扩展层做任何请求篡改或代理\n\n4. **模型注册范围**\n   - 仅注册 4 个对话/推理模型\n   - 语音、TTS、ASR、图像生成/编辑等模型不在此扩展中注册\n\n## 模型元数据说明\n\n| 模型 ID | 能力 | 上下文窗口 | maxTokens | 推理强度 |\n|---|---|---|---|---|\n| step-3.7-flash | text, image | 256,000 | 256,000 | low / medium / high |\n| step-3.5-flash-2603 | text | 256,000 | 256,000 | low / high |\n| step-3.5-flash | text | 256,000 | 256,000 | high only |\n| step-router-v1 | text | 384,000 | 384,000 | low / medium / high |\n\n### step-router-v1 说明\n\n**调用端点：** step-router-v1 **只能通过** `https://api.stepfun.com/step_plan/v1` 调用。\n\n**自动路由：** 该模型会在 `deepseek-v4-pro` 与 `step-3.7-flash` 之间自动路由，用户无需手动选择后端模型。\n\n**输入限制：** 只支持文字输入，**不支持图片和文档输入**。\n\n**工具调用：** 支持普通 function tool calls，**但不支持** StepFun 内置的 `web_search` 工具类型。\n\n**上下文窗口：** 官方明确说明 `max_tokens` 上限为 384K。`contextWindow=384000` 是当前 Pi Provider 元数据工作值，官方页面没有单独明确 Router 的 `contextWindow`，需要通过真实长上下文使用继续验证。\n\n### 关于 cost 的说明\n\nStep Plan 是订阅制套餐产品，不是按 token 计费。此处将 `cost` 全部设为 `0` 是一种展示策略，意味着 Pi 内部费用统计显示为 0。这**不代表模型免费**——用户已为 Step Plan 订阅套餐付费，每次 API 调用消耗的是套餐额度而非额外 token 费用。\n\n### 需要人工确认的元数据\n\n1. **maxTokens** — `step-router-v1` 的 `contextWindow=384000` 需要通过真实长上下文使用继续验证，官方页面未单独明确 Router 的 contextWindow。\n2. **thinkingLevelMap 映射** — Pi 的 thinking levels 到 StepFun 的 reasoning_effort 的映射需要实测验证是否生效。\n","readmeFilename":"README.md","_rev":"1-ac5c91f391ca852cfaead0c6154bcf2f"}