FEAT - TASKER CODEX: manage agent project grants

This commit is contained in:
DCCONSTRUCTIONS
2026-05-16 01:40:45 +03:00
parent 83ea515962
commit 3b96a2613b
29 changed files with 455 additions and 64 deletions
@@ -72,6 +72,11 @@ export type TCodexAgentTokenListResponse = {
tokens: TCodexAgentToken[];
};
export type TCodexAgentGrantListResponse = {
ok: boolean;
grants: TCodexAgentGrant[];
};
export type TCodexAgentSetupResponse = {
ok: boolean;
setup?: TCodexAgentSetupPacket;
@@ -129,6 +134,30 @@ export class WorkspaceCodexAgentService extends APIService {
});
}
async listGrants(workspaceSlug: string, agentId: string): Promise<TCodexAgentGrantListResponse> {
return this.get(`/api/workspaces/${workspaceSlug}/codex-agent-api/agents/${agentId}/grants/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async replaceProjectGrants(
workspaceSlug: string,
agentId: string,
data: {
mode?: TCodexAgentGrantMode;
project_ids: string[];
scopes: string[];
}
): Promise<TCodexAgentGrantListResponse> {
return this.post(`/api/workspaces/${workspaceSlug}/codex-agent-api/agents/${agentId}/grants/replace/`, data)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data;
});
}
async createToken(
workspaceSlug: string,
agentId: string,