KumihoClient class

High-level Dart client for the Kumiho Cloud service.

This client provides access to all Kumiho gRPC endpoints for managing projects, spaces, items, revisions, artifacts, edges, and bundles.

Authentication

Pass a Firebase ID token to the token parameter for authentication. The token is automatically injected as a Bearer token in all requests.

final client = KumihoClient(
  host: 'us-central.kumiho.cloud',
  port: 443,
  token: firebaseIdToken,
  secure: true,
);

Connection Options

For local development (insecure):

final client = KumihoClient(host: 'localhost', port: 50051);

For production (TLS):

final client = KumihoClient(
  host: 'api.kumiho.cloud',
  port: 443,
  secure: true,
  token: authToken,
);

For custom channel:

final client = KumihoClient(channel: existingChannel);

Constructors

KumihoClient({String host = 'localhost', int port = 8080, String? token, String? tenantId, ClientChannelBase? channel, ChannelOptions? options, bool secure = false, bool autoLoadToken = true})
Creates a new Kumiho client.

Properties

callOptions → CallOptions
Creates CallOptions with authentication metadata and correlation ID.
no setterinherited
channel ↔ ClientChannelBase
Underlying gRPC channel.
latefinalinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
streamCallOptions → CallOptions
Creates CallOptions for streaming RPCs.
no setterinherited
stub ↔ KumihoServiceClient
Generated service stub for issuing RPCs.
latefinalinherited
tenantId → String?
Get the tenant ID for anonymous access.
no setterinherited
token ↔ String?
Get the current authentication token.
getter/setter pairinherited
tokenSource → String?
Get the source of the current token (for debugging).
no setterinherited

Methods

