Files
plugins/packages/joycode/package.json
T
kassama f6fdf8fee1 joycode 0.2.4: plan expiry, and one retry when gray access is denied (#701)
joycode 0.2.4 (kasisama):
- usage: the plan's expiry from the IDE's expireText (end of that day,
  China time) as `until`, with each pool's runsOutAt/runsOut; the package
  row decides, otherwise the earliest pool.
- a gray-access denial is retried once with the identity read again.
- gateway failures are read from a clone of the reply (64KB at most); a
  JSON reply over 8MB answers 502 response_too_large.
- an empty catalogue keeps the built-in models, which are text-only.

The first head (f16034b2) turned the repo suite red: usage.test.mjs
called t.mock.method(globalThis, 'fetch') several times in one test, Bun
1.4 restored the wrong function, and the next file (joycode/login.test)
and ~450 tests after it kept hitting the mock. b1f06b75 installs the
mock once per test; nothing outside usage.test.mjs changed.

Run at the reviewed head b1f06b7501bddb4f035eee069bf44d89f02e5349 (mote):
- whole repo `bun test`: 5374 pass, 19 skip, 0 fail (401 files).
- at f16034b2: the same run had its first red in joycode/login.test.mjs
  right after usage.test.mjs, an AssertionError from usage.test.mjs's
  mock (the leak above).
- CI run 41772835368 on b1f06b75: success.
Not tried: a real JoyCode account (none here); the gray-denial retry and
expiry phrases are checked against the tests' fixtures only.
2026-11-04 12:42:45 +08:00

35 lines
3.1 KiB
JSON

{
"name": "@magpie-community/opencode-joycode-auth",
"version": "0.2.4",
"description": "OpenCode provider plugin: JoyCode (JD Cloud JoyCoder IDE credits)",
"type": "module",
"main": "./opencode.mjs",
"exports": { ".": "./opencode2.mjs" },
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/joycode"
},
"scripts": {
"test": "bun test"
},
"files": [
"index.mjs",
"opencode.mjs",
"opencode2.mjs",
"README.md",
"CHANGELOG.md",
"icon.png"
],
"keywords": [
"opencode",
"opencode-plugin",
"joycode"
],
"license": "MIT",
"magpie": {
"maxConcurrency": 4,
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxj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