@magpie-community/opencode-opendesign-auth 0.1.5 → 0.1.6

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 CHANGED
@@ -81,9 +81,12 @@ The script keeps the names and measured levels already there — the catalog
81
81
  carries neither — and reads nothing else: no secret is written to the file or
82
82
  printed.
83
83
 
84
- Requests go to the **Responses** API (`@ai-sdk/openai` at
85
- `https://amr-link.open-design.ai/v1`), which is what an Open Design API key
86
- page recommends for Codex-style clients and what keeps thinking intact.
84
+ Requests go to `https://amr-link.open-design.ai/v1`, each model on the API
85
+ amr-link answers its thinking on (measured, plugins#141): chat completions
86
+ (`@ai-sdk/openai-compatible`) for most, the Responses API (`@ai-sdk/openai`)
87
+ for `claude-haiku-5.5` and `deepseek-v4-pro`, and Anthropic's messages
88
+ (`@ai-sdk/anthropic`) for `glm-5.3-flash`. Every model reasons at `low`,
89
+ `high` and `max`.
87
90
 
88
91
  ## Where the sign-in is kept
89
92
 
package/index.mjs CHANGED
@@ -21,7 +21,28 @@ import { MODELS } from "./models.mjs"
21
21
  const ID = "opendesign"
22
22
  const CONTROL = "https://amr-api.open-design.ai"
23
23
  const LINK = "https://amr-link.open-design.ai/v1"
24
- const NPM = "@ai-sdk/openai" // the Responses API, at LINK
24
+ // WHICH API each model is asked on: magpie reads the protocol off the AI SDK
25
+ // package a model declares (its api.npm) — "@ai-sdk/openai" is the Responses
26
+ // API, "@ai-sdk/anthropic" Anthropic's messages, the compatible package chat
27
+ // completions. amr-link answers thinking on a different one per model
28
+ // (sryimnoob123's measurements, plugins#141: a streaming request to each model
29
+ // on each of the three): chat completions carries the thinking of ten of the
30
+ // eleven; deepseek-v4-pro and claude-haiku-5.5 think longer on Responses, and
31
+ // glm-5.3-flash only thinks on Anthropic's messages among the two others.
32
+ const WIRE = {
33
+ chat: "@ai-sdk/openai-compatible",
34
+ responses: "@ai-sdk/openai",
35
+ anthropic: "@ai-sdk/anthropic",
36
+ }
37
+ const MODEL_WIRE = {
38
+ "claude-haiku-5.5": "responses",
39
+ "deepseek-v4-pro": "responses",
40
+ "glm-5.3-flash": "anthropic",
41
+ }
42
+ const wireOf = (id) => WIRE[MODEL_WIRE[id]] ?? WIRE.chat
43
+ // the provider's own default: a model this plugin doesn't name is asked on
44
+ // chat completions, where ten of the eleven thought
45
+ const NPM = WIRE.chat
25
46
  const SOURCE = "opencode-opendesign-auth/" + pkg.version // as the manifest has it
26
47
  const CLI_VERSION = "0.1.4" // what the sign-in says it is, as the CLI does
27
48
  const TIMEOUT = 20_000
@@ -261,6 +282,9 @@ function modelOf(id, m) {
261
282
  tool_call: true,
262
283
  reasoning: thinking,
263
284
  ...(levels.length && { variants: Object.fromEntries(levels.map((e) => [e, { reasoningEffort: e }])) }),
285
+ // the API magpie asks this model on (WIRE above), per model
286
+ api: { npm: wireOf(id) },
287
+ provider: { npm: wireOf(id) },
264
288
  ...(rate && { rate }),
265
289
  limit: {
266
290
  context: Number.isFinite(context) && context > 0 ? context : 200_000,
@@ -284,7 +308,7 @@ function servedOf(id, m) {
284
308
  return {
285
309
  id,
286
310
  name: c.name,
287
- api: { id, url: LINK, npm: NPM },
311
+ api: { id, url: LINK, npm: wireOf(id) },
288
312
  status: "active",
289
313
  headers: {},
290
314
  options: {},
@@ -400,12 +424,19 @@ export const OpenDesignAuthPlugin = async () => {
400
424
  config: async (cfg) => {
401
425
  cfg.provider ??= {}
402
426
  const was = cfg.provider[ID] ?? {}
427
+ // the wire is this plugin's to declare, never a kept copy's: magpie
428
+ // hands back what the hook last wrote, and a model kept from 0.1.5
429
+ // would otherwise stay on the Responses API it chose for every model
430
+ const models = { ...seed(), ...(was.models ?? {}) }
431
+ for (const [id, m] of Object.entries(models)) {
432
+ models[id] = { ...m, api: { ...(m.api ?? {}), npm: wireOf(id) }, provider: { ...(m.provider ?? {}), npm: wireOf(id) } }
433
+ }
403
434
  cfg.provider[ID] = {
404
435
  name: "Open Design",
405
- npm: NPM,
406
436
  api: LINK,
407
437
  ...was,
408
- models: { ...seed(), ...(was.models ?? {}) },
438
+ npm: NPM,
439
+ models,
409
440
  }
410
441
  },
411
442
  // the plan decides which models an account gets, so the list is read
package/models.mjs CHANGED
@@ -8,18 +8,19 @@
8
8
  // the non-text modalities it takes; cost and capability: the vendor's own
9
9
  // words, which the plugin turns into magpie's rate and thinking flags;
10
10
  // efforts: the reasoning levels amr-link was seen to take and think at,
11
- // measured, not read (#137), so a refresh keeps them.
11
+ // measured, not read (#137; max too, plugins#141: the vendor names low, high
12
+ // and max when asked for one it doesn't take), so a refresh keeps them.
12
13
 
13
14
  export const MODELS = {
14
- "claude-haiku-5.5": { name: "Claude Haiku 5.5", context: 1000000, output: 132000, input: ["image", "file"], cost: "low", capability: "standard", efforts: ["low", "high"] },
15
- "deepseek-v4-flash": { name: "DeepSeek V4 Flash", context: 1048000, output: 232000, cost: "medium", capability: "standard", efforts: ["low", "high"] },
16
- "deepseek-v4-flash-vision-exp": { name: "DeepSeek V4 Flash Vision (exp)", context: 1048000, output: 232000, input: ["image"], cost: "medium", capability: "standard", efforts: ["low", "high"] },
17
- "deepseek-v4-pro": { name: "DeepSeek V4 Pro", context: 1048000, output: 232000, cost: "high", capability: "advanced", efforts: ["low", "high"] },
18
- "deepseek-v4.1-flash": { name: "DeepSeek V4.1 Flash", context: 1048000, output: 232000, input: ["image"], cost: "low", capability: "advanced", efforts: ["low", "high"] },
19
- "glm-5.3-flash": { name: "GLM 5.3 Flash", context: 1048000, output: 232000, input: ["image", "video"], cost: "low", capability: "advanced", efforts: ["low", "high"] },
20
- "glm-5.3-flashx": { name: "GLM 5.3 FlashX", context: 1000000, output: 232000, input: ["image", "file", "video"], cost: "medium", capability: "advanced", efforts: ["low", "high"] },
15
+ "claude-haiku-5.5": { name: "Claude Haiku 5.5", context: 1000000, output: 132000, input: ["image", "file"], cost: "low", capability: "standard", efforts: ["low", "high", "max"] },
16
+ "deepseek-v4-flash": { name: "DeepSeek V4 Flash", context: 1048000, output: 232000, cost: "medium", capability: "standard", efforts: ["low", "high", "max"] },
17
+ "deepseek-v4-flash-vision-exp": { name: "DeepSeek V4 Flash Vision (exp)", context: 1048000, output: 232000, input: ["image"], cost: "medium", capability: "standard", efforts: ["low", "high", "max"] },
18
+ "deepseek-v4-pro": { name: "DeepSeek V4 Pro", context: 1048000, output: 232000, cost: "high", capability: "advanced", efforts: ["low", "high", "max"] },
19
+ "deepseek-v4.1-flash": { name: "DeepSeek V4.1 Flash", context: 1048000, output: 232000, input: ["image"], cost: "low", capability: "advanced", efforts: ["low", "high", "max"] },
20
+ "glm-5.3-flash": { name: "GLM 5.3 Flash", context: 1048000, output: 232000, input: ["image", "video"], cost: "low", capability: "advanced", efforts: ["low", "high", "max"] },
21
+ "glm-5.3-flashx": { name: "GLM 5.3 FlashX", context: 1000000, output: 232000, input: ["image", "file", "video"], cost: "medium", capability: "advanced", efforts: ["low", "high", "max"] },
21
22
  "gpt-6-luna": { name: "GPT-6 Luna", context: 1050000, output: 304000, input: ["image", "file"], cost: "low", capability: "standard", efforts: [] },
22
- "kimi-k2.7-code": { name: "Kimi K2.7 Code", context: 262000, output: 262000, input: ["image"], cost: "medium", capability: "advanced", efforts: ["low", "high"] },
23
- "mimo-v2.6-flash": { name: "MiMo V2.6 Flash", context: 1048000, output: 232000, input: ["image", "audio", "video"], cost: "low", capability: "standard", efforts: ["low", "high"] },
24
- "mimo-v2.6-pro": { name: "MiMo V2.6 Pro", context: 1048000, output: 232000, input: ["image", "audio", "video"], cost: "medium", capability: "advanced", efforts: ["low", "high"] },
23
+ "kimi-k2.7-code": { name: "Kimi K2.7 Code", context: 262000, output: 262000, input: ["image"], cost: "medium", capability: "advanced", efforts: ["low", "high", "max"] },
24
+ "mimo-v2.6-flash": { name: "MiMo V2.6 Flash", context: 1048000, output: 232000, input: ["image", "audio", "video"], cost: "low", capability: "standard", efforts: ["low", "high", "max"] },
25
+ "mimo-v2.6-pro": { name: "MiMo V2.6 Pro", context: 1048000, output: 232000, input: ["image", "audio", "video"], cost: "medium", capability: "advanced", efforts: ["low", "high", "max"] },
25
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-opendesign-auth",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Open Design Cloud (Design Plan) in OpenCode and magpie: the account's device sign-in, its models, and the plan's 5-hour and 7-day allowance",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",