Fix import paths and remove organ metaphors
Some checks failed
DSS Project Analysis / dss-context-update (push) Has been cancelled

- Update all `from storage.` imports to `from dss.storage.`
- Update `from config import config` to use `dss.settings`
- Update `from auth.` imports to `from dss.auth.`
- Update health check to use `dss.mcp.handler`
- Fix SmartMerger import (merger.py not smart_merger.py)
- Fix TranslationDictionary import path
- Fix test assertion for networkx edges/links
- Remove organ/body metaphors from:
  - API server health check
  - CLI status command and help text
  - Admin UI logger and error handler

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-10 13:05:00 -03:00
parent 41fba59bf7
commit faa19beef3
22 changed files with 251 additions and 295 deletions

View File

@@ -1,18 +1,16 @@
#!/usr/bin/env node
/**
* 🧬 DSS CLI - Design System Server Organism Controller
* DSS CLI - Design System Server Command Line Interface
*
* A portable companion for UI developers - think of it as the organism's
* command-line nervous system. Through these commands, you can:
* A portable companion for UI developers. Commands:
*
* - 🧬 Awaken a new organism (init)
* - 💚 Check the organism's vital signs (status)
* - 🩸 Direct the sensory organs to perceive Figma (extract)
* - 🔄 Circulate extracted nutrients (sync)
* - ⚙️ Adjust the organism's behavior (config)
* - 🧠 Birth a conscious instance (start)
*
* Framework: DSS Organism Framework
* - init: Initialize DSS in a project
* - status: Check server status
* - extract: Extract tokens/components from Figma
* - sync: Sync tokens to codebase
* - config: Manage configuration
* - start: Start the server
* - stop: Stop the server
*/
import { Command } from 'commander';
@@ -29,63 +27,63 @@ const program = new Command();
program
.name('dss')
.description('🧬 Design System Server - Organism Controller for UI Developers')
.description('Design System Server - CLI for UI Developers')
.version('0.1.0');
// Init command - setup DSS in a project
program
.command('init')
.description('🧬 ORGANISM GENESIS - Create a new design system organism in your project')
.option('-f, --figma-key <key>', 'Link to Figma genetic blueprint')
.option('-t, --figma-token <token>', 'Figma sensory organ connection token')
.description('Initialize DSS in your project')
.option('-f, --figma-key <key>', 'Figma file key')
.option('-t, --figma-token <token>', 'Figma access token')
.action(initCommand);
// Start command - start the DSS server
program
.command('start')
.description('💚 ORGANISM AWAKENING - Bring the design system organism to life')
.option('-p, --port <port>', 'Neural pathway port', '3456')
.option('-d, --dev', 'Live consciousness mode with hot-reload')
.option('--no-open', 'Do not open sensory interface')
.description('Start the DSS server')
.option('-p, --port <port>', 'Server port', '3456')
.option('-d, --dev', 'Development mode with hot-reload')
.option('--no-open', 'Do not open browser')
.action(startCommand);
// Sync command - sync tokens from Figma
program
.command('sync')
.description('🩸 NUTRIENT CIRCULATION - Distribute extracted tokens through the codebase')
.option('-f, --format <format>', 'Nutrient format: css, scss, json, ts', 'css')
.option('-o, --output <path>', 'Circulation destination')
.description('Sync tokens from Figma to codebase')
.option('-f, --format <format>', 'Output format: css, scss, json, ts', 'css')
.option('-o, --output <path>', 'Output directory')
.option('--file-key <key>', 'Figma file key (overrides config)')
.action(syncCommand);
// Extract command - extract components or tokens
program
.command('extract <type>')
.description('👁️ SENSORY PERCEPTION - Direct organism eyes to perceive Figma designs')
.option('-f, --format <format>', 'Perception output format', 'json')
.option('-o, --output <path>', 'Memory storage location')
.description('Extract components or tokens from Figma')
.option('-f, --format <format>', 'Output format', 'json')
.option('-o, --output <path>', 'Output location')
.option('--file-key <key>', 'Figma file key')
.action(extractCommand);
// Config command - manage configuration
program
.command('config')
.description('⚙️ ENDOCRINE ADJUSTMENT - Configure organism behavior and preferences')
.option('--set <key=value>', 'Set organism hormone value')
.option('--get <key>', 'Read organism hormone value')
.option('--list', 'View all hormones')
.description('Manage DSS configuration')
.option('--set <key=value>', 'Set configuration value')
.option('--get <key>', 'Get configuration value')
.option('--list', 'List all configuration')
.action(configCommand);
// Stop command - stop the server
program
.command('stop')
.description('😴 ORGANISM REST - Put the design system organism into sleep mode')
.description('Stop the DSS server')
.action(stopCommand);
// Status command - check DSS status
program
.command('status')
.description('🏥 VITAL SIGNS CHECK - Monitor organism health and configuration')
.description('Check DSS server status and configuration')
.action(statusCommand);
// Parse arguments

