@axiom-lattice/protocols 2.1.9 → 2.1.11

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/protocols@2.1.9 build /home/runner/work/agentic/agentic/packages/protocols
2
+ > @axiom-lattice/protocols@2.1.11 build /home/runner/work/agentic/agentic/packages/protocols
3
3
  > tsup src/index.ts --format cjs,esm --dts --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,13 +8,13 @@
8
8
  CLI Target: es2020
9
9
  CJS Build start
10
10
  ESM Build start
11
- ESM dist/index.mjs 3.11 KB
12
- ESM dist/index.mjs.map 22.34 KB
13
- ESM ⚡️ Build success in 50ms
14
- CJS dist/index.js 4.55 KB
15
- CJS dist/index.js.map 23.16 KB
16
- CJS ⚡️ Build success in 50ms
11
+ ESM dist/index.mjs 3.54 KB
12
+ ESM dist/index.mjs.map 27.58 KB
13
+ ESM ⚡️ Build success in 60ms
14
+ CJS dist/index.js 5.02 KB
15
+ CJS dist/index.js.map 28.52 KB
16
+ CJS ⚡️ Build success in 61ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 2210ms
19
- DTS dist/index.d.ts 30.49 KB
20
- DTS dist/index.d.mts 30.49 KB
18
+ DTS ⚡️ Build success in 2583ms
19
+ DTS dist/index.d.ts 41.39 KB
20
+ DTS dist/index.d.mts 41.39 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @axiom-lattice/protocols
2
2
 
3
+ ## 2.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - 2422cbf: add sandbox and mcp
8
+
9
+ ## 2.1.10
10
+
11
+ ### Patch Changes
12
+
13
+ - 773c03f: add skills
14
+
3
15
  ## 2.1.9
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -122,9 +122,7 @@ interface ModelLatticeProtocol extends BaseLatticeProtocol<LLMConfig, BaseChatMo
122
122
  */
123
123
  declare enum AgentType {
124
124
  REACT = "react",
125
- DEEP_AGENT = "deep_agent",
126
- PLAN_EXECUTE = "plan_execute",
127
- SEQUENTIAL = "sequential"
125
+ DEEP_AGENT = "deep_agent"
128
126
  }
129
127
  /**
130
128
  * Runtime configuration that will be injected into LangGraphRunnableConfig.configurable
@@ -151,6 +149,13 @@ interface BaseAgentConfig {
151
149
  * Will be available in tools via config.configurable.runConfig
152
150
  */
153
151
  runConfig?: AgentRunConfig;
152
+ skillCategories?: string[];
153
+ connectedSandbox?: ConnectedSandboxConfig;
154
+ }
155
+ type AvailableModule = "filesystem" | "code_eval" | "browser";
156
+ interface ConnectedSandboxConfig {
157
+ isolatedLevel: "agent" | "thread" | "global";
158
+ availabledModules?: AvailableModule[];
154
159
  }
155
160
  /**
156
161
  * REACT agent configuration
@@ -168,28 +173,15 @@ interface DeepAgentConfig extends BaseAgentConfig {
168
173
  subAgents?: string[];
169
174
  internalSubAgents?: AgentConfig[];
170
175
  }
171
- /**
172
- * PLAN_EXECUTE agent configuration
173
- */
174
- interface PlanExecuteAgentConfig extends BaseAgentConfig {
175
- type: AgentType.PLAN_EXECUTE;
176
- tools?: string[];
177
- }
178
- /**
179
- * SEQUENTIAL agent configuration
180
- */
181
- interface SequentialAgentConfig extends BaseAgentConfig {
182
- type: AgentType.SEQUENTIAL;
183
- }
184
176
  /**
185
177
  * Agent configuration union type
186
178
  * Different agent types have different configuration options
187
179
  */
188
- type AgentConfig = ReactAgentConfig | DeepAgentConfig | PlanExecuteAgentConfig | SequentialAgentConfig;
180
+ type AgentConfig = ReactAgentConfig | DeepAgentConfig;
189
181
  /**
190
182
  * Agent configuration with tools property
191
183
  */
192
- type AgentConfigWithTools = ReactAgentConfig | DeepAgentConfig | PlanExecuteAgentConfig;
184
+ type AgentConfigWithTools = ReactAgentConfig | DeepAgentConfig;
193
185
  /**
194
186
  * Type guard to check if config has tools property
195
187
  */
