Skip to main content

Crate vibe_graph_ops

Crate vibe_graph_ops 

Source
Expand description

Vibe-Graph Operations Layer

This crate provides a clean, typed API for all vibe-graph operations. It can be consumed by both the CLI and REST API, ensuring consistent behavior and type-safe interactions.

§Architecture

The ops layer follows hexagonal architecture principles:

  • Requests: Typed input DTOs for each operation
  • Responses: Typed output DTOs with all relevant data
  • OpsContext: The main service that executes operations

§Usage

use vibe_graph_ops::{OpsContext, SyncRequest, Config};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let config = Config::load()?;
    let ctx = OpsContext::new(config);
     
    let request = SyncRequest::local(".");
    let response = ctx.sync(request).await?;
     
    println!("Synced {} repositories", response.project.repositories.len());
    Ok(())
}

Structs§

ArchitectFactory
Factory for creating architects.
CleanRequest
Request to clean the .self folder.
CleanResponse
Response from a clean operation.
ComposeRequest
Request to compose output from a project.
ComposeResponse
Response from a compose operation.
Config
Configuration for vibe-graph operations.
FlatArchitect
Puts all files in a single flat directory.
GitChangesRequest
Request to get git changes for a workspace.
GitChangesResponse
Response from a git changes operation.
GraphRequest
Request to build a source code graph.
GraphResponse
Response from a graph build operation.
LatticeArchitect
Organizes nodes based on spatial metadata (x, y) or index.
LoadRequest
Request to load a project from .self store.
LoadResponse
Response from a load operation.
Manifest
Workspace manifest containing metadata about the persisted state.
OperationSummary
Summary of an operation for API responses.
OpsContext
The main operations context.
Project
A project represents a collection of repositories.
Repository
A repository within a project.
ServeRequest
Request to start the serve command.
Source
A source file within a repository.
StatusRequest
Request to get workspace status.
StatusResponse
Response from a status operation.
Store
Store manages the .self folder and persistence operations.
StoreStats
Statistics about the store.
SyncRequest
Request to sync a codebase (local or remote).
SyncResponse
Response from a sync operation.
WorkspaceInfo
Result of workspace detection.

Enums§

ComposeFormat
Output format for compose.
OpsError
Errors that can occur during operations.
ProjectSource
Where the project originates from.
SyncSource
The source type for a sync operation.
WorkspaceKind
Detected workspace type based on directory structure.

Traits§

GraphArchitect
Transforms a raw logical graph into a deployable filesystem graph.

Functions§

has_store
Check if a .self directory exists at the given path.

Type Aliases§

OpsResult
Result type for operations.