feat: add ops ai workspace dock control

This commit is contained in:
DCCONSTRUCTIONS
2026-06-09 12:48:06 +03:00
parent ee4a959a53
commit 6c119aae04
7 changed files with 231 additions and 2 deletions
@@ -0,0 +1,43 @@
/**
* Copyright (c) 2023-present Plane Software, Inc. and contributors
* SPDX-License-Identifier: AGPL-3.0-only
* See the LICENSE file for details.
*/
import { API_BASE_URL } from "@plane/constants";
import { APIService } from "@/services/api.service";
export type TAIWorkspaceExecutorStatus = "unknown" | "online" | "offline" | "checking" | "error";
export type TAIWorkspaceExecutor = {
id: string;
name: string;
type: string;
connectionMode: "hub" | "direct";
pairingCode?: string | null;
model?: string | null;
accountLabel?: string | null;
status: TAIWorkspaceExecutorStatus;
lastSeenAt?: string | null;
updatedAt?: string | null;
};
export type TAIWorkspaceExecutorListResponse = {
ok: boolean;
selectedExecutorId?: string | null;
executors: TAIWorkspaceExecutor[];
};
export class WorkspaceAIWorkspaceService extends APIService {
constructor() {
super(API_BASE_URL);
}
async listExecutors(workspaceSlug: string): Promise<TAIWorkspaceExecutorListResponse> {
return this.get(`/api/workspaces/${workspaceSlug}/ai-workspace/executors/`)
.then((response) => response?.data)
.catch((error) => {
throw error?.response?.data ?? error;
});
}
}