@opencode/ai 0.0.0-dev-20268 → 0.0.0-dev-20274
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/dist/cache-policy.js
CHANGED
|
@@ -37,6 +37,7 @@ const resolve = (policy) => {
|
|
|
37
37
|
// whole policy pass for these — emitting hints would be harmless but pointless.
|
|
38
38
|
const RESPECTS_INLINE_HINTS = new Set([
|
|
39
39
|
"anthropic-messages",
|
|
40
|
+
"anthropic-compatible-messages",
|
|
40
41
|
"google-vertex-messages",
|
|
41
42
|
"bedrock-converse",
|
|
42
43
|
"openrouter",
|
|
@@ -2,7 +2,8 @@ import { AnthropicMessages } from "../protocols/anthropic-messages.js";
|
|
|
2
2
|
import { Auth } from "../route/auth.js";
|
|
3
3
|
import { ProviderConfigurationError, ProviderID } from "../schema/index.js";
|
|
4
4
|
export const id = ProviderID.make("anthropic-compatible");
|
|
5
|
-
|
|
5
|
+
const compatibleRoute = AnthropicMessages.route.with({ id: "anthropic-compatible-messages", provider: id });
|
|
6
|
+
export const routes = [compatibleRoute];
|
|
6
7
|
const auth = (input) => {
|
|
7
8
|
if ("auth" in input && input.auth)
|
|
8
9
|
return input.auth;
|
|
@@ -16,7 +17,7 @@ export const configure = (input) => {
|
|
|
16
17
|
message: "Anthropic-compatible providers require a baseURL",
|
|
17
18
|
});
|
|
18
19
|
const { provider: _, baseURL, apiKey: _apiKey, auth: _auth, ...rest } = input;
|
|
19
|
-
const route = AnthropicMessages.route.with({
|
|
20
|
+
const route = (provider === "anthropic" ? AnthropicMessages.route : compatibleRoute).with({
|
|
20
21
|
...rest,
|
|
21
22
|
provider,
|
|
22
23
|
endpoint: { baseURL },
|
package/dist/providers/xai.js
CHANGED
|
@@ -13,13 +13,13 @@ const baseURL = "https://api.x.ai/v1";
|
|
|
13
13
|
const RESPONSES_WEBSOCKET_ROTATE_AFTER_MS = 24 * 60 * 1000;
|
|
14
14
|
const responsesRoute = Route.make({
|
|
15
15
|
compact: { endpoint: XAIResponses.compact },
|
|
16
|
-
id: "
|
|
16
|
+
id: "xai-responses",
|
|
17
17
|
provider: id,
|
|
18
18
|
providerMetadataKey: "xai",
|
|
19
19
|
protocol: XAIResponses.protocol,
|
|
20
20
|
endpoint: Endpoint.path("/responses", { baseURL }),
|
|
21
21
|
transport: OpenResponsesChannel.transport({
|
|
22
|
-
id: "
|
|
22
|
+
id: "xai-responses",
|
|
23
23
|
name: "xAI Responses",
|
|
24
24
|
rotateAfterMs: RESPONSES_WEBSOCKET_ROTATE_AFTER_MS,
|
|
25
25
|
// xAI continues a chain only from stored responses: with `store: false` (the route default) `previous_response_id`
|
|
@@ -30,7 +30,7 @@ const responsesRoute = Route.make({
|
|
|
30
30
|
defaults: { providerOptions: { store: false, include: ["reasoning.encrypted_content"] } },
|
|
31
31
|
});
|
|
32
32
|
const chatRoute = Route.make({
|
|
33
|
-
id: "
|
|
33
|
+
id: "xai-chat",
|
|
34
34
|
provider: id,
|
|
35
35
|
providerMetadataKey: "xai",
|
|
36
36
|
protocol: OpenAIChat.protocol,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-20274",
|
|
4
4
|
"name": "@opencode/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
36
36
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
37
|
-
"@opencode/http-recorder": "0.0.0-dev-
|
|
37
|
+
"@opencode/http-recorder": "0.0.0-dev-20274",
|
|
38
38
|
"@tsconfig/bun": "1.0.9",
|
|
39
39
|
"@types/bun": "1.4.0",
|
|
40
40
|
"@typescript/native-preview": "7.0.0-dev.20251207.1",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
45
45
|
"@smithy/eventstream-codec": "4.2.14",
|
|
46
46
|
"@smithy/util-utf8": "4.2.2",
|
|
47
|
-
"@opencode/schema": "0.0.0-dev-
|
|
47
|
+
"@opencode/schema": "0.0.0-dev-20274",
|
|
48
48
|
"aws4fetch": "1.0.20",
|
|
49
49
|
"effect": "4.0.0-rc.112",
|
|
50
50
|
"google-auth-library": "10.5.0"
|