WarmHubClient
HTTP client for WarmHub repository, organization, and component APIs.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WarmHubClient(
apiUrl?,options?):WarmHubClient
Create a WarmHub client.
Pass either an options object or the legacy (apiUrl, options) form. The
options object form is preferred for new code.
Parameters
Section titled “Parameters”apiUrl?
Section titled “apiUrl?”string
options?
Section titled “options?”Returns
Section titled “Returns”WarmHubClient
Constructor
Section titled “Constructor”new WarmHubClient(
options?):WarmHubClient
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”WarmHubClient
Properties
Section titled “Properties”apiUrl
Section titled “apiUrl”
readonlyapiUrl:string
The resolved API base URL the client issues requests against. Defaults to
DEFAULT_API_URL when no apiUrl is passed to the constructor.
readonlyauth:object
Authentication helpers for browser sign-in flows, session checks, and token diagnostics.
getClientId
Section titled “getClientId”getClientId: () =>
Promise<string>
Return the configured browser authentication client ID.
Use this in browser sign-in flows that need to initialize the configured auth provider before redirecting or opening a login UI.
Returns
Section titled “Returns”Promise<string>
sync: () =>
Promise<{ success: boolean; }>
Sync the authenticated identity with WarmHub.
Call after a browser or server session is established so WarmHub can provision or refresh the corresponding user and personal organization records.
Returns
Section titled “Returns”Promise<{ success: boolean; }>
currentUser
Section titled “currentUser”currentUser: () =>
Promise<CurrentUserInfo>
Return the current authenticated WarmHub user.
Throws when the request is unauthenticated or the token cannot be resolved.
Returns
Section titled “Returns”Promise<CurrentUserInfo>
whoami
Section titled “whoami”whoami: () =>
Promise<WhoamiInfo>
Return authentication status, identity details, and token scope diagnostics for the current request.
Returns
Section titled “Returns”Promise<WhoamiInfo>
homepage
Section titled “homepage”
readonlyhomepage:object
Homepage surfaces.
featuredLists
Section titled “featuredLists”featuredLists: () =>
Promise<HomepageFeaturedListsResult>
Return manually curated featured homepage lists.
Returns
Section titled “Returns”Promise<HomepageFeaturedListsResult>
diagnostics
Section titled “diagnostics”
readonlydiagnostics:object
Connectivity and compatibility helpers for checking the configured WarmHub backend.
ping: () =>
Promise<PingResult>
Perform a health-check request against the configured backend URL.
This uses the HTTP health endpoint rather than tRPC, so it is useful for distinguishing connection failures from procedure-level errors.
Returns
Section titled “Returns”Promise<PingResult>
capabilities
Section titled “capabilities”capabilities: () =>
Promise<{ apiVersion: string; minSupportedSdk: string; features: Record<string, boolean>; }>
Return backend API version, minimum supported SDK version, and feature flags.
Returns
Section titled “Returns”Promise<{ apiVersion: string; minSupportedSdk: string; features: Record<string, boolean>; }>
assertCompatible
Section titled “assertCompatible”assertCompatible: () =>
Promise<void>
Verify the installed SDK is at or above the backend’s advertised
minimum supported version, throwing a WarmHubError with a clear
“upgrade to >=X” message when it is not.
Call this once at startup (e.g. immediately after constructing the client) to fail fast on SDK version skew, rather than discovering a removed route deep in the commit pipeline as an opaque error. The result is cached on the client instance — repeated calls reuse the first network round-trip and re-throw the same error if too old.
Returns
Section titled “Returns”Promise<void>
https://github.com/warmhub/warmhub-app/issues/3081
component
Section titled “component”
readonlycomponent:object
Installed component inspection for packages that add shapes, subscriptions, credentials, and seed data to a repository.
The top-level methods cover per-repo installation queries, bundled system installs, and the registry-backed install pipeline used by wh component install <org/name>.
list: (
orgName,repoName,opts?) =>Promise<{ items: Array<{ ref?: string; componentName: string; version?: string; state?: 'initiated' | 'active' | 'uninstalled'; source?: string; sourceUrl?: string; sourceRef?: string; resolvedSha?: string; manifestHash?: string; installedAt?: string; active: boolean; latestVersion?: string; updateAvailable?: boolean; }>; nextCursor?: string; }>
List components installed in a repository.
Pass pagination options when a repository may have many installed components.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ComponentListOptions
Returns
Section titled “Returns”Promise<{ items: Array<{ ref?: string; componentName: string; version?: string; state?: 'initiated' | 'active' | 'uninstalled'; source?: string; sourceUrl?: string; sourceRef?: string; resolvedSha?: string; manifestHash?: string; installedAt?: string; active: boolean; latestVersion?: string; updateAvailable?: boolean; }>; nextCursor?: string; }>
search
Section titled “search”search: (
query,opts?) =>Promise<GlobalSearchResult>
Search registered components visible to the caller across all orgs
(GH-4383): public components plus private components the caller can
read. Distinct from listing components installed in a repo
(component.list).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<GlobalSearchResult>
get: (
orgName,repoName,componentRef) =>Promise<{ ref?: string; componentName: string; version?: string; state?: 'initiated' | 'active' | 'uninstalled'; source?: string; sourceUrl?: string; sourceRef?: string; resolvedSha?: string; manifestHash?: string; installedAt?: string; active: boolean; latestVersion?: string; updateAvailable?: boolean; installedManifest: unknown; installComponentId?: string; ownedShapes: Array<{ name: string; kind: 'shape'; active: boolean; version: { version: number; operation: 'add' | 'revise' | 'retract'; data: unknown; dataHash: string; } | null; componentRef?: string; }>; ownedThings: Array<{ wref: string; name: string; kind: 'shape' | 'thing' | 'assertion' | 'collection'; shapeName?: string; componentRef?: string; version: number; createdAt: number; data?: unknown; active: boolean; aboutWref?: string; roles?: Array<'from' | 'to' | 'ends' | 'first' | 'second'>; metadata?: { durableId: string; createdOn: number; revisedOn: number; }; }>; }>
Fetch one installed component by its Org/Name ref.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
componentRef
Section titled “componentRef”string
Returns
Section titled “Returns”Promise<{ ref?: string; componentName: string; version?: string; state?: 'initiated' | 'active' | 'uninstalled'; source?: string; sourceUrl?: string; sourceRef?: string; resolvedSha?: string; manifestHash?: string; installedAt?: string; active: boolean; latestVersion?: string; updateAvailable?: boolean; installedManifest: unknown; installComponentId?: string; ownedShapes: Array<{ name: string; kind: 'shape'; active: boolean; version: { version: number; operation: 'add' | 'revise' | 'retract'; data: unknown; dataHash: string; } | null; componentRef?: string; }>; ownedThings: Array<{ wref: string; name: string; kind: 'shape' | 'thing' | 'assertion' | 'collection'; shapeName?: string; componentRef?: string; version: number; createdAt: number; data?: unknown; active: boolean; aboutWref?: string; roles?: Array<'from' | 'to' | 'ends' | 'first' | 'second'>; metadata?: { durableId: string; createdOn: number; revisedOn: number; }; }>; }>
history
Section titled “history”history: (
orgName,repoName,opts?) =>Promise<{ items: Array<{ ref: string; kind: string; version: string | null; createdAt: number; }>; }>
Install lifecycle timeline from the durable install-events log (GH-4690).
Omit componentRef for the repo-wide activity feed; pass Org/Name for a
single component’s history.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ComponentHistoryOptions
Returns
Section titled “Returns”Promise<{ items: Array<{ ref: string; kind: string; version: string | null; createdAt: number; }>; }>
install
Section titled “install”install: (
orgName,repoName,componentRef) =>Promise<ComponentInstallResult>
Install a registered component into a repository (GH-4610).
Backend-driven: the server resolves the registration and its latest
published manifest, reconciles the shapes/subscriptions/credentials/seeds
into the target repo, and runs the component’s optional setup callback —
the same pipeline wh component install <org/name> drives. orgName /
repoName identify the INSTALL repo; componentRef is the
<org>/<name> of the component to install. Requires things:write on the
install repo; private registrations require owner-org membership.
Reinstall is idempotent: the install identity (installId) is reused so
runtime tokens keyed on it survive teardown/reinstall.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
componentRef
Section titled “componentRef”string
Returns
Section titled “Returns”Promise<ComponentInstallResult>
uninstall
Section titled “uninstall”uninstall: (
orgName,repoName,componentRef) =>Promise<ComponentUninstallResult>
Uninstall a registered component from a repository (GH-4677).
Backend-driven terminal teardown — the sibling of install: the
server pauses the install’s subscriptions per the manifest teardown
policy, revokes its tokens in place, dispatches the component’s optional
uninstall callback, and marks the repo-local ComponentInstall record
uninstalled. The same pipeline wh component teardown <org/name> drives.
orgName / repoName identify the INSTALL repo; componentRef is the
<org>/<name> of the component. Requires things:write on the install
repo; private registrations require owner-org membership.
Non-destructive: manifest shapes and seeded data are left intact (only repo deletion removes those) and reinstall revives the install.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
componentRef
Section titled “componentRef”string
Returns
Section titled “Returns”Promise<ComponentUninstallResult>
registry
Section titled “registry”registry:
object
Registered-component identity and install-pipeline operations.
This sub-surface drives the backend-mediated install flow that powers wh component install <org/name>. It manages registered component identities (register, unregister, list, view, update) and the install pipeline (resolve returns the latest published manifest plus an install id, setupCall dispatches the optional setup callback). Use these when building a custom installer; most callers should run the CLI instead.
registry.register
Section titled “registry.register”register: (
orgName,componentName,input) =>Promise<{ ownerOrgName: string; componentName: string; ref: string; isPrivate: boolean; mintedTokens: boolean; sourceUrl?: string; sourceDefaultRef?: string; setupUrl?: string; uninstallUrl?: string; allowedCallbackDomains: string[]; credentialSetId?: string; credentialSetName?: string; description?: string; createdAt: number; updatedAt: number; }>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
componentName
Section titled “componentName”string
unknown
Returns
Section titled “Returns”Promise<{ ownerOrgName: string; componentName: string; ref: string; isPrivate: boolean; mintedTokens: boolean; sourceUrl?: string; sourceDefaultRef?: string; setupUrl?: string; uninstallUrl?: string; allowedCallbackDomains: string[]; credentialSetId?: string; credentialSetName?: string; description?: string; createdAt: number; updatedAt: number; }>
registry.unregister
Section titled “registry.unregister”unregister: (
orgName,componentName) =>Promise<{unregistered:true; }>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
componentName
Section titled “componentName”string
Returns
Section titled “Returns”Promise<{ unregistered: true; }>
registry.list
Section titled “registry.list”list: (
orgName) =>Promise<unknown>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
Returns
Section titled “Returns”Promise<unknown>
registry.view
Section titled “registry.view”view: (
orgName,componentName) =>Promise<{ ownerOrgName: string; componentName: string; ref: string; isPrivate: boolean; mintedTokens: boolean; sourceUrl?: string; sourceDefaultRef?: string; setupUrl?: string; uninstallUrl?: string; allowedCallbackDomains: string[]; credentialSetId?: string; credentialSetName?: string; description?: string; createdAt: number; updatedAt: number; }>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
componentName
Section titled “componentName”string
Returns
Section titled “Returns”Promise<{ ownerOrgName: string; componentName: string; ref: string; isPrivate: boolean; mintedTokens: boolean; sourceUrl?: string; sourceDefaultRef?: string; setupUrl?: string; uninstallUrl?: string; allowedCallbackDomains: string[]; credentialSetId?: string; credentialSetName?: string; description?: string; createdAt: number; updatedAt: number; }>
registry.update
Section titled “registry.update”update: (
orgName,componentName,input) =>Promise<{ ownerOrgName: string; componentName: string; ref: string; isPrivate: boolean; mintedTokens: boolean; sourceUrl?: string; sourceDefaultRef?: string; setupUrl?: string; uninstallUrl?: string; allowedCallbackDomains: string[]; credentialSetId?: string; credentialSetName?: string; description?: string; createdAt: number; updatedAt: number; }>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
componentName
Section titled “componentName”string
{ isPrivate?: boolean; mintedTokens?: boolean; sourceUrl?: string; sourceDefaultRef?: string; setupUrl?: string; uninstallUrl?: string; allowedCallbackDomains?: string[]; credentialSetName?: string; description?: string; manifest?: Record<string, unknown>; }
Returns
Section titled “Returns”Promise<{ ownerOrgName: string; componentName: string; ref: string; isPrivate: boolean; mintedTokens: boolean; sourceUrl?: string; sourceDefaultRef?: string; setupUrl?: string; uninstallUrl?: string; allowedCallbackDomains: string[]; credentialSetId?: string; credentialSetName?: string; description?: string; createdAt: number; updatedAt: number; }>
registry.resolve
Section titled “registry.resolve”resolve: (
orgName,componentName,installRepo) =>Promise<{ manifest: Record<string, unknown>; manifestHash: string; hasSetup: boolean; }>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
componentName
Section titled “componentName”string
installRepo
Section titled “installRepo”string
Returns
Section titled “Returns”Promise<{ manifest: Record<string, unknown>; manifestHash: string; hasSetup: boolean; }>
registry.setupCall
Section titled “registry.setupCall”setupCall: (
orgName,componentName,input) =>Promise<{ ok: boolean; status: number; body?: string; warnings: string[]; }>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
componentName
Section titled “componentName”string
{ installId: string; installRepo: string; expectedManifestHash: string; }
Returns
Section titled “Returns”Promise<{ ok: boolean; status: number; body?: string; warnings: string[]; }>
cli:
object
Operator-invoked CLI methods (GH-3193).
cli.call(orgName, componentName, method, { installRepo, args })
dispatches a component-declared method via the backend. The backend
loads the install’s manifest snapshot, verifies the method exists,
authorizes the operator, signs the request with the install-repo
credential set (HMAC over ${timestamp}.${body} by default), and
proxies the component service’s JSON response back as the envelope’s
body.
WarmHub-level failures (component not installed, method not in snapshot,
ComponentConfig.cliBaseUrl missing, credentials missing, operator
lacks requiresPermission) come back as a thrown WarmHubError.
Upstream non-2xx responses do not throw — they arrive inside the
envelope as { ok: false, status, body } so the CLI can pretty-print
the component’s own error payload.
cli.call
Section titled “cli.call”call: (
orgName,componentName,method,input) =>Promise<{ ok: boolean; status: number; body?: string; warnings: string[]; }>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
componentName
Section titled “componentName”string
method
Section titled “method”string
{ installRepo: string; args?: Record<string, unknown>; }
Returns
Section titled “Returns”Promise<{ ok: boolean; status: number; body?: string; warnings: string[]; }>
commit
Section titled “commit”
readonlycommit:object
High-level write surface for submitting WarmHub operations through the commit pipeline.
apply: (
orgName,repoName,message,operations,opts?) =>Promise<OperationSubmitResult>
Submit one or more operations through WarmHub’s commit pipeline.
This is the primary write path for SDK callers. It streams operations to the backend, preserves server-side per-operation results, supports chunking for large submissions, and can attribute writes to a committer wref or installed component.
Simple first-chunk transport failures are retried by default. Ambiguous failures surface as PartialStreamSubmissionError, including the case where an ambiguous attempt is followed by an all-failed retry; inspect error.cause for the underlying AllStreamOperationsFailedError or backend error. Deterministic all-failed submissions without prior ambiguity throw AllStreamOperationsFailedError directly so callers can inspect per-operation failure rows. Validation, auth, conflict, rate-limit, and other definite backend failures surface as WarmHubError. See Transient Retry for the full retry and partial-submission rules.
Writing to an archived organization or repository fails with an ARCHIVED error before any operations are applied.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
message
Section titled “message”string | undefined
Optional commit message stored with the submitted operations.
operations
Section titled “operations”Add, revise, or retract operations to submit in order.
committer?
Section titled “committer?”string
Optional untyped wref identifying the actor on whose behalf the write is made. It may target an existing shape ("Agent") or shaped thing ("Agent/bot-1"), locally or canonically ("wh:other-org/other-repo/Agent" or "wh:other-org/other-repo/Agent/bot-1"). A one-segment value is a shape wref, not a free-form label, and succeeds only when that shape exists. On success, OperationSubmitResult.committer echoes the supplied wref string; version reads expose the resolved target as committerWref.
componentRef?
Section titled “componentRef?”string
Attribute writes to an installed component, identified by its Org/Name ref, when the caller is allowed to claim it.
chunkSize?
Section titled “chunkSize?”number
Maximum operations per stream append. Values are clamped by the SDK.
skipExisting?
Section titled “skipExisting?”boolean
Return noop for add operations whose target already exists.
streamId?
Section titled “streamId?”string
Advanced continuation hook for caller-managed streams.
returnRepoSeq?
Section titled “returnRepoSeq?”boolean
Return the sequence allocated to the writer’s own commit acknowledgement. This does not disclose a reader-facing repository head. Multi-chunk submissions return the last sequence actually allocated; a later no-op or failed chunk does not erase it.
retry?
Section titled “retry?”false | RetryPolicyOptions
Retry policy for transient first-chunk failures, or false to disable automatic retry.
Returns
Section titled “Returns”Promise<OperationSubmitResult>
https://docs.warmhub.ai/sdk/write-methods/
readonlyorg:object
Organization management surface for namespaces, membership, roles, and scoped member permissions.
get: (
orgName) =>Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
Get an organization by name.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
Returns
Section titled “Returns”Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
getCallerRole
Section titled “getCallerRole”getCallerRole: (
orgName) =>Promise<OrgRole|null>
Return the caller’s role in an organization, or null when the caller is not a member.
Useful for UI gating before showing organization-level controls.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
Returns
Section titled “Returns”Promise<OrgRole | null>
list: (
opts?) =>Promise<Page<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>>
List organizations visible to the caller.
Archived organizations are hidden unless includeArchived is set.
Parameters
Section titled “Parameters”OrgListOptions
Returns
Section titled “Returns”Promise<Page<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>>
create
Section titled “create”create: (
name,displayName?,description?) =>Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
Create a new organization.
The description is trimmed and empty strings are ignored. Organization names must avoid reserved public slugs such as docs, api, login, and warmhub.
Parameters
Section titled “Parameters”string
displayName?
Section titled “displayName?”string
Optional display label. Defaults to the organization name when omitted.
description?
Section titled “description?”string
Returns
Section titled “Returns”Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
setDescription
Section titled “setDescription”setDescription: (
orgName,description?) =>Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
Set or clear an organization description.
Descriptions are trimmed; empty strings clear the stored value.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
description?
Section titled “description?”string
Returns
Section titled “Returns”Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
setDisplayName
Section titled “setDisplayName”setDisplayName: (
orgName,displayName) =>Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
Update an organization’s display name.
Display names are trimmed; empty or whitespace-only values are rejected.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
displayName
Section titled “displayName”string
Returns
Section titled “Returns”Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
rename
Section titled “rename”rename: (
orgName,newName) =>Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
Rename an organization in place.
The new slug must satisfy the same naming and reserved-name rules as organization creation.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
newName
Section titled “newName”string
Returns
Section titled “Returns”Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
update
Section titled “update”update: (
input) =>Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
Atomic combined update of an organization’s display name and/or slug.
Both writes run in a single backend transaction so a slug conflict cannot leave a partial display-name change behind. Pass at least one of displayName or newName.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
displayName?
Section titled “displayName?”string
newName?
Section titled “newName?”string
Returns
Section titled “Returns”Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
addMember
Section titled “addMember”addMember: (
orgName,role) =>Promise<{ email: string; firstName?: string; lastName?: string; role: 'owner' | 'admin' | 'editor' | 'viewer'; status: 'active' | 'pending'; invitedBy?: string; createdAt: number; }>
Add a member to an organization or create a pending invite.
The role defaults to editor. If the email address does not belong to an existing WarmHub user, WarmHub creates a pending invite and attempts to send the invite email asynchronously. Only owners can assign the owner role.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
string
"owner" | "admin" | "editor" | "viewer"
Organization role to assign. Defaults to editor.
Returns
Section titled “Returns”Promise<{ email: string; firstName?: string; lastName?: string; role: 'owner' | 'admin' | 'editor' | 'viewer'; status: 'active' | 'pending'; invitedBy?: string; createdAt: number; }>
removeMember
Section titled “removeMember”removeMember: (
orgName,Promise<void>
Remove an active member or revoke a pending invite by email address.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
string
Returns
Section titled “Returns”Promise<void>
leave: (
orgName) =>Promise<void>
Leave an organization the caller is a member of (self-service).
Session-only: requires an interactive user session, so personal access tokens are rejected. You cannot leave your personal organization, and an owner can only leave when the organization retains another active owner.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
Returns
Section titled “Returns”Promise<void>
changeMemberRole
Section titled “changeMemberRole”changeMemberRole: (
orgName,role) =>Promise<{ email: string; firstName?: string; lastName?: string; role: 'owner' | 'admin' | 'editor' | 'viewer'; status: 'active' | 'pending'; invitedBy?: string; createdAt: number; }>
Change a member’s organization role.
Only owners can promote another member to owner or demote an existing owner. WarmHub rejects attempts to remove the final owner.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
string
"owner" | "admin" | "editor" | "viewer"
Returns
Section titled “Returns”Promise<{ email: string; firstName?: string; lastName?: string; role: 'owner' | 'admin' | 'editor' | 'viewer'; status: 'active' | 'pending'; invitedBy?: string; createdAt: number; }>
setMemberScopes
Section titled “setMemberScopes”setMemberScopes: (
orgName,scopes) =>Promise<void>
Replace a member’s scoped permission entries.
Each entry targets either the organization (acme) or one repository (acme/world) and carries the full desired permission set for that resource. Matching entries replace the role-derived permission set for that resource; include every permission the member should retain.
Member scope entries share the same wire shape as personal access token scopes, but allowedMatches is enforced for PATs only. Member scopes cannot restrict access by thing-name glob.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
string
scopes
Section titled “scopes”WireScopeEntry[]
Scoped permission entries with resource and permissions fields.
Returns
Section titled “Returns”Promise<void>
clearMemberScopes
Section titled “clearMemberScopes”clearMemberScopes: (
orgName,Promise<void>
Remove all scoped permission entries from a member.
After clearing, the member’s effective access comes from their organization role only.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
string
Returns
Section titled “Returns”Promise<void>
listMembers
Section titled “listMembers”listMembers: (
orgName,opts?) =>Promise<OrgMemberList>
List organization members and pending invites.
The response includes the caller’s current organization role so frontend settings pages can gate owner/admin-only controls without making a second request.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
OrgListMembersOptions
Returns
Section titled “Returns”Promise<OrgMemberList>
archive
Section titled “archive”archive: (
orgName) =>Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
Archive an organization, blocking new repositories and membership changes.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
Returns
Section titled “Returns”Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
unarchive
Section titled “unarchive”unarchive: (
orgName) =>Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
Unarchive an organization.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
Returns
Section titled “Returns”Promise<{ name: string; displayName: string; description?: string; tier: 'free' | 'pro' | 'enterprise'; archivedAt?: number; createdAt: number; repoCount?: number; errorCount?: number; lastActivityAt?: number; }>
readonlyrepo:object
Repository management surface for lifecycle operations, metadata, statistics, and content documents.
get: (
orgName,repoName) =>Promise<RepoInfo>
Get a repository by organization and repository name.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<RepoInfo>
getStats
Section titled “getStats”getStats: (
orgName,repoName) =>Promise<{ total: number; byKind: { shape: number; thing: number; assertion: number; }; byShape: Record<string, number>; }>
Return authoritative active-item totals for a single repository.
The returned total is the sum of active shapes, things, and assertions. Use this when billing, quota checks, health reports, or per-shape breakdowns need single-repo stats.
The per-shape breakdown counts active things and assertions by shape.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<{ total: number; byKind: { shape: number; thing: number; assertion: number; }; byShape: Record<string, number>; }>
getStatsBatch
Section titled “getStatsBatch”getStatsBatch: (
orgName,repoNames) =>Promise<RepoStatsBatchResult>
Return active-item totals for up to 100 repositories in one request.
Use this instead of issuing one getStats request per repository when building organization dashboards. Batch entries include the exact total for visible repositories; call getStats for an individual repository when you need the per-shape map.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoNames
Section titled “repoNames”string[]
Returns
Section titled “Returns”Promise<RepoStatsBatchResult>
getConfigureStats
Section titled “getConfigureStats”getConfigureStats: (
orgName,repoName) =>Promise<{ subscriptionCount: number; }>
Return configuration-surface counts for a repository.
Currently this reports the number of subscriptions attached to the repository, which is useful before delete or visibility-change flows.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<{ subscriptionCount: number; }>
getShapeInstanceCounts
Section titled “getShapeInstanceCounts”getShapeInstanceCounts: (
orgName,repoName) =>Promise<Record<string, { things: number; assertions: number; }>>
Return per-shape thing and assertion counts for a repository.
The server computes the totals directly, so callers do not need to page through repository contents to build shape summary UI.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<Record<string, { things: number; assertions: number; }>>
list: (
orgName,opts?) =>Promise<{ items: Array<{ orgName: string; name: string; displayName: string; description?: string; visibility: 'public' | 'private'; archivedAt?: number; createdAt: number; }>; nextCursor?: string; }>
List repositories in an organization.
Archived repositories are hidden by default. Search and sort options are applied before pagination.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
RepoListOptions
Returns
Section titled “Returns”Promise<{ items: Array<{ orgName: string; name: string; displayName: string; description?: string; visibility: 'public' | 'private'; archivedAt?: number; createdAt: number; }>; nextCursor?: string; }>
search
Section titled “search”search: (
query,opts?) =>Promise<GlobalSearchResult>
Search repos visible to the caller across all orgs (GH-4383): public repos plus private repos the caller can read. BM25 over name/description/shape vocabulary/README.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<GlobalSearchResult>
create
Section titled “create”create: (
orgName,repoName,description?,visibility?,displayName?) =>Promise<RepoInfo>
Create a repository inside an organization.
Repositories are private by default. Descriptions are trimmed and capped by the backend.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
description?
Section titled “description?”string
visibility?
Section titled “visibility?”'public' | 'private'
public or private; defaults to private.
displayName?
Section titled “displayName?”string
Returns
Section titled “Returns”Promise<RepoInfo>
setDescription
Section titled “setDescription”setDescription: (
orgName,repoName,description?) =>Promise<RepoInfo>
Set or clear a repository description.
Descriptions are trimmed; empty strings clear the stored value.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
description?
Section titled “description?”string
Returns
Section titled “Returns”Promise<RepoInfo>
setDisplayName
Section titled “setDisplayName”setDisplayName: (
orgName,repoName,displayName) =>Promise<RepoInfo>
Set a repository display name.
displayName is required and non-empty (trimmed); slug fallback is a
creation-time behavior only and there is no clear-to-slug flow.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
displayName
Section titled “displayName”string
Returns
Section titled “Returns”Promise<RepoInfo>
setVisibility
Section titled “setVisibility”setVisibility: (
orgName,repoName,visibility) =>Promise<RepoInfo>
Set a repository’s visibility to public or private.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
visibility
Section titled “visibility”'public' | 'private'
Returns
Section titled “Returns”Promise<RepoInfo>
rename
Section titled “rename”rename: (
orgName,repoName,newName) =>Promise<RepoInfo>
Rename a repository within its organization.
The new name must be unused in the organization and follow the same path-segment rules as repository creation.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
newName
Section titled “newName”string
Returns
Section titled “Returns”Promise<RepoInfo>
update
Section titled “update”update: (
input) =>Promise<RepoInfo>
Atomic combined update of a repository’s display name and/or slug.
Both writes run in a single backend transaction so a slug conflict cannot leave a partial display-name change behind. Pass at least one of displayName or newName. displayName is rejected when empty — slug fallback is a creation-time behavior only.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
displayName?
Section titled “displayName?”string
newName?
Section titled “newName?”string
Returns
Section titled “Returns”Promise<RepoInfo>
archive
Section titled “archive”archive: (
orgName,repoName) =>Promise<RepoInfo>
Archive a repository, blocking new writes.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<RepoInfo>
unarchive
Section titled “unarchive”unarchive: (
orgName,repoName) =>Promise<RepoInfo>
Unarchive a repository.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<RepoInfo>
delete
Section titled “delete”delete: (
orgName,repoName) =>Promise<{graceExpiresAt:Date; }>
Soft-delete a repository.
The repository is hidden immediately and scheduled for permanent purge after a 30-day grace window. WarmHub blocks deletion when another repository still has inbound cross-repo references, active subscriptions, or active credential grants that depend on the repository.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<{ graceExpiresAt: Date; }>
listPage
Section titled “listPage”listPage: (
orgName,opts?) =>Promise<RepoListPageResult>
List repositories with dashboard-oriented per-repository metadata.
Each item includes exact active counts, an activity-oriented lastWriteAt, and a hasErrors flag for terminal action failures.
Search and sort are applied before pagination, so cursors remain stable across the filtered and ordered list.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
RepoListPageOptions
Returns
Section titled “Returns”Promise<RepoListPageResult>
listForCaller
Section titled “listForCaller”listForCaller: (
opts?) =>Promise<{ orgName: string; name: string; displayName: string; createdAt: number; lastWriteAt?: number; }[]>
List the caller’s repositories across every org they belong to, ordered
for recency by default (most recently written first), capped at limit.
Unlike listPage, this is user-level and resolves the caller’s orgs
server-side, so you don’t fan out one request per org to build an
account-wide view. Membership is the access filter and per-token
allowedMatches narrowing is not applied, so this requires an
interactive session — PAT and component-token callers are rejected. Use
the org-scoped listPage from token-authenticated contexts.
Parameters
Section titled “Parameters”RepoListForCallerOptions
Returns
Section titled “Returns”Promise<{ orgName: string; name: string; displayName: string; createdAt: number; lastWriteAt?: number; }[]>
explore
Section titled “explore”explore: (
opts?) =>Promise<RepoExploreResult>
Browse the public “Explore” directory: every visibility='public' live
repository across all orgs, with search, org/activity/subscription/thing
filters, and sort. No auth required — anonymous callers see the same
public-only listing.
Two mutually-exclusive modes. Browse mode paginates a filtered, sorted
listing (search/org/activity/hasSubscriptions/minThings/sort/
limit/cursor). Slugs mode is an exact-match batch lookup: pass up to
12 org/repo slugs to resolve just those live public repos in input
order, ignoring every browse field. Combining slugs with any browse/
search/sort/filter field is a hard input error, not a silently-filtered
list.
total and orgs (the org-filter facet) are returned on the first page
only — i.e. when cursor is absent.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”{ search?: string; org?: string; activity?: 'week' | 'month'; hasSubscriptions?: true; minThings?: number; sort?: 'recentlyUpdated' | 'mostSubscribed' | 'mostThings' | 'nameAsc' | 'newest'; limit?: number; cursor?: string; slugs?: Array<string>; }
Returns
Section titled “Returns”Promise<RepoExploreResult>
getReadme
Section titled “getReadme”getReadme: (
orgName,repoName) =>Promise<ThingDetail|null>
Fetch a repository’s Content/Readme markdown record.
The SDK contract allows null; current backend behavior returns a synthesized empty stub for repositories that have not committed README content yet. Callers should still null-check defensively.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<ThingDetail | null>
getAgents
Section titled “getAgents”getAgents: (
orgName,repoName) =>Promise<ThingDetail|null>
Fetch a repository’s Content/Agents markdown record.
The SDK contract allows null; current backend behavior mirrors getReadme and returns a synthesized empty stub when no AGENTS.md content has been committed yet.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<ThingDetail | null>
setReadme
Section titled “setReadme”setReadme: (
orgName,repoName,content) =>Promise<{ committer?: string; createdByEmail?: string; message?: string; operationCount: number; repoSeq?: number; operations: Array<{ opIndex?: number; name: string; operation: 'add' | 'revise' | 'retract' | 'rename' | 'noop'; version: number; dataHash: string; status?: 'applied' | 'noop'; warnings?: { undeclaredFields?: Array<string>; undeclaredFieldsTruncated?: true; totalUndeclared?: number; coalescedWrefs?: Array<{ fieldPath: string; wref: string; reason: string; }>; coalescedWrefsTruncated?: true; totalCoalescedWrefs?: number; deprecations?: Array<{ shape: string; message: string; removalMilestone: string; }>; }; }>; }>
Commit a new Content/Readme value.
The backend adds or revises the content record through the normal commit pipeline.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
content
Section titled “content”string
Returns
Section titled “Returns”Promise<{ committer?: string; createdByEmail?: string; message?: string; operationCount: number; repoSeq?: number; operations: Array<{ opIndex?: number; name: string; operation: 'add' | 'revise' | 'retract' | 'rename' | 'noop'; version: number; dataHash: string; status?: 'applied' | 'noop'; warnings?: { undeclaredFields?: Array<string>; undeclaredFieldsTruncated?: true; totalUndeclared?: number; coalescedWrefs?: Array<{ fieldPath: string; wref: string; reason: string; }>; coalescedWrefsTruncated?: true; totalCoalescedWrefs?: number; deprecations?: Array<{ shape: string; message: string; removalMilestone: string; }>; }; }>; }>
setAgents
Section titled “setAgents”setAgents: (
orgName,repoName,content) =>Promise<{ committer?: string; createdByEmail?: string; message?: string; operationCount: number; repoSeq?: number; operations: Array<{ opIndex?: number; name: string; operation: 'add' | 'revise' | 'retract' | 'rename' | 'noop'; version: number; dataHash: string; status?: 'applied' | 'noop'; warnings?: { undeclaredFields?: Array<string>; undeclaredFieldsTruncated?: true; totalUndeclared?: number; coalescedWrefs?: Array<{ fieldPath: string; wref: string; reason: string; }>; coalescedWrefsTruncated?: true; totalCoalescedWrefs?: number; deprecations?: Array<{ shape: string; message: string; removalMilestone: string; }>; }; }>; }>
Commit a new Content/Agents value through the normal commit pipeline.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
content
Section titled “content”string
Returns
Section titled “Returns”Promise<{ committer?: string; createdByEmail?: string; message?: string; operationCount: number; repoSeq?: number; operations: Array<{ opIndex?: number; name: string; operation: 'add' | 'revise' | 'retract' | 'rename' | 'noop'; version: number; dataHash: string; status?: 'applied' | 'noop'; warnings?: { undeclaredFields?: Array<string>; undeclaredFieldsTruncated?: true; totalUndeclared?: number; coalescedWrefs?: Array<{ fieldPath: string; wref: string; reason: string; }>; coalescedWrefsTruncated?: true; totalCoalescedWrefs?: number; deprecations?: Array<{ shape: string; message: string; removalMilestone: string; }>; }; }>; }>
getLlmsTxt
Section titled “getLlmsTxt”getLlmsTxt: (
orgName,repoName) =>Promise<SynthesizedRepoContent>
Fetch the synthesized Content/LlmsTxt sitemap for a repository.
The returned markdown follows the llms.txt convention. Authenticated callers also receive structured reference metadata partitioned by readable outbound and inbound references; cross-org references the caller cannot read are omitted.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<SynthesizedRepoContent>
index:
object
Field-index diagnostics.
index.describe
Section titled “index.describe”describe: (
orgName,repoName) =>Promise<IndexedFieldsReport>
Describe all indexed fields for a repo, grouped by state.
Returns ready, building, failed, and other buckets (read-only diagnostics).
Use wh repo describe --indexed-fields --repo <org/repo>.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<IndexedFieldsReport>
https://docs.warmhub.ai/sdk/repo-stats/
readonlyshape:object
Shape management surface for schema definitions that validate things and assertions.
list: (
orgName,repoName,opts?) =>Promise<{ items: Array<{ name: string; kind: 'shape'; active: boolean; version: { version: number; operation: 'add' | 'revise' | 'retract'; data: unknown; dataHash: string; } | null; componentRef?: string; }>; }>
List shape definitions in a repository.
Options can include retracted shapes, filter by component ownership, or hide component-owned shapes.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ShapeListOptions
Returns
Section titled “Returns”Promise<{ items: Array<{ name: string; kind: 'shape'; active: boolean; version: { version: number; operation: 'add' | 'revise' | 'retract'; data: unknown; dataHash: string; } | null; componentRef?: string; }>; }>
get: (
orgName,repoName,shapeName,opts?) =>Promise<{ name: string; kind: 'shape'; active: boolean; version: { version: number; operation: 'add' | 'revise' | 'retract'; data: unknown; dataHash: string; } | null; componentRef?: string; }>
Get one shape definition by name.
Returns the full shape thing record, with name,
kind: "shape", active, and a nested version: { version, operation, data, dataHash } | null. This is not the same shape as the
shape returned by create and revise: the change result
is flat (name, operation, version: number, dataHash) and does
not carry data. To read shape fields, call get and read
result.version?.data — the change result alone is not enough.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
shapeName
Section titled “shapeName”string
ShapeGetOptions
Returns
Section titled “Returns”Promise<{ name: string; kind: 'shape'; active: boolean; version: { version: number; operation: 'add' | 'revise' | 'retract'; data: unknown; dataHash: string; } | null; componentRef?: string; }>
create
Section titled “create”create: (
orgName,repoName,shapeName,fields,opts?) =>Promise<{ name: string; operation: 'add' | 'revise' | 'retract' | 'noop'; version: number; dataHash: string; }>
Create a shape definition.
Shape data should describe the fields used to validate things and assertions with that shape.
Returns { name, operation, version, dataHash }.
The result confirms the write and exposes the new version number, but it
does not include the shape data — call client.shape.get for the
full shape record (with kind, active, and nested
version.data).
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
shapeName
Section titled “shapeName”string
fields
Section titled “fields”Record<string, unknown>
ShapeCreateOptions
Returns
Section titled “Returns”Promise<{ name: string; operation: 'add' | 'revise' | 'retract' | 'noop'; version: number; dataHash: string; }>
revise
Section titled “revise”revise: (
orgName,repoName,shapeName,newFields,opts?) =>Promise<{ name: string; operation: 'add' | 'revise' | 'retract' | 'noop'; version: number; dataHash: string; }>
Revise a shape definition, creating a new shape version.
Returns { name, operation, version, dataHash },
the same flat shape as create. To read the revised fields back, call
client.shape.get for the full shape record.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
shapeName
Section titled “shapeName”string
newFields
Section titled “newFields”Record<string, unknown>
ShapeReviseOptions
Returns
Section titled “Returns”Promise<{ name: string; operation: 'add' | 'revise' | 'retract' | 'noop'; version: number; dataHash: string; }>
remove
Section titled “remove”remove: (
orgName,repoName,shapeName) =>Promise<ShapeRemove>
Retract a shape definition.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
shapeName
Section titled “shapeName”string
Returns
Section titled “Returns”Promise<ShapeRemove>
rename
Section titled “rename”rename: (
orgName,repoName,oldName,newName) =>Promise<RenameResult>
Rename a shape within a repository.
The rename is applied in place: the existing shape history is preserved and no new version is created.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
oldName
Section titled “oldName”string
newName
Section titled “newName”string
Returns
Section titled “Returns”Promise<RenameResult>
history
Section titled “history”history: (
orgName,repoName,name,opts) =>Promise<HistoryResult>
Return add, revise, retract, and rename history for a shape.
Use pagination options for long-lived shapes with many revisions.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
string
ShapeHistoryOptions = {}
Returns
Section titled “Returns”Promise<HistoryResult>
subscription
Section titled “subscription”
readonlysubscription:object
Webhook subscription management surface scoped to a repository.
create
Section titled “create”create: (
input) =>Promise<SubscriptionInfo>
Create a webhook subscription.
Webhook subscriptions require a delivery URL. Commit subscriptions are
repo-scoped and require a shape/filter; repo and org metadata
subscriptions omit commit-only fields. Org-scoped events also omit
repoName.
Delivery can use a fallback URL and allow trace reentry. Commit subscriptions can additionally forward events from another repository.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SubscriptionInfo>
get: (…
args) =>Promise<SubscriptionInfo>
Get one subscription by name.
Repo-scoped subscriptions are addressed by (orgName, repoName, name);
org-scoped subscriptions omit repoName via the object
form: get({ orgName, name }).
Parameters
Section titled “Parameters”…[ orgName: string, repoName: string, name: string ] | [ ref: { orgName: string; repoName?: string; name: string; } ]
Returns
Section titled “Returns”Promise<SubscriptionInfo>
reveal
Section titled “reveal”reveal: (…
args) =>Promise<{ webhookUrl?: string; fallbackWebhookUrl?: string; }>
Reveal the raw webhook URL(s) for a subscription.
Reads return only webhookOrigin/fallbackWebhookOrigin (scheme://host);
the raw URL path is a bearer secret. This break-glass call returns the
raw URL(s) and is audit-logged server-side. Requires repo:configure.
Because it returns the secret, a name-scoped principal (e.g. a component
setup token) may reveal only the subscriptions it is scoped to — a
stricter contract than the redacted get/list, which are unscoped.
Parameters
Section titled “Parameters”…[ orgName: string, repoName: string, name: string ] | [ ref: { orgName: string; repoName?: string; name: string; } ]
Returns
Section titled “Returns”Promise<{ webhookUrl?: string; fallbackWebhookUrl?: string; }>
list: (…
args) =>Promise<SubscriptionList>
List subscriptions in a scope.
Pass (orgName, repoName) to list a repository’s subscriptions, or omit
repoName — list(orgName) or list({ orgName }) — to list the
org-scoped subscriptions.
Parameters
Section titled “Parameters”…[ orgName: string, repoName?: string ] | [ ref: { orgName: string; repoName?: string; } ]
Returns
Section titled “Returns”Promise<SubscriptionList>
update
Section titled “update”update: (
input) =>Promise<SubscriptionInfo>
Update an existing webhook subscription.
Use null for nullable fields such as fallback webhook URL when you need to clear an existing value. Legacy cron subscriptions cannot be updated — delete them instead.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SubscriptionInfo>
pause: (…
args) =>Promise<{name:string;active:boolean; }>
Pause a subscription.
Omit repoName (object form) to pause an org-scoped subscription.
Parameters
Section titled “Parameters”…[ orgName: string, repoName: string, name: string ] | [ ref: { orgName: string; repoName?: string; name: string; } ]
Returns
Section titled “Returns”Promise<{ name: string; active: boolean; }>
resume
Section titled “resume”resume: (…
args) =>Promise<{name:string;active:boolean; }>
Resume a paused subscription.
Omit repoName (object form) to resume an org-scoped subscription.
Parameters
Section titled “Parameters”…[ orgName: string, repoName: string, name: string ] | [ ref: { orgName: string; repoName?: string; name: string; } ]
Returns
Section titled “Returns”Promise<{ name: string; active: boolean; }>
remove
Section titled “remove”remove: (…
args) =>Promise<{ok:true; }>
Delete a subscription.
Omit repoName (object form) to delete an org-scoped subscription.
Parameters
Section titled “Parameters”…[ orgName: string, repoName: string, name: string ] | [ ref: { orgName: string; repoName?: string; name: string; } ]
Returns
Section titled “Returns”Promise<{ ok: true; }>
bindCredentials
Section titled “bindCredentials”bindCredentials: (…
args) =>Promise<SubscriptionBindCredentialsResult>
Bind a credential set to a subscription for outbound webhook authentication.
Omit repoName (object form) to bind an org-scoped subscription to one of
the org’s org-scoped credential sets.
Parameters
Section titled “Parameters”…[ orgName: string, repoName: string, subscriptionName: string, credentialSetName: string ] | [ ref: { orgName: string; repoName?: string; subscriptionName: string; credentialSetName: string; } ]
Returns
Section titled “Returns”Promise<SubscriptionBindCredentialsResult>
unbindCredentials
Section titled “unbindCredentials”unbindCredentials: (…
args) =>Promise<SubscriptionUnbindCredentialsResult>
Remove the credential set currently bound to a subscription.
Omit repoName (object form) for an org-scoped subscription.
Parameters
Section titled “Parameters”…[ orgName: string, repoName: string, subscriptionName: string ] | [ ref: { orgName: string; repoName?: string; subscriptionName: string; } ]
Returns
Section titled “Returns”Promise<SubscriptionUnbindCredentialsResult>
https://docs.warmhub.ai/sdk/component-identity/#subscriptions
action
Section titled “action”
readonlyaction:object
Low-level action lease, delivery, run, and notification primitives for subscription consumers.
acquireLease
Section titled “acquireLease”acquireLease: (
orgName,repoName,subscriptionName,holderId,holderType,opts?) =>Promise<ActionLeaseAcquire>
Acquire an exclusive processing lease for a subscription consumer.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
subscriptionName
Section titled “subscriptionName”string
holderId
Section titled “holderId”string
Stable identifier for the process claiming the lease.
holderType
Section titled “holderType”"sdk" | "cli"
Kind of consumer claiming the lease.
graceMs?
Section titled “graceMs?”number
ttlMs?
Section titled “ttlMs?”number
Returns
Section titled “Returns”Promise<ActionLeaseAcquire>
heartbeatLease
Section titled “heartbeatLease”heartbeatLease: (
orgName,repoName,subscriptionName,holderId,ttlMs?) =>Promise<ActionLeaseOp>
Extend the TTL for an existing processing lease.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
subscriptionName
Section titled “subscriptionName”string
holderId
Section titled “holderId”string
ttlMs?
Section titled “ttlMs?”number
Returns
Section titled “Returns”Promise<ActionLeaseOp>
releaseLease
Section titled “releaseLease”releaseLease: (
orgName,repoName,subscriptionName,holderId) =>Promise<ActionLeaseOp>
Release an existing processing lease.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
subscriptionName
Section titled “subscriptionName”string
holderId
Section titled “holderId”string
Returns
Section titled “Returns”Promise<ActionLeaseOp>
claimDelivery
Section titled “claimDelivery”claimDelivery: (
orgName,repoName,target,holderId) =>Promise<ActionLeaseOp>
Claim one action delivery for processing.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
target
Section titled “target”ActionDeliveryTarget
holderId
Section titled “holderId”string
Returns
Section titled “Returns”Promise<ActionLeaseOp>
completeDelivery
Section titled “completeDelivery”completeDelivery: (
orgName,repoName,target,holderId) =>Promise<ActionLeaseOp>
Mark one claimed action delivery as complete.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
target
Section titled “target”ActionDeliveryTarget
holderId
Section titled “holderId”string
Returns
Section titled “Returns”Promise<ActionLeaseOp>
liveFeed
Section titled “liveFeed”liveFeed: (
orgName,repoName,subscriptionName,opts?) =>Promise<{ items: Array<{ subscriptionName: string; deliveryId: string; runId?: string; status: string; matchedOperationIndexes: Array<number>; matchedOperations: Array<{ index: number; operation?: unknown; }>; createdAt: number; updatedAt?: number; runStatus?: string; attemptCount?: number; maxAttempts?: number; lastErrorCode?: string; lastErrorMessage?: string; lastResponseSnippet?: string; traceId?: string; causationId?: string; hopCount?: number; originRunId?: string; originRepoId?: string; actionContainer?: string; }>; nextCursor?: string; }>
Query the live delivery feed for a subscription.
Use this for polling or live-log views that need recent delivery status entries.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
subscriptionName
Section titled “subscriptionName”string
ActionLiveFeedOptions
Returns
Section titled “Returns”Promise<{ items: Array<{ subscriptionName: string; deliveryId: string; runId?: string; status: string; matchedOperationIndexes: Array<number>; matchedOperations: Array<{ index: number; operation?: unknown; }>; createdAt: number; updatedAt?: number; runStatus?: string; attemptCount?: number; maxAttempts?: number; lastErrorCode?: string; lastErrorMessage?: string; lastResponseSnippet?: string; traceId?: string; causationId?: string; hopCount?: number; originRunId?: string; originRepoId?: string; actionContainer?: string; }>; nextCursor?: string; }>
listRuns
Section titled “listRuns”listRuns: (
orgName,repoName,opts?) =>Promise<Page<{ runId: string; subscriptionName?: string; status: string; matchedOperationIndexes: Array<number>; attemptCount: number; maxAttempts: number; lastErrorCode?: string; lastErrorMessage?: string; traceId?: string; causationId?: string; hopCount?: number; originRunId?: string; originRepoId?: string; createdAt: number; updatedAt: number; }>>
List subscription action runs as a Page<ActionRunInfo> (items +
optional nextCursor), newest-first, capped at 200 runs per page.
status and outcome are mutually exclusive.
since and cursor are mutually exclusive; pass cursor alone on later
pages — the since window rides in the cursor.
Cursors are opaque, short-lived resume tokens; on VALIDATION_ERROR
restart the query without cursor.
See docs/dev/warmhub-actions-api.md for the full contract.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ActionListRunsOptions
Returns
Section titled “Returns”Promise<Page<{ runId: string; subscriptionName?: string; status: string; matchedOperationIndexes: Array<number>; attemptCount: number; maxAttempts: number; lastErrorCode?: string; lastErrorMessage?: string; traceId?: string; causationId?: string; hopCount?: number; originRunId?: string; originRepoId?: string; createdAt: number; updatedAt: number; }>>
runStats
Section titled “runStats”runStats: (
orgName,repoName,opts?) =>Promise<{ total: number; byStatus: { pending: number; running: number; processing: number; retry_wait: number; succeeded: number; suppressed: number; failed_terminal: number; dead_letter: number; }; }>
Aggregate run counts (total + per-status) for a repo or one subscription.
Computed server-side over an optional since window as a window
aggregate — it counts every run in the window, whereas listRuns returns
only a page sample of that pageable history. Use runStats for totals and
listRuns to walk the individual runs page by page.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ActionRunStatsOptions
Returns
Section titled “Returns”Promise<{ total: number; byStatus: { pending: number; running: number; processing: number; retry_wait: number; succeeded: number; suppressed: number; failed_terminal: number; dead_letter: number; }; }>
getRunAttempts
Section titled “getRunAttempts”getRunAttempts: (
orgName,repoName,runId) =>Promise<{ attempt: number; status: string; startedAt: number; finishedAt?: number; httpStatus?: number; errorCode?: string; errorMessage?: string; responseSnippet?: string; }[]>
List delivery attempts for one action run.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
string
Returns
Section titled “Returns”Promise<{ attempt: number; status: string; startedAt: number; finishedAt?: number; httpStatus?: number; errorCode?: string; errorMessage?: string; responseSnippet?: string; }[]>
listNotifications
Section titled “listNotifications”listNotifications: (
orgName,repoName,opts?) =>Promise<{ subscriptionName?: string; attempt: number; channel: string; status: string; eventType?: string; errorCode?: string; errorMessage?: string; createdAt: number; }[]>
List repo-scoped action notifications.
Use since or limit to bound notification-center style reads.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ActionListNotificationsOptions
Returns
Section titled “Returns”Promise<{ subscriptionName?: string; attempt: number; channel: string; status: string; eventType?: string; errorCode?: string; errorMessage?: string; createdAt: number; }[]>
collection
Section titled “collection”
readonlycollection:object
create
Section titled “create”create: (
orgName,repoName,opts) =>Promise<CollectionMutationResult>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
CollectionCreateOptions
Returns
Section titled “Returns”Promise<CollectionMutationResult>
members
Section titled “members”members: (
orgName,repoName,wref,opts?) =>Promise<CollectionMembersPage>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
CollectionMembersOptions
Returns
Section titled “Returns”Promise<CollectionMembersPage>
membersIter
Section titled “membersIter”membersIter: (
orgName,repoName,wref,opts?) =>AsyncIterableIterator<CollectionMember>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
CollectionMembersOptions
Returns
Section titled “Returns”AsyncIterableIterator<CollectionMember>
membersAll
Section titled “membersAll”membersAll: (
orgName,repoName,wref,opts?) =>Promise<CollectionMember[]>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
CollectionMembersOptions & object
Returns
Section titled “Returns”Promise<CollectionMember[]>
contains
Section titled “contains”contains: (
orgName,repoName,wref,members,opts?) =>Promise<CollectionContainsResult>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
members
Section titled “members”string[]
CollectionContainsOptions
Returns
Section titled “Returns”Promise<CollectionContainsResult>
diff: (
orgName,repoName,leftWref,rightWref,opts?) =>Promise<CollectionDiffResult>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
leftWref
Section titled “leftWref”string
rightWref
Section titled “rightWref”string
CollectionDiffOptions
Returns
Section titled “Returns”Promise<CollectionDiffResult>
revise
Section titled “revise”revise: (
orgName,repoName,wref,opts) =>Promise<CollectionMutationResult>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
string
CollectionReviseOptions
Returns
Section titled “Returns”Promise<CollectionMutationResult>
stats: (
orgName,repoName,wref,opts?) =>Promise<CollectionStatsResult>
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
CollectionStatsOptions
Returns
Section titled “Returns”Promise<CollectionStatsResult>
readonlything:object
Read surface for things, assertions, histories, references, search, and in-place thing renames.
head: (
orgName,repoName,opts?) =>Promise<HeadResult>
Return the current HEAD snapshot for repository contents.
Filter by shape, kind, assertion target, or glob match pattern, and choose the data mode appropriate for the payload size. Component filters can narrow results to component-owned records or hide component infrastructure records.
Tokenless reads of public repositories have stricter page-size and page-count limits than authenticated reads.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ThingHeadOptions
Returns
Section titled “Returns”Promise<HeadResult>
headIter
Section titled “headIter”headIter: (
orgName,repoName,opts?) =>AsyncIterableIterator<ThingItem>
Iterate every current HEAD row matching the supplied filters.
Prefer this over hand-written cursor loops when scanning all matching records. Pass opts.cursor to resume from a saved cursor; the iterator advances the cursor automatically after the first request. Pass limit to control page size.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ThingHeadOptions
Returns
Section titled “Returns”AsyncIterableIterator<ThingItem>
headAll
Section titled “headAll”headAll: (
orgName,repoName,opts?) =>Promise<ThingItem[]>
Materialize every current HEAD row matching the supplied filters.
Use max to guard memory usage; throws a WarmHubError with kind VALIDATION_ERROR once more than max items have actually been observed across pages.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
ThingHeadOptions & object
Returns
Section titled “Returns”Promise<ThingItem[]>
get: (
orgName,repoName,wref,version?,opts?) =>Promise<ThingDetail>
Get one thing, assertion, shape, or collection by wref.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
version?
Section titled “version?”number
Optional exact version to pin when the wref is not already version-qualified.
ThingGetOptions
Returns
Section titled “Returns”Promise<ThingDetail>
getWithLease
Section titled “getWithLease”getWithLease: (
orgName,repoName,wref,opts?) =>Promise<ThingGetWithLease>
Acquire a short, bounded, exclusive lease on a thing AND read it in one atomic round trip (#3625).
Returns everything WarmHub.thing.get returns plus a lease
block; the holder echoes lease.id back as leaseId on the subsequent
revise/retract (auto-releasing the lease) or calls
WarmHub.thing.releaseLease to return it early. Requires
things:write — never anonymous.
Fail-fast: if another holder already holds an active lease, throws a
WarmHubError with kind === 'LEASE_UNAVAILABLE' and
error.details?.reason === 'lease_held' (read leaseExpiresAt to back
off until expiry). ttlMs out of the backend’s bounds (default 5s /
min 1s / max 30s) is rejected, never clamped.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
string
ttlMs?
Section titled “ttlMs?”number
Returns
Section titled “Returns”Promise<ThingGetWithLease>
releaseLease
Section titled “releaseLease”releaseLease: (
orgName,repoName,wref,leaseId) =>Promise<void>
Release a lease early (#3625), closing the acquire↔release loop without waiting out the TTL.
Idempotent and owner-gated: releasing an absent, already-released,
expired, or non-matching lease is a benign no-op (no error). A
successful revise/retract carrying the leaseId already
auto-releases the lease, so this is only needed when the holder decides
not to mutate. Requires things:write.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
string
leaseId
Section titled “leaseId”string
Returns
Section titled “Returns”Promise<void>
graph: (
orgName,repoName,wref,opts?) =>Promise<ThingGraphResult>
Get one record and its embedded assertion, about, and wref graph.
Depth and limit options bound traversal size. References the caller cannot read remain string wrefs in the returned graph.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
ThingGraphOptions
Returns
Section titled “Returns”Promise<ThingGraphResult>
getMany
Section titled “getMany”getMany: (
orgName,repoName,wrefs,version?,opts?) =>Promise<ThingGetManyResult>
Batch-fetch wrefs, auto-chunking above the backend’s 500-wref transport cap.
The result preserves duplicate requested wrefs and reports inaccessible or missing refs in missing rather than throwing per item. A top-level version pins every unqualified wref; per-wref version pins remain intact.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string[]
version?
Section titled “version?”number
Optional exact version to apply to unqualified wrefs.
includeRetracted?
Section titled “includeRetracted?”boolean
Include retracted records in items instead of reporting them in missing.
dataMode?
Section titled “dataMode?”CollectionReadDataMode
chunkSize?
Section titled “chunkSize?”number
Maximum wrefs per backend request. Defaults to 500 and is clamped to the backend cap.
chunkConcurrency?
Section titled “chunkConcurrency?”number
Maximum concurrent chunk requests. Defaults to 1 and is clamped to 8.
Returns
Section titled “Returns”Promise<ThingGetManyResult>
headVersions
Section titled “headVersions”headVersions: (
orgName,repoName,wrefs,opts?) =>Promise<ThingHeadVersionsResult>
Batched lightweight per-thing change probe — returns
{ wref, durableId, version, active, revisedOn } per wref with NO
payload. Use it to check whether locally-cached copies are still fresh
without pulling data: a value is stale if durableId differs (the wref
now points to a different thing), version/active differ (the same
thing changed/was retracted), or the wref appears in missing.
Auto-chunks above the backend’s 500-wref transport cap; preserves
duplicate requested wrefs and reports inaccessible/unknown refs in
missing rather than throwing per item.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string[]
chunkSize?
Section titled “chunkSize?”number
Maximum wrefs per backend request. Defaults to 500 and is clamped to the backend cap.
chunkConcurrency?
Section titled “chunkConcurrency?”number
Maximum concurrent chunk requests. Defaults to 1 and is clamped to 8.
Returns
Section titled “Returns”Promise<ThingHeadVersionsResult>
history
Section titled “history”history: (
orgName,repoName,opts) =>Promise<HistoryResult>
Return version history and timeline metadata for repository records.
Provide at least one selector: a concrete wref, a shape filter, or an assertion target. Shape- and target-filtered histories support pagination and optional collection resolution.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
ThingHistoryOptions
Returns
Section titled “Returns”Promise<HistoryResult>
rename
Section titled “rename”rename: (
orgName,repoName,shapeName,oldName,newName) =>Promise<RenameResult>
Rename a thing within its shape namespace.
The rename is applied in place: the thing’s existing history is preserved and no new version is created.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
shapeName
Section titled “shapeName”string
oldName
Section titled “oldName”string
newName
Section titled “newName”string
Returns
Section titled “Returns”Promise<RenameResult>
resolve
Section titled “resolve”resolve: (
orgName,repoName,wref) =>Promise<ThingDetail>
Resolve a wref to its current projected record.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
Returns
Section titled “Returns”Promise<ThingDetail>
about: (
orgName,repoName,wref,opts?) =>Promise<AboutResult>
Return assertions about a shape, shaped thing, or collection target.
Filter by assertion shape or glob match pattern, optionally resolve collection targets, and page through large assertion sets with limit and cursor.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Returns { target?, assertions, nextCursor? }.
The array is named assertions, not items. This breaks the repo-wide
items convention used by HeadResult, FilterResult, SearchResult,
RefsResult, and LogResult; destructure explicitly to avoid the trap:
const { target, assertions } = await client.thing.about(org, repo, "Location/cave");for (const a of assertions) console.log(a.wref);Any returned subjective-logic opinion tuple (b, d, u, α) is a binomial opinion — well-formed only when the underlying assertion expresses a binary proposition. See Opinions as Separate Assertions.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
AboutOptions
Returns
Section titled “Returns”Promise<AboutResult>
aboutIter
Section titled “aboutIter”aboutIter: (
orgName,repoName,wref,opts?) =>AsyncIterableIterator<Assertion>
Iterate every assertion about a shape, shaped thing, or collection target.
Prefer this over hand-written cursor loops when scanning all matching assertions. The iterator reads the assertions envelope field and advances the cursor automatically; pass opts.cursor to resume from a saved cursor and limit to control page size.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
AboutOptions
Returns
Section titled “Returns”AsyncIterableIterator<Assertion>
aboutAll
Section titled “aboutAll”aboutAll: (
orgName,repoName,wref,opts?) =>Promise<Assertion[]>
Materialize every assertion about a shape, shaped thing, or collection target.
Use max to guard memory usage; throws a WarmHubError with kind VALIDATION_ERROR once more than max assertions have actually been observed across pages.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
AboutOptions & object
Returns
Section titled “Returns”Promise<Assertion[]>
query: (
orgName,repoName,opts?) =>Promise<HeadResult>
Query repository records by shape, kind, assertion target, text filters, or glob match pattern.
Use this for structured reads where the caller controls filters. For ranked text or vector search, use thing.search. For count-only reads, use thing.count.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<HeadResult>
queryIter
Section titled “queryIter”queryIter: (
orgName,repoName,opts?) =>AsyncIterableIterator<ThingItem>
Iterate every repository record matching the supplied filters.
Prefer this over hand-written cursor loops when scanning all matching records. Pass opts.cursor to resume from a saved cursor; the iterator advances the cursor automatically after the first request. Pass limit to control page size.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”AsyncIterableIterator<ThingItem>
queryAll
Section titled “queryAll”queryAll: (
orgName,repoName,opts?) =>Promise<ThingItem[]>
Materialize every repository record matching the supplied filters.
Use max to guard memory usage; throws a WarmHubError with kind VALIDATION_ERROR once more than max items have actually been observed across pages.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
FilterOptions & object
Returns
Section titled “Returns”Promise<ThingItem[]>
search
Section titled “search”search: (
orgName,repoName,query,opts?) =>Promise<HeadResult>
Search repository records with text, vector, or hybrid mode.
When searching with an assertion target or collection resolution, pages may be sparse; keep paginating until nextCursor is absent.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
string
Returns
Section titled “Returns”Promise<HeadResult>
count: (
orgName,repoName,opts?) =>Promise<CountResult>
Count matching repository records without returning record data.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
Returns
Section titled “Returns”Promise<CountResult>
refs: (
orgName,repoName,wref,opts?) =>Promise<RefsResult>
Query wref-typed field references for a record.
Inbound mode finds records whose wref fields point at the supplied wref. Outbound mode finds records that the supplied record points to. Inbound queries can be narrowed to a field path.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
Returns
Section titled “Returns”Promise<RefsResult>
refsIter
Section titled “refsIter”refsIter: (
orgName,repoName,wref,opts?) =>AsyncIterableIterator<{wref:string;kind?:"assertion"|"thing"|"shape"|"collection";shapeName?:string;version?:number;fieldPath?:string; }>
Iterate every wref-typed field reference for a record.
Prefer this over hand-written cursor loops when scanning all matching references. Pass opts.cursor to resume from a saved cursor; the iterator advances the cursor automatically after the first request. Pass limit to control page size.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
Returns
Section titled “Returns”AsyncIterableIterator<{ wref: string; kind?: "assertion" | "thing" | "shape" | "collection"; shapeName?: string; version?: number; fieldPath?: string; }>
refsAll
Section titled “refsAll”refsAll: (
orgName,repoName,wref,opts?) =>Promise<object[]>
Materialize every wref-typed field reference for a record.
Use max to guard memory usage; throws a WarmHubError with kind VALIDATION_ERROR once more than max refs have actually been observed across pages.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string | undefined
repoName
Section titled “repoName”string | undefined
string
RefsOptions & object
Returns
Section titled “Returns”Promise<object[]>
readonlylive:object
Live repository update surface backed by server-sent events.
thingHead
Section titled “thingHead”thingHead: (
orgName,repoName,opts,onUpdate) =>Promise<LiveHandle>
Stream refreshed thing.head results whenever the repository changes.
The SDK re-runs the underlying thing.head query after each invalidation and passes the latest snapshot to onUpdate.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
LiveThingHeadOptions | undefined
onUpdate
Section titled “onUpdate”(result) => void | Promise<void>
Returns
Section titled “Returns”Promise<LiveHandle>
thingHistory
Section titled “thingHistory”thingHistory: (
orgName,repoName,opts,onUpdate) =>Promise<LiveHandle>
Stream refreshed history results for a single wref whenever the repository changes.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
LiveThingHistoryOptions
onUpdate
Section titled “onUpdate”(result) => void | Promise<void>
Returns
Section titled “Returns”Promise<LiveHandle>
subscriptionLog
Section titled “subscriptionLog”subscriptionLog: (
orgName,repoName,subscriptionName,opts,onUpdate) =>Promise<LiveHandle>
Stream refreshed action live-feed entries for a subscription.
Cursor contract: cursors are short-lived resume tokens for the same query
and result scope. If filters, visibility, or backing streams change, the
backend may reject a saved cursor with VALIDATION_ERROR / Invalid cursor; restart the query without cursor instead of retrying the stale
token.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
subscriptionName
Section titled “subscriptionName”string
LiveSubscriptionLogOptions | undefined
onUpdate
Section titled “onUpdate”(result) => void | Promise<void>
Returns
Section titled “Returns”Promise<LiveHandle>
subscribe
Section titled “subscribe”subscribe: (
orgName,repoName,opts,onEvent) =>Promise<LiveHandle>
Subscribe to raw repository invalidation events.
Unlike the higher-level live helpers, this method does not re-query. It forwards invalidation metadata such as affected shapes, affected things, affected assertion targets, and whether the event corresponds to a new commit.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string
{ signal?: AbortSignal; } | undefined
Type Literal
Section titled “Type Literal”{ signal?: AbortSignal; }
signal?
Section titled “signal?”AbortSignal
Optional abort signal used to close the SSE stream.
undefined
onEvent
Section titled “onEvent”(event) => void | Promise<void>
Callback invoked for each repository invalidation event.
Returns
Section titled “Returns”Promise<LiveHandle>
readonlytoken:object
Personal access token management for the authenticated user.
create
Section titled “create”create: (
input) =>Promise<{ token: string; name: string; scopes?: Array<{ resource?: string; permissions: Array<string>; allowedMatches?: Array<string>; }>; warnings?: Array<string>; expiresAt: number; createdAt: number; }>
Create a personal access token for the authenticated user.
Omit scopes to mint a token with the same authority as the calling principal. PATs cannot create or revoke other PATs — token-management permissions are excluded from the grantable set. Server enforces a maximum lifetime; pass an expiresAt unix-millis value to clamp earlier.
See Personal Access Tokens for scope grammar (resource format, permission strings, allowedMatches), rotation, and CI usage.
Parameters
Section titled “Parameters”{ name: string; scopes?: Array<{ resource?: string; permissions: Array<string>; allowedMatches?: Array<string>; }>; structured?: boolean; description?: string; expiresAt?: number; committerIdentityWref?: string; }
Returns
Section titled “Returns”Promise<{ token: string; name: string; scopes?: Array<{ resource?: string; permissions: Array<string>; allowedMatches?: Array<string>; }>; warnings?: Array<string>; expiresAt: number; createdAt: number; }>
list: (
opts?) =>Promise<TokenInfo[]>
List personal access tokens for the authenticated user.
By default only active tokens are returned. Pass
{ includeInactive: true } to also include expired and revoked tokens.
Parameters
Section titled “Parameters”includeInactive?
Section titled “includeInactive?”boolean
Returns
Section titled “Returns”Promise<TokenInfo[]>
get: (
name) =>Promise<TokenInfo|null>
Get one personal access token by name.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<TokenInfo | null>
revoke
Section titled “revoke”revoke: (
name) =>Promise<{ ok: boolean; }>
Revoke a personal access token by name.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<{ ok: boolean; }>
stream
Section titled “stream”
readonlystream:object
Low-level stream append surface for callers that already have backend stream operations.
append
Section titled “append”append: (
input) =>Promise<StreamAppendResult>
Append one non-empty chunk of stream operations to a repository.
Most callers should prefer commit.apply or OperationBuilder. Use this low-level surface only when you already have backend-shaped stream operations and a caller-managed stream ID.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<StreamAppendResult>
credential
Section titled “credential”
readonlycredential:object
Credential set management for subscription webhook authentication and component integrations.
Sets are scoped at creation time. Repo-scoped sets are visible only to the owning repo; org-scoped sets can be granted to multiple repositories in the same organization. Methods that operate on a specific set accept repoName: string | undefined — pass the owning repo name for repo-scoped sets or undefined for org-scoped sets.
createSet
Section titled “createSet”createSet: (
orgName,repoName,name,opts?) =>Promise<CredentialInfo>
Create a credential set.
Credential sets are repo-scoped by default. Org-scoped sets can be granted to multiple repositories in the same organization.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string | undefined
string
scope?
Section titled “scope?”"org" | "repo"
description?
Section titled “description?”string
Returns
Section titled “Returns”Promise<CredentialInfo>
listSets
Section titled “listSets”listSets: (
orgName,repoName?) =>Promise<CredentialInfo[]>
List credential sets visible from a repository.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName?
Section titled “repoName?”string
Returns
Section titled “Returns”Promise<CredentialInfo[]>
getSet
Section titled “getSet”getSet: (
orgName,repoName,name) =>Promise<CredentialInfo>
Get credential set metadata without secret values.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string | undefined
string
Returns
Section titled “Returns”Promise<CredentialInfo>
setKey
Section titled “setKey”setKey: (
orgName,repoName,setName,keyName,value) =>Promise<CredentialKeyMutationResult>
Set or replace one secret key in a credential set.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string | undefined
setName
Section titled “setName”string
keyName
Section titled “keyName”string
string
Returns
Section titled “Returns”Promise<CredentialKeyMutationResult>
setKeys
Section titled “setKeys”setKeys: (
orgName,repoName,setName,secrets) =>Promise<CredentialKeyMutationResult>
Set or replace multiple secret keys in one request.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string | undefined
setName
Section titled “setName”string
secrets
Section titled “secrets”Record<string, string>
Returns
Section titled “Returns”Promise<CredentialKeyMutationResult>
unsetKey
Section titled “unsetKey”unsetKey: (
orgName,repoName,setName,keyName) =>Promise<CredentialKeyMutationResult>
Remove one secret key from a credential set.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string | undefined
setName
Section titled “setName”string
keyName
Section titled “keyName”string
Returns
Section titled “Returns”Promise<CredentialKeyMutationResult>
deleteSet
Section titled “deleteSet”deleteSet: (
orgName,repoName,setName) =>Promise<CredentialDeleteResult>
Delete a credential set and its stored secrets.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string | undefined
setName
Section titled “setName”string
Returns
Section titled “Returns”Promise<CredentialDeleteResult>
listAuditLog
Section titled “listAuditLog”listAuditLog: (
orgName,repoName,setName,opts?) =>Promise<CredentialAuditEntry[]>
List audit entries for a credential set.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string | undefined
setName
Section titled “setName”string
limit?
Section titled “limit?”number
Returns
Section titled “Returns”Promise<CredentialAuditEntry[]>
revokeSet
Section titled “revokeSet”revokeSet: (
orgName,repoName,setName,opts?) =>Promise<CredentialRevokeResult>
Revoke a credential set so it can no longer be exported or bound.
Parameters
Section titled “Parameters”orgName
Section titled “orgName”string
repoName
Section titled “repoName”string | undefined
setName
Section titled “setName”string
reason?
Section titled “reason?”string
Returns
Section titled “Returns”Promise<CredentialRevokeResult>
Methods
Section titled “Methods”withAccessToken()
Section titled “withAccessToken()”withAccessToken(
accessToken):WarmHubClient
Return a new client that shares this client’s backend URL and fetch implementation but uses a different access-token provider.
Parameters
Section titled “Parameters”accessToken
Section titled “accessToken”AccessTokenProvider
Returns
Section titled “Returns”WarmHubClient