openmates 0.11.0-alpha.4 → 0.11.0-alpha.6
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/{chunk-N6QY7K6L.js → chunk-NU4XR6MF.js} +14 -0
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -955,6 +955,7 @@ var CHAT_MODELS = [
|
|
|
955
955
|
{ id: "claude-haiku-4-5-20251001", name: "Claude Haiku 4.5" },
|
|
956
956
|
{ id: "gpt-5.4", name: "GPT-5.4" },
|
|
957
957
|
{ id: "gpt-oss-120b", name: "GPT-OSS-120b" },
|
|
958
|
+
{ id: "gpt-oss-20b", name: "GPT-OSS-20b" },
|
|
958
959
|
{ id: "gemini-3-flash-preview", name: "Gemini 3 Flash" },
|
|
959
960
|
{ id: "gemini-3-pro-image-preview", name: "Gemini 3 Pro" },
|
|
960
961
|
{ id: "gemini-3.1-pro-preview", name: "Gemini 3.1 Pro" },
|
|
@@ -4857,10 +4858,22 @@ function getUploadUrl(apiUrl) {
|
|
|
4857
4858
|
}
|
|
4858
4859
|
return "https://upload.openmates.org";
|
|
4859
4860
|
}
|
|
4861
|
+
function getUploadOrigin(apiUrl) {
|
|
4862
|
+
try {
|
|
4863
|
+
const url = new URL(apiUrl);
|
|
4864
|
+
if (url.hostname === "localhost") return "http://localhost:5173";
|
|
4865
|
+
if (url.hostname.startsWith("api.")) {
|
|
4866
|
+
return `${url.protocol}//app.${url.hostname.slice(4)}`;
|
|
4867
|
+
}
|
|
4868
|
+
} catch {
|
|
4869
|
+
}
|
|
4870
|
+
return "https://app.openmates.org";
|
|
4871
|
+
}
|
|
4860
4872
|
async function uploadFile(filePath, session) {
|
|
4861
4873
|
const filename = basename2(filePath);
|
|
4862
4874
|
const fileBytes = readFileSync4(filePath);
|
|
4863
4875
|
const uploadUrl = `${getUploadUrl(session.apiUrl)}/v1/upload/file`;
|
|
4876
|
+
const origin = getUploadOrigin(session.apiUrl);
|
|
4864
4877
|
const cookies = [];
|
|
4865
4878
|
if (session.cookies?.auth_refresh_token) {
|
|
4866
4879
|
cookies.push(`auth_refresh_token=${session.cookies.auth_refresh_token}`);
|
|
@@ -4876,6 +4889,7 @@ async function uploadFile(filePath, session) {
|
|
|
4876
4889
|
method: "POST",
|
|
4877
4890
|
body: formData,
|
|
4878
4891
|
headers: {
|
|
4892
|
+
Origin: origin,
|
|
4879
4893
|
...cookies.length > 0 ? { Cookie: cookies.join("; ") } : {}
|
|
4880
4894
|
},
|
|
4881
4895
|
signal: AbortSignal.timeout(10 * 60 * 1e3)
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED