feat: add Ops AI Workspace npm setup command

This commit is contained in:
DCCONSTRUCTIONS
2026-06-24 20:40:12 +03:00
parent 763b90f3ba
commit 43e5f570e5
7 changed files with 160 additions and 31 deletions
@@ -139,6 +139,21 @@ export type TAIWorkspaceBridgeEventsResponse = {
events: TAIWorkspaceBridgeEvent[];
};
export type TAIWorkspaceAgentSetupCommandResponse = {
ok: boolean;
executorId?: string;
install?: {
command?: string;
packageName?: string;
gatewayUrl?: string;
expiresAt?: string;
};
setupCode?: {
suffix?: string;
expiresAt?: string;
};
};
export type TAIWorkspaceOpsProject = {
id: string;
identifier?: string | null;
@@ -284,6 +299,22 @@ export class WorkspaceAIWorkspaceService extends APIService {
return this.listExecutors(workspaceSlug);
}
async createAgentSetupCommand(
workspaceSlug: string,
executorId: string,
options: { port?: string | number; opsWorkspaceSlug?: string; opsProjectId?: string } = {}
): Promise<TAIWorkspaceAgentSetupCommandResponse> {
return this.post(`/api/workspaces/${workspaceSlug}/ai-workspace/executors/${executorId}/agent/setup-command/`, {
port: String(options.port || "").trim() || undefined,
opsWorkspaceSlug: String(options.opsWorkspaceSlug || "").trim() || undefined,
opsProjectId: String(options.opsProjectId || "").trim() || undefined,
})
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data ?? error;
});
}
getWindowsAgentInstallerUrl(
workspaceSlug: string,
executorId: string,