import { ContextProvider } from '@agentxjs/core/context'; import { AgentOS, FileSystem, Shell, Environment, OSProvider } from '@agentxjs/core/os'; import { AgentXPlatform } from '@agentxjs/core/runtime'; import { LoggerFactory, LogLevel, Logger } from 'commonxjs/logger'; export { OffsetGenerator, SqliteMessageQueue } from './mq/index.js'; export { W as WebSocketConnection, a as WebSocketServer } from './WebSocketServer-CbjDC1lS.js'; export { Persistence, PersistenceDriver, SqliteDriverOptions, StorageContainerRepository, StorageImageRepository, StorageLLMProviderRepository, StoragePrototypeRepository, StorageSessionRepository, createPersistence, memoryDriver, sqliteDriver } from './persistence/index.js'; import '@agentxjs/core/mq'; import '@agentxjs/core/network'; import 'ws'; import '@agentxjs/core/persistence'; import 'unstorage'; import '@agentxjs/core/agent'; /** * FileLoggerFactory - File-based logger for Node.js * * Writes logs to a file instead of console. * Useful for TUI applications where console output interferes with the UI. * * Usage: * tail -f .agentx/logs/app.log */ /** * FileLoggerFactory options */ interface FileLoggerFactoryOptions { /** * Directory for log files */ logDir: string; /** * Log level * @default "debug" */ level?: LogLevel; /** * Log file name * @default "app.log" */ filename?: string; } /** * FileLoggerFactory - Creates FileLogger instances */ declare class FileLoggerFactory implements LoggerFactory { private readonly filePath; private readonly level; private readonly loggers; constructor(options: FileLoggerFactoryOptions); getLogger(name: string): Logger; } /** * LocalOS — Node.js implementation of AgentOS * * fs and sh share the same root directory. * fs uses node:fs/promises, sh uses execa. */ /** * LocalOS — AgentOS backed by local Node.js filesystem and child_process. * * fs and sh share the same root directory — write a file, run it immediately. */ declare class LocalOS implements AgentOS { readonly fs: FileSystem; readonly sh: Shell; readonly env: Environment; constructor(root: string); /** * Watch for file system changes (optional capability). * Not part of AgentOS interface — platform-specific. */ watch(handler: (event: { type: string; path: string; }) => void): () => void; } /** * LocalOSProvider — Creates LocalOS instances by ID. * * Maps osId to a subdirectory under the base path. * Each agent gets its own isolated OS environment. */ declare class LocalOSProvider implements OSProvider { private readonly basePath; constructor(basePath: string); create(osId: string): Promise; } /** * @agentxjs/node-platform * * Node.js platform for AgentX. * Provides implementations for persistence, bash, and network. * * @example * ```typescript * import { createNodePlatform } from "@agentxjs/node-platform"; * * const platform = await createNodePlatform({ dataPath: "./data" }); * ``` */ /** * Options for creating a Node platform */ interface NodePlatformOptions { /** * Base path for AgentX data storage * @default "~/.deepractice/agentx" */ dataPath?: string; /** * Directory for log files * If provided, enables file logging instead of console * @example ".agentx/logs" */ logDir?: string; /** * Log level * @default "debug" for file logging, "info" for console */ logLevel?: LogLevel; /** * Context provider — inject cognitive context (e.g. RoleX). * If not provided, agents run without cognitive context. */ contextProvider?: ContextProvider; /** * OS provider for unified file system + shell. * If provided, OS tools (read/write/edit/sh/start) are injected into agents. * Each Image gets its own isolated OS environment. * @default auto-created under dataPath/workspaces when not specified */ osProvider?: OSProvider; /** * Container ID — product-level isolation boundary. * @default "default" */ containerId?: string; } /** * Deferred platform config - resolved lazily */ interface DeferredPlatformConfig { readonly __deferred: true; readonly options: NodePlatformOptions; resolve(): Promise; } /** * Create a Node.js platform configuration (deferred initialization) * * Use this for function-style API. The platform is initialized lazily. * * @param options - Platform options * @returns Deferred platform config * * @example * ```typescript * const server = await createServer({ * platform: nodePlatform({ dataPath: "./data" }), * }); * ``` */ declare function nodePlatform(options?: NodePlatformOptions): DeferredPlatformConfig; /** * Create a Node.js platform for AgentX (immediate initialization) * * @param options - Platform options * @returns AgentXPlatform instance */ declare function createNodePlatform(options?: NodePlatformOptions): Promise; /** * Check if value is a deferred platform config */ declare function isDeferredPlatform(value: unknown): value is DeferredPlatformConfig; export { type DeferredPlatformConfig, FileLoggerFactory, type FileLoggerFactoryOptions, LocalOS, LocalOSProvider, type NodePlatformOptions, createNodePlatform, isDeferredPlatform, nodePlatform };