Functions & Classes
| Symbol | Kind | Description |
|---|---|---|
parseExtensionsHeader() | function | Parse A2A-Extensions header value into URI array. |
negotiateExtensions() | function | Negotiate extensions between client-requested and agent-declared sets. |
formatExtensionsHeader() | function | Format activated extension URIs into header value. |
buildLafsExtension() | function | Build an A2A AgentExtension object declaring LAFS support. |
buildExtension() | function | Build a generic A2A AgentExtension object. |
isValidExtensionKind() | function | Check whether a string is a valid extension kind. |
validateExtensionDeclaration() | function | Validate an A2A extension declaration for correctness. |
ExtensionSupportRequiredError | class | Error thrown when required A2A extensions are not supported by the client. |
extensionNegotiationMiddleware() | function | Express middleware for A2A extension negotiation. |
discoveryMiddleware() | function | Create Express middleware for serving A2A Agent Card. |
discoveryFastifyPlugin() | function | Fastify plugin for A2A Agent Card discovery. |
TokenEstimator | class | Character-based token estimator for JSON payloads. |
estimateTokens() | function | Convenience function to estimate tokens for a value. |
estimateTokensJSON() | function | Convenience function to estimate tokens from a JSON string. |
isMVILevel() | function | Type guard that checks whether an unknown value is a valid MVILevel. |
isAgentAction() | function | Type guard that checks whether an unknown value is a valid LAFSAgentAction. |
applyBudgetEnforcement() | function | Apply budget enforcement to an envelope. |
withBudget() | function | Create a budget enforcement middleware function. |
checkBudget() | function | Check if an envelope has exceeded its budget without modifying it. |
withBudgetSync() | function | Synchronous version of withBudget for non-async contexts. |
wrapWithBudget() | function | Higher-order function that wraps a handler with budget enforcement. |
composeMiddleware() | function | Compose multiple middleware functions into a single middleware. |
getConformanceProfiles() | function | Loads the conformance profiles from the bundled JSON schema. |
getChecksForTier() | function | Returns the list of check names that belong to the given conformance tier. |
validateConformanceProfiles() | function | Validates that the conformance profiles are internally consistent and referen… |
getErrorRegistry() | function | Loads the full LAFS error registry from the bundled JSON. |
isRegisteredErrorCode() | function | Checks whether a given error code exists in the LAFS error registry. |
getRegistryCode() | function | Retrieves the full registry entry for a given error code. |
getAgentAction() | function | Returns the default agent action for a given error code. |
getTypeUri() | function | Returns the RFC 9457 type URI for a given error code. |
getDocUrl() | function | Returns the documentation URL for a given error code. |
getTransportMapping() | function | Resolves the transport-specific status value for a given error code and trans… |
LAFSFlagError | class | Error thrown when LAFS flag validation fails. |
resolveOutputFormat() | function | Resolve the output format from flag inputs using the LAFS precedence chain. |
isNativeAvailable() | function | Check if the native addon is available. |
getNativeModule() | function | Get the native module, or null if unavailable. |
validateEnvelope() | function | Validates an unknown input against the LAFS envelope JSON Schema (Draft-07). |
assertEnvelope() | function | Validates input and throws on schema failure, returning a typed envelope on s… |
runEnvelopeConformance() | function | Runs the full suite of LAFS envelope conformance checks. |
runFlagConformance() | function | Runs LAFS flag-semantics conformance checks against a set of flag inputs. |
ComplianceError | class | Error thrown when assertCompliance or withCompliance detects failures. |
enforceCompliance() | function | Runs the full LAFS compliance pipeline against an unknown input value. |
assertCompliance() | function | Validates input and throws ComplianceError on any failure. |
withCompliance() | function | Wraps an envelope-producing function with automatic compliance enforcement. |
createComplianceMiddleware() | function | Creates a ComplianceMiddleware that enforces LAFS compliance on the next ha… |
getDeprecationRegistry() | function | Retrieve all registered deprecation entries. |
detectDeprecatedEnvelopeFields() | function | Detect deprecated field usage in a LAFS envelope. |
emitDeprecationWarnings() | function | Emit deprecation warnings by attaching them to the envelope metadata. |
createEnvelope() | function | Create a fully validated LAFS envelope from a success or error input. |
LafsError | class | Error subclass that carries the full LAFSError payload. |
parseLafsResponse() | function | Parse and unwrap a raw LAFS envelope, returning the result or throwing on error. |
resolveFieldExtraction() | function | Resolve field extraction flags into a validated configuration. |
extractFieldFromResult() | function | Extract a named field from a LAFS result object. |
extractFieldFromEnvelope() | function | Extract a named field from an envelope’s result. |
applyFieldFilter() | function | Filter result fields in a LAFS envelope to the requested subset. |
resolveFlags() | function | Resolve all flags across both layers and validate cross-layer semantics. |
LafsA2AResult | class | Wrapper for A2A responses with LAFS envelope support. |
createLafsArtifact() | function | Create a LAFS envelope artifact for A2A. |
createTextArtifact() | function | Create a text artifact. |
createFileArtifact() | function | Create a file artifact. |
isExtensionRequired() | function | Check if an extension is required in an Agent Card. |
getExtensionParams() | function | Get extension parameters from an Agent Card. |
isValidTransition() | function | Check if a transition from one state to another is valid. |
isTerminalState() | function | Check if a state is terminal (no further transitions allowed). |
isInterruptedState() | function | Check if a state is interrupted (paused awaiting input). |
InvalidStateTransitionError | class | Thrown when attempting an invalid state transition. |
TaskImmutabilityError | class | Thrown when attempting to modify a task in a terminal state. |
TaskNotFoundError | class | Thrown when a task is not found. |
TaskRefinementError | class | Thrown when a refinement/follow-up task references invalid parent tasks. |
TaskManager | class | In-memory task manager implementing A2A task lifecycle. |
attachLafsEnvelope() | function | Attach a LAFS envelope as an artifact to an A2A task. |
TaskEventBus | class | In-memory event bus for task lifecycle streaming events. |
streamTaskEvents() | function | Build an async iterator for real-time task stream events. |
PushNotificationConfigStore | class | In-memory manager for async push-notification configs. |
PushNotificationDispatcher | class | Deliver task updates to registered push-notification webhooks. |
TaskArtifactAssembler | class | Applies append/lastChunk artifact deltas into task-local snapshots. |
createJsonRpcRequest() | function | Create a JSON-RPC 2.0 request object. |
createJsonRpcResponse() | function | Create a JSON-RPC 2.0 success response. |
createJsonRpcErrorResponse() | function | Create a JSON-RPC 2.0 error response. |
createA2AErrorResponse() | function | Create an A2A-specific JSON-RPC error response by error type name. |
validateJsonRpcRequest() | function | Validate the structure of a JSON-RPC request. |
isA2AError() | function | Check if a numeric error code is an A2A-specific error. |
createGrpcStatus() | function | Create a gRPC Status object for an A2A error type. |
createProblemDetails() | function | Create an RFC 9457 Problem Details object for an A2A error. |
createLafsProblemDetails() | function | Create an RFC 9457 Problem Details object bridging A2A error types with LAFS… |
buildUrl() | function | Build a URL by substituting path parameters. |
parseListTasksQuery() | function | Parse camelCase query parameters for the ListTasks endpoint. |
getErrorCodeMapping() | function | Get the complete error code mapping for a given A2A error type. |
parseA2AVersionHeader() | function | Parse the a2a-version header into an array of version strings. |
negotiateA2AVersion() | function | Negotiate an A2A protocol version from the client’s requested versions. |
CircuitBreakerError | class | Error thrown when a circuit breaker rejects a call. |
CircuitBreaker | class | Circuit breaker for protecting against cascading failures. |
CircuitBreakerRegistry | class | Registry for managing multiple named circuit breakers. |
circuitBreakerMiddleware() | function | Create an Express middleware that wraps downstream handlers with a circuit br… |
healthCheck() | function | Health check middleware for Express applications. |
createDatabaseHealthCheck() | function | Create a health check function that verifies database connectivity. |
createExternalServiceHealthCheck() | function | Create a health check function that probes an external HTTP service. |
livenessProbe() | function | Liveness probe — a minimal check confirming the process is running. |
readinessProbe() | function | Readiness probe — verifies the service can accept traffic. |
projectEnvelope() | function | Project an envelope to the declared MVI verbosity level. |
estimateProjectedTokens() | function | Estimate token count for a projected envelope. |
lafsErrorToProblemDetails() | function | Convert a LAFSError to an RFC 9457 Problem Details object. |
gracefulShutdown() | function | Enable graceful shutdown for an HTTP server. |
isShuttingDown() | function | Check whether a shutdown sequence is currently in progress. |
getShutdownState() | function | Get a snapshot of the current shutdown state. |
forceShutdown() | function | Terminate the process immediately without waiting for connections to drain. |
shutdownMiddleware() | function | Express middleware that rejects requests with 503 while the server is shuttin… |
waitForShutdown() | function | Wait until a shutdown sequence begins. |
Types & Interfaces
| Symbol | Kind | Description |
|---|---|---|
LafsExtensionParams | interface | LAFS extension parameters declared in Agent Card |
ExtensionKind | type | Classification of an A2A extension’s behavior. |
ExtensionNegotiationResult | interface | Result of extension negotiation between client and agent |
BuildLafsExtensionOptions | interface | Options for building the LAFS extension declaration |
BuildExtensionOptions | interface | Options for building a generic A2A extension declaration |
ExtensionNegotiationMiddlewareOptions | interface | Options for the extension negotiation middleware |
AgentProvider | interface | A2A Agent Provider information. |
AgentCapabilities | interface | A2A Agent Capabilities. |
AgentExtension | interface | A2A Agent Extension declaration. |
AgentSkill | interface | A2A Agent Skill. |
SecurityScheme | interface | Security scheme for authentication (OpenAPI 3.0 style). |
AgentCard | interface | A2A v1.0 Agent Card - Standard format for agent discovery. |
Capability | interface | Legacy capability descriptor. |
ServiceConfig | interface | Legacy service configuration. |
EndpointConfig | interface | Legacy endpoint configuration. |
DiscoveryDocument | interface | Legacy discovery document format. |
DiscoveryConfig | interface | Configuration for the discovery middleware (A2A v1.0 format). |
DiscoveryMiddlewareOptions | interface | Discovery middleware options. |
TokenEstimatorOptions | interface | Configuration options for the token estimator. |
LAFSTransport | type | Transport protocol used to deliver a LAFS envelope. |
LAFSErrorCategory | type | Classification category for a LAFS error. |
Warning | interface | A non-fatal warning attached to a LAFS envelope’s _meta.warnings array. |
MVILevel | type | Minimum Viable Information level controlling envelope verbosity. |
LAFSMeta | interface | Metadata block (_meta) embedded in every LAFS envelope. |
LAFSAgentAction | type | Recommended action an LLM agent should take in response to an error. |
LAFSError | interface | Structured error payload returned in a failing LAFS envelope. |
LAFSPageCursor | interface | Cursor-based pagination metadata. |
LAFSPageOffset | interface | Offset-based pagination metadata. |
LAFSPageNone | interface | Sentinel pagination mode indicating no pagination is applied. |
LAFSPage | type | Discriminated union of all supported pagination modes. |
ContextLedgerEntry | interface | A single entry in the context ledger recording one state mutation. |
ContextLedger | interface | Append-only ledger tracking context mutations across agent interactions. |
LAFSEnvelope | interface | Top-level LAFS response envelope wrapping every operation result. |
FlagInput | interface | Input parameters for resolving the output format via flag semantics. |
ConformanceReport | interface | Result of a LAFS conformance test run. |
BudgetEnforcementOptions | type | Options controlling token-budget enforcement behaviour. |
TokenEstimate | interface | Token-count estimate attached to a budget-aware envelope. |
LAFSMetaWithBudget | interface | Extended metadata block that includes an optional token-budget estimate. |
LAFSEnvelopeWithBudget | interface | LAFS envelope variant whose metadata includes token-budget estimates. |
MiddlewareFunction | type | Middleware function that transforms a LAFS envelope. |
NextFunction | type | Continuation function passed to BudgetMiddleware to invoke the next middlew… |
BudgetMiddleware | type | Middleware function for token-budget enforcement with chain delegation. |
BudgetEnforcementResult | interface | Outcome of running budget enforcement on a LAFS envelope. |
ConformanceTier | type | Named conformance tier indicating the breadth of checks applied. |
ConformanceProfiles | interface | Schema for the conformance-profiles JSON file. |
RegistryCode | interface | A single entry in the LAFS error-code registry. |
ErrorRegistry | interface | Top-level shape of the LAFS error-registry JSON file. |
TransportMapping | type | A transport-specific status value resolved from the error registry. |
FlagResolution | interface | Result of resolving output format flags. |
NativeValidationResult | interface | Shape of the validation result from the native binding. |
StructuredValidationError | interface | Structured representation of a single schema validation error. |
EnvelopeValidationResult | interface | Result of validating a value against the LAFS envelope JSON Schema. |
EnvelopeConformanceOptions | interface | Options for configuring envelope conformance checking. |
ComplianceStage | type | Identifies which stage of the compliance pipeline produced an issue. |
ComplianceIssue | interface | Describes a single compliance failure detected during enforcement. |
EnforceComplianceOptions | interface | Options controlling which compliance stages are executed. |
ComplianceResult | interface | Aggregated result of a full LAFS compliance run. |
ComplianceMiddleware | type | Middleware signature for intercepting LAFS envelopes in a pipeline. |
DeprecationEntry | interface | A single deprecation rule in the registry. |
CreateEnvelopeMetaInput | interface | Input for constructing the _meta block of a LAFS envelope. |
CreateEnvelopeSuccessInput | interface | Input for creating a successful LAFS envelope. |
CreateEnvelopeErrorInput | interface | Input for creating a failing LAFS envelope. |
CreateEnvelopeInput | type | Discriminated union of success and error inputs for createEnvelope. |
ParseLafsResponseOptions | interface | Options for parseLafsResponse. |
FieldExtractionInput | interface | Input flags for the field extraction layer. |
FieldExtractionResolution | interface | Resolved field extraction configuration. |
UnifiedFlagInput | interface | Combined input for both format and field extraction layers. |
UnifiedFlagResolution | interface | Combined resolution result with cross-layer warnings. |
LafsA2AConfig | interface | Configuration for LAFS A2A integration. |
LafsSendMessageParams | interface | Request parameters for sending messages. |
CreateTaskOptions | interface | Options for creating a new task |
ListTasksOptions | interface | Options for listing tasks |
ListTasksResult | interface | Paginated result from listTasks |
TaskStreamEvent | type | Union type of task stream events emitted by the event bus. |
StreamIteratorOptions | interface | Options for the stream task events async iterator |
PushNotificationDeliveryResult | interface | Result of delivering a push notification to a single webhook |
PushTransport | type | Transport function for sending HTTP requests to push-notification webhooks. |
JsonRpcMethod | type | Union of all valid JSON-RPC method string values from JSONRPC_METHODS |
A2AErrorType | type | Union of A2A error type key names from JSONRPC_A2A_ERROR_CODES |
JsonRpcRequest | interface | A JSON-RPC 2.0 request object. |
JsonRpcResponse | interface | A JSON-RPC 2.0 success response object. |
JsonRpcErrorResponse | interface | A JSON-RPC 2.0 error response object. |
GrpcStatusCode | type | Numeric gRPC status code value (0-16) |
GrpcStatusName | type | String name of a gRPC status code (e.g. "OK", "NOT_FOUND") |
GrpcServiceMethod | interface | Descriptor for a single gRPC service method. |
GrpcStatus | interface | gRPC Status object for A2A errors. |
GrpcErrorInfo | interface | Equivalent of google.rpc.ErrorInfo for structured gRPC error details. |
HttpEndpoint | type | Union of all HTTP endpoint descriptor objects from HTTP_ENDPOINTS |
ProblemDetails | interface | RFC 9457 Problem Details object. |
ListTasksQueryParams | interface | Parsed query parameters for the ListTasks endpoint. |
ErrorCodeMapping | interface | Complete error code mapping across all three transports. |
CircuitState | type | Represents the three possible states of a circuit breaker. |
CircuitBreakerConfig | interface | Configuration options for a CircuitBreaker instance. |
CircuitBreakerMetrics | interface | Snapshot of runtime metrics for a CircuitBreaker. |
HealthCheckConfig | interface | Configuration for the healthCheck middleware. |
HealthCheckFunction | type | A function that performs a single health check. |
HealthCheckResult | interface | Result of an individual health check. |
HealthStatus | interface | Aggregated health status returned by the health endpoint. |
LafsProblemDetails | interface | RFC 9457 Problem Details with LAFS extensions. |
GracefulShutdownConfig | interface | Configuration for the gracefulShutdown handler. |
ShutdownState | interface | Snapshot of the current shutdown state. |
Other Exports
| Symbol | Kind | Description |
|---|---|---|
LAFS_EXTENSION_URI | variable | Canonical LAFS extension URI |
A2A_EXTENSIONS_HEADER | variable | Canonical A2A Extensions header per spec Section 3.2.6 |
extensions.ts | file | |
discovery.ts | file | |
discovery-server.ts | file | |
defaultEstimator | variable | Global token estimator instance with default settings. |
tokenEstimator.ts | file | |
MVI_LEVELS | variable | Immutable set of all valid MVILevel values. |
AGENT_ACTIONS | variable | Immutable set of all valid LAFSAgentAction values. |
types.ts | file | |
budgetEnforcement.ts | file | |
conformance-profiles.json | file | |
conformanceProfiles.ts | file | |
error-registry.json | file | |
errorRegistry.ts | file | |
flagSemantics.ts | file | |
native-loader.ts | file | |
validateEnvelope.ts | file | |
conformance.ts | file | |
cli.ts | file | |
compliance.ts | file | |
deprecationRegistry.ts | file | |
LAFS_SCHEMA_URL | variable | Canonical JSON Schema URL for the LAFS v1 envelope. |
CATEGORY_ACTION_MAP | variable | Default agent action for each error category. |
envelope.ts | file | |
fieldExtraction.ts | file | |
flagResolver.ts | file | |
bridge.ts | file | |
TERMINAL_STATES | variable | States from which no further transitions are possible |
INTERRUPTED_STATES | variable | States where the task is paused awaiting external input |
VALID_TRANSITIONS | variable | Valid state transitions (adjacency map). Terminal states have empty outgoing… |
task-lifecycle.ts | file | |
streaming.ts | file | |
JSONRPC_METHODS | variable | All JSON-RPC method names defined by the A2A protocol. |
JSONRPC_STANDARD_ERROR_CODES | variable | Standard JSON-RPC 2.0 error codes. |
JSONRPC_A2A_ERROR_CODES | variable | A2A-specific error codes (-32001 through -32009). |
jsonrpc.ts | file | |
GRPC_STATUS_CODE | variable | Standard gRPC status codes (numeric values 0-16). |
A2A_GRPC_STATUS_CODES | variable | Maps A2A error types to gRPC status names. |
A2A_GRPC_ERROR_REASONS | variable | UPPER_SNAKE_CASE error reasons without “Error” suffix. |
A2A_GRPC_ERROR_DOMAIN | variable | Error domain for A2A gRPC errors. |
GRPC_SERVICE_METHODS | variable | gRPC service method definitions for the A2A protocol. |
GRPC_METADATA_VERSION_KEY | variable | gRPC metadata key for A2A protocol version. |
GRPC_METADATA_EXTENSIONS_KEY | variable | gRPC metadata key for activated A2A extensions. |
grpc.ts | file | |
HTTP_ENDPOINTS | variable | HTTP+JSON endpoint definitions for each A2A operation. |
A2A_HTTP_STATUS_CODES | variable | Maps A2A error types to HTTP status codes. |
A2A_ERROR_TYPE_URIS | variable | RFC 9457 Problem Details type URIs for A2A errors. |
http.ts | file | |
A2A_ERROR_MAPPINGS | variable | Precomputed cross-binding error mapping for all 9 A2A error types. |
SUPPORTED_A2A_VERSIONS | variable | Supported A2A protocol versions. |
DEFAULT_A2A_VERSION | variable | Default A2A protocol version used when none is requested. |
index.ts | file | A2A Protocol Bindings - Barrel Export Re-exports all binding modules and pro… |
index.ts | file | |
index.ts | file | |
index.ts | file | LAFS Health Check Module Provides health check endpoints for monitoring and… |
mviProjection.ts | file | |
PROBLEM_DETAILS_CONTENT_TYPE | variable | Content-Type for RFC 9457 Problem Details responses. |
problemDetails.ts | file | |
index.ts | file | LAFS Graceful Shutdown Module Handles graceful shutdown of LAFS servers. |
index.ts | file | |
a2aBridge.test.ts | file | |
agentAction.test.ts | file | |
bindings.test.ts | file | |
budgetEnforcement.test.ts | file | |
compliance.test.ts | file | |
conformanceProfiles.test.ts | file | |
deprecationMigration.test.ts | file | |
discovery.test.ts | file | |
envelope.test.ts | file | |
envelopeApi.test.ts | file | |
extensions.test.ts | file | |
fieldExtraction.test.ts | file | |
flag-resolver.test.ts | file | |
flags.test.ts | file | |
mviProjection.test.ts | file | |
problemDetails.test.ts | file | |
streamingAsync.test.ts | file | |
structuredValidation.test.ts | file | |
task-lifecycle.test.ts | file |