pi-antigravity-rotator 2.1.1 → 2.1.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [2.1.2] - 2026-05-25
6
+
7
+ ### Added
8
+ - **Developer Role Support**: Added comprehensive compatibility and validation support for the newer `"developer"` role (introduced by OpenAI to replace the system prompt on models like o1/gpt-4o).
9
+ - **Developer Message Routing**: Automatically routes messages with the `"developer"` role as system instructions upstream in the Antigravity request mapping.
10
+ - **Improved Adapter Coverage**: Extended type validation and integration testing in the compat adapters to fully cover the new schema additions.
11
+
5
12
  ## [2.1.1] - 2026-05-21
6
13
 
7
14
  ### Added
package/README.md CHANGED
@@ -458,7 +458,7 @@ Current adapter scope:
458
458
 
459
459
  - Text chat/messages.
460
460
  - **Responses API compatibility**: Supports `POST /v1/responses` plus basic in-memory retrieve/delete/cancel/input-items endpoints for Codex-style agents.
461
- - **Model Role Support**: Fully supports the `"model"` role in chat message histories (e.g., from Pi or Hermes agents), validating and routing it identically to the `"assistant"` role.
461
+ - **Developer and Model Role Support**: Fully supports the `"developer"` (mapped to system instructions) and `"model"` roles in chat message histories, validating and routing them correctly.
462
462
  - **Request Normalization**: Automatically normalizes loose inputs (non-array messages), legacy prompt/input fields (e.g. `prompt` strings/arrays or `input` structures), and raw native Antigravity requests (`request.contents`) into standard OpenAI/Anthropic format.
463
463
  - **Native Reasoning visibility**: Models with thinking capabilities (Gemini 3 Pro, Gemini 3.5 Flash, Claude Sonnet 4.6 Thinking) automatically expose their interleaved thinking blocks in real-time as OpenAI `reasoning_content` or Anthropic `thinking_delta` chunks.
464
464
  - Streaming mode is supported as compatibility SSE. The adapter buffers the upstream Antigravity stream, then emits one OpenAI/Anthropic-compatible final delta. Native token-by-token pass-through is not implemented yet.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-antigravity-rotator",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Multi-account rotation proxy for Google Antigravity with per-model routing, real-time quota tracking, and infringement detection",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/compat.ts CHANGED
@@ -10,7 +10,7 @@ import { withRotation, flattenHeaders, type RequestBody } from "./proxy.js";
10
10
  const compatLogger = logger.child("compat");
11
11
 
12
12
  export interface ChatMessage {
13
- role: "system" | "user" | "assistant" | "model" | "tool";
13
+ role: "system" | "developer" | "user" | "assistant" | "model" | "tool";
14
14
  content: string | Array<{ type: string; text?: string;[key: string]: unknown }> | null;
15
15
  tool_calls?: OpenAIToolCall[];
16
16
  tool_call_id?: string;
@@ -531,7 +531,7 @@ function convertToolChoiceToGemini(toolChoice: unknown): GeminiToolConfig | unde
531
531
  function validateMessages(value: unknown): value is ChatMessage[] {
532
532
  return Array.isArray(value) && value.every((msg) => {
533
533
  if (!isRecord(msg)) return false;
534
- if (!["system", "user", "assistant", "model", "tool"].includes(String(msg.role))) return false;
534
+ if (!["system", "developer", "user", "assistant", "model", "tool"].includes(String(msg.role))) return false;
535
535
  return typeof msg.content === "string" || msg.content === null || Array.isArray(msg.content);
536
536
  });
537
537
  }
@@ -1009,7 +1009,7 @@ export function openAIToAntigravityBody(input: OpenAIChatCompletionRequest): Req
1009
1009
  // Separate system messages from conversation turns
1010
1010
  const systemParts: string[] = [];
1011
1011
  const conversationMessages = input.messages.filter((msg) => {
1012
- if (msg.role === "system") {
1012
+ if (msg.role === "system" || msg.role === "developer") {
1013
1013
  const text = typeof msg.content === "string" ? msg.content : extractText(msg.content);
1014
1014
  if (text) systemParts.push(text);
1015
1015
  return false;