openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
31 lines (30 loc) • 1.16 kB
JavaScript
import { t as captureResidentUserProfileAccess } from "./user-profile-list-D7DDbqt5.mjs";
//#region src/gateway/github-publication-inspect-reader.ts
/** Inspection verifies recorded publications are public; other readers require linked identity. */
function captureOwnGitHubPullRequestReader(e, t, n) {
const r = t();
const i = captureResidentUserProfileAccess(e);
const accountIds = () => {
const e = i.readCurrentFacts();
return r === "github.com" ? [...e.githubAccountIds ?? []] : (e.enterpriseGitHubAccounts ?? []).flatMap((e) => e.host === r ? [e.accountId] : []);
};
const a = accountIds();
if (!a.length && !n) throw new Error("Link a verified GitHub account on the configured host before inspecting your PR.");
return {
host: r,
accountIds: a,
publication: n,
identity: JSON.stringify([
e,
r,
a.toSorted((e, t) => e - t),
...n ? [n] : []
]),
assertCurrent: () => {
const e = accountIds();
if (t() !== r || !a.every((t) => e.includes(t))) throw new Error("Your linked GitHub identity changed; retry inspection with your current account.");
}
};
}
//#endregion
export { captureOwnGitHubPullRequestReader as t };