Skip to content
0

katanakit-js ​

Classes ​

ClassDescription
AccessServiceAccessService - Singleton facade con Strategy Pattern.
AgentServiceAgentService - Singleton facade con Strategy Pattern.
ArrayServiceArrayService — singleton facade for collection helpers.
AssistantServiceAssistantService - Singleton para el asistente conversacional.
AuthServiceHolds the providers a deployment has configured and routes a request to one.
CancelledErrorThe error thrown by a Retryer (and surfaced to query.promise/mutation) when a fetch is cancelled, e.g. via query.cancel(). revert, if true, tells the caller to restore the state the query was in before the fetch started instead of surfacing the error. silent, if true, tells the caller to suppress this error and instead resolve with the promise of the fetch that triggered the cancellation.
DatesServiceDatesService - Singleton para operaciones de fechas.
DirectoryServiceUser management over any storage, with the lockout guards built in.
FetchApiManagerFetchApiManager - Singleton para el registro de APIs y peticiones HTTP.
FlatAccessStrategyEstrategia estricta: sólo verifica capacidades declaradas explícitamente en el rol del sujeto, sin her jerarquía. Útil cuando cada rol debe declarar todo lo que puede hacer.
HierarchicalAccessStrategyEstrategia por defecto: control de acceso jerárquico basado en roles registrados. Es la estrategia estándar del servicio.
InfiniteQueryObserverAn InfiniteQueryObserver extends QueryObserver to observe and switch between infinite queries. It augments the base QueryObserverResult with infinite-query-specific fields and methods, such as hasNextPage and fetchNextPage, and is the primitive that framework adapters (e.g. useInfiniteQuery) build their hooks on top of.
LoggerServiceLoggerService - Singleton para logging Aplica el patrón Singleton para garantizar una única instancia de logger.
MutationRepresents a single mutation attempt. A Mutation holds the mutation's options, state (data/error/status), and the MutationObservers currently subscribed to it.
MutationCacheThe MutationCache is the storage for mutations.
MutationObserverObserves a single mutation and derives a MutationObserverResult from it. A framework hook like useMutation creates one MutationObserver per hook call, keeps it stable across re-renders, calls setOptions when the options passed to the hook change, subscribes to it to re-render on updates, and reads getCurrentResult() for the value to return. Calling mutate() builds a new underlying Mutation in the MutationCache and executes it.
OpenAiCompatibleStrategyEstrategia por defecto: proveedor compatible con OpenAI (POST /chat/completions con Bearer token). Cubre DashScope en modo compatible, OpenAI, Azure OpenAI y la mayoría de endpoints self-hosted.
QueriesObserverA QueriesObserver watches an array of queries at once, exposing them as a single array of QueryObserverResults (or, when a combine option is given, as a combined value derived from that array). It manages one internal QueryObserver per query, and is the primitive that framework adapters (e.g. useQueries) build their hooks on top of.
QueryRepresents a single cached query. A Query holds the query's key, options, state (data/error/status), and the observers currently subscribed to it.
QueryCacheThe QueryCache is the storage mechanism for TanStack Query. It stores all the data, meta information, and state of the queries it contains.
QueryClientQueryClient is used to interact with a cache of queries and mutations. It owns a QueryCache and a MutationCache (creating default ones if none are passed in) and holds the default options that are applied to queries and mutations created through it.
QueryClientFactoryQueryClientFactory - Factory Pattern para crear instancias de QueryClient.
QueryObserverA QueryObserver watches a single query in the QueryCache and computes a QueryObserverResult from its state, recomputing and notifying subscribers whenever the underlying query (or the observer's options) changes. It is the primitive that framework adapters (e.g. useQuery) build their hooks on top of, but it can also be used directly to observe and switch between queries outside of any framework.
QueryServiceQueryService - Singleton para el QueryClient compartido.
UtilsServiceUtilsService - Singleton para utilidades genéricas.
ValidationServiceValidationService - Singleton para validaciones.

Interfaces ​

InterfaceDescription
AgentRunOptionsOptions for running the tool-calling agent loop.
AiChatOptionsOptions for a single chat completion.
AiToolA tool the agent can invoke. parameters is a JSON Schema object describing the expected input.
ApiEntry-
AssistantInitConfigConfiguration for the assistant facade.
AssistantReplyOptionsOptions for a single assistant reply.
AstroPath-
AuthErrorWhy a provider could not answer.
BatteryManagerType for the experimental Battery API.
CacheDecoratorOptionsCacheDecorator - Decorator Pattern para caché de resultados.
CancelOptionsOptions for cancelling an in-flight fetch, e.g. via query.cancel(). They are carried on the CancelledError that the cancelled fetch rejects with.
CollectionEntryLikeMinimal shape of an Astro content collection entry.
ConversationStorePersistence contract for assistant conversations.
DatesServiceTypesContract of the dates facade.
DefaultOptions-
DehydratedStateA serializable snapshot of a QueryClient's cache, as produced by dehydrate and consumed by hydrate. Typically transported from server to client (e.g. embedded in server-rendered markup) to seed the client's cache with data that has already been fetched, avoiding a redundant fetch on the client.
DehydrateOptionsOptions for dehydrate, controlling which queries/mutations are included in the resulting DehydratedState and how their data/errors are transformed before being serialized (e.g. for embedding in server-rendered markup).
DirectoryActorActions that lock every administrator out of their own system.
DirectoryError-
DirectoryRepositoryWhere user records actually live.
DirectoryServiceOptions-
FetchNextPageOptions-
FetchOptionsOptions passed when executing a fetch request.
FetchPreviousPageOptions-
FetchRequestMutable request inputs passed through registered HTTP request interceptors.
FocusManagerThe FocusManager manages the focus state within TanStack Query.
GrantAwareOptions-
HydrateOptionsOptions for hydrate, controlling the default options applied to queries/mutations restored from a DehydratedState, and how to reverse any transformation applied by DehydrateOptions.serializeData.
IAccessServiceContract of the access-control facade. Pure, no I/O.
IAccessStrategyEstrategia de verificación de acceso - Strategy Pattern.
IAiProviderStrategyEstrategia de proveedor AI - Strategy Pattern.
IAiServiceContract of the AI/agent facade.
IAppUtilsContract of the app utilities facade.
IAssistantServiceContract of the assistant facade.
IAstroServiceContract of the Astro facade.
IAuthProviderAn identity provider the kit can ask "who is this?".
IConverterServiceContract of the unit converter facade.
ICryptoStrategyContract for a crypto strategy.
IDataUtilsContract of the data utilities.
IDomServiceContract of the DOM facade.
IFetchApiManagerContract of the fetch facade.
IFormatterServiceContract of the formatter facade.
InfiniteDataThe data shape of an infinite query: every page fetched so far, plus the page param each one was fetched with. pages and pageParams are index-aligned — pageParams[i] is the param that produced pages[i].
InfiniteQueryObserverBaseResult-
InfiniteQueryObserverLoadingErrorResult-
InfiniteQueryObserverLoadingResult-
InfiniteQueryObserverOptions-
InfiniteQueryObserverPendingResult-
InfiniteQueryObserverPlaceholderResult-
InfiniteQueryObserverRefetchErrorResult-
InfiniteQueryObserverSuccessResult-
InfiniteQueryPageParamsOptions-
InitialPageParam-
INotionServiceContract of the Notion adapter facade.
IntervalControlControl object returned by interval operations.
InvalidateOptions-
InvalidateQueryFiltersFilters used to select queries, for example in queryClient.getQueriesData or queryClient.invalidateQueries. All provided filters must match; filters that are left unspecified are ignored.
IReactiveServiceContract of the reactive facade.
IRssServiceContract of the RSS facade.
ISystemUtilsContract of the system utilities.
IThemeServiceContract of the theme facade.
IUuidStrategyContract for a UUID strategy.
IWordPressServiceContract of the WordPress adapter facade.
MutateOptions-
MutationCacheConfigGlobal callbacks that fire for every mutation handled by a MutationCache, regardless of which component or observer triggered it. They differ from the defaultOptions provided to a QueryClient in two ways: defaultOptions can be overridden by each mutation, while these callbacks are always called, and onMutate here does not allow returning a result.
MutationFiltersFilters used to select mutations, for example in mutationCache.findAll or queryClient.isMutating. All provided filters must match; filters that are left unspecified are ignored.
MutationObserverBaseResultThe raw state stored on a Mutation instance. This is the underlying state that observer results (e.g. MutationObserverResult) are derived from.
MutationObserverErrorResultThe raw state stored on a Mutation instance. This is the underlying state that observer results (e.g. MutationObserverResult) are derived from.
MutationObserverIdleResultThe raw state stored on a Mutation instance. This is the underlying state that observer results (e.g. MutationObserverResult) are derived from.
MutationObserverLoadingResultThe raw state stored on a Mutation instance. This is the underlying state that observer results (e.g. MutationObserverResult) are derived from.
MutationObserverOptions-
MutationObserverSuccessResultThe raw state stored on a Mutation instance. This is the underlying state that observer results (e.g. MutationObserverResult) are derived from.
MutationOptions-
MutationStateThe raw state stored on a Mutation instance. This is the underlying state that observer results (e.g. MutationObserverResult) are derived from.
NotifyEvent-
NotionFilterFilter for querying a Notion database.
ObserverConfigConfiguration for a registered IntersectionObserver.
ObserverEntryInternal registry entry storing an observer instance and its tracked targets.
OnlineManagerThe OnlineManager manages the online state within TanStack Query. It can be used to change the default event listeners or to manually change the online state.
PaginationProps-
PathsOptions-
QueriesObserverOptions-
QueryCacheConfigGlobal callbacks that fire for every query handled by a QueryCache, regardless of which component or observer triggered it. Unlike QueryClient's defaultOptions, which a query can override, these callbacks are always called. Unlike MutationCacheConfig's callbacks, these are fire-and-forget: their return value is not awaited before the query settles.
QueryClientConfig-
QueryExecuteOptions-
QueryFiltersFilters used to select queries, for example in queryClient.getQueriesData or queryClient.invalidateQueries. All provided filters must match; filters that are left unspecified are ignored.
QueryObserverBaseResult-
QueryObserverLoadingErrorResult-
QueryObserverLoadingResult-
QueryObserverOptions-
QueryObserverPendingResult-
QueryObserverPlaceholderResult-
QueryObserverRefetchErrorResult-
QueryObserverSuccessResult-
QueryOptions-
QueryStateThe raw state stored on a Query instance. This is the underlying state that observer results (e.g. QueryObserverResult) are derived from.
RefetchOptions-
RefetchQueryFiltersFilters used to select queries, for example in queryClient.getQueriesData or queryClient.invalidateQueries. All provided filters must match; filters that are left unspecified are ignored.
RegisterThe interface to augment via declaration merging to override Query's default types repository-wide. Each field it declares replaces the default of the matching type: defaultError for DefaultError, queryKey for QueryKey, mutationKey for MutationKey, queryMeta for QueryMeta and mutationMeta for MutationMeta. Leave a field out to keep that type's default. Augment the module you install — @tanstack/react-query, @tanstack/vue-query, @tanstack/solid-query, @tanstack/svelte-query, @tanstack/preact-query, @tanstack/angular-query-experimental or @tanstack/lit-query. Augmenting @tanstack/query-core works too and covers every adapter at once.
ResetOptions-
ResourceAccessDecision-
ResultOptions-
SalePriceResult of useSalePrice: the regular price, the discounted price and the rounded percentage taken off.
ScrollOptionsOptions for scrolling operations.
SeoMetaArticleArticle Open Graph extensions (og:type=article).
SeoMetaFlatFlat meta: HTML head essentials, Open Graph and optional Twitter/X cards.
SeoOgImageObjectOpen Graph image (string URL or object).
SeoRobotsObjectRobots as string or simple object.
SeoTagNode-
SetDataOptionsOptions for writing data into the cache, e.g. via queryClient.setQueryData(). updatedAt overrides the timestamp the data is recorded with, which is what staleness is measured from; omit it to use the current time.
SignalGetter-
SiteConfigSite-wide configuration for KatanaKit SEO / RSS helpers. Framework-agnostic — reuse in Vanilla, Astro, Vue/React SPAs, Express, etc.
StorageStrategyStrategy contract: homogeneous storage without any.
Subscribable-
ThemeOptions-
TimeoutControlControl object returned by timeout operations.
TimeoutManagerAllows customization of how timeouts are created.
ToggleSignalSetter-
UrlOptions-
ValidationSchemaSchema-agnostic contract. Accepts Zod (safeParse), Valibot (safeParse), Standard Schema (~standard.validate), Yup (validateSync) or any object exposing one of those members.
WorkerPoolEntry-

Type Aliases ​

Type AliasDescription
AccessCapabilityA namespaced capability, <domain>:<action>[:<scope>].
AccessResourceAnything the authorization layer can check a subject against.
AccessRoleA role slug. Closed vocabulary by convention (BuiltInRole), open by schema: useRegisterRole takes any slug matching the pattern.
AccessRoleDefinitionA role definition: slug, label, hierarchy rank and the capabilities it grants.
AccessSourceWhere a permission came from. Kept so audit logs can say why.
AccessSubjectStructural subject for access checks. Decoupled from the persistence layer: any object with an id and a role list can be checked (e.g. a Prisma Account row, a JWT payload, or a test fixture). Extra keys are preserved, so a subject can also carry the principal it was resolved from.
AgentDataPayload returned by a successful useRunAgent call.
AgentResultSafe result of an agent run.
AgentStepOne round of tool execution inside the agent loop.
AiErrorSafe error returned on non-2xx or network failures.
AiFunctionCallFunction invocation requested by the model when using tools.
AiMessageA chat message. tool_calls and tool_call_id use snake_case on purpose: they mirror the OpenAI-compatible protocol so messages pass through unchanged.
AiProviderConfigProvider configuration for an OpenAI-compatible chat/agent endpoint.
AiResultSafe result (discriminated union) without throwing.
AiRoleRole of a chat message in the OpenAI-compatible protocol.
AiToolCallA single tool call emitted by the model (OpenAI-compatible wire shape).
AnyDataTag-
ApiConfigValueValues accepted by defineApiConfig: an ApiEntry, a boolean flag (kept on config only — never registered as an API) or a method.
ApiErrorStructure of the safe error returned on non-2xx or network failures.
ApisConfig-
AppDateFormatOptions-
AssistantReplyPayload returned by a successful assistant reply.
AssistantResultSafe result of an assistant reply.
AstroServiceError-
AstroServiceResultSafe Result (discriminated union without throwing).
AuthRequestLikeAnything that carries the headers of an inbound request.
AuthResultSafe result of an authentication step.
BuiltInCapabilityCapabilities the kit ships with. A convenience alias for autocomplete — the schema itself accepts any <domain>:<action>[:<scope>] string.
BuiltInRoleRole slugs the kit ships with. A convenience alias for autocomplete — the schema itself accepts any slug, and deployments register their own.
ConfigDataThe props/booleans half of a define*Config literal — the config data.
ConfigFacadeWhat every define*Config returns: the registered config under config, plus the methods declared alongside it so this.config resolves inside them.
ConfigMethodAny method a consumer declares inline in a define*Config literal. Written with function (never an arrow) so this resolves to the facade.
ConfigMethodEntriesThe methods half of a define*Config literal.
ConfigMethodKeysKeys of T whose value is a ConfigMethod. Methods declared as optional are still detected (NonNullable), so they are split out of the config half rather than leaking into it.
ConfigValuesConstrains every non-method entry of a define*Config literal to V, while leaving method entries untouched. Pair with NoInfer<T> in the signature so it validates without stealing inference from the literal.
Currency-
CurrencyFormatOptions-
DataTag-
dataTagErrorSymbol-
dataTagSymbol-
DateFormatOptionsBackwards-compatible alias for AppDateFormatOptions.
DateOrderRelative ordering of two dates.
DateUnitGranularity accepted by the calendar arithmetic helpers.
DefaultedInfiniteQueryObserverOptions-
DefaultedQueryObserverOptions-
DefaultErrorThe error type used wherever an error is not given an explicit type parameter. Defaults to Error; declare defaultError on Register to change it everywhere at once.
DefinedInfiniteQueryObserverResult-
DefinedQueryObserverResult-
DirectoryErrorCode-
DirectoryPage-
DirectoryPageResultShape a repository must satisfy — lets a plain object be passed as one.
DirectoryQuery-
DirectoryResultSafe result of a directory operation. Never throws for a refused action.
DirectoryUser-
DistributiveOmit-
FakeVehicleGeneric fake vehicle returned by useFakeVehicle.
FetchResultSafe result, discriminated union (Astro Actions style) without throwing. The ok flag narrows the union between the success and error branches.
FetchStatus-
FieldErrorsA single field-level validation message keyed by field name.
FileEncodingText encodings accepted by the filesystem helpers.
FileHashAlgorithmHash algorithms supported by useHashFile / useVerifyFileHash.
FileStatsPortable stats subset returned by useGetFileStats.
FilesystemErrorSafe error from a filesystem operation (NodeJS.ErrnoException-shaped).
FilesystemResultSafe Result for filesystem operations: { data, error, ok }, never throws.
GeometryFormatOptionsOptions for number formatting in geometry calculations.
GeoPositionRepresents a geographic position with latitude, longitude and accuracy.
GetNextPageParamFunction-
GetPreviousPageParamFunction-
GrantA role scoped to one resource.
GrantResolverSupplies the roles a subject holds over one resource.
HttpMethod-
IdentityA person in your system.
IdentityStatusAccount lifecycle state you own.
IfConfigConfig for the InsForge adapter. InsForge is the database fallback (primary data layer is Cloudflare); storage and edge functions are also available through the same client.
IfInsertRowsRows for insert (one or many).
IfInvokeOptionsEdge function invocation.
IfListOptionsOptions for listing bucket objects.
IfOrderSort clause for table queries.
IfRpcCallPostgres function (RPC) call.
IfStorageRefBucket + object key reference for storage operations.
IfTableQueryOptions for a table read. Filters map to equality clauses.
IfUpdatePatchPatch for update (must be paired with filters — mass updates are refused).
IfWriteQueryOptions for an update or delete. Filters are REQUIRED (no mass writes).
InferDataFromTag-
InferErrorFromTag-
InfiniteQueryExecuteOptions-
InfiniteQueryObserverResult-
InitialDataFunction-
ISerializedErrorSerialized error shape.
LazyLoaderEntryInternal registry entry for lazy loading configurations.
Locale-
LogLevelNative console methods used as log levels.
ManagedTimerIdWrapping setTimeout is awkward from a typing perspective because platform typings may extend the return type of setTimeout. For example, NodeJS typings add NodeJS.Timeout; but a non-default timeoutManager may not be able to return such a type.
MediaProviderWhere a media source comes from. file = direct mp4/webm (native <video>).
MediaSourceNormalized media source: provider + stable id or direct src.
MutateFunction-
MutateFunctionRest-
MutationCacheNotifyEventThe event passed to a MutationCache subscriber. Fired whenever a mutation is added or removed from the cache, its state is updated, or one of its observers is added, removed, or has its options updated.
MutationFunction-
MutationFunctionContext-
MutationKeyThe type of a mutation key — the serializable array used to identify and filter mutations. Defaults to ReadonlyArray<unknown>; declare mutationKey on Register to narrow it repository-wide.
MutationMetaThe type of the meta object that can be attached to a mutation and read back from mutationFn, callbacks and cache-level handlers. Defaults to Record<string, unknown>; declare mutationMeta on Register to narrow it.
MutationObserverResult-
MutationScopeGroups mutations so they run one after another instead of in parallel. Mutations that share the same id form a queue: while one is running, the others wait in isPaused: true state and resume automatically when their turn comes. Mutations with no scope always run in parallel.
MutationStatus-
NetworkMode-
NonUndefinedGuard-
NotifyEventType-
NotifyOnChangeProps-
NotionBlockA Notion block object.
NotionBlockListResult of listing block children (paginated).
NotionConfigConfiguration for the Notion API integration.
NotionCoverCover image on a page.
NotionDatabaseA Notion database object.
NotionDatabaseQueryQuery options for a Notion database.
NotionIconIcon on a page or database (emoji or file).
NotionPageA Notion page object.
NotionPageListResult of querying a Notion database (paginated).
NotionParentParent reference for pages and databases.
NotionPropertyProperty value on a Notion page.
NotionPropertySchemaSchema definition for a database property.
NotionRichTextRich text object used in Notion blocks and properties.
NotionSearchQuerySearch query options for the Notion API.
NotionSearchResultResult of a Notion search (paginated).
NotionSortSort option for querying a Notion database.
NotionUserA Notion user object.
NotionUserListPaginated list of Notion users.
NumberFormatOptions-
ObserverCallbackCallback invoked when an observed element enters the viewport.
ObserverTargetTarget can be either an HTMLElement reference or a CSS selector string.
OmitKeyof-
Override-
PathParams-
PlaceholderDataFunction-
PrincipalThe authenticated subject, as reported by an identity provider.
ProductType-
QueriesPlaceholderDataFunction-
QueryBooleanOption-
QueryCacheNotifyEventThe event passed to a QueryCache subscriber. Fired whenever a query is added or removed from the cache, its state is updated (e.g. via query.setState or queryClient.removeQueries), or one of its observers is added, removed, or has its results or options updated.
QueryFunction-
QueryFunctionContext-
QueryKeyThe type of a query key — the serializable array that identifies a query in the cache. Defaults to ReadonlyArray<unknown>; declare queryKey on Register to narrow it repository-wide.
QueryKeyHashFunction-
QueryKeyWithDataTag-
QueryMetaThe type of the meta object that can be attached to a query and read back from queryFn, callbacks and cache-level handlers. Defaults to Record<string, unknown>; declare queryMeta on Register to narrow it.
QueryObserverResult-
QueryParams-
QueryPersister-
QueryStatus-
ReadDirEntryA single directory entry returned by useReadDir.
ReadDirOptionsOptions for useReadDir.
RequestInterceptorInspects or modifies a request before fetch; interceptors run in registration order.
RssConfigConfiguration for generating an RSS feed.
RssItemA single item in an RSS feed.
RssResultResult of an RSS generation attempt.
SafeResultGeneric Safe Result discriminated union (Astro Actions style): the ok flag narrows between the success and error branches and nothing is thrown.
SalePriceOptions-
ScrollPositionRepresents scroll position.
SeoArrayable-
SeoBooleanableSlim SEO types: typical HTML meta + Open Graph (Facebook) only. CamelCase keys map to <title> / <meta> / <link rel="canonical">.
SeoMetaInputFlat meta input (all keys optional / nullable).
SeoTagResultResult of useSeoMeta: html / tags for the head, plus one flat object of resolved fields (site + HTML + OG + Twitter). No duplicate title / meta.title / config.title.
SignalListener-
SignalSetter-
SkipTokenThe type of the skipToken sentinel value.
SmartVideoOptionsInput for useBuildVideoEmbed (core) — one src, unified output.
StaleTime-
StaleTimeFunction-
StorageTarget-
TemporalInput-
ThemeMode-
ThrowOnError-
TimeoutCallbackTimeoutManager does not support passing arguments to the callback.
TimeoutProviderBackend for timer functions.
UnsetMarker-
UpdaterEither a plain value of type TOutput, or a function that receives TInput and returns TOutput. Used for example by setQueryData-style updaters, which accept either the new data directly or a function that computes it from the previous data. See functionalUpdate.
UseSeoMetaBaseSite + HTML + OG fields in one object (before Omit).
UseSeoMetaOptionsPublic options for useSeoMeta. HTML, Open Graph, Twitter/X card and site fields in one object. Omit keys you do not want in the type.
ValidationIssueMinimal issue shape (error.issues entries).
ValidationParseResultMinimal Zod-like success/failure result (schema.safeParse).
ViewportSizeRepresents viewport dimensions.
WatchCallbackWatch callback taken from the native Vue watch. Any internal function is accepted: sync or async, with (newValue, oldValue) args or with no args at all (e.g. () => checkValidations()).
WatchOptionsWatch options taken from the native Vue watch. deep defaults to true in useKatanaWatch.
WatchSourceWatch source taken from the native Vue watch (ref, reactive object, getter function or array of those).
WatchStopHandleStop function taken from the native Vue watch.
WithRequired-
WordPressAuthAuthentication methods for WordPress.
WordPressConfigConfiguration for the WordPress REST API integration.
WorkerFunc-
WpAcfFieldsContainer for ACF (Advanced Custom Fields) fields on a WordPress entity.
WpBaseEntityBase fields shared by all WordPress entities.
WpBatchOperationA batch operation for the WordPress REST API.
WpBatchResultResult of a WordPress batch operation.
WpCapabilityA WordPress capability name (edit_orders).
WpCapabilityMapCapability map as WordPress reports it ({ manage_options: true }).
WpCategoryA WordPress category.
WpCategoryCreatePayload for creating a WordPress category.
WpCategoryUpdatePayload for updating a WordPress category.
WpCommentA WordPress comment.
WpCommentCreatePayload for creating a WordPress comment.
WpCommentUpdatePayload for updating a WordPress comment.
WpEmbeddedEmbedded resources returned by WordPress when _embed is used.
WpMediaA WordPress media item (attachment).
WpMediaMetaMetadata for a media upload.
WpMediaUpdatePayload for updating a WordPress media item.
WpPageA WordPress page.
WpPageCreatePayload for creating a WordPress page.
WpPageUpdatePayload for updating a WordPress page.
WpPostA WordPress post.
WpPostCreatePayload for creating a WordPress post.
WpPostUpdatePayload for updating a WordPress post.
WpQueryParamsCommon query parameters for WordPress REST API list endpoints.
WpRoleAuditA declared role compared against what the live site reports.
WpRoleAuditStatusVerification outcome of a declared role: verified, partial, unverifiable.
WpRoleDefinitionA role declaration: the PHP-free replacement for add_role().
WpRoleRegistryA declared role registry.
WpTagA WordPress tag.
WpTagCreatePayload for creating a WordPress tag.
WpTagUpdatePayload for updating a WordPress tag.
WpUserA WordPress user.
WpUserCreatePayload for creating a WordPress user.
WpUserUpdatePayload for updating a WordPress user.
WriteFileOptionsOptions for useWriteFile / useAppendFile.
YoutubeApiConfigConfig for the YouTube service. One GCP project serves all repos.
YoutubeChannelsResponseMinimal channels.list shape (only what the service reads).
YoutubeEmbedOptionsOptions for the YouTube nocookie embed URL.
YoutubeListParamsParams for useGetChannelVideos.
YoutubePlaylistItemsResponseMinimal playlistItems.list shape (only what the service reads).
YoutubeThumbnailQualityThumbnail quality for i.ytimg.com.
YoutubeVideoNormalizedNormalized video, enriched with player-ready URLs.
YoutubeVideoPagePaginated channel listing result.
YoutubeVideosResponseMinimal videos.list shape (only what the service reads).
YoutubeVideoThumbnailsResolution-keyed thumbnails (all derivable without an API key).

Variables ​

VariableDescription
AccessCapabilitySchemaA capability: at least <domain>:<action>, optionally :action:<scope>. Rejecting a bare word matters — an unscoped delete is exactly the ambiguity content:delete:own exists to remove.
AccessResourceSchemaThe thing being acted on — enough for the authorization layer to route a check to the right table, and nothing more.
AccessRoleDefinitionSchemaA role definition.
AccessRoleSchemaA role slug: lowercase, and made of alphanumeric words joined by _, . or -. The format is enforced so a typo fails loudly at the schema boundary instead of silently granting nothing.
AccessSubjectSchemaStructural subject for access checks. Decoupled from the persistence layer: any object with an id and a role list can be checked (e.g. a Prisma Account row, a JWT payload, or a test fixture).
AgentDataSchemaPayload returned by a successful useRunAgent call.
AgentStepSchemaOne round of tool execution inside the agent loop.
AiErrorSchemaSafe error returned on non-2xx or network failures (AI boundary).
AiFunctionCallSchemaFunction invocation requested by the model when using tools.
AiMessageSchemaA chat message. tool_calls and tool_call_id use snake_case on purpose: they mirror the OpenAI-compatible protocol so messages pass through unchanged.
AiProviderConfigSchemaProvider configuration for an OpenAI-compatible chat/agent endpoint.
AiRoleSchemaRole of a chat message in the OpenAI-compatible protocol.
AiToolCallSchemaA single tool call emitted by the model (OpenAI-compatible wire shape).
ApiErrorSchemaSafe error returned on non-2xx, network or validation failures.
AppDateFormatOptionsSchemaDate format parts (subset of Intl.DateTimeFormatOptions).
assistantObject facade implementing IAssistantService over the singleton.
AssistantReplySchemaPayload returned by a successful assistant reply.
AstroServiceErrorSchemaError shape for Astro content operations.
BUILT_IN_CAPABILITIESCapabilities that ship with the kit. Namespaced as <domain>:<action> [:<scope>]; the scope suffix is what keeps edit:own and edit:any from being confused. Open-ended by design — a deployment that needs expediente:firmar or nomina:aprobar registers its own.
BUILT_IN_ROLE_SLUGSRole slugs that ship with the kit, ordered from most to least privileged.
CurrencyFormatOptionsSchemaOptions for currency formatting.
CurrencySchemaSupported ISO currency codes.
dataTagErrorSymbol-
dataTagSymbol-
DateOrderSchemaRelative ordering of two dates, matching Notion's dateOrder().
DateUnitSchemaGranularity of a date calculation, matching Notion's formula vocabulary.
defaultSchedulerDefault scheduling function used by the notify manager. Schedules the callback with the system's setTimeout(callback, 0).
DirectoryErrorCodeSchemaWhy an operation was refused.
DirectoryPageSchemaA page of results plus the cursor for the next one.
DirectoryQuerySchemaA page request. cursor is opaque and provider-defined — the kit neither issues nor interprets it.
DirectoryUserSchemaA person as your directory stores them.
environmentManagerManages how TanStack Query detects whether the current runtime should be treated as server-side, which disables scheduling refetch timers and changes the default retry count and gcTime. By default, the detection treats a missing window (or the presence of a Deno global) as server.
FakeVehicleSchemaGeneric fake vehicle shape returned by useFakeVehicle.
FieldErrorsSchemaA single field-level validation message keyed by field name.
FileEncodingSchemaText encodings accepted by the filesystem helpers.
FileHashAlgorithmSchemaHash algorithms supported by useHashFile / useVerifyFileHash.
FileStatsSchemaPortable stats subset for a file or directory.
FilesystemErrorSchemaSafe error from a filesystem operation (NodeJS.ErrnoException-shaped).
focusManagerSingleton instance of FocusManager, used to manage and observe the focus state within TanStack Query.
GeometryFormatOptionsSchemaOptions for number formatting in geometry calculations.
GeometryUtilsConsolidated pure geometry utilities namespace. Groups area, perimeter and volume calculations (no shared mutable state).
GeoPositionSchemaRepresents a geographic position with latitude, longitude and accuracy.
GrantSchemaA role held over one specific resource — the "share with restricted access" that a content-management role ladder cannot express.
HttpMethodSchemaHTTP verbs supported by the fetch facade.
IdentitySchemaA person in your system, as opposed to the principal they log in with.
IdentityStatusSchemaLifecycle of an account you own.
IfBucketSchemaBucket name.
IfConfigSchemaConfig for the InsForge adapter. InsForge is the database fallback (primary data layer is Cloudflare); storage and edge functions are also available through the same client.
IfInsertRowsSchemaRows for insert (one or many).
IfInvokeOptionsSchemaEdge function invocation.
IfListOptionsSchemaOptions for listing bucket objects.
IfOrderSchemaSort clause for table queries.
IfRpcCallSchemaPostgres function (RPC) call.
IfStorageRefSchemaBucket + object key reference for storage operations.
IfTableNameSchemaTable name (bare; schema comes from config or query options).
IfTableQuerySchemaOptions for a table read. Filters map to equality clauses.
IfUpdatePatchSchemaPatch for update (must be paired with filters — mass updates are refused).
IfWriteQuerySchemaOptions for an update or delete. Filters are REQUIRED (no mass writes).
KITT_BASE_URLDefault endpoint for Alibaba Cloud Model Studio (DashScope) compatible mode.
KITT_DEFAULT_MODELDefault model for the Kitt assistant preset.
KITT_SYSTEM_PROMPTDefault system prompt injected when the agent is configured without one.
kittPresetReusable preset (base URL + model) for the Kitt assistant.
LazyLoaderEntrySchemaInternal registry entry for lazy loading configurations.
LazyNodeCryptoStrategyLazy Node.js crypto strategy for PBKDF2 hashing.
LocaleSchemaLocales with first-class formatting support.
LogLevelSchemaNative console methods used as log levels.
MediaProviderSchemaWhere a media source comes from. file = direct mp4/webm (native <video>).
MediaSourceSchemaNormalized media source: provider + stable id or direct src.
NativeUuidStrategyNative UUID strategy using globalThis.crypto.randomUUID, with a fallback.
notifyManagerHandles scheduling and batching callbacks in TanStack Query.
NotionBlockListSchemaResult of listing block children (paginated).
NotionBlockResponseSchemaSingle block response (fields may be sparse depending on the endpoint).
NotionBlockSchemaA Notion block object.
NotionConfigSchemaConfig for the Notion API integration.
NotionCoverSchemaCover image on a page.
NotionDatabaseQuerySchemaQuery options for a Notion database.
NotionDatabaseResponseSchemaSingle database response (fields may be sparse depending on the endpoint).
NotionDatabaseSchemaA Notion database object.
NotionFilterSchemaFilter for querying a Notion database.
NotionIconSchemaIcon on a page or database (emoji or file).
NotionPageListSchemaResult of querying a Notion database (paginated).
NotionPageResponseSchemaSingle page response (fields may be sparse depending on the endpoint).
NotionPageSchemaA Notion page object.
NotionParentSchemaParent reference for pages and databases.
NotionPropertySchemaSchemaSchema definition for a database property.
NotionPropertyValueSchemaProperty value on a Notion page.
NotionRichTextSchemaRich text object used in Notion blocks and properties.
NotionSearchQuerySchemaSearch query options for the Notion API.
NotionSearchResultSchemaResult of a Notion search (paginated).
NotionSortSchemaSort option for querying a Notion database.
NotionUserListSchemaPaginated list of Notion users.
NotionUserResponseSchemaSingle user response (fields may be sparse depending on the endpoint).
NotionUserSchemaA Notion user object.
NumberFormatOptionsSchemaOptions for plain number formatting.
onlineManagerSingleton instance of OnlineManager, used to manage and observe the online state within TanStack Query.
PrincipalSchemaA principal is the result of authenticating: who the provider says you are, and how it proved it.
ProductTypeSchemaDemo product shape (Express adapter).
ReadDirEntrySchemaA single directory entry with pre-resolved type flags.
ReadDirOptionsSchemaOptions for directory listing.
RssConfigSchemaConfiguration for generating an RSS feed.
RssItemSchemaA single item in an RSS feed.
SalePriceOptionsSchemaOptions for sale price arithmetic.
ScrollPositionSchemaRepresents scroll position.
SerializedErrorSchemaSerialized error shape.
siteConfigDemo defaults — override in your project.
skipTokenSentinel value that can be passed as a query's queryFn to conditionally disable the query (equivalent to enabled: false) while preserving full type inference for the query's data. Unlike enabled: false, a query disabled via skipToken cannot be triggered with refetch.
SmartVideoOptionsSchemaInput for useBuildVideoEmbed (core) — one src, unified output.
StorageTargetSchemaStorage backends (Web Storage API).
ThemeModeSchemaColor scheme modes.
timeoutManagerSingleton instance of TimeoutManager, used throughout TanStack Query to schedule and cancel timers.
unsetMarker-
useQuerySelectorReturns the first element matching a CSS selector.
useQuerySelectorAllReturns all elements matching a CSS selector.
ValidationIssueSchemaMinimal issue shape (error.issues entries).
ViewportSizeSchemaRepresents viewport dimensions.
WordPressAuthSchemaAuthentication methods for WordPress.
WordPressConfigSchemaConfiguration for the WordPress REST API integration.
WpAcfFieldsSchemaContainer for ACF (Advanced Custom Fields) fields.
WpBaseEntitySchemaBase fields shared by all WordPress entities.
WpBatchOperationSchemaA batch operation for the WordPress REST API.
WpBatchResultSchemaResult of a WordPress batch operation.
WpCapabilityMapSchemaCapability map as WordPress reports it: { manage_options: true, … }.
WpCapabilitySchemaA WordPress capability name: edit_orders, read_private_orders, manage_options. Snake_case, the vocabulary WordPress itself uses.
WpCategoryCreateSchemaPayload for creating a WordPress category.
WpCategoryListSchemaList of categories.
WpCategoryResponseSchemaCategory response variant (partials via _fields stay well-typed).
WpCategorySchemaA WordPress category.
WpCategoryUpdateSchemaPayload for updating a WordPress category.
WpCommentCreateSchemaPayload for creating a WordPress comment.
WpCommentListSchemaList of comments.
WpCommentResponseSchemaComment response variant (partials via _fields stay well-typed).
WpCommentSchemaA WordPress comment.
WpCommentUpdateSchemaPayload for updating a WordPress comment.
WpEmbeddedSchemaEmbedded resources returned when _embed is used.
WpMediaListSchemaList of media items.
WpMediaMetaSchemaMetadata for a media upload.
WpMediaResponseSchemaMedia response variant (partials via _fields stay well-typed).
WpMediaSchemaA WordPress media item (attachment).
WpMediaUpdateSchemaPayload for updating a WordPress media item.
WpPageCreateSchemaPayload for creating a WordPress page.
WpPageListSchemaList of pages.
WpPageResponseSchemaPage response variant (partials via _fields stay well-typed).
WpPageSchemaA WordPress page.
WpPageUpdateSchemaPayload for updating a WordPress page.
WpPostCreateSchemaPayload for creating a WordPress post.
WpPostListSchemaList of posts.
WpPostResponseSchemaPost response variant (partials via _fields stay well-typed).
WpPostSchemaA WordPress post.
WpPostUpdateSchemaPayload for updating a WordPress post.
WpQueryParamsSchemaCommon query parameters for WordPress REST API list endpoints.
WpRoleAuditSchemaThe result of auditing a declared role against what WordPress reports for the users that hold it.
WpRoleAuditStatusSchemaHow a declaration compares to the live site.
WpRoleDefinitionSchemaA role declaration, the PHP-free replacement for add_role().
WpRoleRegistrySchemaA declared role registry.
WpTagCreateSchemaPayload for creating a WordPress tag.
WpTagListSchemaList of tags.
WpTagResponseSchemaTag response variant (partials via _fields stay well-typed).
WpTagSchemaA WordPress tag.
WpTagUpdateSchemaPayload for updating a WordPress tag.
WpUserCreateSchemaPayload for creating a WordPress user.
WpUserListSchemaList of users.
WpUserResponseSchemaUser response variant (partials via _fields stay well-typed).
WpUserSchemaA WordPress user.
WpUserUpdateSchemaPayload for updating a WordPress user.
WriteFileOptionsSchemaOptions for writing or appending files.
YoutubeApiConfigSchemaConfig for the YouTube service. One GCP project serves all repos.
YoutubeChannelsResponseSchemaMinimal channels.list shape (only what the service reads).
YoutubeEmbedOptionsSchemaOptions for the YouTube nocookie embed URL.
YoutubeListParamsSchemaParams for useGetChannelVideos.
YoutubePlaylistItemsResponseSchemaMinimal playlistItems.list shape (only what the service reads).
YoutubeThumbnailQualitySchemaThumbnail quality for i.ytimg.com.
YoutubeVideoNormalizedSchemaNormalized video, enriched with player-ready URLs.
YoutubeVideoPageSchemaPaginated channel listing result.
YoutubeVideosResponseSchemaMinimal videos.list shape (only what the service reads).
YoutubeVideoThumbnailsSchemaResolution-keyed thumbnails (all derivable without an API key).

Functions ​

FunctionDescription
CacheDecoratorDecorates an async function with memoized results (Decorator Pattern).
createMemoryStorageCreates a new in-memory Storage instance used as an SSR / private-mode fallback. Each call owns its own Map — never share one across requests.
defaultShouldDehydrateMutationThe default shouldDehydrateMutation predicate used by dehydrate. Only dehydrates mutations that are currently paused (e.g. paused by networkMode while offline).
defaultShouldDehydrateQueryThe default shouldDehydrateQuery predicate used by dehydrate. Only dehydrates queries whose status is 'success'.
defineApiConfigDeclares the API registry in a single call - the config-file entry point.
defineSeoMetaConfigRegisters the site-wide SEO config once — the same define*Config pattern used by the HTTP client and the other services.
dehydrateDehydrates a QueryClient's cache (queries and mutations) into a plain, serializable DehydratedState, typically to embed in server-rendered markup and later restore into a client-side QueryClient via hydrate. Which queries/mutations are included, and how their data/errors are transformed, is controlled by options, falling back to the client's dehydrate default options, and finally to defaultShouldDehydrateQuery / defaultShouldDehydrateMutation.
dehydrateQueryDehydrates a single Query into a serializable DehydratedQuery snapshot. Note that most query config (e.g. queryFn, staleTime) is not dehydrated but instead meant to be configured again when consuming the de/rehydrated data, typically with useQuery on the client. If the query is still pending, its in-flight promise is dehydrated too so it can be resumed on the other side instead of re-fetched.
experimental_streamedQueryThis is a helper function to create a query function that streams data from an AsyncIterable. Data will be an Array of all the chunks received. The query will be in a 'pending' state until the first chunk of data is received, but will go to 'success' after that. The query will stay in fetchStatus 'fetching' until the stream ends.
hashKeyDefault query & mutation keys hash function. Hashes the value into a stable hash.
hydrateRestores a DehydratedState (as produced by dehydrate) into a QueryClient's cache, typically to seed the client with data already fetched on the server. mutations and queries are each optional on dehydratedState. Queries not yet in the cache are built from the dehydrated snapshot; queries that already exist are only updated when the dehydrated data is newer than what's already cached. Newly built queries have their fetchStatus reset to 'idle' so they don't hydrate stuck in a fetching state. If a dehydrated query still had an in-flight promise, it is resumed via query.fetch() (reusing that promise as initialPromise) rather than re-invoking queryFn.
keepPreviousDataIntended to be passed as a query's placeholderData option, for example placeholderData: keepPreviousData. Instead of resetting the query's data to undefined while a new query key is fetching, it keeps displaying the previously fetched data until the new data arrives.
LocalStorageStrategyCreates a strategy backed by window.localStorage.
LoggerDecoratorLoggerDecorator - Decorator Pattern para trazado de llamadas.
matchMutationChecks whether a mutation matches the given MutationFilters. Every filter that is specified must match; filters that are left unspecified are ignored. If a mutationKey filter is provided but the mutation has no mutationKey of its own, it does not match.
matchQueryChecks whether a query matches the given QueryFilters. Every filter that is specified must match; filters that are left unspecified are ignored.
MemoryStorageStrategyCreates a strategy backed by an in-memory store (SSR / private-mode fallback).
noopA function that does nothing.
partialMatchKeyChecks if key b partially matches with key a.
replaceEqualDeepThis function returns a if b is deeply equal. If not, it will replace any deeply equal children of b with those of a. This can be used for structural sharing between JSON values for example.
RetryDecoratorRetryDecorator - Decorator Pattern para reintentos.
SessionStorageStrategyCreates a strategy backed by window.sessionStorage.
shouldThrowErrorResolves a throwOnError option to a boolean. If throwOnError is a function, it is called with params (e.g. the error and, depending on the caller, additional context such as the query or mutation) and its result is returned, allowing the throwing behavior to be decided per error. Otherwise, throwOnError itself is coerced to a boolean (undefined resolves to false).
useAddClassAdds one or more CSS classes to the target element.
useAddDaysAdds a number of days to a date.
useAddRequestInterceptorRegisters a request interceptor on the singleton HTTP client.
useAppendAppends a child element to the target parent.
useAppendFileAppends text or bytes to a file, creating it when missing.
useApplySeoTagApplies tags from a SeoTagResult into document.head (Vanilla / SPA). No-op when document is unavailable (SSR).
useAttemptRuns an operation (sync or async) and captures any throw as a Safe Result.
useAverageComputes the arithmetic mean of an array of numbers.
useBearerTokenReads the bearer token from anything carrying headers.
useBlurActiveElementRemoves focus from the currently active element.
useBuildUrlReturns the URL of a registered endpoint without calling fetch.
useBuildVideoEmbedBuilds the semantically correct embed HTML for any supported source.
useBuildVimeoEmbedUrlBuilds the Vimeo player embed URL with privacy defaults.
useBuildYoutubeEmbedUrlBuilds the privacy-enhanced YouTube embed URL (youtube-nocookie).
useBuildYoutubeRssUrlBuilds the public channel RSS feed URL. Needs no API key and costs zero quota — ideal for "latest videos" widgets.
useBuildYoutubeThumbnailBuilds the public YouTube thumbnail URL (no API key needed).
useCanWhether the subject may perform a capability. Any of the subject's roles granting the capability (directly or by inheritance) is enough.
useCapabilitiesForEffective capabilities of a role: its own plus every less-privileged role's.
useCapitalizePure: capitalizes the first character; leaves the rest unchanged.
useChatSends a single chat completion and returns the assistant text as a Safe Result.
useChunkSplits an array into chunks of the given size.
useClearStorageClears all values from the specified storage backend.
useCopyFileCopies a file. Existing destinations are overwritten unless overwrite: false is passed (COPYFILE_EXCL).
useCopyToClipboardCopies text to the clipboard (browser only).
useCreateBatchReturns a batch function that defers signal notifications until the callback completes. Nested calls are supported -- only the outermost batch flushes the queue.
useCreateDebouncedSignalCreates a signal whose setter debounces writes by delayMs milliseconds. Useful for search inputs or any value that triggers expensive work.
useCreateEffectCreates a side effect that re-runs whenever a signal read by the callback changes. Explicit dependencies can also be provided for compatibility. An optional cleanup function returned from the callback is invoked before each re-run and on disposal.
useCreateElementCreates a new HTML element.
useCreateMemoCreates a memoised signal whose value is derived from a computation. The computation re-runs whenever a signal it reads changes. Explicit dependencies can also be provided for compatibility.
useCreateMemoryStoreCreates a fresh in-memory conversation store. Useful in tests or when you want an isolated store per process.
useCreatePoolCreates a reusable Worker pool under a unique key. If a pool with the same key already exists, it is terminated first.
useCreateQueryClientCreates a new QueryClient. Use this on the server (SSR) to get one client per request and avoid sharing a process-global cache across users.
useCreateSessionCreates a new conversation session.
useCreateSignalCreates a reactive signal with a getter and setter.
useCreateStorageSignalCreates a signal that persists its value to a storage backend (localStorage, sessionStorage, etc.). Reads the initial value from storage on creation.
useCreateToggleCreates a boolean toggle signal.
useDateAddReturns the date a given number of units away, with calendar semantics.
useDateBetweenReturns the whole number of units between two dates. Signed, never fractional, and defaulting to days.
useDateOrderReturns whether the first date comes before, after, or at the same time as the second.
useDateSubtractSubtracts units from a date, with calendar semantics.
useDebounceReturns a debounced version of func that delays invocation until delayMs milliseconds of quiet.
useDebounceImmediateLeading-edge debounce: fires immediately on the first call, then ignores calls until delayMs of quiet. Additional calls during the wait window schedule a single trailing invocation with the latest arguments.
useDeepCloneDeep clones a value using structuredClone with a JSON fallback.
useDeepMergeDeep merges source into a shallow copy of target.
useDeleteDELETE helper over a registered API endpoint.
useDestroyThemeCleans up the media-query listener. Call this when the theme system is no longer needed (e.g. during teardown in tests).
useDurationBetweenReturns the balanced breakdown between two dates as a Temporal.Duration.
useEnhanceVideoFacadesHydrates click-to-play facades rendered by useBuildVideoEmbed. SSR-safe: no-op outside the browser, no side effects on import. Call once per page (Astro/React/Vue/MDX useEffect or inline script).
useEnsureDirCreates a directory (and any missing parents).
useErrorCustomCreate a custom error object. Use with useLogger for consistent error logging.
useErrorNormalizeNormalizes any thrown value into the shared ApiError shape.
useErrorSerializeSerialize an error into a plain object. Uses sensible defaults based on the status code when message is omitted.
useEveryWhether every item matches. See ArrayService.useEvery.
useEveryAsyncAsync every, short-circuiting. See ArrayService.useEveryAsync.
useExitFullscreenExits fullscreen mode.
useFakeBooleanGenerates a random boolean.
useFakeCompanyNameGenerates a fake company name.
useFakeDateGenerates a random date within an optional range.
useFakeEmailGenerates a fake email address.
useFakeFirstNameGenerates a fake first name.
useFakeFullNameGenerates a fake full name.
useFakeLastNameGenerates a fake last name.
useFakeListBuilds an array of fake items from a factory (sync or async).
useFakeNumberGenerates an integer within an inclusive range.
useFakePhoneGenerates a fake phone number.
useFakeSeedSeeds the faker instance for reproducible output, or rolls a new random seed.
useFakeSetDefaultRefDatePins the reference date faker uses for relative date helpers, so date-dependent output stays reproducible next to useFakeSeed.
useFakeTextGenerates lorem-ipsum text.
useFakeUrlGenerates a fake URL.
useFakeUuidGenerates a v4 UUID.
useFakeVehicleGenerates a generic fake vehicle (brand, model, type, fuel, color, vin, plate).
useFetchFetches a registered endpoint and returns a Safe Result.
useFetchApiFetches a registered endpoint and returns a Safe Result. Alias for useFetch.
useFileExistsChecks whether a path exists and is accessible. Never throws: returns false for missing paths and non-Node runtimes.
useFilterKeeps the items that satisfy predicate. See ArrayService.useFilter.
useFilterAsyncAsync filter, in parallel. See ArrayService.useFilterAsync.
useFindReturns the first matching item, or undefined. See ArrayService.useFind.
useFindAsyncAsync find, short-circuiting. See ArrayService.useFindAsync.
useFindIndexReturns the index of the first match, or -1. See ArrayService.useFindIndex.
useFindLastReturns the last matching item, or undefined. See ArrayService.useFindLast.
useFirstDayOfMonthReturns the first day of the month for a given date.
useFlatMapMaps to collections and flattens one level. See ArrayService.useFlatMap.
useFocusElementFocuses an element.
useFormatFormats a date input into a localised string using Intl.DateTimeFormat.
useFormatCurrencyPure: formats an amount as currency.
useFormatNumberPure number formatter over Intl.NumberFormat. Stateless — safe to call from any environment.
useFromEntriesTyped Object.fromEntries. See ArrayService.useFromEntries.
useGenerateMetaTagsHTML string of meta tags (no RSS). Prefer useSeoMeta.
useGetGET helper over a registered API endpoint.
useGetActiveElementReturns the currently focused element.
useGetApiGET helper over a registered API endpoint. Alias for useGet.
useGetApisReturns a shallow copy of the registered APIs (safe to mutate locally).
useGetApisConfigReturns a shallow copy of the registered APIs. Alias for useGetApis.
useGetAttributeGets the value of an attribute from the target element.
useGetBackCameraOpens the back-facing (environment) camera.
useGetBasenameReturns the last portion of a path (file name).
useGetBatteryGets the device battery status.
useGetBodyReturns the <body> element, or null outside a browser.
useGetChannelVideosLists channel videos via the quota-cheap path (channels → playlistItems, never search.list which costs 100 units). Call server/build-time and cache the response (1h) to share quota across every repo using the same GCP project.
useGetChannelVideosRssFetches the keyless channel RSS feed and parses it. Zero quota, limited to the latest ~15 videos with basic metadata.
useGetCwdReturns the current working directory of the process (where the command was launched), or null outside a Node-compatible runtime. Use it for project-relative paths; use useGetDirname for file-relative paths.
useGetDataAttributeGets a data-* attribute value from the target element.
useGetDirnameResolves the directory of a module from its import.meta.url.
useGetElementByClassFinds the first element matching a class name.
useGetElementByIdFinds an element by its id attribute.
useGetFileExtensionReturns the extension of a path, including the leading dot.
useGetFileStatsReturns a portable stats subset for a file or directory.
useGetFrontCameraOpens the front-facing (user) camera.
useGetGeolocationGets the device's current geographic position once.
useGetHistoryReturns the full message history of a session, oldest first.
useGetMediaStreamRequests a media stream (camera, microphone, or both).
useGetRelativePathComputes the relative path from from to to.
useGetResolvedReturns the resolved theme ("light" or "dark"), accounting for system preference when mode is "system".
useGetRootReturns the root <html> element, or null outside a browser.
useGetScrollPositionReturns the current scroll position as { x, y }.
useGetScrollProgressReturns the vertical scroll progress as a value between 0 (top) and 1 (bottom).
useGetScrollXReturns the current horizontal scroll position.
useGetScrollYReturns the current vertical scroll position.
useGetStorageRetrieves a value from storage by key.
useGetThemeModeReturns the current theme mode (may be "system").
useGetTitleReturns the current document title.
useGetUploadsPlaylistIdResolves a channel id to its uploads playlist id (quota cost: 1 unit). Prefer passing playlistId to useGetChannelVideos to skip this call.
useGetUrlParamsParses query parameters from a URL string into a plain object.
useGetVideoDetailsEnriches videos with duration and view count (videos.list, 1 unit).
useGetViewportSizeReturns the current viewport dimensions.
useGetVimeoVideoIdExtracts a Vimeo video id from a URL or bare numeric id.
useGetYoutubeConfigReturns a shallow copy of the YouTube config (safe to mutate locally).
useGetYoutubeVideoIdExtracts a YouTube video id from a watch / shorts / live / embed / youtu.be URL or a bare 11-char id. Returns null when not matched.
useGrantAwareCanResolves a capability against a subject and a resource.
useGroupByGroups array items by a key property or key selector function.
useHasClassChecks whether the target element has a given CSS class.
useHashDerives a PBKDF2-SHA512 hash of plainText. Returns "salt:hashHex". Prefer a unique salt per secret.
useHashFileStreams a file and returns its checksum as a lowercase hex digest.
useHasRoleExact role membership - no hierarchy involved.
useHasWorkerChecks whether a Worker pool with the given key exists.
useHeadTagsFull <head> HTML (meta + RSS). Accepts legacy SeoMeta or flat SeoMetaInput.
useInitAgentRegisters the AI provider for the Kitt assistant.
useInitAssistantConfigures the assistant: provider (Kitt) plus an optional conversation store.
useInitQueryClientReplaces the shared QueryClient singleton with a configured instance. The previous client's caches are cleared before swapping.
useInitThemeInitializes the theme system. Reads the stored preference (or falls back to defaultMode), applies the theme, and registers a system color-scheme listener for "system" mode.
useInitYoutubeRegisters the YouTube APIs (youtube + keyless youtubeFeed) and stores the default channel. Call once per app, server/build-time — the API key must never ship to the browser.
useIntervalRepeatedly executes a callback at ms intervals with pause/resume/stop controls. Uses recursive setTimeout internally to avoid overlap.
useIsAfterChecks whether date1 is after date2.
useIsAtBottomChecks whether the page is scrolled to (or near) the bottom.
useIsAtTopChecks whether the page is scrolled to (or near) the top.
useIsBeforeChecks whether date1 is before date2.
useIsBrowserChecks whether the code is running in a browser environment.
useIsDocumentVisibleChecks whether the document tab is currently visible.
useIsEqualChecks whether two dates are equal.
useIsFullscreenChecks whether the document is currently in fullscreen mode.
useIsNodeChecks whether the code runs in a Node.js-compatible runtime (Node, Bun or Deno). Returns false in browsers and edge runtimes.
useIsObjectType guard that checks whether a value is a plain object (not null, not an array).
useIsSupportedChecks whether IntersectionObserver is available in the current environment.
useJoinPathJoins path segments without resolving against process.cwd().
useJsonParsePure: parse JSON (throws on invalid input — same as JSON.parse).
useJsonStringifyPure: pretty-print JSON (3-space indent).
useKeysTyped Object.keys. See ArrayService.useKeys.
useLastDayOfMonthReturns the last day of the month for a given date.
useLazyLoaderHasChecks whether a lazy-loader with the given key is active.
useLazyLoaderInitInitializes lazy loading for images using IntersectionObserver. Elements matching the selector must have a data-src attribute with the real image URL.
useLazyLoaderStopStops a lazy-loader instance and disconnects its underlying observer.
useLazyLoaderStopAllStops all active lazy-loader instances.
useLoggerWrapper para LoggerService - mantiene backward compatibility
useLoggerClearWrapper para LoggerService - mantiene backward compatibility
useLoggerErrorWrapper para LoggerService - mantiene backward compatibility
useLoggerTableWrapper para LoggerService - mantiene backward compatibility
useLoggerWarnWrapper para LoggerService - mantiene backward compatibility
useLowerCasePure: locale-aware lower case (trims whitespace).
useMapProjects every item. See ArrayService.useMap.
useMapAsyncAsync map, in parallel. See ArrayService.useMapAsync.
useMatchesMediaTests a CSS media query against the current viewport.
useModalCloseCloses a modal by adding the "hidden" class or removing it from the DOM. Clicking outside the modal or calling this function will hide it.
useMoveFileMoves (renames) a file or directory.
useNowReturns today's date as an ISO date string.
useNowDateTimeReturns the current date and time as an ISO string (no timezone offset).
useNumericIdReturns the next auto-incrementing numeric id.
useObserverCreateCreates an IntersectionObserver under the given key. If an observer with the same key already exists, it is disconnected first.
useObserverDisconnectDisconnects and removes an observer by key, cleaning up all observed targets.
useObserverDisconnectAllDisconnects and removes all registered observers.
useObserverHasChecks whether an observer with the given key exists.
useObserverKeysReturns a list of all registered observer keys.
useObserverObserveStarts observing a single element under an existing observer key.
useObserverObserveAllObserves all elements matching a CSS selector under an existing observer key.
useObserverUnobserveStops observing a specific element under an observer key.
useOmitOmits the listed keys from an object, returning a shallow copy without them.
useOnAttaches an event listener to the target element and returns a cleanup function.
useOnDeviceMotionListens for device motion events (acceleration, rotation rate).
useOnDeviceOrientationListens for device orientation events (compass heading, tilt).
useOnVisibilityChangeRegisters a callback for document visibility changes.
useParseIso8601DurationParses an ISO 8601 duration (PT1H2M3S) into seconds. Pure and SSR-safe.
useParseMediaSourceNormalizes any supported input into a MediaSource. Pure and SSR-safe: no DOM, no fetch.
useParseSmartVideoOptionsValidates unknown input (parsed JSON, frontmatter, CMS payloads) against the SmartVideoOptions schema. Returns a Safe Result instead of throwing.
useParseYoutubeRssParses a YouTube channel RSS feed (feeds/videos.xml) into normalized videos. Pure and SSR-safe — no network, no DOM parser.
usePartitionSplits into [matching, rest]. See ArrayService.usePartition.
usePatchPATCH helper over a registered API endpoint.
usePbkdf2HashAlias for useHash.
usePickPicks the listed keys from an object into a new object.
usePostPOST helper over a registered API endpoint.
usePrefersColorSchemeChecks whether the user's OS is set to prefer a dark color scheme.
usePrefersDarkModeChecks whether the user's OS prefers dark mode.
usePrefersReducedMotionChecks whether the user prefers reduced motion.
usePrintPageTriggers the browser print dialog.
usePutPUT helper over a registered API endpoint.
useQueryClientReturns the shared QueryClient singleton, creating one on first call.
useRaceRaces a promise against a timeout. Clears the timer when the promise wins so the timeout rejection cannot become an unhandled rejection.
useReadDirLists a directory with type flags resolved per entry.
useReadFileReads a text file.
useReadFileBufferReads a file as raw bytes (no encoding).
useReadJsonFileReads and parses a JSON file, optionally validating it with a Zod schema.
useReadModuleFileReads a file resolved from the caller's module directory — the __dirname + relative path pattern, without __dirname.
useReadModuleJsonReads and parses a JSON file resolved from the caller's module directory, optionally validating it with a Zod schema.
useReduceFolds into a single value. See ArrayService.useReduce.
useReduceAsyncAsync reduce, sequential. See ArrayService.useReduceAsync.
useRegisterRoleRegisters (or replaces) a role definition. Use it to extend a built-in role's capabilities, e.g. grant content:create to member.
useRemoveRemoves the target element from the DOM.
useRemoveAttributeRemoves an attribute from the target element.
useRemoveClassRemoves CSS class(es) from the target element.
useRemoveDirRemoves a directory tree. Recursive by default; force: false surfaces ENOENT instead of ignoring missing paths.
useRemoveFileRemoves a file.
useRemoveStorageRemoves a value from storage by key.
useRepeatExecutes a callback iterations times with an optional delay between each iteration.
useReplySends a user message within a conversation and returns the assistant reply. If no sessionId is provided, a new session is created. The user message and the assistant reply are persisted only on success.
useRequestFullscreenRequests fullscreen on the given element (or the document root).
useRequestMotionPermissionRequests permission to access device orientation/motion sensors (required on iOS 13+).
useResetRolesRestores the built-in role registry (mainly for tests).
useResetSeoMetaConfigClears the registered config (restores the demo defaults). Useful in tests.
useResetSessionDeletes a conversation session and its messages.
useResetThemeResets the theme to "system" and removes the stored preference.
useResolvePathResolves a sequence of path segments into an absolute path. Relative segments resolve against process.cwd(); if the first segment is absolute (like a useGetDirname result), cwd is ignored.
useResolveSubjectTurns an authenticated principal into an access subject — the single point where authentication hands over to authorization.
useRetryRetries an async function with a fixed delay between attempts.
useReverseReturns a reversed copy. See ArrayService.useReverse.
useRolesLists every registered role definition. Returns copies, not live state.
useRoundRounds a number (or numeric string) to the specified number of decimal places.
useRssHeadLink-
useRunRuns a pure function in a one-shot Worker and destroys it afterwards. Falls back to running on the main thread when Workers are unavailable (SSR). Async worker functions are awaited (Promise resolved before postMessage).
useRunAgentRuns the tool-calling agent loop against a goal until it emits a final answer or exhausts maxSteps.
useRunPoolRuns a task on an existing Worker pool. Tasks are correlated by __taskId so concurrent tasks do not stomp each other's handlers.
useRunStorageScopeRuns fn with request-isolated in-memory storage (SSR). Use this around a request handler so useSetStorage / useGetStorage share state within the request but not across requests.
useSafeQueryFnBridges a KatanaKit Safe Result fetcher into a TanStack queryFn.
useSalePricePure: applies a discount to a price and reports what was taken off.
useScrollToScrolls the window to a specific position, respecting prefers-reduced-motion.
useScrollToBottomScrolls to the bottom of the page.
useScrollToElementScrolls an element into view.
useScrollToTopScrolls to the top of the page.
useSeoMetaSEO helper: one flat object in → one flat object out (+ html/tags).
useSeoMetaConfigReturns the registered site config, falling back to the bundled demo defaults when defineSeoMetaConfig was never called.
useSessionExistsChecks whether a conversation session exists.
useSetAttributeSets an attribute on the target element with XSS protection. Blocks event-handler attributes (on*) and javascript: URLs.
useSetDataAttributeSets a data-* attribute on the target element.
useSetHtmlSets innerHTML on the target element.
useSetStorageStores a value under the given key (serialized as JSON).
useSetTempTitleTemporarily changes the document title, restoring the original after durationMs.
useSetTextSets the textContent of the target element (safe for user input).
useSetThemeModeSets the theme mode and persists it to storage.
useSetTimeoutExecutes a callback after ms milliseconds, returning a cancellable promise that resolves with the callback's result.
useSetTitleSets the document title.
useSleepReturns a promise that resolves after ms milliseconds.
useSlugifyConverts a text string into a URL-friendly slug.
useSomeWhether any item matches. See ArrayService.useSome.
useSomeAsyncAsync some, short-circuiting. See ArrayService.useSomeAsync.
useSortBySorts a copy by a derived key. See ArrayService.useSortBy.
useSplitConfigSplits a define*Config literal into its config half and its method half.
useStopMediaStreamStops all tracks in a media stream (releases camera/microphone).
useStopVibrationStops any ongoing vibration.
useSubtractDaysSubtracts a number of days from a date.
useTerminateTerminates a specific Worker pool and rejects any in-flight tasks.
useTerminateAllTerminates all active Worker pools and rejects any in-flight tasks.
useThrottleReturns a throttled version of func that fires at most once per limitMs milliseconds (leading edge).
useThrottleTrailingThrottle with trailing invocation: fires on the leading edge and also fires once at the end of the throttle window with the latest arguments.
useTitle-
useToCelsiusPure: °F → °C (formatted).
useToCmPure: inches → centimeters (formatted).
useToFahrenheitPure: °C → °F (formatted).
useToggleClassToggles a CSS class on the target element.
useToggleThemeToggles between "light" and "dark" (ignores "system").
useToInchesPure: centimeters → inches (formatted).
useTokenReturns a cryptographically strong 6-digit numeric token (100000–999999).
useToKilometersPure: miles → kilometers (formatted). Round-trips with useToMiles.
useToKilosPure: pounds → kilograms (formatted).
useToMilesPure: kilometers → miles (formatted). Round-trips with useToKilometers.
useToPoundsPure: kilograms → pounds (formatted).
useTryJsonParseParses JSON without throwing; failures come back as a Safe Result.
useUniqueReturns a new array with duplicate values removed, preserving first-seen order.
useUpperCasePure: locale-aware upper case (trims whitespace).
useUuidGenerates a RFC 4122 v4 UUID string.
useValidateValidates unknown data against a Zod schema and returns a Safe Result. Wrapper sobre ValidationService (backward compatibility).
useValuesTyped Object.values. See ArrayService.useValues.
useVerifyFileHashVerifies a file checksum against an expected value (case-insensitive).
useVibrateTriggers the device vibration motor with a given pattern.
useWatchGeolocationContinuously watches the device's geographic position.
useWorkerKeysReturns a list of all active Worker pool keys.
useWriteFileWrites (or overwrites) a file, creating it when missing.
useWriteJsonFileSerializes data to JSON and writes it to a file (pretty-printed by default).

Released under the MIT License.