@axiom-lattice/core 2.1.14 → 2.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -5,7 +5,7 @@ import { BaseChatModel, BaseChatModelCallOptions } from '@langchain/core/languag
5
5
  import { BaseLanguageModelInput } from '@langchain/core/language_models/base';
6
6
  import { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
7
7
  import { ChatResult } from '@langchain/core/outputs';
8
- import { LLMConfig, ToolConfig, ToolExecutor, AgentConfig, GraphBuildOptions, MessageChunk, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult, ScheduleLatticeProtocol, ScheduleConfig, ScheduleClient, ScheduleStorage, TaskHandler, ScheduleOnceOptions, ScheduleCronOptions, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, ThreadStore, AssistantStore, Thread, CreateThreadRequest, Assistant, CreateAssistantRequest } from '@axiom-lattice/protocols';
8
+ import { LLMConfig, ToolConfig, ToolExecutor, AgentConfig, GraphBuildOptions, MessageChunk, QueueLatticeProtocol, QueueConfig, QueueClient, QueueResult, ScheduleLatticeProtocol, ScheduleConfig, ScheduleClient, ScheduleStorage, TaskHandler, ScheduleOnceOptions, ScheduleCronOptions, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, ThreadStore, AssistantStore, SkillStore, Thread, CreateThreadRequest, Assistant, CreateAssistantRequest, Skill, CreateSkillRequest, LoggerLatticeProtocol, LoggerConfig, LoggerClient, LoggerContext, SkillConfig, SkillClient } from '@axiom-lattice/protocols';
9
9
  import * as protocols from '@axiom-lattice/protocols';
10
10
  export { protocols as Protocols };
11
11
  export { AgentConfig, AgentType, GraphBuildOptions, MemoryType } from '@axiom-lattice/protocols';
@@ -1179,6 +1179,7 @@ declare function describeCronExpression(expression: string): string;
1179
1179
  type StoreTypeMap = {
1180
1180
  thread: ThreadStore;
1181
1181
  assistant: AssistantStore;
1182
+ skill: SkillStore;
1182
1183
  };
1183
1184
  /**
1184
1185
  * Store type keys
@@ -1361,6 +1362,99 @@ declare class InMemoryAssistantStore implements AssistantStore {
1361
1362
  clear(): void;
1362
1363
  }
1363
1364
 
1365
+ /**
1366
+ * FileSystemSkillStore
1367
+ *
1368
+ * Filesystem-based implementation of SkillStore
1369
+ * Stores each skill as a Markdown file with YAML frontmatter
1370
+ */
1371
+
1372
+ /**
1373
+ * FileSystemSkillStore options
1374
+ */
1375
+ interface FileSystemSkillStoreOptions {
1376
+ /**
1377
+ * Root directory path for storing skills
1378
+ * Can be absolute or relative path (relative to current working directory)
1379
+ * @default "lattice_store/skills"
1380
+ */
1381
+ rootDir?: string;
1382
+ }
1383
+ /**
1384
+ * Filesystem-based implementation of SkillStore
1385
+ */
1386
+ declare class FileSystemSkillStore implements SkillStore {
1387
+ private rootDir;
1388
+ constructor(options?: FileSystemSkillStoreOptions);
1389
+ /**
1390
+ * Ensure the root directory exists
1391
+ */
1392
+ private ensureDirectoryExists;
1393
+ /**
1394
+ * Get directory path for a skill name
1395
+ * Name is used as the directory name, and SKILL.md is the fixed filename
1396
+ */
1397
+ private getSkillDirectoryPath;
1398
+ /**
1399
+ * Get file path for a skill name
1400
+ * File is always named SKILL.md inside the name directory
1401
+ */
1402
+ private getSkillFilePath;
1403
+ /**
1404
+ * Read skill from file
1405
+ * Uses name as the directory name and reads SKILL.md from it
1406
+ */
1407
+ private readSkillFile;
1408
+ /**
1409
+ * Write skill to file
1410
+ * Creates directory with name and writes SKILL.md inside it
1411
+ */
1412
+ private writeSkillFile;
1413
+ /**
1414
+ * Get all skills
1415
+ */
1416
+ getAllSkills(): Promise<Skill[]>;
1417
+ /**
1418
+ * Get skill by ID
1419
+ * ID should equal name (name is used for path addressing)
1420
+ */
1421
+ getSkillById(id: string): Promise<Skill | null>;
1422
+ /**
1423
+ * Create a new skill
1424
+ * id should equal name (name is used for path addressing)
1425
+ */
1426
+ createSkill(id: string, data: CreateSkillRequest): Promise<Skill>;
1427
+ /**
1428
+ * Update an existing skill
1429
+ */
1430
+ updateSkill(id: string, updates: Partial<CreateSkillRequest>): Promise<Skill | null>;
1431
+ /**
1432
+ * Delete a skill by ID
1433
+ * Deletes the entire directory (name is the directory name)
1434
+ */
1435
+ deleteSkill(id: string): Promise<boolean>;
1436
+ /**
1437
+ * Check if skill exists
1438
+ */
1439
+ hasSkill(id: string): Promise<boolean>;
1440
+ /**
1441
+ * Search skills by metadata
1442
+ */
1443
+ searchByMetadata(metadataKey: string, metadataValue: string): Promise<Skill[]>;
1444
+ /**
1445
+ * Filter skills by compatibility
1446
+ */
1447
+ filterByCompatibility(compatibility: string): Promise<Skill[]>;
1448
+ /**
1449
+ * Filter skills by license
1450
+ */
1451
+ filterByLicense(license: string): Promise<Skill[]>;
1452
+ /**
1453
+ * Get sub-skills of a parent skill
1454
+ */
1455
+ getSubSkills(parentSkillName: string): Promise<Skill[]>;
1456
+ }
1457
+
1364
1458
  /**
1365
1459
  * Embeddings Lattice Interface
1366
1460
  * Defines the structure of an embeddings lattice entry
@@ -1501,6 +1595,287 @@ declare const registerVectorStoreLattice: (key: string, vectorStore: VectorStore
1501
1595
  declare const getVectorStoreLattice: (key: string) => VectorStoreLatticeInterface;
1502
1596
  declare const getVectorStoreClient: (key: string) => VectorStore;
1503
1597
 
1598
+ /**
1599
+ * LoggerLatticeManager
1600
+ *
1601
+ * Logger Lattice manager for registering and managing logger services
1602
+ */
1603
+
1604
+ /**
1605
+ * Logger Lattice interface
1606
+ */
1607
+ interface LoggerLattice extends LoggerLatticeProtocol {
1608
+ key: string;
1609
+ config: LoggerConfig;
1610
+ client: LoggerLatticeProtocol["client"];
1611
+ }
1612
+ /**
1613
+ * LoggerLatticeManager - Singleton logger Lattice manager
1614
+ * Responsible for registering and managing various logger service Lattices
1615
+ */
1616
+ declare class LoggerLatticeManager extends BaseLatticeManager<LoggerLattice> {
1617
+ private static _instance;
1618
+ /**
1619
+ * Get LoggerLatticeManager singleton instance
1620
+ */
1621
+ static getInstance(): LoggerLatticeManager;
1622
+ /**
1623
+ * Get Lattice type prefix
1624
+ */
1625
+ protected getLatticeType(): string;
1626
+ /**
1627
+ * Register logger Lattice
1628
+ * @param key Lattice key name
1629
+ * @param config Logger configuration
1630
+ * @param client Optional logger client. If not provided, will create based on config type.
1631
+ */
1632
+ registerLattice(key: string, config: LoggerConfig, client?: LoggerClient): void;
1633
+ /**
1634
+ * Get LoggerLattice
1635
+ * @param key Lattice key name
1636
+ */
1637
+ getLoggerLattice(key: string): LoggerLattice;
1638
+ /**
1639
+ * Get all Lattices
1640
+ */
1641
+ getAllLattices(): LoggerLattice[];
1642
+ /**
1643
+ * Check if Lattice exists
1644
+ * @param key Lattice key name
1645
+ */
1646
+ hasLattice(key: string): boolean;
1647
+ /**
1648
+ * Remove Lattice
1649
+ * @param key Lattice key name
1650
+ */
1651
+ removeLattice(key: string): boolean;
1652
+ /**
1653
+ * Clear all Lattices
1654
+ */
1655
+ clearLattices(): void;
1656
+ /**
1657
+ * Get Lattice count
1658
+ */
1659
+ getLatticeCount(): number;
1660
+ /**
1661
+ * Get Lattice key list
1662
+ */
1663
+ getLatticeKeys(): string[];
1664
+ }
1665
+ declare const loggerLatticeManager: LoggerLatticeManager;
1666
+ declare const registerLoggerLattice: (key: string, config: LoggerConfig, client?: LoggerClient) => void;
1667
+ declare const getLoggerLattice: (key: string) => LoggerLattice;
1668
+
1669
+ /**
1670
+ * PinoLoggerClient
1671
+ *
1672
+ * Pino-based logger client implementation
1673
+ */
1674
+
1675
+ /**
1676
+ * Pino-based logger client implementation
1677
+ * Supports custom file paths and pino configurations
1678
+ */
1679
+ declare class PinoLoggerClient implements LoggerClient {
1680
+ private pinoLogger;
1681
+ private config;
1682
+ private context;
1683
+ constructor(config: LoggerConfig);
1684
+ /**
1685
+ * Determine if file logging should be used
1686
+ */
1687
+ private shouldUseFileLogging;
1688
+ /**
1689
+ * Get file options from config
1690
+ */
1691
+ private getFileOptions;
1692
+ /**
1693
+ * Get contextual logger with merged context
1694
+ */
1695
+ private getContextualLogger;
1696
+ info(msg: string, obj?: object): void;
1697
+ error(msg: string, obj?: object | Error): void;
1698
+ warn(msg: string, obj?: object): void;
1699
+ debug(msg: string, obj?: object): void;
1700
+ updateContext(context: Partial<LoggerContext>): void;
1701
+ child(options: Partial<LoggerConfig>): LoggerClient;
1702
+ }
1703
+
1704
+ /**
1705
+ * ConsoleLoggerClient
1706
+ *
1707
+ * Simple console-based logger client implementation
1708
+ */
1709
+
1710
+ /**
1711
+ * Console-based logger client implementation
1712
+ */
1713
+ declare class ConsoleLoggerClient implements LoggerClient {
1714
+ private config;
1715
+ private context;
1716
+ constructor(config: LoggerConfig);
1717
+ private formatMessage;
1718
+ info(msg: string, obj?: object): void;
1719
+ error(msg: string, obj?: object | Error): void;
1720
+ warn(msg: string, obj?: object): void;
1721
+ debug(msg: string, obj?: object): void;
1722
+ updateContext(context: Partial<LoggerContext>): void;
1723
+ child(options: Partial<LoggerConfig>): LoggerClient;
1724
+ }
1725
+
1726
+ /**
1727
+ * SkillLatticeManager
1728
+ *
1729
+ * Skill Lattice manager for registering and managing skill components
1730
+ */
1731
+
1732
+ /**
1733
+ * Skill Lattice interface
1734
+ */
1735
+ interface SkillLattice {
1736
+ key: string;
1737
+ config: SkillConfig;
1738
+ client: SkillClient | null;
1739
+ }
1740
+ /**
1741
+ * SkillLatticeManager - Singleton skill Lattice manager
1742
+ * Responsible for registering and managing various skill Lattices
1743
+ */
1744
+ declare class SkillLatticeManager extends BaseLatticeManager<SkillLattice> {
1745
+ private static _instance;
1746
+ private storeKey?;
1747
+ /**
1748
+ * Get SkillLatticeManager singleton instance
1749
+ */
1750
+ static getInstance(): SkillLatticeManager;
1751
+ /**
1752
+ * Get Lattice type prefix
1753
+ */
1754
+ protected getLatticeType(): string;
1755
+ /**
1756
+ * Configure store for persistence
1757
+ * @param storeKey Store key name registered in StoreLatticeManager
1758
+ */
1759
+ configureStore(storeKey: string): void;
1760
+ /**
1761
+ * Get configured store
1762
+ * @returns SkillStore instance if configured, null otherwise
1763
+ */
1764
+ private getStore;
1765
+ /**
1766
+ * Inject store into client if client supports it
1767
+ * @param client Skill client instance
1768
+ * @param store Store instance to inject
1769
+ */
1770
+ private injectStoreIntoClient;
1771
+ /**
1772
+ * Register a skill Lattice
1773
+ * @param key Lattice key name
1774
+ * @param config Skill configuration
1775
+ * @param client Optional skill client implementation
1776
+ */
1777
+ registerLattice(key: string, config: SkillConfig, client?: SkillClient): Promise<void>;
1778
+ /**
1779
+ * Get skill Lattice by key
1780
+ * @param key Lattice key name
1781
+ */
1782
+ getSkillLattice(key: string): SkillLattice | undefined;
1783
+ /**
1784
+ * Get all skill Lattices from store
1785
+ * Always reads from the configured store and merges with in-memory clients
1786
+ */
1787
+ getAllLattices(): Promise<SkillLattice[]>;
1788
+ /**
1789
+ * Check if Lattice exists
1790
+ * @param key Lattice key name
1791
+ */
1792
+ hasLattice(key: string): boolean;
1793
+ /**
1794
+ * Remove Lattice
1795
+ * @param key Lattice key name
1796
+ */
1797
+ removeLattice(key: string): Promise<boolean>;
1798
+ /**
1799
+ * Clear all Lattices
1800
+ */
1801
+ clearLattices(): void;
1802
+ /**
1803
+ * Get Lattice count
1804
+ */
1805
+ getLatticeCount(): number;
1806
+ /**
1807
+ * Get Lattice key name list
1808
+ */
1809
+ getLatticeKeys(): string[];
1810
+ /**
1811
+ * Get skill configuration
1812
+ * @param key Lattice key name
1813
+ */
1814
+ getSkillConfig(key: string): SkillConfig;
1815
+ /**
1816
+ * Get skill client
1817
+ * Ensures client has store access if store is configured
1818
+ * @param key Lattice key name
1819
+ */
1820
+ getSkillClient(key: string): SkillClient | null;
1821
+ /**
1822
+ * Get all skill configurations from store
1823
+ * Always reads from the configured store, not from memory
1824
+ */
1825
+ getAllSkillConfigs(): Promise<SkillConfig[]>;
1826
+ /**
1827
+ * Search skills by metadata
1828
+ * @param metadataKey Metadata key to search for
1829
+ * @param metadataValue Metadata value to match
1830
+ */
1831
+ searchByMetadata(metadataKey: string, metadataValue: string): Promise<SkillLattice[]>;
1832
+ /**
1833
+ * Filter skills by compatibility
1834
+ * @param compatibility Compatibility string to filter by
1835
+ */
1836
+ filterByCompatibility(compatibility: string): Promise<SkillLattice[]>;
1837
+ /**
1838
+ * Filter skills by license
1839
+ * @param license License string to filter by
1840
+ */
1841
+ filterByLicense(license: string): Promise<SkillLattice[]>;
1842
+ /**
1843
+ * Load skills from configured store
1844
+ * This method loads all skills from the store and registers them in memory
1845
+ */
1846
+ loadFromStore(): Promise<void>;
1847
+ /**
1848
+ * Update skill in store
1849
+ * @param key Skill key
1850
+ * @param updates Partial skill data to update
1851
+ */
1852
+ updateSkillInStore(key: string, updates: Partial<SkillConfig>): Promise<void>;
1853
+ }
1854
+ declare const skillLatticeManager: SkillLatticeManager;
1855
+
1856
+ /**
1857
+ * Skill name validator
1858
+ * Validates skill names according to the specification:
1859
+ * - 1-64 characters
1860
+ * - Lowercase alphanumeric with single hyphen separators
1861
+ * - Not start or end with -
1862
+ * - Not contain consecutive --
1863
+ * - Match the directory name that contains SKILL.md
1864
+ * - Regex: ^[a-z0-9]+(-[a-z0-9]+)*$
1865
+ */
1866
+ /**
1867
+ * Validate skill name
1868
+ * @param name Skill name to validate
1869
+ * @returns true if valid, false otherwise
1870
+ */
1871
+ declare function isValidSkillName(name: string): boolean;
1872
+ /**
1873
+ * Validate skill name and throw error if invalid
1874
+ * @param name Skill name to validate
1875
+ * @throws Error if name is invalid
1876
+ */
1877
+ declare function validateSkillName(name: string): void;
1878
+
1504
1879
  /**
1505
1880
  * Event bus service
1506
1881
  * Used for event publishing and subscription between internal system components
@@ -1558,4 +1933,4 @@ declare class AgentManager {
1558
1933
 
1559
1934
  declare const AGENT_TASK_EVENT = "agent:execute";
1560
1935
 
1561
- export { AGENT_TASK_EVENT, type AgentClient, type AgentLattice, AgentLatticeManager, AgentManager, type BufferStats, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ColumnInfo, type CronFields, type DatabaseConfig, type DatabaseType, DefaultScheduleClient, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, type ISqlDatabase, InMemoryAssistantStore, InMemoryChunkBuffer, InMemoryThreadStore, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, PostgresDatabase, type QueryResult, type QueueLattice, QueueLatticeManager, type ScheduleLattice, ScheduleLatticeManager, SqlDatabaseManager, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, type TableInfo, type TableSchema, type ThreadBuffer, type ThreadBufferConfig, ThreadStatus, type ToolDefinition, type ToolLattice, ToolLatticeManager, type VectorStoreLatticeInterface, VectorStoreLatticeManager, agentLatticeManager, describeCronExpression, embeddingsLatticeManager, eventBus, eventBus as eventBusDefault, getAgentClient, getAgentConfig, getAgentLattice, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getChunkBuffer, getEmbeddingsClient, getEmbeddingsLattice, getModelLattice, getNextCronTime, getQueueLattice, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, hasChunkBuffer, isValidCronExpression, modelLatticeManager, parseCronExpression, queueLatticeManager, registerAgentLattice, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerModelLattice, registerQueueLattice, registerScheduleLattice, registerStoreLattice, registerToolLattice, registerVectorStoreLattice, scheduleLatticeManager, sqlDatabaseManager, storeLatticeManager, toolLatticeManager, validateAgentInput, validateToolInput, vectorStoreLatticeManager };
1936
+ export { AGENT_TASK_EVENT, type AgentClient, type AgentLattice, AgentLatticeManager, AgentManager, type BufferStats, type Chunk, ChunkBuffer, ChunkBufferLatticeManager, type ColumnInfo, ConsoleLoggerClient, type CronFields, type DatabaseConfig, type DatabaseType, DefaultScheduleClient, type EmbeddingsLatticeInterface, EmbeddingsLatticeManager, FileSystemSkillStore, type FileSystemSkillStoreOptions, type ISqlDatabase, InMemoryAssistantStore, InMemoryChunkBuffer, InMemoryThreadStore, type LoggerLattice, LoggerLatticeManager, MemoryLatticeManager, MemoryQueueClient, MemoryScheduleStorage, type ModelConfig, type ModelLatticeInterface, ModelLatticeManager, PinoLoggerClient, PostgresDatabase, type QueryResult, type QueueLattice, QueueLatticeManager, type ScheduleLattice, ScheduleLatticeManager, type SkillLattice, SkillLatticeManager, SqlDatabaseManager, type StoreLattice, StoreLatticeManager, type StoreType, type StoreTypeMap, type TableInfo, type TableSchema, type ThreadBuffer, type ThreadBufferConfig, ThreadStatus, type ToolDefinition, type ToolLattice, ToolLatticeManager, type VectorStoreLatticeInterface, VectorStoreLatticeManager, agentLatticeManager, describeCronExpression, embeddingsLatticeManager, eventBus, eventBus as eventBusDefault, getAgentClient, getAgentConfig, getAgentLattice, getAllAgentConfigs, getAllToolDefinitions, getCheckpointSaver, getChunkBuffer, getEmbeddingsClient, getEmbeddingsLattice, getLoggerLattice, getModelLattice, getNextCronTime, getQueueLattice, getScheduleLattice, getStoreLattice, getToolClient, getToolDefinition, getToolLattice, getVectorStoreClient, getVectorStoreLattice, hasChunkBuffer, isValidCronExpression, isValidSkillName, loggerLatticeManager, modelLatticeManager, parseCronExpression, queueLatticeManager, registerAgentLattice, registerAgentLattices, registerCheckpointSaver, registerChunkBuffer, registerEmbeddingsLattice, registerLoggerLattice, registerModelLattice, registerQueueLattice, registerScheduleLattice, registerStoreLattice, registerToolLattice, registerVectorStoreLattice, scheduleLatticeManager, skillLatticeManager, sqlDatabaseManager, storeLatticeManager, toolLatticeManager, validateAgentInput, validateSkillName, validateToolInput, vectorStoreLatticeManager };