first commit

This commit is contained in:
Michal
2026-02-21 03:10:39 +00:00
commit d0aa0c5d63
174 changed files with 21169 additions and 0 deletions

23
src/shared/package.json Normal file
View File

@@ -0,0 +1,23 @@
{
"name": "@mcpctl/shared",
"version": "0.1.0",
"private": true,
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"scripts": {
"build": "tsc --build",
"clean": "rimraf dist",
"test": "vitest",
"test:run": "vitest run"
},
"dependencies": {
"zod": "^3.24.0"
}
}

View File

@@ -0,0 +1,5 @@
// Shared constants
export const APP_NAME = 'mcpctl';
export const APP_VERSION = '0.1.0';
export const DEFAULT_MCPD_URL = 'http://localhost:3000';
export const DEFAULT_DB_PORT = 5432;

4
src/shared/src/index.ts Normal file
View File

@@ -0,0 +1,4 @@
export * from './types/index.js';
export * from './validation/index.js';
export * from './constants/index.js';
export * from './utils/index.js';

View File

@@ -0,0 +1,46 @@
// Core domain types for mcpctl
// These will be expanded as tasks are implemented
export interface McpServerConfig {
name: string;
type: string;
command: string;
args: string[];
envTemplate: EnvTemplateEntry[];
setupGuide?: string;
}
export interface EnvTemplateEntry {
name: string;
description: string;
isSecret: boolean;
setupUrl?: string;
defaultValue?: string;
}
export interface McpProfile {
name: string;
serverId: string;
config: Record<string, unknown>;
filterRules?: Record<string, unknown>;
}
export interface McpProject {
name: string;
description?: string;
profileIds: string[];
}
// Service interfaces for dependency injection
export interface BackupService {
exportConfig(): Promise<string>;
importConfig(data: string): Promise<void>;
}
export interface ConfigExporter {
serialize(): Promise<Record<string, unknown>>;
}
export interface ConfigImporter {
deserialize(data: Record<string, unknown>): Promise<void>;
}

View File

@@ -0,0 +1,2 @@
// Shared utility functions
// Will be expanded as tasks are implemented

View File

@@ -0,0 +1,4 @@
// Shared Zod validation schemas
// Will be expanded as tasks are implemented
export { z } from 'zod';

View File

@@ -0,0 +1,16 @@
import { describe, it, expect } from 'vitest';
import { APP_NAME, APP_VERSION, DEFAULT_MCPD_URL } from '../src/constants/index.js';
describe('shared package', () => {
it('exports APP_NAME constant', () => {
expect(APP_NAME).toBe('mcpctl');
});
it('exports APP_VERSION constant', () => {
expect(APP_VERSION).toBe('0.1.0');
});
it('exports DEFAULT_MCPD_URL constant', () => {
expect(DEFAULT_MCPD_URL).toBe('http://localhost:3000');
});
});

8
src/shared/tsconfig.json Normal file
View File

@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist"
},
"include": ["src/**/*.ts"]
}

View File

@@ -0,0 +1,8 @@
import { defineProject } from 'vitest/config';
export default defineProject({
test: {
name: 'shared',
include: ['tests/**/*.test.ts'],
},
});