/** * TypeScript type definitions for OpenRegister entities and shared utilities. * * @example * // Import specific types * import type { TObject, TSchema, TRegister } from '@conduction/nextcloud-vue/src/types' * * // Import shared utilities * import type { TPaginated, TApiError, TQuota } from '@conduction/nextcloud-vue/src/types' */ // Shared utility types export type { TPaginated, TEmptyPaginated, TQuota, TUsage, TEntityStats, TCrudAuthorization, TApiError, TObjectPath, } from './shared' // Core entity types export type { TObject } from './object' export type { TSchema, TSchemaConfiguration } from './schema' export type { TRegister } from './register' export type { TAuditTrail } from './auditTrail' export type { TSource } from './source' export type { TOrganisation, TOrganisationAuthorization } from './organisation' // Multi-tenancy types (multi-tenancy-context capability) export type { TenantContext, TenantSwitchEvent, TenantSwitchListener, TenantSwitchUnsubscribe, TenantSwitchBus, } from './tenant' // Sub-resource entity types export type { TFile } from './file' export type { TTask, TTaskPriority, TTaskStatus } from './task' export type { TNotification, TNotificationType, TNotificationPriority } from './notification' // Manifest types (json-manifest-renderer capability) export type { TManifest, TManifestMenuItem, TManifestMenuItemLeaf, TManifestPage, TPageType, } from './manifest' // Runtime exports from the store factory. The implementation is in // `../store/createCrudStore.js`; its companion `createCrudStore.d.ts` // provides full generic types (entity inference, feature-flag gating, // extend merging with correct `this` typing). We re-export both the // factory and its supporting types so consumers can `import type // { BaseState, MergedActions, Features } from '@conduction/nextcloud-vue'`. export { createCrudStore } from '../store/createCrudStore' export type { Prettify, EntityClass, InferEntity, Features, LoadingState, ViewModeState, LoadingGetters, ViewModeGetters, ViewModeActions, BaseState, BaseActions, MergedActions, FullState, FullGetters, StoreThis, ExtendConfig, CrudConfig, CrudPlugin, } from '../store/createCrudStore' // Runtime store plugins. Each plugin is a factory returning a plugin definition // consumed by `createCrudStore({ plugins: [...] })` or `createObjectStore`. export { logsPlugin } from '../store/plugins/logs' // AI Chat Companion types /** * Reactive context object injected by CnAppRoot and consumed by useAiContext(). * Page components (CnIndexPage, CnDetailPage, CnDashboardPage) overwrite fields * to give the AI Chat Companion per-page context. */ export interface CnAiContext { appId: string pageKind: 'index' | 'detail' | 'dashboard' | 'chat' | 'settings' | 'custom' objectUuid?: string registerSlug?: string schemaSlug?: string route?: { path: string; name?: string; params?: Record } } /** * Return type of useAiChatStream(). All state properties are reactive. */ export interface UseAiChatStreamReturn { state: { isStreaming: boolean currentText: string toolCalls: Array<{ toolId: string arguments: unknown result?: unknown isError?: boolean }> error: { code: string; message: string } | null messages: Array<{ role: 'user' | 'assistant' | 'system' content: string toolCalls?: unknown[] }> } send(content: string, options?: { newThread?: boolean }): Promise abort(): void startNewThread(): void loadConversation(uuid: string): Promise } /** Inject the reactive cnAiContext from the nearest CnAppRoot ancestor. */ export function useAiContext(instance?: object | null): CnAiContext /** Options for {@link useAiChatStream}. */ export interface UseAiChatStreamOptions { /** * Backend app id the chat/conversation URLs resolve against * (`/index.php/apps/{chatAppId}/api/...`). Defaults to * {@link DEFAULT_CHAT_APP_ID} (`hermiq`). */ chatAppId?: string } /** Create a streaming chat state + transport for the AI Chat Companion. */ export function useAiChatStream( contextInstance?: object | null, options?: UseAiChatStreamOptions, ): UseAiChatStreamReturn /** * Default chat/agent backend app id the AI Chat Companion targets. Single * configuration point for the chat backend — `openregister` today; the flip to * `hermiq` is a deferred coordinated change (hydra ADR-034 Amendment 2026-07-05). */ export const DEFAULT_CHAT_APP_ID: string /** Base API path for a chat backend app (`/index.php/apps/{appId}/api`). */ export function chatApiBase(appId?: string): string /** SSE streaming endpoint for a chat backend app (`POST`). */ export function chatStreamUrl(appId?: string): string /** Non-streaming fallback endpoint for a chat backend app (`POST`). */ export function chatSendUrl(appId?: string): string /** Health probe endpoint for a chat backend app (`GET`). */ export function chatHealthUrl(appId?: string): string /** Conversation list endpoint for a chat backend app (`GET`). */ export function conversationsUrl(appId?: string): string /** Messages of one conversation for a chat backend app (`GET`). */ export function conversationMessagesUrl(appId: string | undefined, conversationUuid: string): string