FEAT - TASKER CODEX: manage agent project grants
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user