@magpie-community/opencode-factory-auth 0.1.42 → 0.1.43

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
@@ -63,17 +63,27 @@ Each model is served on the one API droid uses for it:
63
63
 
64
64
  | API | Models |
65
65
  |---|---|
66
- | Anthropic Messages (`/api/llm/a`) | Fable 5.1, Fable 5, Opus 5.5, Opus 5, Opus 4.8 (each also in Fast Mode), Sonnet 5.5, Sonnet 5, Sonnet 4.6, Haiku 5.5, Haiku 4.5, MiniMax M2.7 |
67
- | OpenAI Responses (`/api/llm/o/v1`) | GPT-6.1 Sol, GPT-6 Sol/Astra/Luna, GPT-5.6 Sol/Terra/Luna, GPT-5.5, GPT-5.4, GPT-5.3-Codex (each also in Fast Mode), Grok 4.7, Grok 4.6 |
68
- | Chat completions (`/api/llm/o/v1`) | GLM-5.3, GLM-5.3-Flash, GLM-5.2, Kimi K3, DeepSeek V4.1 Flash, DeepSeek V4.1 Flash 1017, Qwen3.8 Max, MiniMax M3, Mistral Large 4, Mistral Medium 3.5, Nemotron 3 Ultra |
66
+ | Anthropic Messages (`/api/llm/a`) | Fable 5.2, Fable 5.1, Fable 5, Opus 5.5, Opus 5, Opus 4.8 (each also in Fast Mode), Sonnet 5.5, Sonnet 5, Sonnet 4.6, Haiku 5.5, Haiku 4.5, MiniMax M2.7 |
67
+ | OpenAI Responses (`/api/llm/o/v1`) | GPT-6.1 Sol, GPT-6 Sol/Astra/Luna, GPT-5.6 Sol/Terra/Luna, GPT-5.5, GPT-5.4, GPT-5.3-Codex (GPT-6 Sol/Luna, GPT-5.6 Sol, GPT-5.5, GPT-5.4 and GPT-5.3-Codex also in Fast Mode), Grok 4.7, Grok 4.6 |
68
+ | Chat completions (`/api/llm/o/v1`) | GLM-5.3, GLM-5.3-Flash, GLM-5.2, GLM-5.2 Fast, Kimi K3.1 Pro, Kimi K3, DeepSeek V4.1 Flash, DeepSeek V4.1 Flash 1017, Qwen3.8 Max, MiniMax M3.1 Flash, MiniMax M3, Mistral Large 4, Mistral Medium 3.5, Nemotron 3.5 Super, Nemotron 3 Ultra, Inkling, Muse Spark 1.2, Beam 1.0 |
69
69
  | Gemini generate (`/api/llm/g/v1/generate`) | Gemini 4 Argon, Gemini 3.1 Pro, Gemini 3.8/3.7/3.6/3.5 Flash, Gemini 3 Flash |
70
70
 
71
71
  Reasoning efforts are the variants droid offers for each model. DeepSeek V4.1
72
- Flash (1017 too), Kimi K3 and GLM-5.2 have `none`, droid's "off": they stop
73
- thinking.
72
+ Flash (1017 too), Kimi K3 and GLM-5.2 (GLM-5.2 Fast too) have `none`, droid's
73
+ "off": they stop thinking.
74
74
  Reasoning is mandatory on GLM-5.3 and GLM-5.3-Flash (Fireworks turns `none`
75
75
  away), so `low` is their least.
76
76
 
