8dd350286e
- Add Docker Compose and Dockerfile support for tool definitions - Implement readiness probes with configurable command, timeout, interval - Create ConfigFolder model for reusable file collections with project overrides - Add rich tool config fields: port_override, start_command, working_directory, env vars, volumes - Build unified Tool Workshop UI at /tool-workshop replacing /tool-configs and /tool-types - Update instance creation to support dockerfile builds, config folder mounting, readiness probes - Add 3 database migrations for tool_types, tool_configs, and new config_folders table - Create docker_build.py and readiness_probe.py services - Add config_folders API with CRUD and project override endpoints Quality gates: frontend build passes, Python syntax valid, all phases complete Addresses tool-workshop OpenSpec change
96 lines
2.4 KiB
TypeScript
96 lines
2.4 KiB
TypeScript
import { apiClient } from "./client";
|
|
|
|
export interface ConfigFolder {
|
|
id: string;
|
|
user_id: string;
|
|
name: string;
|
|
description: string | null;
|
|
mount_path: string;
|
|
files: Record<string, string>;
|
|
project_overrides: Record<string, { mount_path?: string; files?: Record<string, string> }> | null;
|
|
is_active: boolean;
|
|
created_at: string;
|
|
updated_at: string;
|
|
}
|
|
|
|
export interface CreateConfigFolderRequest {
|
|
name: string;
|
|
description?: string;
|
|
mount_path: string;
|
|
files?: Record<string, string>;
|
|
is_active?: boolean;
|
|
}
|
|
|
|
export interface UpdateConfigFolderRequest {
|
|
name?: string;
|
|
description?: string;
|
|
mount_path?: string;
|
|
files?: Record<string, string>;
|
|
is_active?: boolean;
|
|
}
|
|
|
|
export interface ProjectOverrideRequest {
|
|
mount_path?: string;
|
|
files?: Record<string, string>;
|
|
}
|
|
|
|
export const listConfigFolders = async (): Promise<ConfigFolder[]> => {
|
|
const response = await apiClient.get<ConfigFolder[]>("/config-folders");
|
|
return response.data;
|
|
};
|
|
|
|
export const getConfigFolder = async (id: string): Promise<ConfigFolder> => {
|
|
const response = await apiClient.get<ConfigFolder>(`/config-folders/${id}`);
|
|
return response.data;
|
|
};
|
|
|
|
export const createConfigFolder = async (
|
|
data: CreateConfigFolderRequest
|
|
): Promise<ConfigFolder> => {
|
|
const response = await apiClient.post<ConfigFolder>("/config-folders", data);
|
|
return response.data;
|
|
};
|
|
|
|
export const updateConfigFolder = async (
|
|
id: string,
|
|
data: UpdateConfigFolderRequest
|
|
): Promise<ConfigFolder> => {
|
|
const response = await apiClient.put<ConfigFolder>(`/config-folders/${id}`, data);
|
|
return response.data;
|
|
};
|
|
|
|
export const deleteConfigFolder = async (id: string): Promise<void> => {
|
|
await apiClient.delete(`/config-folders/${id}`);
|
|
};
|
|
|
|
export const addProjectOverride = async (
|
|
id: string,
|
|
projectId: string,
|
|
data: ProjectOverrideRequest
|
|
): Promise<ConfigFolder> => {
|
|
const response = await apiClient.post<ConfigFolder>(
|
|
`/config-folders/${id}/overrides/${projectId}`,
|
|
data
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
export const updateProjectOverride = async (
|
|
id: string,
|
|
projectId: string,
|
|
data: ProjectOverrideRequest
|
|
): Promise<ConfigFolder> => {
|
|
const response = await apiClient.put<ConfigFolder>(
|
|
`/config-folders/${id}/overrides/${projectId}`,
|
|
data
|
|
);
|
|
return response.data;
|
|
};
|
|
|
|
export const deleteProjectOverride = async (
|
|
id: string,
|
|
projectId: string
|
|
): Promise<void> => {
|
|
await apiClient.delete(`/config-folders/${id}/overrides/${projectId}`);
|
|
};
|