@axiom-lattice/protocols 6.4.0 → 7.0.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiom-lattice/protocols",
3
- "version": "6.4.0",
3
+ "version": "7.0.1",
4
4
  "description": "Unified protocol type definitions for Axiom Lattice framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -22,9 +22,9 @@
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
24
  "@a2a-js/sdk": "^0.3.13",
25
- "@langchain/core": "1.1.30",
26
- "@langchain/langgraph": "1.0.4",
27
- "zod": "3.25.76"
25
+ "@langchain/core": "1.3.2",
26
+ "@langchain/langgraph": "1.5.3",
27
+ "zod": "4.6.7"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/jest": "^29.5.12",
@@ -39,9 +39,12 @@
39
39
  "typescript": "^5.4.2"
40
40
  },
41
41
  "peerDependencies": {
42
- "@langchain/core": "1.1.30",
43
- "@langchain/langgraph": "1.0.4",
44
- "zod": "3.25.76"
42
+ "@langchain/core": "1.3.2",
43
+ "@langchain/langgraph": "1.5.3",
44
+ "zod": "4.6.7"
45
+ },
46
+ "engines": {
47
+ "node": ">=20.10.0"
45
48
  },
46
49
  "scripts": {
47
50
  "build": "tsup src/index.ts --format cjs,esm --dts --sourcemap",
@@ -14,7 +14,6 @@ import { BaseLatticeProtocol } from "./BaseLatticeProtocol";
14
14
  export enum AgentType {
15
15
  REACT = "react",
16
16
  DEEP_AGENT = "deep_agent",
17
- PROCESSING = "processing",
18
17
  /** Remote A2A agent — delegates to an external A2A-compatible server */
19
18
  A2A_REMOTE = "a2a_remote",
20
19
  /** Workflow agent — compiled from YAML DSL into a LangGraph StateGraph */
@@ -52,7 +51,7 @@ interface BaseAgentConfig {
52
51
  * Child's explicitly set fields override the parent's.
53
52
  */
54
53
  extendsAgent?: string;
55
- schema?: ZodObject<any, any, any, any, any>; // Input validation schema
54
+ schema?: ZodObject; // Input validation schema
56
55
  modelKey?: string; // Model key to use
57
56
  /**
58
57
  * Runtime configuration to inject into tool execution context
@@ -129,7 +128,7 @@ export interface CollectionMiddlewareConfig {
129
128
  connectAll?: boolean;
130
129
  }
131
130
 
132
- export type MiddlewareType = "filesystem" | "code_eval" | "browser" | "sql" | "skill" | "http" | "custom" | "metrics" | "ask_user_to_clarify" | "widget" | "claw" | "date" | "scheduler" | "topology" | "task" | "collection" | string;
131
+ export type MiddlewareType = "filesystem" | "code_eval" | "browser" | "sql" | "skill" | "http" | "custom" | "metrics" | "ask_user_to_clarify" | "widget" | "claw" | "date" | "scheduler" | "task" | "collection" | string;
133
132
 
134
133
  export interface AgentMiddlewareConfig {
135
134
  id: string;
@@ -191,17 +190,6 @@ export interface DeepAgentConfig extends BaseAgentConfig {
191
190
  internalSubAgents?: AgentConfig[]; // Internal sub-agent list (unique to DEEP_AGENT)
192
191
  }
193
192
 
194
- /**
195
- * PROCESSING agent configuration — workflow orchestration with topology enforcement.
196
- * Replaces todoListMiddleware with topologyMiddleware.
197
- */
198
- export interface ProcessingAgentConfig extends BaseAgentConfig {
199
- type: AgentType.PROCESSING;
200
- tools?: string[];
201
- subAgents?: string[];
202
- internalSubAgents?: AgentConfig[];
203
- }
204
-
205
193
  // ─── A2A_REMOTE Agent ──────────────────────────────────────────────────────
206
194
 
207
195
  export interface LocalRuntimeConfig {
@@ -314,7 +302,6 @@ export function isWorkflowAgentConfig(
314
302
  export type AgentConfig =
315
303
  | ReactAgentConfig
316
304
  | DeepAgentConfig
317
- | ProcessingAgentConfig
318
305
  | A2ARemoteAgentConfig
319
306
  | WorkflowAgentConfig
320
307
 
@@ -324,7 +311,6 @@ export type AgentConfig =
324
311
  export type AgentConfigWithTools =
325
312
  | ReactAgentConfig
326
313
  | DeepAgentConfig
327
- | ProcessingAgentConfig
328
314
  | A2ARemoteAgentConfig
329
315
  | WorkflowAgentConfig
330
316
 
@@ -344,15 +330,6 @@ export function isDeepAgentConfig(
344
330
  return config.type === AgentType.DEEP_AGENT;
345
331
  }
346
332
 
347
- /**
348
- * Type guard to check if config is ProcessingAgentConfig (has subAgents + topology)
349
- */
350
- export function isProcessingAgentConfig(
351
- config: AgentConfig
352
- ): config is ProcessingAgentConfig {
353
- return config.type === AgentType.PROCESSING;
354
- }
355
-
356
333
  /**
357
334
  * Get tools from config safely
358
335
  */
@@ -364,10 +341,10 @@ export function getToolsFromConfig(config: AgentConfig): string[] {
364
341
  }
365
342
 
366
343
  /**
367
- * Get subAgents from config safely (DeepAgentConfig and ProcessingAgentConfig have subAgents)
344
+ * Get subAgents from config safely (only DeepAgentConfig has subAgents)
368
345
  */
369
346
  export function getSubAgentsFromConfig(config: AgentConfig): string[] {
370
- if (isDeepAgentConfig(config) || isProcessingAgentConfig(config)) {
347
+ if (isDeepAgentConfig(config)) {
371
348
  return config.subAgents || [];
372
349
  }
373
350
  return [];
@@ -13,6 +13,15 @@ import { BaseLatticeProtocol, LatticeMessage } from "./BaseLatticeProtocol";
13
13
  */
14
14
  export type McpTransportType = "stdio" | "streamable_http" | "sse";
15
15
 
16
+ /**
17
+ * MCP protocol era selection for client connections.
18
+ *
19
+ * - `auto` (default): negotiate the modern protocol and fall back to legacy
20
+ * - `legacy`: pin the 2025-era client interface
21
+ * - `modern`: pin the 2026-07-28 protocol revision
22
+ */
23
+ export type McpProtocolMode = "auto" | "legacy" | "modern";
24
+
16
25
  /**
17
26
  * MCP server configuration
18
27
  */
@@ -41,6 +50,12 @@ export interface McpServerConfig {
41
50
  timeout?: number;
42
51
  /** Retry attempts on connection failure */
43
52
  retryAttempts?: number;
53
+ /**
54
+ * Protocol era selection. Defaults to `auto` (modern negotiation with a
55
+ * legacy fallback). Servers that only understand the 2025-era handshake
56
+ * should use `legacy`; servers that must use 2026-07-28 can pin `modern`.
57
+ */
58
+ protocolMode?: McpProtocolMode;
44
59
  }
45
60
 
46
61
  /**
@@ -63,6 +63,10 @@ export interface ToolCall {
63
63
  export interface AssistantMessage extends BaseMessage {
64
64
  role: "ai";
65
65
  content?: string; // Text response from the assistant (optional if using tool calls)
66
+ /** Reasoning / thinking text kept separate from the answer. */
67
+ reasoning_content?: string;
68
+ /** Measured reasoning time in milliseconds, when the server could observe it. */
69
+ reasoning_duration_ms?: number;
66
70
  tool_calls?: ToolCall[]; // Optional tool calls made by the assistant
67
71
  }
68
72
 
@@ -125,6 +129,15 @@ export interface MessageChunk {
125
129
  data: {
126
130
  id: string;
127
131
  content?: string;
132
+ /**
133
+ * Normalized reasoning text. Wire data normally arrives under
134
+ * `additional_kwargs.reasoning_content`; this field is accepted as a
135
+ * forward-compatible top-level form (and is how the merger re-feeds live
136
+ * messages through history loading).
137
+ */
138
+ reasoning_content?: string;
139
+ /** Measured reasoning time in milliseconds, when the server could observe it. */
140
+ reasoning_duration_ms?: number;
128
141
  /**
129
142
  * Machine-readable end reason for {@link MessageChunkTypes.ERROR} chunks.
130
143
  * Known values: `aborted`, `superseded`, `stream_error`.
@@ -150,6 +163,10 @@ export interface MessageChunk {
150
163
  function?: { name?: string; arguments?: any };
151
164
  id?: string;
152
165
  }>;
166
+ /** OpenAI-compatible reasoning tokens (Qwen, DeepSeek, ...). */
167
+ reasoning_content?: string;
168
+ /** Measured reasoning time in milliseconds (server-authored metadata). */
169
+ reasoning_duration_ms?: number;
153
170
  };
154
171
  tool_call_id?: string;
155
172
  /**