workerd
Internal
Transport-level /invoke failure (never an author failure): unknown
interface/method, malformed message, bad capability table, or a missing
binding.
new InvokeError(
status,
code,
message
): InvokeError;
| Parameter | Type |
|---|---|
status |
number |
code |
string |
message |
string |
readonly code: string;
Known PluginErrorCode wire string, or unknown.
readonly details: Readonly<Record<string, unknown>> | undefined;
Structured detail object from the wire (details JSON), when the error carries one.
readonly status: number;
HTTP status the bridge answers with.
readonly wireCode: string;
Raw wire code, including codes this SDK does not know.
get detailsText(): string;
details as the JSON text the wire carries.
string
JSON object text, or an empty string when the error has none.
get limit(): LimitExceeded | undefined;
The exceeded cap when this is a limit_exceeded error.
LimitExceeded | undefined
The cap from details first, then from the canonical message;
undefined for every other code.
static fromWire(
code,
message,
details?
): PluginError;
Construct a PluginError from a Cap'n Proto / JSON wire code.
Unknown codes become unknown on PluginError.code while
PluginError.wireCode keeps the raw value.
| Parameter | Type | Default value | Description |
|---|---|---|---|
code |
string |
undefined |
Wire error code (known or unknown). |
message |
string |
undefined |
Operator-facing error text. |
details? |
string |
"" |
details JSON text from the wire (empty when none). |
Typed plugin error.
static limitExceeded(limit): PluginError;
Builds a limit_exceeded error whose message and details both carry
the exceeded cap.
| Parameter | Type | Description |
|---|---|---|
limit |
LimitExceeded |
Exceeded cap. |
Typed plugin error.
Internal
One X-Bookclerk-Caps entry: capability index i of the message is
described by entry i.
binding?: string;
Binding name for guestDatabase.
id?: string;
Isolate object id for adapterSession.
kind: string;
source / destination / progress / cancellation / … / adapterSession.
token?: string;
Grant token for host-served kinds.
Internal
Transport-level /invoke failure as a plain value (Workers RPC drops own
properties of thrown errors, so the adapter returns this instead of
throwing across the service binding).
error: object;
JSON error body.
code: string;
message: string;
status: number;
HTTP status the bridge answers with (400 / 404 / 500).
Internal
Adapter hooks the dispatcher calls back into.
author(): AuthorStub | undefined;
Default author entrypoint (PLUGIN), or undefined when unbound.
AuthorStub | undefined
bindContext(ctx): GrantedContext;
Bridge context → author-facing granted context.
| Parameter | Type |
|---|---|
ctx |
BridgeContext | undefined |
importCap(descriptor, stop): unknown;
Resolve one request capability descriptor; undefined for an unknown
kind. stop aborts when the call returns.
| Parameter | Type |
|---|---|
descriptor |
CapDescriptor |
stop |
AbortSignal |
unknown
named(name): NamedStub | undefined;
Named author entrypoint, or undefined when the isolate does not export it.
| Parameter | Type |
|---|---|
name |
EntrypointName |
NamedStub | undefined
Internal
Successful /invoke reply: $Results bytes plus the descriptors of
capabilities the reply exported.
body: Uint8Array;
Unpacked single-segment Cap'n message (<Interface>.<method>$Results).
caps: CapDescriptor[];
Reply capability table (X-Bookclerk-Caps on the response).
type InvokeOutcome = InvokeReply | InvokeFailure;
Internal
What the adapter's invoke resolves to.
function dispatchInvoke(
iface,
method,
context,
caps,
target,
body,
host
): Promise<InvokeReply>;
Internal
Dispatch one /invoke call.
| Parameter | Type | Description |
|---|---|---|
iface |
string |
Cap'n interface name (X-Bookclerk-Interface). |
method |
string |
Method name (X-Bookclerk-Method). |
context |
BridgeContext | undefined |
Decoded bridge context, or undefined for PluginWorker.*. |
caps |
CapDescriptor[] |
Request capability descriptors (X-Bookclerk-Caps). |
target |
string | null |
Isolate object id (X-Bookclerk-Target), or null. |
body |
Uint8Array |
$Params message bytes. |
host |
InvokeHost |
Adapter hooks. |
Promise<InvokeReply>
$Results bytes plus reply capability descriptors.
On transport-level failures (400 / 404 / 500).
Re-exports Abridgement
Re-exports AdapterBatchOptions
Re-exports AdapterBatchRequest
Re-exports AdapterBatchStatement
Re-exports AdapterBatchStreamedOptions
Re-exports AdapterDatabaseSession
Re-exports AdapterEnv
Re-exports AdapterTransaction
Re-exports AiBinding
Re-exports AiEmbedText
Re-exports AiEntrypoint
Re-exports AiInput
Re-exports AiModel
Re-exports AiModelList
Re-exports AiOutput
Re-exports AiRunOk
Re-exports AiRunParams
Re-exports AiTask
Re-exports AiTextEmbeddingsInput
Re-exports AiTextEmbeddingsOutput
Re-exports AiTextEmbeddingsRequest
Re-exports AiTextEmbeddingsResponse
Re-exports AiTextRole
Re-exports allowedEntrypointFamilies
Re-exports AtomicTransport
Re-exports AuthenticateUserParams
Re-exports BookclerkEntrypoint
Re-exports BookclerkEnv
Re-exports canonicalExecuteRequestHash
Re-exports ChangesPage
Re-exports ChangesRequest
Re-exports Checkpoint
Re-exports chunkIndexes
Re-exports cliArgs
Re-exports CliEntrypoint
Re-exports CliInvokeParams
Re-exports CliInvokeResult
Re-exports CliSchema
Re-exports collectExecuteStream
Re-exports CopyResult
Re-exports CoverEntrypoint
Re-exports CoverFetchParams
Re-exports CoverImage
Re-exports CoverImages
Re-exports createDatabaseBinding
Re-exports Credit
Re-exports CreditLevel
Re-exports CreditRole
Re-exports D1ExecResult
Re-exports D1Meta
Re-exports D1Result
Re-exports DatabaseAdapterEntrypoint
Re-exports DatabaseBinding
Re-exports DatabaseBindingOptions
Re-exports dataMigrationOp
Re-exports DbColumn
Re-exports DbResultSelection
Re-exports DbRow
Re-exports DbStatementKind
Re-exports DbTiming
Re-exports DbType
Re-exports DbValue
Re-exports decodeDbValue
Re-exports decodeExecuteRequest
Re-exports decodeExecuteResultReply
Re-exports decodeExecuteStream
Re-exports decodeExtensibleConfig
Re-exports DeliveredCheckpoint
Re-exports Destination
Re-exports DomainEvent
Re-exports encodeDbValue
Re-exports encodeExecuteRequest
Re-exports encodeExecuteResultReply
Re-exports encodeExecuteStream
Re-exports ENTRYPOINT_BINDINGS
Re-exports ENTRYPOINT_CLASSES
Re-exports EntrypointName
Re-exports EventBatch
Re-exports eventBatchResults
Re-exports EventMessage
Re-exports EventOutcome
Re-exports EventPublisherBinding
Re-exports EventReadOptions
Re-exports EventSuspendOptions
Re-exports executeAdapterBatch
Re-exports executeAdapterBatchStreamed
Re-exports ExecuteReply
Re-exports executeReplyToD1Results
Re-exports ExecuteRequest
Re-exports ExecuteStreamDecoder
Re-exports executeStreamLimits
Re-exports ExecuteStreamLimits
Re-exports ExpressionKind
Re-exports ExtensibleConfig
Re-exports ExternalUser
Re-exports FEATURE_SCALAR_LIMITS
Re-exports FEATURE_STORAGE_CHANGES
Re-exports FEATURE_STORAGE_CONDITIONAL_WRITE
Re-exports FEATURE_STORAGE_COPY
Re-exports FEATURE_STORAGE_DELETE_MANY
Re-exports FEATURE_STORAGE_HEAD_MANY
Re-exports FEATURE_STORAGE_MOVE
Re-exports FEATURE_STORAGE_MOVE_MANY
Re-exports FEATURE_STREAMS
Re-exports FetchStorePage
Re-exports fromBridgeJson
Re-exports GrantedContext
Re-exports GrantedDatabaseTransport
Re-exports GUEST_READ_ONLY_REPLAY_PAYLOAD
Re-exports GUEST_RECEIPT_CLAIM_LOST
Re-exports GUEST_RECEIPT_RESULT_LOST
Re-exports GUEST_RECEIPT_STUB_SUFFIX
Re-exports GUEST_RECEIPT_WRAP_PREFIX
Re-exports GUEST_REPLAY_PAYLOAD_MAX_BYTES
Re-exports guestBatchIsReadOnly
Re-exports guestReceiptFinalizeStatements
Re-exports guestReplayPayload
Re-exports HealthOk
Re-exports HostWebSocket
Re-exports Identifier
Re-exports IdentifierScheme
Re-exports IngressEntrypoint
Re-exports Instant
Re-exports Invocation
Re-exports invocationOf
Re-exports JobCheckpoint
Re-exports JobCompletion
Re-exports JobController
Re-exports JobInvocation
Re-exports jobOutcomeFor
Re-exports JobOutcomeRecord
Re-exports JobRetryOptions
Re-exports JobRunnerContext
Re-exports JobSuspendOptions
Re-exports JsonObject
Re-exports jsonPayload
Re-exports KeyOutcome
Re-exports KvListKeyBinding
Re-exports KvListOptionsBinding
Re-exports KvListResultBinding
Re-exports KvNamespaceBinding
Re-exports KvPutOptionsBinding
Re-exports KvValueType
Re-exports KvValueWithMetadata
Re-exports ListeningProgress
Re-exports ListOptions
Re-exports ListPage
Re-exports MAX_BATCH_KEYS
Re-exports MAX_CHANGES_CURSOR_BYTES
Re-exports MAX_CHANGES_PAGE
Re-exports MAX_CHECKPOINT_BYTES
Re-exports MAX_EVENT_PAYLOAD_BYTES
Re-exports MAX_LIST_PAGE
Re-exports MAX_PLUGIN_MIGRATION_OPS
Re-exports MAX_PLUGIN_MIGRATION_REGISTRATION_BYTES
Re-exports MAX_PLUGIN_MIGRATION_TOTAL_OPS
Re-exports MAX_SCALAR_BYTES
Re-exports MAX_STREAM_WINDOW_BYTES
Re-exports MAX_WRITE_KEY_BYTES
Re-exports MediaKind
Re-exports MetadataAudioFile
Re-exports MetadataChapter
Re-exports MetadataChapters
Re-exports MetadataChaptersParams
Re-exports MetadataEntrypoint
Re-exports MetadataField
Re-exports MetadataFileParseParams
Re-exports MetadataFileRecord
Re-exports MetadataFileRenderParams
Re-exports MetadataFilesEntrypoint
Re-exports MetadataLookupParams
Re-exports MetadataRecord
Re-exports MetadataSearchParams
Re-exports MoveManyPage
Re-exports MoveManyRequest
Re-exports MoveOptions
Re-exports MoveResult
Re-exports NamedDatabase
Re-exports NamedEntrypoint
Re-exports NamedKv
Re-exports NamedQueue
Re-exports NamedSockets
Re-exports NotificationAlertAction
Re-exports NotificationAudience
Re-exports NotificationField
Re-exports NotificationMessage
Re-exports NotificationSeverity
Re-exports NotifierEntrypoint
Re-exports NotifyBinding
Re-exports NotifyDestination
Re-exports NotifyDestinationKind
Re-exports NotifyRaise
Re-exports NotifyRaised
Re-exports NotifySendParams
Re-exports NotifySent
Re-exports NotifyValidated
Re-exports NotifyValidateParams
Re-exports ObjectChange
Re-exports ObjectInfo
Re-exports ObjectMetadata
Re-exports OidcClientTemplate
Re-exports OidcEntrypoint
Re-exports OriginBinding
Re-exports OriginFetchOptions
Re-exports OriginTransport
Re-exports OriginTransportReply
Re-exports OriginTransportResponse
Re-exports packEmbeddingVectors
Re-exports parseDbValue
Re-exports PluginCapabilities
Re-exports PluginDescribe
Re-exports PluginError
Re-exports PluginMigration
Re-exports PluginMigrationOp
Re-exports PreparedStatement
Re-exports PRODUCT_API_VERSION
Re-exports ProgressSink
Re-exports PublishEvent
Re-exports PutResult
Re-exports QueueBatch
Re-exports queueBatchResults
Re-exports QueueBinding
Re-exports QueueMessage
Re-exports QueueOutcome
Re-exports QueueRetryOptions
Re-exports QueueSendBatchEntry
Re-exports QueueSendOptions
Re-exports rawStreamCeiling
Re-exports ReadOptions
Re-exports ReadResult
Re-exports RemoteLibraryEntrypoint
Re-exports requirePluginMigrationRegistration
Re-exports RetryOptions
Re-exports RetryToken
Re-exports runAdapterBatch
Re-exports ScanLibraryParams
Re-exports scanPage
Re-exports schemaMigrationOp
Re-exports SeriesEntry
Re-exports shouldSkipRemainingGuestWork
Re-exports SocketAutoResponsePair
Re-exports SocketConnectOptions
Re-exports SocketMessageData
Re-exports SocketMessageOk
Re-exports SocketsBinding
Re-exports SocketSendData
Re-exports Source
Re-exports StatementResult
Re-exports statementResultToD1Result
Re-exports StorageBinding
Re-exports StorageEntrypoint
Re-exports StorefrontEntrypoint
Re-exports StorePage
Re-exports STREAM_FRAME_TARGET_BYTES
Re-exports streamsResults
Re-exports toBridgeJson
Re-exports TRIGGER_FAMILIES
Re-exports TypedDbStatement
Re-exports unpackEmbeddingVectors
Re-exports WebhookDeliveredEvent
Re-exports WebhookMessage
Re-exports WebhookPullOptions
Re-exports WebhookPullResult
Re-exports WebhooksBinding
Re-exports WireQueueBatch
Re-exports WorkKind
Re-exports wrapPluginFromBinding
Re-exports wrapPluginFromNative
Re-exports WriteChunksError
Re-exports writeChunksOperationId
Re-exports WriteChunksOptions
Re-exports WriteOptions
Re-exports WriteProgress
Generated from packages/plugin-sdk at main · View as Markdown