kumiho library

Kumiho Dart SDK - A graph-native creative and AI asset management client.

This library provides a Dart client for the Kumiho Cloud gRPC service. Kumiho tracks revisions, relationships, and lineage of creative assets without uploading files to the cloud (BYO Storage philosophy).

Getting Started

import 'package:kumiho/kumiho.dart';

void main() async {
  // Token is auto-loaded from env var or ~/.kumiho/kumiho_authentication.json
  final client = KumihoClient(
    host: 'localhost',
    port: 50051,
  );

  try {
    // Create a project
    final project = await client.newProject('my-project');

    // Create a space using fluent API
    final space = await project.createSpace('models');

    // Create an item
    final item = await space.createItem('hero', 'model');

    // Create a revision
    final revision = await item.createRevision();

    // Add an artifact
    await revision.createArtifact('mesh', '/path/to/hero.fbx');

  } finally {
    await client.shutdownAsync();
  }
}

Authentication

The SDK supports multiple authentication methods:

  1. Explicit token: Pass token parameter to constructor
  2. Environment variable: Set KUMIHO_AUTH_TOKEN
  3. Credentials file: Use kumiho-cli login to cache credentials at ~/.kumiho/kumiho_authentication.json

Auto-Refresh (Opt-in)

Set KUMIHO_ENABLE_AUTO_REFRESH=true to enable automatic token refresh when credentials expire. The SDK will use the stored refresh token.

Environment Variables

Variable Description
KUMIHO_AUTH_TOKEN Primary auth token (overrides file)
KUMIHO_CONFIG_DIR Custom config directory
KUMIHO_USE_CONTROL_PLANE_TOKEN Prefer CP token (true/false)
KUMIHO_ENABLE_AUTO_REFRESH Enable token auto-refresh (true/false)
KUMIHO_AUTH_TOKEN_GRACE_SECONDS Grace period before expiry (default: 300)
KUMIHO_CONTROL_PLANE_URL Control Plane base URL (preferred)

Key Concepts

  • Project: Top-level container for all assets and spaces
  • Space: Hierarchical folder structure within a project
  • Item: A versioned asset (model, texture, workflow, etc.)
  • Revision: A specific iteration of an item with artifacts
  • Artifact: A file reference (path/URI) within a revision
  • Edge: A relationship between revisions (dependencies, references)
  • Bundle: A special item that aggregates other items
  • Kref: A URI-based unique identifier for any Kumiho object

Classes

AddBundleMemberRequest
AddBundleMemberResponse
Artifact
A file reference within a revision in the Kumiho system.
ArtifactResponse
Bundle
A bundle that aggregates multiple items in the Kumiho system.
BundleMember
BundleRevisionHistory
CreateArtifactRequest
CreateBundleRequest
CreateEdgeRequest
CreateItemRequest
CreateProjectRequest
CreateRevisionRequest
CreateSpaceRequest
DeleteArtifactRequest
DeleteAttributeRequest
Delete a single metadata attribute
DeleteEdgeRequest
DeleteItemRequest
DeleteProjectRequest
DeleteRevisionRequest
DeleteSpaceRequest
DiscoveryEnvVars
Environment variables used by discovery.
DiscoveryRecord
A parsed discovery result.
Edge
A relationship between two revisions in the Kumiho system.
EdgeDirection
EdgeType
Standard edge types for Kumiho relationships.
Event
EventCapabilities
Event streaming capabilities for the current tenant tier
EventStreamRequest
GetArtifactRequest
GetArtifactsByLocationRequest
GetArtifactsByLocationResponse
GetArtifactsRequest
GetArtifactsResponse
GetAttributeRequest
Get a single metadata attribute
GetAttributeResponse
GetBundleHistoryRequest
GetBundleHistoryResponse
GetBundleMembersRequest
GetBundleMembersResponse
GetChildSpacesRequest
GetChildSpacesResponse
GetEdgesRequest
GetEdgesResponse
GetEventCapabilitiesRequest
Request for event streaming capabilities
GetItemRequest
GetItemsRequest
GetItemsResponse
GetProjectsRequest
GetProjectsResponse
GetRevisionsRequest
GetRevisionsResponse
GetSpaceRequest
GetTenantUsageRequest
HasTagRequest
HasTagResponse
ImpactAnalysisRequest
Request for impact analysis (what depends on this revision, transitively)
ImpactAnalysisResponse
ImpactedRevision
Item
A versioned asset in the Kumiho system.
ItemResponse
ItemSearchRequest
Kref
A Kumiho Artifact Reference (URI-based unique identifier).
KrefRequest
KumihoClient
High-level Dart client for the Kumiho Cloud service.
KumihoClientBase
Forward declaration of the client type.
KumihoObject
Base class for all high-level Kumiho domain objects.
KumihoServiceApi
The Kumiho service definition.
KumihoServiceBase
KumihoServiceClient
The Kumiho service definition.
PagedList<T>
A list that also contains pagination information.
PaginationRequest
Pagination parameters for list requests
PaginationResponse
Pagination info in list responses
PathStep
Represents a single step in a traversal path
PeekNextRevisionRequest
--- Peek Next Revision Messages ---
PeekNextRevisionResponse
Project
A Kumiho project—the top-level container for assets.
ProjectResponse
RemoveBundleMemberRequest
RemoveBundleMemberResponse
ResolveKrefRequest
ResolveLocationRequest
ResolveLocationResponse
Revision
A specific iteration of an item in the Kumiho system.
RevisionPath
Represents a complete path between two revisions
RevisionResponse
SetAttributeRequest
Set a single metadata attribute (upsert)
SetDefaultArtifactRequest
SetDeprecatedRequest
ShortestPathRequest
Request for shortest path between two revisions
ShortestPathResponse
Space
A hierarchical container for organizing items in Kumiho.
SpaceResponse
StatusResponse
TagRevisionRequest
TenantUsageResponse
TraverseEdgesRequest
Request for transitive dependency/dependents traversal
TraverseEdgesResponse
UnTagRevisionRequest
UpdateMetadataRequest
--- Metadata Update Messages ---
UpdateProjectRequest
WasTaggedRequest
WasTaggedResponse

Enums

EventStreamRequest_StartPosition

Extensions

GeneratedMessageGenericExtensions on T
Extensions on GeneratedMessages.

Functions

clientFromDiscovery({String? token, String? tenantHint, String? controlPlaneUrl, bool forceRefresh = false}) Future<KumihoClient>
Creates a gRPC KumihoClient using Control Plane discovery.
discoverTenant({String? controlPlaneUrl, String? firebaseToken, String? tenantHint, bool forceRefresh = false, Duration timeout = const Duration(seconds: 10), File? cacheFile}) Future<DiscoveryRecord>
Resolves discovery info via Control Plane.
getDefaultDiscoveryCacheFile() File
isValidKref(String uri) bool
Checks if a Kref URI is valid without throwing exceptions.
validateKref(String uri) → void
Validates a Kref URI for security and correctness.

Typedefs

KumihoApiClient = KumihoClient
Backwards-compatible alias for older imports.

Exceptions / Errors

KrefValidationError
Exception thrown when a Kref URI is invalid or contains malicious patterns.
KumihoError
Base exception class for all Kumiho errors.