addBundleMember(String bundleKref, String memberItemKref, {Map<String, String>? metadata}) → Future<AddBundleMemberResponse>
Adds an item as a member of a bundle.
inherited
analyzeImpact(String revisionKref, {List<String>? edgeTypeFilter, int? maxDepth, int? limit}) → Future<ImpactAnalysisResponse>
Analyzes the impact of changes to a revision.
inherited
analyzeProjectDeletion(String projectId) → Future<ProjectDeletionImpactResponse>
inherited
artifact(String krefUri) → Future<Artifact>
Gets an artifact by kref and returns an Artifact model.
batchGetRevisions({List<String>? revisionKrefs, List<String>? itemKrefs, String tag = 'latest', bool allowPartial = true}) → Future<({List<String> notFound, List<RevisionResponse> revisions})>
Batch-fetches multiple revisions in a single call.
inherited
createArtifact(String revisionKref, String name, String location, {Map<String, String>? metadata, bool existsError = false}) → Future<ArtifactResponse>
Creates a new artifact for a revision.
inherited
createBundle(String parentPath, String bundleName, {Map<String, String>? metadata}) → Future<ItemResponse>
Creates a new bundle item.
inherited
createEdge(String sourceKref, String targetKref, String edgeType, {Map<String, String>? metadata, bool existsError = false}) → Future<StatusResponse>
Creates an edge between two revisions.
inherited
createItem(String parentPath, String itemName, String kind, {Map<String, String>? metadata, bool existsError = false}) → Future<ItemResponse>
Creates a new item within a space.
inherited
createProject(String name, {String? description}) → Future<ProjectResponse>
Creates a new project.
inherited
createRevision(String itemKref, {Map<String, String>? metadata, int? number, String? embeddingText, bool existsError = false}) → Future<RevisionResponse>
Creates a new revision for an item.
inherited
createSpace(String parentPath, String spaceName, {bool existsError = false}) → Future<SpaceResponse>
Creates a new space within a project or parent space.
inherited
deleteArtifact(String kref, {bool force = false}) → Future<StatusResponse>
Deletes an artifact.
inherited
deleteAttribute(String kref, String key) → Future<StatusResponse>
Deletes a single metadata attribute.
inherited
deleteEdge(String sourceKref, String targetKref, String edgeType) → Future<StatusResponse>
Deletes an edge between two revisions.
inherited
deleteItem(String kref, {bool force = false}) → Future<StatusResponse>
Deletes an item.
inherited
deleteProject(String projectId, {bool force = false}) → Future<StatusResponse>
Forwards the legacy delete/deprecate request to the connected server. New servers require hardDeleteProject for permanent deletion, while older servers can continue to honor force: true.
inherited
deleteRevision(String kref, {bool force = false}) → Future<StatusResponse>
Deletes a revision.
inherited
deleteSpace(String path, {bool force = false}) → Future<StatusResponse>
Deletes a space.
inherited
eventStream({String? routingKeyFilter, String? krefFilter, String? cursor, String? consumerGroup, bool fromBeginning = false, Duration? timeout}) → Stream<Event>
Subscribes to real-time events.
inherited
findShortestPath(String sourceKref, String targetKref, {List<String>? edgeTypeFilter, int? maxDepth, bool allShortest = false}) → Future<ShortestPathResponse>
Finds the shortest path between two revisions.
inherited
forceRefreshToken() → Future<void>
Force refresh the authentication token.
inherited
getArtifact(String revisionKref, String name) → Future<ArtifactResponse>
Gets a specific artifact by name.
inherited
getArtifactByKref(String krefUri) → Future<Artifact>
Gets an artifact by kref, returned as an Artifact model.
getArtifacts(String revisionKref) → Future<List<ArtifactResponse>>
Lists all artifacts for a revision.
inherited
getArtifactsByLocation(String location) → Future<List<ArtifactResponse>>
Finds artifacts by their file location.
inherited
getAttribute(String kref, String key) → Future<GetAttributeResponse>
Gets a single metadata attribute.
inherited
getBundleByKref(String krefUri) → Future<Bundle>
Gets a bundle by kref, returned as a Bundle model.
getBundleHistory(String bundleKref) → Future<GetBundleHistoryResponse>
Gets the membership history of a bundle.
inherited
getBundleMembers(String bundleKref, {int? revisionNumber}) → Future<GetBundleMembersResponse>
Gets the current members of a bundle.
inherited
getChildSpaces(String parentPath, {bool recursive = false, int? pageSize, String? cursor}) → Future<List<SpaceResponse>>
Lists child spaces under a parent path.
inherited
getEdges(String kref, {String? edgeTypeFilter, EdgeDirection? direction}) → Future<GetEdgesResponse>
Gets edges for a revision.
inherited
getEventCapabilities() → Future<EventCapabilities>
Gets event streaming capabilities for the current tenant tier.
inherited
getItem(String parentPath, String itemName, String kind) → Future<ItemResponse>
Gets an item by its path components.
inherited
getItemByKref(String kref) → Future<ItemResponse>
Gets an item by its kref URI.
inherited
getItemFromRevision(String revisionKref) → Future<Item>
Gets the item that contains a revision, returned as an Item model.
getItems(String parentPath, {String? nameFilter, String? kindFilter, int? pageSize, String? cursor, bool includeDeprecated = false}) → Future<PagedList<ItemResponse>>
Lists items within a space with optional filtering.
inherited
getLatestRevision(String itemKref) → Future<RevisionResponse?>
Gets the latest revision for an item, or null if none exist.
inherited
getProjects() → Future<List<ProjectResponse>>
Lists all projects accessible to the current user.
inherited
getRevision(String kref) → Future<RevisionResponse>
Gets a revision by its kref URI, with optional tag/time resolution.
inherited
getRevisions(String itemKref) → Future<List<RevisionResponse>>
Lists all revisions for an item.
inherited
getSpace(String pathOrKref) → Future<SpaceResponse>
Gets a space by its path or kref.
inherited
getTenantUsage() → Future<TenantUsageResponse>
Gets the current tenant's usage statistics.
inherited
hardDeleteProject(ProjectDeletionImpactResponse impact, {bool confirmed = false}) → Future<StatusResponse>
inherited
hasTag(String kref, String tag) → Future<bool>
Checks if a revision currently has a tag.
inherited
item(String krefUri) → Future<Item>
Gets an item by kref and returns an Item model.
itemSearch(String contextFilter, String nameFilter, String kindFilter, {int? pageSize, String? cursor, bool includeDeprecated = false}) → Future<PagedList<ItemResponse>>
Searches for items across the project.
inherited
mergeOptions(CallOptions? custom) → CallOptions
Merges default call options with custom options.
inherited
moveItem(String kref, String targetSpacePath, {String? deletionGuardId}) → Future<ItemResponse>
Moves an Item to a Space in another Project without changing its kref.
inherited
newProject(String name, {String description = ''}) → Future<Project>
Creates a new project and returns a Project model.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peekNextRevision(String itemKref) → Future<int>
Peeks at the next revision number without creating it.
inherited
project(String name) → Future<Project?>
Gets a project by name and returns a Project model, or null if no project with that name exists.
projects() → Future<List<Project>>
Gets all projects and returns Project models.
refreshTokenIfNeeded() → Future<bool>
Refreshes the authentication token if needed.
inherited
registerProjectDeletionGuard(String projectId, String guardId, String resourceKref, {required List<String> allowedOperations, List<String> allowedMetadataKeys = const []}) → Future<ProjectDeletionGuardResponse>
inherited
removeBundleMember(String bundleKref, String memberItemKref, {Map<String, String>? metadata}) → Future<RemoveBundleMemberResponse>
Removes an item from a bundle.
inherited
resolve(String kref) → Future<String?>
Resolves a kref to a file location string, or null if it cannot be resolved.
inherited
resolveKref(String kref, {String? tag, String? time}) → Future<RevisionResponse>
Resolves a kref to a specific revision.
inherited
resolveLocation(String kref, {String? tag, String? time}) → Future<ResolveLocationResponse>
Resolves a kref to a file location.
inherited
resolveProjectDeletionGuard(String projectId, String guardId) → Future<StatusResponse>
inherited
resolveProjectReference(String projectId, String insideRevisionKref, String outsideRevisionKref, String edgeType, String action, {String replacementRevisionKref = ''}) → Future<StatusResponse>
inherited
revision(String krefUri) → Future<Revision>
Gets a revision by kref and returns a Revision model.
scoreRevisions(String query, List<String> revisionKrefs, {List<String>? scoreFields}) → Future<List<ScoredRevision>>
Scores specific revisions against a query using server-side embeddings and/or fulltext (no client-side embedding needed).
inherited
Full-text fuzzy search across items (typo-tolerant), mirroring Python's search.
inherited
searchItems({String contextFilter = '', String kindFilter = '', String nameFilter = ''}) → Future<List<Item>>
Searches for items and returns Item models.
setAttribute(String kref, String key, String value) → Future<StatusResponse>
Sets a single metadata attribute.
inherited
setDefaultArtifact(String revisionKref, String artifactName) → Future<StatusResponse>
Sets the default artifact for a revision.
inherited
setDeprecated(String kref, bool deprecated) → Future<StatusResponse>
Sets the deprecated status of an item.
inherited
shutdown() → void
Shut down the channel if it was created by this client.
inherited
shutdownAsync() → Future<void>
Awaitable variant for callers that need to ensure the channel is closed.
inherited
space(String path) → Future<Space>
Gets a space by path and returns a Space model.
tagRevision(String kref, String tag) → Future<StatusResponse>
Tags a revision.
inherited
toString() → String
A string representation of this object.
inherited
traverseEdges(String originKref, EdgeDirection direction, {List<String>? edgeTypeFilter, int? maxDepth, int? limit, bool includePath = false}) → Future<TraverseEdgesResponse>
Traverses edges to find all connected revisions.
inherited
untagRevision(String kref, String tag) → Future<StatusResponse>
Removes a tag from a revision.
inherited
updateArtifactMetadata(String kref, Map<String, String> metadata) → Future<ArtifactResponse>
Updates metadata for an artifact.
inherited
updateItemMetadata(String kref, Map<String, String> metadata) → Future<ItemResponse>
Updates metadata for an item.
inherited
updateProject(String projectId, {bool? allowPublic, String? description}) → Future<ProjectResponse>
Updates a project's settings.
inherited
updateRevisionMetadata(String kref, Map<String, String> metadata) → Future<RevisionResponse>
Updates metadata for a revision.
inherited
updateSpaceMetadata(String kref, Map<String, String> metadata) → Future<SpaceResponse>
Updates metadata for a space.
inherited
wasTagged(String kref, String tag) → Future<bool>
Checks if a revision was ever tagged (including removed tags).
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited