@axiom-lattice/protocols 2.1.53 → 3.0.0

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.
@@ -237,8 +237,20 @@ export function isTeamAgentConfig(
237
237
 
238
238
  // ─── A2A_REMOTE Agent ──────────────────────────────────────────────────────
239
239
 
240
+ export interface LocalRuntimeConfig {
241
+ label?: string;
242
+ agentCardUrl: string;
243
+ healthUrl?: string;
244
+ command: {
245
+ executable: string;
246
+ args: string[];
247
+ cwd?: string;
248
+ env?: Record<string, string>;
249
+ };
250
+ }
251
+
240
252
  /**
241
- * A2A_REMOTE agent configuration — delegates to an external A2A server.
253
+ * A2A_REMOTE agent configuration — wraps a remote A2A-compatible agent endpoint.
242
254
  *
243
255
  * This agent type wraps a remote A2A endpoint so orchestrators can treat
244
256
  * external agents the same as local LangGraph agents.
@@ -251,17 +263,48 @@ export interface A2ARemoteAgentConfig extends BaseAgentConfig {
251
263
  */
252
264
  agentCardUrl: string;
253
265
  /**
254
- * Optional API key sent as Bearer token or X-API-Key header.
266
+ * Optional API key sent as a Bearer token.
255
267
  */
256
268
  apiKey?: string;
257
269
  /**
258
270
  * HTTP timeout in milliseconds (default: 300_000 = 5 min).
259
271
  */
260
272
  timeout?: number;
273
+ projectId?: string;
261
274
  /**
262
275
  * Optional tool keys (not used by the builder, but included for type compatibility).
263
276
  */
264
277
  tools?: string[];
278
+ /**
279
+ * Optional local runtime snapshot for Local Managed A2A assistants.
280
+ * When present, the gateway manages a local process for this assistant.
281
+ * Copied from a template or custom form at creation time.
282
+ */
283
+ localRuntime?: LocalRuntimeConfig;
284
+ }
285
+
286
+ export type LocalA2AProviderId = string;
287
+
288
+ export type LocalA2AProviderStatus =
289
+ | "missing"
290
+ | "disabled"
291
+ | "starting"
292
+ | "running"
293
+ | "stopped"
294
+ | "failed";
295
+
296
+ export interface LocalA2AProviderState {
297
+ runtimeId: string;
298
+ label: string;
299
+ status: LocalA2AProviderStatus;
300
+ enabled: boolean;
301
+ assistantId?: string;
302
+ agentCardUrl?: string;
303
+ healthUrl?: string;
304
+ pid?: number;
305
+ message?: string;
306
+ lastStartedAt?: string;
307
+ lastStoppedAt?: string;
265
308
  }
266
309
 
267
310
  /**
@@ -0,0 +1,36 @@
1
+ /**
2
+ * ConversationStoreProtocol
3
+ *
4
+ * Application-layer conversation persistence. Maintains mappings from
5
+ * application `conversationId`/`threadId` to A2A task IDs, allowing
6
+ * consumers to reference previous tasks without relying on A2A protocol
7
+ * state for chat memory. A2A handles task routing; conversation memory
8
+ * lives here.
9
+ */
10
+
11
+ export interface ConversationRecord {
12
+ conversationId: string;
13
+ tenantId?: string;
14
+ taskIds: string[];
15
+ contextId?: string;
16
+ metadata?: Record<string, unknown>;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ }
20
+
21
+ export interface CreateConversationInput {
22
+ conversationId: string;
23
+ tenantId?: string;
24
+ contextId?: string;
25
+ metadata?: Record<string, unknown>;
26
+ }
27
+
28
+ export interface IConversationStore {
29
+ getConversation(conversationId: string): Promise<ConversationRecord | null>;
30
+
31
+ createConversation(input: CreateConversationInput): Promise<ConversationRecord>;
32
+
33
+ addTaskToConversation(conversationId: string, taskId: string): Promise<ConversationRecord>;
34
+
35
+ deleteConversation(conversationId: string): Promise<void>;
36
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * LocalA2ATemplateConfig
3
+ *
4
+ * Read-only template definitions for Local Managed A2A providers.
5
+ * Templates define command defaults (executable, args, cwd, env)
6
+ * without port or agentCardUrl — those are user-supplied at creation time.
7
+ *
8
+ * Templates are defined in `packages/gateway/src/config/local-a2a-templates.ts`
9
+ * and served via `GET /api/local-a2a/templates`.
10
+ */
11
+
12
+ import type { LocalRuntimeConfig } from "./AgentLatticeProtocol";
13
+
14
+ export interface LocalA2ATemplateDefinition {
15
+ key: string;
16
+ name: string;
17
+ description?: string;
18
+ command: LocalRuntimeConfig["command"];
19
+ }
@@ -0,0 +1,66 @@
1
+ /**
2
+ * STTModelLatticeProtocol
3
+ *
4
+ * Speech-to-text model lattice protocol for defining unified interface
5
+ * for speech recognition / transcription models.
6
+ */
7
+
8
+ import { BaseLatticeProtocol } from "./BaseLatticeProtocol";
9
+
10
+ /**
11
+ * STT provider configuration.
12
+ */
13
+ export interface STTConfig {
14
+ /** Provider type */
15
+ provider?: string;
16
+ /** API mode: "whisper" uses /v1/audio/transcriptions, "chat" uses /v1/chat/completions */
17
+ apiMode?: "whisper" | "chat";
18
+ /** Model name, e.g. "whisper-1", "qwen3-asr-flash" */
19
+ model?: string;
20
+ /** Direct API key */
21
+ apiKey?: string;
22
+ /** Environment variable name for API key, e.g. "DASHSCOPE_API_KEY" */
23
+ apiKeyEnvName?: string;
24
+ /** Custom base URL */
25
+ baseURL?: string;
26
+ /** Request timeout in milliseconds */
27
+ timeout?: number;
28
+ /** Additional parameters passed through to provider (e.g. asr_options) */
29
+ extra?: Record<string, unknown>;
30
+ }
31
+
32
+ /**
33
+ * Result returned by a transcription provider.
34
+ */
35
+ export interface TranscriptionResult {
36
+ /** Transcribed text */
37
+ text: string;
38
+ /** Confidence score 0-1, if available */
39
+ confidence?: number;
40
+ /** Word-level timing segments, if available */
41
+ segments?: Array<{
42
+ start: number;
43
+ end: number;
44
+ text: string;
45
+ }>;
46
+ }
47
+
48
+ /**
49
+ * STT client interface for providers to implement.
50
+ */
51
+ export interface STTClient {
52
+ transcribe(audio: Buffer, format: string): Promise<TranscriptionResult>;
53
+ }
54
+
55
+ /**
56
+ * STT model lattice protocol interface.
57
+ */
58
+ export interface STTModelLatticeProtocol
59
+ extends BaseLatticeProtocol<STTConfig, STTClient> {
60
+ /**
61
+ * Transcribe audio buffer to text.
62
+ * @param audio - Raw audio buffer
63
+ * @param format - Audio format, e.g. "webm", "wav", "mp3"
64
+ */
65
+ transcribe(audio: Buffer, format: string): Promise<TranscriptionResult>;
66
+ }
package/src/index.ts CHANGED
@@ -13,6 +13,7 @@ export * from "./UILatticeProtocol";
13
13
  export * from "./QueueLatticeProtocol";
14
14
  export * from "./ScheduleLatticeProtocol";
15
15
  export * from "./EmbeddingsLatticeProtocol";
16
+ export * from "./STTModelLatticeProtocol";
16
17
  export * from "./VectorStoreLatticeProtocol";
17
18
  export * from "./LoggerLatticeProtocol";
18
19
  export * from "./MessageProtocol";
@@ -39,9 +40,11 @@ export * from "./EvalStoreProtocol";
39
40
  export * from "./TaskStoreProtocol";
40
41
  export * from "./TaskWorkItemProtocol";
41
42
 
43
+ export * from "./LocalA2ATemplateConfig";
42
44
  export * from "./ChannelAdapterProtocol";
43
45
  export * from "./A2AProtocol";
44
46
  export * from "./A2AApiKeyStoreProtocol";
47
+ export * from "./ConversationStoreProtocol";
45
48
 
46
49
  // Workflow DSL (concise, public API)
47
50
  export * from "./WorkflowDSL";