Skip to main content

Functions & Classes

SymbolKindDescription
parseExtensionsHeader()functionParse A2A-Extensions header value into URI array.
negotiateExtensions()functionNegotiate extensions between client-requested and agent-declared sets.
formatExtensionsHeader()functionFormat activated extension URIs into header value.
buildLafsExtension()functionBuild an A2A AgentExtension object declaring LAFS support.
buildExtension()functionBuild a generic A2A AgentExtension object.
isValidExtensionKind()functionCheck whether a string is a valid extension kind.
validateExtensionDeclaration()functionValidate an A2A extension declaration for correctness.
ExtensionSupportRequiredErrorclassError thrown when required A2A extensions are not supported by the client.
extensionNegotiationMiddleware()functionExpress middleware for A2A extension negotiation.
discoveryMiddleware()functionCreate Express middleware for serving A2A Agent Card.
discoveryFastifyPlugin()functionFastify plugin for A2A Agent Card discovery.
TokenEstimatorclassCharacter-based token estimator for JSON payloads.
estimateTokens()functionConvenience function to estimate tokens for a value.
estimateTokensJSON()functionConvenience function to estimate tokens from a JSON string.
isMVILevel()functionType guard that checks whether an unknown value is a valid MVILevel.
isAgentAction()functionType guard that checks whether an unknown value is a valid LAFSAgentAction.
applyBudgetEnforcement()functionApply budget enforcement to an envelope.
withBudget()functionCreate a budget enforcement middleware function.
checkBudget()functionCheck if an envelope has exceeded its budget without modifying it.
withBudgetSync()functionSynchronous version of withBudget for non-async contexts.
wrapWithBudget()functionHigher-order function that wraps a handler with budget enforcement.
composeMiddleware()functionCompose multiple middleware functions into a single middleware.
getConformanceProfiles()functionLoads the conformance profiles from the bundled JSON schema.
getChecksForTier()functionReturns the list of check names that belong to the given conformance tier.
validateConformanceProfiles()functionValidates that the conformance profiles are internally consistent and referen…
getErrorRegistry()functionLoads the full LAFS error registry from the bundled JSON.
isRegisteredErrorCode()functionChecks whether a given error code exists in the LAFS error registry.
getRegistryCode()functionRetrieves the full registry entry for a given error code.
getAgentAction()functionReturns the default agent action for a given error code.
getTypeUri()functionReturns the RFC 9457 type URI for a given error code.
getDocUrl()functionReturns the documentation URL for a given error code.
getTransportMapping()functionResolves the transport-specific status value for a given error code and trans…
LAFSFlagErrorclassError thrown when LAFS flag validation fails.
resolveOutputFormat()functionResolve the output format from flag inputs using the LAFS precedence chain.
isNativeAvailable()functionCheck if the native addon is available.
getNativeModule()functionGet the native module, or null if unavailable.
validateEnvelope()functionValidates an unknown input against the LAFS envelope JSON Schema (Draft-07).
assertEnvelope()functionValidates input and throws on schema failure, returning a typed envelope on s…
runEnvelopeConformance()functionRuns the full suite of LAFS envelope conformance checks.
runFlagConformance()functionRuns LAFS flag-semantics conformance checks against a set of flag inputs.
ComplianceErrorclassError thrown when assertCompliance or withCompliance detects failures.
enforceCompliance()functionRuns the full LAFS compliance pipeline against an unknown input value.
assertCompliance()functionValidates input and throws ComplianceError on any failure.
withCompliance()functionWraps an envelope-producing function with automatic compliance enforcement.
createComplianceMiddleware()functionCreates a ComplianceMiddleware that enforces LAFS compliance on the next ha…
getDeprecationRegistry()functionRetrieve all registered deprecation entries.
detectDeprecatedEnvelopeFields()functionDetect deprecated field usage in a LAFS envelope.
emitDeprecationWarnings()functionEmit deprecation warnings by attaching them to the envelope metadata.
createEnvelope()functionCreate a fully validated LAFS envelope from a success or error input.
LafsErrorclassError subclass that carries the full LAFSError payload.
parseLafsResponse()functionParse and unwrap a raw LAFS envelope, returning the result or throwing on error.
resolveFieldExtraction()functionResolve field extraction flags into a validated configuration.
extractFieldFromResult()functionExtract a named field from a LAFS result object.
extractFieldFromEnvelope()functionExtract a named field from an envelope’s result.
applyFieldFilter()functionFilter result fields in a LAFS envelope to the requested subset.
resolveFlags()functionResolve all flags across both layers and validate cross-layer semantics.
LafsA2AResultclassWrapper for A2A responses with LAFS envelope support.
createLafsArtifact()functionCreate a LAFS envelope artifact for A2A.
createTextArtifact()functionCreate a text artifact.
createFileArtifact()functionCreate a file artifact.
isExtensionRequired()functionCheck if an extension is required in an Agent Card.
getExtensionParams()functionGet extension parameters from an Agent Card.
isValidTransition()functionCheck if a transition from one state to another is valid.
isTerminalState()functionCheck if a state is terminal (no further transitions allowed).
isInterruptedState()functionCheck if a state is interrupted (paused awaiting input).
InvalidStateTransitionErrorclassThrown when attempting an invalid state transition.
TaskImmutabilityErrorclassThrown when attempting to modify a task in a terminal state.
TaskNotFoundErrorclassThrown when a task is not found.
TaskRefinementErrorclassThrown when a refinement/follow-up task references invalid parent tasks.
TaskManagerclassIn-memory task manager implementing A2A task lifecycle.
attachLafsEnvelope()functionAttach a LAFS envelope as an artifact to an A2A task.
TaskEventBusclassIn-memory event bus for task lifecycle streaming events.
streamTaskEvents()functionBuild an async iterator for real-time task stream events.
PushNotificationConfigStoreclassIn-memory manager for async push-notification configs.
PushNotificationDispatcherclassDeliver task updates to registered push-notification webhooks.
TaskArtifactAssemblerclassApplies append/lastChunk artifact deltas into task-local snapshots.
createJsonRpcRequest()functionCreate a JSON-RPC 2.0 request object.
createJsonRpcResponse()functionCreate a JSON-RPC 2.0 success response.
createJsonRpcErrorResponse()functionCreate a JSON-RPC 2.0 error response.
createA2AErrorResponse()functionCreate an A2A-specific JSON-RPC error response by error type name.
validateJsonRpcRequest()functionValidate the structure of a JSON-RPC request.
isA2AError()functionCheck if a numeric error code is an A2A-specific error.
createGrpcStatus()functionCreate a gRPC Status object for an A2A error type.
createProblemDetails()functionCreate an RFC 9457 Problem Details object for an A2A error.
createLafsProblemDetails()functionCreate an RFC 9457 Problem Details object bridging A2A error types with LAFS…
buildUrl()functionBuild a URL by substituting path parameters.
parseListTasksQuery()functionParse camelCase query parameters for the ListTasks endpoint.
getErrorCodeMapping()functionGet the complete error code mapping for a given A2A error type.
parseA2AVersionHeader()functionParse the a2a-version header into an array of version strings.
negotiateA2AVersion()functionNegotiate an A2A protocol version from the client’s requested versions.
CircuitBreakerErrorclassError thrown when a circuit breaker rejects a call.
CircuitBreakerclassCircuit breaker for protecting against cascading failures.
CircuitBreakerRegistryclassRegistry for managing multiple named circuit breakers.
circuitBreakerMiddleware()functionCreate an Express middleware that wraps downstream handlers with a circuit br…
healthCheck()functionHealth check middleware for Express applications.
createDatabaseHealthCheck()functionCreate a health check function that verifies database connectivity.
createExternalServiceHealthCheck()functionCreate a health check function that probes an external HTTP service.
livenessProbe()functionLiveness probe — a minimal check confirming the process is running.
readinessProbe()functionReadiness probe — verifies the service can accept traffic.
projectEnvelope()functionProject an envelope to the declared MVI verbosity level.
estimateProjectedTokens()functionEstimate token count for a projected envelope.
lafsErrorToProblemDetails()functionConvert a LAFSError to an RFC 9457 Problem Details object.
gracefulShutdown()functionEnable graceful shutdown for an HTTP server.
isShuttingDown()functionCheck whether a shutdown sequence is currently in progress.
getShutdownState()functionGet a snapshot of the current shutdown state.
forceShutdown()functionTerminate the process immediately without waiting for connections to drain.
shutdownMiddleware()functionExpress middleware that rejects requests with 503 while the server is shuttin…
waitForShutdown()functionWait until a shutdown sequence begins.

