
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
codestate-core
Advanced tools
The core domain models, use cases, and services for CodeState - a developer context engine for saving and resuming your full development environment.
IScriptService
interface with better method organizationIScriptService
interface methods for better maintainabilityCodeState Core provides the foundational building blocks for managing development context, including:
npm install codestate-core
import {
ConfigurableLogger,
GitService,
Terminal,
IDEService,
FileStorage,
CreateScript,
GetScripts,
SaveSession,
ListSessions
} from 'codestate-core';
// Initialize services
const logger = new ConfigurableLogger({ level: 'LOG', sinks: ['console'] });
const gitService = new GitService();
const terminal = new Terminal();
const ideService = new IDEService();
// Create a new script using use case
const createScript = new CreateScript();
const scriptResult = await createScript.execute({
name: 'setup-project',
script: 'npm install && npm run build',
rootPath: '/path/to/project'
});
// Get scripts using use case
const getScripts = new GetScripts();
const scripts = await getScripts.execute();
// Save session using use case
const saveSession = new SaveSession();
const session = await saveSession.execute({
name: 'feature-development',
projectRoot: '/path/to/project',
notes: 'Working on new feature'
});
CreateScript.execute(scriptData)
- Create new scriptGetScripts.execute()
- Get all scriptsGetScriptsByRootPath.execute(rootPath)
- Get scripts for specific projectUpdateScript.execute(id, updates)
- Update existing scriptDeleteScript.execute(id)
- Delete scriptExportScripts.execute()
- Export scripts to JSONImportScripts.execute(json)
- Import scripts from JSONSaveSession.execute(sessionData)
- Save current development sessionResumeSession.execute(id)
- Resume saved sessionListSessions.execute(filter)
- List all saved sessionsUpdateSession.execute(id, updates)
- Update session metadataDeleteSession.execute(id)
- Delete sessionGetConfig.execute()
- Retrieve current configurationUpdateConfig.execute(updates)
- Update configurationExportConfig.execute(outputPath)
- Export configuration to fileImportConfig.execute(filePath)
- Import configuration from fileResetConfig.execute()
- Reset to default configurationgetGitStatus()
- Get current git repository statusgetDirtyData()
- Get uncommitted changescommitChanges(message)
- Commit changescreateStash(message)
- Create git stashapplyStash(id)
- Apply git stashlistStashes()
- List all stashesdeleteStash(id)
- Delete stashgetAvailableIDEs()
- Get list of available IDEsopenIDE(ideName, projectRoot)
- Open project in specific IDEopenFiles(request)
- Open specific files in IDEisIDEInstalled(ideName)
- Check if IDE is installedexecute(command, options)
- Execute terminal commandspawnTerminal(command, options)
- Spawn new terminal windowspawnApplication(command, options)
- Launch applicationisCommandAvailable(command)
- Check if command is availableFull TypeScript definitions are included:
import type {
Script,
Session,
Config,
GitStatus,
IDE
} from 'codestate-core';
All data models use Zod schemas for runtime validation:
import { SchemaRegistry } from 'codestate-core';
// Validate script data
const scriptSchema = SchemaRegistry.getSchema('Script');
const validatedScript = scriptSchema.parse(scriptData);
Comprehensive error handling with typed errors:
import { ErrorRegistry, ErrorTypes } from 'codestate-core';
try {
await scriptService.createScript(scriptData);
} catch (error) {
if (error instanceof ErrorRegistry.getError(ErrorTypes.SCRIPT_CREATION_FAILED)) {
// Handle script creation error
}
}
This package is part of the CodeState monorepo. For development setup, see the main CodeState repository.
MIT
FAQs
Core domain models, use cases, and services for CodeState
The npm package codestate-core receives a total of 68 weekly downloads. As such, codestate-core popularity was classified as not popular.
We found that codestate-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.