opencode-aicodewith-auth 0.1.46 → 0.1.48
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/index.js +13 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -694,6 +694,15 @@ function resolveInclude(body) {
|
|
|
694
694
|
}
|
|
695
695
|
return include;
|
|
696
696
|
}
|
|
697
|
+
function stripItemIds(input) {
|
|
698
|
+
return input.filter((item) => item.type !== "item_reference").map((item) => {
|
|
699
|
+
if ("id" in item) {
|
|
700
|
+
const { id, ...rest } = item;
|
|
701
|
+
return rest;
|
|
702
|
+
}
|
|
703
|
+
return item;
|
|
704
|
+
});
|
|
705
|
+
}
|
|
697
706
|
function filterOpenCodeSystemPrompts(input) {
|
|
698
707
|
if (!Array.isArray(input))
|
|
699
708
|
return input;
|
|
@@ -743,6 +752,7 @@ async function transformRequestBody(body, codexInstructions) {
|
|
|
743
752
|
body.stream = true;
|
|
744
753
|
body.instructions = codexInstructions;
|
|
745
754
|
if (body.input && Array.isArray(body.input)) {
|
|
755
|
+
body.input = stripItemIds(body.input);
|
|
746
756
|
body.input = filterOpenCodeSystemPrompts(body.input);
|
|
747
757
|
body.input = addCodexBridgeMessage(body.input, !!body.tools);
|
|
748
758
|
if (body.input) {
|
|
@@ -960,6 +970,9 @@ function transformClaudeResponse(response) {
|
|
|
960
970
|
if (!response.body) {
|
|
961
971
|
return response;
|
|
962
972
|
}
|
|
973
|
+
if (!response.ok) {
|
|
974
|
+
return response;
|
|
975
|
+
}
|
|
963
976
|
const reader = response.body.getReader();
|
|
964
977
|
const decoder = new TextDecoder;
|
|
965
978
|
const encoder = new TextEncoder;
|
|
@@ -2016,9 +2029,6 @@ var AicodewithCodexAuthPlugin = async (ctx) => {
|
|
|
2016
2029
|
if (input.model.providerID !== PROVIDER_ID2)
|
|
2017
2030
|
return;
|
|
2018
2031
|
if (isCodexModel(input.model.id)) {
|
|
2019
|
-
if (!output.options)
|
|
2020
|
-
output.options = {};
|
|
2021
|
-
output.options.store = true;
|
|
2022
2032
|
return;
|
|
2023
2033
|
}
|
|
2024
2034
|
if (!input.model.id?.startsWith("claude-"))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-aicodewith-auth",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"description": "OpenCode plugin for AICodewith authentication - Access GPT-5.3 Codex, GPT-5.2, Claude, and Gemini models through AICodewith API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|