@magpie-community/opencode-workbuddy-auth 0.1.15 → 0.1.16

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.
Files changed (2) hide show
  1. package/index.mjs +20 -2
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -77,9 +77,27 @@ const SITES = {
77
77
  platform: "workbuddy-ai",
78
78
  ai: true,
79
79
  models: AI_MODELS,
80
+ // models whose images WorkBuddy AI drops though its config says they
81
+ // take them (see textOnly)
82
+ noImages: /^glm-/,
80
83
  },
81
84
  }
82
85
 
86
+ // textOnly says whether site drops the images sent to model, whatever its
87
+ // config says. On 2026-10-13, with a real WorkBuddy AI account (Yirasumi on
88
+ // Discord), www.workbuddy.ai's /v3/config marked every model
89
+ // supportsImages: true, but a chat to glm-5.3-flash, glm-5.3 or glm-5.2
90
+ // came back saying "[System reminder: the current model does not support
91
+ // images. Content filtered. ...]": the server had taken the image out.
92
+ // Its other models (deepseek-v4.1-flash, kimi, gemini, grok, gpt) read
93
+ // them, and WorkBuddy (China)'s glm-5.3-flash does too, so this is WorkBuddy
94
+ // AI's GLM models alone. Said text-only, magpie's image-describing model
95
+ // reads the image for them; a user who said the model takes images keeps
96
+ // their own answer (magpie's settings, over what this list says).
97
+ function textOnly(site, model) {
98
+ return !!site.noImages?.test(model)
99
+ }
100
+
83
101
  const NPM = "@ai-sdk/openai-compatible"
84
102
  const hex = () => randomBytes(16).toString("hex")
85
103
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms))
@@ -1180,7 +1198,7 @@ async function liveModels(site, a) {
1180
1198
  if (d) {
1181
1199
  m.context = d.maxInputTokens
1182
1200
  m.output = d.maxOutputTokens
1183
- m.images = d.supportsImages === true
1201
+ m.images = d.supportsImages === true && !textOnly(site, id)
1184
1202
  const r = creditsOf(d.credits)
1185
1203
  if (r !== undefined) {
1186
1204
  m.free = r === 0
@@ -1394,4 +1412,4 @@ export const WorkBuddyAuthPlugin = makePlugin(SITES.workbuddy)
1394
1412
  export const WorkBuddyAIAuthPlugin = makePlugin(SITES["workbuddy-ai"])
1395
1413
 
1396
1414
  // for tests
1397
- export const _internal = { runsOutOf, packagesOf, endOf, enterpriseHeaders, enterpriseOf, liveModels, browserSignIn, withSystem, normalizeToolChoice, fitTools, fitted, renamed, unflagged, usageOf, desktopHeld, explained, REFUSED_HINT, EXHAUSTED_HINT, freeCredits, creditsOf, fresh, SITES, renewing, renewed, SESSION, attend, turnKey, conversationKey, signatureOf }
1415
+ export const _internal = { textOnly, runsOutOf, packagesOf, endOf, enterpriseHeaders, enterpriseOf, liveModels, browserSignIn, withSystem, normalizeToolChoice, fitTools, fitted, renamed, unflagged, usageOf, desktopHeld, explained, REFUSED_HINT, EXHAUSTED_HINT, freeCredits, creditsOf, fresh, SITES, renewing, renewed, SESSION, attend, turnKey, conversationKey, signatureOf }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-workbuddy-auth",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
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",