Files
plugins/packages/sensenova/testdata/pool-usage.json
T
yihheng 04f3608d49 sensenova 0.1.0: SenseNova Token Plan provider plugin (#577, yihheng)
A new provider plugin, @magpie-community/opencode-sensenova-auth 0.1.0, for the SenseNova (SenseTime 日日新) Token Plan, provider id `sensenova-token-plan`.

- Sign-in: a console sign-in (OIDC + PKCE). The password is sealed to JWE under the platform's JWKS key and is not stored.
- Quota: the account's credit pools (5h/7d windows, expiring grants) from pool-usage.
- Chat: with an optional pasted API key, it serves the plan's chat models at token.sensenova.cn/v1. The list is filtered per account to models the plan covers.
- Also adds a registry.json entry and a root README row.

Hosts:
- platform.sensenova.cn gets the access JWT.
- iam.sensecoreapi.cn gets the sealed password.
- signin.sensecore.cn gets the refresh token and the code.
- token.sensenova.cn gets the API key.

There are no dependencies and no install scripts.

Run at head 3804ab46ae6c6c16d393e5dc08d6ae81c63da668 on mote (macOS 27.2, Bun 1.4.2), with a fresh HOME:
- `bun test packages/sensenova`: 43 pass, 0 fail.
- `bun scripts/check.mjs sensenova` passed.
- Full `bun test`: 4455 pass, 9 skip, 0 fail.
- Broken by hand: I removed each of the two `redirect: "manual"` lines that the last review found untested (IAM login, code exchange). Each time, its new 307 test went red (42/1). The earlier reviews' reverts went red at 0aa00b5 and 10984cf.

Not tried: a real sign-in, quota read or chat. There is no SenseNova account. Unauthenticated probes of the real hosts (in the last review) match the walk's shape.

This is the first version, not on npm yet, so the dist branch serves it until it is published.
2026-11-02 03:45:35 +08:00

74 lines
1.8 KiB
JSON

{
"plan": {
"id": "free",
"name": "Free Plan",
"type": "TOKEN_PLAN_PLAN_TYPE_FREE"
},
"pools": [
{
"id": "pool_00000000-0000-4000-8000-000000000001",
"name": "通用积分池",
"model_ids": [
"deepseek-flash",
"deepseek-v4-flash",
"deepseek-v4-pro",
"glm-5.1",
"glm-5.2",
"kimi-k2.6",
"kimi-k3",
"minimax-m2.7",
"qwen3.6-27b",
"sensenova-6.7-flash-lite",
"sensenova-6.8-flash",
"sensenova-6.8-flash-lite",
"sensenova-mask",
"sensenova-pe",
"sensenova-u1-fast",
"sensenova-u1-pro-previews-v2.3",
"sensenova-u1.5-fast",
"sensenova-u1.5-lite"
],
"window_5h": {
"limit": "120000",
"used": "120000",
"remaining": "0",
"reset_at": "1793483140"
},
"window_7d": {
"limit": "1200000",
"used": "438285.55472",
"remaining": "761714.44528",
"reset_at": "1793673940"
},
"grant_balance": "0",
"nearest_grant_expiry": "0",
"nearest_grant_expiring_balance": "0",
"pool_type": "default"
},
{
"id": "pool_00000000-0000-4000-8000-000000000002",
"name": "Flash-Lite积分池",
"model_ids": [
"sensenova-6.7-flash-lite",
"sensenova-6.8-flash-lite"
],
"window_5h": {
"limit": "120000",
"used": "2877.6448",
"remaining": "117122.3552",
"reset_at": "1793483140"
},
"window_7d": {
"limit": "1200000",
"used": "12747.1272",
"remaining": "1187252.8728",
"reset_at": "1793673940"
},
"grant_balance": "0",
"nearest_grant_expiry": "0",
"nearest_grant_expiring_balance": "0",
"pool_type": "dedicated"
}
]
}