@@ -1081,6 +1073,441 @@ interface AssistantStore {
1081
1073
  hasAssistant(id: string): Promise<boolean>;
1082
1074
  }
1083
1075
 
1076
+ /**
1077
+ * SkillStoreProtocol
1078
+ *
1079
+ * Skill store protocol definitions for the Axiom Lattice framework
1080
+ * Provides standardized interfaces for skill management across all implementations
1081
+ */
1082
+ /**
1083
+ * Skill type definition
1084
+ */
1085
+ interface Skill {
1086
+ /**
1087
+ * Skill identifier (key)
1088
+ */
1089
+ id: string;
1090
+ /**
1091
+ * Skill name
1092
+ */
1093
+ name: string;
1094
+ /**
1095
+ * Skill description
1096
+ */
1097
+ description: string;
1098
+ /**
1099
+ * License information (optional)
1100
+ */
1101
+ license?: string;
1102
+ /**
1103
+ * Compatibility information (optional)
1104
+ */
1105
+ compatibility?: string;
1106
+ /**
1107
+ * Additional metadata as string-to-string map (optional)
1108
+ */
1109
+ metadata?: Record<string, string>;
1110
+ /**
1111
+ * Skill detailed content description (optional)
1112
+ * This is the markdown body content after the frontmatter
1113
+ */
1114
+ content?: string;
1115
+ /**
1116
+ * Sub-skills (optional)
1117
+ * Array of skill names that are sub-skills of this skill
1118
+ * Creates a hierarchical tree structure for organizing skills
1119
+ */
1120
+ subSkills?: string[];
1121
+ /**
1122
+ * Skill creation timestamp
1123
+ */
1124
+ createdAt: Date;
1125
+ /**
1126
+ * Skill last update timestamp
1127
+ */
1128
+ updatedAt: Date;
1129
+ }
1130
+ /**
1131
+ * Create skill request type
1132
+ */
1133
+ interface CreateSkillRequest {
1134
+ /**
1135
+ * Skill name
1136
+ */
1137
+ name: string;
1138
+ /**
1139
+ * Skill description
1140
+ */
1141
+ description: string;
1142
+ /**
1143
+ * License information (optional)
1144
+ */
1145
+ license?: string;
1146
+ /**
1147
+ * Compatibility information (optional)
1148
+ */
1149
+ compatibility?: string;
1150
+ /**
1151
+ * Additional metadata as string-to-string map (optional)
1152
+ */
1153
+ metadata?: Record<string, string>;
1154
+ /**
1155
+ * Skill detailed content description (optional)
1156
+ * This is the markdown body content after the frontmatter
1157
+ */
1158
+ content?: string;
1159
+ /**
1160
+ * Sub-skills (optional)
1161
+ * Array of skill names that are sub-skills of this skill
1162
+ * Creates a hierarchical tree structure for organizing skills
1163
+ */
1164
+ subSkills?: string[];
1165
+ }
1166
+ /**
1167
+ * SkillStore interface
1168
+ * Provides CRUD operations for skill data
1169
+ */
1170
+ interface SkillStore {
1171
+ /**
1172
+ * Get all skills
1173
+ * @returns Array of all skills
1174
+ */
1175
+ getAllSkills(): Promise<Skill[]>;
1176
+ /**
1177
+ * Get skill by ID
1178
+ * @param id Skill identifier
1179
+ * @returns Skill if found, null otherwise
1180
+ */
1181
+ getSkillById(id: string): Promise<Skill | null>;
1182
+ /**
1183
+ * Create a new skill
1184
+ * @param id Skill identifier
1185
+ * @param data Skill creation data
1186
+ * @returns Created skill
1187
+ */
1188
+ createSkill(id: string, data: CreateSkillRequest): Promise<Skill>;
1189
+ /**
1190
+ * Update an existing skill
1191
+ * @param id Skill identifier
1192
+ * @param updates Partial skill data to update
1193
+ * @returns Updated skill if found, null otherwise
1194
+ */
1195
+ updateSkill(id: string, updates: Partial<CreateSkillRequest>): Promise<Skill | null>;
1196
+ /**
1197
+ * Delete a skill by ID
1198
+ * @param id Skill identifier
1199
+ * @returns true if deleted, false otherwise
1200
+ */
1201
+ deleteSkill(id: string): Promise<boolean>;
1202
+ /**
1203
+ * Check if skill exists
1204
+ * @param id Skill identifier
1205
+ * @returns true if skill exists, false otherwise
1206
+ */
1207
+ hasSkill(id: string): Promise<boolean>;
1208
+ /**
1209
+ * Search skills by metadata
1210
+ * @param metadataKey Metadata key to search for
1211
+ * @param metadataValue Metadata value to match
1212
+ * @returns Array of matching skills
1213
+ */
1214
+ searchByMetadata(metadataKey: string, metadataValue: string): Promise<Skill[]>;
1215
+ /**
1216
+ * Filter skills by compatibility
1217
+ * @param compatibility Compatibility string to filter by
1218
+ * @returns Array of matching skills
1219
+ */
1220
+ filterByCompatibility(compatibility: string): Promise<Skill[]>;
1221
+ /**
1222
+ * Filter skills by license
1223
+ * @param license License string to filter by
1224
+ * @returns Array of matching skills
1225
+ */
1226
+ filterByLicense(license: string): Promise<Skill[]>;
1227
+ /**
1228
+ * Get sub-skills of a parent skill
1229
+ * @param parentSkillName Parent skill name
1230
+ * @returns Array of sub-skills if found, empty array otherwise
1231
+ */
1232
+ getSubSkills(parentSkillName: string): Promise<Skill[]>;
1233
+ }
1234
+
1235
+ /**
1236
+ * SkillLatticeProtocol
1237
+ *
1238
+ * Skill Lattice protocol for defining reusable skill components
1239
+ */
1240
+
1241
+ /**
1242
+ * Skill configuration interface
1243
+ */
1244
+ interface SkillConfig {
1245
+ /** Skill name (required) */
1246
+ name: string;
1247
+ /** Skill description (required) */
1248
+ description: string;
1249
+ /** License information (optional) */
1250
+ license?: string;
1251
+ /** Compatibility information (optional) */
1252
+ compatibility?: string;
1253
+ /** Additional metadata as string-to-string map (optional) */
1254
+ metadata?: Record<string, string>;
1255
+ /** Skill detailed content description (optional) */
1256
+ content?: string;
1257
+ /** Sub-skills (optional) - Array of skill names that are sub-skills of this skill */
1258
+ subSkills?: string[];
1259
+ }
1260
+ /**
1261
+ * Skill client interface
1262
+ * Clients can optionally implement setStore to receive store access
1263
+ * Supports both interface implementation and any type for backward compatibility
1264
+ */
1265
+ interface SkillClient {
1266
+ /**
1267
+ * Optional method to set the store instance
1268
+ * Called by SkillLatticeManager when registering a skill
1269
+ */
1270
+ setStore?: (store: SkillStore) => void;
1271
+ /**
1272
+ * Optional store property
1273
+ * Can be set directly or via setStore method
1274
+ */
1275
+ store?: SkillStore;
1276
+ /**
1277
+ * Additional client-specific properties and methods
1278
+ */
1279
+ [key: string]: any;
1280
+ }
1281
+ /**
1282
+ * Skill client type (supports both interface and any for backward compatibility)
1283
+ */
1284
+ type SkillClientType = SkillClient | any;
1285
+ /**
1286
+ * Skill Lattice protocol interface
1287
+ */
1288
+ interface SkillLatticeProtocol extends BaseLatticeProtocol<SkillConfig, SkillClientType> {
1289
+ execute?: (input: any, config?: any) => Promise<any>;
1290
+ }
1291
+
1292
+ /**
1293
+ * McpLatticeProtocol
1294
+ *
1295
+ * Model Context Protocol (MCP) lattice protocol for integrating MCP servers
1296
+ * with the Lattice framework. Provides standardized interfaces for MCP
1297
+ * client connections, tool discovery, and remote execution.
1298
+ */
1299
+
1300
+ /**
1301
+ * MCP transport type
1302
+ */
1303
+ type McpTransportType = "stdio" | "streamable_http" | "sse";
1304
+ /**
1305
+ * MCP server configuration
1306
+ */
1307
+ interface McpServerConfig {
1308
+ /** Server name */
1309
+ name: string;
1310
+ /** Server version */
1311
+ version: string;
1312
+ /** Transport type */
1313
+ transport: McpTransportType;
1314
+ /** Command for stdio transport (e.g., "npx", "python") */
1315
+ command?: string;
1316
+ /** Arguments for stdio transport */
1317
+ args?: string[];
1318
+ /** URL for HTTP/SSE transport */
1319
+ url?: string;
1320
+ /** Environment variables */
1321
+ env?: Record<string, string>;
1322
+ /** Connection timeout in milliseconds */
1323
+ timeout?: number;
1324
+ /** Retry attempts on connection failure */
1325
+ retryAttempts?: number;
1326
+ }
1327
+ /**
1328
+ * MCP tool definition
1329
+ */
1330
+ interface McpTool {
1331
+ /** Tool name */
1332
+ name: string;
1333
+ /** Tool description */
1334
+ description: string;
1335
+ /** Input schema */
1336
+ inputSchema: {
1337
+ type: "object";
1338
+ properties: Record<string, any>;
1339
+ required?: string[];
1340
+ };
1341
+ /** Tool metadata */
1342
+ metadata?: Record<string, any>;
1343
+ }
1344
+ /**
1345
+ * MCP tool call result
1346
+ */
1347
+ interface McpToolResult {
1348
+ /** Whether the call was successful */
1349
+ success: boolean;
1350
+ /** Result content */
1351
+ content: Array<{
1352
+ type: "text" | "image" | "audio" | "resource";
1353
+ data: any;
1354
+ mimeType?: string;
1355
+ }>;
1356
+ /** Error message if failed */
1357
+ error?: string;
1358
+ /** Execution metadata */
1359
+ metadata?: {
1360
+ duration: number;
1361
+ tokens?: number;
1362
+ model?: string;
1363
+ };
1364
+ }
1365
+ /**
1366
+ * MCP client interface
1367
+ */
1368
+ interface McpClient {
1369
+ /** Client name */
1370
+ name: string;
1371
+ /** Client version */
1372
+ version: string;
1373
+ /** Server configuration */
1374
+ serverConfig: McpServerConfig;
1375
+ /**
1376
+ * Connect to MCP server
1377
+ */
1378
+ connect(): Promise<void>;
1379
+ /**
1380
+ * Disconnect from MCP server
1381
+ */
1382
+ disconnect(): Promise<void>;
1383
+ /**
1384
+ * Check if connected
1385
+ */
1386
+ isConnected(): boolean;
1387
+ /**
1388
+ * List available tools
1389
+ */
1390
+ listTools(): Promise<McpTool[]>;
1391
+ /**
1392
+ * Call a tool
1393
+ */
1394
+ callTool(name: string, arguments_: Record<string, any>): Promise<McpToolResult>;
1395
+ /**
1396
+ * Subscribe to server notifications
1397
+ */
1398
+ subscribe(topic: string, handler: (data: any) => void): void;
1399
+ /**
1400
+ * Unsubscribe from server notifications
1401
+ */
1402
+ unsubscribe(topic: string): void;
1403
+ /**
1404
+ * Get client statistics
1405
+ */
1406
+ getStats(): McpStats;
1407
+ /**
1408
+ * Get connection status
1409
+ */
1410
+ getStatus(): McpConnectionStatus;
1411
+ }
1412
+ /**
1413
+ * MCP client options
1414
+ */
1415
+ interface McpClientOptions {
1416
+ /** Client name */
1417
+ name: string;
1418
+ /** Client version */
1419
+ version: string;
1420
+ /** Server configuration */
1421
+ serverConfig: McpServerConfig;
1422
+ /** Auto-connect on initialization */
1423
+ autoConnect?: boolean;
1424
+ /** Error handler */
1425
+ onError?: (error: Error) => void;
1426
+ /** Connection status handler */
1427
+ onStatusChange?: (status: McpConnectionStatus) => void;
1428
+ }
1429
+ /**
1430
+ * MCP Lattice protocol interface
1431
+ */
1432
+ interface McpLatticeProtocol extends BaseLatticeProtocol<McpServerConfig, McpClient> {
1433
+ /**
1434
+ * Server configuration
1435
+ */
1436
+ config: McpServerConfig;
1437
+ /**
1438
+ * MCP client instance
1439
+ */
1440
+ client: McpClient;
1441
+ /**
1442
+ * Connect to MCP server
1443
+ */
1444
+ connect(): Promise<void>;
1445
+ /**
1446
+ * Disconnect from MCP server
1447
+ */
1448
+ disconnect(): Promise<void>;
1449
+ /**
1450
+ * Get available tools
1451
+ */
1452
+ getTools(): Promise<McpTool[]>;
1453
+ /**
1454
+ * Execute a tool
1455
+ */
1456
+ executeTool(name: string, arguments_: Record<string, any>): Promise<McpToolResult>;
1457
+ /**
1458
+ * Execute with automatic retries
1459
+ */
1460
+ executeToolWithRetry(name: string, arguments_: Record<string, any>, maxRetries?: number): Promise<McpToolResult>;
1461
+ /**
1462
+ * Get protocol version
1463
+ */
1464
+ getProtocolVersion(): string;
1465
+ /**
1466
+ * Health check
1467
+ */
1468
+ healthCheck(): Promise<boolean>;
1469
+ }
1470
+ /**
1471
+ * MCP message types
1472
+ */
1473
+ declare enum McpMessageType {
1474
+ CONNECT = "mcp:connect",
1475
+ DISCONNECT = "mcp:disconnect",
1476
+ LIST_TOOLS = "mcp:list_tools",
1477
+ CALL_TOOL = "mcp:call_tool",
1478
+ TOOL_RESULT = "mcp:tool_result",
1479
+ NOTIFICATION = "mcp:notification",
1480
+ ERROR = "mcp:error",
1481
+ HEALTH_CHECK = "mcp:health_check"
1482
+ }
1483
+ /**
1484
+ * MCP Lattice message
1485
+ */
1486
+ interface McpLatticeMessage extends LatticeMessage {
1487
+ type: McpMessageType;
1488
+ payload: {
1489
+ toolName?: string;
1490
+ arguments?: Record<string, any>;
1491
+ result?: McpToolResult;
1492
+ tools?: McpTool[];
1493
+ error?: string;
1494
+ };
1495
+ }
1496
+ /**
1497
+ * MCP connection status
1498
+ */
1499
+ type McpConnectionStatus = "disconnected" | "connecting" | "connected" | "reconnecting" | "error";
1500
+ /**
1501
+ * MCP statistics
1502
+ */
1503
+ interface McpStats {
1504
+ totalCalls: number;
1505
+ successfulCalls: number;
1506
+ failedCalls: number;
1507
+ averageLatency: number;
1508
+ lastCallTimestamp: number;
1509
+ }
1510
+
1084
1511
  /**
1085
1512
  * 通用类型定义
1086
1513
  *
@@ -1144,4 +1571,4 @@ type Timestamp = number;
1144
1571
  */