77
+ droid 1.7.0's new models are included where droid 1.7.0 lists them for an
78
+ account with no special access, at its registry's limits, efforts and
79
+ multipliers. Fable 5.2 asks for the same data-retention terms as Fable 5.1
80
+ in droid; it is placed after the other non-Fast models so magpie's first 24
81
+ stay as they were (#119). Muse Spark 1.2 is on Fireworks but in droid's
82
+ standard pool, so Droid Core's windows don't count it. GPT-6.1 Terra and
83
+ Muse Spark Open (feature-flagged), GPT-6.1 Sol Ultra Fast (high-cost terms)
84
+ and Muse Spark 1.3 (Responses on Google, which the plugin doesn't send) are
85
+ not included.
86
+
77
87
  DeepSeek V4.1 Flash 1017 (`deepseek-v4.1-flash-1017`) is a separate model
78
88
  entry, with droid 0.251.0's 1,040,000-token context, 131,072-token output,
79
89
  image support, `none`/`low`/`high`/`max` efforts and 0.12x token multiplier.
@@ -87,8 +97,9 @@ A model's price is its token multiplier in droid's registry
87
97
  (`0.8×`), so a cheap one is picked without opening droid. A promotion running
88
98
  comes off it, with the multiplier before the discount struck through beside
89
99
  the price (`rateWas`): Mistral Large 4's launch discount, Gemini 4 Argon's,
90
- Gemini 3.8/3.7 Flash's and GPT-5.6 Sol's, each while droid's own dates for it
91
- hold. A promotion that has ended is no discount at all.
100
+ Gemini 3.8/3.7 Flash's and GPT-5.6 Sol's (its Fast Mode too), each while
101
+ droid's own dates for it hold. A promotion that has ended is no discount at
102
+ all.
92
103
 
93
104
  Gemini's requests go to Factory's generate route with the model in the
94
105
  body, droid's line opening the system instruction. Gemini 4 Argon is behind
@@ -102,8 +113,9 @@ beta on Anthropic's API, at `service_tier: "priority"` on OpenAI's. A request
102
113
  that asks the base model for fast (Claude Code's `speed: "fast"`, a
103
114
  Responses request's `service_tier: "priority"`) is sent to its Fast Mode
104
115
  model, as droid's own fast toggle does: asked of the base model, Factory
105
- answered at standard speed (#119). Opus 4.6/4.7 Fast, GPT-5.4 Mini Fast, GPT-5.6 Sol Fast (unreleased)
106
- and GLM-5.2 Fast (behind a feature flag) are not included.
116
+ answered at standard speed (#119). GLM-5.2 Fast is a model of its own on
117
+ chat completions, at droid's 524,288-token context, and isn't sent for fast
118
+ asked of GLM-5.2. Opus 4.6/4.7 Fast and GPT-5.4 Mini Fast are not included.
107
119
 
108
120
  auto is not included: droid picks it on the client side.
109
121
 
package/index.mjs CHANGED
@@ -54,8 +54,15 @@ const E4 = ["low", "medium", "high", "xhigh"]
54
54
  // refused it. The Fast Mode models are droid 0.240.0's (fastBody; testdata/
55
55
  // droid-0.240.0-fast.txt), at their base model's limits and efforts as
56
56
  // droid has them. Left out: Opus 4.6/4.7 Fast and GPT-5.4 Mini Fast (their
57
- // base models aren't offered), GPT-5.6 Sol Fast (unreleased:!0) and
58
- // GLM-5.2 Fast (behind a feature flag, on a Baseten model id of its own).
57
+ // base models aren't offered). droid 1.7.0's new models (testdata/
58
+ // droid-1.7.0-models.txt) are offered where droid 1.7.0 lists them for an
59
+ // account with no special access: Fable 5.2, Kimi K3.1 Pro, Nemotron 3.5
60
+ // Super, MiniMax M3.1 Flash, Inkling, Muse Spark 1.2, Beam 1.0, and GPT-6
61
+ // Sol, GPT-6 Luna, GPT-5.6 Sol and GLM-5.2 Fast (GLM-5.2 Fast at its own
62
+ // limits). Left out: GPT-6.1 Terra and Muse Spark Open (feature flags droid
63
+ // lists them under only once on), GPT-6.1 Sol Ultra Fast (high-cost terms,
64
+ // as Astra's), and Muse Spark 1.3 (Responses on Google, a route the plugin
65
+ // has no wire for).
59
66
  const MODELS = [
60
67
  ["claude-fable-5.1", "Fable 5.1", ANTHROPIC, "anthropic", 867000, 128000, E5, true, 4],
61
68
  ["claude-fable-5", "Fable 5", ANTHROPIC, "anthropic", 867000, 128000, E5, true, 4],
@@ -85,15 +92,21 @@ const MODELS = [
85
92
  ["glm-5.3", "GLM-5.3", CHAT, "fireworks", 1040000, 131072, ["low", "high", "max"], false, 0.56],
86
93
  ["glm-5.3-flash", "GLM-5.3-Flash", CHAT, "fireworks", 1048576, 131072, ["low", "high", "max"], true, 0.06],
87
94
  ["glm-5.2", "GLM-5.2", CHAT, "baseten", 1040000, 131072, ["none", "high", "max"], false, 0.56],
95
+ ["kimi-k3.1-pro", "Kimi K3.1 Pro", CHAT, "fireworks", 1000000, 131072, ["low", "high", "max"], true, 0.8],
88
96
  ["kimi-k3", "Kimi K3", CHAT, "fireworks", 262144, 65536, ["none", "low", "high", "max"], true, 1.2],
89
97
  ["deepseek-v4.1-flash", "DeepSeek V4.1 Flash", CHAT, "fireworks", 1040000, 131072, ["none", "low", "high", "max"], true, 0.12],
90
98
  ["deepseek-v4.1-flash-1017", "DeepSeek V4.1 Flash 1017", CHAT, "fireworks", 1040000, 131072, ["none", "low", "high", "max"], true, 0.12],
91
99
  ["qwen3.8-max", "Qwen3.8 Max", CHAT, "fireworks", 262144, 131072, ["low", "medium", "xhigh"], false, 0.8],
100
+ ["minimax-m3.1-flash", "MiniMax M3.1 Flash", CHAT, "fireworks", 1000000, 131072, E5, true, 0.06],
92
101
  ["minimax-m3", "MiniMax M3", CHAT, "fireworks", 512000, 64000, ["high"], true, 0.12],
93
102
  ["minimax-m2.7", "MiniMax M2.7", ANTHROPIC, "fireworks", 196600, 64000, ["high"], false, 0.12],
94
103
  ["mistral-large-4", "Mistral Large 4", CHAT, "mistral", 524288, 64000, ["high"], true, 0.544],
95
104
  ["mistral-medium-3.5", "Mistral Medium 3.5", CHAT, "mistral", 256000, 64000, ["high"], true, 0.6],
105
+ ["nemotron-3.5-super", "Nemotron 3.5 Super", CHAT, "baseten", 1000000, 65536, ["high"], true, 0.08],
96
106
  ["nemotron-3-ultra", "Nemotron 3 Ultra", CHAT, "baseten", 202000, 65536, ["high"], false, 0.24],
107
+ ["inkling", "Inkling", CHAT, "fireworks", 1040000, 32768, ["minimal", "low", "medium", "high", "xhigh", "max"], true, 0.4],
108
+ ["muse-spark-1.2", "Muse Spark 1.2", CHAT, "fireworks", 1040000, 131072, E4, false, 0.5],
109
+ ["beam-1.0", "Beam 1.0", CHAT, "baseten", 1048576, 32768, E5, false, 0.52],
97
110
  ["gemini-4-argon", "Gemini 4 Argon", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true, 1.6],
98
111
  ["gemini-3.1-pro-preview", "Gemini 3.1 Pro", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true, 0.8],
99
112
  ["gemini-3.8-flash", "Gemini 3.8 Flash", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true, 0.6],
@@ -101,6 +114,9 @@ const MODELS = [
101
114
  ["gemini-3.6-flash", "Gemini 3.6 Flash", GEMINI, "google", 1000000, 65536, ["low", "medium", "high"], true, 0.6],
102
115
  ["gemini-3.5-flash", "Gemini 3.5 Flash", GEMINI, "google", 1000000, 65536, ["minimal", "low", "medium", "high"], true, 0.6],
103
116
  ["gemini-3-flash-preview", "Gemini 3 Flash", GEMINI, "google", 1000000, 65536, ["minimal", "low", "medium", "high"], true, 0.2],
117
+ // after the rest, as the Fast Mode models are: first, it would push
118
+ // GLM-5.3-Flash out of magpie's first 24 (#119)
119
+ ["claude-fable-5.2", "Fable 5.2", ANTHROPIC, "anthropic", 867000, 128000, E5, true, 3.2],
104
120
  // The Fast Mode models come last: magpie shows a provider with no models
105
121
  // picked only the first 24 of its list, and placed beside their base
106
122
  // models in 0.1.27 they pushed GPT-5.3-Codex, Grok 4.7, Grok 4.6, GLM-5.3
@@ -113,6 +129,10 @@ const MODELS = [
113
129
  ["gpt-5.5-fast", "GPT-5.5 Fast Mode", RESPONSES, "openai", 1050000, 128000, E4, true, 5],
114
130
  ["gpt-5.4-fast", "GPT-5.4 Fast Mode", RESPONSES, "openai", 1050000, 128000, E4, true, 2],
115
131
  ["gpt-5.3-codex-fast", "GPT-5.3-Codex Fast Mode", RESPONSES, "openai", 400000, 128000, E4, true, 1.4],
132
+ ["gpt-6-sol-fast", "GPT-6 Sol Fast Mode", RESPONSES, "openai", 1050000, 128000, E6, true, 1.6],
133
+ ["gpt-6-luna-fast", "GPT-6 Luna Fast Mode", RESPONSES, "openai", 1050000, 128000, E6, true, 0.08],
134
+ ["gpt-5.6-sol-fast", "GPT-5.6 Sol Fast Mode", RESPONSES, "openai", 1050000, 128000, E6, true, 4],
135
+ ["glm-5.2-fast", "GLM-5.2 Fast", CHAT, "baseten", 524288, 131072, ["none", "high", "max"], false, 0.84],
116
136
  ].map(([id, name, wire, upstream, context, output, efforts, images, rate]) => ({ id, name, wire, upstream, context, output, efforts, images, rate }))
117
137
 
118
138
  const byId = new Map(MODELS.map((m) => [m.id, m]))
@@ -172,6 +192,7 @@ function variant(npm, effort) {
172
192
  // promotion that has ended is no discount at all.
173
193
  const PROMOTIONS = [
174
194
  { id: "gpt-5.6-sol", discount: 0.2, from: "2026-08-22T00:00:00Z", to: "2026-11-22T00:00:00Z" },
195
+ { id: "gpt-5.6-sol-fast", discount: 0.2, from: "2026-08-22T00:00:00Z", to: "2026-11-22T00:00:00Z" },
175
196
  { id: "mistral-large-4", discount: 0.5, from: "2026-10-06T00:00:00Z", to: "2026-10-20T00:00:00Z" },
176
197
  { id: "gemini-4-argon", discount: 0.5, from: "2026-10-13T16:00:00Z", to: "2026-12-01T08:00:00Z" },
177
198
  { id: "gemini-3.8-flash", discount: 0.5, from: "2026-08-17T21:10:19Z", to: "2027-01-01T08:00:00Z" },
@@ -940,8 +961,10 @@ async function deviceSignIn() {
940
961
  // is a balance in cents.
941
962
 
942
963
  // CORE are the models Droid Core's windows count: those of a vendor other
943
- // than Anthropic, OpenAI, xAI and Google. Standard's count every other model.
944
- const CORE = MODELS.filter((m) => !["anthropic", "openai", "xai", "google"].includes(m.upstream)).map((m) => m.id)
964
+ // than Anthropic, OpenAI, xAI and Google, but Muse Spark 1.2, Meta's on
965
+ // Fireworks, which droid keeps out of the core pool (no billingPool "core").
966
+ // Standard's count every other model.
967
+ const CORE = MODELS.filter((m) => !["anthropic", "openai", "xai", "google"].includes(m.upstream) && m.id !== "muse-spark-1.2").map((m) => m.id)
945
968
 
946
969
  // statusLine is a status as Go's HTTP client names it, "403 Forbidden".
947
970
  const statusLine = (status) => `${status} ${STATUS_CODES[status] ?? ""}`.trim()
package/opencode2.mjs CHANGED
@@ -85,8 +85,10 @@ export function fieldsOf(prompts) {
85
85
  if (p.placeholder) f.placeholder = String(p.placeholder)
86
86
  if (p.type === "select" && Array.isArray(p.options))
87
87
  f.options = p.options.map((o) => ({ value: String(o.value), label: String(o.label ?? o.value), ...(o.hint ? { description: String(o.hint) } : {}) }))
88
- // a prompt shown only when another answer says so can't be required
89
- if (!p.condition) f.required = true
88
+ // a prompt shown only when another answer says so can't be required, and
89
+ // neither can one whose own validate() accepts an empty answer (the
90
+ // browser sign-in's optional API key)
91
+ if (!p.condition && p.required !== false) f.required = true
90
92
  out.push(f)
91
93
  }
92
94
  return out.length ? out : undefined
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-factory-auth",
3
- "version": "0.1.42",
3
+ "version": "0.1.43",
4
4
  "description": "Sign in to a Factory (Droid) subscription from OpenCode or magpie",
5
5
  "type": "module",
6
6
  "main": "./opencode.mjs",