View File

@@ -1,8 +1,7 @@
/**
* 🏥 DSS Status Command - Organism Vital Signs
* DSS Status Command
*
* Check DSS design system organism's vital signs, consciousness state,
* and sensory organ configuration.
* Check DSS server status and configuration.
*/
import chalk from 'chalk';
@@ -15,48 +14,48 @@ export async function statusCommand(): Promise<void> {
const config = getConfig();
console.log('');
console.log(chalk.cyan(' 🏥 ORGANISM VITAL SIGNS'));
console.log(chalk.cyan(' DSS Status'));
console.log(chalk.dim(' ────────────────────────'));
console.log('');
// Organism status
// Project status
if (hasProjectConfig()) {
console.log(chalk.green(' 🧬 Organism:'), chalk.dim('Born and conscious'));
console.log(chalk.dim(` Home: ${cwd}`));
console.log(chalk.green(' Project:'), chalk.dim('Initialized'));
console.log(chalk.dim(` Root: ${cwd}`));
} else {
console.log(chalk.yellow(' 🧬 Organism:'), chalk.dim('Not yet born'));
console.log(chalk.dim(' Genesis: dss init'));
console.log(chalk.yellow(' Project:'), chalk.dim('Not initialized'));
console.log(chalk.dim(' Initialize: dss init'));
}
console.log('');
// Consciousness status (server)
// Server status
const running = isServerRunning(cwd);
const pid = getServerPid(cwd);
const port = config.port || 3456;
if (running) {
console.log(chalk.green(' 💚 Consciousness:'), chalk.dim(`Awake (PID: ${pid})`));
console.log(chalk.dim(` Neural port: http://localhost:${port}`));
console.log(chalk.green(' Server:'), chalk.dim(`Running (PID: ${pid})`));
console.log(chalk.dim(` URL: http://localhost:${port}`));
// Try to get health info
try {
const api = getApiClient({ port });
const health = await api.health();
console.log(chalk.dim(` Awareness: ${health.figma_mode}`));
console.log(chalk.dim(` Mode: ${health.figma_mode}`));
} catch {
console.log(chalk.yellow(' ⚠️ Unable to read consciousness'));
console.log(chalk.yellow(' Unable to get health status'));
}
} else {
console.log(chalk.yellow(' 💚 Consciousness:'), chalk.dim('Sleeping'));
console.log(chalk.dim(' Awaken: dss start'));
console.log(chalk.yellow(' Server:'), chalk.dim('Stopped'));
console.log(chalk.dim(' Start: dss start'));
}
console.log('');
// Sensory organs (Figma)
// Figma integration
if (config.figmaToken) {
console.log(chalk.green(' 👁️ Sensory Eyes:'), chalk.dim('Configured'));
console.log(chalk.green(' Figma:'), chalk.dim('Configured'));
// Test connection if server is running
if (running) {
@@ -64,21 +63,21 @@ export async function statusCommand(): Promise<void> {
const api = getApiClient({ port });
const test = await api.testFigmaConnection();
if (test.success) {
console.log(chalk.green(' Perception:'), chalk.dim(`Clear (${test.user})`));
console.log(chalk.green(' Connection:'), chalk.dim(`OK (${test.user})`));
} else {
console.log(chalk.red(' Perception:'), chalk.dim(test.error || 'Blinded'));
console.log(chalk.red(' Connection:'), chalk.dim(test.error || 'Failed'));
}
} catch {
console.log(chalk.yellow(' Perception:'), chalk.dim('Cannot test'));
console.log(chalk.yellow(' Connection:'), chalk.dim('Cannot test'));
}
}
} else {
console.log(chalk.yellow(' 👁️ Sensory Eyes:'), chalk.dim('Not configured'));
console.log(chalk.yellow(' Figma:'), chalk.dim('Not configured'));
console.log(chalk.dim(' Configure: dss config --set figmaToken=figd_xxxxx'));
}
if (config.figmaFileKey) {
console.log(chalk.green(' 📋 Genetic Blueprint:'), chalk.dim(config.figmaFileKey));
console.log(chalk.green(' Figma File:'), chalk.dim(config.figmaFileKey));
} else {
console.log(chalk.yellow(' Figma File:'), chalk.dim('Not configured'));
console.log(chalk.dim(' Set: dss config --set figmaFileKey=abc123'));