openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 999 B
JavaScript
import { a as getRuntimeConfigSnapshot } from "./runtime-snapshot-WbwbY5b7.mjs";
import { t as normalizeCloudRepo } from "./cloud-worker-project-profiles-Dq45bFaA.mjs";
import { a as resolveConfiguredGitHubHost } from "./github-host-CjR25cOO.mjs";
import { t as parseProjectGitUrl } from "./project-git-url-CNyTGfDQ.mjs";
//#region src/gateway/configured-default-repository.ts
/** Operator repository selection shared by the picker and prepared pool. */
function configuredDefaultRepository(e = getRuntimeConfigSnapshot()) {
const t = e?.gateway?.projects?.defaultRepository;
if (!t) return;
const n = parseProjectGitUrl(t.url, resolveConfiguredGitHubHost(e));
if (!n) return;
const r = new URL(n.url).pathname.slice(1, -4);
const i = normalizeCloudRepo(n.url);
const a = i ? e?.cloudWorkers?.projectProfiles?.[i] : void 0;
return {
identity: r,
url: n.url,
...t.ref ? { ref: t.ref } : {},
...a ? { profileId: a } : {}
};
}
//#endregion
export { configuredDefaultRepository as t };