refactor: add effect-ts and refactor codes

This commit is contained in:
d-kimsuon
2025-10-15 23:22:27 +09:00
parent 94cc1c0630
commit 21070d09ff
76 changed files with 7598 additions and 1950 deletions

View File

@@ -74,10 +74,10 @@ export const claudeCommandsQuery = (projectId: string) =>
},
}) as const;
export const aliveTasksQuery = {
queryKey: ["aliveTasks"],
export const sessionProcessesQuery = {
queryKey: ["sessionProcesses"],
queryFn: async () => {
const response = await honoClient.api.tasks.alive.$get({});
const response = await honoClient.api.cc["session-processes"].$get({});
if (!response.ok) {
throw new Error(`Failed to fetch alive tasks: ${response.statusText}`);
@@ -123,18 +123,23 @@ export const gitCommitsQuery = (projectId: string) =>
},
}) as const;
export const mcpListQuery = {
queryKey: ["mcp", "list"],
queryFn: async () => {
const response = await honoClient.api.mcp.list.$get();
export const mcpListQuery = (projectId: string) =>
({
queryKey: ["mcp", "list", projectId],
queryFn: async () => {
const response = await honoClient.api.projects[
":projectId"
].mcp.list.$get({
param: { projectId },
});
if (!response.ok) {
throw new Error(`Failed to fetch MCP list: ${response.statusText}`);
}
if (!response.ok) {
throw new Error(`Failed to fetch MCP list: ${response.statusText}`);
}
return await response.json();
},
} as const;
return await response.json();
},
}) as const;
export const fileCompletionQuery = (projectId: string, basePath: string) =>
({
@@ -151,7 +156,7 @@ export const fileCompletionQuery = (projectId: string, basePath: string) =>
throw new Error("Failed to fetch file completion");
}
return response.json();
return await response.json();
},
}) as const;