@magpie-community/opencode-factory-auth 0.1.36 → 0.1.37

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 +9 -3
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -1563,10 +1563,16 @@ function anthropicBody(body) {
1563
1563
  continue
1564
1564
  }
1565
1565
  // Attribution is consumed here; Factory does not strip Anthropic's
1566
- // billing block and requires the Droid identity to be first.
1567
- if (block?.type === "text" && block.text?.startsWith("x-anthropic-billing-header: cc_version=")) {
1566
+ // billing block and requires the Droid identity to be first. Only the
1567
+ // header's own line goes: a block (or string system) that carries
1568
+ // instructions after it, such as Claude Code's auto-mode classifier
1569
+ // policy, keeps them and its other fields (#302).
1570
+ if (block?.type === "text" && block.text.startsWith("x-anthropic-billing-header: cc_version=")) {
1568
1571
  changed = true
1569
- continue
1572
+ const end = block.text.indexOf("\n")
1573
+ const rest = end < 0 ? "" : block.text.slice(end + 1)
1574
+ if (rest.trim() === "") continue
1575
+ block.text = rest
1570
1576
  }
1571
1577
  if (block?.type === "text") {
1572
1578
  // The gateway may join the identity and instructions into one block.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@magpie-community/opencode-factory-auth",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "Sign in to a Factory (Droid) subscription from OpenCode or magpie",
5
5
  "type": "module",
6
6
  "main": "./index.mjs",