@magpie-community/opencode-workbuddy-auth 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -11
- package/index.mjs +22 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -260,7 +260,9 @@ through as it came.
|
|
|
260
260
|
When you are signed in, the models are the ones WorkBuddy's product config
|
|
261
261
|
gives its CLI agent (`GET /v3/config`), with their context, image input and
|
|
262
262
|
reasoning levels. Until then, or if WorkBuddy doesn't answer, the list below
|
|
263
|
-
is used.
|
|
263
|
+
is used. Since 0.2.9 its models take images, as the config says of every
|
|
264
|
+
model, except WorkBuddy AI's GLM models, whose images WorkBuddy AI drops
|
|
265
|
+
(#572).
|
|
264
266
|
|
|
265
267
|
`workbuddy`:
|
|
266
268
|
- Auto
|
|
@@ -286,16 +288,17 @@ client sends it: WorkBuddy doesn't think when a chat names none, so
|
|
|
286
288
|
OpenCode's default variant got answers without thinking. An effort the
|
|
287
289
|
client names, `none` too, goes as it came.
|
|
288
290
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
291
|
+
One value differs from the config, measured with real requests:
|
|
292
|
+
DeepSeek-V4.1-Flash (and its paid `-sg` id) lists `none`, though the
|
|
293
|
+
config says it only reasons: WorkBuddy answers `reasoning_effort: "none"`
|
|
294
|
+
on it with no thinking at all (since 0.2.7, #563).
|
|
295
|
+
|
|
296
|
+
A model's context is the config's `maxInputTokens` on both sites. 0.2.7
|
|
297
|
+
capped DeepSeek-V4.1-Flash at 100000 on `workbuddy` (copilot.tencent.com)
|
|
298
|
+
from one report's error; China accounts took prompts up to 992,389 tokens
|
|
299
|
+
on it, so 0.2.8 lifted the cap (#561). A prompt WorkBuddy does find too
|
|
300
|
+
long ("prompt is too long: … > … maximum") is answered with its own 400,
|
|
301
|
+
passed on as it came, which magpie takes as the context overflowing.
|
|
299
302
|
|
|
300
303
|
A chat goes gzipped (`Content-Encoding: gzip`), as WorkBuddy's own client
|
|
301
304
|
sends its model requests (`RequestBodyGzip` in both builds' product.json).
|
package/index.mjs
CHANGED
|
@@ -81,9 +81,6 @@ const SITES = {
|
|
|
81
81
|
// where this build's API keys are made (see keyAccount)
|
|
82
82
|
keys: "https://www.workbuddy.cn/profile/keys",
|
|
83
83
|
models: CN_MODELS,
|
|
84
|
-
// the prompt a model takes here, where it is less than the config's
|
|
85
|
-
// maxInputTokens (see contextOf)
|
|
86
|
-
contextCap: { "deepseek-v4.1-flash": 100000 },
|
|
87
84
|
// it serves the Claude models on Anthropic's Messages API too (see
|
|
88
85
|
// nativeOf)
|
|
89
86
|
messages: true,
|
|
@@ -112,22 +109,17 @@ const SITES = {
|
|
|
112
109
|
},
|
|
113
110
|
}
|
|
114
111
|
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
function contextOf(site, model, said) {
|
|
127
|
-
const cap = site.contextCap?.[model]
|
|
128
|
-
if (!cap) return said
|
|
129
|
-
return typeof said === "number" && said > 0 ? Math.min(said, cap) : cap
|
|
130
|
-
}
|
|
112
|
+
// A model's context is its config's maxInputTokens, on both sites. 0.2.7
|
|
113
|
+
// capped deepseek-v4.1-flash at 100000 on copilot.tencent.com from one
|
|
114
|
+
// report's error ("prompt is too long: 100001 tokens > 100000 maximum"),
|
|
115
|
+
// and it was wrong: on 2026-10-31 China Free-plan accounts of three other
|
|
116
|
+
// users took 110,041 to 992,389-token prompts on it there, the whole prompt
|
|
117
|
+
// read (needles recalled), and the vendor's own refusal of 1,157,831 named
|
|
118
|
+
// 1048576 as the maximum (plugins#561). The cap made every client compact at
|
|
119
|
+
// 100k. Where a prompt really is too long, WorkBuddy's 400 says "prompt is
|
|
120
|
+
// too long" and goes to the client as it came (explained), which magpie
|
|
121
|
+
// reads as the context overflowing (context_length_exceeded): the agent is
|
|
122
|
+
// told to compact, and the account isn't rested for it.
|
|
131
123
|
|
|
132
124
|
// OFF_TAKEN are models that turn thinking off for reasoning_effort "none"
|
|
133
125
|
// though the config says onlyReasoning (so WorkBuddy's own client offers no
|
|
@@ -2957,11 +2949,19 @@ function variants(efforts) {
|
|
|
2957
2949
|
|
|
2958
2950
|
// configModels is the site's own list as a provider's models, each on the
|
|
2959
2951
|
// API it is served on: a Claude model on Messages, the rest on chat.
|
|
2952
|
+
// A model declared here (before an account's list is read, for a key
|
|
2953
|
+
// whose CLI reads no config, or when /v3/config can't be read) takes images
|
|
2954
|
+
// unless textOnly says the site drops them: both sites' configs mark every
|
|
2955
|
+
// model supportsImages (read 2026-11-01), and a chat to WorkBuddy AI's
|
|
2956
|
+
// kimi-k3 with a two-colour PNG named both colours (plugins#572). Declared
|
|
2957
|
+
// text-only, as before, every model read as one that can't see.
|
|
2960
2958
|
function configModels(site) {
|
|
2961
2959
|
return Object.fromEntries(site.models.map(([id, name, context, efforts]) => [id, {
|
|
2962
2960
|
name,
|
|
2963
|
-
limit: { context
|
|
2961
|
+
limit: { context, output: 0 },
|
|
2964
2962
|
tool_call: true,
|
|
2963
|
+
attachment: !textOnly(site, id),
|
|
2964
|
+
modalities: { input: textOnly(site, id) ? ["text"] : ["text", "image"], output: ["text"] },
|
|
2965
2965
|
// OpenCode (and magpie's host) read a config model's package and URL
|
|
2966
2966
|
// from provider: { npm, api }, not api
|
|
2967
2967
|
...(nativeOf(site, id) ? { provider: { npm: NPM_MESSAGES, api: apiMessages(site) } } : {}),
|
|
@@ -3155,7 +3155,7 @@ async function liveModels(site, a) {
|
|
|
3155
3155
|
const d = (cfg.models ?? []).find((x) => x.id === id)
|
|
3156
3156
|
const m = { id, name: d?.name || id }
|
|
3157
3157
|
if (d) {
|
|
3158
|
-
m.context =
|
|
3158
|
+
m.context = d.maxInputTokens
|
|
3159
3159
|
m.output = d.maxOutputTokens
|
|
3160
3160
|
m.images = d.supportsImages === true && !textOnly(site, id)
|
|
3161
3161
|
Object.assign(m, priceOf(d, cfg.modelPromotions))
|
|
@@ -3790,4 +3790,4 @@ export const WorkBuddyAuthPlugin = makePlugin(SITES.workbuddy)
|
|
|
3790
3790
|
export const WorkBuddyAIAuthPlugin = makePlugin(SITES["workbuddy-ai"])
|
|
3791
3791
|
|
|
3792
3792
|
// for tests
|
|
3793
|
-
export const _internal = { idFor,
|
|
3793
|
+
export const _internal = { idFor, OFF_TAKEN, replyAfterToolsOn, withDefaultEffort, defaultEffortOf, gzipped, FREE_ONLY, PRICE_TTL, keyAccount, remoteConfig, cycleOf, typeUnions, systemAsUser, systemKey, DEFAULT_SYSTEM, EDGE_READS, fitShape, replyAfterTools, AFTER_TOOLS_REFUSED, enterpriseUsageOf, accountName, notDesktop, textOnly, runsOutOf, packagesOf, endOf, enterpriseHeaders, enterpriseOf, liveModels, browserSignIn, withSystem, asReasoning, normalizeToolChoice, fitTools, fitted, renamed, unsaid, FILTER_SAYS, unflagged, usageOf, desktopHeld, explained, REFUSED_HINT, RESTRICTED_HINT, EXHAUSTED_HINT, REFUSED_DOC, commaPaused, commaPausedOn, opened, freeCredits, creditsOf, priceOf, fresh, SITES, renewing, renewed, SESSION, attend, scopeOf, turnKey, conversationKey, signatureOf, isMessages, withoutUnsigned, withoutSignedThinking, prepared, answeredBefore, nativeOf, modelOf, configModels, freeWindowOf, tokensShort, freeWindowRows, freeWindowLedger, readLedgerTail, pinned, rowTime, rowAccount, ofAccount, windowOffset, windowReset, FREE_WINDOW_MODELS, FREE_WINDOW_SPAN, FREE_WINDOW_GAP, FREE_WINDOW_LEAD, checkinOf, API_MESSAGES: NPM_MESSAGES, API_CHAT: NPM }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magpie-community/opencode-workbuddy-auth",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.9",
|
|
4
4
|
"description": "OpenCode provider plugins for WorkBuddy's plans: WorkBuddy (CodeBuddy, copilot.tencent.com) and WorkBuddy AI (www.workbuddy.ai)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|