1145
1572
  type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
1146
1573
 
1147
- export { type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentRunConfig, AgentType, type Assistant, type AssistantMessage, type AssistantStore, type BaseLatticeProtocol, type BaseMessage, type Callback, type CreateAssistantRequest, type CreateThreadRequest, type DeepAgentConfig, type DeveloperMessage, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type FilterCondition, type GraphBuildOptions, type ID, type InterruptMessage, type LLMConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type Message, type MessageChunk, type ModelLatticeProtocol, type PaginatedResult, type PaginationParams, type PinoFileOptions, type PlanExecuteAgentConfig, type QueryParams, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type Result, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type SequentialAgentConfig, type SystemMessage, type TaskHandler, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UserMessage, type VectorStoreConfig, type VectorStoreLatticeProtocol, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isDeepAgentConfig };
1574
+ export { type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentRunConfig, AgentType, type Assistant, type AssistantMessage, type AssistantStore, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type Callback, type ConnectedSandboxConfig, type CreateAssistantRequest, type CreateSkillRequest, type CreateThreadRequest, type DeepAgentConfig, type DeveloperMessage, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type FilterCondition, type GraphBuildOptions, type ID, type InterruptMessage, type LLMConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type Message, type MessageChunk, type ModelLatticeProtocol, type PaginatedResult, type PaginationParams, type PinoFileOptions, type QueryParams, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type Result, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SystemMessage, type TaskHandler, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UserMessage, type VectorStoreConfig, type VectorStoreLatticeProtocol, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isDeepAgentConfig };