Types & Interfaces

SymbolKindDescription
LafsExtensionParamsinterfaceLAFS extension parameters declared in Agent Card
ExtensionKindtypeClassification of an A2A extension’s behavior.
ExtensionNegotiationResultinterfaceResult of extension negotiation between client and agent
BuildLafsExtensionOptionsinterfaceOptions for building the LAFS extension declaration
BuildExtensionOptionsinterfaceOptions for building a generic A2A extension declaration
ExtensionNegotiationMiddlewareOptionsinterfaceOptions for the extension negotiation middleware
AgentProviderinterfaceA2A Agent Provider information.
AgentCapabilitiesinterfaceA2A Agent Capabilities.
AgentExtensioninterfaceA2A Agent Extension declaration.
AgentSkillinterfaceA2A Agent Skill.
SecuritySchemeinterfaceSecurity scheme for authentication (OpenAPI 3.0 style).
AgentCardinterfaceA2A v1.0 Agent Card - Standard format for agent discovery.
CapabilityinterfaceLegacy capability descriptor.
ServiceConfiginterfaceLegacy service configuration.
EndpointConfiginterfaceLegacy endpoint configuration.
DiscoveryDocumentinterfaceLegacy discovery document format.
DiscoveryConfiginterfaceConfiguration for the discovery middleware (A2A v1.0 format).
DiscoveryMiddlewareOptionsinterfaceDiscovery middleware options.
TokenEstimatorOptionsinterfaceConfiguration options for the token estimator.
LAFSTransporttypeTransport protocol used to deliver a LAFS envelope.
LAFSErrorCategorytypeClassification category for a LAFS error.
WarninginterfaceA non-fatal warning attached to a LAFS envelope’s _meta.warnings array.
MVILeveltypeMinimum Viable Information level controlling envelope verbosity.
LAFSMetainterfaceMetadata block (_meta) embedded in every LAFS envelope.
LAFSAgentActiontypeRecommended action an LLM agent should take in response to an error.
LAFSErrorinterfaceStructured error payload returned in a failing LAFS envelope.
LAFSPageCursorinterfaceCursor-based pagination metadata.
LAFSPageOffsetinterfaceOffset-based pagination metadata.
LAFSPageNoneinterfaceSentinel pagination mode indicating no pagination is applied.
LAFSPagetypeDiscriminated union of all supported pagination modes.
ContextLedgerEntryinterfaceA single entry in the context ledger recording one state mutation.
ContextLedgerinterfaceAppend-only ledger tracking context mutations across agent interactions.
LAFSEnvelopeinterfaceTop-level LAFS response envelope wrapping every operation result.
FlagInputinterfaceInput parameters for resolving the output format via flag semantics.
ConformanceReportinterfaceResult of a LAFS conformance test run.
BudgetEnforcementOptionstypeOptions controlling token-budget enforcement behaviour.
TokenEstimateinterfaceToken-count estimate attached to a budget-aware envelope.
LAFSMetaWithBudgetinterfaceExtended metadata block that includes an optional token-budget estimate.
LAFSEnvelopeWithBudgetinterfaceLAFS envelope variant whose metadata includes token-budget estimates.
MiddlewareFunctiontypeMiddleware function that transforms a LAFS envelope.
NextFunctiontypeContinuation function passed to BudgetMiddleware to invoke the next middlew…
BudgetMiddlewaretypeMiddleware function for token-budget enforcement with chain delegation.
BudgetEnforcementResultinterfaceOutcome of running budget enforcement on a LAFS envelope.
ConformanceTiertypeNamed conformance tier indicating the breadth of checks applied.
ConformanceProfilesinterfaceSchema for the conformance-profiles JSON file.
RegistryCodeinterfaceA single entry in the LAFS error-code registry.
ErrorRegistryinterfaceTop-level shape of the LAFS error-registry JSON file.
TransportMappingtypeA transport-specific status value resolved from the error registry.
FlagResolutioninterfaceResult of resolving output format flags.
NativeValidationResultinterfaceShape of the validation result from the native binding.
StructuredValidationErrorinterfaceStructured representation of a single schema validation error.
EnvelopeValidationResultinterfaceResult of validating a value against the LAFS envelope JSON Schema.
EnvelopeConformanceOptionsinterfaceOptions for configuring envelope conformance checking.
ComplianceStagetypeIdentifies which stage of the compliance pipeline produced an issue.
ComplianceIssueinterfaceDescribes a single compliance failure detected during enforcement.
EnforceComplianceOptionsinterfaceOptions controlling which compliance stages are executed.
ComplianceResultinterfaceAggregated result of a full LAFS compliance run.
ComplianceMiddlewaretypeMiddleware signature for intercepting LAFS envelopes in a pipeline.
DeprecationEntryinterfaceA single deprecation rule in the registry.
CreateEnvelopeMetaInputinterfaceInput for constructing the _meta block of a LAFS envelope.
CreateEnvelopeSuccessInputinterfaceInput for creating a successful LAFS envelope.
CreateEnvelopeErrorInputinterfaceInput for creating a failing LAFS envelope.
CreateEnvelopeInputtypeDiscriminated union of success and error inputs for createEnvelope.
ParseLafsResponseOptionsinterfaceOptions for parseLafsResponse.
FieldExtractionInputinterfaceInput flags for the field extraction layer.
FieldExtractionResolutioninterfaceResolved field extraction configuration.
UnifiedFlagInputinterfaceCombined input for both format and field extraction layers.
UnifiedFlagResolutioninterfaceCombined resolution result with cross-layer warnings.
LafsA2AConfiginterfaceConfiguration for LAFS A2A integration.
LafsSendMessageParamsinterfaceRequest parameters for sending messages.
CreateTaskOptionsinterfaceOptions for creating a new task
ListTasksOptionsinterfaceOptions for listing tasks
ListTasksResultinterfacePaginated result from listTasks
TaskStreamEventtypeUnion type of task stream events emitted by the event bus.
StreamIteratorOptionsinterfaceOptions for the stream task events async iterator
PushNotificationDeliveryResultinterfaceResult of delivering a push notification to a single webhook
PushTransporttypeTransport function for sending HTTP requests to push-notification webhooks.
JsonRpcMethodtypeUnion of all valid JSON-RPC method string values from JSONRPC_METHODS
A2AErrorTypetypeUnion of A2A error type key names from JSONRPC_A2A_ERROR_CODES
JsonRpcRequestinterfaceA JSON-RPC 2.0 request object.
JsonRpcResponseinterfaceA JSON-RPC 2.0 success response object.
JsonRpcErrorResponseinterfaceA JSON-RPC 2.0 error response object.
GrpcStatusCodetypeNumeric gRPC status code value (0-16)
GrpcStatusNametypeString name of a gRPC status code (e.g. "OK", "NOT_FOUND")
GrpcServiceMethodinterfaceDescriptor for a single gRPC service method.
GrpcStatusinterfacegRPC Status object for A2A errors.
GrpcErrorInfointerfaceEquivalent of google.rpc.ErrorInfo for structured gRPC error details.
HttpEndpointtypeUnion of all HTTP endpoint descriptor objects from HTTP_ENDPOINTS
ProblemDetailsinterfaceRFC 9457 Problem Details object.
ListTasksQueryParamsinterfaceParsed query parameters for the ListTasks endpoint.
ErrorCodeMappinginterfaceComplete error code mapping across all three transports.
CircuitStatetypeRepresents the three possible states of a circuit breaker.
CircuitBreakerConfiginterfaceConfiguration options for a CircuitBreaker instance.
CircuitBreakerMetricsinterfaceSnapshot of runtime metrics for a CircuitBreaker.
HealthCheckConfiginterfaceConfiguration for the healthCheck middleware.
HealthCheckFunctiontypeA function that performs a single health check.
HealthCheckResultinterfaceResult of an individual health check.
HealthStatusinterfaceAggregated health status returned by the health endpoint.
LafsProblemDetailsinterfaceRFC 9457 Problem Details with LAFS extensions.
GracefulShutdownConfiginterfaceConfiguration for the gracefulShutdown handler.
ShutdownStateinterfaceSnapshot of the current shutdown state.

