import { Event, ProcessEventResponse, ContextMemoriesRequest, EventContext, MemoryResponse, StrategyResponse, StrategySimilarityRequest, SimilarStrategyResponse, ActionSuggestionResponse, EpisodeResponse, StatsResponse, HealthResponse, AgentId, ContextHash, GraphQuery, GraphContextQuery, GraphResponse, AnalyticsResponse, ClaimSearchRequest, ClaimSearchResponse, ClaimResponse, GraphNodeQueryRequest, GraphNodeQueryResponse, GraphTraverseQuery, GraphTraverseResponse, SessionId, RecallContextResult, PerceiveActLearnOptions, PerceiveActLearnResult, SimpleEventRequest, SearchRequest, SearchResponse, CommunityDetectionResponse, CentralityResponse, PPRResponse, ReachabilityResponse, CausalPathResponse, IndexStatsResponse, GraphPersistResponse, PlanningStrategiesRequest, PlanningStrategiesResponse, PlanningActionsRequest, PlanningActionsResponse, PlanningPlanRequest, PlanningPlanResponse, PlanningExecuteRequest, PlanningExecuteResponse, PlanningValidateRequest, PlanningValidateResponse, WorldModelStatsResponse, AdminImportResponse, EmbeddingsProcessResponse, UInt64, LearningEvent, ClaimSearchOptions, NLQRequest, NLQResponse, NLQOptions, StructuredMemoryUpsertRequest, StructuredMemoryListResponse, StructuredMemoryGetResponse, StructuredMemoryDeleteResponse, LedgerAppendRequest, LedgerAppendResponse, LedgerBalanceResponse, StateTransitionRequest, StateTransitionResponse, StateCurrentResponse, PreferenceUpdateRequest, PreferenceUpdateResponse, TreeAddChildRequest, TreeAddChildResponse, StateChangeEventRequest, TransactionEventRequest, ConversationIngestRequest, ConversationIngestResponse, MessageRequest, MessageResponse, CodeFileEventRequest, CodeReviewEventRequest, CodeSearchRequest, CodeSearchResponse, MinnsQLResponse, SubscriptionCreateResponse, SubscriptionListResponse, SubscriptionPollResponse, SubscriptionDeleteResponse, TableCreateRequest, TableCreateResponse, TableSchema, TableDropResponse, TableRowInsertRequest, TableRowInsertResponse, TableRowUpdateRequest, TableRowUpdateResponse, TableRowDeleteResponse, TableRowScanQuery, TableRowScanResponse, TableCompactResponse, TableStatsResponse, WorkflowCreateRequest, WorkflowCreateResponse, WorkflowListResponse, WorkflowDetailResponse, WorkflowUpdateRequest, WorkflowUpdateResponse, WorkflowDeleteResponse, WorkflowStepTransitionRequest, WorkflowStepTransitionResponse, WorkflowFeedbackRequest, WorkflowFeedbackResponse, AgentRegisterRequest, AgentRegisterResponse, AgentListResponse, OntologyPropertiesResponse, OntologyUploadResponse, OntologyDiscoverResponse, OntologyCascadeInferenceResponse, OntologyObservationsResponse, OntologyProposalsResponse, OntologyProposal, OntologyProposalApproveResponse, OntologyProposalRejectResponse, OntologyStatsResponse, ModuleUploadRequest, ModuleUploadResponse, ModuleInfo, ModuleDetailResponse, ModuleDeleteResponse, ModuleCallResponse, ModuleUsageResponse, ModuleUsageResetResponse, ModuleSchedule, ModuleScheduleCreateRequest, ModuleScheduleCreateResponse, ModuleScheduleDeleteResponse, GraphImportRequest, GraphImportResponse, ApiKeyCreateRequest, ApiKeyCreateResponse, ApiKeyInfo, ApiKeyDeleteResponse } from "./types.js"; export * from "./types.js"; export * from "./intent_registry.js"; export * from "./intent_sidecar.js"; export interface MinnsClientConfig { apiKey: string; /** Base URL for the Minns API. Default: "https://api.minns.ai". */ baseUrl?: string; /** Default agent ID applied to all event builders. Can be overridden per-event. */ agentId?: AgentId; /** Default session ID applied to all event builders. Can be overridden per-event. */ sessionId?: SessionId; timeout?: number; headers?: Record; onTelemetry?: (data: TelemetryData) => void; enableDefaultTelemetry?: boolean; /** * If true, the SDK will log detailed request and response information to the console. * Useful for debugging during development. */ debug?: boolean; /** * Maximum payload size in bytes (checked after serialization). * Default: 1MB (1,048,576 bytes). */ maxPayloadSize?: number; /** * Maximum number of events allowed in the local queue. * When exceeded, `enqueue()` will throw a QueueFull error. * Default: 1000. */ maxQueueSize?: number; /** * If true, `processEvent()` will return immediately and process in the background. * Use this to make all event processing low-latency by default. */ defaultAsync?: boolean; /** * If true, events will be buffered and sent in batches. */ autoBatch?: boolean; /** * Maximum time (ms) to wait before flushing the batch queue. Default: 100ms. */ batchInterval?: number; /** * Maximum number of events to buffer before forcing a flush. Default: 10. */ batchMaxSize?: number; /** * If true, all events will have semantic indexing enabled by default. * Can be overridden per-event via EventBuilderConfig. */ enableSemantic?: boolean; } export interface TelemetryData { type: "request" | "error" | "intent_parse" | "background_process" | "batch_flush"; path?: string; method?: string; duration_ms?: number; statusCode?: number; error?: string; tokenCount?: number; metadata?: Record; agent_id?: AgentId; session_id?: SessionId; } export interface LocalAck { success: true; queued: boolean; eventId: string; } export interface EventBuilderConfig { agentId?: AgentId; sessionId?: SessionId; enableSemantic?: boolean; } export declare class EventBuilder { private client; private agentType; private config; private eventPayload?; private contextVariables; private goals; private _metadata; private _language; private _isCode; private causality; private retryMeta?; constructor(client: MinnsClient, agentType: string, config?: EventBuilderConfig); /** * Define an Action taken by the agent. */ action(name: string, params: Record): this; /** * Attach an outcome to the previously defined action. * Throws if no action has been defined yet. */ outcome(result: unknown): this; /** * Store retry metadata, injected into event.metadata during build(). */ retry(attempt: number, maxRetries: number): this; /** * Set action outcome to Failure. Requires action() first. */ failure(error: string, errorCode?: number): this; /** * Set action outcome to Partial. Requires action() first. */ partial(result: unknown, issues: string[]): this; /** * Define an Observation from the environment. */ observation(type: string, data: unknown, options?: { confidence?: number; source?: string; }): this; /** * Define a Communication event (message sent/received). */ communication(messageType: string, sender: number | string, recipient: number | string, content: unknown): this; /** * Define a Cognitive event (agent reasoning/planning). */ cognitive(processType: "GoalFormation" | "Planning" | "Reasoning" | "MemoryRetrieval" | "LearningUpdate", input: unknown, output: unknown, reasoningTrace?: string[]): this; /** * Define a Learning event (memory/strategy feedback loop). * * @example * ```ts * // Record that memories were retrieved * client.event("agent") * .learning({ MemoryRetrieved: { query_id: "q1", memory_ids: [1, 2] } }) * .send(); * * // Record action outcome * client.event("agent") * .learning({ Outcome: { query_id: "q1", success: true } }) * .send(); * ``` */ learning(learningEvent: LearningEvent): this; /** * Define a Context/Text event for claim extraction. */ context(text: string, type?: string): this; /** * Add environmental state (runtime variables). */ state(variables: Record): this; /** * Add a goal with a priority (1-5). */ goal(text: string, priority?: 1 | 2 | 3 | 4 | 5, progress?: number): this; /** * Link to a previous event (causality). */ causedBy(parentId: string): this; /** * Add a metadata key-value pair. The value is automatically wrapped in the * appropriate `MetadataValue` envelope (String, Integer, Float, Boolean, or Json). * * @example * ```ts * client.event("agent") * .action("search", { q: "test" }) * .metadata("source", "user_input") * .metadata("priority", 5) * .send(); * ``` */ meta(key: string, value: string | number | boolean | unknown): this; /** * Set action duration in milliseconds (converted to nanoseconds internally). * Requires `action()` to be called first. * * @example * ```ts * client.event("agent") * .action("api_call", { url: "/data" }) * .duration(150) * .outcome({ status: 200 }) * .send(); * ``` */ duration(ms: number): this; /** * Enable or disable semantic indexing for this event. */ semantic(enabled?: boolean): this; /** * Set the language for Context events. Defaults to "en". * Can be called before or after `.context()`. */ language(lang: string): this; /** * Mark this event as containing source code. Activates code tokenizer, * code BM25 indexing, and NLQ code routing. */ isCode(enabled?: boolean): this; /** * Build the final nested Event object. */ build(): Event; /** * Build and submit the event. * Waits for server response. */ send(): Promise; /** * Build and enqueue the event for background processing. * Returns a local acknowledgement receipt immediately. */ enqueue(): Promise; } export declare class MinnsClient { private baseUrl; private timeout; private headers; private onTelemetry?; private enableDefaultTelemetry; private maxPayloadSize; private maxQueueSize; private defaultAsync; private autoBatch; private batchInterval; private batchMaxSize; private debug; private enableSemantic; private defaultAgentId?; private defaultSessionId?; private eventBuffer; private flushTimer; constructor(config: MinnsClientConfig); /** * Create a new EventBuilder for fluent event construction. * * @example * ```ts * // With default agentId/sessionId set on client: * const client = createClient("key", { agentId: 1, sessionId: 42 }); * await client.event("agent").action("search", { q: "test" }).send(); * * // Override per-event: * await client.event("agent", { agentId: 99, sessionId: 7 }) * .action("search", { q: "test" }).send(); * ``` */ event(agentType: string, config?: EventBuilderConfig): EventBuilder; /** * Internal telemetry helper. */ private emitTelemetry; /** * Sends telemetry data to the /api/telemetry endpoint (Fire and Forget) */ private sendTelemetryToBackend; /** * Make HTTP request with error handling and payload size guarding. */ private request; /** * Process a new event through the Minns system. * * Behavior depends on client configuration: * - If `autoBatch` is on: Event is queued and a local receipt is returned. * - Else if `defaultAsync` or `options.forceAsync` is on: Request is fired in background and receipt is returned. * - Else: Waits for server response. * * @example * ```ts * const event = client.event("agent").action("search", { q: "test" }).build(); * const result = await client.processEvent(event, { enableSemantic: true }); * console.log(result.event_id, result.nodes_created); * ``` */ processEvent(event: Event, options?: { enableSemantic?: boolean; forceAsync?: boolean; }): Promise; /** * Batch process multiple events. Chunks large arrays into `batchMaxSize` requests. */ processEvents(events: Event[], options?: { enableSemantic?: boolean; forceAsync?: boolean; }): Promise; private createLocalAck; /** * Get memories for a specific agent, sorted by strength. */ getAgentMemories(agentId: AgentId, limit?: number): Promise; /** * Retrieve memories for a similar context with optional filters. */ getContextMemories(context: EventContext, request?: Omit): Promise; /** * Get strategies learned by a specific agent, sorted by quality score. */ getAgentStrategies(agentId: AgentId, limit?: number): Promise; /** * Find strategies similar to a signature (goal/tool/result/context). */ getSimilarStrategies(request: StrategySimilarityRequest): Promise; /** * Get action suggestions based on context (Policy Guide feature). */ getActionSuggestions(contextHash: ContextHash, lastActionNode?: number, limit?: number): Promise; /** * Get completed episodes detected by the system. */ getEpisodes(limit?: number): Promise; /** * Get system-wide statistics about Minns. */ getStats(): Promise; /** * Search claims extracted from events via semantic memory. * Accepts either the snake_case `ClaimSearchRequest` or camelCase `ClaimSearchOptions`. */ searchClaims(request: ClaimSearchRequest | ClaimSearchOptions): Promise; /** * Get graph analytics including learning metrics. */ getAnalytics(): Promise; /** * Get graph structure for visualization. */ getGraph(query?: GraphQuery): Promise; /** * Get context-anchored subgraph. */ getGraphByContext(query: GraphContextQuery): Promise; /** * Direct node search for hard facts (IDs, member numbers). */ queryGraphNodes(request: GraphNodeQueryRequest): Promise; /** * Traverse graph relationships from a starting node. */ traverseGraph(query: GraphTraverseQuery): Promise; /** * List recent events. */ getEvents(limit?: number): Promise; /** * Submit a simplified event (quick integration). * * @example * ```ts * await client.sendSimpleEvent({ * agent_id: 1, * agent_type: "assistant", * session_id: 42, * action: "respond", * data: { query: "hello", tokens: 150 }, * success: true, * }); * ``` */ sendSimpleEvent(request: SimpleEventRequest): Promise; /** * Submit a typed state-change event. The server maps fields into event metadata * and auto-updates structured memory state machines. * * @example * ```ts * await client.sendStateChangeEvent({ * agent_id: 1, * agent_type: "workflow-engine", * session_id: 42, * entity: "Order-123", * new_state: "shipped", * old_state: "processing", * trigger: "warehouse_confirmation", * }); * ``` */ sendStateChangeEvent(request: StateChangeEventRequest): Promise; /** * Submit a typed transaction event. The server maps fields into event metadata * and auto-appends to structured memory ledgers. * * @example * ```ts * await client.sendTransactionEvent({ * agent_id: 1, * agent_type: "payment-service", * session_id: 42, * from: "Alice", * to: "Bob", * amount: 25.0, * direction: "Credit", * description: "Payment for services", * }); * ``` */ sendTransactionEvent(request: TransactionEventRequest): Promise; /** * Unified search across the graph: Keyword (BM25), Semantic (embedding), or Hybrid. * * @example * ```ts * // Simple string shorthand (defaults to Hybrid mode): * const results = await client.search("memory consolidation"); * * // Full options: * const results = await client.search({ * query: "memory consolidation", * mode: "Semantic", * limit: 20, * fusion_strategy: "RRF" * }); * ``` */ search(query: string): Promise; search(request: SearchRequest): Promise; /** * Query the graph in plain English. * * The pipeline classifies intent, resolves entities, builds a graph query, * executes it, and returns a human-readable answer. * * Pass `sessionId` / `session_id` for conversational follow-ups (up to 5 exchanges). * * @example * ```ts * // Simple string shorthand: * const res = await client.query("What are the neighbors of Alice?"); * * // With pagination and session: * const res = await client.query({ * question: "What happened after the login event?", * limit: 20, * sessionId: "session-1", * }); * ``` */ query(question: string): Promise; query(request: NLQRequest | NLQOptions): Promise; /** @deprecated Use `query()` instead. */ nlq(question: string): Promise; nlq(request: NLQRequest | NLQOptions): Promise; /** * Upsert a structured memory template. * * @example * ```ts * await client.upsertStructuredMemory({ * key: "ledger:1:2", * template: { Ledger: { entries: [], balance: 0, provenance: "Manual" } }, * }); * ``` */ upsertStructuredMemory(request: StructuredMemoryUpsertRequest): Promise; /** * List structured memory keys, optionally filtered by prefix. */ listStructuredMemory(prefix?: string): Promise; /** * Get a structured memory by key. */ getStructuredMemory(key: string): Promise; /** * Delete a structured memory by key. */ deleteStructuredMemory(key: string): Promise; /** * Append a ledger entry. Balance is recomputed on every append. * * @example * ```ts * const { balance } = await client.appendLedgerEntry("ledger:1:2", { * amount: 25.0, * description: "Payment for services", * direction: "Credit", * }); * ``` */ appendLedgerEntry(key: string, entry: LedgerAppendRequest): Promise; /** * Get the current balance of a ledger. */ getLedgerBalance(key: string): Promise; /** * Transition a state machine to a new state. * * @example * ```ts * await client.transitionState("state:42", { * new_state: "active", * trigger: "user_login", * }); * ``` */ transitionState(key: string, request: StateTransitionRequest): Promise; /** * Get the current state of a state machine. */ getCurrentState(key: string): Promise; /** * Update or insert a preference ranking. */ updatePreference(key: string, request: PreferenceUpdateRequest): Promise; /** * Add a child node to a tree structure. */ addTreeChild(key: string, request: TreeAddChildRequest): Promise; /** * Ingest multi-session conversations into the graph via the unified event pipeline. * Each message is converted to a Conversation event and processed through the full * pipeline (graph construction, episode detection, memory formation). An inline LLM * compaction step extracts structured facts (locations, relationships, preferences, * financial transactions) and writes them as graph edges. * * Requires a configured LLM client server-side. Idempotent per `case_id` — re-ingesting * the same (case_id, session_id, message_index) tuple is a no-op. Use the same `case_id` * across calls for incremental ingestion with stable entity resolution. * * @example * ```ts * const result = await client.ingestConversations({ * case_id: "trip_expenses_2024", * sessions: [{ * session_id: "session_01", * topic: "Dinner expenses", * messages: [ * { role: "user", content: "Alice: Paid €179 for museum - split with Bob" }, * { role: "user", content: "Bob: Paid €107 for dinner - split among all" }, * ], * }], * }); * console.log(result.events_submitted, result.compaction.facts_extracted); * ``` */ ingestConversations(request: ConversationIngestRequest): Promise; /** * Send a single conversation message for real-time/streaming ingestion. * The message is processed through the event pipeline immediately, then * buffered for deferred LLM compaction. Compaction triggers automatically * when the buffer reaches `compaction_buffer_size` (default 6) or the * buffer age exceeds `compaction_buffer_timeout_secs` (default 30s). * * Use the same `case_id` across calls for stable entity resolution. * * @example * ```ts * const res = await client.sendMessage({ * role: "user", * content: "Alice: Paid €50 for lunch - split with Bob", * case_id: "trip_expenses_2024", * session_id: "session_01", * }); * // res.buffered — true if compaction is still pending * // res.compaction — non-null when compaction was triggered * ``` */ sendMessage(request: MessageRequest): Promise; /** * List active claims, optionally filtered by source event. */ getClaims(options?: { limit?: number; event_id?: UInt64; /** @deprecated Use eventId */ eventId?: UInt64; }): Promise; /** * Get a single claim by ID. */ getClaimById(id: UInt64): Promise; /** * Process pending claims to generate embeddings. */ processEmbeddings(limit?: number): Promise; /** * Submit a source file for AST analysis and graph ingestion. * * @example * ```ts * await client.sendCodeFileEvent({ * agent_id: 1, * agent_type: "code-indexer", * session_id: 42, * file_path: "src/auth/login.rs", * content: "pub fn authenticate(user: &str) -> Result { ... }", * language: "rust", * enable_ast: true, * enable_semantic: true, * }); * ``` */ sendCodeFileEvent(request: CodeFileEventRequest): Promise; /** * Submit a code review comment, approval, or change request. * * @example * ```ts * await client.sendCodeReviewEvent({ * agent_id: 1, * agent_type: "code-reviewer", * session_id: 42, * review_id: "PR-123-review-1", * action: "comment", * body: "This function should handle the null case.", * repository: "my-app", * enable_semantic: true, * }); * ``` */ sendCodeReviewEvent(request: CodeReviewEventRequest): Promise; /** * Search for code entities in the graph by name, kind, language, or file path. * * @example * ```ts * const results = await client.searchCode({ name_pattern: "authenticate", kind: "function" }); * console.log(results.entities); * ``` */ searchCode(request?: CodeSearchRequest): Promise; /** * Detect communities in the graph. * @param algorithm "louvain" or "label_propagation" */ getCommunities(algorithm?: string): Promise; /** * Get node centrality scores sorted by combined score. * @param limit Maximum number of results to return. */ getCentrality(limit?: number): Promise; /** * Personalized PageRank from a source node. */ getPersonalizedPageRank(sourceNodeId: number, options?: { limit?: number; min_score?: number; /** @deprecated Use minScore */ minScore?: number; }): Promise; /** * Temporal reachability: which nodes can be reached from source following edges forward in time. */ getReachability(source: number, options?: { max_hops?: number; max_results?: number; maxHops?: number; maxResults?: number; }): Promise; /** * Find the causal path between two nodes via temporal predecessor chain. */ getCausalPath(source: number, target: number): Promise; /** * Get property index performance statistics. */ getIndexStats(): Promise; /** * Force flush in-memory graph state to disk (ReDB). */ persistGraph(): Promise; /** * Bulk import nodes and edges directly into the graph. * Nodes are deduplicated by name. Edges can include temporal validity. * * @example * ```ts * await client.importGraph({ * nodes: [ * { name: "Nike", type: "concept", properties: { concept_type: "brand" } }, * { name: "Just Do It", type: "concept", properties: { concept_type: "campaign" } }, * ], * edges: [ * { source: "Nike", target: "Just Do It", type: "association", label: "runs_campaign" }, * ], * }); * ``` */ importGraph(request: GraphImportRequest): Promise; /** * Generate strategy candidates for a goal using LLM + world model scoring. */ generateStrategies(request: PlanningStrategiesRequest): Promise; /** * Generate action candidates for a specific strategy step. */ generateActions(request: PlanningActionsRequest): Promise; /** * Full planning pipeline: generates both strategies and actions for a goal. */ createPlan(request: PlanningPlanRequest): Promise; /** * Shorthand for `createPlan()` — pass just a goal description and the client * fills in sensible defaults. Requires `agentId` and `sessionId` to be set * on the client config. * * @example * ```ts * const plan = await client.plan("Reduce API latency by 50%"); * ``` */ plan(goalDescription: string): Promise; /** * Start execution tracking for a strategy (enables predictive validation). */ startExecution(request: PlanningExecuteRequest): Promise; /** * Validate an event against predicted world state. */ validateEvent(request: PlanningValidateRequest): Promise; /** * Get world model statistics. */ getWorldModelStats(): Promise; /** * Export entire database as binary. */ exportDatabase(): Promise; /** * Import database from binary data. * @param data Binary export data * @param mode "replace" (wipe and import) or "merge" (upsert). Default: "replace". */ importDatabase(data: ArrayBuffer | Uint8Array, mode?: "replace" | "merge"): Promise; /** * Fire getAgentStrategies, getContextMemories, and searchClaims in parallel. * Each call is wrapped in .catch(() => []) so partial failures don't block. * * @example * ```ts * const recall = await client.recallContext({ * agentId: 1, * context: eventContext, * claimsQuery: "customer refund policy", * memoryLimit: 5, * strategyLimit: 3, * }); * console.log(recall.strategies, recall.memories, recall.claims); * ``` */ recallContext(opts: { agentId: AgentId; context: EventContext; claimsQuery?: string; memoryLimit?: number; strategyLimit?: number; }): Promise; /** * Full Perceive-Act-Learn cycle: * 1. RECALL: parallel context retrieval * 2. PERCEIVE: extractIntentAndResponse (with perception + outcome_capture) * 3. RECORD: emit Observation (if perception), Action (with outcome/failure + retry), Learning Outcome * Returns all event IDs, recall data, and parsed intent. */ perceiveActLearn(agentType: string, agentId: AgentId, sessionId: SessionId, opts: PerceiveActLearnOptions): Promise; /** * Health check endpoint to verify system status. */ healthCheck(): Promise; /** * Execute a MinnsQL structured query (Cypher-inspired with temporal semantics). * * @example * ```ts * const result = await client.executeQuery( * 'MATCH (a:Person)-[r:location]->(b) RETURN a.name, b.name' * ); * console.log(result.columns, result.rows); * ``` */ executeQuery(query: string, groupId?: string): Promise; /** * Create a reactive subscription for a MinnsQL query. * Returns the initial result set and receives incremental updates as the graph changes. */ createSubscription(query: string, groupId?: string): Promise; /** * List all active subscriptions. */ listSubscriptions(): Promise; /** * Poll for pending updates on a subscription since the last poll. */ pollSubscription(subscriptionId: string | number): Promise; /** * Unsubscribe and release all operator state for a subscription. */ deleteSubscription(subscriptionId: string | number): Promise; /** * Create a new temporal table. * * @example * ```ts * await client.createTable({ * name: "orders", * columns: [ * { name: "id", col_type: "Int64", primary_key: true, nullable: false }, * { name: "customer", col_type: "String", nullable: false }, * { name: "amount", col_type: "Float64" }, * { name: "status", col_type: "String" }, * ], * }); * * // Or use MinnsQL: * await client.executeQuery( * 'CREATE TABLE orders (id Int64 PRIMARY KEY, customer String NOT NULL, amount Float64, status String)' * ); * ``` */ createTable(request: TableCreateRequest): Promise; /** * List all tables. */ listTables(): Promise; /** * Get the schema of a table. */ getTableSchema(name: string): Promise; /** * Drop a table. */ dropTable(name: string): Promise; /** * Insert one or more rows into a table. * * @example * ```ts * // Single row * await client.insertRows("orders", { values: [1, "Alice", 99.99] }); * * // Batch * await client.insertRows("orders", [ * { values: [1, "Alice", 99.99] }, * { values: [2, "Bob", 50.00] }, * ]); * ``` */ insertRows(table: string, rows: TableRowInsertRequest | TableRowInsertRequest[]): Promise; /** * Update a row by ID (creates a new version). */ updateRow(table: string, rowId: number, request: TableRowUpdateRequest): Promise; /** * Soft-delete a row by ID. */ deleteRow(table: string, rowId: number): Promise; /** * Scan rows from a table with temporal filtering. */ scanRows(table: string, query?: TableRowScanQuery): Promise; /** * Get rows referencing a graph node via NodeRef column. */ getRowsByNode(table: string, nodeId: number, groupId?: number): Promise; /** * Trigger compaction on a table to reclaim space from old versions. */ compactTable(table: string): Promise; /** * Get statistics for a table. */ getTableStats(table: string): Promise; /** * Create a new multi-step workflow. */ createWorkflow(request: WorkflowCreateRequest): Promise; /** * List workflows, optionally filtered by group. */ listWorkflows(options?: { group_id?: string; limit?: number; }): Promise; /** * Get full workflow details including steps. */ getWorkflow(workflowId: string | number): Promise; /** * Update a workflow. Supersedes old step nodes/edges and creates new ones. */ updateWorkflow(workflowId: string | number, request: WorkflowUpdateRequest): Promise; /** * Soft-delete a workflow. */ deleteWorkflow(workflowId: string | number): Promise; /** * Transition a workflow step to a new state. */ transitionWorkflowStep(workflowId: string | number, stepId: string, request: WorkflowStepTransitionRequest): Promise; /** * Attach outcome feedback to a workflow. */ addWorkflowFeedback(workflowId: string | number, request: WorkflowFeedbackRequest): Promise; /** * Register an agent with its capabilities. */ registerAgent(request: AgentRegisterRequest): Promise; /** * List registered agents for a group. */ listAgents(groupId: string): Promise; /** * List all registered ontology properties. */ getOntologyProperties(): Promise; /** * Upload a Turtle (TTL) ontology definition. * * @example * ```ts * await client.uploadOntology(` * @prefix ex: . * ex:knows a owl:ObjectProperty ; * rdfs:domain ex:Person ; * rdfs:range ex:Person . * `); * ``` */ uploadOntology(ttl: string): Promise; /** * Run automatic ontology discovery from graph patterns. */ discoverOntology(): Promise; /** * Run cascade dependency inference only. */ inferOntologyCascades(): Promise; /** * List observed predicates and usage statistics from the graph. */ getOntologyObservations(): Promise; /** * List ontology evolution proposals. */ getOntologyProposals(): Promise; /** * Get a specific ontology proposal. */ getOntologyProposal(proposalId: string | number): Promise; /** * Approve an ontology proposal and apply it to the registry. */ approveOntologyProposal(proposalId: string | number): Promise; /** * Reject an ontology proposal. */ rejectOntologyProposal(proposalId: string | number): Promise; /** * Get ontology evolution statistics. */ getOntologyStats(): Promise; /** * Upload a WASM agent module. */ uploadModule(request: ModuleUploadRequest): Promise; /** * List all WASM modules. */ listModules(): Promise; /** * Get detailed info about a WASM module. */ getModule(name: string): Promise; /** * Unload a WASM module. */ deleteModule(name: string): Promise; /** * Call a function on a WASM module. * * @example * ```ts * const result = await client.callModuleFunction("order-processor", "process_order", argsBase64); * ``` */ callModuleFunction(moduleName: string, functionName: string, argsBase64?: string): Promise; /** * Enable a WASM module. */ enableModule(name: string): Promise; /** * Disable a WASM module. */ disableModule(name: string): Promise; /** * Get usage statistics for a WASM module. */ getModuleUsage(name: string): Promise; /** * Reset usage counters for a WASM module (billing period reset). */ resetModuleUsage(name: string): Promise; /** * List schedules for a WASM module. */ listModuleSchedules(name: string): Promise; /** * Create a cron schedule for a WASM module function. */ createModuleSchedule(moduleName: string, request: ModuleScheduleCreateRequest): Promise; /** * Delete a schedule for a WASM module. */ deleteModuleSchedule(moduleName: string, scheduleId: number): Promise; /** * Create a new API key (admin). */ createApiKey(request: ApiKeyCreateRequest): Promise; /** * List all API keys. */ listApiKeys(): Promise; /** * Delete an API key by name. */ deleteApiKey(name: string): Promise; /** * Flushes the local event buffer. */ flush(options?: { enableSemantic?: boolean; }): Promise; /** * Flush pending events and release the batch timer. * Call this before discarding the client to prevent timer leaks. */ destroy(): Promise; /** Alias for {@link destroy}. */ close(): Promise; private flushEvents; } export declare class MinnsError extends Error { readonly statusCode: number; readonly details?: string; constructor(message: string, statusCode: number, details?: string); } /** * Create an Minns client. * * @example * ```ts * // Minimal: * const client = createClient("your-api-key"); * * // With default agent/session (recommended): * const client = createClient("your-api-key", { agentId: 1, sessionId: 42 }); * await client.event("assistant").action("greet", {}).send(); * ``` */ export declare function createClient(apiKey: string, defaults?: { agentId?: AgentId; sessionId?: SessionId; }): MinnsClient; /** @deprecated Use `MinnsClient` instead. */ export declare const EventGraphDBClient: typeof MinnsClient; /** @deprecated Use `MinnsClientConfig` instead. */ export type EventGraphDBClientConfig = MinnsClientConfig; /** @deprecated Use `MinnsError` instead. */ export declare const EventGraphDBError: typeof MinnsError; export default MinnsClient;