mirror of
https://github.com/aljazceru/claude-code-viewer.git
synced 2025-12-30 19:54:21 +01:00
feat: system information view
This commit is contained in:
@@ -4,6 +4,7 @@ import type { ControllerResponse } from "../../../lib/effect/toEffectResponse";
|
||||
import type { InferEffect } from "../../../lib/effect/types";
|
||||
import { ApplicationContext } from "../../platform/services/ApplicationContext";
|
||||
import { ProjectRepository } from "../../project/infrastructure/ProjectRepository";
|
||||
import * as ClaudeCodeVersion from "../models/ClaudeCodeVersion";
|
||||
import { ClaudeCodeService } from "../services/ClaudeCodeService";
|
||||
|
||||
const LayerImpl = Effect.gen(function* () {
|
||||
@@ -80,9 +81,43 @@ const LayerImpl = Effect.gen(function* () {
|
||||
} as const satisfies ControllerResponse;
|
||||
});
|
||||
|
||||
const getClaudeCodeMeta = () =>
|
||||
Effect.gen(function* () {
|
||||
const config = yield* claudeCodeService.getClaudeCodeMeta();
|
||||
return {
|
||||
response: {
|
||||
executablePath: config.claudeCodeExecutablePath,
|
||||
version: config.claudeCodeVersion
|
||||
? ClaudeCodeVersion.versionText(config.claudeCodeVersion)
|
||||
: null,
|
||||
},
|
||||
status: 200,
|
||||
} as const satisfies ControllerResponse;
|
||||
});
|
||||
|
||||
const getAvailableFeatures = () =>
|
||||
Effect.gen(function* () {
|
||||
const features = yield* claudeCodeService.getAvailableFeatures();
|
||||
const featuresList = Object.entries(features).flatMap(([key, value]) => {
|
||||
return [
|
||||
{
|
||||
name: key as keyof typeof features,
|
||||
enabled: value,
|
||||
},
|
||||
];
|
||||
});
|
||||
|
||||
return {
|
||||
response: { features: featuresList },
|
||||
status: 200,
|
||||
} as const satisfies ControllerResponse;
|
||||
});
|
||||
|
||||
return {
|
||||
getClaudeCommands,
|
||||
getMcpListRoute,
|
||||
getClaudeCodeMeta,
|
||||
getAvailableFeatures,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -13,6 +13,21 @@ class ProjectPathNotFoundError extends Data.TaggedError(
|
||||
const LayerImpl = Effect.gen(function* () {
|
||||
const projectRepository = yield* ProjectRepository;
|
||||
|
||||
const getClaudeCodeMeta = () =>
|
||||
Effect.gen(function* () {
|
||||
const config = yield* ClaudeCode.Config;
|
||||
return config;
|
||||
});
|
||||
|
||||
const getAvailableFeatures = () =>
|
||||
Effect.gen(function* () {
|
||||
const config = yield* ClaudeCode.Config;
|
||||
const features = ClaudeCode.getAvailableFeatures(
|
||||
config.claudeCodeVersion,
|
||||
);
|
||||
return features;
|
||||
});
|
||||
|
||||
const getMcpList = (projectId: string) =>
|
||||
Effect.gen(function* () {
|
||||
const { project } = yield* projectRepository.getProject(projectId);
|
||||
@@ -27,7 +42,9 @@ const LayerImpl = Effect.gen(function* () {
|
||||
});
|
||||
|
||||
return {
|
||||
getClaudeCodeMeta,
|
||||
getMcpList,
|
||||
getAvailableFeatures,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user