Other Exports

SymbolKindDescription
LAFS_EXTENSION_URIvariableCanonical LAFS extension URI
A2A_EXTENSIONS_HEADERvariableCanonical A2A Extensions header per spec Section 3.2.6
extensions.tsfile
discovery.tsfile
discovery-server.tsfile
defaultEstimatorvariableGlobal token estimator instance with default settings.
tokenEstimator.tsfile
MVI_LEVELSvariableImmutable set of all valid MVILevel values.
AGENT_ACTIONSvariableImmutable set of all valid LAFSAgentAction values.
types.tsfile
budgetEnforcement.tsfile
conformance-profiles.jsonfile
conformanceProfiles.tsfile
error-registry.jsonfile
errorRegistry.tsfile
flagSemantics.tsfile
native-loader.tsfile
validateEnvelope.tsfile
conformance.tsfile
cli.tsfile
compliance.tsfile
deprecationRegistry.tsfile
LAFS_SCHEMA_URLvariableCanonical JSON Schema URL for the LAFS v1 envelope.
CATEGORY_ACTION_MAPvariableDefault agent action for each error category.
envelope.tsfile
fieldExtraction.tsfile
flagResolver.tsfile
bridge.tsfile
TERMINAL_STATESvariableStates from which no further transitions are possible
INTERRUPTED_STATESvariableStates where the task is paused awaiting external input
VALID_TRANSITIONSvariableValid state transitions (adjacency map). Terminal states have empty outgoing…
task-lifecycle.tsfile
streaming.tsfile
JSONRPC_METHODSvariableAll JSON-RPC method names defined by the A2A protocol.
JSONRPC_STANDARD_ERROR_CODESvariableStandard JSON-RPC 2.0 error codes.
JSONRPC_A2A_ERROR_CODESvariableA2A-specific error codes (-32001 through -32009).
jsonrpc.tsfile
GRPC_STATUS_CODEvariableStandard gRPC status codes (numeric values 0-16).
A2A_GRPC_STATUS_CODESvariableMaps A2A error types to gRPC status names.
A2A_GRPC_ERROR_REASONSvariableUPPER_SNAKE_CASE error reasons without “Error” suffix.
A2A_GRPC_ERROR_DOMAINvariableError domain for A2A gRPC errors.
GRPC_SERVICE_METHODSvariablegRPC service method definitions for the A2A protocol.
GRPC_METADATA_VERSION_KEYvariablegRPC metadata key for A2A protocol version.
GRPC_METADATA_EXTENSIONS_KEYvariablegRPC metadata key for activated A2A extensions.
grpc.tsfile
HTTP_ENDPOINTSvariableHTTP+JSON endpoint definitions for each A2A operation.
A2A_HTTP_STATUS_CODESvariableMaps A2A error types to HTTP status codes.
A2A_ERROR_TYPE_URISvariableRFC 9457 Problem Details type URIs for A2A errors.
http.tsfile
A2A_ERROR_MAPPINGSvariablePrecomputed cross-binding error mapping for all 9 A2A error types.
SUPPORTED_A2A_VERSIONSvariableSupported A2A protocol versions.
DEFAULT_A2A_VERSIONvariableDefault A2A protocol version used when none is requested.
index.tsfileA2A Protocol Bindings - Barrel Export Re-exports all binding modules and pro…
index.tsfile
index.tsfile
index.tsfileLAFS Health Check Module Provides health check endpoints for monitoring and…
mviProjection.tsfile
PROBLEM_DETAILS_CONTENT_TYPEvariableContent-Type for RFC 9457 Problem Details responses.
problemDetails.tsfile
index.tsfileLAFS Graceful Shutdown Module Handles graceful shutdown of LAFS servers.
index.tsfile
a2aBridge.test.tsfile
agentAction.test.tsfile
bindings.test.tsfile
budgetEnforcement.test.tsfile
compliance.test.tsfile
conformanceProfiles.test.tsfile
deprecationMigration.test.tsfile
discovery.test.tsfile
envelope.test.tsfile
envelopeApi.test.tsfile
extensions.test.tsfile
fieldExtraction.test.tsfile
flag-resolver.test.tsfile
flags.test.tsfile
mviProjection.test.tsfile
problemDetails.test.tsfile
streamingAsync.test.tsfile
structuredValidation.test.tsfile
task-lifecycle.test.tsfile