@cleocode/lafs 2026.4.0 → 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/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.js
CHANGED
|
@@ -4,6 +4,12 @@
|
|
|
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 { AGENT_CARD_PATH, HTTP_EXTENSION_HEADER } from '@a2a-js/sdk';
|
|
@@ -11,27 +17,46 @@ import { AGENT_CARD_PATH, HTTP_EXTENSION_HEADER } from '@a2a-js/sdk';
|
|
|
11
17
|
// Result Wrapper
|
|
12
18
|
// ============================================================================
|
|
13
19
|
/**
|
|
14
|
-
* Wrapper for A2A responses with LAFS envelope support
|
|
20
|
+
* Wrapper for A2A responses with LAFS envelope support.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* Provides typed accessors for extracting tasks, messages, LAFS envelopes,
|
|
24
|
+
* token estimates, and state information from raw A2A `SendMessageResponse`
|
|
25
|
+
* objects. All methods are null-safe and return `null` when the expected
|
|
26
|
+
* data is not present.
|
|
15
27
|
*/
|
|
16
28
|
export class LafsA2AResult {
|
|
17
29
|
result;
|
|
30
|
+
/**
|
|
31
|
+
* Create a LafsA2AResult wrapper.
|
|
32
|
+
*
|
|
33
|
+
* @param result - Raw A2A SendMessageResponse to wrap
|
|
34
|
+
* @param _config - LAFS A2A configuration (reserved for future use)
|
|
35
|
+
* @param _requestId - Request ID for correlation (reserved for future use)
|
|
36
|
+
*/
|
|
18
37
|
constructor(result, _config, _requestId) {
|
|
19
38
|
this.result = result;
|
|
20
39
|
}
|
|
21
40
|
/**
|
|
22
|
-
* Get the raw A2A response
|
|
41
|
+
* Get the raw A2A response.
|
|
42
|
+
*
|
|
43
|
+
* @returns The underlying SendMessageResponse object
|
|
23
44
|
*/
|
|
24
45
|
getA2AResult() {
|
|
25
46
|
return this.result;
|
|
26
47
|
}
|
|
27
48
|
/**
|
|
28
|
-
* Check if result is an error
|
|
49
|
+
* Check if the result is an error response.
|
|
50
|
+
*
|
|
51
|
+
* @returns True if the response contains a JSON-RPC error
|
|
29
52
|
*/
|
|
30
53
|
isError() {
|
|
31
54
|
return 'error' in this.result;
|
|
32
55
|
}
|
|
33
56
|
/**
|
|
34
|
-
* Get error details if result is an error
|
|
57
|
+
* Get error details if the result is an error.
|
|
58
|
+
*
|
|
59
|
+
* @returns The JSON-RPC error response, or null if the result is a success
|
|
35
60
|
*/
|
|
36
61
|
getError() {
|
|
37
62
|
if (this.isError()) {
|
|
@@ -40,7 +65,9 @@ export class LafsA2AResult {
|
|
|
40
65
|
return null;
|
|
41
66
|
}
|
|
42
67
|
/**
|
|
43
|
-
* Get success result
|
|
68
|
+
* Get the success result.
|
|
69
|
+
*
|
|
70
|
+
* @returns The success response, or null if the result is an error
|
|
44
71
|
*/
|
|
45
72
|
getSuccess() {
|
|
46
73
|
if (!this.isError()) {
|
|
@@ -49,7 +76,13 @@ export class LafsA2AResult {
|
|
|
49
76
|
return null;
|
|
50
77
|
}
|
|
51
78
|
/**
|
|
52
|
-
* Extract Task from response (if present)
|
|
79
|
+
* Extract a Task from the response (if present).
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
* Checks the success result for an object with `id` and `status` properties,
|
|
83
|
+
* which identifies it as a Task rather than a Message.
|
|
84
|
+
*
|
|
85
|
+
* @returns The extracted Task, or null if not present or result is an error
|
|
53
86
|
*/
|
|
54
87
|
getTask() {
|
|
55
88
|
const success = this.getSuccess();
|
|
@@ -66,7 +99,13 @@ export class LafsA2AResult {
|
|
|
66
99
|
return null;
|
|
67
100
|
}
|
|
68
101
|
/**
|
|
69
|
-
* Extract Message from response (if present)
|
|
102
|
+
* Extract a Message from the response (if present).
|
|
103
|
+
*
|
|
104
|
+
* @remarks
|
|
105
|
+
* Checks the success result for an object with `messageId` but without
|
|
106
|
+
* `status`, which distinguishes it from a Task.
|
|
107
|
+
*
|
|
108
|
+
* @returns The extracted Message, or null if not present or result is an error
|
|
70
109
|
*/
|
|
71
110
|
getMessage() {
|
|
72
111
|
const success = this.getSuccess();
|
|
@@ -82,16 +121,22 @@ export class LafsA2AResult {
|
|
|
82
121
|
return null;
|
|
83
122
|
}
|
|
84
123
|
/**
|
|
85
|
-
* Check if response contains a LAFS envelope
|
|
124
|
+
* Check if the response contains a LAFS envelope.
|
|
125
|
+
*
|
|
126
|
+
* @returns True if a LAFS envelope was found in the task's artifacts
|
|
86
127
|
*/
|
|
87
128
|
hasLafsEnvelope() {
|
|
88
129
|
return this.getLafsEnvelope() !== null;
|
|
89
130
|
}
|
|
90
131
|
/**
|
|
91
|
-
* Extract LAFS envelope from A2A artifact
|
|
132
|
+
* Extract a LAFS envelope from A2A artifact.
|
|
92
133
|
*
|
|
134
|
+
* @remarks
|
|
93
135
|
* A2A agents can return LAFS envelopes in artifacts for structured data.
|
|
94
|
-
* This method
|
|
136
|
+
* This method scans all artifacts for a DataPart containing an object
|
|
137
|
+
* with `$schema`, `_meta`, and `success` fields (the LAFS envelope shape).
|
|
138
|
+
*
|
|
139
|
+
* @returns The first LAFS envelope found, or null if none present
|
|
95
140
|
*/
|
|
96
141
|
getLafsEnvelope() {
|
|
97
142
|
const task = this.getTask();
|
|
@@ -110,7 +155,14 @@ export class LafsA2AResult {
|
|
|
110
155
|
return null;
|
|
111
156
|
}
|
|
112
157
|
/**
|
|
113
|
-
* Get token estimate from LAFS envelope
|
|
158
|
+
* Get token estimate from LAFS envelope.
|
|
159
|
+
*
|
|
160
|
+
* @remarks
|
|
161
|
+
* Extracts the `_tokenEstimate` field from the LAFS envelope's `_meta`
|
|
162
|
+
* section, which contains estimated token usage, budget, and truncation
|
|
163
|
+
* information.
|
|
164
|
+
*
|
|
165
|
+
* @returns Token estimate object, or null if no envelope or no estimate present
|
|
114
166
|
*/
|
|
115
167
|
getTokenEstimate() {
|
|
116
168
|
const envelope = this.getLafsEnvelope();
|
|
@@ -121,19 +173,28 @@ export class LafsA2AResult {
|
|
|
121
173
|
return meta._tokenEstimate ?? null;
|
|
122
174
|
}
|
|
123
175
|
/**
|
|
124
|
-
* Get task status
|
|
176
|
+
* Get the task status.
|
|
177
|
+
*
|
|
178
|
+
* @returns The task's current status, or null if no task is present
|
|
125
179
|
*/
|
|
126
180
|
getTaskStatus() {
|
|
127
181
|
return this.getTask()?.status ?? null;
|
|
128
182
|
}
|
|
129
183
|
/**
|
|
130
|
-
* Get task state
|
|
184
|
+
* Get the task state.
|
|
185
|
+
*
|
|
186
|
+
* @returns The task's current state string, or null if no task is present
|
|
131
187
|
*/
|
|
132
188
|
getTaskState() {
|
|
133
189
|
return this.getTaskStatus()?.state ?? null;
|
|
134
190
|
}
|
|
135
191
|
/**
|
|
136
|
-
* Check if task is in a terminal state
|
|
192
|
+
* Check if the task is in a terminal state.
|
|
193
|
+
*
|
|
194
|
+
* @remarks
|
|
195
|
+
* Terminal states are `completed`, `failed`, `canceled`, and `rejected`.
|
|
196
|
+
*
|
|
197
|
+
* @returns True if the task is in a terminal state, false otherwise or if no task is present
|
|
137
198
|
*/
|
|
138
199
|
isTerminal() {
|
|
139
200
|
const state = this.getTaskState();
|
|
@@ -143,26 +204,34 @@ export class LafsA2AResult {
|
|
|
143
204
|
return terminalStates.includes(state);
|
|
144
205
|
}
|
|
145
206
|
/**
|
|
146
|
-
* Check if task requires input
|
|
207
|
+
* Check if the task requires user input.
|
|
208
|
+
*
|
|
209
|
+
* @returns True if the task state is `input-required`
|
|
147
210
|
*/
|
|
148
211
|
isInputRequired() {
|
|
149
212
|
return this.getTaskState() === 'input-required';
|
|
150
213
|
}
|
|
151
214
|
/**
|
|
152
|
-
* Check if task requires authentication
|
|
215
|
+
* Check if the task requires authentication.
|
|
216
|
+
*
|
|
217
|
+
* @returns True if the task state is `auth-required`
|
|
153
218
|
*/
|
|
154
219
|
isAuthRequired() {
|
|
155
220
|
return this.getTaskState() === 'auth-required';
|
|
156
221
|
}
|
|
157
222
|
/**
|
|
158
|
-
* Get all artifacts from task
|
|
223
|
+
* Get all artifacts from the task.
|
|
224
|
+
*
|
|
225
|
+
* @returns Array of task artifacts, or empty array if no task or no artifacts
|
|
159
226
|
*/
|
|
160
227
|
getArtifacts() {
|
|
161
228
|
return this.getTask()?.artifacts ?? [];
|
|
162
229
|
}
|
|
230
|
+
/** Type guard: checks whether a Part is a DataPart by inspecting its `kind` field. */
|
|
163
231
|
isDataPart(part) {
|
|
164
232
|
return part.kind === 'data';
|
|
165
233
|
}
|
|
234
|
+
/** Heuristic check: returns true if the data object looks like a LAFS envelope (has `$schema`, `_meta`, `success`). */
|
|
166
235
|
isLafsEnvelope(data) {
|
|
167
236
|
return (typeof data === 'object' &&
|
|
168
237
|
data !== null &&
|
|
@@ -175,7 +244,15 @@ export class LafsA2AResult {
|
|
|
175
244
|
// LAFS Artifact Creation Helpers
|
|
176
245
|
// ============================================================================
|
|
177
246
|
/**
|
|
178
|
-
* Create a LAFS envelope artifact for A2A
|
|
247
|
+
* Create a LAFS envelope artifact for A2A.
|
|
248
|
+
*
|
|
249
|
+
* @remarks
|
|
250
|
+
* Wraps a LAFS envelope in an A2A Artifact with a DataPart. The artifact
|
|
251
|
+
* is tagged with LAFS version and content type metadata for identification
|
|
252
|
+
* by consumers.
|
|
253
|
+
*
|
|
254
|
+
* @param envelope - LAFS envelope to wrap as an artifact
|
|
255
|
+
* @returns A2A Artifact containing the envelope as a DataPart
|
|
179
256
|
*
|
|
180
257
|
* @example
|
|
181
258
|
* ```typescript
|
|
@@ -207,7 +284,19 @@ export function createLafsArtifact(envelope) {
|
|
|
207
284
|
};
|
|
208
285
|
}
|
|
209
286
|
/**
|
|
210
|
-
* Create a text artifact
|
|
287
|
+
* Create a text artifact.
|
|
288
|
+
*
|
|
289
|
+
* @remarks
|
|
290
|
+
* Wraps a plain text string in an A2A Artifact with a TextPart.
|
|
291
|
+
*
|
|
292
|
+
* @param text - Text content for the artifact
|
|
293
|
+
* @param name - Display name for the artifact
|
|
294
|
+
* @returns A2A Artifact containing the text as a TextPart
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* ```typescript
|
|
298
|
+
* const artifact = createTextArtifact('Hello, world!', 'greeting');
|
|
299
|
+
* ```
|
|
211
300
|
*/
|
|
212
301
|
export function createTextArtifact(text, name = 'text_response') {
|
|
213
302
|
const part = {
|
|
@@ -221,7 +310,26 @@ export function createTextArtifact(text, name = 'text_response') {
|
|
|
221
310
|
};
|
|
222
311
|
}
|
|
223
312
|
/**
|
|
224
|
-
* Create a file artifact
|
|
313
|
+
* Create a file artifact.
|
|
314
|
+
*
|
|
315
|
+
* @remarks
|
|
316
|
+
* Wraps a file URI in an A2A Artifact with a FilePart. The media type
|
|
317
|
+
* and optional filename are included for proper content handling by
|
|
318
|
+
* consumers.
|
|
319
|
+
*
|
|
320
|
+
* @param fileUrl - URI pointing to the file resource
|
|
321
|
+
* @param mediaType - MIME type of the file (e.g., `application/pdf`)
|
|
322
|
+
* @param filename - Optional display filename for the artifact
|
|
323
|
+
* @returns A2A Artifact containing the file reference as a FilePart
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```typescript
|
|
327
|
+
* const artifact = createFileArtifact(
|
|
328
|
+
* 'https://example.com/report.pdf',
|
|
329
|
+
* 'application/pdf',
|
|
330
|
+
* 'report.pdf',
|
|
331
|
+
* );
|
|
332
|
+
* ```
|
|
225
333
|
*/
|
|
226
334
|
export function createFileArtifact(fileUrl, mediaType, filename) {
|
|
227
335
|
const part = {
|
|
@@ -250,14 +358,44 @@ function generateId() {
|
|
|
250
358
|
// Extension Helpers
|
|
251
359
|
// ============================================================================
|
|
252
360
|
/**
|
|
253
|
-
* Check if an extension is required
|
|
361
|
+
* Check if an extension is required in an Agent Card.
|
|
362
|
+
*
|
|
363
|
+
* @remarks
|
|
364
|
+
* Scans the agent card's declared extensions for one matching the given
|
|
365
|
+
* URI with `required: true`.
|
|
366
|
+
*
|
|
367
|
+
* @param agentCard - Agent Card to inspect
|
|
368
|
+
* @param extensionUri - URI of the extension to check
|
|
369
|
+
* @returns True if the extension is declared as required
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* ```typescript
|
|
373
|
+
* if (isExtensionRequired(agentCard, LAFS_EXTENSION_URI)) {
|
|
374
|
+
* console.log('LAFS extension is mandatory for this agent');
|
|
375
|
+
* }
|
|
376
|
+
* ```
|
|
254
377
|
*/
|
|
255
378
|
export function isExtensionRequired(agentCard, extensionUri) {
|
|
256
379
|
return (agentCard.capabilities?.extensions?.some((ext) => ext.uri === extensionUri && ext.required) ??
|
|
257
380
|
false);
|
|
258
381
|
}
|
|
259
382
|
/**
|
|
260
|
-
* Get extension parameters
|
|
383
|
+
* Get extension parameters from an Agent Card.
|
|
384
|
+
*
|
|
385
|
+
* @remarks
|
|
386
|
+
* Finds the extension matching the given URI and returns its `params` object.
|
|
387
|
+
*
|
|
388
|
+
* @param agentCard - Agent Card to inspect
|
|
389
|
+
* @param extensionUri - URI of the extension to look up
|
|
390
|
+
* @returns The extension's params object, or undefined if not found
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* ```typescript
|
|
394
|
+
* const params = getExtensionParams(agentCard, LAFS_EXTENSION_URI);
|
|
395
|
+
* if (params?.supportsTokenBudgets) {
|
|
396
|
+
* // Enable budget tracking
|
|
397
|
+
* }
|
|
398
|
+
* ```
|
|
261
399
|
*/
|
|
262
400
|
export function getExtensionParams(agentCard, extensionUri) {
|
|
263
401
|
return agentCard.capabilities?.extensions?.find((ext) => ext.uri === extensionUri)?.params;
|
|
@@ -266,11 +404,21 @@ export function getExtensionParams(agentCard, extensionUri) {
|
|
|
266
404
|
// Constants
|
|
267
405
|
// ============================================================================
|
|
268
406
|
/**
|
|
269
|
-
* A2A Agent Card well-known path
|
|
407
|
+
* A2A Agent Card well-known path.
|
|
408
|
+
*
|
|
409
|
+
* @remarks
|
|
410
|
+
* The standard path `/.well-known/agent-card.json` where A2A Agent Cards
|
|
411
|
+
* are published. Re-exported from the A2A SDK.
|
|
412
|
+
*
|
|
270
413
|
* Reference: specs/external/agent-discovery.md
|
|
271
414
|
*/
|
|
272
415
|
/**
|
|
273
|
-
* HTTP header for A2A Extensions
|
|
416
|
+
* HTTP header for A2A Extensions.
|
|
417
|
+
*
|
|
418
|
+
* @remarks
|
|
419
|
+
* Used to communicate extension activation between client and agent.
|
|
420
|
+
* Re-exported from the A2A SDK.
|
|
421
|
+
*
|
|
274
422
|
* Reference: specs/external/extensions.md
|
|
275
423
|
*/
|
|
276
424
|
export { AGENT_CARD_PATH, HTTP_EXTENSION_HEADER };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/a2a/bridge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../../src/a2a/bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAuBH,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAqGrE,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAa;IASd;IARV;;;;;;OAMG;IACH,Y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