@cleocode/lafs 2026.4.0 → 2026.4.4
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/README.md +97 -68
- package/dist/src/a2a/bindings/grpc.d.ts +117 -11
- package/dist/src/a2a/bindings/grpc.d.ts.map +1 -1
- package/dist/src/a2a/bindings/grpc.js +79 -8
- package/dist/src/a2a/bindings/grpc.js.map +1 -1
- package/dist/src/a2a/bindings/http.d.ts +129 -14
- package/dist/src/a2a/bindings/http.d.ts.map +1 -1
- package/dist/src/a2a/bindings/http.js +93 -12
- package/dist/src/a2a/bindings/http.js.map +1 -1
- package/dist/src/a2a/bindings/index.d.ts +80 -7
- package/dist/src/a2a/bindings/index.d.ts.map +1 -1
- package/dist/src/a2a/bindings/index.js +69 -2
- package/dist/src/a2a/bindings/index.js.map +1 -1
- package/dist/src/a2a/bindings/jsonrpc.d.ts +193 -9
- package/dist/src/a2a/bindings/jsonrpc.d.ts.map +1 -1
- package/dist/src/a2a/bindings/jsonrpc.js +152 -9
- package/dist/src/a2a/bindings/jsonrpc.js.map +1 -1
- package/dist/src/a2a/bridge.d.ts +232 -37
- package/dist/src/a2a/bridge.d.ts.map +1 -1
- package/dist/src/a2a/bridge.js +172 -24
- package/dist/src/a2a/bridge.js.map +1 -1
- package/dist/src/a2a/extensions.d.ts +221 -12
- package/dist/src/a2a/extensions.d.ts.map +1 -1
- package/dist/src/a2a/extensions.js +175 -11
- package/dist/src/a2a/extensions.js.map +1 -1
- package/dist/src/a2a/index.d.ts +2 -0
- package/dist/src/a2a/index.d.ts.map +1 -1
- package/dist/src/a2a/index.js +2 -0
- package/dist/src/a2a/index.js.map +1 -1
- package/dist/src/a2a/streaming.d.ts +274 -2
- package/dist/src/a2a/streaming.d.ts.map +1 -1
- package/dist/src/a2a/streaming.js +245 -2
- package/dist/src/a2a/streaming.js.map +1 -1
- package/dist/src/a2a/task-lifecycle.d.ts +339 -19
- package/dist/src/a2a/task-lifecycle.d.ts.map +1 -1
- package/dist/src/a2a/task-lifecycle.js +302 -19
- package/dist/src/a2a/task-lifecycle.js.map +1 -1
- package/dist/src/budgetEnforcement.d.ts +88 -14
- package/dist/src/budgetEnforcement.d.ts.map +1 -1
- package/dist/src/budgetEnforcement.js +132 -19
- package/dist/src/budgetEnforcement.js.map +1 -1
- package/dist/src/circuit-breaker/index.d.ts +254 -9
- package/dist/src/circuit-breaker/index.d.ts.map +1 -1
- package/dist/src/circuit-breaker/index.js +218 -9
- package/dist/src/circuit-breaker/index.js.map +1 -1
- package/dist/src/compliance.d.ts +176 -0
- package/dist/src/compliance.d.ts.map +1 -1
- package/dist/src/compliance.js +100 -0
- package/dist/src/compliance.js.map +1 -1
- package/dist/src/conformance.d.ts +52 -0
- package/dist/src/conformance.d.ts.map +1 -1
- package/dist/src/conformance.js +41 -0
- package/dist/src/conformance.js.map +1 -1
- package/dist/src/conformanceProfiles.d.ts +66 -0
- package/dist/src/conformanceProfiles.d.ts.map +1 -1
- package/dist/src/conformanceProfiles.js +51 -0
- package/dist/src/conformanceProfiles.js.map +1 -1
- package/dist/src/deprecationRegistry.d.ts +80 -0
- package/dist/src/deprecationRegistry.d.ts.map +1 -1
- package/dist/src/deprecationRegistry.js +50 -0
- package/dist/src/deprecationRegistry.js.map +1 -1
- package/dist/src/discovery.d.ts +344 -63
- package/dist/src/discovery.d.ts.map +1 -1
- package/dist/src/discovery.js +67 -13
- package/dist/src/discovery.js.map +1 -1
- package/dist/src/envelope.d.ts +252 -0
- package/dist/src/envelope.d.ts.map +1 -1
- package/dist/src/envelope.js +165 -0
- package/dist/src/envelope.js.map +1 -1
- package/dist/src/errorRegistry.d.ts +159 -0
- package/dist/src/errorRegistry.d.ts.map +1 -1
- package/dist/src/errorRegistry.js +115 -0
- package/dist/src/errorRegistry.js.map +1 -1
- package/dist/src/fieldExtraction.d.ts +125 -25
- package/dist/src/fieldExtraction.d.ts.map +1 -1
- package/dist/src/fieldExtraction.js +85 -16
- package/dist/src/fieldExtraction.js.map +1 -1
- package/dist/src/flagResolver.d.ts +75 -9
- package/dist/src/flagResolver.d.ts.map +1 -1
- package/dist/src/flagResolver.js +20 -4
- package/dist/src/flagResolver.js.map +1 -1
- package/dist/src/flagSemantics.d.ts +76 -1
- package/dist/src/flagSemantics.d.ts.map +1 -1
- package/dist/src/flagSemantics.js +66 -0
- package/dist/src/flagSemantics.js.map +1 -1
- package/dist/src/health/index.d.ts +87 -6
- package/dist/src/health/index.d.ts.map +1 -1
- package/dist/src/health/index.js +54 -6
- package/dist/src/health/index.js.map +1 -1
- package/dist/src/index.d.ts +12 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +12 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/mviProjection.d.ts +42 -6
- package/dist/src/mviProjection.d.ts.map +1 -1
- package/dist/src/mviProjection.js +31 -5
- package/dist/src/mviProjection.js.map +1 -1
- 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 +70 -4
- package/dist/src/problemDetails.d.ts.map +1 -1
- package/dist/src/problemDetails.js +21 -3
- package/dist/src/problemDetails.js.map +1 -1
- package/dist/src/shutdown/index.d.ts +96 -7
- package/dist/src/shutdown/index.d.ts.map +1 -1
- package/dist/src/shutdown/index.js +72 -7
- package/dist/src/shutdown/index.js.map +1 -1
- package/dist/src/tokenEstimator.d.ts +97 -11
- package/dist/src/tokenEstimator.d.ts.map +1 -1
- package/dist/src/tokenEstimator.js +90 -11
- package/dist/src/tokenEstimator.js.map +1 -1
- package/dist/src/types.d.ts +467 -2
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +64 -0
- package/dist/src/types.js.map +1 -1
- package/dist/src/validateEnvelope.d.ts +59 -1
- package/dist/src/validateEnvelope.d.ts.map +1 -1
- package/dist/src/validateEnvelope.js +75 -9
- package/dist/src/validateEnvelope.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/lafs.md +3 -4
- package/package.json +6 -3
- package/dist/src/mcpAdapter.d.ts +0 -29
- package/dist/src/mcpAdapter.d.ts.map +0 -1
- package/dist/src/mcpAdapter.js +0 -286
- package/dist/src/mcpAdapter.js.map +0 -1
- package/schemas/v1/conformance-profiles.d.ts +0 -15
- package/schemas/v1/envelope.schema.d.ts +0 -14
- package/schemas/v1/error-registry.d.ts +0 -24
package/dist/src/a2a/bridge.d.ts
CHANGED
|
@@ -4,97 +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
|
*/
|
|
9
15
|
import type { AgentCard, Artifact, JSONRPCErrorResponse, Message, MessageSendConfiguration, Part, SendMessageResponse, SendMessageSuccessResponse, Task, TaskState, TaskStatus } from '@a2a-js/sdk';
|
|
10
16
|
import { AGENT_CARD_PATH, HTTP_EXTENSION_HEADER } 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;
|
|
119
|
+
/**
|
|
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
|
+
*/
|
|
60
126
|
constructor(result: SendMessageResponse, _config: LafsA2AConfig, _requestId: string);
|
|
61
127
|
/**
|
|
62
|
-
* Get the raw A2A response
|
|
128
|
+
* Get the raw A2A response.
|
|
129
|
+
*
|
|
130
|
+
* @returns The underlying SendMessageResponse object
|
|
63
131
|
*/
|
|
64
132
|
getA2AResult(): SendMessageResponse;
|
|
65
133
|
/**
|
|
66
|
-
* 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
|
|
67
137
|
*/
|
|
68
138
|
isError(): boolean;
|
|
69
139
|
/**
|
|
70
|
-
* 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
|
|
71
143
|
*/
|
|
72
144
|
getError(): JSONRPCErrorResponse | null;
|
|
73
145
|
/**
|
|
74
|
-
* Get success result
|
|
146
|
+
* Get the success result.
|
|
147
|
+
*
|
|
148
|
+
* @returns The success response, or null if the result is an error
|
|
75
149
|
*/
|
|
76
150
|
getSuccess(): SendMessageSuccessResponse | null;
|
|
77
151
|
/**
|
|
78
|
-
* 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
|
|
79
159
|
*/
|
|
80
160
|
getTask(): Task | null;
|
|
81
161
|
/**
|
|
82
|
-
* 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
|
|
83
169
|
*/
|
|
84
170
|
getMessage(): Message | null;
|
|
85
171
|
/**
|
|
86
|
-
* 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
|
|
87
175
|
*/
|
|
88
176
|
hasLafsEnvelope(): boolean;
|
|
89
177
|
/**
|
|
90
|
-
* Extract LAFS envelope from A2A artifact
|
|
178
|
+
* Extract a LAFS envelope from A2A artifact.
|
|
91
179
|
*
|
|
180
|
+
* @remarks
|
|
92
181
|
* A2A agents can return LAFS envelopes in artifacts for structured data.
|
|
93
|
-
* 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
|
|
94
186
|
*/
|
|
95
187
|
getLafsEnvelope(): LAFSEnvelope | null;
|
|
96
188
|
/**
|
|
97
|
-
* 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
|
|
98
197
|
*/
|
|
99
198
|
getTokenEstimate(): {
|
|
100
199
|
estimated: number;
|
|
@@ -102,34 +201,59 @@ export declare class LafsA2AResult {
|
|
|
102
201
|
truncated?: boolean;
|
|
103
202
|
} | null;
|
|
104
203
|
/**
|
|
105
|
-
* Get task status
|
|
204
|
+
* Get the task status.
|
|
205
|
+
*
|
|
206
|
+
* @returns The task's current status, or null if no task is present
|
|
106
207
|
*/
|
|
107
208
|
getTaskStatus(): TaskStatus | null;
|
|
108
209
|
/**
|
|
109
|
-
* Get task state
|
|
210
|
+
* Get the task state.
|
|
211
|
+
*
|
|
212
|
+
* @returns The task's current state string, or null if no task is present
|
|
110
213
|
*/
|
|
111
214
|
getTaskState(): TaskState | null;
|
|
112
215
|
/**
|
|
113
|
-
* 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
|
|
114
222
|
*/
|
|
115
223
|
isTerminal(): boolean;
|
|
116
224
|
/**
|
|
117
|
-
* Check if task requires input
|
|
225
|
+
* Check if the task requires user input.
|
|
226
|
+
*
|
|
227
|
+
* @returns True if the task state is `input-required`
|
|
118
228
|
*/
|
|
119
229
|
isInputRequired(): boolean;
|
|
120
230
|
/**
|
|
121
|
-
* Check if task requires authentication
|
|
231
|
+
* Check if the task requires authentication.
|
|
232
|
+
*
|
|
233
|
+
* @returns True if the task state is `auth-required`
|
|
122
234
|
*/
|
|
123
235
|
isAuthRequired(): boolean;
|
|
124
236
|
/**
|
|
125
|
-
* 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
|
|
126
240
|
*/
|
|
127
241
|
getArtifacts(): Artifact[];
|
|
242
|
+
/** Type guard: checks whether a Part is a DataPart by inspecting its `kind` field. */
|
|
128
243
|
private isDataPart;
|
|
244
|
+
/** Heuristic check: returns true if the data object looks like a LAFS envelope (has `$schema`, `_meta`, `success`). */
|
|
129
245
|
private isLafsEnvelope;
|
|
130
246
|
}
|
|
131
247
|
/**
|
|
132
|
-
* 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
|
|
133
257
|
*
|
|
134
258
|
* @example
|
|
135
259
|
* ```typescript
|
|
@@ -145,27 +269,98 @@ export declare class LafsA2AResult {
|
|
|
145
269
|
*/
|
|
146
270
|
export declare function createLafsArtifact(envelope: LAFSEnvelope): Artifact;
|
|
147
271
|
/**
|
|
148
|
-
* 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
|
+
* ```
|
|
149
285
|
*/
|
|
150
286
|
export declare function createTextArtifact(text: string, name?: string): Artifact;
|
|
151
287
|
/**
|
|
152
|
-
* 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
|
+
* ```
|
|
153
308
|
*/
|
|
154
309
|
export declare function createFileArtifact(fileUrl: string, mediaType: string, filename?: string): Artifact;
|
|
155
310
|
/**
|
|
156
|
-
* 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
|
+
* ```
|
|
157
327
|
*/
|
|
158
328
|
export declare function isExtensionRequired(agentCard: AgentCard, extensionUri: string): boolean;
|
|
159
329
|
/**
|
|
160
|
-
* 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
|
+
* ```
|
|
161
346
|
*/
|
|
162
347
|
export declare function getExtensionParams(agentCard: AgentCard, extensionUri: string): Record<string, unknown> | undefined;
|
|
163
348
|
/**
|
|
164
|
-
* 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
|
+
*
|
|
165
355
|
* Reference: specs/external/agent-discovery.md
|
|
166
356
|
*/
|
|
167
357
|
/**
|
|
168
|
-
* 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
|
+
*
|
|
169
364
|
* Reference: specs/external/extensions.md
|
|
170
365
|
*/
|
|
171
366
|
export { AGENT_CARD_PATH, HTTP_EXTENSION_HEADER };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../src/a2a/bridge.ts"],"names":[],"mappings":"AAAA
|
|
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,sC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