feat(repos): access check reports the operations the agent can perform

This commit is contained in:
sam committed 2026-10-17 22:58:01 +11:00
1 parent 1410fbc565
commit b25263308b
5 files changed
+146 -102

No files matched your search

+3 -3
View File
@@ -93,7 +93,7 @@ function addRepo() {
open.value = String((draft.value.value as Repo[]).length - 1);
}
const protectOf = (repo: Repo) => repo.protect ?? [];
interface AccessCheck { verified?: boolean; account?: string; base_branch?: string; message: string }
interface AccessCheck { verified?: boolean; account?: string; base_branch?: string; operations?: string[]; message?: string }
const checkAgent=ref("");
const checking=ref("");
const results=ref<Record<string,AccessCheck>>({});
@@ -145,8 +145,8 @@ async function checkAccess(repo:Repo):Promise<void>{
<p v-if="unsaved" class="text-xs text-fg-muted">Save changes before checking access.</p>
<p v-if="agentError" class="text-xs text-danger" role="alert">{{agentError}}</p>
<p v-if="results[`${repo.owner}/${repo.name}`]" role="status" class="text-xs" :class="results[`${repo.owner}/${repo.name}`].verified ? 'text-ok' : 'text-danger'">
{{ results[`${repo.owner}/${repo.name}`].message }}
<span v-if="results[`${repo.owner}/${repo.name}`].verified">{{ results[`${repo.owner}/${repo.name}`].account }} · {{ results[`${repo.owner}/${repo.name}`].base_branch }}</span>
<template v-if="results[`${repo.owner}/${repo.name}`].verified">{{ results[`${repo.owner}/${repo.name}`].operations?.join(" · ") }} as {{ results[`${repo.owner}/${repo.name}`].account }}</template>
<template v-else>{{ results[`${repo.owner}/${repo.name}`].message }}</template>
</p>
</div>
</SettingRow>