@cleocode/lafs 2026.3.74 → 2026.4.3
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/LICENSE +0 -0
- package/README.md +97 -68
- package/dist/schemas/v1/agent-card.schema.json +230 -0
- package/dist/schemas/v1/conformance-profiles.json +0 -0
- package/dist/schemas/v1/context-ledger.schema.json +70 -0
- package/dist/schemas/v1/discovery.schema.json +132 -0
- package/dist/schemas/v1/envelope.schema.json +0 -0
- package/dist/schemas/v1/error-registry.json +0 -0
- package/dist/src/a2a/bindings/grpc.d.ts +118 -11
- package/dist/src/a2a/bindings/grpc.d.ts.map +1 -0
- package/dist/src/a2a/bindings/grpc.js +80 -8
- package/dist/src/a2a/bindings/grpc.js.map +1 -0
- package/dist/src/a2a/bindings/http.d.ts +131 -15
- package/dist/src/a2a/bindings/http.d.ts.map +1 -0
- package/dist/src/a2a/bindings/http.js +101 -14
- package/dist/src/a2a/bindings/http.js.map +1 -0
- package/dist/src/a2a/bindings/index.d.ts +83 -9
- package/dist/src/a2a/bindings/index.d.ts.map +1 -0
- package/dist/src/a2a/bindings/index.js +74 -6
- package/dist/src/a2a/bindings/index.js.map +1 -0
- package/dist/src/a2a/bindings/jsonrpc.d.ts +194 -9
- package/dist/src/a2a/bindings/jsonrpc.d.ts.map +1 -0
- package/dist/src/a2a/bindings/jsonrpc.js +155 -10
- package/dist/src/a2a/bindings/jsonrpc.js.map +1 -0
- package/dist/src/a2a/bridge.d.ts +237 -44
- package/dist/src/a2a/bridge.d.ts.map +1 -0
- package/dist/src/a2a/bridge.js +187 -48
- package/dist/src/a2a/bridge.js.map +1 -0
- package/dist/src/a2a/extensions.d.ts +222 -12
- package/dist/src/a2a/extensions.d.ts.map +1 -0
- package/dist/src/a2a/extensions.js +178 -13
- package/dist/src/a2a/extensions.js.map +1 -0
- package/dist/src/a2a/index.d.ts +10 -7
- package/dist/src/a2a/index.d.ts.map +1 -0
- package/dist/src/a2a/index.js +24 -27
- package/dist/src/a2a/index.js.map +1 -0
- package/dist/src/a2a/streaming.d.ts +276 -3
- package/dist/src/a2a/streaming.d.ts.map +1 -0
- package/dist/src/a2a/streaming.js +255 -11
- package/dist/src/a2a/streaming.js.map +1 -0
- package/dist/src/a2a/task-lifecycle.d.ts +341 -20
- package/dist/src/a2a/task-lifecycle.d.ts.map +1 -0
- package/dist/src/a2a/task-lifecycle.js +327 -26
- package/dist/src/a2a/task-lifecycle.js.map +1 -0
- package/dist/src/budgetEnforcement.d.ts +93 -20
- package/dist/src/budgetEnforcement.d.ts.map +1 -0
- package/dist/src/budgetEnforcement.js +146 -31
- package/dist/src/budgetEnforcement.js.map +1 -0
- package/dist/src/circuit-breaker/index.d.ts +260 -10
- package/dist/src/circuit-breaker/index.d.ts.map +1 -0
- package/dist/src/circuit-breaker/index.js +226 -14
- package/dist/src/circuit-breaker/index.js.map +1 -0
- package/dist/src/cli.d.ts +1 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +12 -11
- package/dist/src/cli.js.map +1 -0
- package/dist/src/compliance.d.ts +180 -3
- package/dist/src/compliance.d.ts.map +1 -0
- package/dist/src/compliance.js +114 -13
- package/dist/src/compliance.js.map +1 -0
- package/dist/src/conformance.d.ts +55 -2
- package/dist/src/conformance.d.ts.map +1 -0
- package/dist/src/conformance.js +124 -76
- package/dist/src/conformance.js.map +1 -0
- package/dist/src/conformanceProfiles.d.ts +68 -1
- package/dist/src/conformanceProfiles.d.ts.map +1 -0
- package/dist/src/conformanceProfiles.js +53 -1
- package/dist/src/conformanceProfiles.js.map +1 -0
- package/dist/src/deprecationRegistry.d.ts +82 -1
- package/dist/src/deprecationRegistry.d.ts.map +1 -0
- package/dist/src/deprecationRegistry.js +58 -7
- package/dist/src/deprecationRegistry.js.map +1 -0
- package/dist/src/discovery.d.ts +347 -65
- package/dist/src/discovery.d.ts.map +1 -0
- package/dist/src/discovery.js +130 -72
- package/dist/src/discovery.js.map +1 -0
- package/dist/src/envelope.d.ts +262 -9
- package/dist/src/envelope.d.ts.map +1 -0
- package/dist/src/envelope.js +179 -15
- package/dist/src/envelope.js.map +1 -0
- package/dist/src/errorRegistry.d.ts +163 -3
- package/dist/src/errorRegistry.d.ts.map +1 -0
- package/dist/src/errorRegistry.js +119 -3
- package/dist/src/errorRegistry.js.map +1 -0
- package/dist/src/fieldExtraction.d.ts +128 -27
- package/dist/src/fieldExtraction.d.ts.map +1 -0
- package/dist/src/fieldExtraction.js +100 -27
- package/dist/src/fieldExtraction.js.map +1 -0
- package/dist/src/flagResolver.d.ts +77 -10
- package/dist/src/flagResolver.d.ts.map +1 -0
- package/dist/src/flagResolver.js +22 -5
- package/dist/src/flagResolver.js.map +1 -0
- package/dist/src/flagSemantics.d.ts +80 -4
- package/dist/src/flagSemantics.d.ts.map +1 -0
- package/dist/src/flagSemantics.js +78 -11
- package/dist/src/flagSemantics.js.map +1 -0
- package/dist/src/health/index.d.ts +103 -9
- package/dist/src/health/index.d.ts.map +1 -0
- package/dist/src/health/index.js +75 -26
- package/dist/src/health/index.js.map +1 -0
- package/dist/src/index.d.ts +34 -23
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +40 -28
- package/dist/src/index.js.map +1 -0
- package/dist/src/mviProjection.d.ts +43 -6
- package/dist/src/mviProjection.d.ts.map +1 -0
- package/dist/src/mviProjection.js +32 -5
- package/dist/src/mviProjection.js.map +1 -0
- package/dist/src/native-loader.d.ts +49 -0
- package/dist/src/native-loader.d.ts.map +1 -0
- package/dist/src/native-loader.js +56 -0
- package/dist/src/native-loader.js.map +1 -0
- package/dist/src/problemDetails.d.ts +71 -4
- package/dist/src/problemDetails.d.ts.map +1 -0
- package/dist/src/problemDetails.js +27 -3
- package/dist/src/problemDetails.js.map +1 -0
- package/dist/src/shutdown/index.d.ts +103 -9
- package/dist/src/shutdown/index.d.ts.map +1 -0
- package/dist/src/shutdown/index.js +78 -12
- package/dist/src/shutdown/index.js.map +1 -0
- package/dist/src/tokenEstimator.d.ts +98 -11
- package/dist/src/tokenEstimator.d.ts.map +1 -0
- package/dist/src/tokenEstimator.js +91 -13
- package/dist/src/tokenEstimator.js.map +1 -0
- package/dist/src/types.d.ts +477 -11
- package/dist/src/types.d.ts.map +1 -0
- package/dist/src/types.js +76 -2
- package/dist/src/types.js.map +1 -0
- package/dist/src/validateEnvelope.d.ts +61 -2
- package/dist/src/validateEnvelope.d.ts.map +1 -0
- package/dist/src/validateEnvelope.js +81 -14
- package/dist/src/validateEnvelope.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/lafs.md +3 -4
- package/package.json +14 -12
- package/schemas/v1/agent-card.schema.json +0 -0
- package/schemas/v1/conformance-profiles.json +0 -0
- package/schemas/v1/context-ledger.schema.json +0 -0
- package/schemas/v1/discovery.schema.json +0 -0
- package/schemas/v1/envelope.schema.json +0 -0
- package/schemas/v1/error-registry.json +0 -0
- package/dist/src/mcpAdapter.d.ts +0 -28
- package/dist/src/mcpAdapter.js +0 -281
package/dist/src/a2a/bridge.d.ts
CHANGED
|
@@ -4,99 +4,196 @@
|
|
|
4
4
|
* Full integration with official @a2a-js/sdk for Agent-to-Agent communication.
|
|
5
5
|
* Implements A2A Protocol v1.0+ specification.
|
|
6
6
|
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Provides the core bridge between LAFS envelopes and A2A protocol types.
|
|
9
|
+
* Includes a result wrapper ({@link LafsA2AResult}) for extracting typed data
|
|
10
|
+
* from A2A responses, artifact creation helpers for LAFS envelopes, text, and
|
|
11
|
+
* files, and extension introspection utilities.
|
|
12
|
+
*
|
|
7
13
|
* Reference: specs/external/specification.md
|
|
8
14
|
*/
|
|
15
|
+
import type { AgentCard, Artifact, JSONRPCErrorResponse, Message, MessageSendConfiguration, Part, SendMessageResponse, SendMessageSuccessResponse, Task, TaskState, TaskStatus } from '@a2a-js/sdk';
|
|
9
16
|
import { AGENT_CARD_PATH, HTTP_EXTENSION_HEADER } from '@a2a-js/sdk';
|
|
10
|
-
import type { Task, TaskState, TaskStatus, Artifact, Part, Message, AgentCard, MessageSendConfiguration, SendMessageResponse, SendMessageSuccessResponse, JSONRPCErrorResponse } from '@a2a-js/sdk';
|
|
11
17
|
import type { LAFSEnvelope } from '../types.js';
|
|
12
18
|
/**
|
|
13
|
-
* Configuration for LAFS A2A integration
|
|
19
|
+
* Configuration for LAFS A2A integration.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* Controls default token budgets, envelope wrapping behavior, protocol
|
|
23
|
+
* version, and extension activation for all A2A operations.
|
|
14
24
|
*/
|
|
15
25
|
export interface LafsA2AConfig {
|
|
16
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Default token budget for all operations.
|
|
28
|
+
* @defaultValue undefined
|
|
29
|
+
*/
|
|
17
30
|
defaultBudget?: {
|
|
31
|
+
/** Maximum number of tokens allowed */
|
|
18
32
|
maxTokens?: number;
|
|
33
|
+
/** Maximum number of items allowed */
|
|
19
34
|
maxItems?: number;
|
|
35
|
+
/** Maximum number of bytes allowed */
|
|
20
36
|
maxBytes?: number;
|
|
21
37
|
};
|
|
22
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* Whether to automatically wrap responses in LAFS envelopes.
|
|
40
|
+
* @defaultValue undefined
|
|
41
|
+
*/
|
|
23
42
|
envelopeResponses?: boolean;
|
|
24
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* A2A protocol version to use.
|
|
45
|
+
* @defaultValue undefined
|
|
46
|
+
*/
|
|
25
47
|
protocolVersion?: string;
|
|
26
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Extension URIs to activate for all requests.
|
|
50
|
+
* @defaultValue undefined
|
|
51
|
+
*/
|
|
27
52
|
defaultExtensions?: string[];
|
|
28
53
|
}
|
|
29
54
|
/**
|
|
30
|
-
* Request parameters for sending messages
|
|
55
|
+
* Request parameters for sending messages.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* Encapsulates the message content, A2A configuration, token budget,
|
|
59
|
+
* extension activation, and conversation context for a single send
|
|
60
|
+
* operation.
|
|
31
61
|
*/
|
|
32
62
|
export interface LafsSendMessageParams {
|
|
33
|
-
/** Message content */
|
|
63
|
+
/** Message content including role, parts, and optional metadata */
|
|
34
64
|
message: {
|
|
65
|
+
/** Role of the message sender */
|
|
35
66
|
role: 'user' | 'agent';
|
|
67
|
+
/** Content parts composing the message */
|
|
36
68
|
parts: Part[];
|
|
37
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Optional message metadata.
|
|
71
|
+
* @defaultValue undefined
|
|
72
|
+
*/
|
|
38
73
|
metadata?: Record<string, unknown>;
|
|
39
74
|
};
|
|
40
|
-
/**
|
|
75
|
+
/**
|
|
76
|
+
* A2A configuration for this request.
|
|
77
|
+
* @defaultValue undefined
|
|
78
|
+
*/
|
|
41
79
|
configuration?: MessageSendConfiguration;
|
|
42
|
-
/**
|
|
80
|
+
/**
|
|
81
|
+
* Token budget override for this request.
|
|
82
|
+
* @defaultValue undefined
|
|
83
|
+
*/
|
|
43
84
|
budget?: {
|
|
85
|
+
/** Maximum number of tokens allowed */
|
|
44
86
|
maxTokens?: number;
|
|
87
|
+
/** Maximum number of items allowed */
|
|
45
88
|
maxItems?: number;
|
|
89
|
+
/** Maximum number of bytes allowed */
|
|
46
90
|
maxBytes?: number;
|
|
47
91
|
};
|
|
48
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Extensions to activate for this request.
|
|
94
|
+
* @defaultValue undefined
|
|
95
|
+
*/
|
|
49
96
|
extensions?: string[];
|
|
50
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Context ID for multi-turn conversations.
|
|
99
|
+
* @defaultValue undefined
|
|
100
|
+
*/
|
|
51
101
|
contextId?: string;
|
|
52
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Task ID for continuing existing task.
|
|
104
|
+
* @defaultValue undefined
|
|
105
|
+
*/
|
|
53
106
|
taskId?: string;
|
|
54
107
|
}
|
|
55
108
|
/**
|
|
56
|
-
* Wrapper for A2A responses with LAFS envelope support
|
|
109
|
+
* Wrapper for A2A responses with LAFS envelope support.
|
|
110
|
+
*
|
|
111
|
+
* @remarks
|
|
112
|
+
* Provides typed accessors for extracting tasks, messages, LAFS envelopes,
|
|
113
|
+
* token estimates, and state information from raw A2A `SendMessageResponse`
|
|
114
|
+
* objects. All methods are null-safe and return `null` when the expected
|
|
115
|
+
* data is not present.
|
|
57
116
|
*/
|
|
58
117
|
export declare class LafsA2AResult {
|
|
59
118
|
private result;
|
|
60
|
-
private config;
|
|
61
|
-
private requestId;
|
|
62
|
-
constructor(result: SendMessageResponse, config: LafsA2AConfig, requestId: string);
|
|
63
119
|
/**
|
|
64
|
-
*
|
|
120
|
+
* Create a LafsA2AResult wrapper.
|
|
121
|
+
*
|
|
122
|
+
* @param result - Raw A2A SendMessageResponse to wrap
|
|
123
|
+
* @param _config - LAFS A2A configuration (reserved for future use)
|
|
124
|
+
* @param _requestId - Request ID for correlation (reserved for future use)
|
|
125
|
+
*/
|
|
126
|
+
constructor(result: SendMessageResponse, _config: LafsA2AConfig, _requestId: string);
|
|
127
|
+
/**
|
|
128
|
+
* Get the raw A2A response.
|
|
129
|
+
*
|
|
130
|
+
* @returns The underlying SendMessageResponse object
|
|
65
131
|
*/
|
|
66
132
|
getA2AResult(): SendMessageResponse;
|
|
67
133
|
/**
|
|
68
|
-
* Check if result is an error
|
|
134
|
+
* Check if the result is an error response.
|
|
135
|
+
*
|
|
136
|
+
* @returns True if the response contains a JSON-RPC error
|
|
69
137
|
*/
|
|
70
138
|
isError(): boolean;
|
|
71
139
|
/**
|
|
72
|
-
* Get error details if result is an error
|
|
140
|
+
* Get error details if the result is an error.
|
|
141
|
+
*
|
|
142
|
+
* @returns The JSON-RPC error response, or null if the result is a success
|
|
73
143
|
*/
|
|
74
144
|
getError(): JSONRPCErrorResponse | null;
|
|
75
145
|
/**
|
|
76
|
-
* Get success result
|
|
146
|
+
* Get the success result.
|
|
147
|
+
*
|
|
148
|
+
* @returns The success response, or null if the result is an error
|
|
77
149
|
*/
|
|
78
150
|
getSuccess(): SendMessageSuccessResponse | null;
|
|
79
151
|
/**
|
|
80
|
-
* Extract Task from response (if present)
|
|
152
|
+
* Extract a Task from the response (if present).
|
|
153
|
+
*
|
|
154
|
+
* @remarks
|
|
155
|
+
* Checks the success result for an object with `id` and `status` properties,
|
|
156
|
+
* which identifies it as a Task rather than a Message.
|
|
157
|
+
*
|
|
158
|
+
* @returns The extracted Task, or null if not present or result is an error
|
|
81
159
|
*/
|
|
82
160
|
getTask(): Task | null;
|
|
83
161
|
/**
|
|
84
|
-
* Extract Message from response (if present)
|
|
162
|
+
* Extract a Message from the response (if present).
|
|
163
|
+
*
|
|
164
|
+
* @remarks
|
|
165
|
+
* Checks the success result for an object with `messageId` but without
|
|
166
|
+
* `status`, which distinguishes it from a Task.
|
|
167
|
+
*
|
|
168
|
+
* @returns The extracted Message, or null if not present or result is an error
|
|
85
169
|
*/
|
|
86
170
|
getMessage(): Message | null;
|
|
87
171
|
/**
|
|
88
|
-
* Check if response contains a LAFS envelope
|
|
172
|
+
* Check if the response contains a LAFS envelope.
|
|
173
|
+
*
|
|
174
|
+
* @returns True if a LAFS envelope was found in the task's artifacts
|
|
89
175
|
*/
|
|
90
176
|
hasLafsEnvelope(): boolean;
|
|
91
177
|
/**
|
|
92
|
-
* Extract LAFS envelope from A2A artifact
|
|
178
|
+
* Extract a LAFS envelope from A2A artifact.
|
|
93
179
|
*
|
|
180
|
+
* @remarks
|
|
94
181
|
* A2A agents can return LAFS envelopes in artifacts for structured data.
|
|
95
|
-
* This method
|
|
182
|
+
* This method scans all artifacts for a DataPart containing an object
|
|
183
|
+
* with `$schema`, `_meta`, and `success` fields (the LAFS envelope shape).
|
|
184
|
+
*
|
|
185
|
+
* @returns The first LAFS envelope found, or null if none present
|
|
96
186
|
*/
|
|
97
187
|
getLafsEnvelope(): LAFSEnvelope | null;
|
|
98
188
|
/**
|
|
99
|
-
* Get token estimate from LAFS envelope
|
|
189
|
+
* Get token estimate from LAFS envelope.
|
|
190
|
+
*
|
|
191
|
+
* @remarks
|
|
192
|
+
* Extracts the `_tokenEstimate` field from the LAFS envelope's `_meta`
|
|
193
|
+
* section, which contains estimated token usage, budget, and truncation
|
|
194
|
+
* information.
|
|
195
|
+
*
|
|
196
|
+
* @returns Token estimate object, or null if no envelope or no estimate present
|
|
100
197
|
*/
|
|
101
198
|
getTokenEstimate(): {
|
|
102
199
|
estimated: number;
|
|
@@ -104,34 +201,59 @@ export declare class LafsA2AResult {
|
|
|
104
201
|
truncated?: boolean;
|
|
105
202
|
} | null;
|
|
106
203
|
/**
|
|
107
|
-
* Get task status
|
|
204
|
+
* Get the task status.
|
|
205
|
+
*
|
|
206
|
+
* @returns The task's current status, or null if no task is present
|
|
108
207
|
*/
|
|
109
208
|
getTaskStatus(): TaskStatus | null;
|
|
110
209
|
/**
|
|
111
|
-
* Get task state
|
|
210
|
+
* Get the task state.
|
|
211
|
+
*
|
|
212
|
+
* @returns The task's current state string, or null if no task is present
|
|
112
213
|
*/
|
|
113
214
|
getTaskState(): TaskState | null;
|
|
114
215
|
/**
|
|
115
|
-
* Check if task is in a terminal state
|
|
216
|
+
* Check if the task is in a terminal state.
|
|
217
|
+
*
|
|
218
|
+
* @remarks
|
|
219
|
+
* Terminal states are `completed`, `failed`, `canceled`, and `rejected`.
|
|
220
|
+
*
|
|
221
|
+
* @returns True if the task is in a terminal state, false otherwise or if no task is present
|
|
116
222
|
*/
|
|
117
223
|
isTerminal(): boolean;
|
|
118
224
|
/**
|
|
119
|
-
* Check if task requires input
|
|
225
|
+
* Check if the task requires user input.
|
|
226
|
+
*
|
|
227
|
+
* @returns True if the task state is `input-required`
|
|
120
228
|
*/
|
|
121
229
|
isInputRequired(): boolean;
|
|
122
230
|
/**
|
|
123
|
-
* Check if task requires authentication
|
|
231
|
+
* Check if the task requires authentication.
|
|
232
|
+
*
|
|
233
|
+
* @returns True if the task state is `auth-required`
|
|
124
234
|
*/
|
|
125
235
|
isAuthRequired(): boolean;
|
|
126
236
|
/**
|
|
127
|
-
* Get all artifacts from task
|
|
237
|
+
* Get all artifacts from the task.
|
|
238
|
+
*
|
|
239
|
+
* @returns Array of task artifacts, or empty array if no task or no artifacts
|
|
128
240
|
*/
|
|
129
241
|
getArtifacts(): Artifact[];
|
|
242
|
+
/** Type guard: checks whether a Part is a DataPart by inspecting its `kind` field. */
|
|
130
243
|
private isDataPart;
|
|
244
|
+
/** Heuristic check: returns true if the data object looks like a LAFS envelope (has `$schema`, `_meta`, `success`). */
|
|
131
245
|
private isLafsEnvelope;
|
|
132
246
|
}
|
|
133
247
|
/**
|
|
134
|
-
* Create a LAFS envelope artifact for A2A
|
|
248
|
+
* Create a LAFS envelope artifact for A2A.
|
|
249
|
+
*
|
|
250
|
+
* @remarks
|
|
251
|
+
* Wraps a LAFS envelope in an A2A Artifact with a DataPart. The artifact
|
|
252
|
+
* is tagged with LAFS version and content type metadata for identification
|
|
253
|
+
* by consumers.
|
|
254
|
+
*
|
|
255
|
+
* @param envelope - LAFS envelope to wrap as an artifact
|
|
256
|
+
* @returns A2A Artifact containing the envelope as a DataPart
|
|
135
257
|
*
|
|
136
258
|
* @example
|
|
137
259
|
* ```typescript
|
|
@@ -147,29 +269,100 @@ export declare class LafsA2AResult {
|
|
|
147
269
|
*/
|
|
148
270
|
export declare function createLafsArtifact(envelope: LAFSEnvelope): Artifact;
|
|
149
271
|
/**
|
|
150
|
-
* Create a text artifact
|
|
272
|
+
* Create a text artifact.
|
|
273
|
+
*
|
|
274
|
+
* @remarks
|
|
275
|
+
* Wraps a plain text string in an A2A Artifact with a TextPart.
|
|
276
|
+
*
|
|
277
|
+
* @param text - Text content for the artifact
|
|
278
|
+
* @param name - Display name for the artifact
|
|
279
|
+
* @returns A2A Artifact containing the text as a TextPart
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* ```typescript
|
|
283
|
+
* const artifact = createTextArtifact('Hello, world!', 'greeting');
|
|
284
|
+
* ```
|
|
151
285
|
*/
|
|
152
286
|
export declare function createTextArtifact(text: string, name?: string): Artifact;
|
|
153
287
|
/**
|
|
154
|
-
* Create a file artifact
|
|
288
|
+
* Create a file artifact.
|
|
289
|
+
*
|
|
290
|
+
* @remarks
|
|
291
|
+
* Wraps a file URI in an A2A Artifact with a FilePart. The media type
|
|
292
|
+
* and optional filename are included for proper content handling by
|
|
293
|
+
* consumers.
|
|
294
|
+
*
|
|
295
|
+
* @param fileUrl - URI pointing to the file resource
|
|
296
|
+
* @param mediaType - MIME type of the file (e.g., `application/pdf`)
|
|
297
|
+
* @param filename - Optional display filename for the artifact
|
|
298
|
+
* @returns A2A Artifact containing the file reference as a FilePart
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```typescript
|
|
302
|
+
* const artifact = createFileArtifact(
|
|
303
|
+
* 'https://example.com/report.pdf',
|
|
304
|
+
* 'application/pdf',
|
|
305
|
+
* 'report.pdf',
|
|
306
|
+
* );
|
|
307
|
+
* ```
|
|
155
308
|
*/
|
|
156
309
|
export declare function createFileArtifact(fileUrl: string, mediaType: string, filename?: string): Artifact;
|
|
157
310
|
/**
|
|
158
|
-
* Check if an extension is required
|
|
311
|
+
* Check if an extension is required in an Agent Card.
|
|
312
|
+
*
|
|
313
|
+
* @remarks
|
|
314
|
+
* Scans the agent card's declared extensions for one matching the given
|
|
315
|
+
* URI with `required: true`.
|
|
316
|
+
*
|
|
317
|
+
* @param agentCard - Agent Card to inspect
|
|
318
|
+
* @param extensionUri - URI of the extension to check
|
|
319
|
+
* @returns True if the extension is declared as required
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* ```typescript
|
|
323
|
+
* if (isExtensionRequired(agentCard, LAFS_EXTENSION_URI)) {
|
|
324
|
+
* console.log('LAFS extension is mandatory for this agent');
|
|
325
|
+
* }
|
|
326
|
+
* ```
|
|
159
327
|
*/
|
|
160
328
|
export declare function isExtensionRequired(agentCard: AgentCard, extensionUri: string): boolean;
|
|
161
329
|
/**
|
|
162
|
-
* Get extension parameters
|
|
330
|
+
* Get extension parameters from an Agent Card.
|
|
331
|
+
*
|
|
332
|
+
* @remarks
|
|
333
|
+
* Finds the extension matching the given URI and returns its `params` object.
|
|
334
|
+
*
|
|
335
|
+
* @param agentCard - Agent Card to inspect
|
|
336
|
+
* @param extensionUri - URI of the extension to look up
|
|
337
|
+
* @returns The extension's params object, or undefined if not found
|
|
338
|
+
*
|
|
339
|
+
* @example
|
|
340
|
+
* ```typescript
|
|
341
|
+
* const params = getExtensionParams(agentCard, LAFS_EXTENSION_URI);
|
|
342
|
+
* if (params?.supportsTokenBudgets) {
|
|
343
|
+
* // Enable budget tracking
|
|
344
|
+
* }
|
|
345
|
+
* ```
|
|
163
346
|
*/
|
|
164
347
|
export declare function getExtensionParams(agentCard: AgentCard, extensionUri: string): Record<string, unknown> | undefined;
|
|
165
348
|
/**
|
|
166
|
-
* A2A Agent Card well-known path
|
|
349
|
+
* A2A Agent Card well-known path.
|
|
350
|
+
*
|
|
351
|
+
* @remarks
|
|
352
|
+
* The standard path `/.well-known/agent-card.json` where A2A Agent Cards
|
|
353
|
+
* are published. Re-exported from the A2A SDK.
|
|
354
|
+
*
|
|
167
355
|
* Reference: specs/external/agent-discovery.md
|
|
168
356
|
*/
|
|
169
|
-
export { AGENT_CARD_PATH };
|
|
170
357
|
/**
|
|
171
|
-
* HTTP header for A2A Extensions
|
|
358
|
+
* HTTP header for A2A Extensions.
|
|
359
|
+
*
|
|
360
|
+
* @remarks
|
|
361
|
+
* Used to communicate extension activation between client and agent.
|
|
362
|
+
* Re-exported from the A2A SDK.
|
|
363
|
+
*
|
|
172
364
|
* Reference: specs/external/extensions.md
|
|
173
365
|
*/
|
|
174
|
-
export { HTTP_EXTENSION_HEADER };
|
|
175
|
-
export type {
|
|
366
|
+
export { AGENT_CARD_PATH, HTTP_EXTENSION_HEADER };
|
|
367
|
+
export type { AgentCapabilities, AgentCard, AgentExtension, AgentSkill, Artifact, DataPart, FilePart, JSONRPCErrorResponse, Message, MessageSendConfiguration, Part, PushNotificationConfig, SendMessageResponse, SendMessageSuccessResponse, Task, TaskArtifactUpdateEvent, TaskState, TaskStatus, TaskStatusUpdateEvent, TextPart, } from '@a2a-js/sdk';
|
|
368
|
+
//# sourceMappingURL=bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/a2a/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EACV,SAAS,EACT,QAAQ,EAIR,oBAAoB,EACpB,OAAO,EACP,wBAAwB,EACxB,IAAI,EACJ,mBAAmB,EACnB,0BAA0B,EAC1B,IAAI,EACJ,SAAS,EACT,UAAU,EAEX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGrE,OAAO,KAAK,EAAE,YAAY,EAAY,MAAM,aAAa,CAAC;AAM1D;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,aAAa,CAAC,EAAE;QACd,uCAAuC;QACvC,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,sCAAsC;QACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,sCAAsC;QACtC,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,mEAAmE;IACnE,OAAO,EAAE;QACP,iCAAiC;QACjC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QACvB,0CAA0C;QAC1C,KAAK,EAAE,IAAI,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