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

@wujie-shell/business

v1.0.0

Published

无界 AI 业务客户端。首期只负责账号登录/注册、当前用户信息和 API Key 获取。

Readme

@wujie-shell/business

无界 AI 业务客户端。首期只负责账号登录/注册、当前用户信息和 API Key 获取。

这个包不直接读取 Vite、Electron 或 Node 环境变量。产品 UI 层应该先解析 VITE_WUJIE_API_ENVVITE_WUJIE_API_ENDPOINT 等变量,再把结果注入到 createWujieAiBusiness。这样包本身保持纯 TypeScript、可测试、可在不同宿主中复用。

安装与入口

workspace 内使用:

import { createWujieAiBusiness } from '@wujie-shell/business'

发布后 npm 入口指向 dist/src/index.js,类型入口为 dist/src/index.d.ts

UI 层环境区分

推荐在 UI 项目中放一个适配文件,例如 src/business/wujieBusiness.ts

import { createWujieAiBusiness } from '@wujie-shell/business'

export const wujieBusiness = createWujieAiBusiness({
  env: import.meta.env.VITE_WUJIE_API_ENV,
  endpoint: import.meta.env.VITE_WUJIE_API_ENDPOINT,
  storagePrefix: `wujie:${import.meta.env.VITE_WUJIE_API_ENV}`,
  storage: window.localStorage,
  fetch: window.fetch.bind(window),
})

示例环境文件:

# .env.development
VITE_WUJIE_API_ENV=test
VITE_WUJIE_API_ENDPOINT=https://test-api.example.com
# .env.production
VITE_WUJIE_API_ENV=prod
VITE_WUJIE_API_ENDPOINT=https://api.example.com

storagePrefix 用来隔离测试和生产环境 token:

wujie:test:gate-token
wujie:test:user-id
wujie:test:device_id
wujie:prod:gate-token
wujie:prod:user-id
wujie:prod:device_id

登录/注册

areaCode 会在包内规范成不带 + 的格式,例如 +86 会发送为 86。 密码登录时,UI 传入明文密码即可,包内会按 wujie-ai 桌面端行为发送 MD5 后的密码。

await wujieBusiness.auth.sendCaptcha({
  mobile: '13800000000',
  areaCode: '+86',
  behaviorParam: captchaPayload,
})

await wujieBusiness.auth.loginOrRegister({
  mobile: '13800000000',
  areaCode: '+86',
  code: '123456',
})

await wujieBusiness.auth.loginOrRegister({
  mobile: '13800000000',
  areaCode: '+86',
  password: 'password',
})

const modelConfig = await wujieBusiness.apiKey.getBigModelConfig()

登录成功后,包会自动写入当前 env 下的 gate-tokenuser-id。后续请求会自动带上 gate-token 请求头。JSON 请求头与 wujie-ai 桌面端保持一致:

Content-Type: application/json
app_code: trade
source_site: AIPC
device_id: <device id>
gate-token: <token>

API Key

大模型配置:

const config = await wujieBusiness.apiKey.getBigModelConfig()

返回字段:

{
  provider: string
  apiKey: string
  modelName: string
  baseUrl: string
  raw: BigModelUserInfo
}

只取大模型 API Key:

const apiKey = await wujieBusiness.apiKey.getBigModelApiKey()

读取当前用户上的 AI gateway API Key:

const gatewayApiKey = await wujieBusiness.apiKey.getGatewayApiKey()

接口范围

当前包只封装以下无界接口:

POST /wj-open/v2/claw/aipc/account/verifyCode
POST /wj-open/v2/claw/aipc/account/register
POST /wj-open/v2/claw/aipc/account/logout
GET  /wj-open/v2/claw/aipc/account/getUserInfo
GET  /wj-open/v2/claw/aipc/billing/big-model/user/info

验证

pnpm --filter @wujie-shell/business test