bfi-cli 0.1.106 → 0.1.107
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/mcp-pm/main.mjs +10 -3
- package/package.json +1 -1
package/dist/mcp-pm/main.mjs
CHANGED
|
@@ -97,7 +97,7 @@ var PmRemote = class {
|
|
|
97
97
|
function messageOf(e) {
|
|
98
98
|
return e instanceof Error ? e.message : String(e);
|
|
99
99
|
}
|
|
100
|
-
const DEFAULT_MAX_MB =
|
|
100
|
+
const DEFAULT_MAX_MB = 50;
|
|
101
101
|
function resolveUploadRoots() {
|
|
102
102
|
return [...(process.env.BFI_UPLOAD_ROOTS || "").split(path.delimiter).map((s) => s.trim()).filter(Boolean), process.cwd()].map((p) => path.resolve(p));
|
|
103
103
|
}
|
|
@@ -124,8 +124,15 @@ async function resolveLocalFile(filePath, roots = resolveUploadRoots(), maxBytes
|
|
|
124
124
|
size: info.size
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function absoluteUploadUrl(uploadUrl, origin = PM_ORIGIN) {
|
|
128
|
-
|
|
127
|
+
function absoluteUploadUrl(uploadUrl, origin = PM_ORIGIN, pmUrl = process.env.BFI_PM_URL || "https://bfi.yyuap.com/bfi-api/bficli/api/v1/mcp/mcp") {
|
|
128
|
+
const url = new URL(uploadUrl, origin);
|
|
129
|
+
try {
|
|
130
|
+
const base = new URL(pmUrl);
|
|
131
|
+
const idx = base.pathname.indexOf("/bficli/api/");
|
|
132
|
+
const prefix = idx > 0 ? base.pathname.slice(0, idx) : "";
|
|
133
|
+
if (prefix && url.pathname.startsWith("/bficli/") && !url.pathname.startsWith(prefix + "/")) url.pathname = prefix + url.pathname;
|
|
134
|
+
} catch {}
|
|
135
|
+
return url.toString();
|
|
129
136
|
}
|
|
130
137
|
async function uploadToTicket(url, file, fetchImpl = fetch) {
|
|
131
138
|
const data = await readFile(file.realPath);
|