@wengine-ai/llms 2.3.2403 → 2.3.2404
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/dist/cjs/server.cjs +42 -42
- package/dist/cjs/server.cjs.map +3 -3
- package/dist/esm/server.mjs +37 -37
- package/dist/esm/server.mjs.map +3 -3
- package/dist/transformer/opencode.transformer.d.ts +16 -1
- package/package.json +2 -2
|
@@ -25,12 +25,27 @@ import { Transformer, TransformerOptions } from "../types/transformer";
|
|
|
25
25
|
* thinking format expected by Claude Code.
|
|
26
26
|
* - Replaces purely-numeric tool_call IDs with UUID-based IDs to avoid
|
|
27
27
|
* downstream parsing issues.
|
|
28
|
+
* - Sends a stable x-opencode-session header. OpenCode Go rejects requests
|
|
29
|
+
* without it (400 MissingSessionID) and uses the value for routing and
|
|
30
|
+
* prompt caching, so it must stay constant for the whole conversation —
|
|
31
|
+
* reusing the coding agent's own session id is the intended usage.
|
|
28
32
|
*/
|
|
29
33
|
export declare class OpenCodeTransformer implements Transformer {
|
|
30
34
|
private readonly options?;
|
|
31
35
|
static TransformerName: string;
|
|
32
36
|
endPoint: string;
|
|
33
37
|
constructor(options?: TransformerOptions | undefined);
|
|
34
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Resolve a stable per-conversation session id for x-opencode-session.
|
|
40
|
+
*
|
|
41
|
+
* Priority: the client's own x-opencode-session header (opencode CLI native),
|
|
42
|
+
* the session id CCR's client adapter already extracted (Claude Code encodes
|
|
43
|
+
* it in metadata.user_id), the same value mirrored onto req.sessionId, a
|
|
44
|
+
* direct extraction from the body's metadata.user_id, and finally the Codex
|
|
45
|
+
* native session_id header. A per-request UUID is the last resort: it keeps
|
|
46
|
+
* Go endpoints from 400ing but forfeits their cross-request cache affinity.
|
|
47
|
+
*/
|
|
48
|
+
private resolveSessionId;
|
|
49
|
+
transformRequestIn(request: UnifiedChatRequest, provider?: any, context?: Record<string, any>): Promise<Record<string, any>>;
|
|
35
50
|
transformResponseOut(response: Response): Promise<Response>;
|
|
36
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wengine-ai/llms",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2404",
|
|
4
4
|
"description": "A universal LLM API transformation server",
|
|
5
5
|
"main": "dist/cjs/server.cjs",
|
|
6
6
|
"module": "dist/esm/server.mjs",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"uuid": "^11.1.0",
|
|
53
53
|
"@fastify/multipart": "^9.0.0",
|
|
54
54
|
"@fastify/static": "^8.2.0",
|
|
55
|
-
"@wengine-ai/claude-code-router-shared": "^2.3.
|
|
55
|
+
"@wengine-ai/claude-code-router-shared": "^2.3.2404",
|
|
56
56
|
"adm-zip": "^0.5.16",
|
|
57
57
|
"better-sqlite3": "^12.10.0",
|
|
58
58
|
"rotating-file-stream": "^3.2.7"
|