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
BatchArtifactInput
Batch revision creation - write many revisions in a single call. The bulk-write RPC behind backfill, dream state, and migrations: N rows land in one transaction and one (chunked) embedding pass instead of N serial single-writes. An artifact to attach to a batch-created revision, completing the Item -> Revision -> Artifact chain in the same transaction.
BatchCreateRevisionsRequest
BatchCreateRevisionsResponse
BatchGetRevisionsRequest
Batch revision fetching - fetch multiple revisions in a single call
BatchGetRevisionsResponse
BatchRevisionFailure
BatchRevisionRow
One batch row: a revision to create plus any artifacts that go with it.
Bundle
A bundle that aggregates multiple items in the Kumiho system.
BundleMember
BundleRevisionHistory
CeDiscoveryEnvVars
Environment variables used by local CE discovery.
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
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
HardDeleteProjectRequest
Snapshot-bound permanent deletion. New clients should prefer this API over DeleteProject(force=true); the legacy operation remains for compatibility.
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.
KumihoServiceBase
KumihoServiceClient
The Kumiho service definition.
MoveItemRequest
Move an Item between tenant-owned Spaces while preserving its immutable kref. This is a graph ownership operation; application-specific metadata is not interpreted by Kumiho.
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.
ProjectDeletionGuardResponse
ProjectDeletionImpactRequest
ProjectDeletionImpactResponse
ProjectResponse
RegisterProjectDeletionGuardRequest
Opaque application-owned deletion guard. Kumiho stores and enforces the guard without interpreting application kinds, statuses, or metadata values.
RemoveBundleMemberRequest
RemoveBundleMemberResponse
ResolveKrefRequest
ResolveLocationRequest
ResolveLocationResponse
ResolveProjectDeletionGuardRequest
ResolveProjectReferenceRequest
Resolve one registered cross-Project Revision reference on an archived Project. The server validates the current edge and owns the mutation.
Revision
A specific iteration of an item in the Kumiho system.
RevisionPath
Represents a complete path between two revisions
RevisionResponse
ScoredRevision
ScoreRevisionsRequest
ScoreRevisionsResponse
SearchRequest
SearchResponse
SearchResult
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.

Constants

kDefaultLocalCePort → const int
Self-hosted CE default loopback port.
kDefaultLocalCeTarget → const String
Default loopback gRPC target for a self-hosted CE server.
reservedKinds → const Set<String>
Item kinds that are reserved and cannot be created via createItem.

Functions

clientFromDiscovery({String? token, String? tenantHint, String? controlPlaneUrl, bool forceRefresh = false}) Future<KumihoClient>
Creates a gRPC KumihoClient using Control Plane discovery.
clientFromLocalCe({Duration? timeout, Client? httpClient}) Future<KumihoClient?>
Creates a tokenless KumihoClient for a loopback self-hosted CE server.
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
isValidEdgeType(String edgeType) bool
Checks if an edge type is valid without throwing exceptions.
isValidKref(String uri) bool
Checks if a Kref URI is valid without throwing exceptions.
resolveLocalCeEndpoint({Duration? timeout, Client? httpClient}) Future<String?>
Resolves a loopback CE gRPC target when a local server advertises CE mode.
validateEdgeType(String edgeType) → void
Validates an edge type for security and correctness.
validateKref(String uri) → void
Validates a Kref URI for security and correctness.

Typedefs

KumihoApiClient = KumihoClient
Backwards-compatible alias for older imports.

Exceptions / Errors

CeDiscoveryError
Raised when a CE environment variable is malformed.
EdgeTypeValidationError
Standard edge types for Kumiho relationships.
KrefValidationError
Exception thrown when a Kref URI is invalid or contains malicious patterns.
KumihoError
Base exception class for all Kumiho errors.
ProjectLimitError
Raised when project creation is blocked by a guardrail.
ReservedKindError
Raised when attempting to create an item with a reserved kind.