@arcadialdev/arcality 4.0.2 → 4.1.0
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/package.json +1 -1
- package/scripts/gen-and-run.mjs +2640 -2612
- package/tests/_helpers/agentic-runner.bundle.spec.js +9 -2
|
@@ -4282,13 +4282,20 @@ function resolveTargetUrl(baseUrl, currentUrl, targetPath) {
|
|
|
4282
4282
|
const parsedBase = new URL(baseUrl || referenceUrl);
|
|
4283
4283
|
const parsedReference = new URL(referenceUrl);
|
|
4284
4284
|
const normalizedTarget = targetPath.trim();
|
|
4285
|
+
const basePath = parsedBase.pathname.replace(/\/+$/, "");
|
|
4286
|
+
if (normalizedTarget.startsWith("?") || normalizedTarget.startsWith("#")) {
|
|
4287
|
+
return new URL(normalizedTarget, parsedReference).toString();
|
|
4288
|
+
}
|
|
4285
4289
|
if (normalizedTarget.startsWith("/")) {
|
|
4286
|
-
const basePath = parsedBase.pathname.replace(/\/+$/, "");
|
|
4287
4290
|
const targetAlreadyIncludesBase = basePath && (normalizedTarget === basePath || normalizedTarget.startsWith(`${basePath}/`));
|
|
4288
4291
|
const combinedPath = targetAlreadyIncludesBase ? normalizedTarget : `${basePath}${normalizedTarget}`.replace(/\/{2,}/g, "/");
|
|
4289
4292
|
return new URL(`${parsedBase.origin}${combinedPath}`).toString();
|
|
4290
4293
|
}
|
|
4291
|
-
|
|
4294
|
+
if (normalizedTarget.startsWith("./") || normalizedTarget.startsWith("../")) {
|
|
4295
|
+
return new URL(normalizedTarget, parsedReference).toString();
|
|
4296
|
+
}
|
|
4297
|
+
const childPath = `${basePath}/${normalizedTarget}`.replace(/\/{2,}/g, "/");
|
|
4298
|
+
return new URL(`${parsedBase.origin}${childPath}`).toString();
|
|
4292
4299
|
}
|
|
4293
4300
|
function writeBatchMissionResult(payload) {
|
|
4294
4301
|
const runDomainDir = process.env.ARCALITY_RUN_DOMAIN_DIR;
|