@magpie-community/opencode-factory-auth 0.1.13 → 0.1.15
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 +1 -1
- package/index.mjs +16 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -64,7 +64,7 @@ Each model is served on the one API droid uses for it:
|
|
|
64
64
|
| API | Models |
|
|
65
65
|
|---|---|
|
|
66
66
|
| Anthropic Messages (`/api/llm/a`) | Fable 5.1, Fable 5, Opus 5.5, Opus 5, Opus 4.8, Sonnet 5.5, Sonnet 5, Sonnet 4.6, Haiku 4.5, MiniMax M2.7 |
|
|
67
|
-
| OpenAI Responses (`/api/llm/o/v1`) | GPT-6 Sol/Astra/Luna, GPT-5.6 Sol/Terra/Luna, GPT-5.5, GPT-5.4, GPT-5.3-Codex, Grok 4.7, Grok 4.6 |
|
|
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, Grok 4.7, Grok 4.6 |
|
|
68
68
|
| Chat completions (`/api/llm/o/v1`) | GLM-5.3, GLM-5.3-Flash, GLM-5.2, Kimi K3, DeepSeek V4.1 Flash, Qwen3.8 Max, MiniMax M3, Mistral Medium 3.5, Nemotron 3 Ultra |
|
|
69
69
|
|
|
70
70
|
Reasoning efforts are the variants droid offers for each model.
|
package/index.mjs
CHANGED
|
@@ -46,6 +46,7 @@ const MODELS = [
|
|
|
46
46
|
["claude-sonnet-5", "Sonnet 5", ANTHROPIC, "anthropic", 872000, 128000, E5, true],
|
|
47
47
|
["claude-sonnet-4-6", "Sonnet 4.6", ANTHROPIC, "anthropic", 931000, 64000, ["low", "medium", "high", "max"], true],
|
|
48
48
|
["claude-haiku-4-5-20251001", "Haiku 4.5", ANTHROPIC, "anthropic", 0, 0, ["low", "medium", "high"], true],
|
|
49
|
+
["gpt-6.1-sol", "GPT-6.1 Sol", RESPONSES, "openai", 1050000, 128000, E5, true],
|
|
49
50
|
["gpt-6-sol", "GPT-6 Sol", RESPONSES, "openai", 1050000, 128000, E6, true],
|
|
50
51
|
["gpt-6-astra", "GPT-6 Astra", RESPONSES, "openai", 1050000, 128000, E5, true],
|
|
51
52
|
["gpt-6-luna", "GPT-6 Luna", RESPONSES, "openai", 1050000, 128000, E6, true],
|
|
@@ -742,6 +743,20 @@ function anthropicBody(body) {
|
|
|
742
743
|
}
|
|
743
744
|
continue
|
|
744
745
|
}
|
|
746
|
+
// Claude Code 2.1.288 also sends the same context as an array of text
|
|
747
|
+
// blocks (#658): each text block is adapted as the string would be,
|
|
748
|
+
// the blocks' other fields and any other block left as they are.
|
|
749
|
+
if (message?.role === "system" && Array.isArray(message.content)) {
|
|
750
|
+
for (const block of message.content) {
|
|
751
|
+
if (block?.type !== "text" || typeof block.text !== "string") continue
|
|
752
|
+
const adapted = systemContext(block.text)
|
|
753
|
+
if (adapted !== block.text) {
|
|
754
|
+
block.text = adapted
|
|
755
|
+
changed = true
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
continue
|
|
759
|
+
}
|
|
745
760
|
if (message?.role !== "user" || !Array.isArray(message.content)) continue
|
|
746
761
|
for (const block of message.content) {
|
|
747
762
|
if (block?.type === "tool_result") {
|
|
@@ -767,7 +782,7 @@ function anthropicBody(body) {
|
|
|
767
782
|
if (block.text.startsWith(INSTRUCTIONS_REMINDER) && block.text.includes(GLOBAL_INSTRUCTIONS)) {
|
|
768
783
|
block.text = block.text.replaceAll(GLOBAL_INSTRUCTIONS, "(global instructions)")
|
|
769
784
|
changed = true
|
|
770
|
-
} else if (HOOK_OUTPUT.test(block.text)) {
|
|
785
|
+
} else if (HOOK_OUTPUT.test(block.text) || SYSTEM_ENV_CONTEXT.test(block.text)) {
|
|
771
786
|
// a system message folded into the user's turn on its way here
|
|
772
787
|
const adapted = systemContext(block.text)
|
|
773
788
|
if (adapted !== block.text) {
|