Files
plugins/packages/tabbit/package.json
T
hclhcl 7ea611975a tabbit: Tabbit (web.tabbit.com) as a provider, with live catalog, check-in and cycle usage (#673)
Adds @magpie-community/opencode-tabbit-auth 0.1.0 (packages/tabbit) and its
registry.json entry. Tabbit (web.tabbit.com) becomes a provider:
- A live model catalog.
- Turns run as room -> run -> SSE join. Each turn has its own stream
  timeout (TABBIT_STREAM_TIMEOUT_MS, default 300 s), and the 30 s request
  timeout no longer covers join.
- A run is stopped through /proxy/v0/chat/stop/ when the client aborts or
  the stream times out.
- A cut turn ends as an error event (streaming) or a 502, never as a
  "stop" finish, and its room is not reused.
- Rooms are keyed by account and session, with a 30 min TTL and a cap of 256.
- 400/401/403/404/429 pass through with retry-after.
- The daily desktop_pet check-in is free.
- Cycle usage.
- macOS desktop sign-in reads the Tabbit Browser cookie store from a temp
  copy that is removed in a finally. Windows and Linux paste the token.

Run at 5be6e90 on mote (macOS):
- bun test: 58 pass. node --test tests/*.test.mjs: 58 pass.
  bun scripts/check.mjs: ok.
- Broken by hand, and each change turned its test red:
  - no rmSync of the cookie copy;
  - 429 not passed through;
  - room keyed by session only;
  - stop sent on an already-aborted signal;
  - no abort listener on the request;
  - streaming truncation ignored;
  - the old truncation rule;
  - totalTimeout back on join;
  - no wake of a quiet reader;
  - onTimeout not called;
  - no room pruning.
- Probes against a local SSE server:
  - A 35 s turn gives 200 under Bun (streaming and non-streaming) and under
    Node.
  - A silent stream with TABBIT_STREAM_TIMEOUT_MS=3000 ends at 3 s under
    Bun and Node (an error event, or a 502 non-streaming), and the server
    sees the stop at 3 s.
- tabbit-* temp dirs in TMPDIR: the same count before and after the bun and
  node runs.

Not tried: a real Tabbit account.
2026-11-03 21:39:56 +08:00

52 lines
1.2 KiB
JSON

{
"name": "@magpie-community/opencode-tabbit-auth",
"version": "0.1.0",
"description": "Tabbit (web.tabbit.com) as a magpie / OpenCode provider: live model catalog, cookie sign-in, chat completions, cycle usage and the daily check-in",
"type": "module",
"main": "./opencode.mjs",
"exports": {
".": "./opencode2.mjs"
},
"files": [
"index.mjs",
"opencode.mjs",
"opencode2.mjs",
"src/",
"README.md",
"LICENSE"
],
"keywords": [
"magpie",
"magpie-plugin",
"opencode",
"opencode-plugin",
"tabbit",
"provider",
"llm-gateway"
],
"license": "MIT",
"engines": {
"node": ">=22"
},
"scripts": {
"test": "node --test tests/*.test.mjs"
},
"magpie": {
"icon": "https://web.tabbit.com/favicon.ico",
"maxConcurrency": 1
},
"homepage": "https://github.com/magpie-community/plugins/tree/main/packages/tabbit#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/tabbit"
},
"bugs": {
"url": "https://github.com/magpie-community/plugins/issues"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}