@shirokuma-library/mcp-knowledge-base
Version:
Shirokuma MCP Server for comprehensive knowledge management including issues, plans, documents, and work sessions. All stored data is structured for AI processing, not human readability.
24 lines (23 loc) • 708 B
JavaScript
export * from './domain-types.js';
export const TypeGuards = {
isPriority(value) {
return ['high', 'medium', 'low'].includes(value);
},
isBaseType(value) {
return ['tasks', 'documents'].includes(value);
},
isContentType(value) {
if (typeof value !== 'string') {
return false;
}
const staticTypes = ['issues', 'plans', 'docs', 'knowledge'];
return staticTypes.includes(value) ||
/^[a-z][a-z0-9_]*$/.test(value);
},
isValidDate(value) {
return /^\d{4}-\d{2}-\d{2}$/.test(value);
},
isValidSessionId(value) {
return /^\d{4}-\d{2}-\d{2}-\d{2}\.\d{2}\.\d{2}\.\d{3}$/.test(value);
}
};