import type { KnowledgeGraphScopeGrant, KnowledgePageGraph, KnowledgePageView, KnowledgeTreeChildren } from '@mastra/core/knowledge'; import type { KnowledgePageActivityEvent, KnowledgePageSearchHit } from '@mastra/core/storage'; import type { ClientOptions, Serialized } from '../types.js'; import { BaseResource } from './base.js'; export type KnowledgeTreeResponse = Serialized; export type KnowledgePageResponse = Serialized; export type KnowledgeGraphResponse = Serialized & { /** Declared access grants onto the scopes shown; absent from servers on an older core. */ grants?: Array; }; /** How many other pages link to each page (`in`) and each page links to (`out`), by `[[ref]]` or note mention. */ export interface KnowledgeLinkCountsResponse { counts: Record; } export interface KnowledgePageLinksResponse { edges: Array<{ fromPageId: string; toPageId: string; kind: 'body' | 'note'; count: number; }>; /** The readable pages at the other ends of `edges`. */ pages: Serialized[]; truncated: boolean; } export interface KnowledgeSearchResponse { results: Serialized[]; } export interface KnowledgeActivityResponse { events: Serialized[]; nextCursor?: string; } /** One committed write the caller can read. Ids they can't read are left out; re-read what changed. */ export interface KnowledgeChangeNotice { kind: 'scope' | 'page' | 'note' | 'pin'; op: string; pageId?: string; scopeId?: string; at: string; } export interface KnowledgeInstanceSummary { key: string; id: string; } /** * Read-only access to one Knowledge instance registered on the server. Reads return every page and note, * as the instance owner; the server's auth decides who may call them. * * @experimental Knowledge APIs are experimental and may change without notice. */ export declare class Knowledge extends BaseResource { private knowledgeKey; constructor(options: ClientOptions, knowledgeKey: string); private get base(); /** One level of the page tree: the root scopes, or `parentId`'s child scopes then its child pages (paged). */ tree(params?: { parentId?: string; cursor?: string; limit?: number; }): Promise; /** One page with its ancestors, notes, pin and references; rejects with 404 when it does not exist. */ page(pageId: string, params?: { noteCursor?: string; noteLimit?: number; }): Promise; /** A bounded page graph under `rootId`, or across every root scope. */ graph(params?: { rootId?: string; maxPages?: number; }): Promise; /** Exact link counts for up to 200 pages, over the whole store. Rejects with 501 where there is no link index. */ linkCounts(pageIds: string[]): Promise; /** One page's links, bounded, with the pages at their other ends. Rejects with 501 where there is no link index. */ pageLinks(pageId: string, params?: { direction?: 'in' | 'out' | 'both'; }): Promise; /** Pages and notes matching `searchQuery`, optionally only within the given scope page ids. */ search(searchQuery: string, params?: { scopeIds?: string[]; limit?: number; }): Promise; /** A newest-first page of activity, optionally for one scope or one page. */ activity(params?: { scopeId?: string; pageId?: string; cursor?: string; limit?: number; }): Promise; /** * A live stream of the writes the caller can read, from when it opens until `signal` aborts. Rejects * when the server can't stream them (for example 501 on an older @mastra/core). */ events(params?: { signal?: AbortSignal; }): Promise>; } //# sourceMappingURL=knowledge.d.ts.map