@principal-ai/repository-abstraction
v0.5.7
Published
Repository and file system abstraction layer
Readme
@principal-ai/repository-abstraction
Repository and file system abstraction layer for the Principal AI ecosystem.
Overview
This package provides abstractions for working with file systems and repositories in a simplified tree representation, offering a unified model for hierarchical file structures.
Key Features
- FileTree - Abstract tree structure representing directories and files
- FileInfo - Abstracted file metadata and properties
- DirectoryInfo - Abstracted directory metadata and properties
- createFileTreeFromPaths - Convert raw paths into tree abstraction
- mergeFileTrees - Combine multiple tree abstractions
- GitHub URL parsing - Parse and identify GitHub repositories from URLs
Installation
bun install @principal-ai/repository-abstractionUsage
import { FileTree, createFileTreeFromPaths } from '@principal-ai/repository-abstraction';
// Create a file tree from paths
const paths = [
'/src/index.ts',
'/src/components/Button.tsx',
'/package.json'
];
const fileTree = createFileTreeFromPaths(paths);Development
# Install dependencies
bun install
# Build the package
bun run build
# Run tests
bun test
# Type checking
bun run typecheck
# Watch mode for development
bun run devLicense
Private package - not for public distribution.
