4 Commits

Author SHA1 Message Date
681ffd2988 fix: gitignore + remove stray binaries from refactor commit 2026-05-31 20:35:22 +01:00
724075a8d6 refactor: import shared Plexum-anthropic-compat-client lib
internal/anthropic and internal/translate moved to the new
Plexum-anthropic-compat-client repo (extracted from MiniMax + Kimi
duplicates). cmd/plexum-minimax-provider-plugin imports them from
the shared module instead.

No behavioral change — same wire client, same translator.
Live re-verified after refactor: plexum say → "ready".
2026-05-31 20:35:09 +01:00
b7fad6dd26 docs: clarify Token Plan vs pay-per-token billing (key + model matrix)
Field investigation against the live API:
- sk-cp- (Token Plan)  + MiniMax-M2.7           →  works
- sk-cp- (Token Plan)  + MiniMax-M2.7-highspeed →  "Token Plan Starter
  (0/0 used)" — the base Token Plan EXCLUDES the highspeed variant
- sk-api- (pay-per-token) + either model        →  structurally
  (needs balance > 0; otherwise "insufficient_balance (1008)")

Plugin code already handles both key types via the same
Authorization: Bearer header — no functional change needed. README now
makes the matrix explicit so operators don't try highspeed on a
plan-only key and wonder why "0/0 used" comes back.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 16:10:11 +01:00
e44936990c feat: Plexum-minimax-provider v0.1 — MiniMax via Anthropic-compat endpoint
Plexum ProviderPlugin that serves MiniMax models through MiniMax's
Anthropic-compatible HTTP endpoint
(https://api.minimax.io/anthropic, or CN api.minimaxi.com). Inspired
by openclaw's extensions/minimax provider-registration, but rewritten
in Go for Plexum's SDK.

internal/anthropic/ (~210 LOC + 6 tests):
- minimal HTTP+SSE Anthropic Messages client (POST /v1/messages,
  stream:true, parses event:/data: SSE frames)
- handles non-2xx as HTTP error; stream errors land as Event{Type:"error"}
- 1 MiB SSE line cap; per-conn 5min timeout

internal/translate/ (~220 LOC):
- CanonicalToAnthropic: canonical.TurnRequest → MessagesRequest
- blockToAnthropic: TextBlock / ToolUseBlock / ToolResultBlock /
  ThinkingBlock → loose ContentBlock map; preserves signatures + cache
  control
- Translator: per-turn state machine; consumes anthropic.Event stream
  and emits canonical.TurnEvent stream (handles thinking blocks +
  tool_use input_json_delta accumulation + signature_delta capture)

cmd/plexum-minimax-provider-plugin/:
- Plugin manifest declares provider.models = [MiniMax-M2.7,
  MiniMax-M2.7-highspeed]
- Backend fixed to "api" (per scope); region "global"|"cn" + base_url
  override supported via config
- HostConfig from <profile>/plugins/plexum-minimax-provider/config.json
  {api_key, region?, base_url?, max_tokens_default?}

scripts/install.sh: build + manifest emit; operator writes config.json
+ allows plugin + adds an agent + restarts.

End-to-end verified against the real key:
1. plexum say --agent-id mini ... → "Hi, I'm MiniMax!"
2. Multi-turn continuity: agent recalled the prior reply
3. Via gateway socket: {"outcome":"text","text":"\n\npong"}
4. Via Fabric channel (alice posts → plugin inbound → mini agent
   → MiniMax → outbound REST → reply visible in bt2-clean seq=11):
     "Hi there! 👋 Fun fact: Octopuses have three hearts, blue blood,
      and neurons distributed throughout their arms—so their tentacles
      can 'think'"

The MiniMax-M2.7-highspeed variant works the same way but hit a
Code Plan rate-limit ceiling during testing (not a plugin issue).

Deferred:
- OAuth (Code Plan portal) — not in v1 scope per request
- MiniMax Portal provider (separate provider id minimax-portal)
- Image / TTS / video / music providers (separate plugins later)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-31 16:01:38 +01:00